diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 01ce7296d3..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,1260 +0,0 @@ -version: 2.1 - -orbs: - codecov: codecov/codecov@3.2.0 - -workflows: - test: - # Keep those job names in sync with .mergify.yml - jobs: - - arm64 - - package_crypto - - package_check - - package_schema - - package_schema_derive - - package_std - - package_storage - - package_vm - - contract_burner - - contract_crypto_verify - - contract_cyberpunk - - contract_hackatom - - contract_ibc_reflect - - contract_ibc_reflect_send - - contract_floaty - - contract_queue - - contract_reflect - - contract_staking - - fmt - - fmt_extra - - clippy: - matrix: - parameters: - # Run with MSRV and some modern stable Rust - rust-version: ["1.59.0", "1.65.0"] - - benchmarking: - requires: - - package_vm - - package_crypto - filters: - branches: - only: - # Long living branches - - main - - /^[0-9]+\.[0-9]+$/ - # Add your branch here if benchmarking matters to your work - - benchmarking - - update-wasmer - - metering-restart - - load-wasm-speed - - cache-analyze - - fix-benches - - benchmark_argon2 - - get_instance-multi-threaded-benchmark-multi-contract - - coverage - deploy: - jobs: - - build_and_upload_devcontracts: - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/ - branches: - ignore: /.*/ - cron_jobs: - triggers: - - schedule: - cron: "0 0 * * *" - filters: - branches: - only: - - main - jobs: - - deadlinks - -jobs: - arm64: - machine: - image: ubuntu-2004:202101-01 - resource_class: arm.large - steps: - - checkout - - run: - name: Install Rust - command: | - wget https://static.rust-lang.org/rustup/dist/aarch64-unknown-linux-gnu/rustup-init - chmod +x rustup-init - ./rustup-init -y --default-toolchain 1.59.0 --profile minimal - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-arm64-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: "contracts/crypto-verify: integration-test" - working_directory: ~/project/contracts/crypto-verify - command: cargo wasm --locked && cargo integration-test --locked - - run: - name: "contracts/hackatom: integration-test" - working_directory: ~/project/contracts/hackatom - command: cargo wasm --locked && cargo integration-test --locked - - run: - name: "contracts/queue: integration-test" - working_directory: ~/project/contracts/queue - command: cargo wasm --locked && cargo integration-test --locked - - run: - name: "contracts/reflect: integration-test" - working_directory: ~/project/contracts/reflect - command: cargo wasm --locked && cargo integration-test --locked - - run: - name: "contracts/staking: integration-test" - working_directory: ~/project/contracts/staking - command: cargo wasm --locked && cargo integration-test --locked - - run: - name: "packages/crypto: test" - working_directory: ~/project/packages/crypto - command: cargo test --locked - - run: - name: "packages/std: test" - working_directory: ~/project/packages/std - command: cargo test --locked - - run: - name: "packages/vm: test" - working_directory: ~/project/packages/vm - # use all features - command: cargo test --locked --features iterator,staking,stargate - - save_cache: - paths: - - ~/.cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-arm64-rust:1.59.0-{{ checksum "Cargo.lock" }} - - package_crypto: - docker: - - image: rust:1.59.0 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-package_crypto-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Build - working_directory: ~/project/packages/crypto - command: cargo build --locked - - run: - name: Run tests - working_directory: ~/project/packages/crypto - command: cargo test --locked - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-package_crypto-rust:1.59.0-{{ checksum "Cargo.lock" }} - - package_check: - docker: - - image: rust:1.59.0 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-package_check-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Build - working_directory: ~/project/packages/check - command: cargo build --locked - - run: - name: Run tests - working_directory: ~/project/packages/check - command: cargo test --locked - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-package_check-rust:1.59.0-{{ checksum "Cargo.lock" }} - - package_schema: - docker: - - image: rust:1.59.0 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-package_schema-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Build - working_directory: ~/project/packages/schema - command: cargo build --locked - - run: - name: Run tests - working_directory: ~/project/packages/schema - command: cargo test --locked - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-package_schema-rust:1.59.0-{{ checksum "Cargo.lock" }} - - package_schema_derive: - docker: - - image: rust:1.59.0 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-package_schema_derive-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Build - working_directory: ~/project/packages/schema-derive - command: cargo build --locked - - run: - name: Run tests - working_directory: ~/project/packages/schema-derive - command: cargo test --locked - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-package_schema_derive-rust:1.59.0-{{ checksum "Cargo.lock" }} - - package_std: - docker: - - image: rust:1.59.0 - environment: - # Limit the number of parallel jobs to avoid OOM crashes during doc testing - RUST_TEST_THREADS: 8 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-package_std-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build library for native target (no features) - working_directory: ~/project/packages/std - command: cargo build --locked --no-default-features - - run: - name: Build library for wasm target (no features) - working_directory: ~/project/packages/std - command: cargo wasm --locked --no-default-features - - run: - name: Run unit tests (no features) - working_directory: ~/project/packages/std - command: cargo test --locked --no-default-features - - run: - name: Build library for native target (all features) - working_directory: ~/project/packages/std - command: cargo build --locked --features abort,iterator,staking,stargate,cosmwasm_1_1 - - run: - name: Build library for wasm target (all features) - working_directory: ~/project/packages/std - command: cargo wasm --locked --features abort,iterator,staking,stargate,cosmwasm_1_1 - - run: - name: Run unit tests (all features) - working_directory: ~/project/packages/std - command: cargo test --locked --features abort,iterator,staking,stargate,cosmwasm_1_1 - - run: - name: Build and run schema generator - working_directory: ~/project/packages/std - command: cargo schema --features cosmwasm_1_1 --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-package_std-rust:1.59.0-{{ checksum "Cargo.lock" }} - - package_storage: - docker: - - image: rust:1.59.0 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-package_storage-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Build library for native target - working_directory: ~/project/packages/storage - command: cargo build --locked - - run: - name: Run unit tests - working_directory: ~/project/packages/storage - command: cargo test --locked - - run: - name: Run unit tests (with iterator support) - working_directory: ~/project/packages/storage - command: cargo test --locked --features iterator - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-package_storage-rust:1.59.0-{{ checksum "Cargo.lock" }} - - package_vm: - docker: - - image: rust:1.59.0 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-package_vm-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Build - working_directory: ~/project/packages/vm - command: cargo build --locked - - run: - name: Build with all features - working_directory: ~/project/packages/vm - command: cargo build --locked --features allow_interface_version_7,iterator,staking,stargate - - run: - name: Test - working_directory: ~/project/packages/vm - command: cargo test --locked - - run: - name: Test with all features - working_directory: ~/project/packages/vm - command: cargo test --locked --features allow_interface_version_7,iterator,staking,stargate - - run: - name: Test multi threaded cache - working_directory: ~/project/packages/vm - command: | - cargo build --locked --example multi_threaded_cache - time ../../target/debug/examples/multi_threaded_cache >/dev/null - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-package_vm-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_burner: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/burner - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_burner-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_burner-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_crypto_verify: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/crypto-verify - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_crypto_verify-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_crypto_verify-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_cyberpunk: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/cyberpunk - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_cyberpunk-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_cyberpunk-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_hackatom: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/hackatom - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_hackatom-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests - command: cargo integration-test --locked - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_hackatom-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_ibc_reflect: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/ibc-reflect - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_ibc_reflect-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_ibc_reflect-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_ibc_reflect_send: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/ibc-reflect-send - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_ibc_reflect_send-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_ibc_reflect_send-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_floaty: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/floaty - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_floaty-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_floaty-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_queue: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/queue - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_queue-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_queue-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_reflect: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/reflect - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_reflect-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_reflect-rust:1.59.0-{{ checksum "Cargo.lock" }} - - contract_staking: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - working_directory: ~/cosmwasm/contracts/staking - steps: - - checkout: - path: ~/cosmwasm - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version - - restore_cache: - keys: - - cargocache-v2-contract_staking-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add wasm32 target - command: rustup target add wasm32-unknown-unknown && rustup target list --installed - - run: - name: Build wasm binary - command: cargo wasm --locked - - run: - name: Unit tests - command: cargo unit-test --locked - - run: - name: Integration tests (singlepass backend) - command: cargo integration-test --locked --no-default-features - - run: - name: Build and run schema generator - command: cargo schema --locked - - run: - name: Ensure schemas are up-to-date - command: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/wasm32-unknown-unknown/release/.fingerprint - - target/wasm32-unknown-unknown/release/build - - target/wasm32-unknown-unknown/release/deps - key: cargocache-v2-contract_staking-rust:1.59.0-{{ checksum "Cargo.lock" }} - - fmt: - docker: - - image: rust:1.59.0 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-fmt-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Add rustfmt component - command: rustup component add rustfmt - - run: - name: Check formatting of workspace - command: cargo fmt -- --check - - run: - name: Check formatting of contract burner - working_directory: ~/project/contracts/burner - command: cargo fmt -- --check - - run: - name: Check formatting of contract crypto-verify - working_directory: ~/project/contracts/crypto-verify - command: cargo fmt -- --check - - run: - name: Check formatting of contract hackatom - working_directory: ~/project/contracts/hackatom - command: cargo fmt -- --check - - run: - name: Check formatting of contract floaty - working_directory: ~/project/contracts/floaty - command: cargo fmt -- --check - - run: - name: Check formatting of contract reflect - working_directory: ~/project/contracts/reflect - command: cargo fmt -- --check - - run: - name: Check formatting of contract queue - working_directory: ~/project/contracts/queue - command: cargo fmt -- --check - - run: - name: Check formatting of contract staking - working_directory: ~/project/contracts/staking - command: cargo fmt -- --check - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - key: cargocache-v2-fmt-rust:1.59.0-{{ checksum "Cargo.lock" }} - - fmt_extra: - docker: - - image: node:16.3.0-buster - steps: - - checkout - - run: - name: Install shfmt - command: curl -sS https://webinstall.dev/shfmt | bash - - run: - name: Validate Markdown files - command: devtools/format_md.sh -c - - run: - name: Validate shell scripts - command: PATH="/root/.local/bin:$PATH" devtools/format_sh.sh -c - - run: - name: Validate YAML files - command: devtools/format_yml.sh -c - - deadlinks: - docker: - - image: rust:1.59.0 - steps: - - checkout - - run: - name: Version information - command: rustc --version; cargo --version; rustup --version; rustup target list --installed - - restore_cache: - keys: - - cargocache-v2-deadlinks-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Generate docs - command: cargo doc - - run: - name: Install pip - command: apt update && apt install -y python3-pip - - run: - name: Install dependencies - command: pip3 install requests bs4 - - run: - name: Check dead links - command: devtools/deadlinks.py - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - /root/.cache/pip - key: cargocache-v2-deadlinks-rust:1.59.0-{{ checksum "Cargo.lock" }} - - clippy: - parameters: - rust-version: - type: string - docker: - # In this job we use the latest Rust stable in order to check against the - # most recent code style recommendations. - - image: rust:<< parameters.rust-version >> - steps: - - checkout - - run: - name: Version information - command: rustc --version && cargo --version - - restore_cache: - keys: - - cargocache-v2-clippy-rust:<< parameters.rust-version >>-{{ checksum "Cargo.lock" }}-{{ checksum "contracts/burner/Cargo.lock" }}-{{ checksum "contracts/crypto-verify/Cargo.lock" }}-{{ checksum "contracts/hackatom/Cargo.lock" }}-{{ checksum "contracts/ibc-reflect/Cargo.lock" }}-{{ checksum "contracts/ibc-reflect-send/Cargo.lock" }}-{{ checksum "contracts/queue/Cargo.lock" }}-{{ checksum "contracts/reflect/Cargo.lock" }}-{{ checksum "contracts/staking/Cargo.lock" }} - - run: - name: Add clippy component - command: rustup component add clippy - # - # Workspace packages - # - - run: - name: Clippy linting on crypto - working_directory: ~/project/packages/crypto - command: cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on derive - working_directory: ~/project/packages/derive - command: cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on schema - working_directory: ~/project/packages/schema - command: cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on schema-derive - working_directory: ~/project/packages/schema-derive - command: cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on std (no feature flags) - working_directory: ~/project/packages/std - command: cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on std (all feature flags) - working_directory: ~/project/packages/std - command: cargo clippy --all-targets --features abort,iterator,staking,stargate -- -D warnings - - run: - name: Clippy linting on storage (no feature flags) - working_directory: ~/project/packages/storage - command: cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on storage (all feature flags) - working_directory: ~/project/packages/storage - command: cargo clippy --all-targets --features iterator -- -D warnings - - run: - name: Clippy linting on vm (no feature flags) - working_directory: ~/project/packages/vm - command: cargo clippy --all-targets --no-default-features -- -D warnings - - run: - name: Clippy linting on vm (all feature flags) - working_directory: ~/project/packages/vm - command: cargo clippy --all-targets --features iterator,staking,stargate -- -D warnings - # - # Contracts - # - - run: - name: Clippy linting on burner - working_directory: ~/project/contracts/burner - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/burner.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on crypto-verify - working_directory: ~/project/contracts/crypto-verify - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/crypto_verify.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on cyberpunk - working_directory: ~/project/contracts/cyberpunk - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/cyberpunk.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on hackatom - working_directory: ~/project/contracts/hackatom - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/hackatom.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on ibc-reflect - working_directory: ~/project/contracts/ibc-reflect - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/ibc_reflect.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on ibc-reflect-send - working_directory: ~/project/contracts/ibc-reflect-send - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/ibc_reflect_send.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on floaty - working_directory: ~/project/contracts/floaty - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/floaty.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on queue - working_directory: ~/project/contracts/queue - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/queue.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on reflect - working_directory: ~/project/contracts/reflect - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/reflect.wasm - cargo clippy --all-targets -- -D warnings - - run: - name: Clippy linting on staking - working_directory: ~/project/contracts/staking - command: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/staking.wasm - cargo clippy --all-targets -- -D warnings - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - contracts/burner/target/debug/.fingerprint - - contracts/burner/target/debug/build - - contracts/burner/target/debug/deps - - contracts/crypto-verify/target/debug/.fingerprint - - contracts/crypto-verify/target/debug/build - - contracts/crypto-verify/target/debug/deps - - contracts/hackatom/target/debug/.fingerprint - - contracts/hackatom/target/debug/build - - contracts/hackatom/target/debug/deps - - contracts/ibc-reflect/target/debug/.fingerprint - - contracts/ibc-reflect/target/debug/build - - contracts/ibc-reflect/target/debug/deps - - contracts/ibc-reflect-send/target/debug/.fingerprint - - contracts/ibc-reflect-send/target/debug/build - - contracts/ibc-reflect-send/target/debug/deps - - contracts/queue/target/debug/.fingerprint - - contracts/queue/target/debug/build - - contracts/queue/target/debug/deps - - contracts/reflect/target/debug/.fingerprint - - contracts/reflect/target/debug/build - - contracts/reflect/target/debug/deps - - contracts/staking/target/debug/.fingerprint - - contracts/staking/target/debug/build - - contracts/staking/target/debug/deps - key: cargocache-v2-clippy-rust:<< parameters.rust-version >>-{{ checksum "Cargo.lock" }}-{{ checksum "contracts/burner/Cargo.lock" }}-{{ checksum "contracts/crypto-verify/Cargo.lock" }}-{{ checksum "contracts/hackatom/Cargo.lock" }}-{{ checksum "contracts/ibc-reflect/Cargo.lock" }}-{{ checksum "contracts/ibc-reflect-send/Cargo.lock" }}-{{ checksum "contracts/queue/Cargo.lock" }}-{{ checksum "contracts/reflect/Cargo.lock" }}-{{ checksum "contracts/staking/Cargo.lock" }} - - benchmarking: - docker: - - image: rust:1.59.0 - environment: - RUST_BACKTRACE: 1 - steps: - - checkout - - run: - name: Version information (default; stable) - command: rustc --version && cargo --version - - restore_cache: - keys: - - cargocache-v2-benchmarking-rust:1.59.0-{{ checksum "Cargo.lock" }} - - run: - name: Run vm benchmarks (Singlepass) - working_directory: ~/project/packages/vm - command: cargo bench --no-default-features -- --color never --save-baseline singlepass - - run: - name: Run crypto benchmarks - working_directory: ~/project/packages/crypto - command: cargo bench -- --color never --save-baseline crypto - - save_cache: - paths: - - /usr/local/cargo/registry - - target/debug/.fingerprint - - target/debug/build - - target/debug/deps - - target/release/.fingerprint - - target/release/build - - target/release/deps - key: cargocache-v2-benchmarking-rust:1.59.0-{{ checksum "Cargo.lock" }} - - coverage: - # https://circleci.com/developer/images?imageType=machine - machine: - image: ubuntu-2004:202201-02 - steps: - - checkout - - run: - name: Run tests with coverage - # See https://github.com/xd009642/tarpaulin/blob/develop/CHANGELOG.md and https://hub.docker.com/r/xd009642/tarpaulin/tags - # for tarpaulin versions. - command: | - mkdir -p reports/crypto - mkdir -p reports/derive - mkdir -p reports/schema - mkdir -p reports/std - mkdir -p reports/storage - docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.21.0 \ - sh -c "cargo tarpaulin --skip-clean --out Xml --output-dir reports/crypto --packages cosmwasm-crypto && cargo tarpaulin --skip-clean --out Xml --output-dir reports/derive --packages cosmwasm-derive && cargo tarpaulin --skip-clean --out Xml --output-dir reports/schema --packages cosmwasm-schema && cargo tarpaulin --skip-clean --out Xml --output-dir reports/std --packages cosmwasm-std && cargo tarpaulin --skip-clean --out Xml --output-dir reports/storage --packages cosmwasm-storage" - - codecov/upload: - file: reports/crypto/cobertura.xml - flags: cosmwasm-crypto - - codecov/upload: - file: reports/derive/cobertura.xml - flags: cosmwasm-derive - - codecov/upload: - file: reports/schema/cobertura.xml - flags: cosmwasm-schema - - codecov/upload: - file: reports/std/cobertura.xml - flags: cosmwasm-std - - codecov/upload: - file: reports/storage/cobertura.xml - flags: cosmwasm-storage - - # This job roughly follows the instructions from https://circleci.com/blog/publishing-to-github-releases-via-circleci/ - build_and_upload_devcontracts: - docker: - # Image from https://github.com/cibuilds/github, based on alpine - - image: cibuilds/github:0.13 - steps: - - run: - name: Install Docker client - command: apk add docker-cli - - setup_remote_docker - - checkout - - run: - # We cannot mount local folders, see https://circleci.com/docs/2.0/building-docker-images/#mounting-folders - name: Prepare volume with source code - command: | - # create a dummy container which will hold a volume with config - docker create -v /code --name with_code alpine /bin/true - # copy a config file into this volume - docker cp ./Cargo.lock with_code:/code - docker cp ./Cargo.toml with_code:/code - docker cp ./contracts with_code:/code - docker cp ./packages with_code:/code - - run: - name: Build development contracts - command: | - echo "Building all contracts under ./contracts" - docker run --volumes-from with_code cosmwasm/rust-optimizer:0.12.9 ./contracts/*/ - - run: - name: Check development contracts - command: | - echo "Checking all contracts under ./artifacts" - docker run --volumes-from with_code rust:1.59.0 \ - /bin/bash -e -c 'export GLOBIGNORE="artifacts/floaty.wasm"; cd ./code; cargo run --bin cosmwasm-check artifacts/*.wasm' - docker cp with_code:/code/artifacts . - - run: - name: Publish artifacts on GitHub - command: | - TAG="$CIRCLE_TAG" - TITLE="$TAG" - BODY="Attached there are some build artifacts generated at this tag. Those are for development purposes only! Please use crates.io to find the packages of this release." - ghr -t "$GITHUB_TOKEN" \ - -u "$CIRCLE_PROJECT_USERNAME" -r "$CIRCLE_PROJECT_REPONAME" \ - -c "$CIRCLE_SHA1" \ - -n "$TITLE" -b "$BODY" \ - -delete \ - "$TAG" ./artifacts/ diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 2c777280a4..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,14 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.rs] -indent_size = 4 - -[*.py] -indent_size = 4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index def0099f59..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Contract Development - -# Pushes to long living branches and all PRs -on: - push: - branches: - - main - - 0.[0-9]+ - pull_request: - -env: - RUST_BACKTRACE: 1 - -jobs: - test-hackatom: - name: ${{ matrix.build }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - build: macOS - os: macOS-latest - - build: Windows - os: windows-latest - defaults: - run: - shell: bash - working-directory: ./contracts/hackatom - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.59.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Build hackatom wasm - run: cargo wasm --locked - - name: Unit Test hackatom - run: cargo unit-test --locked - - name: Integration Test hackatom - run: cargo integration-test --locked diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml new file mode 100644 index 0000000000..f3b268cf87 --- /dev/null +++ b/.github/workflows/contracts.yml @@ -0,0 +1,336 @@ +name: contracts + +on: + push: + branches: [ "main" ] + pull_request: + +env: + TOOLCHAIN_STABLE: 1.82.0 # toolchain for building contracts in stable channel + TOOLCHAIN_NIGHTLY: nightly-2024-09-01 # toolchain for building contracts in nightly channel for version 1.82.0 + TOOLCHAIN_CHECK: 1.88.0 # toolchain for building cosmwasm-check tool + +jobs: + stable: + name: ${{ matrix.dir }}-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + dir: [ + burner, + crypto-verify, + cyberpunk, + empty, + hackatom, + ibc2, + ibc-callbacks, + ibc-reflect, + ibc-reflect-send, + nested-contracts, + queue, + reflect, + replier, + staking, + virus + ] + defaults: + run: + shell: bash + working-directory: contracts/${{ matrix.dir }} + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + targets: wasm32-unknown-unknown + components: clippy, rustfmt + + - name: Check formatting + run: cargo fmt -- --check + + - name: Run unit tests + run: cargo test --lib --locked + + - name: Build WASM binary + run: cargo build --release --lib --locked --target wasm32-unknown-unknown + + - name: Run linter + run: cargo clippy --all-targets --tests -- -D warnings + + - name: Run integration tests + run: cargo test --test integration --locked + + - name: Run schema generator + run: cargo run --bin schema --locked + + - name: Ensure schemas are up-to-date + run: git diff --quiet ./schema + + - name: Upload WASM binary + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.dir }}-${{ runner.os }} + path: ./contracts/${{ matrix.dir }}/target/wasm32-unknown-unknown/release/*.wasm + + nightly: + name: ${{ matrix.dir }}-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + dir: [ floaty ] + defaults: + run: + shell: bash + working-directory: ./contracts/${{ matrix.dir }} + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust for compiling contracts + uses: dtolnay/rust-toolchain@nightly + with: + toolchain: ${{ env.TOOLCHAIN_NIGHTLY }} + targets: wasm32-unknown-unknown + components: clippy, rustfmt + + - name: Check formatting + run: cargo fmt -- --check + + - name: Run unit tests + run: cargo test --lib --locked + + - name: Build WASM binary + run: RUSTFLAGS="-C target-feature=+nontrapping-fptoint" cargo build --release --lib --locked --target wasm32-unknown-unknown + + - name: Run linter + run: cargo clippy --all-targets --tests -- -D warnings + + - name: Run integration tests + run: cargo test --test integration --locked + + - name: Run schema generator + run: cargo run --bin schema --locked + + - name: Ensure schemas are up-to-date + run: git diff --quiet ./schema + + - name: Upload WASM binary + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.dir }}-${{ runner.os }} + path: ./contracts/${{ matrix.dir }}/target/wasm32-unknown-unknown/release/*.wasm + + chkr: + name: check-rel-${{ matrix.os }} + runs-on: ${{ matrix.os }} + needs: [ stable, nightly ] + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust for compiling cosmwasm-check + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_CHECK }} + + - name: Install recently released cosmwasm-check + run: cargo install cosmwasm-check@3.0.2 + + - uses: actions/download-artifact@v4 + with: + name: burner-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: crypto-verify-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: cyberpunk-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: empty-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: floaty-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: hackatom-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: ibc2-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: ibc-callbacks-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: ibc-reflect-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: ibc-reflect-send-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: nested-contracts-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: queue-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: reflect-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: replier-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: staking-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: virus-${{ runner.os }} + path: . + + - name: Check contracts + shell: bash + run: cosmwasm-check *.wasm + + chkd: + name: check-dev-${{ matrix.os }} + runs-on: ${{ matrix.os }} + needs: [ stable, nightly ] + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust for compiling cosmwasm-check + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_CHECK }} + + - name: Install currently developed cosmwasm-check + run: cargo install --path ./packages/check --force + + - uses: actions/download-artifact@v4 + with: + name: burner-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: crypto-verify-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: cyberpunk-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: empty-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: floaty-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: hackatom-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: ibc2-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: ibc-callbacks-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: ibc-reflect-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: ibc-reflect-send-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: nested-contracts-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: queue-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: reflect-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: replier-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: staking-${{ runner.os }} + path: . + + - uses: actions/download-artifact@v4 + with: + name: virus-${{ runner.os }} + path: . + + - name: Check contracts + shell: bash + run: cosmwasm-check *.wasm diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml new file mode 100644 index 0000000000..1b75539bb4 --- /dev/null +++ b/.github/workflows/packages.yml @@ -0,0 +1,293 @@ +name: packages + +on: + push: + branches: [ "main" ] + pull_request: + +env: + TOOLCHAIN_STABLE: 1.82.0 # toolchain for building packages + +jobs: + format: + name: format-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: rustfmt + + - run: cargo fmt -- --check + + package-cosmwasm-core: + name: cosmwasm-core-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + targets: thumbv7em-none-eabi, wasm32-unknown-unknown + components: clippy + + - run: cargo clippy -p cosmwasm-core --all-targets -- -D warnings + - run: cargo clippy -p cosmwasm-core --all-features --all-targets -- -D warnings + - run: cargo build -p cosmwasm-core --locked + - run: cargo build -p cosmwasm-core --locked --release --lib --target wasm32-unknown-unknown + - run: cargo build -p cosmwasm-core --locked --release --lib --target thumbv7em-none-eabi + - run: cargo build -p cosmwasm-core --locked --no-default-features + - run: cargo build -p cosmwasm-core --locked --no-default-features --release --lib --target wasm32-unknown-unknown + - run: cargo build -p cosmwasm-core --locked --no-default-features --release --lib --target thumbv7em-none-eabi + - run: cargo build -p cosmwasm-core --locked --all-features + - run: cargo build -p cosmwasm-core --locked --all-features --release --lib --target wasm32-unknown-unknown + - run: cargo build -p cosmwasm-core --locked --all-features --release --lib --target thumbv7em-none-eabi + - run: cargo test -p cosmwasm-core --locked --no-default-features + - run: cargo test -p cosmwasm-core --locked --all-features + + package-cosmwasm-crypto: + name: cosmwasm-crypto-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cosmwasm-crypto --all-targets -- -D warnings + - run: cargo build -p cosmwasm-crypto --locked + - run: cargo test -p cosmwasm-crypto --locked + + package-cw-schema: + name: cw-schema-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cw-schema --all-targets -- -D warnings + - run: cargo build -p cw-schema --locked + - run: cargo test -p cw-schema --locked + + package-cw-schema-derive: + name: cw-schema-derive-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cw-schema-derive --all-targets -- -D warnings + - run: cargo build -p cw-schema-derive --locked + - run: cargo test -p cw-schema-derive --locked + + package-cosmwasm-derive: + name: cosmwasm-derive-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cosmwasm-derive --all-targets -- -D warnings + - run: cargo build -p cosmwasm-derive --locked + - run: cargo test -p cosmwasm-derive --locked + + package-cosmwasm-schema: + name: cosmwasm-schema-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cosmwasm-schema --all-targets -- -D warnings + - run: cargo build -p cosmwasm-schema --locked + - run: cargo test -p cosmwasm-schema --locked + + package-cosmwasm-schema-derive: + name: cosmwasm-schema-derive-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cosmwasm-schema-derive --all-targets -- -D warnings + - run: cargo build -p cosmwasm-schema-derive --locked + - run: cargo test -p cosmwasm-schema-derive --locked + + package-cosmwasm-std: + name: cosmwasm-std-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + targets: wasm32-unknown-unknown + components: clippy + + - run: cargo clippy -p cosmwasm-std --all-targets -- -D warnings + - run: cargo clippy -p cosmwasm-std --all-targets --features std,iterator,staking,stargate -- -D warnings + - run: cargo clippy -p cosmwasm-std --all-features --all-targets -- -D warnings + - run: cargo build -p cosmwasm-std --locked + - run: cargo build -p cosmwasm-std --locked --release --lib --target wasm32-unknown-unknown + - run: cargo build -p cosmwasm-std --locked --no-default-features --features std + - run: cargo build -p cosmwasm-std --locked --no-default-features --features std --release --lib --target wasm32-unknown-unknown + - run: cargo build -p cosmwasm-std --locked --features std,iterator,staking,stargate,cosmwasm_1_2 + - run: cargo build -p cosmwasm-std --locked --features std,iterator,staking,stargate,cosmwasm_1_2 --release --lib --target wasm32-unknown-unknown + - run: cargo build -p cosmwasm-std --locked --all-features + - run: cargo build -p cosmwasm-std --locked --all-features --release --lib --target wasm32-unknown-unknown + - run: cargo test -p cosmwasm-std --locked + - run: cargo test -p cosmwasm-std --locked --no-default-features --features std + - run: cargo test -p cosmwasm-std --locked --features std,iterator,staking,stargate,cosmwasm_1_2 + - run: cargo test -p cosmwasm-std --locked --all-features + + package-cosmwasm-vm: + name: cosmwasm-vm-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cosmwasm-vm --all-targets --no-default-features -- -D warnings + - run: cargo clippy -p cosmwasm-vm --all-targets --features iterator,staking,stargate -- -D warnings + - run: cargo build -p cosmwasm-vm --locked + - run: cargo build -p cosmwasm-vm --locked --features iterator,staking,stargate + - run: cargo build -p cosmwasm-vm --locked --all-features + - run: cargo test -p cosmwasm-vm --locked + - run: cargo test -p cosmwasm-vm --locked --features iterator,staking,stargate + - run: cargo test -p cosmwasm-vm --locked --all-features + - run: | + cargo build --locked --example multi_threaded_cache + time target/debug/examples/multi_threaded_cache > /dev/null + if: runner.os == 'Linux' + + package-cosmwasm-vm-derive: + name: cosmwasm-vm-derive-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cosmwasm-vm-derive --all-targets -- -D warnings + - run: cargo build -p cosmwasm-vm-derive --locked + - run: cargo test -p cosmwasm-vm-derive --locked + + package-cosmwasm-check: + name: cosmwasm-check-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.TOOLCHAIN_STABLE }} + components: clippy + + - run: cargo clippy -p cosmwasm-check --all-targets -- -D warnings + - run: cargo build -p cosmwasm-check --locked + - run: cargo test -p cosmwasm-check --locked diff --git a/.gitignore b/.gitignore index b0ea61c7fa..cbe15aa263 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ target/ artifacts/ # IDEs -.vscode/ .idea/ *.iml @@ -18,3 +17,4 @@ artifacts/ # Log files (e.g. memory profiling) *.log +dhat-heap.json diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index 5be4218397..0000000000 --- a/.mergify.yml +++ /dev/null @@ -1,32 +0,0 @@ -# See https://doc.mergify.io/configuration.html - -pull_request_rules: - - name: automerge to main with label automerge - conditions: - - "#approved-reviews-by>=1" - - base=main - - label=automerge - - label!=WIP - # We need to list them all individually. Here is why: https://doc.mergify.io/conditions.html#validating-all-status-check - - "status-success=ci/circleci: package_crypto" - - "status-success=ci/circleci: package_schema" - - "status-success=ci/circleci: package_std" - - "status-success=ci/circleci: package_storage" - - "status-success=ci/circleci: package_vm" - - "status-success=ci/circleci: contract_burner" - - "status-success=ci/circleci: contract_crypto_verify" - - "status-success=ci/circleci: contract_hackatom" - - "status-success=ci/circleci: contract_ibc_reflect" - - "status-success=ci/circleci: contract_ibc_reflect_send" - - "status-success=ci/circleci: contract_floaty" - - "status-success=ci/circleci: contract_queue" - - "status-success=ci/circleci: contract_reflect" - - "status-success=ci/circleci: contract_staking" - - "status-success=ci/circleci: fmt" - - "status-success=ci/circleci: clippy-1.54.0" - - "status-success=ci/circleci: clippy-1.58.1" - - "status-success=Windows" - - "status-success=macOS" - actions: - merge: - method: merge diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index d62e48a9fb..0000000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -# Used for *.md formatting in devtools/format_md.sh -target/ diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 6a82f4e8f4..0000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "overrides": [ - { - "files": "*.md", - "options": { - "proseWrap": "always" - } - } - ] -} diff --git a/CHANGELOG-pre-1.0.0.md b/CHANGELOG-pre-1.0.0.md new file mode 100644 index 0000000000..189a6bd535 --- /dev/null +++ b/CHANGELOG-pre-1.0.0.md @@ -0,0 +1,1361 @@ +# CHANGELOG of versions before 1.0.0 + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.0-rc.0] - 2022-05-05 + +### Fixed + +- cosmwasm-std: Upgrade `serde-json-wasm` to 0.4.0 to fix u128/i128 + serialization of `to_vec`/`to_binary` in some cases ([#1297]). + +[#1297]: https://github.com/CosmWasm/cosmwasm/pull/1297 + +### Added + +- cosmwasm-std: Implement `checked_multiply_ratio` for + `Uint64`/`Uint128`/`Uint256` +- cosmwasm-std: Implement `checked_from_ratio` for `Decimal`/`Decimal256` +- cosmwasm-std: Implement `Div`/`DivAssign` for `Decimal`/`Decimal256`. +- cosmwasm-vm: Add feature `allow_interface_version_7` to run CosmWasm 0.16 + contracts in modern hosts. Be careful if you consider using this! + +### Changed + +- all: Updated Rust edition to 2021 +- cosmwasm-std: Rename `SubMsgExecutionResponse` to `SubMsgResponse`. +- cosmwasm-crypto: Update dependency `k256` to ^0.10.4. +- cosmwasm-vm: `BackendError` was changed to `non_exhaustive` for future + extension; `BackendError` now implements `PartialEq` for easier test code; the + `msg` in `BackendError::Unknown` became non-optional because it was always + set; the argument in `BackendError::unknown`/`::user_err` was change to + `impl Into` to avoid unnecessary clones. + +### Deprecated + +- cosmwasm-std: `SubMsgExecutionResponse` is deprecated in favor of the new + `SubMsgResponse`. + +### Removed + +- cosmwasm-std: Remove `Pair` which was previously deprecated. Use `Record` + instead. ([#1282]) + +[#1282]: https://github.com/CosmWasm/cosmwasm/issues/1282 + +## [1.0.0-beta8] - 2022-04-06 + +### Added + +- cosmwasm-std: Implement `MulAssign` for `Decimal`/`Decimal256`. +- cosmwasm-std: Implement `is_zero`/`atomics`/`decimal_places` as const for Uint + and Decimal types. +- cosmwasm-std: Implement `new` and `raw` const constructors for + `Decimal`/`Decimal256`. + +### Changed + +- all: Drop support for Rust versions lower than 1.56.1. +- cosmwasm-std: `MockQuerier` now supports adding custom behaviour for handling + Wasm queries via `MockQuerier::update_wasm` ([#1050]). + +[#1050]: https://github.com/CosmWasm/cosmwasm/pull/1050 + +### Fixed + +- cosmwasm-std: `Api::addr_validate` now requires inputs to be normalized. +- cosmwasm-vm: The `addr_validate` import now requires inputs to be normalized. + +## [1.0.0-beta7] - 2022-03-22 + +### Added + +- cosmwasm-std: Implement `Decimal{,256}::checked_mul` and + `Decimal{,256}::checked_pow`. +- cosmwasm-std: Implement `Sub`/`SubAssign` for `Uint64`. +- cosmwasm-std: Implement `Mul`/`MulAssign` for `Uint64`. +- cosmwasm-std: Implement `RemAssign` for + `Uint64`/`Uint128`/`Uint256`/`Uint512`. +- cosmwasm-std: Implement `pow`/`checked_pow` for `Uint64`/`Uint128`/`Uint512`. +- cosmwasm-std: Implement `SubAssign`/`AddAssign` for `Decimal`/`Decimal256`. +- cosmwasm-crypto: Upgrade ed25519-zebra to version 3. + +### Changed + +- cosmwasm-vm: Upgrade Wasmer to 2.2.1. + +## [1.0.0-beta6] - 2022-03-07 + +### Added + +- cosmwasm-std: Implement `ops::Rem` for `Uint{64,128,256,512}`. + +### Changed + +- cosmwasm-std: Change type of `Reply::result` from `ContractResult` to the new + `SubMsgResult`. Both types are equal when serialized but `ContractResult` is + documented to be the result of a contract execution, which is not the case + here. ([#1232]) +- cosmwasm-vm: Upgrade Wasmer to 2.2.0 and bump `MODULE_SERIALIZATION_VERSION` + to "v3-wasmer1". ([#1224]) + +[#1224]: https://github.com/CosmWasm/cosmwasm/pull/1224 +[#1232]: https://github.com/CosmWasm/cosmwasm/pull/1232 + +## [1.0.0-beta5] - 2022-02-08 + +### Changed + +- all: Drop support for Rust versions lower than 1.54.0. +- cosmwasm-std: The `Debug` implementation of `Binary` now produces a hex string instead of a list of bytes ([#1199]). +- cosmwasm-std: Pin uint version to 0.9.1 in order to maintain a reasonably low MSRV. +- cosmwasm-std: Add missing `Isqrt` export ([#1214]). + +[#1199]: https://github.com/CosmWasm/cosmwasm/issues/1199 +[#1214]: https://github.com/CosmWasm/cosmwasm/issues/1214 + +### Fixed + +- cosmwasm-vm: Fix `AddAssign` implementation of `GasInfo`. +- cosmwasm-vm: Bump `MODULE_SERIALIZATION_VERSION` to "v2" because the module + serialization format changed between Wasmer 2.0.0 and 2.1.x. + +## [1.0.0-beta4] - 2021-12-23 + +### Changed + +- cosmwasm-vm: `wasmer` version bumped `2.1.0 -> 2.1.1` + +### Fixed + +- cosmwasm-vm: Remove system-dependent stacktrace from `VmError::RuntimeErr` + (fixes CWA-2021-003). + +## [1.0.0-beta3] + +### Added + +- cosmwasm-std: New const methods `Uint64::to_be_bytes`/`::to_le_bytes`. +- cosmwasm-vm: The check_contracts tool now has a `--supported-features` option + that defaults to "iterator,staking,stargate". +- cosmwasm-vm: The default `singlepass` compiler is now supported on 64-bit + Windows. +- cosmwasm-std: Add missing `DivideByZeroError` export. +- cosmwasm-std: Implement `std::iter::Sum` for `Decimal` and `Decimal256`. + +### Changed + +- all: Drop support for Rust versions lower than 1.53.0. +- cosmwasm-std: The balance argument from `mock_dependencies` was removed. + Remove `&[]` if you don't need a contract balance or use the new + `mock_dependencies_with_balance` if you need a balance. +- cosmwasm-vm: Unlock cache mutex before module instantiation. +- cosmwasm-vm: `wasmer` version bumped `2.0.0 -> 2.1.0` + +### Removed + +- cosmwasm-std: Remove the macros `create_entry_points` and + `create_entry_points_with_migration` in favour of the new, more flexible entry + point system introduced in CosmWasm 0.14. + +## [1.0.0-beta] - 2021-10-11 + +### Added + +- cosmwasm-std: Add new `WasmQuery::ContractInfo` variant to get metadata about + the contract, like `code_id` and `admin`. +- cosmwasm-std: New field `Env::transaction` containing info of the transaction + the contract call was executed in. +- cosmwasm-std: Implement `ops::Mul` for `Decimal` and `Decimal256`. +- cosmwasm-std: New const methods `Uint128::to_be_bytes`/`::to_le_bytes`. +- cosmwasm-std: New const conversion methods `Uint256::from_uint128` and + `Uint512::from_uint256`. +- cosmwasm-std: New getters `Decimal{,256}::atomics()` and + `Decimal{,256}::decimal_places()`. +- cosmwasm-std: New constructors `Decimal{,256}::from_atomics`. +- cosmwasm-std: New `Uint128::checked_pow`. +- cosmwasm-std: New macros `ensure!`, `ensure_eq!` and `ensure_ne!` allow + requirement checking that return errors instead of panicking ([#1103]). + +[#1103]: https://github.com/CosmWasm/cosmwasm/issues/1103 + +### Changed + +- cosmwasm-std: Make `iterator` a required feature if the `iterator` feature + flag is set (enabled by default). +- cosmwasm-vm: Increase `MAX_LENGTH_HUMAN_ADDRESS` from 90 to 256 in order to + support longer address formats than bech32. +- cosmwasm-std: Make `CustomQuery` a subtrait of `Clone`, i.e. types that + implement `CustomQuery` need to be `Clone`able. +- cosmwasm-std: Add generic for custom query type to `QuerierWrapper`, `Deps`, + `DepsMut` and `OwnedDeps`. Merge `QuerierWrapper::custom_query` into the now + fully typed `QuerierWrapper::query`. +- cosmwasm-std: Add generic type `Q` for the custom query request type to + `do_instantiate`, `do_execute`, `do_migrate`, `do_sudo`, `do_reply`, + `do_query`, `ibc_channel_open`, `ibc_channel_connect`, `ibc_channel_close`, + `ibc_packet_receive`, `ibc_packet_ack` and `ibc_packet_timeout`. +- cosmwasm-std: In `Decimal` change `Fraction` to `Fraction`, + such that `Decimal::numerator` and `::denominator` now return `Uint128`. +- cosmwasm-std: Make methods `Uint256::to_be_bytes`/`::to_le_bytes` const. +- cosmwasm-std: Make methods `Uint512::to_be_bytes`/`::to_le_bytes` const. +- cosmwasm-std: Make method `Uint512::from_le_bytes` const. +- cosmwasm-std: Rename `Pair` to `Record`. `Pair` is now an alias for `Record` + and deprecated. ([#1108]) +- cosmwasm-vm: Bump required marker export `interface_version_7` to + `interface_version_8`. +- cosmwasm-vm: Increase cost per Wasm operation from 1 to 150_000 and adjust + crypto API gas cost based on the target of 1 Teragas per millisecond. +- cosmwasm-std: Deprecate the macros `create_entry_points` and + `create_entry_points_with_migration` in favour of the new, more flexible entry + point system introduced in CosmWasm 0.14. + +### Removed + +- cosmwasm-std: Remove `HumanAddr` (deprecated since 0.14). Use `String` + instead. +- cosmwasm-std: Remove `KV` (deprecated since 0.14). Use `Pair` instead. + +[#1108]: https://github.com/CosmWasm/cosmwasm/issues/1108 + +## [0.16.2] - 2021-09-07 + +### Added + +- cosmwasm-std: Implement `Mul` and `MulAssign` for `Uint128`. +- cosmwasm-std: Implement `FromStr` for `Uint128`, `Uint256`, and `Uint512`. +- cosmwasm-std: Make `Uint256::from_le_bytes`, `::from_be_bytes` and `::new` + const. +- cosmwasm-std: Added the `Decimal256` type with 18 decimal places. + +### Changed + +- cosmwasm-std: Implement `Decimal::from_ratio` using full uint128 + multiplication to support a wider range of input values. +- cosmwasm-std: `Decimal::from_ratio` now accepts any types that implement + `Into` rather than `Into`. +- cosmwasm-crypto: Update dependency `k256` to ^0.9.6. +- cosmwasm-std: Add enum cases `Shl` to `OverflowOperation` (breaking; [#1071]). + +[#1071]: https://github.com/CosmWasm/cosmwasm/pull/1071 + +### Fixed + +- cosmwasm-std: Fixed a bug where `Uint*` types wouldn't handle formatting + options when formatted with `std::fmt::Display`. + +## [0.16.1] - 2021-08-31 + +### Added + +- cosmwasm-std: Added `From` and `From<&Addr>` conversions for + `Cow`. +- cosmwasm-std: Added new `Uint256` and `Uint512` types. +- cosmwasm-std: Added implementations of `Isqrt` (integer square root) for + `Uint64`, `Uint128`, `Uint256`, and `Uint512`. +- cosmwasm-std: Exposed `Uint{64, 128, 256}::full_mul` for full multiplication + that cannot overflow. + +### Changed + +- cosmwasm-std: In `ExternalApi::addr_validate` and `::addr_canonicalize` do not + send too long inputs to VM to avoid terminating contract execution. Errors are + returned instead now. +- cosmwasm-std: Add enum cases `Shr` to `OverflowOperation` (breaking; [#1059]). + +[#1059]: https://github.com/CosmWasm/cosmwasm/pull/1059 + +## [0.16.0] - 2021-08-05 + +### Added + +- cosmwasm-std: Added the `IbcChannelOpenMsg`, `IbcChannelConnectMsg`, + `IbcChannelCloseMsg`, `IbcPacketReceiveMsg`, `IbcPacketAckMsg`, and + `IbcPacketTimeoutMsg` types for use with corresponding IBC entrypoints. +- cosmwasm-std::testing: New mocking helpers for IBC channel msg types: + `mock_ibc_channel_open_init`, `mock_ibc_channel_open_try`, + `mock_ibc_channel_connect_ack`, `mock_ibc_channel_connect_confirm`, + `mock_ibc_channel_close_init`, `mock_ibc_channel_close_confirm`. +- cosmwasm-std::testing: Added `mock_ibc_packet_timeout` since + `mock_ibc_packet_ack` is no longer usable for creating mock data for + `ibc_packet_timeout`. +- cosmwasm-std: New `Attribute::new` constructor that does the same thing as + `attr`. +- cosmwasm-std::testing: Added `mock_wasm_attr` when you really need to create + an `Attribute` with a key starting with `_` in test code. +- cosmwasm-std: Renamed `IBCAcknowledgementWithPacket` -> `IbcPacketAckMsg` to + remove an unneeded level of indirection. +- cosmwasm-std: Added `Event::add_attributes` for bulk adding attributes to an + `Event` struct. +- cosmwasm-std: Added `Addr::into_string` for explicit conversion + +### Changed + +- cosmwasm-vm: The `Checksum::to_hex` function signature was changed from + `to_hex(&self) -> String` to `to_hex(self) -> String`. +- cosmwasm-std: The `attr` function now accepts types that implement + `Into` rather than `ToString`. +- cosmwasm-std, cosmwasm-vm, cosmwasm-storage: The `iterator` feature is now + enabled by default. +- cosmwasm-std: Make `MockApi::canonical_length` private. +- cosmwasm-vm: Make `MockApi::canonical_length` private. +- cosmwasm-vm: Bump required marker export `interface_version_6` to + `interface_version_7`. +- cosmwasm-std, cosmwasm-vm: Entrypoints `ibc_channel_open`, + `ibc_channel_connect`, `ibc_channel_close`, `ibc_packet_receive`, + `ibc_packet_ack`, `ibc_packet_timeout` now each accept a corresponding `Msg` + value that wraps around channels, packets and acknowledgements. +- cosmwasm-std/cosmwasm-vm: Increase canonical address lengths up to 64 bytes. +- cosmwasm-std/cosmwasm-vm: In `MockApi`, increase max length of supported human + addresses from 24 bytes to 54 bytes by using a longer canonical + representation. This allows you to insert typical bech32 addresses in tests. + ([#995]) +- cosmwasm-std::testing: `mock_ibc_packet_recv` function now returns an + `IbcPacketReceiveMsg`, `mock_ibc_packet_ack` requires an acknowledgement to be + passed and returns an `IbcPacketAckMsg`. +- cosmwasm-std: `IbcBasicResponse` and `IbcReceiveResponse` now both support + custom events via the `events` field. +- cosmwasm-std: `attr` (and `Attribute::new`) will now panic in debug builds if + the attribute's key starts with an underscore. These names are reserved and + could cause problems further down the line. +- cosmwasm-std: `Response`, `IbcBasicResponse` and `IbcReceiveResponse` can no + longer be constructed using struct literals. Use constructors like + `Response::new` to construct empty structs and appropriate builder-style + methods to set fields (`response.add_message`, `response.set_data`, etc). +- cosmwasm-std: `Event`, `IbcChannel`, `IbcPacket`, `IbcAcknowledgement` have + been marked `non_exhaustive` (can't be constructed using a struct literal by + downstream code). +- cosmwasm-std: `Event::attr` has been renamed to `Event::add_attribute` for + consistency with other types like `Response`. +- cosmwasm-vm: `Instance::required_features` changed from a property to a getter + method. +- cosmwasm-vm: Add `required_features` field to `AnalysisReport` which is + returned by `Cache::analyze`. +- cosmwasm-vm: The VM now checks that exactly one `interface_version_*` marker + export is set. For `interface_version_5` and `interface_version_6` (CosmWasm + 0.14–0.15) more specific error messages were added. + +[#995]: https://github.com/CosmWasm/cosmwasm/pull/995 + +### Removed + +- cosmwasm-std::testing: `mock_ibc_channel` is now private. Use + `mock_ibc_channel_open`, `mock_ibc_channel_connect`, or + `mock_ibc_channel_close` instead. + +## [0.15.2] - 2021-07-21 + +### Fixed + +- cosmwasm-std: Export `VoteOption` as a top-level type. + +## [0.15.1] - 2021-07-20 + +### Fixed + +- cosmwasm-std: Export `GovMsg` as a top-level type of the crate. + +## [0.15.0] - 2021-06-24 + +### Added + +- cosmwasm-std: Implement `Sub` and `SubAssign` for `Uint128` +- cosmwasm-std: Implement custom events for contract execution results +- cosmwasm-std: Add `CosmosMsg::Gov` for voting on governance proposals. +- cosmwasm-storage: Implement `Storage` for `PrefixedStorage` and + `ReadonlyPrefixedStorage`. NOTE: Calling `set` or `remove` on + `ReadonlyPrefixedStorage` will panic! + +### Removed + +- cosmwasm-std: Make `Uint128` inner field private ([#905]) +- cosmwasm-std: Remove `Context` - deprecated in previous release +- cosmwasm-std: Remove `HandleResponse`, `InitResponse`, and `MigrateResponse` - + deprecated in previous release +- cosmwasm-crypto: Remove `ed25519::MESSAGE_MAX_LEN`, `ed25519::BATCH_MAX_LEN` + and message length verification as this should not be a concern of + `cosmwasm-crypto`. + +[#905]: https://github.com/CosmWasm/cosmwasm/issues/905 + +### Changed + +- cosmwasm-std: Rename the `send` function parameter to `funds` in `WasmMsg` for + consistency with the wasmd message types. +- cosmwasm-vm: Increase read limit of contract execution results from 100,000 + bytes to 64 MiB. JSON deserializers should have their own limit to protect + against large deserializations. +- cosmwasm-vm: Create `VmError::DeserializationLimitExceeded`; Add limit + argument to `from_slice`; Increase deserialization limit of contract execution + results from 100,000 bytes to 256 KiB. This probably only affects internal + testing as well as integration tests of smart contracts. +- cosmwasm-vm: More accurate error messages for op codes related to bulk memory + operations, reference types, SIMD and the Threads extension. +- cosmwasm-vm: Update `wasmer` to `2.0.0` +- cosmwasm-vm: ED25519 message length and batch length limits are now hardcoded + in `cosmwasm-vm` itself instead of being imported from `cosmwasm-crypto`. +- cosmwasm-vm: Filesystem storage layout now distinguishes clearly between state + and cache. +- cosmwasm-std: Add enum case `ReplyOn::Never`; Remove default implementation of + `ReplyOn` as there is no natural default case anymore ([#961]). +- cosmwasm-std: Merge `messages` and `submessages` into one list, using + `ReplyOn::Never` to model the "fire and forget" semantics ([#961]). +- cosmwasm-std: Add `SubMsg` constructors: `::new()`, `::reply_on_error()`, + `::reply_on_success()`, `::reply_always()`; Add `with_gas_limit` to add a gas + limit to any those constructors ([#961]). +- cosmwasm-std: Change `Event`'s constructor - it no longer takes a vector of + attributes and instead constructs an empty one +- cosmwasm-std: Rename `Event.kind` to `Event.ty`. +- cosmwasm-std: Rename `SubcallResponse` to `SubMsgExecutionResponse`. +- contracts: Rename `ReflectSubCall` to `ReflectSubMsg` and `SubCallResult` to + `SubCallMsg` in the `reflect` contract. +- cosmwasm-std: Rename the `subcall` module to `submessages`. +- cosmwasm-vm: Bump required marker export `cosmwasm_vm_version_5` to + `interface_version_6`. +- cosmwasm-std: `IbcAcknowledgement` is renamed to + `IbcAcknowledgementWithPacket` as it contains both data elements. ([#975]) +- cosmwasm-std: `IbcAcknowledgementWithPacket.acknowledgement` is no longer + simply `Binary`, but a new `IbcAcknowledgement` structure, which contains one + field - `data: Binary`. This change was made to allow us to handle future + changes to IBC in a non-contract-breaking way. ([#975]) + +[#961]: https://github.com/CosmWasm/cosmwasm/pull/961 +[#975]: https://github.com/CosmWasm/cosmwasm/pull/975 + +### Fixed + +- comswasm-vm: Whitelisted the `i64.extend32_s` operation. + +## [0.14.1] - 2021-06-14 + +### Added + +- cosmwasm-std: Add `Timestamp::minus_seconds` and `::minus_nanos`. +- cosmwasm-std: Add `Addr::as_bytes` +- cosmwasm-std: Implement `std::ops::Sub` for `math::Decimal` +- cosmwasm-std: Add `Timestamp::seconds` and `Timestamp::subsec_nanos`. +- cosmwasm-std: Implement division for `Decimal / Uint128` +- cosmwasm-std: Add `math::Decimal::sqrt` + +### Fixed + +- cosmwasm-std: Fix `Uint64::multiply_ratio` and `Uint128::multiply_ratio` so + that internal multiplication cannot cause an unnecessary overflow. ([#920]) + +[#920]: https://github.com/CosmWasm/cosmwasm/issues/920 + +## [0.14.0] - 2021-05-03 + +### Added + +- cosmwasm-crypto: Add `ed25519_batch_verify`, EdDSA ed25519 batch signature + verification scheme for Tendermint signatures and public keys formats. + ([#788]) +- cosmwasm-crypto: Add `ed25519_verify`, EdDSA ed25519 signature verification + scheme for Tendermint signature and public key formats. ([#771]) +- cosmwasm-crypto: New crypto-related crate. Add `secp256k1_verify`, ECDSA + secp256k1 signature verification scheme for Cosmos signature and public key + formats. ([#780]) +- cosmwasm-vm: Add PinnedMemoryCache. ([#696]) +- cosmwasm-vm: The new `Cache::analyze` provides a static analysis of the Wasm + bytecode. This is used to tell the caller if the contract exposes IBC entry + points. ([#736]) +- cosmwasm-vm: Added new `stargate` feature flag to enable new stargate and ibc + features ([#692], [#716]) +- cosmwasm-vm: (requires `stargate`) call into 6 new ibc entry points if exposed + by contract ([#692], [#716]) +- cosmwasm-std: Added new `stargate` feature flag to enable new stargate and ibc + features ([#692], [#706]) +- cosmwasm-std: (requires `stargate`) Added new `CosmosMsg::Stargate` message + type to dispatch protobuf-encoded message (contract must know proto schema) + ([#706]) +- cosmwasm-std: (requires `stargate`) Added new `QueryRequest::Stargate` message + type to dispatch protobuf-encoded queries (contract must know proto schema for + request and response) ([#706]) +- cosmwasm-std: (requires `stargate`) Added new `CosmosMsg::Ibc(IbcMsg)` message + type to use ibctransfer app or send raw ics packets (if contract has ibc entry + points) ([#692], [#710]) +- cosmwasm-std: Add mutable helper methods to `InitResponse`, `MigrateResponse` + and `HandleResponse` which make `Context` obsolete. +- contracts: added new `ibc-reflect` contract that receives channels and assigns + each an account to redispatch. Similar idea to ICS27/Interchain Accounts (but + different implementation) ([#692], [#711], [#714]) +- cosmwasm-std: Added new `WasmMsg::Migrate` variant that allows one contract + (eg. multisig) be the admin and migrate another contract ([#768]) +- cosmwasm-std: Added optional `system` entry point that can only be called by + native (blockchain) modules to expose admin functionality if desired. ([#793]) +- cosmwasm-std: Add extra field `submessages` to `Response`, such that you can + get a callback from these messages after their execution (success or failure). + ([#796]) +- cosmwasm-std: Added `reply` entry point that will receive all callbacks from + submessages dispatched by this contract. This is only required if contract + returns "submessages" (above). ([#796]) +- cosmwasm-std: Implement `From for String`, `From for u128` + as well as `From for Uint128`. +- cosmwasm-std: Create new address type `Addr`. This is human readable (like + `HumanAddr`) but is immutable and always contains a valid address ([#802]). +- cosmwasm-vm: Add import `addr_validate` ([#802]). +- cosmwasm-std: Add `BankMsg::Burn` variant when you want the tokens to + disappear ([#860]) +- cosmwasm-std: Create `Fraction` trait to represent a fraction `p`/`q` with + integers `p` and `q`. `Decimal` now implements `Fraction`, which + provides public getters `::numerator()` and `::denominator()`. +- cosmwasm-std: Add `Decimal::inv` that returns `1/d` for decimal `d`. +- cosmwasm-vm: Add `Cache::metrics` to expose internal data for monitoring + purposes ([#763]). +- cosmwasm-std: Implement `PartialOrd` and `Ord` for `Binary` using the same + lexicographical ordering as implemented by `Vec`. +- cosmwasm-std: Implement `PartialOrd` and `Ord` for `Addr` using the same + lexicographical ordering as implemented by `String`. +- cosmwasm-std: Added new `WasmMsg::UpdateAdmin` variant that allows an admin + contract (eg. multisig) to set another admin ([#900]) +- cosmwasm-std: Added new `WasmMsg::ClearAdmin` variant that allows an admin + contract (eg. multisig) to clear the admin, to prevent future migrations + ([#900]) +- cosmwasm-std: Implement `Display for Coin` ([#901]). +- cosmwasm-std: Create `Uint64` analogously to `Uint128` with string + serialization allowing the use of the full uint64 range in JSON clients that + use float numbers, such as JavaScript and jq. +- cosmwasm-std: Create const functions `Uint64::new` and `Uint128::new` to + create instances in a const context. + +[#692]: https://github.com/CosmWasm/cosmwasm/issues/692 +[#706]: https://github.com/CosmWasm/cosmwasm/pull/706 +[#710]: https://github.com/CosmWasm/cosmwasm/pull/710 +[#711]: https://github.com/CosmWasm/cosmwasm/pull/711 +[#714]: https://github.com/CosmWasm/cosmwasm/pull/714 +[#716]: https://github.com/CosmWasm/cosmwasm/pull/716 +[#763]: https://github.com/CosmWasm/cosmwasm/issues/763 +[#768]: https://github.com/CosmWasm/cosmwasm/pull/768 +[#793]: https://github.com/CosmWasm/cosmwasm/pull/793 +[#796]: https://github.com/CosmWasm/cosmwasm/pull/796 +[#802]: https://github.com/CosmWasm/cosmwasm/pull/802 +[#860]: https://github.com/CosmWasm/cosmwasm/pull/860 +[#900]: https://github.com/CosmWasm/cosmwasm/pull/900 +[#901]: https://github.com/CosmWasm/cosmwasm/pull/901 + +### Changed + +- contracts: Rename `HandleMsg` to `ExecuteMsg`. +- all: Rename `handle` entry point to `execute`. +- all: Rename `init` entry point to `instantiate`. +- all: Rename `system` entry point to `sudo`. +- all: Drop support for Rust versions lower than 1.51.0. +- all: The `query` and `execute` entry points are now optional. It is still + highly recommended to implement and expose them in almost any use case though. +- all: Change the encoding of the key/value region of the `db_next` import to a + more generic encoding that supports an arbitrary number of sections. This + encoding can then be reused for other multi value regions. +- all: Remove the `info: MessageInfo` argument from the `migrate` entry point + ([#690]). +- cosmwasm-std: Remove `from_address` from `BankMsg::Send`, as it always sends + from the contract address, and this is consistent with other `CosmosMsg` + variants. +- cosmwasm-std: Remove the previously deprecated `InitResult`, `HandleResult`, + `MigrateResult` and `QueryResult` in order to make error type explicit and + encourage migration to custom errors. +- cosmwasm-std: Add a `data` field to `InitResponse` the same way as in + `MigrateResponse` and `HandleResponse`. +- cosmwasm-std: Rename `MessageInfo::sent_funds` to `MessageInfo::funds`. +- cosmwasm-std: Merge response types `InitResponse`, `HandleResponse` and + `MigrateResponse` into the new `Response`. +- cosmwasm-std: Remove `Default` implementation from `HumanAddr`, + `CanonicalAddr`, `ContractInfo`, `MessageInfo`, `BlockInfo` and `Env`. If you + need one of those, you're probably doing something wrong. +- cosmwasm-std: Make `label` in `WasmMsg::Instantiate` non-optional to better + match the Go/database format. +- cosmwasm-std: Add new field `admin` to `WasmMsg::Instantiate` to fully support + `MsgInstantiateContract` from `x/wasm` ([#861]). +- cosmwasm-std: `Binary::to_array` is now generic over the array length instead + of the output type. As a consequence the obsolete type `ByteArray` was + removed. The array length is not restricted to 0-64 anymore. +- cosmwasm-std: Use const generics to implement `From<&[u8; LENGTH]> for Binary` + and `From<[u8; LENGTH]> for Binary`, such that the array length is not + restricted to 0-64 anymore. +- cosmwasm-vm: Avoid serialization of Modules in `InMemoryCache`, for + performance. Also, remove `memory_limit` from `InstanceOptions`, and define it + instead at `Cache` level (same memory limit for all cached instances). + ([#697]) +- cosmwasm-std: Rename type `KV` to `Pair` in order to comply to naming + convention as enforced by clippy rule `upper_case_acronyms` from Rust 1.51.0 + on. +- cosmwasm-std: `ContractInfo::address` and `MessageInfo::sender` are now of + type `Addr`. The value of those fields is created by the host and thus valid. +- cosmwasm-vm: Bump required marker export `cosmwasm_vm_version_4` to + `interface_version_5`. +- cosmwasm-vm: Rename trait `Api` to `BackendApi` to better express this is the + API provided by the VM's backend (i.e. the blockchain). +- cosmwasm-vm: Rename imports to `addr_canonicalize` and `addr_humanize` + ([#802]). +- cosmwasm-vm: Replace types `HumanAddr`/`CanonicalAddr` with + `&str`/`String`/`&[u8]`/`Vec` in the methods of `BackendApi`. The address + types belong in the contract development and the backend operates on raw + strings and binary anyways. +- contracts: `reflect` contract requires `stargate` feature and supports + redispatching `Stargate` and `IbcMsg::Transfer` messages ([#692]) +- cosmwasm-std: The arithmetic methods of `Uint128` got a huge overhaul, making + them more consistent with the behaviour of the Rust primitive types. Thank you + [@yihuang] for bringing this up and for the great implementation. ([#853]) + 1. `Uint128` got the new functions `checked_add`, `checked_sub`, + `checked_mul`, `checked_div`, `checked_div_euclid`, `checked_rem`, + `wrapping_add`, `wrapping_sub`, `wrapping_mul`, `wrapping_pow`, + `saturating_add`, `saturating_sub`, `saturating_mul` and `saturating_pow` + which match their equivalent in [u128] except that instead of `Option` the + checked methods return a `Result` with an `OverflowError` or + `DivideByZeroError` that carries a few debug information and can directly + be converted to `StdError`/`StdResult` by using the `?` operator. + 2. `StdError::Underflow` and `StdError::underflow` were removed in favour of + `StdError::Overflow`. `StdError::DivideByZeroError` was added. + 3. The `-` operator (`impl ops::Sub for Uint128`) was removed + because it returned a `StdResult` instead of panicking in the case of an + overflow. This behaviour was inconsistent with `+` and the Rust standard + library. Please use the explicit `*_sub` methods introduced above. In a + couple of releases from now, we want to introduce the operator again with + panicking overflow behaviour ([#858]). +- cosmwasm-std: Replace `HumanAddr` with `String` in `BankQuery`, `StakingQuery` + and `WasmQuery` query requests ([#802]). +- cosmwasm-std: In staking query response types `Delegation`, `FullDelegation` + and `Validator` the validator address fields were changed from `HumanAddr` to + `String`. The new `Addr` type cannot be used here because it only supports + standard account addresses via `Api::addr_*` ([#871]). +- cosmwasm-std: Change address types in `BankMsg`, `IbcMsg` and `WasmMsg` from + `HumanAddr` to `String` ([#802]). +- cosmwasm-std: `Api::addr_humanize` now returns `Addr` instead of `HumanAddr` + ([#802]). +- cosmwasm-std: Hide `StakingMsg`, `CosmosMsg::Staking`, + `AllDelegationsResponse`, `BondedDenomResponse`, `Delegation`, + `FullDelegation`, `StakingQuery`, `Validator`, `ValidatorsResponse` and + `testing::StakingQuerier` behind the `staking` feature flag to make those only + available in contracts built for PoS chains. +- cosmwasm-std: Remove `StakingMsg::Withdraw` in favour of + `DistributionMsg::SetWithdrawAddress` and + `DistributionMsg::WithdrawDelegatorReward` ([#848]). +- cosmwasm-std: Rename `StakingQuery::Validators`, `ValidatorsResponse` and + `QuerierWrapper::query_validators` to `StakingQuery::AllValidators`, + `AllValidatorsResponse` and `QuerierWrapper.query_all_validators`. Add + `StakingQuery::Validator`, `ValidatorResponse` and + `QuerierWrapper::query_validator` to allow querying a single validator. + ([#879]) +- cosmwasm-schema: Make first argument non-mutable in `export_schema_with_title` + for consistency with `export_schema`. +- cosmwasm-std: The block time in `BlockInfo::time` is now a `Timestamp`. + `BlockInfo::time_nanos` was removed. + +[#696]: https://github.com/CosmWasm/cosmwasm/issues/696 +[#697]: https://github.com/CosmWasm/cosmwasm/issues/697 +[#736]: https://github.com/CosmWasm/cosmwasm/pull/736 +[#690]: https://github.com/CosmWasm/cosmwasm/issues/690 +[@yihuang]: https://github.com/yihuang +[#853]: https://github.com/CosmWasm/cosmwasm/pull/853 +[#858]: https://github.com/CosmWasm/cosmwasm/issues/858 +[u128]: https://doc.rust-lang.org/std/primitive.u128.html +[#802]: https://github.com/CosmWasm/cosmwasm/pull/802 +[#871]: https://github.com/CosmWasm/cosmwasm/issues/871 +[#861]: https://github.com/CosmWasm/cosmwasm/issues/861 +[#848]: https://github.com/CosmWasm/cosmwasm/issues/848 +[#879]: https://github.com/CosmWasm/cosmwasm/pull/879 + +### Deprecated + +- cosmwasm-std: `InitResponse`, `MigrateResponse` and `HandleResponse` are + deprecated in favour of the new `Response`. +- cosmwasm-std: `Context` is deprecated in favour of the new mutable helpers in + `Response`. +- cosmwasm-std: `HumanAddr` is not much more than an alias to `String` and it + does not provide significant safety advantages. With CosmWasm 0.14, we now use + `String` when there was `HumanAddr` before. There is also the new `Addr`, + which holds a validated immutable human readable address. ([#802]) + +[#802]: https://github.com/CosmWasm/cosmwasm/pull/802 + +## [0.13.2] - 2021-01-14 + +## Changed + +- cosmwasm-vm: Update Wasmer to 1.0.1. + +## [0.13.1] - 2021-01-12 + +### Added + +- cosmwasm-std: Add the new `#[entry_point]` macro attribute that serves as an + alternative implementation to `cosmwasm_std::create_entry_points!(contract)` + and `cosmwasm_std::create_entry_points_with_migration!(contract)`. Both ways + are supported in the 0.13 series. + +## [0.13.0] – 2021-01-06 + +## Added + +- cosmwasm-std: Extend binary to array support to 64 bytes. + +## Changed + +- all: Drop support for Rust versions lower than 1.47.0. +- cosmwasm-std: Remove `cosmwasm_std::testing::MockApi::new`. Use + `MockApi::default` instead. +- cosmwasm-vm: Upgrade Wasmer to 1.0 and adapt all the internal workings + accordingly. +- cosmwasm-vm: Export method `cosmwasm_vm::Cache::stats` and response type + `Stats`. +- cosmwasm-vm: Remove `cosmwasm_vm::testing::MockApi::new`. Use + `MockApi::default` instead. +- cosmwasm-vm: Convert field `Instance::api` to a method. +- cosmwasm-vm: Change order of generic arguments for consistency in `Instance`, + `Cache` and `Backend` to always match ``. +- cosmwasm-vm: Remove `Instance::get_memory_size`. Use `Instance::memory_pages` + instead. + +## 0.12.2 (2020-12-14) + +**cosmwasm-std** + +- `StdError` now implements `PartialEq` (ignoring backtrace if any). This allows + simpler `assert_eq!()` when testing error conditions (rather than match + statements as now). + +## 0.12.1 (2020-12-09) + +**cosmwasm-std** + +- Deprecate `InitResult`, `HandleResult`, `MigrateResult` and `QueryResult` in + order to make error type explicit and encourage migration to custom errors. +- Implement `Deref` for `QuerierWrapper`, such that `QuerierWrapper` behaves + like a smart pointer to `Querier` allowing you to access `Querier` methods + directly. + +## 0.12.0 (2020-11-19) + +**cosmwasm-std** + +- Remove the previously deprecated `StdError::Unauthorized`. Contract specific + errors should be implemented using custom error types now (see + [migration guide](./MIGRATING.md) 0.10 -> 0.11). +- Use dependency `thiserror` instead of `snafu` to implement `StdError`. Along + with this change, the `backtraces` feature now requires Rust nightly. +- Rename `StdError::ParseErr::source` to `StdError::ParseErr::source_type` and + `StdError::SerializeErr::target` to `StdError::SerializeErr::target_type` to + work around special treatment of the field name `source` in thiserror. +- Rename `Extern` to `Deps` to unify naming. +- Simplify ownership of calling `handle`, etc. with `Deps` and `DepsMut` struct + that just contains references (`DepsMut` has `&mut Storage` otherwise the + same) +- Remove unused `Deps::change_querier`. If you need this or similar + functionality, create a new struct with the right querier. +- Remove `ReadonlyStorage`. You can just use `Storage` everywhere. And use + `&Storage` to provide readonly access. This was only needed to let + `PrefixedStorage`/`ReadonlyPrefixedStorage` implement the common interface, + which is something we don't need. + +**cosmwasm-storage** + +- `PrefixedStorage`/`ReadonlyPrefixedStorage` do not implement the + `Storage`/`ReadonlyStorage` traits anymore. If you need nested prefixes, you + need to construct them directly via `PrefixedStorage::multilevel` and + `ReadonlyPrefixedStorage::multilevel`. +- Remove unused `TypedStorage`. If you need this or similar functionality, you + probably want to use `Bucket` or `Singleton`. If you really need it, please + copy the v0.11 code into your project. +- Remove `StorageTransaction` along with `transactional` and `RepLog`. This has + not been used actively for contract development and is now maintained in a + contract testing framework. + +**cosmwasm-vm** + +- Remove `Storage::range` and `StorageIterator`. The storage implementation is + now responsible for maintaining iterators internally and make them accessible + via the new `Storage::scan` and `Storage::next` methods. +- Add `FfiError::IteratorDoesNotExist`. Looking at this, `FfiError` should + probably be renamed to something that includes before, on and behind the FFI + boundary to Go. +- `MockStorage` now implements the new `Storage` trait and has an additional + `MockStorage::all` for getting all elements of an iterator in tests. +- Remove unused `Extern::change_querier`. If you need this or similar + functionality, create a new struct with the right querier. +- Let `Instance::from_code` and `CosmCache::get_instance` take options as an + `InstanceOptions` struct. This contains `gas_limit` and `print_debug` for now + and can easily be extended. `cosmwasm_vm::testing::mock_instance_options` can + be used for creating such a struct in integration tests. +- Make `FileSystemCache` crate internal. This should be used via `CosmCache`. +- Fix return type of `FileSystemCache::load` to `VmResult>` in + order to differentiate missing files from errors. +- Add in-memory caching for recently used Wasm modules. +- Rename `CosmCache` to just `cosmwasm_vm::Cache` and add `CacheOptions` to + configure it. +- Rename `Extern` to `Backend`. +- Rename `mock_dependencies` to `mock_backend` and + `mock_dependencies_with_balances` to `mock_backend_with_balances`. +- Rename `FfiError`/`FfiResult` to `BackendError`/`BackendResult` and adapt + `VmError` accordingly. + +## 0.11.2 (2020-10-26) + +**cosmwasm-std** + +- Implement `From` and `From` + for `StdError`. +- Generalize denom argument from `&str` to `S: Into` in `coin`, `coins` + and `Coin::new`. +- Implement `PartialEq` between `Binary` and `Vec`/`&[u8]`. +- Add missing `PartialEq` implementations between `HumanAddr` and `str`/`&str`. +- Add `Binary::to_array`, which allows you to copy binary content into a + fixed-length `u8` array. This is especially useful for creating integers from + binary data. + +## 0.11.1 (2020-10-12) + +**cosmwasm-std** + +- Implement `Hash` and `Eq` for `Binary` to allow using `Binary` in `HashSet` + and `HashMap`. +- Implement `Hash` and `Eq` for `CanonicalAddr` to allow using `CanonicalAddr` + in `HashSet` and `HashMap`. +- Implement `Add`, `AddAssign` and `Sub` with references on the right hand side + for `Uint128`. +- Implement `Sum` and `Sum<&'a Uint128>` for `Uint128`. + +## 0.11.0 (2020-10-08) + +**all** + +- Drop support for Rust versions lower than 1.45.2. +- The serialization of the result from `init`/`migrate`/`handle`/`query` changed + in an incompatible way. See the new `ContractResult` and `SystemResult` types + and their documentation. +- Pass `Env` into `query` as well. As this doesn't have `MessageInfo`, we + removed `MessageInfo` from `Env` and pass that as a separate argument to + `init`, `handle`, and `query`. See the example + [type definitions in the README](README.md#implementing-the-smart-contract) to + see how to update your contract exports (just add one extra arg each). + +**cosmwasm-std** + +- Add `time_nanos` to `BlockInfo` allowing access to high precision block times. +- Change `FullDelegation::accumulated_rewards` from `Coin` to `Vec`. +- Rename `InitResponse::log`, `MigrateResponse::log` and `HandleResponse::log` + to `InitResponse::attributes`, `MigrateResponse::attributes` and + `HandleResponse::attributes`. +- Rename `LogAttribute` to `Attribute`. +- Rename `log` to `attr`. +- Rename `Context::add_log` to `Context::add_attribute`. +- Add `Api::debug` for emitting debug messages during development. +- Fix error type for response parsing errors in `ExternalQuerier::raw_query`. + This was `Ok(Err(StdError::ParseErr))` instead of + `Err(SystemError::InvalidResponse)`, implying an error created in the target + contract. +- Deprecate `StdError::Unauthorized` and `StdError::unauthorized` in favour of + custom errors. From now on `StdError` should only be created by the standard + library and should only contain cases the standard library needs. +- Let `impl Display for CanonicalAddr` use upper case hex instead of base64. + This also affects `CanonicalAddr::to_string`. +- Create trait `CustomQuery` for the generic argument in + `QueryRequest`. This allows us to provide + `impl From for QueryRequest` for any custom query. +- Implement `From for Vec`. +- Implement `From for Vec`. +- Add `Binary::into_vec` and `CanonicalAddr::into_vec`. +- The `canonical_length` argument was removed from `mock_dependencies`, + `mock_dependencies_with_balances`. In the now deprecated `MockApi::new`, the + argument is unused. Contracts should not need to set this value and usually + should not make assumptions about the value. +- The canonical address encoding in `MockApi::canonical_address` and + `MockApi::human_address` was changed to an unpredictable representation of + non-standard length that aims to destroy most of the input structure. + +**cosmwasm-storage** + +- Change order of arguments such that `storage` is always first followed by + namespace in `Bucket::new`, `Bucket::multilevel`, `ReadonlyBucket::new`, + `ReadonlyBucket::multilevel`, `bucket` and `bucket_read`. +- Change order of arguments such that `storage` is always first followed by + namespace in `PrefixedStorage::new`, `PrefixedStorage::multilevel`, + `ReadonlyPrefixedStorage::new`, `ReadonlyPrefixedStorage::multilevel`, + `prefixed` and `prefixed_read`. + +**cosmwasm-vm** + +- `CosmCache::new`, `Instance::from_code` and `Instance::from_module` now take + an additional argument to enable/disable printing debug logs from contracts. +- Bump required export `cosmwasm_vm_version_3` to `cosmwasm_vm_version_4`. +- The `canonical_length` argument was removed from `mock_dependencies`, + `mock_dependencies_with_balances` and `MockApi::new_failing`. In the now + deprecated `MockApi::new`, the argument is unused. Contracts should not need + to set this value and usually should not make assumptions about the value. +- The canonical address encoding in `MockApi::canonical_address` and + `MockApi::human_address` was changed to an unpredictable representation of + non-standard length that aims to destroy most of the input structure. + +## 0.10.1 (2020-08-25) + +**cosmwasm-std** + +- Fix bug where `ExternalStorage.range()` would cause VM error if either lower + or upper bound was set + ([#508](https://github.com/CosmWasm/cosmwasm/issues/508)) + +## 0.10.0 (2020-07-30) + +**all** + +- Drop support for Rust versions lower than 1.44.1. + +**cosmwasm-std** + +- Remove error helpers `generic_err`, `invalid_base64`, `invalid_utf8`, + `not_found`, `parse_err`, `serialize_err`, `underflow`, `unauthorized` in + favour of `StdError::generic_err` and friends. +- Implement `From<&[u8; $N]> for Binary` and `From<[u8; $N]> for Binary` for all + `$N <= 32`. +- Add `Context` object that can be used to build Init/Handle/Migrate response + via `add_log`, `add_message`, `set_data` and then convert to the proper type + via `into` or `try_into`. Option to simplify response construction. +- Env uses `HumanAddr` for `message.sender` and `contract_address` +- Remove `Api` argument from `mock_env` +- Implement `From<&[u8]>` and `From>` for `CanonicalAddr` + +**cosmwasm-vm** + +- Remove unused cache size argument from `CosmCache`. +- `set_gas_limit` now panics if the given gas limit exceeds the max. supported + value. +- Increase the max. supported value for gas limit from 10_000_000_000 to + 0x7FFFFFFFFFFFFFFF. +- Add checks to `get_region` for failing early when the contract sends a Region + pointer to the VM that is not backed by a plausible Region. This helps + development of standard libraries. +- Create dedicated `RegionValidationError` and `RegionValidationResult`. +- `Api::human_address` and `Api::canonical_address` now return a pair of return + data and gas usage. +- Remove `NextItem` in favour of a more advanced `FfiResult`, which is used + to store the return result and the gas information consistently across all + APIs. `FfiResult` was changed to `(Result, GasInfo)`. +- Create error type `FfiError::InvalidUtf8` for the cases where the backend + sends invalid UTF-8 in places that expect strings. +- Remove `FfiError::Other` in favour of `FfiError::UserErr` and + `FfiError::Unknown`. +- The `canonicalize_address` and `humanize_address` imports now report user + errors to the contract. +- Bump `cosmwasm_vm_version_2` to `cosmwasm_vm_version_3`. +- `Querier::raw_query` and `QuerierResult` were removed in favour of the new + `Querier::query_raw`, which includes a gas limit parameter for the query. + +## 0.9.4 (2020-07-16) + +**cosmwasm-vm** + +- Add `Instance::create_gas_report` returning a gas report including the + original limit, the remaining gas and the internally/externally used gas. + +## 0.9.3 (2020-07-08) + +**cosmwasm-storage** + +- Add `.remove()` method to `Bucket` and `Singleton`. + +## 0.9.2 (2020-06-29) + +- Downgrade wasmer to 0.17.0. + +## 0.9.1 (2020-06-25) + +**cosmwasm-std** + +- Replace type `Never` with `Empty` because enums with no cases cannot be + expressed in valid JSON Schema. + +## 0.9.0 (2020-06-25) + +Note: this version contains an API bug and should not be used (see +https://github.com/CosmWasm/cosmwasm/issues/451). + +**all** + +- Upgrade wasmer to 0.17.1. +- Drop support for Rust versions lower than 1.43.1 + +**cosmwasm-std** + +- `ReadonlyStorage::get` and all its implementations now return + `Option>`. +- `ReadonlyStorage::range` and all its implementations now always succeed and + return an iterator instead of a result. This is now an iterator over + `Option` instead of `Option>`. +- `Storage::{set, remove}` and all their implementations no longer have a return + value. Previously they returned `StdResult<()>`. +- Trait `Querier` is not `Clone` and `Send` anymore. +- `consume_region` panics on null pointers and returns `Vec` instead of + `StdResult>`. +- Added contract migration mechanism. Contracts can now optionally export a + `migrate` function with the following definition: + ```rust + extern "C" fn migrate(env_ptr: u32, msg_ptr: u32) -> u32; + ``` +- InitResponse no longer has a data field. We always return the contract address + in the data field in the blockchain and don't allow you to override. `handle` + can still make use of the field. +- Rename `MockQuerier::with_staking` to `MockQuerier::update_staking` to match + `::update_balance`. +- The obsolete `StdError::NullPointer` and `null_pointer` were removed. +- Error creator functions are now in type itself, e.g. + `StdError::invalid_base64` instead of `invalid_base64`. The free functions are + deprecated and will be removed before 1.0. + +**cosmwasm-storage** + +- Remove `transactional_deps`. Use `transactional` that just provides a + transactional storage instead. +- `get_with_prefix` returns `Option>` instead of + `StdResult>>`. +- `set_with_prefix` and `remove_with_prefix` return nothing instead of + `StdResult<()>`. +- `RepLog::commit` no longer returns any value (always succeeds). +- `Op::apply` no longer returns any value (always succeeds). + +**cosmwasm-vm** + +- The export `allocate` must not return 0 as a valid address. The contract is + responsible for avoiding this offset in the linear memory. +- The import `db_read` now allocates memory for the return value as part of the + call and returns a pointer to the value as `u32`. The return value 0 means + _key does not exist_. +- The import `db_next` now allocates a memory region for the return key and + value as part of the call and returns a pointer to the region as `u32`. The + data in the region is stored in the format `value || key || keylen`. As + before, an empty key means _no more value_. +- Remove `Instance::get_gas` in favour of `Instance::get_gas_left`. +- All calls from the VM layer to the chain layer also return the amount of gas + used on success. (This is represented by replacing the return value with + `(value, used_gas)`). Gas usage across the system is then tracked in the VM + layer, which allows us to halt the contract during an import, as soon as we + can prove that we used all allocated gas. +- Remove instance caching, which is disabled since 0.8.1 as it is not stable. + Remove `CosmCache::store_instance`; you can not call `Instance::recylce` + directly to get back the external dependencies. +- Rename `MockQuerier::with_staking` to `MockQuerier::update_staking` to match + `::update_balance`. +- Instead of panicking, `read_region`/`write_region`/`get_region`/`set_region` + now return a new `CommunicationError::DerefErr` when dereferencing a pointer + provided by the contract fails. +- `FfiError::set_message` was removed because errors should be immutable. Use + `FfiError::other` to create an error with the desired error message. +- The import implementation of `db_scan` now errors instead of returning an + error code for an invalid order value. The return type was changed to `u32`. +- Remove `StorageIteratorItem` in favour of the new types `StorageIterator` and + `NextItem`. `StorageIterator` is a custom iterator type that does not + implement Rust's `Iterator` trait, allowing it to communicate the used gas + value of the last `next` call to the VM. +- Don't report any `VmError` back to the contract in `canonicalize_address` and + `humanize_address`. Only invalid inputs should be reported. +- Move error cases `VmError::RegionLengthTooBig` and `VmError::RegionTooSmall` + into `CommunicationError`. +- In the `canonicalize_address` implementation, invalid UTF-8 inputs now result + in `CommunicationError::InvalidUtf8`, which is not reported back to the + contract. A standard library should ensure this never happens by correctly + encoding string input values. +- Merge trait `ReadonlyStorage` into `Storage`. +- The imports `canonicalize_address` and `humanize_address` now return a memory + address to an error `Region`. If this address is 0, the call succeeded. +- Bump `cosmwasm_vm_version_1` to `cosmwasm_vm_version_2`. + +## 0.8.1 (2020-06-08) + +**cosmwasm-std** + +- The arguments of `log` changed from `&str` to `ToString`, allowing to pass + various types like `String`, `HumanAddr`, `Uint128` or primitive integers + directly. +- Add `From>` and `Into>` implementations for `Binary` for + zero-copy conversions. + +**cosmwasm-vm** + +- Deprecated `Instance::get_gas` in favour of `Instance::get_gas_left`. The old + method will remain available for a while but will issue a deprecation warning + when used. +- Disable instance caching by treating every cache size as 0. Instance caching + is not safe as the same Wasm memory is reused across multiple executions. +- The storage of an `Instance` can now be set into readonly mode, which is + checked by the writing storage imports `db_write` and `db_remove`. Read-only + mode is off by default for backwards compatibility. `call_query_raw` now sets + the instance's storage to readonly. +- The new error case `VmError::WriteAccessDenied` is returned when a contract + calls an import that potentially writes to storage during a query. + +## 0.8.0 (2020-05-25) + +**all** + +- Upgrade schemars to 0.7. +- Upgrade wasmer to 0.17. +- Update snafu to 0.6. +- Minimal supported Rust version is 1.41. +- Split `Region.len` into `Region.capacity` and `Region.length`, where the new + capacity is the number of bytes available and `length` is the number of bytes + used. This is a breaking change in the contract-vm interface, which requires + the same memory layout of the `Region` struct on both sides. +- Add `remove` method to `Storage` trait. +- (feature-flagged) Add `range` method to `ReadonlyStorage` trait. This returns + an iterator that covers all or a subset of the items in the db ordered + ascending or descending by key. +- Add new feature flag `iterator` to both packages to enable `range` + functionality. This is used to allow potential porting to chains that use + Merkle Tries (which don't allow iterating over ranges). +- All serialized JSON types now use snake_case mappings for names. This means + enum fields like `ChangeOwner` will map to `change_owner` in the underlying + JSON, not `changeowner`. This is a breaking change for the clients. +- Public interface between contract and runtime no longer uses `String` to + represent an error, but rather serializes `ApiError` as a rich JSON error. +- Return value from `env.write_db` and `env.remove_db` to allow error reporting. +- Query responses are now required to contain valid JSON. +- Renamed all `*_db` wasm imports to `db_*` +- Merge `cw-storage` repo as subpackage, now `cosmwasm-storage` +- Add iterator support to `cosmwasm-storage` +- `Coin.amount` is now `Uint128` rather than `String`. Uint128 serializes as a + string in JSON, but parses into a u128 data in memory. It also has some + operator overloads to allow easy math operations on `Coin` types, as well as + enforcing valid amounts. +- `Env` no longer has a `contract.balance` element. If you need this info, + please use the `Querier` to get this info. As of Cosmos-SDK 0.39 this needs + extra storage queries to get the balance, so we only do those queries when + needed. +- `Env.message.sent_funds` is a `Vec` not `Option>`. We will + normalize the go response in `go-cosmwasm` before sending it to the contract. +- `Env.message.signer` was renamed to `Env.message.sender`. +- `Env.block.{height,time}` are now `u64` rather than `i64`. + +**cosmwasm-schema** + +- This new crate now contains the implementations for generating JSON Schema + files from interface types. It exposes the functions `export_schema`, + `export_schema_with_title`, and `schema_for`. + +**cosmwasm-std** + +- Make all symbols from `cosmwasm::memory` crate internal, as those symbols are + not needed by users of the library. +- Rename `cosmwasm::mock::dependencies` -> `cosmwasm::mock::mock_dependencies` + to differentiate between testing and production `External`. +- Export all symbols from `cosmwasm::mock` as the new non-wasm32 module + `cosmwasm::testing`. Export all remaining symbols at top level (e.g. + `use cosmwasm::traits::{Api, Storage};` + `use cosmwasm::encoding::Binary;` + becomes `use cosmwasm::{Api, Binary, Storage};`). +- Rename package `cosmwasm` to `cosmwasm-std`. +- The export `allocate` does not zero-fill the allocated memory anymore. +- Add `remove_db` to the required imports of a contract. +- (feature-flagged) add `scan_db` and `next_db` callbacks from wasm contract to + VM. +- `serde::{from_slice, to_vec}` return `cosmwasm_std::Result`, no more need to + use `.context(...)` when calling these functions +- Split `Response` into `InitResponse` and `HandleResponse`; split + `ContractResult` into `InitResult` and `HandleResult`. +- Create explicit `QueryResponse`, analogue to `InitResponse` and + `HandleResponse`. +- The exports `cosmwasm_vm_version_1`, `allocate` and `deallocate` are now + private and can only be called via the Wasm export. Make sure to `use` + `cosmwasm_std` at least once in the contract to pull in the C exports. +- Add `Querier` trait and `QueryRequest` for query callbacks from the contract, + along with `SystemError` type for the runtime rejecting messages. +- `QueryRequest` takes a generic `Custom(T)` type that is passed opaquely to the + end consumer (`wasmd` or integration test stubs), allowing custom queries to + native code. +- `{Init,Handle,Query}Result` are now just aliases for a concrete `ApiResult` + type. +- Support results up to 128 KiB in `ExternalStorage.get`. +- The `Storage` trait's `.get`, `.set` and `.remove` now return a `Result` to + allow propagation of errors. +- Move `transactional`, `transactional_deps`, `RepLog`, `StorageTransaction` + into crate `cosmwasm-storage`. +- Rename `Result` to `StdResult` to differentiate between the auto-`use`d + `core::result::Result`. Fix error argument to `Error`. +- Complete overhaul of `Error` into `StdError`: + - The `StdError` enum can now be serialized and deserialized (losing its + backtrace), which allows us to pass them over the Wasm/VM boundary. This + allows using fully structured errors in e.g. integration tests. + - Auto generated snafu error constructor structs like `NotFound`/`ParseErr`/… + have been intenalized in favour of error generation helpers like + `not_found`/`parse_err`/… + - All error generator functions now return errors instead of results. + - Error cases don't contain `source` fields anymore. Instead source errors are + converted to standard types like `String`. For this reason, both + `snafu::ResultExt` and `snafu::OptionExt` cannot be used anymore. + - Backtraces became optional. Use `RUST_BACKTRACE=1` to enable them. + - `Utf8Err`/`Utf8StringErr` merged into `StdError::InvalidUtf8` + - `Base64Err` renamed into `StdError::InvalidBase64` + - `ContractErr`/`DynContractErr` merged into `StdError::GeneralErr` + - The unused `ValidationErr` was removed + - `StdError` is now + [non_exhaustive](https://doc.rust-lang.org/1.35.0/unstable-book/language-features/non-exhaustive.html), + making new error cases non-breaking changes. +- `ExternalStorage.get` now returns an empty vector if a storage entry exists + but has an empty value. Before, this was normalized to `None`. +- Reorganize `CosmosMsg` enum types. They are now split by modules: + `CosmosMsg::Bank(BankMsg)`, `CosmosMsg::Custom(T)`, `CosmosMsg::Wasm(WasmMsg)` +- CosmosMsg is now generic over the content of `Custom` variant. This allows + blockchains to support custom native calls in their Cosmos-SDK apps and + developers to make use of them in CosmWasm apps without forking the + `cosmwasm-vm` and `go-cosmwasm` runtime. +- Add `staking` feature flag to expose new `StakingMsg` types under `CosmosMsg` + and new `StakingRequest` types under `QueryRequest`. +- Add support for mocking-out staking queries via `MockQuerier.with_staking` +- `from_slice`/`from_binary` now require result type to be `DeserializeOwned`, + i.e. the result must not contain references such as `&str`. + +**cosmwasm-vm** + +- Make `Instance.memory`/`.allocate`/`.deallocate`/`.func` crate internal. A + user of the VM must not access the instance's memory directly. +- The imports `env.canonicalize_address`, `env.humanize_address` and + `env.read_db` don't return the number of bytes written anymore. This value is + now available in the resulting regions. Negative return values are errors, 0 + is success and values greater than 0 are reserved for future use. +- Change the required interface version guard export from `cosmwasm_api_0_6` to + `cosmwasm_vm_version_1`. +- Provide implementations for `remove_db` and (feature-flagged) `scan_db` and + `next_db` +- Provide custom `serde::{from_slice, to_vec}` implementation separate from + `cosmwasm_std`, so we can return cosmwasm-vm specific `Result` (only used + internally). +- `call_{init,handle,query}` and the `cosmwasm_vm::testing` wrappers return + standard `Result` types now, eg. `Result`. +- Add length limit when reading memory from the instance to protect against + malicious contracts creating overly large `Region`s. +- Add `Instance.get_memory_size`, giving you the peak memory consumption of an + instance. +- Remove `cosmwasm_vm::errors::CacheExt`. +- Move `cosmwasm_vm::errors::{Error, Result}` to + `cosmwasm_vm::{VmError, VmResult}` and remove generic error type from result. +- The import `db_read` now returns an error code if the storage key does not + exist. The latest standard library converts this error code back to a `None` + value. This allows differentiating non-existent and empty storage entries. +- Make `Instance::from_module`, `::from_wasmer` and `::recycle` crate-internal. +- Create explicit, public `Checksum` type to identify Wasm blobs. +- `CosmCache::new` now takes supported features as an argument. +- Rename `VmError::RegionTooSmallErr` to `VmError::RegionTooSmall`. +- Rename `VmError::RegionLengthTooBigErr` to `VmError::RegionLengthTooBig`. +- Change property types to owned string in `VmError::UninitializedContextData`, + `VmError::ConversionErr`, `VmError::ParseErr` and `VmError::SerializeErr`. +- Remove `VmError::IoErr` in favour of `VmError::CacheErr`. +- Simplify `VmError::CompileErr`, `VmError::ResolveErr` and + `VmError::WasmerRuntimeErr` to just hold a string with the details instead of + the source error. +- Remove `VmError::WasmerErr` in favour of the new `VmError::InstantiationErr`. +- The snafu error builders from `VmError` are now private, i.e. callers can only + use the errors, not create them. +- `VmError` is now `#[non_exhaustive]`. +- Split `VmError::RuntimeErr` in `VmError::BackendErr` and + `VmError::GenericErr`; rename `VmError::WasmerRuntimeErr` to + `VmError::RuntimeErr`. +- Add `Instance.with_querier` analogue to `Instance.with_storage`. + +## 0.7.2 (2020-03-23) + +**cosmwasm** + +- Fix JSON schema type of `Binary` from int array (wrong) to string (right). +- Make `Extern` not `Clone`able anymore. Before cloning led to copying the data + for mock storage and copying a stateless bridge for the external storage, + which are different semantics. +- Remove public `cosmwasm::imports::dependencies`. A user of this library does + not need to call this explicitly. Dependencies are created internally and + passed as an argument in `exports::do_init`, `exports::do_handle` and + `exports::do_query`. +- Make `ExternalStorage` not `Clone`able anymore. This does not copy any data, + so a clone could lead to unexpected results. + +## 0.7.1 (2020-03-11) + +**cosmwasm_vm** + +- Avoid unnecessary panic when checking corrupted wasm file. +- Support saving the same wasm to cache multiple times. + +## 0.7.0 (2020-02-26) + +**cosmwasm** + +- Rename `Slice` to `Region` to simplify differentiation between Wasm memory + region and serde's `from_slice` +- Rename `Params` to `Env`, `mock_params` to `mock_env` for clearer naming (this + is information on the execution environment) +- `Response.log` is not a vector of key/value pairs that can later be indexed by + Tendermint. + +**cosmwasm_vm** + +- Remove export `cosmwasm_vm::read_memory`. Using this indicates an + architectural flaw, since this is a method for host to guest communication + inside the VM and not needed for users of the VM. +- Create new type `cosmwasm_vm:errors::Error::RegionTooSmallErr`. +- Change return type of `cosmwasm_vm::write_memory` to `Result` to + make it harder to forget handling errors. +- Fix missing error propagation in `do_canonical_address`, `do_human_address` + and `allocate`. +- Update error return codes in import `c_read`. +- Rename imports `c_read`/`c_write` to `read_db`/`write_db`. +- Rename imports `c_canonical_address`/`c_human_address` to + `canonicalize_address`/`humanize_address`. +- Add `cosmwasm_vm::testing::test_io` for basic memory allocation/deallocation + testing between host and guest. +- Make `ValidationErr.msg` a dynamic `String` including relevant runtime + information. +- Remove export `check_api_compatibility`. The VM will take care of calling it. +- Let `check_api_compatibility` check imports by fully qualified identifier + `.`. +- Make gas limit immutable in `cosmwasm_vm::instance::Instance`. It is passed + once at construction time and cannot publicly be manipulated anymore. +- Remove `take_storage`/`leave_storage` from `cosmwasm_vm::Instance`. + +## 0.6 + +[Define canonical address callbacks](https://github.com/CosmWasm/cosmwasm/issues/73) + +- Use `&[u8]` for addresses in params +- Allow contracts to resolve human readable addresses (`&str`) in their json + into a fixed-size binary representation +- Provide mocks for unit testing and integration tests + +- Separate out `Storage` from `ReadOnlyStorage` as separate traits + +## 0.5 + +### 0.5.2 + +This is the first documented and supported implementation. It contains the basic +feature set. `init` and `handle` supported for modules and can return messages. +A stub implementation of `query` is done, which is likely to be deprecated soon. +Some main points: + +- The build-system and unit/integration-test setup is all stabilized. +- Cosmwasm-vm supports singlepass and cranelift backends, and caches modules on + disk and instances in memory (lru cache). +- JSON Schema output works + +All future Changelog entries will reference this base + +[1.0.0-rc.0]: + https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta8...v1.0.0-rc.0 +[1.0.0-beta8]: + https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta7...v1.0.0-beta8 +[1.0.0-beta7]: + https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta6...v1.0.0-beta7 +[1.0.0-beta6]: + https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta5...v1.0.0-beta6 +[1.0.0-beta5]: + https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta4...v1.0.0-beta5 +[1.0.0-beta4]: + https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta3...v1.0.0-beta4 +[1.0.0-beta3]: + https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta...v1.0.0-beta3 +[1.0.0-beta]: https://github.com/CosmWasm/cosmwasm/compare/v0.16.2...v1.0.0-beta +[0.16.2]: https://github.com/CosmWasm/cosmwasm/compare/v0.16.1...v0.16.2 +[0.16.1]: https://github.com/CosmWasm/cosmwasm/compare/v0.16.0...v0.16.1 +[0.16.0]: https://github.com/CosmWasm/cosmwasm/compare/v0.15.2...v0.16.0 +[0.15.2]: https://github.com/CosmWasm/cosmwasm/compare/v0.15.1...v0.15.2 +[0.15.1]: https://github.com/CosmWasm/cosmwasm/compare/v0.15.0...v0.15.1 +[0.15.0]: https://github.com/CosmWasm/cosmwasm/compare/v0.14.1...v0.15.0 +[0.14.1]: https://github.com/CosmWasm/cosmwasm/compare/v0.14.0...v0.14.1 +[0.14.0]: https://github.com/CosmWasm/cosmwasm/compare/v0.13.1...v0.14.0 +[0.13.2]: https://github.com/CosmWasm/cosmwasm/compare/v0.13.1...v0.13.2 +[0.13.1]: https://github.com/CosmWasm/cosmwasm/compare/v0.13.0...v0.13.1 +[0.13.0]: https://github.com/CosmWasm/cosmwasm/compare/v0.12.0...v0.13.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index f365e59251..d7ddd62240 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,1545 +1,1394 @@ # CHANGELOG -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to -[Semantic Versioning](https://semver.org/spec/v2.0.0.html). +[Keep a Changelog]: https://keepachangelog.com/en/1.0.0 +[Semantic Versioning]: https://semver.org/spec/v2.0.0.html -## [Unreleased] +The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning]. -## [1.1.9] - 2022-12-06 +[Unreleased] changes -### Fixed +--- -- cosmwasm-schema: Fix type fully qualified path to symbol `QueryResponses` in - macro `cosmwasm_schema::generate_api!` ([#1527]). +## [3.0.2] - 2025-08-26 -[#1527]: https://github.com/CosmWasm/cosmwasm/issues/1527 +## Changed -## [1.1.8] - 2022-11-22 +- cosmwasm repository: Add and fix crate-level documentation for all CosmWasm crates ([#2510]) +- cosmwasm repository: Minor maintenance fixes ([#2514]) +- cosmwasm repository: Unified security policy ([#2515]) +- cosmwasm-crypto: Correct malformed crates.io links in crypto ([#2518]) +- cosmwasm repository: Updated copyright notice ([#2519]) +- cosmwasm repository: Migrate CircleCI to GitHub Actions ([#2523]) +- cosmwasm repository: Remove unused configuration files ([#2524]) +- cosmwasm repository: Enable checks on pull request ([#2527]) +- cosmwasm-crypto: Fix `ed25519-zebra` to version **`=4.0.3`** ([#2528]) +- cosmwasm repository: Unified formatting of Cargo.toml files ([#2529]) +- cosmwasm repository: Initial Task script ([#2530]) +- cosmwasm repository: Update README ([#2531]) +- cosmwasm repository: Local dependency paths ([#2532]) +- cosmwasm-core: Add tests for `cosmwasm-core` ([#2533]) +- cosmwasm repository: Unified dependencies ([#2534]) +- cosmwasm-std: Fix typos ([#2537]) + +[#2510]: https://github.com/CosmWasm/cosmwasm/pull/2510 +[#2514]: https://github.com/CosmWasm/cosmwasm/pull/2514 +[#2515]: https://github.com/CosmWasm/cosmwasm/pull/2515 +[#2518]: https://github.com/CosmWasm/cosmwasm/pull/2518 +[#2519]: https://github.com/CosmWasm/cosmwasm/pull/2519 +[#2523]: https://github.com/CosmWasm/cosmwasm/pull/2523 +[#2524]: https://github.com/CosmWasm/cosmwasm/pull/2524 +[#2527]: https://github.com/CosmWasm/cosmwasm/pull/2527 +[#2528]: https://github.com/CosmWasm/cosmwasm/pull/2528 +[#2529]: https://github.com/CosmWasm/cosmwasm/pull/2529 +[#2530]: https://github.com/CosmWasm/cosmwasm/pull/2530 +[#2531]: https://github.com/CosmWasm/cosmwasm/pull/2531 +[#2532]: https://github.com/CosmWasm/cosmwasm/pull/2532 +[#2533]: https://github.com/CosmWasm/cosmwasm/pull/2533 +[#2534]: https://github.com/CosmWasm/cosmwasm/pull/2534 +[#2537]: https://github.com/CosmWasm/cosmwasm/pull/2537 + +## [3.0.1] - 2025-06-26 -### Fixed +## Added -- cosmwasm-schema: Fix type params on `QueryMsg` causing a compiler error when - used with the `QueryResponses` derive macro. +- cosmwasm-std: Add missing export for `ValidatorMetadata` ([#2511]) -## [1.1.6] - 2022-11-16 +[#2511]: https://github.com/CosmWasm/cosmwasm/pull/2511 -### Added +## [3.0.0] - 2025-06-23 -- cosmwasm-std: Add `From` implementations to convert between - `CanonicalAddr`/`Binary` as well as `CanonicalAddr`/`HexBinary` ([#1463]). -- cosmwasm-std: Add `From` implementations to convert `u8` arrays to - `CanonicalAddr` ([#1463]). -- cosmwasm-std: Implement `PartialEq` between `CanonicalAddr` and - `HexBinary`/`Binary` ([#1463]). +## Added -[#1463]: https://github.com/CosmWasm/cosmwasm/pull/1463 +- cosmwasm-std: Implement `From for u{64,128}`, + `From for u128`, `From for i{64,128}`, and + `From for i128` ([#2268]) +- cosmwasm-std: Implement `Uint128::from_{be,le}_bytes` and + `Uint64::from_{be,le}_bytes`. ([#2269]) +- cosmwasm-std: Added new `Ibc2Msg` and `CosmosMsg::Ibc2` variant ([#2340], + [#2390], [#2403]) +- cosmwasm-std: Added `ibc2_port` to `ContractInfoResponse`. ([#2390], [#2403]) +- cosmwasm-vm: Added `ibc2_packet_receive` entrypoint ([#2403]) +- cosmwasm-vm: Add IBC Callbacks entrypoints to the `Entrypoints` enum. + ([#2438]) +- cosmwasm-std: Add `WriteAcknowledgement` to `Ibc2Msg` - ([#2425]) +- cosmwasm-vm: Add `ibc2_packet_timeout` entrypoint - ([#2454]) +- cosmwasm-std: Add `Ibc2PacketTimeoutMsg` message - ([#2454]) +- cosmwasm-std: Add `cosmwasm_std::testing::Envs`, which is an `Env` factory for + testing environments. It auto-increments block heights and timestamps. It + allows for advanced configurations such as custom address prefixes. ([#2442]) +- cosmwasm-vm: Add support for `ibc2_packet_ack` endpoint ([#2474]) +- cosmwasm-std: Add support for `ibc2_packet_ack` endpoint ([#2474]) +- cosmwasm-std: Add `Ibc2PacketSendMsg` message - ([#2477]) +- cosmwasm-vm: Add `ibc2_packet_send` entrypoint ([#2477]) +- cosmwasm-std: Add Tx hash to TransactionInfo and make it non exhaustive + ([#2480]) +- cosmwasm-std: Add `WasmQuery::RawRange` query to allow querying raw storage + ranges of different contracts. ([#2471]) +- cosmwasm-std: Add `transfer` field to `IbcDestinationCallbackMsg`, providing + an easier way to handle an IBC transfer in a destination callback. ([#2484]) +- cw-schema/cw-schema-derive: Add new easily compressible schema and associated + proc-macro ([#2495]) +- cosmwasm-schema: Generate new cw-schemas alongside JSON schemas ([#2495]) + +## Changed + +- cosmwasm-std: Deprecate `abort` feature. The panic handler is now always + enabled. ([#2337]) +- cosmwasm-std: Document safety invariants of the internal memory repr ([#2344]) +- cosmwasm-std: Enforce non-null pointers using `ptr::NonNull` in the internal + memory repr ([#2344]) +- cosmwasm-std: Make `instantiate2_address_impl` public and let it take a new + `len` argument to allow truncating address data as part of the generation + process. ([#2155]) +- cosmwasm-vm: Updated wasmer to 5.0.4 ([#2374]) +- cosmwasm-vm: Charge gas for `write_region` ([#2378]) +- cosmwasm-vm: Remove the `cranelift` feature. This was doing nothing since + 2.2.0 already. ([#2262]) +- cosmwasm-std: Remove previously deprecated `from_slice`, `from_binary`, + `to_vec` and `to_binary`. ([#2156]) +- cosmwasm-vm: The testing functions `cosmwasm_vm::testing::*` do not require + the contract's message types to implement `schemars::JsonSchema` anymore. This + makes the use of `schemars` optional for contracts. ([#2201]) +- cosmwasm-std: Remove `schemars::JsonSchema` requirement from `CustomMsg`. + ([#2201]) +- cosmwasm-std: `Int256::new`/`Int512::new` now take an `i128` argument instead + of bytes. Use `::from_be_bytes` if you need the old behaviour. ([#2367]) +- cosmwasm-std: `Uint256::new`/`Uint512::new` now take an `u128` argument + instead of bytes. Use `::from_be_bytes` if you need the old behaviour. + ([#2367]) +- cosmwasm-std: Deprecate `{Decimal,Decimal256}::raw` and + `{SignedDecimal,SignedDecimal256}::raw` in favour of e.g. + `Decimal::new(Uint128::new(value))`. ([#2399]) +- cosmwasm-std: Deprecate `Uint256::from_u128` and `Int256::from_i128` in favour + of `::new`. ([#2399]) +- cosmwasm-std: Move `MemoryStorage` to `cosmwasm_std::testing::MockStorage`. + ([#2237]) +- cosmwasm-std: Remove previously deprecated `cosmwast_std::testing::mock_info`. + Use `cosmwasm_std::testing::message_info` instead. ([#2393]) +- cosmwasm-std: Remove abort feature. ([#2141]) +- cosmwasm-std: Change `Coin::amount` to `Uint256` instead of `Uint128`. + ([#2458]) +- cosmwasm-std: Replace dependency `serde-json-wasm` with `serde_json`. + ([#2195]) +- cosmwasm-std: Make `GovMsg` `#[non_exhaustive]` for consistency. ([#2347]) +- cosmwasm-crypto: Upgrade ark-\* dependencies to 0.5.0. ([#2432]) +- cosmwasm-std: Remove support for `BankQuery::AllBalances` and + `query_all_balances`. ([#2433]) +- cosmwasm-std: source_client instead of channel_id in IBCv2 - ([#2450]) +- cosmwasm-std: Remove previously deprecated `IbcQuery::ListChannels` and + `ListChannelsResponse`. ([#2223]) +- cosmwasm-std: Remove export of `ExternalApi`, `ExternalQuerier` and + `ExternalStorage` as those are only needed by export implementations in + cosmwasm-std. ([#2467]) +- cosmwasm-vm: Update wasmer to 5.0.6. ([#2472]) +- cosmwasm-std: Add a new `exports` feature which needs to be enabled for the + primary cosmwasm_std dependency of a contract. +- cosmwasm-vm: Enable partial reference-type support, enabling contracts + compiled with Rust 1.82 or newer to be stored. ([#2473]) +- cosmwasm-std: Removed IBC fees ([#2479]) +- cosmwasm-schema: Remove unused result types from trait definition ([#2495]) +- cosmwasm-std: Split up `Validator` type into `Validator` and + `ValidatorMetadata` to allow adding more fields to `ValidatorResponse` in the + future. ([#2501]) +- cosmwasm-std: Redesigned `StdError` to be more flexible and less immutable + ([#2500]) + +## Fixed + +- cosmwasm-schema: The schema export now doesn't overwrite existing + `additionalProperties` values anymore ([#2310]) +- cosmwasm-vm: Fix CWA-2025-002. +- cosmwasm-std: Fix deserialization of `DenomMetadata`. ([#2417]) + +[#2141]: https://github.com/CosmWasm/cosmwasm/issues/2141 +[#2155]: https://github.com/CosmWasm/cosmwasm/issues/2155 +[#2156]: https://github.com/CosmWasm/cosmwasm/issues/2156 +[#2195]: https://github.com/CosmWasm/cosmwasm/issues/2195 +[#2201]: https://github.com/CosmWasm/cosmwasm/issues/2201 +[#2223]: https://github.com/CosmWasm/cosmwasm/issues/2223 +[#2237]: https://github.com/CosmWasm/cosmwasm/issues/2237 +[#2262]: https://github.com/CosmWasm/cosmwasm/issues/2262 +[#2268]: https://github.com/CosmWasm/cosmwasm/issues/2268 +[#2269]: https://github.com/CosmWasm/cosmwasm/issues/2269 +[#2310]: https://github.com/CosmWasm/cosmwasm/pull/2310 +[#2337]: https://github.com/CosmWasm/cosmwasm/issues/2337 +[#2340]: https://github.com/CosmWasm/cosmwasm/pull/2340 +[#2344]: https://github.com/CosmWasm/cosmwasm/pull/2344 +[#2347]: https://github.com/CosmWasm/cosmwasm/issues/2347 +[#2367]: https://github.com/CosmWasm/cosmwasm/issues/2367 +[#2374]: https://github.com/CosmWasm/cosmwasm/issues/2374 +[#2378]: https://github.com/CosmWasm/cosmwasm/issues/2378 +[#2390]: https://github.com/CosmWasm/cosmwasm/issues/2390 +[#2393]: https://github.com/CosmWasm/cosmwasm/issues/2393 +[#2399]: https://github.com/CosmWasm/cosmwasm/pull/2399 +[#2403]: https://github.com/CosmWasm/cosmwasm/pull/2403 +[#2417]: https://github.com/CosmWasm/cosmwasm/pull/2417 +[#2425]: https://github.com/CosmWasm/cosmwasm/pull/2425 +[#2432]: https://github.com/CosmWasm/cosmwasm/pull/2432 +[#2433]: https://github.com/CosmWasm/cosmwasm/pull/2433 +[#2438]: https://github.com/CosmWasm/cosmwasm/pull/2438 +[#2442]: https://github.com/CosmWasm/cosmwasm/pull/2442 +[#2450]: https://github.com/CosmWasm/cosmwasm/pull/2450 +[#2454]: https://github.com/CosmWasm/cosmwasm/pull/2454 +[#2458]: https://github.com/CosmWasm/cosmwasm/pull/2458 +[#2467]: https://github.com/CosmWasm/cosmwasm/pull/2467 +[#2471]: https://github.com/CosmWasm/cosmwasm/pull/2471 +[#2472]: https://github.com/CosmWasm/cosmwasm/pull/2472 +[#2473]: https://github.com/CosmWasm/cosmwasm/pull/2473 +[#2477]: https://github.com/CosmWasm/cosmwasm/pull/2477 +[#2479]: https://github.com/CosmWasm/cosmwasm/pull/2479 +[#2480]: https://github.com/CosmWasm/cosmwasm/pull/2480 +[#2484]: https://github.com/CosmWasm/cosmwasm/pull/2484 +[#2495]: https://github.com/CosmWasm/cosmwasm/pull/2495 +[#2500]: https://github.com/CosmWasm/cosmwasm/pull/2500 +[#2501]: https://github.com/CosmWasm/cosmwasm/pull/2501 + +## [2.2.0] - 2024-12-17 + +### Added + +- cosmwasm-std: Add `from_msgpack`, `to_msgpack_vec` and `to_msgpack_binary`. + These functions are meant to be used similarly to their JSON counterparts. + [MessagePack](https://msgpack.org) is a more compact, binary encoding. + ([#2118]) +- cosmwasm-std: Add `IbcMsg::{PayPacketFee, PayPacketFeeAsync}` and + `IbcQuery::FeeEnabledChannel` to allow contracts to incentivize IBC packets + using IBC Fees. ([#2196]) +- cosmwasm-vm: Add `Config` that allows to configure the limits for static Wasm + validation. ([#2220]) +- cosmwasm-check: Add `--wasm-limits` flag to supply configured limits for + static validation. ([#2220]) +- cosmwasm-std: Add `migrate_with_info` call implementation for the extended + `migrate` entrypoint function ([#2212]) +- cosmwasm-vm: Export a new `migrate_with_info` function ([#2212]) +- cosmwasm-derive: Add support for migrate method with + `migrate_info: MigrateInfo` argument. ([#2212]) +- cosmwasm-vm: Add `Cache::store_code` + +[#2118]: https://github.com/CosmWasm/cosmwasm/pull/2118 +[#2196]: https://github.com/CosmWasm/cosmwasm/pull/2196 +[#2220]: https://github.com/CosmWasm/cosmwasm/pull/2220 +[#2212]: https://github.com/CosmWasm/cosmwasm/pull/2212 ### Changed -- all: Bump a few dependency versions to make the codebase compile with - `-Zminimal-versions` ([#1465]). -- cosmwasm-profiler: Package was removed 🪦. It served its job showing us that - we cannot properly measure different runtimes for differet Wasm opcodes. -- cosmwasm-schema: schema generation is now locked to produce strictly - `draft-07` schemas -- cosmwasm-schema: `QueryResponses` derive now sets the `JsonSchema` trait bound - on the generated `impl` block. This allows the contract dev to not add a - `JsonSchema` trait bound on the type itself. +- cosmwasm-std: `Binary`, `HexBinary` and `Checksum` are now encoded as binary + blobs when used together with a "compact" `serde` encoding. A compact encoding + is an encoding that returns `false` from + [`is_human_readable`](https://docs.rs/serde/latest/serde/trait.Serializer.html#method.is_human_readable). + This is to make these types more efficient when used together with the new + [MessagePack](https://msgpack.org) encoding. ([#2118]) +- cosmwasm-std: Let `mock_env` return a contract address that is valid bech32 + and uses the same bech32 prefix as `MockApi`; Change `MOCK_CONTRACT_ADDR` + value to match the contract address from `mock_env`. ([#2211]) +- cosmwasm-vm: Let `mock_env` return a contract address that is valid bech32 and + uses the same bech32 prefix as `MockApi`; Change `MOCK_CONTRACT_ADDR` value to + match the contract address from `mock_env`. ([#2211]) +- cosmwasm-derive: Automatically detect whether the package is a dependency or + the primary package, only expanding entrypoints for the primary package. This + effectively deprecates the usage of the `library` feature pattern. + + Note: This feature does **NOT** interact well with workspaces due to a cargo + bug. If you have multiple contracts in a workspace, you might still want to + use the library feature ([#2246]) + +- cosmwasm-std: Deprecate `BankQuery::AllBalances` and `IbcQuery::ListChannels`. + Both are inherently problematic to use because the returned entries are + unbounded. ([#2247]) +- cosmwasm-vm: Upgrade Wasmer to 4.3.7; Bump `MODULE_SERIALIZATION_VERSION` to + "v20". ([#2255]) +- cosmwasm-vm: Effectively remove the `cranelift` feature. It still exists but + is only a no-op for semver compatibility. It will now unconditionally use the + singlepass compiler. ([#2260]) +- cosmwasm-vm: Automatically derive cache version from function hashes and the + Wasmer version ([#2250]) + +[#2118]: https://github.com/CosmWasm/cosmwasm/pull/2118 +[#2211]: https://github.com/CosmWasm/cosmwasm/issues/2211 +[#2246]: https://github.com/CosmWasm/cosmwasm/pull/2246 +[#2247]: https://github.com/CosmWasm/cosmwasm/pull/2247 +[#2255]: https://github.com/CosmWasm/cosmwasm/pull/2255 +[#2260]: https://github.com/CosmWasm/cosmwasm/pull/2260 +[#2250]: https://github.com/CosmWasm/cosmwasm/pull/2250 + +## [2.1.5] - 2024-12-10 + +- cosmwasm-vm: Add `Cache::store_code` + +## [2.1.4] - 2024-09-23 -[#1465]: https://github.com/CosmWasm/cosmwasm/pull/1465 +### Fixed -## [1.1.5] - 2022-10-17 +- cosmwasm-vm: Fix CWA-2024-007 and CWA-2024-008. -### Added +## [2.1.3] - 2024-08-08 -- cosmwasm-std: Add `wrapping_add`, `wrapping_sub`, `wrapping_mul` and - `wrapping_pow` to `Uint256`/`Uint512`. -- cosmwasm-schema: Better error messaging when attempting to compile schema - generator for `wasm32` -- cosmwasm-vm: In the `secp256k1_verify`, `secp256k1_recover_pubkey`, - `ed25519_verify` and `ed25519_batch_verify` import implementations we now exit - early if the gas left is not sufficient to perform the operation. +### Fixed -### Changed +- cosmwasm-vm: Problem with caching related to CWA-2024-004. Please upgrade + directly to this version instead of the previous one. -- cosmwasm-std: Remove `non_exhaustive` from IBC types `IbcChannelOpenMsg`, - `IbcChannelConnectMsg` and `IbcChannelCloseMsg` in order to allow exhaustive - matching over the possible scenarios without an unused fallback case - ([#1449]). +## [2.1.2] - 2024-08-08 -[#1449]: https://github.com/CosmWasm/cosmwasm/pull/1449 +### Fixed -## [1.1.4] - 2022-10-03 +- cosmwasm-vm: Fix CWA-2024-004 + +## [2.1.1] - 2024-07-30 ### Fixed -- cosmwasm-schema: Properly analyze schemas generated for `untagged` enums +- cosmwasm-std: Make fields of `IbcAckCallbackMsg` and `IbcTimeoutCallbackMsg` + public. ([#2191]) +- cosmwasm-std: Add default implementation for `Storage::range` to make + `iterator` feature additive. ([#2197]) -## [1.1.3] - 2022-09-29 +[#2191]: https://github.com/CosmWasm/cosmwasm/pull/2191 +[#2197]: https://github.com/CosmWasm/cosmwasm/pull/2197 + +## [2.1.0] - 2024-07-11 ### Fixed -- cosmwasm-schema: `IntegrityError` is now public +- cosmwasm-std: Fix CWA-2024-002 +- cosmwasm-std: Fix `Reply` deserialization on CosmWasm 1.x chains ([#2159]) +- cosmwasm-std: Updated `QueryRequest` enum to use the default generic parameter + `Empty`. ([#2165]) -## [1.1.2] - 2022-09-19 +[#2159]: https://github.com/CosmWasm/cosmwasm/pull/2159 +[#2165]: https://github.com/CosmWasm/cosmwasm/pull/2165 ### Added -- cosmwasm-std: Add testing macro `assert_approx_eq!` for comparing two integers - to be relatively close to each other ([#1417]). -- cosmwasm-std: Add `HexBinary` which is like `Binary` but encodes to hex - strings in JSON. Add `StdError::InvalidHex` error case. ([#1425]) +- cosmwasm-vm: Add `secp256r1_verify` and `secp256r1_recover_pubkey` imports for + ECDSA signature verification over secp256r1. ([#1983], [#2057], [#2058]) +- cosmwasm-vm: Add metrics for the pinned memory cache ([#2059]) +- cosmwasm-derive: The crate used in the expansion can now be renamed ([#2068]) +- cosmwasm-schema-derive: The crate used in the expansion can now be renamed + ([#2070]) +- cosmwasm-std: The decimal types now implement `TryFrom` for their respective + integer representations ([#2075]) +- cosmwasm-std: Implement `&T + T` and `&T op &T` for `Uint64`, `Uint128`, + `Uint256` and `Uint512`; improve panic message for `Uint64::add` and + `Uint512::add` ([#2092]) +- cosmwasm-std: Add `{CosmosMsg,SubMsg,Response}::change_custom` to change the + custom message type ([#2099]) +- cosmwasm-std: Add `Uint{64,128,256,512}::strict_add` and `::strict_sub` which + are like the `Add`/`Sub` implementations but `const`. ([#2098], [#2107]) +- cosmwasm-std: Let `Timestamp::plus_nanos`/`::minus_nanos` use + `Uint64::strict_add`/`::strict_sub` and document overflows. ([#2098], [#2107]) +- cosmwasm-std: Add `QuerierWrapper::query_grpc` helper for gRPC queries. + ([#2120]) +- cosmwasm-derive: Add `migrate_version` attribute for `migrate` entrypoints + ([#2124], [#2166]) +- cosmwasm-vm: Read the migrate version from Wasm modules and return them as + part of `AnalyzeReport` ([#2129], [#2166]) +- cosmwasm-vm: Add `bls12_381_aggregate_g1`, `bls12_381_aggregate_g2`, + `bls12_381_pairing_equality`, `bls12_381_hash_to_g1`, and + `bls12_381_hash_to_g2` to enable BLS12-381 curve operations, such as verifying + pairing equalities ([#2106]) +- cosmwasm-std: Add IBC Callbacks support, including two new entrypoints + `ibc_source_callback` and `ibc_destination_callback`, as well as the + `IbcCallbackRequest` type. ([#2025]) +- cosmwasm-vm: Add support for the two new IBC Callbacks entrypoints. ([#2025]) +- cosmwasm-std: Add `TransferMsgBuilder` to more easily create an + `IbcMsg::Transfer` with different kinds of memo values, including IBC + Callbacks memo values. ([#2167]) +- cosmwasm-std: Add `IbcMsg::WriteAcknowledgement` for async IBC + acknowledgements ([#2130]) +- cosmwasm-std: Add derive attributes for `Order` ([#2174]) + +[#1983]: https://github.com/CosmWasm/cosmwasm/pull/1983 +[#2025]: https://github.com/CosmWasm/cosmwasm/pull/2025 +[#2057]: https://github.com/CosmWasm/cosmwasm/pull/2057 +[#2058]: https://github.com/CosmWasm/cosmwasm/pull/2058 +[#2068]: https://github.com/CosmWasm/cosmwasm/pull/2068 +[#2075]: https://github.com/CosmWasm/cosmwasm/pull/2075 +[#2092]: https://github.com/CosmWasm/cosmwasm/pull/2092 +[#2098]: https://github.com/CosmWasm/cosmwasm/pull/2098 +[#2099]: https://github.com/CosmWasm/cosmwasm/pull/2099 +[#2106]: https://github.com/CosmWasm/cosmwasm/pull/2106 +[#2107]: https://github.com/CosmWasm/cosmwasm/pull/2107 +[#2120]: https://github.com/CosmWasm/cosmwasm/pull/2120 +[#2124]: https://github.com/CosmWasm/cosmwasm/pull/2124 +[#2129]: https://github.com/CosmWasm/cosmwasm/pull/2129 +[#2130]: https://github.com/CosmWasm/cosmwasm/pull/2130 +[#2166]: https://github.com/CosmWasm/cosmwasm/pull/2166 +[#2167]: https://github.com/CosmWasm/cosmwasm/pull/2167 +[#2174]: https://github.com/CosmWasm/cosmwasm/pull/2174 -[#1417]: https://github.com/CosmWasm/cosmwasm/issues/1417 -[#1425]: https://github.com/CosmWasm/cosmwasm/pull/1425 +### Changed + +- cosmwasm-std: Enable `add_event` and `add_events` functions to process types + implementing `Into` ([#2044]) +- cosmwasm-vm: Improve performance of the `Cache::analyze` function ([#2051]) +- cosmwasm-derive: Update to `syn` v2 ([#2063]) +- cosmwasm-schema-derive: Update to `syn` v2 ([#2063]) +- cosmwasm-schema-derive: Improve emitted error messages ([#2063]) +- cosmwasm-schema: `#[cw_serde]` now doesn't add `#[serde(deny_unknown_fields)]` + to the expanded code anymore ([#2080]) +- cosmwasm-std: Improve performance of `Uint{64,128,256,512}::isqrt` ([#2108]) +- cosmwasm-std: Deprecate "compact" serialization of `Binary`, `HexBinary`, + `Checksum` ([#2125]) +- cosmwasm-vm: Update wasmer to 4.3.3 ([#2147], [#2153], [#2182]) +- cosmwasm-vm: Rebalance gas costs for cryptographic functions and wasm + instructions. ([#2152]) +- cosmwasm-std: Add message_info and deprecate mock_info ([#2160]) + +[#2044]: https://github.com/CosmWasm/cosmwasm/pull/2044 +[#2051]: https://github.com/CosmWasm/cosmwasm/pull/2051 +[#2059]: https://github.com/CosmWasm/cosmwasm/pull/2059 +[#2063]: https://github.com/CosmWasm/cosmwasm/pull/2063 +[#2070]: https://github.com/CosmWasm/cosmwasm/pull/2070 +[#2080]: https://github.com/CosmWasm/cosmwasm/pull/2080 +[#2108]: https://github.com/CosmWasm/cosmwasm/pull/2108 +[#2125]: https://github.com/CosmWasm/cosmwasm/pull/2125 +[#2147]: https://github.com/CosmWasm/cosmwasm/pull/2147 +[#2152]: https://github.com/CosmWasm/cosmwasm/pull/2152 +[#2153]: https://github.com/CosmWasm/cosmwasm/pull/2153 +[#2160]: https://github.com/CosmWasm/cosmwasm/pull/2160 +[#2182]: https://github.com/CosmWasm/cosmwasm/pull/2182 + +## [2.0.8] - 2024-12-10 + +- cosmwasm-vm: Add `Cache::store_code` + +## [2.0.7] - 2024-09-23 ### Fixed -- cosmwasm-vm: Bump `MODULE_SERIALIZATION_VERSION` to "v4" because the module - serialization format changed between Wasmer 2.2 and 2.3 ([#1426]). -- cosmwasm-schema: The `QueryResponses` derive macro now supports `QueryMsg`s - with generics. ([#1429]) +- cosmwasm-vm: Fix CWA-2024-007 and CWA-2024-008. -[#1426]: https://github.com/CosmWasm/cosmwasm/issues/1426 -[#1429]: https://github.com/CosmWasm/cosmwasm/pull/1429 +## [2.0.6] - 2024-08-08 -## [1.1.1] - 2022-09-15 +### Fixed + +- cosmwasm-vm: Problem with caching related to CWA-2024-004. Please upgrade + directly to this version instead of the previous one. + +## [2.0.5] - 2024-08-08 ### Fixed -- cosmwasm-schema: Using `QueryResponses` with a `QueryMsg` containing a - unit-like variant will no longer crash. The different variant types in Rust - are: - ```rust - enum QueryMsg { - UnitLike, - Tuple(), - Struct {}, - } - ``` - It's still recommended to only use struct variants, even if there are no - fields. +- cosmwasm-vm: Fix CWA-2024-004 + +## [2.0.4] - 2024-06-03 + +### Fixed + +- cosmwasm-std: Fix `Reply` deserialization on CosmWasm 1.x chains ([#2158]) + +[#2158]: https://github.com/CosmWasm/cosmwasm/pull/2158 ### Changed -- cosmwasm-schema: It is no longer necessary to specify `serde` or `schemars` as - a dependency in order to make `cosmwasm-schema` macros work. +- cosmwasm-std: Add message_info and deprecate mock_info ([#2160]) -## [1.1.0] - 2022-09-05 +[#2160]: https://github.com/CosmWasm/cosmwasm/pull/2160 + +## [2.0.3] - 2024-05-10 + +### Changed + +- cosmwasm-std: Deprecate "compact" serialization of `Binary`, `HexBinary`, + `Checksum` ([#2128]) + +[#2128]: https://github.com/CosmWasm/cosmwasm/pull/2128 + +## [2.0.2] - 2024-04-24 + +### Fixed + +- cosmwasm-std: Fix CWA-2024-002 ### Added -- cosmwasm-std: Implement PartialEq for `Binary` and `u8` arrays. -- cosmwasm-std: Add `Uint{64,128,256,512}::one`. -- cosmwasm-std: Add `Uint{64,128,256,512}::abs_diff` and - `Decimal{,256}::abs_diff` ([#1334]). -- cosmwasm-std: Implement `From for Decimal256`. -- cosmwasm-std: Implement `Rem`/`RemAssign` for `Decimal`/`Decimal256`. -- cosmwasm-std: Implement `checked_add`/`_sub`/`_div`/`_rem` for - `Decimal`/`Decimal256`. -- cosmwasm-std: Implement `pow`/`saturating_pow` for `Decimal`/`Decimal256`. -- cosmwasm-std: Implement `ceil`/`floor` for `Decimal`/`Decimal256`. -- cosmwasm-std: Implement `PartialEq` for reference on one side and owned value - on the other for all `Uint` and `Decimal` types -- cosmwasm-std: Implement `saturating_add`/`sub`/`mul` for - `Decimal`/`Decimal256`. -- cosmwasm-std: Implement `BankQuery::Supply` to allow querying the total supply - of a native token. In order to use this query in a contract, the - `cosmwasm_1_1` feature needs to be enabled for the `cosmwasm_std` dependency. - This makes the contract incompatible with chains running CosmWasm `1.0`. - ([#1356]) -- cosmwasm-std: Implement `MIN` const value for all `Uint` and `Decimal` types -- cosmwasm-std: Implement `checked_div_euclid` for `Uint256`/`Uint512` -- cosmwasm-std: Add `QuerierWrapper::query_wasm_contract_info` - this is just a - convenience helper for querying `WasmQuery::ContractInfo`. -- cosmwasm-check: This is a new binary package that allows running various - CosmWasm compatibility checks on compiled .wasm files. See - https://crates.io/crates/cosmwasm-check for usage info. +- cosmwasm-std: Implement `&T + T` and `&T op &T` for `Uint64`, `Uint128`, + `Uint256` and `Uint512`; improve panic message for `Uint64::add` and + `Uint512::add` ([#2092]) +- cosmwasm-std: Add `Uint{64,128,256,512}::strict_add` and `::strict_sub` which + are like the `Add`/`Sub` implementations but `const`. ([#2098], [#2107]) -[#1334]: https://github.com/CosmWasm/cosmwasm/pull/1334 -[#1356]: https://github.com/CosmWasm/cosmwasm/pull/1356 +[#2092]: https://github.com/CosmWasm/cosmwasm/pull/2092 +[#2098]: https://github.com/CosmWasm/cosmwasm/pull/2098 +[#2107]: https://github.com/CosmWasm/cosmwasm/pull/2107 ### Changed -- cosmwasm-vm/cosmwasm-profiler: Upgrade Wasmer to 2.3.0. -- cosmwasm-std: Enable the `abort` feature by default. This provides more - helpful panic messages via a custom panic handler. -- cosmwasm-std: Make `Decimal{,256}::DECIMAL_PLACES` a public `u32` value. -- cosmwasm-crypto: Bumped `k256` `0.10.4 -> 0.11` and `digest` `0.9 -> 0.10` - ([#1374]). -- cosmwasm-vm: Rename features to capabilities, including - 1. `features_from_csv` to `capabilities_from_csv`; - 2. `CacheOptions::supported_features` to - `CacheOptions::available_capabilities`; - 3. `MockInstanceOptions::supported_features` to - `MockInstanceOptions::available_capabilities` - 4. `Instance::required_features` to `Instance::required_capabilities` - 5. `AnalysisReport::required_features` to - `AnalysisReport::required_capabilities`. +- cosmwasm-std: Let `Timestamp::plus_nanos`/`::minus_nanos` use + `Uint64::strict_add`/`::strict_sub` and document overflows. ([#2098], [#2107]) -[#1374]: https://github.com/CosmWasm/cosmwasm/pull/1374 +[#2098]: https://github.com/CosmWasm/cosmwasm/pull/2098 +[#2107]: https://github.com/CosmWasm/cosmwasm/pull/2107 -### Deprecated +## [2.0.1] - 2024-04-03 -- cosmwasm-vm: The `check_contract` example was deprecated. Please use the new - crate [cosmwasm-check](https://crates.io/crates/cosmwasm-check) instead - ([#1371]). +### Fixed -[#1371]: https://github.com/CosmWasm/cosmwasm/issues/1371 +- cosmwasm-std: Correctly deallocate vectors that were turned into a `Region` + via `release_buffer` ([#2062]) +- cosmwasm-std: Add back `CosmosMsg::Stargate` case to support new contracts on + chains with older CosmWasm versions. ([#2083]) -## [1.0.0] - 2022-05-14 +[#2062]: https://github.com/CosmWasm/cosmwasm/pull/2062 +[#2083]: https://github.com/CosmWasm/cosmwasm/pull/2083 + +## [2.0.0] - 2024-03-12 + +### Fixed + +- cosmwasm-vm: Fix memory increase issue (1.3 -> 1.4 regression) by avoiding the + use of a long running Wasmer Engine. ([#1978]) +- cosmwasm-vm: Fix CWA-2023-004. ([#1996]) + +[#1978]: https://github.com/CosmWasm/cosmwasm/issues/1978 +[#1996]: https://github.com/CosmWasm/cosmwasm/issues/1996 ### Added -- cosmwasm-std: Export `DelegationResponse` ([#1301]). -- cosmwasm-std: When the new `abort` feature is enabled, cosmwasm-std installs a - panic handler that aborts the contract and passes the panic message to the - host. The `abort` feature can only be used when deploying to chains that - implement the import. For this reason, it's not yet enabled by default. - ([#1299]) -- cosmwasm-vm: A new import `abort` is created to abort contract execution when - requested by the contract. ([#1299]) -- cosmwasm-std: Add new `ibc3` feature that allows to use IBC-Go V3 features, - like version negotiation and exposing relayer address to the contract. - Requires a compatible wasmd runtime (v0.27.0+) ([#1302]) +- cosmwasm-std: Add `SubMsg:reply_never` constructor ([#1929]) +- cosmwasm-std: Add optional memo field to `IbcMsg::Transfer`. ([#1878]) +- cosmwasm-std: Add `Reply::gas_used`. ([#1954]) +- cosmwasm-std: Add `SubMsgResponse::msg_responses` and deprecate + `SubMsgResponse::data`. Add new type `MsgResponse`. ([#1903]) +- cosmwasm-std: Add `cosmwasm_2_0` feature to enable 2.0 specific functionality. + ([#1974]) +- cosmwasm-std: Add new field `payload` to `SubMsg` and `Reply`. This is binary + data the contract can set in a contract specific format and get back then the + `reply` entry point is called. `SubMsg::with_payload` allows setting the + payload on an existing `SubMsg`. ([#2008]) + +[#1878]: https://github.com/CosmWasm/cosmwasm/pull/1878 +[#1903]: https://github.com/CosmWasm/cosmwasm/pull/1903 +[#1929]: https://github.com/CosmWasm/cosmwasm/pull/1929 +[#1954]: https://github.com/CosmWasm/cosmwasm/pull/1954 +[#1974]: https://github.com/CosmWasm/cosmwasm/pull/1974 +[#2008]: https://github.com/CosmWasm/cosmwasm/pull/2008 -[#1299]: https://github.com/CosmWasm/cosmwasm/pull/1299 -[#1301]: https://github.com/CosmWasm/cosmwasm/pull/1301 -[#1302]: https://github.com/CosmWasm/cosmwasm/pull/1302 +### Changed + +- cosmwasm-std: Replace `ContractInfoResponse::new` with new (unstable) + constructor, remove `SubMsgExecutionResponse` (Use `SubMsgResponse` instead) + and remove `PartialEq<&str> for Addr` (validate the address and use + `PartialEq for Addr` instead). ([#1879]) +- cosmwasm-std: `Uint{64,128}::full_mul` now take `Into` as an argument. + ([#1874]) +- cosmwasm-vm: Make `CacheOptions` non-exhaustive and add a constructor. + ([#1898]) +- cosmwasm-std: `Coin::new` now takes `Into` instead of `u128` as the + first argument and `DecCoin::new` takes `Into` instead of + `Decimal256`. ([#1902]) +- cosmwasm-std: Make inner values of `CanonicalAddr` and `Binary` private and + add constructor for `Binary`. ([#1876]) +- cosmwasm-vm: Make inner value of `Size` private and add constructor. ([#1876]) +- cosmwasm-vm: Reduce gas values by a factor of 1000. ([#1884]) +- cosmwasm-std: Upgrade to `serde-json-wasm` 1.0. This means `u128` and `i128` + are now serialized as numbers instead of strings. Use `Uint128` and `Int128` + instead. ([#1939]) +- cosmwasm-std: Add `ack` parameter to `IbcReceiveResponse::new` and remove + `IbcReceiveResponse::set_ack` ([#1940]) +- cosmwasm-std: Make `BalanceResponse`, `AllBalanceResponse`, + `DelegationRewardsResponse`, `DelegatorReward`, `DelegatorValidatorsResponse`, + `PortIdResponse`, `ListChannelsResponse`, `ChannelResponse`, + `BondedDenomResponse`, `AllDelegationsResponse`, `Delegation`, + `DelegationResponse`, `FullDelegation`, `AllValidatorsResponse`, + `ValidatorResponse` and `Validator` non-exhaustive. Add `Validator::create` + and `FullDelegation::create` to allow creating them in a stable way. Use + `Addr` type for `ContractInfoResponse::{creator, admin}`. ([#1883]) +- cosmwasm-std: Change `DistributionQuerier::new` to take `IntoIterator` instead + of `HashMap`. ([#1941]) +- cosmwasm-vm: Make `instantiate` entrypoint optional. ([#1933]) +- cosmwasm-std: Rename `CosmosMsg::Stargate` to `CosmosMsg::Any` and use a + nested msg struct like in other messages. ([#1926]) +- cosmwasm-vm: Add `AnalysisReport::entrypoints` and make + `AnalysisReport::required_capabilities` a `BTreeSet`. ([#1949]) +- cosmwasm-std: Add `Checksum` type and change type of + `CodeInfoResponse::checksum` to that. ([#1944]) +- cosmwasm-std: Removed `backtraces` feature, use the `RUST_BACKTRACE=1` env + variable instead. Error variants that previously only contained a `backtrace` + field with the feature enabled now always contain it. ([#1967]) +- cosmwasm-vm: Removed `backtraces` feature, use the `RUST_BACKTRACE=1` env + variable instead. All `VmError` variants now have a `backtrace` field. + ([#1967]) +- cosmwasm-std: Replace `MockApi` with bech32 implementation. ([#1914]) +- cosmwasm-vm: Replace `MockApi` with bech32 implementation. ([#1914]) +- cosmwasm-std: Make `IbcReceiveResponse::acknowledgement` optional and add + `IbcReceiveResponse::without_ack` constructor. ([#1892]) +- cosmwasm-std: Add `std` feature and make it a default feature. ([#1971]) +- cosmwasm-std: Add `QueryRequest::Grpc` and deprecate `QueryRequest::Stargate`. + ([#1973]) +- cosmwasm-std: Remove `update_balance`, `set_denom_metadata`, + `set_withdraw_address`, `set_withdraw_addresses`, `clear_withdraw_addresses`, + `update_ibc` and `update_staking` from `MockQuerier` and expose the underlying + queriers directly. ([#1977]) +- cosmwasm-vm: Rename `BackendApi::canonical_address`/`::human_address` to + `::addr_canonicalize`/`::addr_humanize` for consistency. +- cosmwasm-vm: Add `BackendApi::addr_validate` to avoid having to do two calls + from Rust into Go. +- cosmwasm-vm: Upgrade Wasmer to 4.2.6; Bump `MODULE_SERIALIZATION_VERSION` to + "v9". ([#1992], [#2042]) +- cosmwasm-std: Rename `GovMsg::vote` to `GovMsg::option` ([#1999]) +- cosmwasm-vm: Read `Region` from Wasm memory as bytes and convert to `Region` + afterwards ([#2005]) +- cosmwasm-vm: Limit total number of function parameters in + `check_wasm_functions` and increase max function count and max parameter + count. ([#1991]) + +[#1874]: https://github.com/CosmWasm/cosmwasm/pull/1874 +[#1876]: https://github.com/CosmWasm/cosmwasm/pull/1876 +[#1879]: https://github.com/CosmWasm/cosmwasm/pull/1879 +[#1883]: https://github.com/CosmWasm/cosmwasm/pull/1883 +[#1884]: https://github.com/CosmWasm/cosmwasm/pull/1884 +[#1892]: https://github.com/CosmWasm/cosmwasm/pull/1892 +[#1898]: https://github.com/CosmWasm/cosmwasm/pull/1898 +[#1902]: https://github.com/CosmWasm/cosmwasm/pull/1902 +[#1914]: https://github.com/CosmWasm/cosmwasm/pull/1914 +[#1926]: https://github.com/CosmWasm/cosmwasm/pull/1926 +[#1933]: https://github.com/CosmWasm/cosmwasm/pull/1933 +[#1939]: https://github.com/CosmWasm/cosmwasm/pull/1939 +[#1940]: https://github.com/CosmWasm/cosmwasm/pull/1940 +[#1941]: https://github.com/CosmWasm/cosmwasm/pull/1941 +[#1944]: https://github.com/CosmWasm/cosmwasm/pull/1944 +[#1949]: https://github.com/CosmWasm/cosmwasm/pull/1949 +[#1967]: https://github.com/CosmWasm/cosmwasm/pull/1967 +[#1971]: https://github.com/CosmWasm/cosmwasm/pull/1971 +[#1973]: https://github.com/CosmWasm/cosmwasm/pull/1973 +[#1977]: https://github.com/CosmWasm/cosmwasm/pull/1977 +[#1991]: https://github.com/CosmWasm/cosmwasm/pull/1991 +[#1992]: https://github.com/CosmWasm/cosmwasm/pull/1992 +[#1999]: https://github.com/CosmWasm/cosmwasm/pull/1999 +[#2005]: https://github.com/CosmWasm/cosmwasm/pull/2005 +[#2042]: https://github.com/CosmWasm/cosmwasm/pull/2042 + +### Removed -## [1.0.0-rc.0] - 2022-05-05 +- cosmwasm-std: Remove `Mul for Uint128` and + `Mul for Uint256`. Use `Uint{128,256}::mul_floor` instead. + ([#1890]) +- cosmwasm-std: Remove operand strings from `OverflowError`, + `ConversionOverflowError` and `DivideByZeroError`. ([#1896]) +- cosmwasm-std: Remove old IBC version and make v3 the default. ([#1875]) +- cosmwasm-storage: Removed, use [cw-storage-plus] instead. ([#1936]) +- cosmwasm-std: Remove `IbcReceiveResponse`'s `Default` implementation. Use + `IbcReceiveResponse::new` instead. ([#1942]) +- cosmwasm-vm: Remove `InstanceOptions::print_debug` flag. Set your own handler + using `Instance::set_debug_handler`. ([#1953]) +- cosmwasm-vm: Remove `allow_interface_version_7` feature and all related + functionality. ([#1952]) +- cosmwasm-vm: Remove `Checksum`. Use `cosmwasm_std::Checksum` instead. + ([#1944]) + +[cw-storage-plus]: https://github.com/CosmWasm/cw-storage-plus +[#1875]: https://github.com/CosmWasm/cosmwasm/pull/1875 +[#1890]: https://github.com/CosmWasm/cosmwasm/pull/1890 +[#1896]: https://github.com/CosmWasm/cosmwasm/pull/1896 +[#1936]: https://github.com/CosmWasm/cosmwasm/pull/1936 +[#1942]: https://github.com/CosmWasm/cosmwasm/pull/1942 +[#1952]: https://github.com/CosmWasm/cosmwasm/pull/1952 +[#1953]: https://github.com/CosmWasm/cosmwasm/pull/1953 + +## [1.5.9] - 2024-12-10 + +### Added + +- cosmwasm-vm: Add `Cache::store_code` + +## [1.5.8] - 2024-09-23 ### Fixed -- cosmwasm-std: Upgrade `serde-json-wasm` to 0.4.0 to fix u128/i128 - serialization of `to_vec`/`to_binary` in some cases ([#1297]). +- cosmwasm-vm: Fix CWA-2024-007 and CWA-2024-008. -[#1297]: https://github.com/CosmWasm/cosmwasm/pull/1297 +## [1.5.7] - 2024-08-08 -### Added +### Fixed -- cosmwasm-std: Implement `checked_multiply_ratio` for - `Uint64`/`Uint128`/`Uint256` -- cosmwasm-std: Implement `checked_from_ratio` for `Decimal`/`Decimal256` -- cosmwasm-std: Implement `Div`/`DivAssign` for `Decimal`/`Decimal256`. -- cosmwasm-vm: Add feature `allow_interface_version_7` to run CosmWasm 0.16 - contracts in modern hosts. Be careful if you consider using this! +- cosmwasm-vm: Problem with caching related to CWA-2024-004. Please upgrade + directly to this version instead of the previous one. + +## [1.5.6] - 2024-08-08 + +### Fixed + +- cosmwasm-vm: Fix CWA-2024-004 ### Changed -- all: Updated Rust edition to 2021 -- cosmwasm-std: Rename `SubMsgExecutionResponse` to `SubMsgResponse`. -- cosmwasm-crypto: Update dependency `k256` to ^0.10.4. -- cosmwasm-vm: `BackendError` was changed to `non_exhaustive` for future - extension; `BackendError` now implements `PartialEq` for easier test code; the - `msg` in `BackendError::Unknown` became non-optional because it was always - set; the argument in `BackendError::unknown`/`::user_err` was change to - `impl Into` to avoid unnecessary clones. +- cosmwasm-std: Backport PR that changed the version pinned dependency + `k256 = { version = "=0.13.1", features = ["ecdsa"] }` to the open version + range ^0.13.3 by avoiding a normalization of the public key in + `secp256k1_recover_pubkey`. ([#2014], [#2198]) -### Deprecated +[#2014]: https://github.com/CosmWasm/cosmwasm/pull/2014 +[#2198]: https://github.com/CosmWasm/cosmwasm/pull/2198 -- cosmwasm-std: `SubMsgExecutionResponse` is deprecated in favor of the new - `SubMsgResponse`. +## [1.5.5] - 2024-05-10 -### Removed +### Changed -- cosmwasm-std: Remove `Pair` which was previously deprecated. Use `Record` - instead. ([#1282]) +- cosmwasm-std: Deprecate "compact" serialization of `Binary`, `HexBinary` + ([#2126]) -[#1282]: https://github.com/CosmWasm/cosmwasm/issues/1282 +[#2126]: https://github.com/CosmWasm/cosmwasm/pull/2126 -## [1.0.0-beta8] - 2022-04-06 +## [1.5.4] + +### Fixed + +- cosmwasm-std: Fix CWA-2024-002 ### Added -- cosmwasm-std: Implement `MulAssign` for `Decimal`/`Decimal256`. -- cosmwasm-std: Implement `is_zero`/`atomics`/`decimal_places` as const for Uint - and Decimal types. -- cosmwasm-std: Implement `new` and `raw` const constructors for - `Decimal`/`Decimal256`. +- cosmwasm-std: Implement `&T + T` and `&T op &T` for `Uint64`, `Uint128`, + `Uint256` and `Uint512`; improve panic message for `Uint64::add` and + `Uint512::add` ([#2092]) +- cosmwasm-std: Add `Uint{64,128,256,512}::strict_add` and `::strict_sub` which + are like the `Add`/`Sub` implementations but `const`. ([#2098], [#2107]) + +[#2092]: https://github.com/CosmWasm/cosmwasm/pull/2092 +[#2098]: https://github.com/CosmWasm/cosmwasm/pull/2098 +[#2107]: https://github.com/CosmWasm/cosmwasm/pull/2107 + +### Changed + +- cosmwasm-std: Let `Timestamp::plus_nanos`/`::minus_nanos` use + `Uint64::strict_add`/`::strict_sub` and document overflows. ([#2098], [#2107]) + +[#2098]: https://github.com/CosmWasm/cosmwasm/pull/2098 +[#2107]: https://github.com/CosmWasm/cosmwasm/pull/2107 + +### Fixed + +- cosmwasm-std: Correctly deallocate vectors that were turned into a `Region` + via `release_buffer` ([#2062]) + +[#2062]: https://github.com/CosmWasm/cosmwasm/pull/2062 + +## [1.5.3] ### Changed -- all: Drop support for Rust versions lower than 1.56.1. -- cosmwasm-std: `MockQuerier` now supports adding custom behaviour for handling - Wasm queries via `MockQuerier::update_wasm` ([#1050]). +- cosmwasm-vm: Read `Region` from Wasm memory as bytes and convert to `Region` + afterwards ([#2005]) + +[#2005]: https://github.com/CosmWasm/cosmwasm/pull/2005 -[#1050]: https://github.com/CosmWasm/cosmwasm/pull/1050 +## [1.5.2] - 2024-01-15 ### Fixed -- cosmwasm-std: `Api::addr_validate` now requires inputs to be normalized. -- cosmwasm-vm: The `addr_validate` import now requires inputs to be normalized. +- cosmwasm-vm: Fix memory increase issue (1.3 -> 1.4 regression) by avoiding the + use of a long running Wasmer Engine. ([#1978]) + +[#1978]: https://github.com/CosmWasm/cosmwasm/issues/1978 + +## [1.5.1] - 2024-01-10 + +### Fixed -## [1.0.0-beta7] - 2022-03-22 +- cosmwasm-vm: Fix CWA-2023-004. ### Added -- cosmwasm-std: Implement `Decimal{,256}::checked_mul` and - `Decimal{,256}::checked_pow`. -- cosmwasm-std: Implement `Sub`/`SubAssign` for `Uint64`. -- cosmwasm-std: Implement `Mul`/`MulAssign` for `Uint64`. -- cosmwasm-std: Implement `RemAssign` for - `Uint64`/`Uint128`/`Uint256`/`Uint512`. -- cosmwasm-std: Implement `pow`/`checked_pow` for `Uint64`/`Uint128`/`Uint512`. -- cosmwasm-std: Implement `SubAssign`/`AddAssign` for `Decimal`/`Decimal256`. -- cosmwasm-crypto: Upgrade ed25519-zebra to version 3. +- cosmwasm-vm: Add constructor `CacheOptions::new` + +## [1.5.0] - 2023-10-31 + +### Added + +- cosmwasm-std: Add `addr_make` and `with_prefix` for + `cosmwasm_std::testing::MockApi` ([#1905]). +- cosmwasm-std: Add `abs` and `unsigned_abs` for `Int{64,128,256,512}` + ([#1854]). +- cosmwasm-std: Add `From` for `Int512`, + `TryFrom` for `Int64`, `TryFrom` for `Int128`, + `TryFrom` for `Int256` and `Int256::from_i128` for const contexts + ([#1861]). +- cosmwasm-std: Add `Int{64,128,256}::{checked_multiply_ratio, full_mul}` + ([#1866]) +- cosmwasm-std: Add `is_negative` for `Int{64,128,256,512}` ([#1867]). +- cosmwasm-std: Add `TryFrom for Uint64` and + `TryFrom for Int{B}` where `A >= B` ([#1870]). +- cosmwasm-std: Add `to_json_{vec,binary,string}` and `from_json` and deprecate + `to_{vec,binary}` in favor of `to_json_{vec,binary}` and `from_{slice,binary}` + in favor of `from_json`. ([#1886]) +- cosmwasm-std: Add `SignedDecimal` and `SignedDecimal256` ([#1807]). +- cosmwasm-vm: Allow float operations with NaN canonicalization ([#1864]). + +[#1905]: https://github.com/CosmWasm/cosmwasm/pull/1905 +[#1854]: https://github.com/CosmWasm/cosmwasm/pull/1854 +[#1861]: https://github.com/CosmWasm/cosmwasm/pull/1861 +[#1866]: https://github.com/CosmWasm/cosmwasm/pull/1866 +[#1867]: https://github.com/CosmWasm/cosmwasm/pull/1867 +[#1870]: https://github.com/CosmWasm/cosmwasm/pull/1870 +[#1886]: https://github.com/CosmWasm/cosmwasm/pull/1886 +[#1807]: https://github.com/CosmWasm/cosmwasm/pull/1807 +[#1864]: https://github.com/CosmWasm/cosmwasm/pull/1864 ### Changed -- cosmwasm-vm: Upgrade Wasmer to 2.2.1. +- cosmwasm-vm: Added `.module` extension to file names in the file system cache + ([#1913]). -## [1.0.0-beta6] - 2022-03-07 +[#1913]: https://github.com/CosmWasm/cosmwasm/pull/1913 -### Added +## [1.4.1] - 2023-10-09 + +## Fixed + +- cosmwasm-vm: Fix a 1.3.x -> 1.4.0 regression bug leading to a _Wasmer runtime + error: RuntimeError: out of bounds memory access_ in cases when the Wasm file + is re-compiled and used right away. ([#1907]) -- cosmwasm-std: Implement `ops::Rem` for `Uint{64,128,256,512}`. +[#1907]: https://github.com/CosmWasm/cosmwasm/pull/1907 ### Changed -- cosmwasm-std: Change type of `Reply::result` from `ContractResult` to the new - `SubMsgResult`. Both types are equal when serialized but `ContractResult` is - documented to be the result of a contract execution, which is not the case - here. ([#1232]) -- cosmwasm-vm: Upgrade Wasmer to 2.2.0 and bump `MODULE_SERIALIZATION_VERSION` - to "v3-wasmer1". ([#1224]) +- cosmwasm-check: Use "=" for pinning the versions of cosmwasm-vm and + cosmwasm-std dependencies. This ensures that you can use an older version of + cosmwasm-check together with the VM of the same version by doing + `cargo install cosmwasm-check@1.4.1`. A typical use case would be to check a + contract with CosmWasm 1.4, 1.5 and 2.0. Note that other dependencies are + still upgraded when using `cargo install` which may lead to API, behavioural + or compiler incompatibilities. The + [--locked](https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile) + feature allows you use the versions locked when the release was created. -[#1224]: https://github.com/CosmWasm/cosmwasm/pull/1224 -[#1232]: https://github.com/CosmWasm/cosmwasm/pull/1232 +## [1.4.0] - 2023-09-04 -## [1.0.0-beta5] - 2022-02-08 +### Added + +- cosmwasm-std: Implement `Not` for `Uint{64,128,256}` ([#1799]). +- cosmwasm-std: Add iterators for `Coins` ([#1806]). +- cosmwasm-std: Make `abs_diff` const for `Uint{256,512}` and + `Int{64,128,256,512}`. It is now const for all integer types. +- cosmwasm-std: Implement `TryFrom` for `Decimal` ([#1832]) +- cosmwasm-std: Add `StdAck`. ([#1512]) +- cosmwasm-std: Add new imports `db_next_{key, value}` for iterating storage + keys / values only and make `Storage::{range_keys, range_values}` more + efficient. This requires the `cosmwasm_1_4` feature to be enabled. ([#1834]) +- cosmwasm-std: Add + `DistributionQuery::{DelegationRewards, DelegationTotalRewards, DelegatorValidators}`. + This requires the `cosmwasm_1_4` feature to be enabled. ([#1788]) +- cosmwasm-std: Export module `cosmwasm_std::storage_keys` with + `namespace_with_key`, `to_length_prefixed` and `to_length_prefixed_nested` to + make it easier to use the strandard storage key layout documented in + [STORAGE_KEYS.md](https://github.com/CosmWasm/cosmwasm/blob/v1.5.0/docs/STORAGE_KEYS.md) + in other libraries such as cw-storage-plus or indexers. ([#1676]) + +[#1512]: https://github.com/CosmWasm/cosmwasm/issues/1512 +[#1676]: https://github.com/CosmWasm/cosmwasm/pull/1676 +[#1799]: https://github.com/CosmWasm/cosmwasm/pull/1799 +[#1806]: https://github.com/CosmWasm/cosmwasm/pull/1806 +[#1832]: https://github.com/CosmWasm/cosmwasm/pull/1832 +[#1834]: https://github.com/CosmWasm/cosmwasm/pull/1834 +[#1788]: https://github.com/CosmWasm/cosmwasm/pull/1788 ### Changed -- all: Drop support for Rust versions lower than 1.54.0. -- cosmwasm-std: The `Debug` implementation of `Binary` now produces a hex string - instead of a list of bytes ([#1199]). -- cosmwasm-std: Pin uint version to 0.9.1 in order to maintain a reasonably low - MSRV. -- cosmwasm-std: Add missing `Isqrt` export ([#1214]). +- cosmwasm-vm: Avoid using loupe for getting the `Module` size in the file + system cache to prepare for the Wasmer 3 upgrade. +- cosmwasm-vm: When enabling `print_debug` the debug logs are now printed to + STDERR instead of STDOUT by default ([#1667]). +- cosmwasm-vm: Add `Instance::set_debug_handler`/`unset_debug_handler` to allow + customizing the handling of debug messages emitted by the contract ([#1667]). +- cosmwasm-vm: Upgrade Wasmer to version 4.1. ([#1674], [#1693], [#1701], + [#1793]) +- cosmwasm-check: Update clap dependency to version 4 ([#1677]) +- cosmwasm-vm: Use `wasmparser` for initial validation instead of `parity-wasm` + ([#1786]) +- cosmwasm-std: Make constructors `Decimal{,256}::{percent,permille,bps}` const +- cosmwasm-std: Use new `db_next_key` import to make `skip` and `nth` + implementation of `range` iterators more efficient. This requires the + `cosmwasm_1_4` feature to be enabled. ([#1838]) + +[#1667]: https://github.com/CosmWasm/cosmwasm/pull/1667 +[#1674]: https://github.com/CosmWasm/cosmwasm/pull/1674 +[#1677]: https://github.com/CosmWasm/cosmwasm/pull/1677 +[#1693]: https://github.com/CosmWasm/cosmwasm/pull/1693 +[#1701]: https://github.com/CosmWasm/cosmwasm/pull/1701 +[#1786]: https://github.com/CosmWasm/cosmwasm/pull/1786 +[#1793]: https://github.com/CosmWasm/cosmwasm/pull/1793 +[#1838]: https://github.com/CosmWasm/cosmwasm/pull/1838 + +## [1.3.3] - 2023-08-22 + +### Added -[#1199]: https://github.com/CosmWasm/cosmwasm/issues/1199 -[#1214]: https://github.com/CosmWasm/cosmwasm/issues/1214 +- cosmwasm-std: Implement `into_empty` for `QuerierWrapper`, `Deps` and + `DepsMut`. + +## [1.3.2] - 2023-08-15 ### Fixed -- cosmwasm-vm: Fix `AddAssign` implementation of `GasInfo`. -- cosmwasm-vm: Bump `MODULE_SERIALIZATION_VERSION` to "v2" because the module - serialization format changed between Wasmer 2.0.0 and 2.1.x. +- cosmwasm-std: Export `CoinFromStrError`, `CoinsError` and `DivisionError` + +## [1.3.1] - 2023-07-26 -## [1.0.0-beta4] - 2021-12-23 +### Fixed + +- cosmwasm-std: Export `DelegatorWithdrawAddressResponse`, + `DenomMetadataResponse` and `AllDenomMetadataResponse` which were added in + `1.3.0` ([#1795]). + +[#1795]: https://github.com/CosmWasm/cosmwasm/pull/1795 ### Changed -- cosmwasm-vm: `wasmer` version bumped `2.1.0 -> 2.1.1` +- cosmwasm-std: Query responses are now exported, even if the corresponding + cargo feature is not enabled ([#1795]). -### Fixed +## [1.3.0] - 2023-07-17 -- cosmwasm-vm: Remove system-dependent stacktrace from `VmError::RuntimeErr` - (fixes CWA-2021-003). +### Fixed -## [1.0.0-beta3] +- cosmwasm-vm: Add missing cache stats increment when calling `pin`. ### Added -- cosmwasm-std: New const methods `Uint64::to_be_bytes`/`::to_le_bytes`. -- cosmwasm-vm: The check_contracts tool now has a `--supported-features` option - that defaults to "iterator,staking,stargate". -- cosmwasm-vm: The default `singlepass` compiler is now supported on 64-bit - Windows. -- cosmwasm-std: Add missing `DivideByZeroError` export. -- cosmwasm-std: Implement `std::iter::Sum` for `Decimal` and `Decimal256`. +- cosmwasm-std: Implement `BankQuery::AllDenomMetadata` to allow querying all + the denom metadata and `BankQuery::DenomMetadata` to query a specific one. In + order to use this query in a contract, the `cosmwasm_1_3` feature needs to be + enabled for the `cosmwasm_std` dependency. This makes the contract + incompatible with chains running anything lower than CosmWasm `1.3.0`. + ([#1647]) +- cosmwasm-std: Add `DistributionQuery::DelegatorWithdrawAddress`. Also needs + the `cosmwasm_1_3` feature (see above). ([#1593]) +- cosmwasm-std: Add `DistributionMsg::FundCommunityPool`. Also needs the + `cosmwasm_1_3` feature (see above). ([#1747]) +- cosmwasm-std: Add `FromStr` impl for `Coin`. ([#1684]) +- cosmwasm-std: Add `Coins` helper to handle multiple coins. ([#1687]) +- cosmwasm-vm: Add `Cache::save_wasm_unchecked` to save Wasm blobs that have + been checked before. This is useful for state-sync where we know the Wasm code + was checked when it was first uploaded. ([#1635]) +- cosmwasm-vm: Allow sign extension Wasm opcodes in static validation. This + allows contracts to be compiled with Rust 1.70.0 and above. ([#1727]) +- cosmwasm-std: Add trait functions `Storage::range_keys` and + `Storage::range_values`. The default implementations just use + `Storage::range`. Later this can be implemented more efficiently. ([#1748]) +- cosmwasm-std: Add `Int64`, `Int128`, `Int256` and `Int512` signed integer + types. ([#1718]) + +[#1593]: https://github.com/CosmWasm/cosmwasm/pull/1593 +[#1635]: https://github.com/CosmWasm/cosmwasm/pull/1635 +[#1647]: https://github.com/CosmWasm/cosmwasm/pull/1647 +[#1684]: https://github.com/CosmWasm/cosmwasm/pull/1684 +[#1687]: https://github.com/CosmWasm/cosmwasm/pull/1687 +[#1718]: https://github.com/CosmWasm/cosmwasm/pull/1718 +[#1727]: https://github.com/CosmWasm/cosmwasm/issues/1727 +[#1747]: https://github.com/CosmWasm/cosmwasm/pull/1747 +[#1748]: https://github.com/CosmWasm/cosmwasm/pull/1748 ### Changed -- all: Drop support for Rust versions lower than 1.53.0. -- cosmwasm-std: The balance argument from `mock_dependencies` was removed. - Remove `&[]` if you don't need a contract balance or use the new - `mock_dependencies_with_balance` if you need a balance. -- cosmwasm-vm: Unlock cache mutex before module instantiation. -- cosmwasm-vm: `wasmer` version bumped `2.0.0 -> 2.1.0` +- cosmwasm-vm: Add checks for table section of Wasm blob ([#1631]). +- cosmwasm-vm: Limit number of imports during static validation ([#1629]). +- cosmwasm-vm: Add target (triple + CPU features) into the module cache + directory to avoid using modules compiled for a different system. Bump + `MODULE_SERIALIZATION_VERSION` to "v6". ([#1664]) +- cosmwasm-vm: Add `.wasm` extension to stored wasm files ([#1686]). -### Removed +[#1629]: https://github.com/CosmWasm/cosmwasm/pull/1629 +[#1631]: https://github.com/CosmWasm/cosmwasm/pull/1631 +[#1664]: https://github.com/CosmWasm/cosmwasm/pull/1664 +[#1686]: https://github.com/CosmWasm/cosmwasm/pull/1686 + +### Deprecated -- cosmwasm-std: Remove the macros `create_entry_points` and - `create_entry_points_with_migration` in favour of the new, more flexible entry - point system introduced in CosmWasm 0.14. +- cosmwasm-storage: All exports are deprecated because this crate will be + removed with CosmWasm 2.0 ([#1596]). -## [1.0.0-beta] - 2021-10-11 +[#1596]: https://github.com/CosmWasm/cosmwasm/issues/1596 + +## [1.2.7] - 2023-06-19 ### Added -- cosmwasm-std: Add new `WasmQuery::ContractInfo` variant to get metadata about - the contract, like `code_id` and `admin`. -- cosmwasm-std: New field `Env::transaction` containing info of the transaction - the contract call was executed in. -- cosmwasm-std: Implement `ops::Mul` for `Decimal` and `Decimal256`. -- cosmwasm-std: New const methods `Uint128::to_be_bytes`/`::to_le_bytes`. -- cosmwasm-std: New const conversion methods `Uint256::from_uint128` and - `Uint512::from_uint256`. -- cosmwasm-std: New getters `Decimal{,256}::atomics()` and - `Decimal{,256}::decimal_places()`. -- cosmwasm-std: New constructors `Decimal{,256}::from_atomics`. -- cosmwasm-std: New `Uint128::checked_pow`. -- cosmwasm-std: New macros `ensure!`, `ensure_eq!` and `ensure_ne!` allow - requirement checking that return errors instead of panicking ([#1103]). - -[#1103]: https://github.com/CosmWasm/cosmwasm/issues/1103 +- cosmwasm-std: Add `<<` and `<<=` implementation for `Uint{64,128,256,512}` + types. ([#1723]) +- cosmwasm-std: Add `Timestamp::{plus,minus}_{minutes, hours, days}`. ([#1729]) +- cosmwasm-std: Add `Decimal::bps` and `Decimal256::bps` to create a decimal + from a basis point value ([#1715]). + +[#1723]: https://github.com/CosmWasm/cosmwasm/pull/1723 +[#1729]: https://github.com/CosmWasm/cosmwasm/pull/1729 +[#1715]: https://github.com/CosmWasm/cosmwasm/pull/1715 ### Changed -- cosmwasm-std: Make `iterator` a required feature if the `iterator` feature - flag is set (enabled by default). -- cosmwasm-vm: Increase `MAX_LENGTH_HUMAN_ADDRESS` from 90 to 256 in order to - support longer address formats than bech32. -- cosmwasm-std: Make `CustomQuery` a subtrait of `Clone`, i.e. types that - implement `CustomQuery` need to be `Clone`able. -- cosmwasm-std: Add generic for custom query type to `QuerierWrapper`, `Deps`, - `DepsMut` and `OwnedDeps`. Merge `QuerierWrapper::custom_query` into the now - fully typed `QuerierWrapper::query`. -- cosmwasm-std: Add generic type `Q` for the custom query request type to - `do_instantiate`, `do_execute`, `do_migrate`, `do_sudo`, `do_reply`, - `do_query`, `ibc_channel_open`, `ibc_channel_connect`, `ibc_channel_close`, - `ibc_packet_receive`, `ibc_packet_ack` and `ibc_packet_timeout`. -- cosmwasm-std: In `Decimal` change `Fraction` to `Fraction`, - such that `Decimal::numerator` and `::denominator` now return `Uint128`. -- cosmwasm-std: Make methods `Uint256::to_be_bytes`/`::to_le_bytes` const. -- cosmwasm-std: Make methods `Uint512::to_be_bytes`/`::to_le_bytes` const. -- cosmwasm-std: Make method `Uint512::from_le_bytes` const. -- cosmwasm-std: Rename `Pair` to `Record`. `Pair` is now an alias for `Record` - and deprecated. ([#1108]) -- cosmwasm-vm: Bump required marker export `interface_version_7` to - `interface_version_8`. -- cosmwasm-vm: Increase cost per Wasm operation from 1 to 150_000 and adjust - crypto API gas cost based on the target of 1 Teragas per millisecond. -- cosmwasm-std: Deprecate the macros `create_entry_points` and - `create_entry_points_with_migration` in favour of the new, more flexible entry - point system introduced in CosmWasm 0.14. +- cosmwasm-std: Coin uses shorter `Coin { 123 "ucosm" }` format for Debug + ([#1704]) -### Removed +[#1704]: https://github.com/CosmWasm/cosmwasm/pull/1704 + +## [1.2.6] - 2023-06-05 + +### Changed -- cosmwasm-std: Remove `HumanAddr` (deprecated since 0.14). Use `String` - instead. -- cosmwasm-std: Remove `KV` (deprecated since 0.14). Use `Pair` instead. +- cosmwasm-vm: Bumped module serialization version from v4 to v5 to invalidate + potentially corrupted caches caused by Rust update. See + https://github.com/CosmWasm/wasmvm/issues/426 for more information. ([#1708]) -[#1108]: https://github.com/CosmWasm/cosmwasm/issues/1108 +[#1708]: https://github.com/CosmWasm/cosmwasm/pull/1708 -## [0.16.2] - 2021-09-07 +## [1.2.5] - 2023-05-02 ### Added -- cosmwasm-std: Implement `Mul` and `MulAssign` for `Uint128`. -- cosmwasm-std: Implement `FromStr` for `Uint128`, `Uint256`, and `Uint512`. -- cosmwasm-std: Make `Uint256::from_le_bytes`, `::from_be_bytes` and `::new` - const. -- cosmwasm-std: Added the `Decimal256` type with 18 decimal places. +- cosmwasm-std: Implement `PartialEq` for `Addr == &Addr` and `&Addr == Addr` as + well as `Event == &Event` and `&Event == Event` ([#1672]). +- cosmwasm-std: Add `#[must_use]` annotations to `Uint64`, `Uint128`, `Uint256`, + `Uint512`, `Decimal` and `Decimal256` math operations ([#1678]) -### Changed +[#1672]: https://github.com/CosmWasm/cosmwasm/pull/1672 +[#1678]: https://github.com/CosmWasm/cosmwasm/pull/1678 + +### Deprecated + +- cosmwasm-std: The PartialEq implementations between `Addr` and `&str`/`String` + are deprecated because they are not considered to be safe. In almost all cases + you want to convert both sides of the equation to `Addr` first. If you really + want to do a string comparison, use `Addr::as_str()` explicitly. ([#1671]) -- cosmwasm-std: Implement `Decimal::from_ratio` using full uint128 - multiplication to support a wider range of input values. -- cosmwasm-std: `Decimal::from_ratio` now accepts any types that implement - `Into` rather than `Into`. -- cosmwasm-crypto: Update dependency `k256` to ^0.9.6. -- cosmwasm-std: Add enum cases `Shl` to `OverflowOperation` (breaking; [#1071]). +[#1671]: https://github.com/CosmWasm/cosmwasm/pull/1671 -[#1071]: https://github.com/CosmWasm/cosmwasm/pull/1071 +## [1.2.4] - 2023-04-17 ### Fixed -- cosmwasm-std: Fixed a bug where `Uint*` types wouldn't handle formatting - options when formatted with `std::fmt::Display`. +- cosmwasm-vm: Add call depths limit -## [0.16.1] - 2021-08-31 +## [1.2.3] - 2023-03-22 + +- cosmwasm-vm: Use saturating increments for `Stats` fields to ensure we don't + run into overflow issues. + +## [1.2.2] - 2023-03-08 ### Added -- cosmwasm-std: Added `From` and `From<&Addr>` conversions for - `Cow`. -- cosmwasm-std: Added new `Uint256` and `Uint512` types. -- cosmwasm-std: Added implementations of `Isqrt` (integer square root) for - `Uint64`, `Uint128`, `Uint256`, and `Uint512`. -- cosmwasm-std: Exposed `Uint{64, 128, 256}::full_mul` for full multiplication - that cannot overflow. +- cosmwasm-std: Add an IBC querier implementation to `testing::MockQuerier` + ([#1620], [#1624]). +- cosmwasm-std: Add `#[must_use]` annotations to `Timestamp` math functions. + +[#1620]: https://github.com/CosmWasm/cosmwasm/pull/1620 +[#1624]: https://github.com/CosmWasm/cosmwasm/pull/1624 + +### Fixed + +- all: Fix `backtraces` feature for newer versions of Rust. This still requires + Rust nightly ([#1613]). +- cosmwasm-std: Add missing export `CheckedMultiplyFractionError` ([#1608]). + +[#1608]: https://github.com/CosmWasm/cosmwasm/pull/1608 +[#1613]: https://github.com/CosmWasm/cosmwasm/pull/1613 + +## [1.2.1] - 2023-01-30 + +### Added + +- cosmwasm-std: Add `Decimal{,256}::to_uint_floor` and `::to_uint_ceil` for + efficient and explicit decimal to uint conversion ([#1603]). + +[#1603]: https://github.com/CosmWasm/cosmwasm/pull/1603 + +### Fixed + +- cosmwasm-std: Make fields of `WeightedVoteOption` public to allow constructing + it ([#1597]). + +[#1597]: https://github.com/CosmWasm/cosmwasm/issues/1597 ### Changed -- cosmwasm-std: In `ExternalApi::addr_validate` and `::addr_canonicalize` do not - send too long inputs to VM to avoid terminating contract execution. Errors are - returned instead now. -- cosmwasm-std: Add enum cases `Shr` to `OverflowOperation` (breaking; [#1059]). +- cosmwasm-std: Improve readability of `Debug` output for `Decimal` and + `Decimal256` ([#1600]). -[#1059]: https://github.com/CosmWasm/cosmwasm/pull/1059 +[#1600]: https://github.com/CosmWasm/cosmwasm/pull/1600 -## [0.16.0] - 2021-08-05 +## [1.2.0] - 2023-01-24 ### Added -- cosmwasm-std: Added the `IbcChannelOpenMsg`, `IbcChannelConnectMsg`, - `IbcChannelCloseMsg`, `IbcPacketReceiveMsg`, `IbcPacketAckMsg`, and - `IbcPacketTimeoutMsg` types for use with corresponding IBC entrypoints. -- cosmwasm-std::testing: New mocking helpers for IBC channel msg types: - `mock_ibc_channel_open_init`, `mock_ibc_channel_open_try`, - `mock_ibc_channel_connect_ack`, `mock_ibc_channel_connect_confirm`, - `mock_ibc_channel_close_init`, `mock_ibc_channel_close_confirm`. -- cosmwasm-std::testing: Added `mock_ibc_packet_timeout` since - `mock_ibc_packet_ack` is no longer usable for creating mock data for - `ibc_packet_timeout`. -- cosmwasm-std: New `Attribute::new` constructor that does the same thing as - `attr`. -- cosmwasm-std::testing: Added `mock_wasm_attr` when you really need to create - an `Attribute` with a key starting with `_` in test code. -- cosmwasm-std: Renamed `IBCAcknowledgementWithPacket` -> `IbcPacketAckMsg` to - remove an unneeded level of indirection. -- cosmwasm-std: Added `Event::add_attributes` for bulk adding attributes to an - `Event` struct. -- cosmwasm-std: Added `Addr::into_string` for explicit conversion +- cosmwasm-std: Add `GovMsg::VoteWeighted`. In order to use this in a contract, + the `cosmwasm_1_2` feature needs to be enabled for the `cosmwasm_std` + dependency. This makes the contract incompatible with chains running versions + of CosmWasm earlier than 1.2.0 ([#1481]). +- cosmwasm-std: Add `instantiate2_address` which allows calculating the + predictable addresses for `MsgInstantiateContract2` ([#1437], [#1554]). +- cosmwasm-std: Add `WasmMsg::Instantiate2` (requires `cosmwasm_1_2`, see + `GovMsg::VoteWeighted` above) to instantiate contracts at a predictable + address ([#1436], [#1554])). +- cosmwasm-schema: In contracts, `cosmwasm schema` will now output a separate + JSON Schema file for each entrypoint in the `raw` subdirectory ([#1478], + [#1533]). +- cosmwasm-std: Upgrade `serde-json-wasm` dependency to 0.5.0 which adds map + support to `to_vec`/`to_binary` and friends. +- cosmwasm-std: Implement `AsRef<[u8]>` for `Binary` and `HexBinary` ([#1550]). +- cosmwasm-std: Allow constructing `SupplyResponse` via a `Default` + implementation ([#1552], [#1560]). +- cosmwasm-std: Add `Never` type which cannot be instantiated. This can be used + as the error type for `ibc_packet_receive` or `ibc_packet_ack` to gain + confidence that the implementations never errors and the transaction does not + get reverted. ([#1513]) +- cosmwasm-std: Add new `WasmQuery::CodeInfo` to get the checksum of a code ID + ([#1561]). +- cosmwasm-vm: Add `Cache::remove_wasm` to remove obsolete Wasm blobs and their + compiled modules. +- cosmwasm-std: Implement fraction multiplication and division. Assists with + Uint & Decimal arithmetic and exposes methods for flooring/ceiling result + ([#1485], [#1566]). + +[#1436]: https://github.com/CosmWasm/cosmwasm/issues/1436 +[#1437]: https://github.com/CosmWasm/cosmwasm/issues/1437 +[#1478]: https://github.com/CosmWasm/cosmwasm/pull/1478 +[#1481]: https://github.com/CosmWasm/cosmwasm/pull/1481 +[#1485]: https://github.com/CosmWasm/cosmwasm/issues/1485 +[#1513]: https://github.com/CosmWasm/cosmwasm/pull/1513 +[#1533]: https://github.com/CosmWasm/cosmwasm/pull/1533 +[#1550]: https://github.com/CosmWasm/cosmwasm/issues/1550 +[#1552]: https://github.com/CosmWasm/cosmwasm/pull/1552 +[#1554]: https://github.com/CosmWasm/cosmwasm/pull/1554 +[#1560]: https://github.com/CosmWasm/cosmwasm/pull/1560 +[#1561]: https://github.com/CosmWasm/cosmwasm/pull/1561 +[#1566]: https://github.com/CosmWasm/cosmwasm/pull/1566 ### Changed -- cosmwasm-vm: The `Checksum::to_hex` function signature was changed from - `to_hex(&self) -> String` to `to_hex(self) -> String`. -- cosmwasm-std: The `attr` function now accepts types that implement - `Into` rather than `ToString`. -- cosmwasm-std, cosmwasm-vm, cosmwasm-storage: The `iterator` feature is now - enabled by default. -- cosmwasm-std: Make `MockApi::canonical_length` private. -- cosmwasm-vm: Make `MockApi::canonical_length` private. -- cosmwasm-vm: Bump required marker export `interface_version_6` to - `interface_version_7`. -- cosmwasm-std, cosmwasm-vm: Entrypoints `ibc_channel_open`, - `ibc_channel_connect`, `ibc_channel_close`, `ibc_packet_receive`, - `ibc_packet_ack`, `ibc_packet_timeout` now each accept a corresponding `Msg` - value that wraps around channels, packets and acknowledgements. -- cosmwasm-std/cosmwasm-vm: Increase canonical address lengths up to 64 bytes. -- cosmwasm-std/cosmwasm-vm: In `MockApi`, increase max length of supported human - addresses from 24 bytes to 54 bytes by using a longer canonical - representation. This allows you to insert typical bech32 addresses in tests. - ([#995]) -- cosmwasm-std::testing: `mock_ibc_packet_recv` function now returns an - `IbcPacketReceiveMsg`, `mock_ibc_packet_ack` requires an acknowledgement to be - passed and returns an `IbcPacketAckMsg`. -- cosmwasm-std: `IbcBasicResponse` and `IbcReceiveResponse` now both support - custom events via the `events` field. -- cosmwasm-std: `attr` (and `Attribute::new`) will now panic in debug builds if - the attribute's key starts with an underscore. These names are reserved and - could cause problems further down the line. -- cosmwasm-std: `Response`, `IbcBasicResponse` and `IbcReceiveResponse` can no - longer be constructed using struct literals. Use constructors like - `Response::new` to construct empty structs and appropriate builder-style - methods to set fields (`response.add_message`, `response.set_data`, etc). -- cosmwasm-std: `Event`, `IbcChannel`, `IbcPacket`, `IbcAcknowledgement` have - been marked `non_exhaustive` (can't be constructed using a struct literal by - downstream code). -- cosmwasm-std: `Event::attr` has been renamed to `Event::add_attribute` for - consistency with other types like `Response`. -- cosmwasm-vm: `Instance::required_features` changed from a property to a getter - method. -- cosmwasm-vm: Add `required_features` field to `AnalysisReport` which is - returned by `Cache::analyze`. -- cosmwasm-vm: The VM now checks that exactly one `interface_version_*` marker - export is set. For `interface_version_5` and `interface_version_6` (CosmWasm - 0.14–0.15) more specific error messages were added. - -[#995]: https://github.com/CosmWasm/cosmwasm/pull/995 +- cosmwasm-vm: Avoid exposing OS specific file system errors in order to test + cosmwasm-vm on Windows. This gives us confidence for integrating cosmwasm-vm + in a libwasmvm build on Windows. This change is likely to be consensus + breaking as error messages change. ([#1406]) +- cosmwasm-vm: Use `Display` representation for embedding Wasmer + `InstantiationError`s ([#1508]). -### Removed +[#1406]: https://github.com/CosmWasm/cosmwasm/pull/1406 +[#1508]: https://github.com/CosmWasm/cosmwasm/issues/1508 -- cosmwasm-std::testing: `mock_ibc_channel` is now private. Use - `mock_ibc_channel_open`, `mock_ibc_channel_connect`, or - `mock_ibc_channel_close` instead. +### Fixed + +- cosmwasm-schema: Nested QueryMsg with generics is now supported by the + QueryResponses macro ([#1516]). +- cosmwasm-schema: A nested QueryMsg no longer causes runtime errors if it + contains doc comments. +- cosmwasm-std/cosmwasm-vm: Increase length limit for address conversion in + `MockApi` to support addresses longer than 54 bytes ([#1529]). + +[#1516]: https://github.com/CosmWasm/cosmwasm/issues/1516 +[#1529]: https://github.com/CosmWasm/cosmwasm/issues/1529 -## [0.15.2] - 2021-07-21 +## [1.1.9] - 2022-12-06 ### Fixed -- cosmwasm-std: Export `VoteOption` as a top-level type. +- cosmwasm-schema: Fix type fully qualified path to symbol `QueryResponses` in + macro `cosmwasm_schema::generate_api!` ([#1527]). -## [0.15.1] - 2021-07-20 +[#1527]: https://github.com/CosmWasm/cosmwasm/issues/1527 + +## [1.1.8] - 2022-11-22 ### Fixed -- cosmwasm-std: Export `GovMsg` as a top-level type of the crate. +- cosmwasm-schema: Fix type params on `QueryMsg` causing a compiler error when + used with the `QueryResponses` derive macro. -## [0.15.0] - 2021-06-24 +## [1.1.6] - 2022-11-16 ### Added -- cosmwasm-std: Implement `Sub` and `SubAssign` for `Uint128` -- cosmwasm-std: Implement custom events for contract execution results -- cosmwasm-std: Add `CosmosMsg::Gov` for voting on governance proposals. -- cosmwasm-storage: Implement `Storage` for `PrefixedStorage` and - `ReadonlyPrefixedStorage`. NOTE: Calling `set` or `remove` on - `ReadonlyPrefixedStorage` will panic! +- cosmwasm-std: Add `From` implementations to convert between + `CanonicalAddr`/`Binary` as well as `CanonicalAddr`/`HexBinary` ([#1463]). +- cosmwasm-std: Add `From` implementations to convert `u8` arrays to + `CanonicalAddr` ([#1463]). +- cosmwasm-std: Implement `PartialEq` between `CanonicalAddr` and + `HexBinary`/`Binary` ([#1463]). -### Removed +[#1463]: https://github.com/CosmWasm/cosmwasm/pull/1463 -- cosmwasm-std: Make `Uint128` inner field private ([#905]) -- cosmwasm-std: Remove `Context` - deprecated in previous release -- cosmwasm-std: Remove `HandleResponse`, `InitResponse`, and `MigrateResponse` - - deprecated in previous release -- cosmwasm-crypto: Remove `ed25519::MESSAGE_MAX_LEN`, `ed25519::BATCH_MAX_LEN` - and message length verification as this should not be a concern of - `cosmwasm-crypto`. +### Changed -[#905]: https://github.com/CosmWasm/cosmwasm/issues/905 +- all: Bump a few dependency versions to make the codebase compile with + `-Zminimal-versions` ([#1465]). +- cosmwasm-profiler: Package was removed 🪦. It served its job showing us that + we cannot properly measure different runtimes for different Wasm opcodes. +- cosmwasm-schema: schema generation is now locked to produce strictly + `draft-07` schemas +- cosmwasm-schema: `QueryResponses` derive now sets the `JsonSchema` trait bound + on the generated `impl` block. This allows the contract dev to not add a + `JsonSchema` trait bound on the type itself. + +[#1465]: https://github.com/CosmWasm/cosmwasm/pull/1465 + +## [1.1.5] - 2022-10-17 + +### Added + +- cosmwasm-std: Add `wrapping_add`, `wrapping_sub`, `wrapping_mul` and + `wrapping_pow` to `Uint256`/`Uint512`. +- cosmwasm-schema: Better error messaging when attempting to compile schema + generator for `wasm32` +- cosmwasm-vm: In the `secp256k1_verify`, `secp256k1_recover_pubkey`, + `ed25519_verify` and `ed25519_batch_verify` import implementations we now exit + early if the gas left is not sufficient to perform the operation. ### Changed -- cosmwasm-std: Rename the `send` function parameter to `funds` in `WasmMsg` for - consistency with the wasmd message types. -- cosmwasm-vm: Increase read limit of contract execution results from 100,000 - bytes to 64 MiB. JSON deserializers should have their own limit to protect - against large deserializations. -- cosmwasm-vm: Create `VmError::DeserializationLimitExceeded`; Add limit - argument to `from_slice`; Increase deserialization limit of contract execution - results from 100,000 bytes to 256 KiB. This probably only affects internal - testing as well as integration tests of smart contracts. -- cosmwasm-vm: More accurate error messages for op codes related to bulk memory - operations, reference types, SIMD and the Threads extension. -- cosmwasm-vm: Update `wasmer` to `2.0.0` -- cosmwasm-vm: ED25519 message length and batch length limits are now hardcoded - in `cosmwasm-vm` itself instead of being imported from `cosmwasm-crypto`. -- cosmwasm-vm: Filesystem storage layout now distinguishes clearly between state - and cache. -- cosmwasm-std: Add enum case `ReplyOn::Never`; Remove default implementation of - `ReplyOn` as there is no natural default case anymore ([#961]). -- cosmwasm-std: Merge `messages` and `submessages` into one list, using - `ReplyOn::Never` to model the "fire and forget" semantics ([#961]). -- cosmwasm-std: Add `SubMsg` constructors: `::new()`, `::reply_on_error()`, - `::reply_on_success()`, `::reply_always()`; Add `with_gas_limit` to add a gas - limit to any those constructors ([#961]). -- cosmwasm-std: Change `Event`'s constructor - it no longer takes a vector of - attributes and instead constructs an empty one -- cosmwasm-std: Rename `Event.kind` to `Event.ty`. -- cosmwasm-std: Rename `SubcallResponse` to `SubMsgExecutionResponse`. -- contracts: Rename `ReflectSubCall` to `ReflectSubMsg` and `SubCallResult` to - `SubCallMsg` in the `reflect` contract. -- cosmwasm-std: Rename the `subcall` module to `submessages`. -- cosmwasm-vm: Bump required marker export `cosmwasm_vm_version_5` to - `interface_version_6`. -- cosmwasm-std: `IbcAcknowledgement` is renamed to - `IbcAcknowledgementWithPacket` as it contains both data elements. ([#975]) -- cosmwasm-std: `IbcAcknowledgementWithPacket.acknowledgement` is no longer - simply `Binary`, but a new `IbcAcknowledgement` structure, which contains one - field - `data: Binary`. This change was made to allow us to handle future - changes to IBC in a non-contract-breaking way. ([#975]) - -[#961]: https://github.com/CosmWasm/cosmwasm/pull/961 -[#975]: https://github.com/CosmWasm/cosmwasm/pull/975 +- cosmwasm-std: Remove `non_exhaustive` from IBC types `IbcChannelOpenMsg`, + `IbcChannelConnectMsg` and `IbcChannelCloseMsg` in order to allow exhaustive + matching over the possible scenarios without an unused fallback case + ([#1449]). + +[#1449]: https://github.com/CosmWasm/cosmwasm/pull/1449 + +## [1.1.4] - 2022-10-03 ### Fixed -- comswasm-vm: Whitelisted the `i64.extend32_s` operation. +- cosmwasm-schema: Properly analyze schemas generated for `untagged` enums -## [0.14.1] - 2021-06-14 +## [1.1.3] - 2022-09-29 + +### Fixed + +- cosmwasm-schema: `IntegrityError` is now public + +## [1.1.2] - 2022-09-19 ### Added -- cosmwasm-std: Add `Timestamp::minus_seconds` and `::minus_nanos`. -- cosmwasm-std: Add `Addr::as_bytes` -- cosmwasm-std: Implement `std::ops::Sub` for `math::Decimal` -- cosmwasm-std: Add `Timestamp::seconds` and `Timestamp::subsec_nanos`. -- cosmwasm-std: Implement division for `Decimal / Uint128` -- cosmwasm-std: Add `math::Decimal::sqrt` +- cosmwasm-std: Add testing macro `assert_approx_eq!` for comparing two integers + to be relatively close to each other ([#1417]). +- cosmwasm-std: Add `HexBinary` which is like `Binary` but encodes to hex + strings in JSON. Add `StdError::InvalidHex` error case. ([#1425]) + +[#1417]: https://github.com/CosmWasm/cosmwasm/issues/1417 +[#1425]: https://github.com/CosmWasm/cosmwasm/pull/1425 ### Fixed -- cosmwasm-std: Fix `Uint64::multiply_ratio` and `Uint128::multiply_ratio` so - that internal multiplication cannot cause an unnecessary overflow. ([#920]) +- cosmwasm-vm: Bump `MODULE_SERIALIZATION_VERSION` to "v4" because the module + serialization format changed between Wasmer 2.2 and 2.3 ([#1426]). +- cosmwasm-schema: The `QueryResponses` derive macro now supports `QueryMsg`s + with generics. ([#1429]) -[#920]: https://github.com/CosmWasm/cosmwasm/issues/920 +[#1426]: https://github.com/CosmWasm/cosmwasm/issues/1426 +[#1429]: https://github.com/CosmWasm/cosmwasm/pull/1429 -## [0.14.0] - 2021-05-03 +## [1.1.1] - 2022-09-15 -### Added +### Fixed -- cosmwasm-crypto: Add `ed25519_batch_verify`, EdDSA ed25519 batch signature - verification scheme for Tendermint signatures and public keys formats. - ([#788]) -- cosmwasm-crypto: Add `ed25519_verify`, EdDSA ed25519 signature verification - scheme for Tendermint signature and public key formats. ([#771]) -- cosmwasm-crypto: New crypto-related crate. Add `secp256k1_verify`, ECDSA - secp256k1 signature verification scheme for Cosmos signature and public key - formats. ([#780]) -- cosmwasm-vm: Add PinnedMemoryCache. ([#696]) -- cosmwasm-vm: The new `Cache::analyze` provides a static analyzis of the Wasm - bytecode. This is used to tell the caller if the contract exposes IBC entry - points. ([#736]) -- cosmwasm-vm: Added new `stargate` feature flag to enable new stargate and ibc - features ([#692], [#716]) -- cosmwasm-vm: (requires `stargate`) call into 6 new ibc entry points if exposed - by contract ([#692], [#716]) -- cosmwasm-std: Added new `stargate` feature flag to enable new stargate and ibc - features ([#692], [#706]) -- cosmwasm-std: (requires `stargate`) Added new `CosmosMsg::Stargate` message - type to dispatch protobuf-encoded message (contract must know proto schema) - ([#706]) -- cosmwasm-std: (requires `stargate`) Added new `QueryRequest::Stargate` message - type to dispatch protobuf-encoded queries (contract must know proto schema for - request and response) ([#706]) -- cosmwasm-std: (requires `stargate`) Added new `CosmosMsg::Ibc(IbcMsg)` message - type to use ibctransfer app or send raw ics packets (if contract has ibc entry - points) ([#692], [#710]) -- cosmwasm-std: Add mutable helper methods to `InitResponse`, `MigrateResponse` - and `HandleResponse` which make `Context` obsolete. -- contracts: added new `ibc-reflect` contract that receives channels and assigns - each an account to redispatch. Similar idea to ICS27/Interchain Accounts (but - different implementation) ([#692], [#711], [#714]) -- cosmwasm-std: Added new `WasmMsg::Migrate` variant that allows one contract - (eg. multisig) be the admin and migrate another contract ([#768]) -- cosmwasm-std: Added optional `system` entry point that can only be called by - native (blockchain) modules to expose admin functionality if desired. ([#793]) -- cosmwasm-std: Add extra field `submessages` to `Response`, such that you can - get a callback from these messages after their execution (success or failure). - ([#796]) -- cosmwasm-std: Added `reply` entry point that will receive all callbacks from - submessages dispatched by this contract. This is only required if contract - returns "submessages" (above). ([#796]) -- cosmwasm-std: Implement `From for String`, `From for u128` - as well as `From for Uint128`. -- cosmwasm-std: Create new address type `Addr`. This is human readable (like - `HumanAddr`) but is immutable and always contains a valid address ([#802]). -- cosmwasm-vm: Add import `addr_validate` ([#802]). -- cosmwasm-std: Add `BankMsg::Burn` variant when you want the tokens to - disappear ([#860]) -- cosmwasm-std: Create `Fraction` trait to represent a fraction `p`/`q` with - integers `p` and `q`. `Decimal` now implements `Fraction`, which - provides public getters `::numerator()` and `::denominator()`. -- cosmwasm-std: Add `Decimal::inv` that returns `1/d` for decimal `d`. -- cosmwasm-vm: Add `Cache::metrics` to expose internal data for monitoring - purposes ([#763]). -- cosmwasm-std: Implement `PartialOrd` and `Ord` for `Binary` using the same - lexicographical ordering as implemented by `Vec`. -- cosmwasm-std: Implement `PartialOrd` and `Ord` for `Addr` using the same - lexicographical ordering as implemented by `String`. -- cosmwasm-std: Added new `WasmMsg::UpdateAdmin` variant that allows an admin - contract (eg. multisig) to set another admin ([#900]) -- cosmwasm-std: Added new `WasmMsg::ClearAdmin` variant that allows an admin - contract (eg. multisig) to clear the admin, to prevent future migrations - ([#900]) -- cosmwasm-std: Implement `Display for Coin` ([#901]). -- cosmwasm-std: Create `Uint64` analogously to `Uint128` with string - serialization allowing the use of the full uint64 range in JSON clients that - use float numbers, such as JavaScript and jq. -- cosmwasm-std: Create const functions `Uint64::new` and `Uint128::new` to - create instances in a const context. - -[#692]: https://github.com/CosmWasm/cosmwasm/issues/692 -[#706]: https://github.com/CosmWasm/cosmwasm/pull/706 -[#710]: https://github.com/CosmWasm/cosmwasm/pull/710 -[#711]: https://github.com/CosmWasm/cosmwasm/pull/711 -[#714]: https://github.com/CosmWasm/cosmwasm/pull/714 -[#716]: https://github.com/CosmWasm/cosmwasm/pull/716 -[#763]: https://github.com/CosmWasm/cosmwasm/issues/763 -[#768]: https://github.com/CosmWasm/cosmwasm/pull/768 -[#793]: https://github.com/CosmWasm/cosmwasm/pull/793 -[#796]: https://github.com/CosmWasm/cosmwasm/pull/796 -[#802]: https://github.com/CosmWasm/cosmwasm/pull/802 -[#860]: https://github.com/CosmWasm/cosmwasm/pull/860 -[#900]: https://github.com/CosmWasm/cosmwasm/pull/900 -[#901]: https://github.com/CosmWasm/cosmwasm/pull/901 +- cosmwasm-schema: Using `QueryResponses` with a `QueryMsg` containing a + unit-like variant will no longer crash. The different variant types in Rust + are: + ```rust + enum QueryMsg { + UnitLike, + Tuple(), + Struct {}, + } + ``` + It's still recommended to only use struct variants, even if there are no + fields. ### Changed -- contracts: Rename `HandleMsg` to `ExecuteMsg`. -- all: Rename `handle` entry point to `execute`. -- all: Rename `init` entry point to `instantiate`. -- all: Rename `system` entry point to `sudo`. -- all: Drop support for Rust versions lower than 1.51.0. -- all: The `query` and `execute` entry points are now optional. It is still - highly recommended to implement and expose them in almost any use case though. -- all: Change the encoding of the key/value region of the `db_next` import to a - more generic encoding that supports an arbitrary number of sections. This - encoding can then be reused for other multi value regions. -- all: Remove the `info: MessageInfo` argument from the `migrate` entry point - ([#690]). -- cosmwasm-std: Remove `from_address` from `BankMsg::Send`, as it always sends - from the contract address, and this is consistent with other `CosmosMsg` - variants. -- cosmwasm-std: Remove the previously deprecated `InitResult`, `HandleResult`, - `MigrateResult` and `QueryResult` in order to make error type explicit and - encourage migration to custom errors. -- cosmwasm-std: Add a `data` field to `InitResponse` the same way as in - `MigrateResponse` and `HandleResponse`. -- cosmwasm-std: Rename `MessageInfo::sent_funds` to `MessageInfo::funds`. -- cosmwasm-std: Merge response types `InitResponse`, `HandleResponse` and - `MigrateResponse` into the new `Response`. -- cosmwasm-std: Remove `Default` implementation from `HumanAddr`, - `CanonicalAddr`, `ContractInfo`, `MessageInfo`, `BlockInfo` and `Env`. If you - need one of those, you're probably doing something wrong. -- cosmwasm-std: Make `label` in `WasmMsg::Instantiate` non-optional to better - match the Go/database format. -- cosmwasm-std: Add new field `admin` to `WasmMsg::Instantiate` to fully support - `MsgInstantiateContract` from `x/wasm` ([#861]). -- cosmwasm-std: `Binary::to_array` is now generic over the array length instead - of the output type. As a consequence the obsolete type `ByteArray` was - removed. The array length is not restricted to 0-64 anymore. -- cosmwasm-std: Use const generics to implement `From<&[u8; LENGTH]> for Binary` - and `From<[u8; LENGTH]> for Binary`, such that the array length is not - restricted to 0-64 anymore. -- cosmwasm-vm: Avoid serialization of Modules in `InMemoryCache`, for - performance. Also, remove `memory_limit` from `InstanceOptions`, and define it - instead at `Cache` level (same memory limit for all cached instances). - ([#697]) -- cosmwasm-std: Rename type `KV` to `Pair` in order to comply to naming - convention as enforced by clippy rule `upper_case_acronyms` from Rust 1.51.0 - on. -- cosmwasm-std: `ContractInfo::address` and `MessageInfo::sender` are now of - type `Addr`. The value of those fields is created by the host and thus valid. -- cosmwasm-vm: Bump required marker export `cosmwasm_vm_version_4` to - `interface_version_5`. -- cosmwasm-vm: Rename trait `Api` to `BackendApi` to better express this is the - API provided by the VM's backend (i.e. the blockchain). -- cosmwasm-vm: Rename imports to `addr_canonicalize` and `addr_humanize` - ([#802]). -- cosmwasm-vm: Replace types `HumanAddr`/`CanonicalAddr` with - `&str`/`String`/`&[u8]`/`Vec` in the methods of `BackendApi`. The address - types belong in the contract development and the backend operates on raw - strings and binary anyways. -- contracts: `reflect` contract requires `stargate` feature and supports - redispatching `Stargate` and `IbcMsg::Transfer` messages ([#692]) -- cosmwasm-std: The arithmetic methods of `Uint128` got a huge overhaul, making - them more consistent with the behaviour of the Rust primitive types. Thank you - [@yihuang] for bringing this up and for the great implementation. ([#853]) - 1. `Uint128` got the new functions `checked_add`, `checked_sub`, - `checked_mul`, `checked_div`, `checked_div_euclid`, `checked_rem`, - `wrapping_add`, `wrapping_sub`, `wrapping_mul`, `wrapping_pow`, - `saturating_add`, `saturating_sub`, `saturating_mul` and `saturating_pow` - which match their equivalent in [u128] except that instead of `Option` the - checked methods return a `Result` with an `OverflowError` or - `DivideByZeroError` that carries a few debug information and can directly - be converted to `StdError`/`StdResult` by using the `?` operator. - 2. `StdError::Underflow` and `StdError::underflow` were removed in favour of - `StdError::Overflow`. `StdError::DivideByZeroError` was added. - 3. The `-` operator (`impl ops::Sub for Uint128`) was removed - because it returned a `StdResult` instead of panicking in the case of an - overflow. This behaviour was inconsistent with `+` and the Rust standard - library. Please use the explicit `*_sub` methods introduced above. In a - couple of releases from now, we want to introduce the operator again with - panicking overflow behaviour ([#858]). -- cosmwasm-std: Replace `HumanAddr` with `String` in `BankQuery`, `StakingQuery` - and `WasmQuery` query requests ([#802]). -- cosmwasm-std: In staking query response types `Delegation`, `FullDelegation` - and `Validator` the validator address fields were changed from `HumanAddr` to - `String`. The new `Addr` type cannot be used here because it only supports - standard account addresses via `Api::addr_*` ([#871]). -- cosmwasm-std: Change address types in `BankMsg`, `IbcMsg` and `WasmMsg` from - `HumanAddr` to `String` ([#802]). -- cosmwasm-std: `Api::addr_humanize` now returns `Addr` instead of `HumanAddr` - ([#802]). -- cosmwasm-std: Hide `StakingMsg`, `CosmosMsg::Staking`, - `AllDelegationsResponse`, `BondedDenomResponse`, `Delegation`, - `FullDelegation`, `StakingQuery`, `Validator`, `ValidatorsResponse` and - `testing::StakingQuerier` behind the `staking` feature flag to make those only - available in contracts built for PoS chains. -- cosmwasm-std: Remove `StakingMsg::Withdraw` in favour of - `DistributionMsg::SetWithdrawAddress` and - `DistributionMsg::WithdrawDelegatorReward` ([#848]). -- cosmwasm-std: Rename `StakingQuery::Validators`, `ValidatorsResponse` and - `QuerierWrapper::query_validators` to `StakingQuery::AllValidators`, - `AllValidatorsResponse` and `QuerierWrapper.query_all_validators`. Add - `StakingQuery::Validator`, `ValidatorResponse` and - `QuerierWrapper::query_validator` to allow querying a single validator. - ([#879]) -- cosmwasm-schema: Make first argument non-mutable in `export_schema_with_title` - for consistency with `export_schema`. -- cosmwasm-std: The block time in `BlockInfo::time` is now a `Timestamp`. - `BlockInfo::time_nanos` was removed. - -[#696]: https://github.com/CosmWasm/cosmwasm/issues/696 -[#697]: https://github.com/CosmWasm/cosmwasm/issues/697 -[#736]: https://github.com/CosmWasm/cosmwasm/pull/736 -[#690]: https://github.com/CosmWasm/cosmwasm/issues/690 -[@yihuang]: https://github.com/yihuang -[#853]: https://github.com/CosmWasm/cosmwasm/pull/853 -[#858]: https://github.com/CosmWasm/cosmwasm/issues/858 -[u128]: https://doc.rust-lang.org/std/primitive.u128.html -[#802]: https://github.com/CosmWasm/cosmwasm/pull/802 -[#871]: https://github.com/CosmWasm/cosmwasm/issues/871 -[#861]: https://github.com/CosmWasm/cosmwasm/issues/861 -[#848]: https://github.com/CosmWasm/cosmwasm/issues/848 -[#879]: https://github.com/CosmWasm/cosmwasm/pull/879 - -### Deprecated +- cosmwasm-schema: It is no longer necessary to specify `serde` or `schemars` as + a dependency in order to make `cosmwasm-schema` macros work. -- cosmwasm-std: `InitResponse`, `MigrateResponse` and `HandleResponse` are - deprecated in favour of the new `Response`. -- cosmwasm-std: `Context` is deprecated in favour of the new mutable helpers in - `Response`. -- cosmwasm-std: `HumanAddr` is not much more than an alias to `String` and it - does not provide significant safety advantages. With CosmWasm 0.14, we now use - `String` when there was `HumanAddr` before. There is also the new `Addr`, - which holds a validated immutable human readable address. ([#802]) +## [1.1.0] - 2022-09-05 -[#802]: https://github.com/CosmWasm/cosmwasm/pull/802 +### Added -## [0.13.2] - 2021-01-14 +- cosmwasm-std: Implement PartialEq for `Binary` and `u8` arrays. +- cosmwasm-std: Add `Uint{64,128,256,512}::one`. +- cosmwasm-std: Add `Uint{64,128,256,512}::abs_diff` and + `Decimal{,256}::abs_diff` ([#1334]). +- cosmwasm-std: Implement `From for Decimal256`. +- cosmwasm-std: Implement `Rem`/`RemAssign` for `Decimal`/`Decimal256`. +- cosmwasm-std: Implement `checked_add`/`_sub`/`_div`/`_rem` for + `Decimal`/`Decimal256`. +- cosmwasm-std: Implement `pow`/`saturating_pow` for `Decimal`/`Decimal256`. +- cosmwasm-std: Implement `ceil`/`floor` for `Decimal`/`Decimal256`. +- cosmwasm-std: Implement `PartialEq` for reference on one side and owned value + on the other for all `Uint` and `Decimal` types +- cosmwasm-std: Implement `saturating_add`/`sub`/`mul` for + `Decimal`/`Decimal256`. +- cosmwasm-std: Implement `BankQuery::Supply` to allow querying the total supply + of a native token. In order to use this query in a contract, the + `cosmwasm_1_1` feature needs to be enabled for the `cosmwasm_std` dependency. + This makes the contract incompatible with chains running CosmWasm `1.0`. + ([#1356]) +- cosmwasm-std: Implement `MIN` const value for all `Uint` and `Decimal` types +- cosmwasm-std: Implement `checked_div_euclid` for `Uint256`/`Uint512` +- cosmwasm-std: Add `QuerierWrapper::query_wasm_contract_info` - this is just a + convenience helper for querying `WasmQuery::ContractInfo`. +- cosmwasm-check: This is a new binary package that allows running various + CosmWasm compatibility checks on compiled .wasm files. See + https://crates.io/crates/cosmwasm-check for usage info. -## Changed +[#1334]: https://github.com/CosmWasm/cosmwasm/pull/1334 +[#1356]: https://github.com/CosmWasm/cosmwasm/pull/1356 -- cosmwasm-vm: Update Wasmer to 1.0.1. +### Changed -## [0.13.1] - 2021-01-12 +- cosmwasm-vm/cosmwasm-profiler: Upgrade Wasmer to 2.3.0. +- cosmwasm-std: Enable the `abort` feature by default. This provides more + helpful panic messages via a custom panic handler. +- cosmwasm-std: Make `Decimal{,256}::DECIMAL_PLACES` a public `u32` value. +- cosmwasm-crypto: Bumped `k256` `0.10.4 -> 0.11` and `digest` `0.9 -> 0.10` + ([#1374]). +- cosmwasm-vm: Rename features to capabilities, including + 1. `features_from_csv` to `capabilities_from_csv`; + 2. `CacheOptions::supported_features` to + `CacheOptions::available_capabilities`; + 3. `MockInstanceOptions::supported_features` to + `MockInstanceOptions::available_capabilities` + 4. `Instance::required_features` to `Instance::required_capabilities` + 5. `AnalysisReport::required_features` to + `AnalysisReport::required_capabilities`. -### Added +[#1374]: https://github.com/CosmWasm/cosmwasm/pull/1374 -- cosmwasm-std: Add the new `#[entry_point]` macro attribute that serves as an - alternative implementation to `cosmwasm_std::create_entry_points!(contract)` - and `cosmwasm_std::create_entry_points_with_migration!(contract)`. Both ways - are supported in the 0.13 series. +### Deprecated -## [0.13.0] – 2021-01-06 +- cosmwasm-vm: The `check_contract` example was deprecated. Please use the new + crate [cosmwasm-check](https://crates.io/crates/cosmwasm-check) instead + ([#1371]). -## Added +[#1371]: https://github.com/CosmWasm/cosmwasm/issues/1371 -- cosmwasm-std: Extend binary to array support to 64 bytes. +## [1.0.0] - 2022-05-14 -## Changed +### Added -- all: Drop support for Rust versions lower than 1.47.0. -- cosmwasm-std: Remove `cosmwasm_std::testing::MockApi::new`. Use - `MockApi::default` instead. -- cosmwasm-vm: Upgrade Wasmer to 1.0 and adapt all the internal workings - accordingly. -- cosmwasm-vm: Export method `cosmwasm_vm::Cache::stats` and response type - `Stats`. -- cosmwasm-vm: Remove `cosmwasm_vm::testing::MockApi::new`. Use - `MockApi::default` instead. -- cosmwasm-vm: Convert field `Instance::api` to a method. -- cosmwasm-vm: Change order of generic arguments for consistency in `Instance`, - `Cache` and `Backend` to always match ``. -- cosmwasm-vm: Remove `Instance::get_memory_size`. Use `Instance::memory_pages` - instead. - -## 0.12.2 (2020-12-14) - -**cosmwasm-std** - -- `StdError` now implements `PartialEq` (ignoring backtrace if any). This allows - simpler `assert_eq!()` when testing error conditions (rather than match - statements as now). - -## 0.12.1 (2020-12-09) - -**cosmwasm-std** - -- Deprecate `InitResult`, `HandleResult`, `MigrateResult` and `QueryResult` in - order to make error type explicit and encourage migration to custom errors. -- Implement `Deref` for `QuerierWrapper`, such that `QuerierWrapper` behaves - like a smart pointer to `Querier` allowing you to access `Querier` methods - directly. - -## 0.12.0 (2020-11-19) - -**cosmwasm-std** - -- Remove the previously deprecated `StdError::Unauthorized`. Contract specific - errors should be implemented using custom error types now (see - [migration guide](./MIGRATING.md) 0.10 -> 0.11). -- Use dependency `thiserror` instead of `snafu` to implement `StdError`. Along - with this change, the `backtraces` feature now requires Rust nightly. -- Rename `StdError::ParseErr::source` to `StdError::ParseErr::source_type` and - `StdError::SerializeErr::target` to `StdError::SerializeErr::target_type` to - work around speacial treatment of the field name `source` in thiserror. -- Rename `Extern` to `Deps` to unify naming. -- Simplify ownership of calling `handle`, etc. with `Deps` and `DepsMut` struct - that just contains references (`DepsMut` has `&mut Storage` otherwise the - same) -- Remove unused `Deps::change_querier`. If you need this or similar - functionality, create a new struct with the right querier. -- Remove `ReadonlyStorage`. You can just use `Storage` everywhere. And use - `&Storage` to provide readonly access. This was only needed to let - `PrefixedStorage`/`ReadonlyPrefixedStorage` implement the common interface, - which is something we don't need. - -**cosmwasm-storage** - -- `PrefixedStorage`/`ReadonlyPrefixedStorage` do not implement the - `Storage`/`ReadonlyStorage` traits anymore. If you need nested prefixes, you - need to construct them directly via `PrefixedStorage::multilevel` and - `ReadonlyPrefixedStorage::multilevel`. -- Remove unused `TypedStorage`. If you need this or similar functionality, you - probably want to use `Bucket` or `Singleton`. If you really need it, please - copy the v0.11 code into your project. -- Remove `StorageTransaction` along with `transactional` and `RepLog`. This has - not been used actively for contract development and is now maintained in a - contract testing framework. - -**cosmwasm-vm** - -- Remove `Storage::range` and `StorageIterator`. The storage implementation is - now responsible for maintaining iterators internally and make them accessible - via the new `Storage::scan` and `Storage::next` methods. -- Add `FfiError::IteratorDoesNotExist`. Looking at this, `FfiError` should - probably be renamed to something that includes before, on and behind the FFI - boundary to Go. -- `MockStorage` now implements the new `Storage` trait and has an additional - `MockStorage::all` for getting all elements of an iterator in tests. -- Remove unused `Extern::change_querier`. If you need this or similar - functionality, create a new struct with the right querier. -- Let `Instance::from_code` and `CosmCache::get_instance` take options as an - `InstanceOptions` struct. This contains `gas_limit` and `print_debug` for now - and can easily be extended. `cosmwasm_vm::testing::mock_instance_options` can - be used for creating such a struct in integration tests. -- Make `FileSystemCache` crate internal. This should be used via `CosmCache`. -- Fix return type of `FileSystemCache::load` to `VmResult>` in - order to differentiate missing files from errors. -- Add in-memory caching for recently used Wasm modules. -- Rename `CosmCache` to just `cosmwasm_vm::Cache` and add `CacheOptions` to - configure it. -- Rename `Extern` to `Backend`. -- Rename `mock_dependencies` to `mock_backend` and - `mock_dependencies_with_balances` to `mock_backend_with_balances`. -- Rename `FfiError`/`FfiResult` to `BackendError`/`BackendResult` and adapt - `VmError` accordingly. - -## 0.11.2 (2020-10-26) - -**cosmwasm-std** - -- Implement `From` and `From` - for `StdError`. -- Generalize denom argument from `&str` to `S: Into` in `coin`, `coins` - and `Coin::new`. -- Implement `PartialEq` between `Binary` and `Vec`/`&[u8]`. -- Add missing `PartialEq` implementations between `HumanAddr` and `str`/`&str`. -- Add `Binary::to_array`, which allows you to copy binary content into a - fixed-length `u8` array. This is especially useful for creating integers from - binary data. - -## 0.11.1 (2020-10-12) - -**cosmwasm-std** - -- Implement `Hash` and `Eq` for `Binary` to allow using `Binary` in `HashSet` - and `HashMap`. -- Implement `Hash` and `Eq` for `CanonicalAddr` to allow using `CanonicalAddr` - in `HashSet` and `HashMap`. -- Implement `Add`, `AddAssign` and `Sub` with references on the right hand side - for `Uint128`. -- Implement `Sum` and `Sum<&'a Uint128>` for `Uint128`. - -## 0.11.0 (2020-10-08) - -**all** - -- Drop support for Rust versions lower than 1.45.2. -- The serialization of the result from `init`/`migrate`/`handle`/`query` changed - in an incompatible way. See the new `ContractResult` and `SystemResult` types - and their documentation. -- Pass `Env` into `query` as well. As this doesn't have `MessageInfo`, we - removed `MessageInfo` from `Env` and pass that as a separate argument to - `init`, `handle`, and `query`. See the example - [type definitions in the README](README.md#implementing-the-smart-contract) to - see how to update your contract exports (just add one extra arg each). - -**cosmwasm-std** - -- Add `time_nanos` to `BlockInfo` allowing access to high precision block times. -- Change `FullDelegation::accumulated_rewards` from `Coin` to `Vec`. -- Rename `InitResponse::log`, `MigrateResponse::log` and `HandleResponse::log` - to `InitResponse::attributes`, `MigrateResponse::attributes` and - `HandleResponse::attributes`. -- Rename `LogAttribute` to `Attribute`. -- Rename `log` to `attr`. -- Rename `Context::add_log` to `Context::add_attribute`. -- Add `Api::debug` for emitting debug messages during development. -- Fix error type for response parsing errors in `ExternalQuerier::raw_query`. - This was `Ok(Err(StdError::ParseErr))` instead of - `Err(SystemError::InvalidResponse)`, implying an error created in the target - contract. -- Deprecate `StdError::Unauthorized` and `StdError::unauthorized` in favour of - custom errors. From now on `StdError` should only be created by the standard - library and should only contain cases the standard library needs. -- Let `impl Display for CanonicalAddr` use upper case hex instead of base64. - This also affects `CanonicalAddr::to_string`. -- Create trait `CustomQuery` for the generic argument in - `QueryRequest`. This allows us to provide - `impl From for QueryRequest` for any custom query. -- Implement `From for Vec`. -- Implement `From for Vec`. -- Add `Binary::into_vec` and `CanonicalAddr::into_vec`. -- The `canonical_length` argument was removed from `mock_dependencies`, - `mock_dependencies_with_balances`. In the now deprecated `MockApi::new`, the - argument is unused. Contracts should not need to set this value and usually - should not make assumptions about the value. -- The canonical address encoding in `MockApi::canonical_address` and - `MockApi::human_address` was changed to an unpredictable representation of - non-standard length that aims to destroy most of the input structure. - -**cosmwasm-storage** - -- Change order of arguments such that `storage` is always first followed by - namespace in `Bucket::new`, `Bucket::multilevel`, `ReadonlyBucket::new`, - `ReadonlyBucket::multilevel`, `bucket` and `bucket_read`. -- Change order of arguments such that `storage` is always first followed by - namespace in `PrefixedStorage::new`, `PrefixedStorage::multilevel`, - `ReadonlyPrefixedStorage::new`, `ReadonlyPrefixedStorage::multilevel`, - `prefixed` and `prefixed_read`. - -**cosmwasm-vm** - -- `CosmCache::new`, `Instance::from_code` and `Instance::from_module` now take - an additional argument to enable/disable printing debug logs from contracts. -- Bump required export `cosmwasm_vm_version_3` to `cosmwasm_vm_version_4`. -- The `canonical_length` argument was removed from `mock_dependencies`, - `mock_dependencies_with_balances` and `MockApi::new_failing`. In the now - deprecated `MockApi::new`, the argument is unused. Contracts should not need - to set this value and usually should not make assumptions about the value. -- The canonical address encoding in `MockApi::canonical_address` and - `MockApi::human_address` was changed to an unpredictable representation of - non-standard length that aims to destroy most of the input structure. - -## 0.10.1 (2020-08-25) - -**cosmwasm-std** - -- Fix bug where `ExternalStorage.range()` would cause VM error if either lower - or upper bound was set - ([#508](https://github.com/CosmWasm/cosmwasm/issues/508)) - -## 0.10.0 (2020-07-30) - -**all** - -- Drop support for Rust versions lower than 1.44.1. - -**cosmwasm-std** - -- Remove error helpers `generic_err`, `invalid_base64`, `invalid_utf8`, - `not_found`, `parse_err`, `serialize_err`, `underflow`, `unauthorized` in - favour of `StdError::generic_err` and friends. -- Implement `From<&[u8; $N]> for Binary` and `From<[u8; $N]> for Binary` for all - `$N <= 32`. -- Add `Context` object that can be used to build Init/Handle/Migrate response - via `add_log`, `add_message`, `set_data` and then convert to the proper type - via `into` or `try_into`. Option to simplify response construction. -- Env uses `HumanAddr` for `message.sender` and `contract_address` -- Remove `Api` argument from `mock_env` -- Implement `From<&[u8]>` and `From>` for `CanonicalAddr` - -**cosmwasm-vm** - -- Remove unused cache size argument from `CosmCache`. -- `set_gas_limit` now panics if the given gas limit exceeds the max. supported - value. -- Increase the max. supported value for gas limit from 10_000_000_000 to - 0x7FFFFFFFFFFFFFFF. -- Add checks to `get_region` for failing early when the contract sends a Region - pointer to the VM that is not backed by a plausible Region. This helps - development of standard libraries. -- Create dedicated `RegionValidationError` and `RegionValidationResult`. -- `Api::human_address` and `Api::canonical_address` now return a pair of return - data and gas usage. -- Remove `NextItem` in favour of a more advanced `FfiResult`, which is used - to store the return result and the gas information consistently across all - APIs. `FfiResult` was changed to `(Result, GasInfo)`. -- Create error type `FfiError::InvalidUtf8` for the cases where the backend - sends invalid UTF-8 in places that expect strings. -- Remove `FfiError::Other` in favour of `FfiError::UserErr` and - `FfiError::Unknown`. -- The `canonicalize_address` and `humanize_address` imports now report user - errors to the contract. -- Bump `cosmwasm_vm_version_2` to `cosmwasm_vm_version_3`. -- `Querier::raw_query` and `QuerierResult` were removed in favour of the new - `Querier::query_raw`, which includes a gas limit parameter for the query. - -## 0.9.4 (2020-07-16) - -**cosmwasm-vm** - -- Add `Instance::create_gas_report` returning a gas report including the - original limit, the remaining gas and the internally/externally used gas. - -## 0.9.3 (2020-07-08) - -**cosmwasm-storage** - -- Add `.remove()` method to `Bucket` and `Singleton`. - -## 0.9.2 (2020-06-29) - -- Downgrade wasmer to 0.17.0. - -## 0.9.1 (2020-06-25) - -**cosmwasm-std** - -- Replace type `Never` with `Empty` because enums with no cases cannot be - expressed in valid JSON Schema. - -## 0.9.0 (2020-06-25) - -Note: this version contains an API bug and should not be used (see -https://github.com/CosmWasm/cosmwasm/issues/451). - -**all** +- cosmwasm-std: Export `DelegationResponse` ([#1301]). +- cosmwasm-std: When the new `abort` feature is enabled, cosmwasm-std installs a + panic handler that aborts the contract and passes the panic message to the + host. The `abort` feature can only be used when deploying to chains that + implement the import. For this reason, it's not yet enabled by default. + ([#1299]) +- cosmwasm-vm: A new import `abort` is created to abort contract execution when + requested by the contract. ([#1299]) +- cosmwasm-std: Add new `ibc3` feature that allows to use IBC-Go V3 features, + like version negotiation and exposing relayer address to the contract. + Requires a compatible wasmd runtime (v0.27.0+) ([#1302]) -- Upgrade wasmer to 0.17.1. -- Drop support for Rust versions lower than 1.43.1 +[#1299]: https://github.com/CosmWasm/cosmwasm/pull/1299 +[#1301]: https://github.com/CosmWasm/cosmwasm/pull/1301 +[#1302]: https://github.com/CosmWasm/cosmwasm/pull/1302 -**cosmwasm-std** - -- `ReadonlyStorage::get` and all its implementations now return - `Option>`. -- `ReadonlyStorage::range` and all its implementations now always succeed and - return an iterator instead of a result. This is now an iterator over - `Option` instead of `Option>`. -- `Storage::{set, remove}` and all their implementations no longer have a return - value. Previously they returned `StdResult<()>`. -- Trait `Querier` is not `Clone` and `Send` anymore. -- `consume_region` panics on null pointers and returns `Vec` instead of - `StdResult>`. -- Added contract migration mechanism. Contracts can now optionally export a - `migrate` function with the following definition: - ```rust - extern "C" fn migrate(env_ptr: u32, msg_ptr: u32) -> u32; - ``` -- InitResponse no longer has a data field. We always return the contract address - in the data field in the blockchain and don't allow you to override. `handle` - can still make use of the field. -- Rename `MockQuerier::with_staking` to `MockQuerier::update_staking` to match - `::update_balance`. -- The obsolete `StdError::NullPointer` and `null_pointer` were removed. -- Error creator functions are now in type itself, e.g. - `StdError::invalid_base64` instead of `invalid_base64`. The free functions are - deprecated and will be removed before 1.0. - -**cosmwasm-storage** - -- Remove `transactional_deps`. Use `transactional` that just provides a - transactional storage instead. -- `get_with_prefix` returns `Option>` instead of - `StdResult>>`. -- `set_with_prefix` and `remove_with_prefix` return nothing instead of - `StdResult<()>`. -- `RepLog::commit` no longer returns any value (always succeeds). -- `Op::apply` no longer returns any value (always succeeds). - -**cosmwasm-vm** - -- The export `allocate` must not return 0 as a valid address. The contract is - responsible for avoiding this offset in the linear memory. -- The import `db_read` now allocates memory for the return value as part of the - call and returns a pointer to the value as `u32`. The return value 0 means - _key does not exist_. -- The import `db_next` now allocates a memory region for the return key and - value as part of the call and returns a pointer to the region as `u32`. The - data in the region is stored in the format `value || key || keylen`. As - before, an empty key means _no more value_. -- Remove `Instance::get_gas` in favour of `Instance::get_gas_left`. -- All calls from the VM layer to the chain layer also return the amount of gas - used on success. (This is represented by replacing the return value with - `(value, used_gas)`). Gas usage across the system is then tracked in the VM - layer, which allows us to halt the contract during an import, as soon as we - can prove that we used all allocated gas. -- Remove instance caching, which is disabled since 0.8.1 as it is not stable. - Remove `CosmCache::store_instance`; you can not call `Instance::recylce` - directly to get back the external dependencies. -- Rename `MockQuerier::with_staking` to `MockQuerier::update_staking` to match - `::update_balance`. -- Instead of panicking, `read_region`/`write_region`/`get_region`/`set_region` - now return a new `CommunicationError::DerefErr` when dereferencing a pointer - provided by the contract fails. -- `FfiError::set_message` was removed because errors should be immutable. Use - `FfiError::other` to create an error with the desired error message. -- The import implementation of `db_scan` now errors instead of returning an - error code for an invalid order value. The return type was changed to `u32`. -- Remove `StorageIteratorItem` in favour of the new types `StorageIterator` and - `NextItem`. `StorageIterator` is a custom iterator type that does not - implement Rust's `Iterator` trait, allowing it to communicate the used gas - value of the last `next` call to the VM. -- Don't report any `VmError` back to the contract in `canonicalize_address` and - `humanize_address`. Only invalid inputs should be reported. -- Move error cases `VmError::RegionLengthTooBig` and `VmError::RegionTooSmall` - into `CommunicationError`. -- In the `canonicalize_address` implementation, invalid UTF-8 inputs now result - in `CommunicationError::InvalidUtf8`, which is not reported back to the - contract. A standard library should ensure this never happens by correctly - encoding string input values. -- Merge trait `ReadonlyStorage` into `Storage`. -- The imports `canonicalize_address` and `humanize_address` now return a memory - address to an error `Region`. If this address is 0, the call succeeded. -- Bump `cosmwasm_vm_version_1` to `cosmwasm_vm_version_2`. - -## 0.8.1 (2020-06-08) - -**cosmwasm-std** - -- The arguments of `log` changed from `&str` to `ToString`, allowing to pass - various types like `String`, `HumanAddr`, `Uint128` or primitive integers - directly. -- Add `From>` and `Into>` implementations for `Binary` for - zero-copy conversions. - -**cosmwasm-vm** - -- Deprecated `Instance::get_gas` in favour of `Instance::get_gas_left`. The old - method will remain available for a while but will issue a deprecation warning - when used. -- Disable instance caching by treating every cache size as 0. Instance caching - is not safe as the same Wasm memory is reused across multiple executions. -- The storage of an `Instance` can now be set into readonly mode, which is - checked by the writing storage imports `db_write` and `db_remove`. Read-only - mode is off by default for backwards compatibility. `call_query_raw` now sets - the instance's storage to readonly. -- The new error case `VmError::WriteAccessDenied` is returned when a contract - calls an import that potentially writes to storage during a query. - -## 0.8.0 (2020-05-25) - -**all** - -- Upgrade schemars to 0.7. -- Upgrade wasmer to 0.17. -- Update snafu to 0.6. -- Minimal supported Rust version is 1.41. -- Split `Region.len` into `Region.capacity` and `Region.length`, where the new - capacity is the number of bytes available and `length` is the number of bytes - used. This is a breaking change in the contract-vm interface, which requires - the same memory layout of the `Region` struct on both sides. -- Add `remove` method to `Storage` trait. -- (feature-flagged) Add `range` method to `ReadonlyStorage` trait. This returns - an iterator that covers all or a subset of the items in the db ordered - ascending or descending by key. -- Add new feature flag `iterator` to both packages to enable `range` - functionality. This is used to allow potential porting to chains that use - Merkle Tries (which don't allow iterating over ranges). -- All serialized JSON types now use snake_case mappings for names. This means - enum fields like `ChangeOwner` will map to `change_owner` in the underlying - JSON, not `changeowner`. This is a breaking change for the clients. -- Public interface between contract and runtime no longer uses `String` to - represent an error, but rather serializes `ApiError` as a rich JSON error. -- Return value from `env.write_db` and `env.remove_db` to allow error reporting. -- Query responses are now required to contain valid JSON. -- Renamed all `*_db` wasm imports to `db_*` -- Merge `cw-storage` repo as subpackage, now `cosmwasm-storage` -- Add iterator support to `cosmwasm-storage` -- `Coin.amount` is now `Uint128` rather than `String`. Uint128 serializes as a - string in JSON, but parses into a u128 data in memory. It also has some - operator overloads to allow easy math operations on `Coin` types, as well as - enforcing valid amounts. -- `Env` no longer has a `contract.balance` element. If you need this info, - please use the `Querier` to get this info. As of Cosmos-SDK 0.39 this needs - extra storage queries to get the balance, so we only do those queries when - needed. -- `Env.message.sent_funds` is a `Vec` not `Option>`. We will - normalize the go response in `go-cosmwasm` before sending it to the contract. -- `Env.message.signer` was renamed to `Env.message.sender`. -- `Env.block.{height,time}` are now `u64` rather than `i64`. - -**cosmwasm-schema** - -- This new crate now contains the implementations for generating JSON Schema - files from interface types. It exposes the functions `export_schema`, - `export_schema_with_title`, and `schema_for`. - -**cosmwasm-std** - -- Make all symbols from `cosmwasm::memory` crate internal, as those symbols are - not needed by users of the library. -- Rename `cosmwasm::mock::dependencies` -> `cosmwasm::mock::mock_dependencies` - to differentiate between testing and production `External`. -- Export all symbols from `cosmwasm::mock` as the new non-wasm32 module - `cosmwasm::testing`. Export all remaining symbols at top level (e.g. - `use cosmwasm::traits::{Api, Storage};` + `use cosmwasm::encoding::Binary;` - becomes `use cosmwasm::{Api, Binary, Storage};`). -- Rename package `cosmwasm` to `cosmwasm-std`. -- The export `allocate` does not zero-fill the allocated memory anymore. -- Add `remove_db` to the required imports of a contract. -- (feature-flagged) add `scan_db` and `next_db` callbacks from wasm contract to - VM. -- `serde::{from_slice, to_vec}` return `cosmwasm_std::Result`, no more need to - use `.context(...)` when calling these functions -- Split `Response` into `InitResponse` and `HandleResponse`; split - `ContractResult` into `InitResult` and `HandleResult`. -- Create explicit `QueryResponse`, analogue to `InitResponse` and - `HandleResponse`. -- The exports `cosmwasm_vm_version_1`, `allocate` and `deallocate` are now - private and can only be called via the Wasm export. Make sure to `use` - `cosmwasm_std` at least once in the contract to pull in the C exports. -- Add `Querier` trait and `QueryRequest` for query callbacks from the contract, - along with `SystemError` type for the runtime rejecting messages. -- `QueryRequest` takes a generic `Custom(T)` type that is passed opaquely to the - end consumer (`wasmd` or integration test stubs), allowing custom queries to - native code. -- `{Init,Handle,Query}Result` are now just aliases for a concrete `ApiResult` - type. -- Support results up to 128 KiB in `ExternalStorage.get`. -- The `Storage` trait's `.get`, `.set` and `.remove` now return a `Result` to - allow propagation of errors. -- Move `transactional`, `transactional_deps`, `RepLog`, `StorageTransaction` - into crate `cosmwasm-storage`. -- Rename `Result` to `StdResult` to differentiate between the auto-`use`d - `core::result::Result`. Fix error argument to `Error`. -- Complete overhaul of `Error` into `StdError`: - - The `StdError` enum can now be serialized and deserialized (losing its - backtrace), which allows us to pass them over the Wasm/VM boundary. This - allows using fully structured errors in e.g. integration tests. - - Auto generated snafu error constructor structs like `NotFound`/`ParseErr`/… - have been intenalized in favour of error generation helpers like - `not_found`/`parse_err`/… - - All error generator functions now return errors instead of results. - - Error cases don't contain `source` fields anymore. Instead source errors are - converted to standard types like `String`. For this reason, both - `snafu::ResultExt` and `snafu::OptionExt` cannot be used anymore. - - Backtraces became optional. Use `RUST_BACKTRACE=1` to enable them. - - `Utf8Err`/`Utf8StringErr` merged into `StdError::InvalidUtf8` - - `Base64Err` renamed into `StdError::InvalidBase64` - - `ContractErr`/`DynContractErr` merged into `StdError::GeneralErr` - - The unused `ValidationErr` was removed - - `StdError` is now - [non_exhaustive](https://doc.rust-lang.org/1.35.0/unstable-book/language-features/non-exhaustive.html), - making new error cases non-breaking changes. -- `ExternalStorage.get` now returns an empty vector if a storage entry exists - but has an empty value. Before, this was normalized to `None`. -- Reorganize `CosmosMsg` enum types. They are now split by modules: - `CosmosMsg::Bank(BankMsg)`, `CosmosMsg::Custom(T)`, `CosmosMsg::Wasm(WasmMsg)` -- CosmosMsg is now generic over the content of `Custom` variant. This allows - blockchains to support custom native calls in their Cosmos-SDK apps and - developers to make use of them in CosmWasm apps without forking the - `cosmwasm-vm` and `go-cosmwasm` runtime. -- Add `staking` feature flag to expose new `StakingMsg` types under `CosmosMsg` - and new `StakingRequest` types under `QueryRequest`. -- Add support for mocking-out staking queries via `MockQuerier.with_staking` -- `from_slice`/`from_binary` now require result type to be `DeserializeOwned`, - i.e. the result must not contain references such as `&str`. - -**cosmwasm-vm** - -- Make `Instance.memory`/`.allocate`/`.deallocate`/`.func` crate internal. A - user of the VM must not access the instance's memory directly. -- The imports `env.canonicalize_address`, `env.humanize_address` and - `env.read_db` don't return the number of bytes written anymore. This value is - now available in the resulting regions. Negative return values are errors, 0 - is success and values greater than 0 are reserved for future use. -- Change the required interface version guard export from `cosmwasm_api_0_6` to - `cosmwasm_vm_version_1`. -- Provide implementations for `remove_db` and (feature-flagged) `scan_db` and - `next_db` -- Provide custom `serde::{from_slice, to_vec}` implementation separate from - `cosmwasm_std`, so we can return cosmwasm-vm specific `Result` (only used - internally). -- `call_{init,handle,query}` and the `cosmwasm_vm::testing` wrappers return - standard `Result` types now, eg. `Result`. -- Add length limit when reading memory from the instance to protect against - malicious contracts creating overly large `Region`s. -- Add `Instance.get_memory_size`, giving you the peak memory consumption of an - instance. -- Remove `cosmwasm_vm::errors::CacheExt`. -- Move `cosmwasm_vm::errors::{Error, Result}` to - `cosmwasm_vm::{VmError, VmResult}` and remove generic error type from result. -- The import `db_read` now returns an error code if the storage key does not - exist. The latest standard library converts this error code back to a `None` - value. This allows differentiating non-existent and empty storage entries. -- Make `Instance::from_module`, `::from_wasmer` and `::recycle` crate-internal. -- Create explicit, public `Checksum` type to identify Wasm blobs. -- `CosmCache::new` now takes supported features as an argument. -- Rename `VmError::RegionTooSmallErr` to `VmError::RegionTooSmall`. -- Rename `VmError::RegionLengthTooBigErr` to `VmError::RegionLengthTooBig`. -- Change property types to owned string in `VmError::UninitializedContextData`, - `VmError::ConversionErr`, `VmError::ParseErr` and `VmError::SerializeErr`. -- Remove `VmError::IoErr` in favour of `VmError::CacheErr`. -- Simplify `VmError::CompileErr`, `VmError::ResolveErr` and - `VmError::WasmerRuntimeErr` to just hold a string with the details instead of - the source error. -- Remove `VmError::WasmerErr` in favour of the new `VmError::InstantiationErr`. -- The snafu error builders from `VmError` are now private, i.e. callers can only - use the errors, not create them. -- `VmError` is now `#[non_exhaustive]`. -- Split `VmError::RuntimeErr` in `VmError::BackendErr` and - `VmError::GenericErr`; rename `VmError::WasmerRuntimeErr` to - `VmError::RuntimeErr`. -- Add `Instance.with_querier` analogue to `Instance.with_storage`. - -## 0.7.2 (2020-03-23) - -**cosmwasm** - -- Fix JSON schema type of `Binary` from int array (wrong) to string (right). -- Make `Extern` not `Clone`able anymore. Before cloning led to copying the data - for mock storage and copying a stateless bridge for the external storage, - which are different semantics. -- Remove public `cosmwasm::imports::dependencies`. A user of this library does - not need to call this explicitely. Dependencies are created internally and - passed as an argument in `exports::do_init`, `exports::do_handle` and - `exports::do_query`. -- Make `ExternalStorage` not `Clone`able anymore. This does not copy any data, - so a clone could lead to unexpected results. - -## 0.7.1 (2020-03-11) - -**cosmwasm_vm** - -- Avoid unnecessary panic when checking corrupted wasm file. -- Support saving the same wasm to cache multiple times. - -## 0.7.0 (2020-02-26) - -**cosmwasm** - -- Rename `Slice` to `Region` to simplify differentiation between Wasm memory - region and serde's `from_slice` -- Rename `Params` to `Env`, `mock_params` to `mock_env` for clearer naming (this - is information on the execution environment) -- `Response.log` is not a vector of key/value pairs that can later be indexed by - Tendermint. - -**cosmwasm_vm** - -- Remove export `cosmwasm_vm::read_memory`. Using this indicates an - architectural flaw, since this is a method for host to guest communication - inside the VM and not needed for users of the VM. -- Create new type `cosmwasm_vm:errors::Error::RegionTooSmallErr`. -- Change return type of `cosmwasm_vm::write_memory` to `Result` to - make it harder to forget handling errors. -- Fix missing error propagation in `do_canonical_address`, `do_human_address` - and `allocate`. -- Update error return codes in import `c_read`. -- Rename imports `c_read`/`c_write` to `read_db`/`write_db`. -- Rename imports `c_canonical_address`/`c_human_address` to - `canonicalize_address`/`humanize_address`. -- Add `cosmwasm_vm::testing::test_io` for basic memory allocation/deallocation - testing between host and guest. -- Make `ValidationErr.msg` a dynamic `String` including relevant runtime - information. -- Remove export `check_api_compatibility`. The VM will take care of calling it. -- Let `check_api_compatibility` check imports by fully qualified identifier - `.`. -- Make gas limit immutable in `cosmwasm_vm::instance::Instance`. It is passed - once at construction time and cannot publicly be manipulated anymore. -- Remove `take_storage`/`leave_storage` from `cosmwasm_vm::Instance`. - -## 0.6 - -[Define canonical address callbacks](https://github.com/confio/cosmwasm/issues/73) - -- Use `&[u8]` for addresses in params -- Allow contracts to resolve human readable addresses (`&str`) in their json - into a fixed-size binary representation -- Provide mocks for unit testing and integration tests - -- Separate out `Storage` from `ReadOnlyStorage` as separate traits - -## 0.5 - -### 0.5.2 - -This is the first documented and supported implementation. It contains the basic -feature set. `init` and `handle` supported for modules and can return messages. -A stub implementation of `query` is done, which is likely to be deprecated soon. -Some main points: - -- The build-system and unit/integration-test setup is all stabilized. -- Cosmwasm-vm supports singlepass and cranelift backends, and caches modules on - disk and instances in memory (lru cache). -- JSON Schema output works - -All future Changelog entries will reference this base - -[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/v1.1.9...HEAD +--- + +The CHANGELOG for versions before **1.0.0** was moved to +[CHANGELOG-pre-1.0.0.md](./CHANGELOG-pre-1.0.0.md). + +[Unreleased]: https://github.com/CosmWasm/cosmwasm/compare/v3.0.2...HEAD +[3.0.2]: https://github.com/CosmWasm/cosmwasm/compare/v3.0.1...v3.0.2 +[3.0.1]: https://github.com/CosmWasm/cosmwasm/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/CosmWasm/cosmwasm/compare/v2.2.0...v3.0.0 +[2.2.0]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.5...v2.2.0 +[2.1.5]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.4...v2.1.5 +[2.1.4]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.3...v2.1.4 +[2.1.3]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.2...v2.1.3 +[2.1.2]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.1...v2.1.2 +[2.1.1]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.0...v2.1.1 +[2.1.0]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.8...v2.1.0 +[2.0.8]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.7...v2.0.8 +[2.0.7]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.6...v2.0.7 +[2.0.6]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.5...v2.0.6 +[2.0.5]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.4...v2.0.5 +[2.0.4]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.3...v2.0.4 +[2.0.3]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.2...v2.0.3 +[2.0.2]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.9...v2.0.0 +[1.5.9]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.8...v1.5.9 +[1.5.8]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.7...v1.5.8 +[1.5.7]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.6...v1.5.7 +[1.5.6]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.5...v1.5.6 +[1.5.5]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.4...v1.5.5 +[1.5.4]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.3...v1.5.4 +[1.5.3]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.2...v1.5.3 +[1.5.2]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.1...v1.5.2 +[1.5.1]: https://github.com/CosmWasm/cosmwasm/compare/v1.5.0...v1.5.1 +[1.5.0]: https://github.com/CosmWasm/cosmwasm/compare/v1.4.1...v1.5.0 +[1.4.1]: https://github.com/CosmWasm/cosmwasm/compare/v1.4.0...v1.4.1 +[1.4.0]: https://github.com/CosmWasm/cosmwasm/compare/v1.3.3...v1.4.0 +[1.3.3]: https://github.com/CosmWasm/cosmwasm/compare/v1.3.2...v1.3.3 +[1.3.2]: https://github.com/CosmWasm/cosmwasm/compare/v1.3.1...v1.3.2 +[1.3.1]: https://github.com/CosmWasm/cosmwasm/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/CosmWasm/cosmwasm/compare/v1.2.7...v1.3.0 +[1.2.7]: https://github.com/CosmWasm/cosmwasm/compare/v1.2.6...v1.2.7 +[1.2.6]: https://github.com/CosmWasm/cosmwasm/compare/v1.2.5...v1.2.6 +[1.2.5]: https://github.com/CosmWasm/cosmwasm/compare/v1.2.4...v1.2.5 +[1.2.4]: https://github.com/CosmWasm/cosmwasm/compare/v1.2.3...v1.2.4 +[1.2.3]: https://github.com/CosmWasm/cosmwasm/compare/v1.2.2...v1.2.3 +[1.2.2]: https://github.com/CosmWasm/cosmwasm/compare/v1.2.1...v1.2.2 +[1.2.1]: https://github.com/CosmWasm/cosmwasm/compare/v1.2.0...v1.2.1 +[1.2.0]: https://github.com/CosmWasm/cosmwasm/compare/v1.1.9...v1.2.0 [1.1.9]: https://github.com/CosmWasm/cosmwasm/compare/v1.1.8...v1.1.9 [1.1.8]: https://github.com/CosmWasm/cosmwasm/compare/v1.1.6...v1.1.8 [1.1.6]: https://github.com/CosmWasm/cosmwasm/compare/v1.1.5...v1.1.6 @@ -1550,29 +1399,3 @@ All future Changelog entries will reference this base [1.1.1]: https://github.com/CosmWasm/cosmwasm/compare/v1.1.0...v1.1.1 [1.1.0]: https://github.com/CosmWasm/cosmwasm/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-rc.0...v1.0.0 -[1.0.0-rc.0]: - https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta8...v1.0.0-rc.0 -[1.0.0-beta8]: - https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta7...v1.0.0-beta8 -[1.0.0-beta7]: - https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta6...v1.0.0-beta7 -[1.0.0-beta6]: - https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta5...v1.0.0-beta6 -[1.0.0-beta5]: - https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta4...v1.0.0-beta5 -[1.0.0-beta4]: - https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta3...v1.0.0-beta4 -[1.0.0-beta3]: - https://github.com/CosmWasm/cosmwasm/compare/v1.0.0-beta...v1.0.0-beta3 -[1.0.0-beta]: https://github.com/CosmWasm/cosmwasm/compare/v0.16.2...v1.0.0-beta -[0.16.2]: https://github.com/CosmWasm/cosmwasm/compare/v0.16.1...v0.16.2 -[0.16.1]: https://github.com/CosmWasm/cosmwasm/compare/v0.16.0...v0.16.1 -[0.16.0]: https://github.com/CosmWasm/cosmwasm/compare/v0.15.2...v0.16.0 -[0.15.2]: https://github.com/CosmWasm/cosmwasm/compare/v0.15.1...v0.15.2 -[0.15.1]: https://github.com/CosmWasm/cosmwasm/compare/v0.15.0...v0.15.1 -[0.15.0]: https://github.com/CosmWasm/cosmwasm/compare/v0.14.1...v0.15.0 -[0.14.1]: https://github.com/CosmWasm/cosmwasm/compare/v0.14.0...v0.14.1 -[0.14.0]: https://github.com/CosmWasm/cosmwasm/compare/v0.13.1...v0.14.0 -[0.13.2]: https://github.com/CosmWasm/cosmwasm/compare/v0.13.1...v0.13.2 -[0.13.1]: https://github.com/CosmWasm/cosmwasm/compare/v0.13.0...v0.13.1 -[0.13.0]: https://github.com/CosmWasm/cosmwasm/compare/v0.12.0...v0.13.0 diff --git a/Cargo.lock b/Cargo.lock index 452ae792eb..4eb6c3b8c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,97 +1,336 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli", + "gimli 0.31.1", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ - "getrandom 0.2.6", + "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anstream" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ - "winapi", + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.57" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] -name = "atty" -version = "0.2.14" +name = "ark-bls12-381" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" dependencies = [ - "hermit-abi", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.4", + "itertools 0.13.0", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.103", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.4", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", + "rayon", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "assert_cmd" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd389a4b2970a01282ee455294913c0a43724daedcd1a24c3eb0ec1c1320b66" +dependencies = [ + "anstyle", + "bstr", + "doc-comment", "libc", - "winapi", + "predicates", + "predicates-core", + "predicates-tree", + "wait-timeout", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" -version = "0.3.65" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.7", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] -name = "base64ct" -version = "1.5.0" +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64-serde" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba368df5de76a5bea49aaf0cf1b39ccfbbef176924d1ba5db3e4135216cbe3c7" +dependencies = [ + "base64 0.21.7", + "serde", +] + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.103", +] [[package]] name = "bitflags" @@ -100,30 +339,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bstr" -version = "0.2.17" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ - "lazy_static", "memchr", "regex-automata", "serde", @@ -131,164 +381,311 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.8" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50690fb3370fb9fe3550372746084c46f2ac8c9685c583d2be10eefd89d3d1a3" +dependencies = [ + "bytecheck_derive 0.8.1", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a31f923c2db9513e4298b72df143e6e655a759b3d6a0966df18f81223fff54f" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.8" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb17c862a905d912174daa27ae002326fff56dc8b8ada50a0a5f0976cb174f0" +checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.103", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cast" -version = "0.2.7" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ - "rustc_version", + "shlex", ] [[package]] -name = "cc" -version = "1.0.73" +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ - "num-integer", "num-traits", ] +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" -version = "2.34.0" +version = "4.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ - "ansi_term", - "atty", - "bitflags", + "anstream", + "anstyle", + "clap_lex", "strsim", - "textwrap", - "unicode-width", - "vec_map", ] +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" +dependencies = [ + "cc", +] + +[[package]] +name = "colorchoice" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "colored" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ - "atty", "lazy_static", - "winapi", + "windows-sys 0.59.0", +] + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "windows-sys 0.59.0", ] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "5d1ea1c2a2f898d2a6ff149587b8a04f41ee708d248c723f01ac2f0f01edc0b3" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] name = "cosmwasm-check" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "anyhow", + "assert_cmd", "clap", "colored", "cosmwasm-std", "cosmwasm-vm", + "predicates", + "tempfile", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" -dependencies = [ - "base64", +version = "3.0.3-dev" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "base64 0.22.1", + "base64-serde", + "cosmwasm-core", "criterion", - "digest 0.10.3", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "english-numbers", + "glob", "hex", "hex-literal", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core 0.6.4", + "rayon", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "sha3", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "cosmwasm-std", - "syn", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "anyhow", "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "insta", + "schemars 0.8.22", "semver", "serde", "serde_json", @@ -298,167 +695,129 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.103", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "base64", + "base64 0.22.1", + "bech32", + "bnum", "chrono", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", "cosmwasm-schema", - "derivative", - "forward_ref", + "crc32fast", + "cw-schema", + "derive_more 2.0.1", "hex", "hex-literal", - "schemars", + "paste", + "proptest", + "rand_core 0.6.4", + "rmp-serde", + "schemars 0.8.22", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clap", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", + "cosmwasm-vm-derive", + "crc32fast", "criterion", - "enumset", + "derive_more 1.0.0-beta.6", + "dhat", + "glob", "hex", "hex-literal", "leb128", - "loupe", - "parity-wasm", - "rand", - "schemars", + "rand 0.8.5", + "rand_core 0.6.4", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", + "target-lexicon", "tempfile", "thiserror", + "time", + "tracing", + "wasm-encoder 0.205.0", "wasmer", "wasmer-middlewares", + "wasmer-types", "wat", ] [[package]] -name = "cpufeatures" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" -dependencies = [ - "libc", -] - -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "cranelift-codegen-shared", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", + "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "criterion" -version = "0.3.5" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ - "atty", + "anes", "cast", + "ciborium", "clap", "criterion-plot", - "csv", - "itertools", - "lazy_static", + "is-terminal", + "itertools 0.10.5", "num-traits", + "once_cell", "oorandom", "plotters", "rayon", "regex", "serde", - "serde_cbor", "serde_derive", "serde_json", "tinytemplate", @@ -467,73 +826,62 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] -name = "crossbeam-channel" -version = "0.5.4" +name = "crossbeam-deque" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ - "cfg-if", + "crossbeam-epoch", "crossbeam-utils", ] [[package]] -name = "crossbeam-deque" -version = "0.8.1" +name = "crossbeam-epoch" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", - "crossbeam-epoch", "crossbeam-utils", ] [[package]] -name = "crossbeam-epoch" -version = "0.9.8" +name = "crossbeam-queue" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" -dependencies = [ - "cfg-if", - "lazy_static", -] +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -549,45 +897,65 @@ dependencies = [ ] [[package]] -name = "csv" -version = "1.1.6" +name = "curve25519-dalek" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "bstr", - "csv-core", - "itoa 0.4.8", - "ryu", - "serde", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", ] [[package]] -name = "csv-core" -version = "0.1.10" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "memchr", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +name = "cw-schema" +version = "3.0.3-dev" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", + "cw-schema-derive", + "indexmap", + "insta", + "pretty_assertions", + "schemars 1.0.4", + "serde", + "serde_json", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools 0.13.0", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] name = "darling" -version = "0.13.4" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -595,74 +963,177 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.4" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "syn", + "strsim", + "syn 2.0.103", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.103", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_more" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.103", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "unicode-xid", +] + +[[package]] +name = "dhat" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cd11d84628e233de0ce467de10b8633f4ddaecafadefc86e13b84b8739b827" +dependencies = [ + "backtrace", + "lazy_static", + "mintex", + "parking_lot", + "rustc-hash", + "serde", + "serde_json", + "thousands", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + [[package]] name = "dyn-clone" -version = "1.0.5" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" [[package]] name = "dynasm" @@ -670,13 +1141,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -687,62 +1158,88 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.9", - "thiserror", + "rand_core 0.6.4", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", ] +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + [[package]] name = "english-numbers" version = "0.3.3" @@ -766,165 +1263,277 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "enumset" -version = "1.0.11" +name = "enum-ordinalize" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4799cdb24d48f1f8a7a98d06b7fde65a85a2d1e42b25a889f5406aa1fbefe074" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" dependencies = [ - "enumset_derive", + "enum-ordinalize-derive", ] [[package]] -name = "enumset_derive" -version = "0.6.0" +name = "enum-ordinalize-derive" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea83a3fbdc1d999ccfbcbee717eab36f8edf2d71693a23ce0d7cca19e085304c" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ - "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.103", ] [[package]] -name = "fallible-iterator" -version = "0.2.0" +name = "enumset" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "11a6b7c3d347de0a9f7bfd2f853be43fe32fa6fac30c70f6d6d67a1e936b87ee" +dependencies = [ + "enumset_derive", +] [[package]] -name = "fastrand" -version = "1.7.0" +name = "enumset_derive" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "6da3ea9e1d1a3b1593e15781f930120e72aa7501610b2f82e5b6739c72e8eac5" dependencies = [ - "instant", + "darling", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] -name = "ff" -version = "0.12.0" +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ - "rand_core 0.6.3", - "subtle", + "libc", + "windows-sys 0.60.2", ] [[package]] -name = "fnv" -version = "1.0.7" +name = "fallible-iterator" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "fastrand" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "generic-array" -version = "0.14.5" +name = "ff" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "typenum", - "version_check", + "rand_core 0.6.4", + "subtle", ] [[package]] -name = "getrandom" -version = "0.1.16" +name = "fiat-crypto" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] -name = "getrandom" -version = "0.2.6" +name = "filetime" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "libredox", + "windows-sys 0.59.0", ] [[package]] -name = "gimli" -version = "0.26.1" +name = "flate2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ - "fallible-iterator", - "indexmap", + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "indexmap", "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "go-gen" +version = "0.1.0" +dependencies = [ + "anyhow", + "cosmwasm-schema", + "cosmwasm-std", + "heck", + "indenter", + "schemars 0.8.22", +] + [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] [[package]] name = "half" -version = "1.8.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.1" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" @@ -932,7 +1541,93 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", ] [[package]] @@ -941,73 +1636,138 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" -version = "1.8.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ - "autocfg", - "hashbrown 0.11.2", + "equivalent", + "hashbrown 0.15.4", +] + +[[package]] +name = "insta" +version = "1.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371" +dependencies = [ + "console", + "once_cell", "serde", + "similar", ] [[package]] -name = "instant" -version = "0.1.12" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "cfg-if", + "hermit-abi", + "libc", + "windows-sys 0.59.0", ] +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] -name = "itoa" -version = "0.4.8" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "k256" -version = "0.11.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sha2 0.10.3", + "sha2", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leb128" @@ -1015,94 +1775,130 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" -version = "0.2.125" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libloading" -version = "0.7.3" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "winapi", + "windows-targets 0.53.2", ] [[package]] -name = "log" -version = "0.4.17" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "cfg-if", + "bitflags 2.9.1", + "libc", + "redox_syscall", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "linux-raw-sys" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "lock_api" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ - "quote", - "syn", + "autocfg", + "scopeguard", ] [[package]] -name = "mach" -version = "0.3.2" +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "mach2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "memmap2" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] [[package]] name = "memmap2" -version = "0.5.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ "libc", ] [[package]] name = "memoffset" -version = "0.6.5" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", + "adler2", ] +[[package]] +name = "mintex" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c505b3e17ed6b70a7ed2e67fbb2c560ee327353556120d6e72f5232b6880d536" + [[package]] name = "more-asserts" version = "0.2.2" @@ -1110,91 +1906,184 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] -name = "num-integer" -version = "0.1.45" +name = "munge" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "9e22e7961c873e8b305b176d2a4e1d41ce7ba31bc1c52d2a107a89568ec74c55" dependencies = [ - "autocfg", - "num-traits", + "munge_macro", ] [[package]] -name = "num-traits" -version = "0.2.15" +name = "munge_macro" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "0ac7d860b767c6398e88fe93db73ce53eb496057aa6895ffa4d60cb02e1d1c6b" dependencies = [ - "autocfg", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] -name = "num_cpus" -version = "1.13.1" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "hermit-abi", - "libc", + "memchr", + "minimal-lexical", ] [[package]] -name = "object" -version = "0.28.3" +name = "normalize-line-endings" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] -name = "once_cell" -version = "1.10.0" +name = "num-bigint" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] [[package]] -name = "oorandom" -version = "11.1.3" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] [[package]] -name = "pin-project-lite" -version = "0.2.9" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", +] [[package]] -name = "pkcs8" -version = "0.9.0" +name = "object" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ - "der", - "spki", + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", ] +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + [[package]] name = "plotters" -version = "0.3.1" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits", "plotters-backend", @@ -1205,24 +2094,101 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.2" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.1" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "predicates" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" +dependencies = [ + "anstyle", + "difflib", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" + +[[package]] +name = "predicates-tree" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "prettyplease" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" +dependencies = [ + "proc-macro2", + "syn 2.0.103", +] + +[[package]] +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro-error" @@ -1233,7 +2199,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1248,13 +2214,64 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "proc-macro2" -version = "1.0.37" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ - "unicode-xid", + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" +dependencies = [ + "bitflags 2.9.1", + "lazy_static", + "num-traits", + "proptest-macro", + "rand 0.9.1", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "unarray", +] + +[[package]] +name = "proptest-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7b009e4051fac51cd34053b7e33a7dbda87a79f1548fdb00f3f35a4b32bac91" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] @@ -1263,7 +2280,16 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "ptr_meta_derive", + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", ] [[package]] @@ -1274,18 +2300,44 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + [[package]] name = "rand" version = "0.8.5" @@ -1293,8 +2345,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core 0.6.3", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", ] [[package]] @@ -1304,163 +2366,226 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.1.16", + "getrandom 0.2.16", ] [[package]] name = "rand_core" -version = "0.6.3" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" dependencies = [ - "getrandom 0.2.6", + "rand_core 0.9.3", ] [[package]] name = "rayon" -version = "1.5.2" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "autocfg", - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.2" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ - "bitflags", + "bitflags 2.9.1", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] name = "regex" -version = "1.5.5" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "region" -version = "3.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", - "mach", - "winapi", + "mach2", + "windows-sys 0.52.0", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "rend" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" dependencies = [ - "winapi", + "bytecheck 0.8.1", ] [[package]] -name = "rend" -version = "0.3.6" +name = "rfc6979" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "bytecheck", + "hmac", + "subtle", ] [[package]] -name = "rfc6979" -version = "0.3.0" +name = "ring" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.38" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "517a3034eb2b1499714e9d1e49b2367ad567e07639b69776d35e259d9c27cca6" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ - "bytecheck", - "hashbrown 0.12.1", - "ptr_meta", + "bytecheck 0.8.1", + "bytes", + "hashbrown 0.15.4", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", "rend", "rkyv_derive", - "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.38" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505c209ee04111a006431abf39696e640838364d67a107c559ababaf6fd8c9dd" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.103", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", ] [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" @@ -1470,24 +2595,83 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] -name = "rustversion" -version = "1.0.6" +name = "rustix" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] [[package]] -name = "ryu" -version = "1.0.9" +name = "rustls" +version = "0.23.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.20", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -1500,180 +2684,232 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.8" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.22", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b5a3c80cea1ab61f4260238409510e814e38b4b563c06044edf91e7dc070e3" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" dependencies = [ "dyn-clone", - "schemars_derive", + "ref-cast", + "schemars_derive 1.0.4", "serde", "serde_json", ] [[package]] name = "schemars_derive" -version = "0.8.8" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ae4dce13e8614c46ac3c38ef1c0d668b101df6ac39817aebdaa26642ddae9b" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.103", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "schemars_derive" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.103", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", "generic-array", - "pkcs8", "subtle", "zeroize", ] +[[package]] +name = "self_cell" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f7d95a54511e0c7be3f51e8867aa8cf35148d7b9445d44de2f943e2b206e749" + [[package]] name = "semver" -version = "1.0.9" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "serde" -version = "1.0.137" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "serde-wasm-bindgen" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" dependencies = [ + "js-sys", "serde", + "wasm-bindgen", ] [[package]] -name = "serde_bytes" -version = "0.11.6" +name = "serde_derive" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212e73464ebcde48d723aa02eb270ba62eff38a9b732df31f33f1b4e145f3a54" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ - "serde", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] -name = "serde_cbor" -version = "0.11.2" +name = "serde_derive_internals" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ - "half", - "serde", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] -name = "serde_derive" -version = "1.0.137" +name = "serde_json" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ - "proc-macro2", - "quote", - "syn", + "itoa", + "memchr", + "ryu", + "serde", ] [[package]] -name = "serde_derive_internals" -version = "0.25.0" +name = "serde_with" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "bf65a400f8f66fb7b0552869ad70157166676db75ed8181f8104ea91cf9d0b42" dependencies = [ - "proc-macro2", - "quote", - "syn", + "serde", + "serde_derive", + "serde_with_macros", ] [[package]] -name = "serde_json" -version = "1.0.81" +name = "serde_with_macros" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "81679d9ed988d5e9a5e6531dc3f2c28efbd639cbd1dfb628df08edea6004da77" dependencies = [ - "itoa 1.0.1", - "ryu", - "serde", + "darling", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] name = "sha2" -version = "0.9.9" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ - "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "digest", ] [[package]] -name = "sha2" -version = "0.10.3" +name = "sha3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.3", + "digest", + "keccak", ] [[package]] -name = "signature" -version = "1.5.0" +name = "shared-buffer" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "bytes", + "memmap2 0.6.2", ] [[package]] -name = "smallvec" -version = "1.8.0" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "spki" -version = "0.6.0" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "base64ct", - "der", + "digest", + "rand_core 0.6.4", ] +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1688,623 +2924,1010 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.8.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "subtle" -version = "2.4.1" +name = "strum" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] [[package]] -name = "syn" -version = "1.0.92" +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ + "heck", "proc-macro2", "quote", - "unicode-xid", + "rustversion", + "syn 2.0.103", ] [[package]] -name = "target-lexicon" -version = "0.12.3" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] -name = "tempfile" -version = "3.3.0" +name = "supports-color" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "is-terminal", + "is_ci", ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "supports-color" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" dependencies = [ - "unicode-width", + "is_ci", ] [[package]] -name = "thiserror" -version = "1.0.31" +name = "syn" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "thiserror-impl" -version = "1.0.31" +name = "syn" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", - "syn", + "unicode-ident", ] [[package]] -name = "tinytemplate" -version = "1.2.1" +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ - "serde", - "serde_json", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] -name = "tracing" -version = "0.1.34" +name = "tar" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", + "filetime", + "libc", + "xattr", ] [[package]] -name = "tracing-attributes" -version = "0.1.21" +name = "target-lexicon" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] -name = "tracing-core" -version = "0.1.26" +name = "tempfile" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "lazy_static", + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.59.0", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "termtree" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] -name = "uint" -version = "0.9.3" +name = "thiserror" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", + "thiserror-impl", ] [[package]] -name = "unicode-width" -version = "0.1.9" +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] [[package]] -name = "unicode-xid" -version = "0.2.3" +name = "thousands" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] -name = "vec_map" -version = "0.8.2" +name = "time" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] [[package]] -name = "version_check" -version = "0.9.4" +name = "time-core" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] -name = "walkdir" -version = "2.3.2" +name = "time-macros" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ - "same-file", - "winapi", - "winapi-util", + "num-conv", + "time-core", ] [[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +name = "tinystr" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] [[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +name = "tinytemplate" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] [[package]] -name = "wasm-bindgen" -version = "0.2.80" +name = "tinyvec" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ - "cfg-if", - "wasm-bindgen-macro", + "tinyvec_macros", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.80" +name = "tinyvec_macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] -name = "wasm-bindgen-macro" -version = "0.2.80" +name = "tracing" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "pin-project-lite", + "tracing-attributes", + "tracing-core", ] [[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.80" +name = "tracing-attributes" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "syn 2.0.103", ] [[package]] -name = "wasm-bindgen-shared" -version = "0.2.80" +name = "tracing-core" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", +] [[package]] -name = "wasmer" -version = "2.3.0" +name = "twox-hash" +version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "indexmap", - "js-sys", - "loupe", - "more-asserts", - "target-lexicon", - "thiserror", - "wasm-bindgen", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-compiler-cranelift", - "wasmer-compiler-singlepass", - "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", - "wasmer-types", - "wasmer-vm", - "winapi", + "static_assertions", ] [[package]] -name = "wasmer-artifact" -version = "2.3.0" +name = "typeid" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", -] +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] -name = "wasmer-compiler" -version = "2.3.0" +name = "typenum" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "enumset", - "loupe", - "rkyv", - "serde", - "serde_bytes", - "smallvec", - "target-lexicon", - "thiserror", - "wasmer-types", - "wasmparser", + "base64 0.22.1", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots 0.26.11", ] [[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "wasmer-compiler-singlepass" -version = "2.3.0" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" dependencies = [ - "byteorder", - "dynasm", - "dynasmrt", - "gimli", - "lazy_static", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "wasmer-compiler", - "wasmer-types", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "wasmer-derive" -version = "2.3.0" +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" dependencies = [ - "proc-macro-error", + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", "proc-macro2", "quote", - "syn", + "syn 2.0.103", + "wasm-bindgen-shared", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasm-bindgen-macro" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", - "wasmer-vm", + "quote", + "wasm-bindgen-macro-support", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasm-bindgen-macro-support" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.205.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e95b3563d164f33c1cfb0a7efbd5940c37710019be10cd09f800fdec8b0e5c" dependencies = [ - "cfg-if", - "enum-iterator", - "enumset", "leb128", - "libloading", - "loupe", - "object", - "rkyv", +] + +[[package]] +name = "wasm-encoder" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a" +dependencies = [ + "leb128fmt", + "wasmparser 0.235.0", +] + +[[package]] +name = "wasmer" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" +dependencies = [ + "bindgen", + "bytes", + "cfg-if", + "cmake", + "indexmap", + "js-sys", + "more-asserts", + "rustc-demangle", "serde", - "tempfile", + "serde-wasm-bindgen", + "shared-buffer", + "tar", + "target-lexicon", + "thiserror", "tracing", - "wasmer-artifact", + "ureq", + "wasm-bindgen", "wasmer-compiler", - "wasmer-engine", - "wasmer-object", + "wasmer-compiler-singlepass", + "wasmer-derive", "wasmer-types", "wasmer-vm", - "which", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-compiler" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", "cfg-if", + "enum-iterator", "enumset", "leb128", - "loupe", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", "region", "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "self_cell", + "shared-buffer", + "smallvec", + "target-lexicon", + "thiserror", "wasmer-types", "wasmer-vm", - "winapi", + "wasmparser 0.216.1", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmer-compiler-singlepass" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ - "enum-iterator", + "byteorder", + "dynasm", + "dynasmrt", "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", + "gimli 0.28.1", + "more-asserts", + "rayon", + "smallvec", "wasmer-compiler", "wasmer-types", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "wasmer-derive" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "object", - "thiserror", - "wasmer-compiler", + "wasmer", "wasmer-types", + "wasmer-vm", ] [[package]] name = "wasmer-types" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "backtrace", + "bytecheck 0.6.12", "enum-iterator", + "enumset", + "getrandom 0.2.16", + "hex", "indexmap", - "loupe", "more-asserts", "rkyv", - "serde", + "sha2", + "target-lexicon", "thiserror", + "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ "backtrace", "cc", "cfg-if", "corosensei", + "crossbeam-queue", + "dashmap", "enum-iterator", + "fnv", "indexmap", - "lazy_static", "libc", - "loupe", - "mach", + "mach2", "memoffset", "more-asserts", "region", - "rkyv", "scopeguard", - "serde", "thiserror", - "wasmer-artifact", "wasmer-types", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "wasmparser" -version = "0.83.0" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" +dependencies = [ + "ahash", + "bitflags 2.9.1", + "hashbrown 0.14.5", + "indexmap", + "semver", +] + +[[package]] +name = "wasmparser" +version = "0.235.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" +dependencies = [ + "bitflags 2.9.1", + "indexmap", + "semver", +] [[package]] name = "wast" -version = "40.0.0" +version = "235.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb4f48a8b083dbc50e291e430afb8f524092bb00428957bcc63f49f856c64ac" +checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13" dependencies = [ - "leb128", + "bumpalo", + "leb128fmt", "memchr", "unicode-width", + "wasm-encoder 0.235.0", ] [[package]] name = "wat" -version = "1.0.42" +version = "1.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0401b6395ce0db91629a75b29597ccb66ea29950af9fc859f1bb3a736609c76e" +checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "which" -version = "4.2.5" +name = "webpki-roots" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "either", - "lazy_static", - "libc", + "webpki-roots 1.0.1", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "webpki-roots" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "rustls-pki-types", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "winapi-util" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] -name = "winapi-util" -version = "0.1.5" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "winapi", + "windows-targets 0.52.6", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] [[package]] name = "windows-sys" -version = "0.33.0" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_aarch64_msvc" -version = "0.33.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" -version = "0.33.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.33.0" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.33.0" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" -version = "0.33.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "xattr" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" +dependencies = [ + "libc", + "rustix", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "synstructure", +] [[package]] name = "zeroize" -version = "1.5.5" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94693807d016b2f2d2e14420eb3bfcca689311ff775dcf113d74ea624b7cdf07" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] diff --git a/Cargo.toml b/Cargo.toml index 311069d0cf..dfc6892728 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,23 @@ members = ["packages/*"] exclude = ["contracts"] -# Resolver has to be set explicitely in workspaces -# due to https://github.com/rust-lang/cargo/issues/9956 resolver = "2" + +[workspace.package] +version = "3.0.3-dev" + +[workspace.dependencies] +cosmwasm-core = { path = "./packages/core" } +cosmwasm-crypto = { path = "./packages/crypto" } +cosmwasm-derive = { path = "./packages/derive" } +cosmwasm-schema = { path = "./packages/schema" } +cosmwasm-schema-derive = { path = "./packages/schema-derive" } +cosmwasm-std = { path = "./packages/std", default-features = false } +cosmwasm-vm = { path = "./packages/vm" } +cosmwasm-vm-derive = { path = "./packages/vm-derive" } +cw-schema = { path = "./packages/cw-schema" } +cw-schema-derive = { path = "./packages/cw-schema-derive" } +schemars = "0.8.4" +serde = { version = "1.0.192", default-features = false, features = ["alloc", "derive"] } +serde_json = "1.0.140" +thiserror = "1.0.26" diff --git a/EntryPoints.md b/EntryPoints.md deleted file mode 100644 index f65cfed42c..0000000000 --- a/EntryPoints.md +++ /dev/null @@ -1,83 +0,0 @@ -# Defining Entry Points to Wasm - -## Exports - -`exports` are the functions that we export to the outside world. After -compilation these will be the only entry points that the application can call -into the web assembly contract. In general, the runtime will define a fixed set -of `exports` that must be implemented by the contract. - -To make an export in rust code, you can add the following lines: - -```rust -#[no_mangle] -pub extern "C" fn double(n: i32) -> i32 { - n * 2 -} -``` - -Note that you need the `#[no_mangle]` directive to keep the naming, and declare -it as `pub extern "C"` to create a proper C ABI, which is the standard interface -for Web Assembly, as well as FFI. - -## Imports - -If we want to interact with the outside world, the smart contract needs to -define a set of `imports`. These are function signatures we expect to be -implemented by the environment and provided when the VM is instantiated. If the -proper imports are not provided, you will receive an error upon instantiating -the contract. - -```rust -extern "C" { - fn c_read() -> *mut c_char; - fn c_write(string: *mut c_char); -} -``` - -The above expects the runtime to provide read/write access to some (persistent) -singleton. Notably, the contract has no knowledge how it is stored, and no way -to "jailbreak" or access other element of the database. - -## Memory Management - -If you look closely, you will see every function definition in `exports` accepts -a fixed number of arguments of type `i32` and returns one result of type `i32` -(or `void`). With such limitations, how can one pass in a `struct` to the -contract, or even a serialized byte array (eg. json blob). And how can we return -a string back? - -There is one more way in which the runtime can interact with a smart contract -instance. It can directly read and write to the linear memory of the smart -contract. In general, contracts are expected to export two well-defined -functions: - -```rust -#[no_mangle] -pub extern "C" fn allocate(size: usize) -> *mut c_void { - let mut buffer = Vec::with_capacity(size); - let pointer = buffer.as_mut_ptr(); - mem::forget(buffer); - pointer as *mut c_void -} - -#[no_mangle] -pub extern "C" fn deallocate(pointer: *mut c_void, capacity: usize) { - unsafe { - let _ = Vec::from_raw_parts(pointer, 0, capacity); - } -} -``` - -`allocate` heap allocates `size` bytes and tells the wasm alloc library not to -clear it (forget), after which it returns the pointer (integer offset) to the -caller. The caller can now safely write up to `size` bytes to the given offset, -eg. `copy(data, vm.Memory[offset:offset+size])`. Of course, this passes the -responsibility of freeing the memory from the wasm code to the caller, so make -sure to call `deallocate()` on the memory reference after the function call -finishes. - -We can explore more complex and idiomatic ways of passing data between the -environment and the wasm contract, but for now, just ensure you export these two -functions and the runtime will make use of them to get `string` and `[]byte` -into and out of the wasm contract. diff --git a/IBC.md b/IBC.md index 41497bdd48..56212091a0 100644 --- a/IBC.md +++ b/IBC.md @@ -1,580 +1,3 @@ -# IBC interfaces for CosmWasm contracts +Information on IBC can be found in the [CosmWasm documentation]. -If you import `cosmwasm-std` with the `stargate` feature flag, it will expose a -number of IBC-related functionality. This requires that the host chain is -running an IBC-enabled version of -[`x/wasmd`](https://github.com/CosmWasm/wasmd/tree/master/x/wasm), that is -`v0.16.0` or higher. You will get an error when you upload the contract if the -chain doesn't support this functionality. - -## Sending Tokens via ICS20 - -There are two ways to use IBC. The simplest one, available to all contracts, is -simply to send tokens to another chain on a pre-established ICS20 channel. ICS20 -is the protocol that is used to move fungible tokens between Cosmos blockchains. -To this end, we expose a -[new `CosmosMsg::Ibc(IbcMsg::Transfer{})` message variant](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta4/packages/std/src/ibc.rs#L25-L40) -that works similar to `CosmosMsg::Bank(BankMsg::Send{})`, but with a few extra -fields: - -```rust -pub enum IbcMsg { - /// Sends bank tokens owned by the contract to the given address on another chain. - /// The channel must already be established between the ibctransfer module on this chain - /// and a matching module on the remote chain. - /// We cannot select the port_id, this is whatever the local chain has bound the ibctransfer - /// module to. - Transfer { - /// exisiting channel to send the tokens over - channel_id: String, - /// address on the remote chain to receive these tokens - to_address: String, - /// packet data only supports one coin - /// https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20 - amount: Coin, - /// when packet times out, measured on remote chain - timeout: IbcTimeout, - } -} - -/// In IBC each package must set at least one type of timeout: -/// the timestamp or the block height. Using this rather complex enum instead of -/// two timeout fields we ensure that at least one timeout is set. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] -#[serde(rename_all = "snake_case")] -pub struct IbcTimeout { - block: Option, - timestamp: Option, -} -``` - -Note the `to_address` is likely not a valid `Addr`, as it uses the bech32 prefix -of the _receiving_ chain. In addition to the info you need in `BankMsg::Send`, -you need to define the `channel` to send upon as well as a timeout specified -either in block height or block time (or both). If the packet is not relayed -before the timeout passes (measured on the receiving chain), you can request -your tokens back. - -## Writing New Protocols - -However, we go beyond simply _using_ existing IBC protocols, and allow you to -_implement_ your own ICS protocols inside the contract. A good example to -understand this is the -[`cw20-ics20` contract](https://github.com/CosmWasm/cosmwasm-plus/tree/v0.6.0-beta1/contracts/cw20-ics20) -included in the `cosmwasm-plus` repo. This contract speaks the `ics20-1` -protocol to an external blockchain just as if it were the `ibctransfer` module -in Go. However, we can implement any logic we want there and even hot-load it on -a running blockchain. - -This particular contract above accepts -[cw20 tokens](https://github.com/CosmWasm/cosmwasm-plus/tree/v0.6.0-beta1/packages/cw20) -and sends those to a remote chain, as well as receiving the tokens back and -releasing the original cw20 token to a new owner. It does not (yet) allow -minting coins originating from the remote chain. I recommend opening up the -source code for that contract and refering to it when you want a concrete -example for anything discussed below. - -In order to enable IBC communication, a contract must expose the following 6 -entry points. Upon detecting such an "IBC-Enabled" contract, the -[`x/wasm` runtime](https://github.com/CosmWasm/wasmd) will automatically bind a -port for this contract (`wasm.`), which allows a relayer to -create channels between this contract and another chain. Once channels are -created, the contract will process all packets and receipts. - -### Channel Lifecycle - -You should first familiarize yourself with the -[4 step channel handshake protocol](https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#channel-lifecycle-management) -from the IBC spec. After realizing that it was 2 slight variants of 2 steps, we -simplified the interface for the contracts. Each side will receive 2 calls to -establish a new channel, and returning an error in any of the steps will abort -the handshake. Below we will refer to the chains as A and B - A is where the -handshake initialized at. - -#### Channel Open - -The first step of a handshake on either chain is `ibc_channel_open`, which -combines `ChanOpenInit` and `ChanOpenTry` from the spec. The only valid action -of the contract is to accept the channel or reject it. This is generally based -on the ordering and version in the `IbcChannel` information, but you could -enforce other constraints as well: - -```rust -#[entry_point] -/// enforces ordering and versioning constraints -pub fn ibc_channel_open(deps: DepsMut, env: Env, msg: IbcChannelOpenMsg) -> StdResult<()> { } -``` - -This is the -[IbcChannel structure](https://github.com/CosmWasm/cosmwasm/blob/v0.15.0/packages/std/src/ibc.rs#L117-L128) -used heavily in the handshake process: - -```rust -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] -pub struct IbcChannel { - pub endpoint: IbcEndpoint, - pub counterparty_endpoint: IbcEndpoint, - pub order: IbcOrder, - pub version: String, - /// CounterpartyVersion can be None when not known this context, yet - pub counterparty_version: Option, - /// The connection upon which this channel was created. If this is a multi-hop - /// channel, we only expose the first hop. - pub connection_id: String, -} - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] -pub struct IbcEndpoint { - pub port_id: String, - pub channel_id: String, -} -``` - -This `IbcChannel` value has to be wrapped in the `IbcChannelOpenMsg` type. - -```rust -let msg = IbcChannelOpenMsg::new_init(channel); -// or -let msg = IbcChannelOpenMsg::new_try(channel, counterparty_version); -``` - -Note that neither `counterparty_version` nor `counterparty_endpoint` is set in -`ibc_channel_open` for chain A. Chain B should enforce any -`counterparty_version` constraints in `ibc_channel_open`. Chain A must enforce -`counterparty_version` or `counterparty_endpoint` restrictions in -`ibc_channel_connect`. - -(Just test if the `counterparty_version` field is `Some(x)` in both calls and -then enforce the counterparty restrictions if set. That will check these once at -the proper place for both chain A and chain B). - -You should save any state only in `ibc_channel_connect` once the channel has -been approved by the remote side. - -#### Channel Connect - -Once both sides have returned `Ok()` to `ibc_channel_open`, we move onto the -second step of the handshake, which is equivalent to `ChanOpenAck` and -`ChanOpenConfirm` from the spec: - -```rust -#[entry_point] -/// once it's established, we may take some setup action -pub fn ibc_channel_connect( - deps: DepsMut, - env: Env, - msg: IbcChannelConnectMsg, -) -> StdResult { } -``` - -At this point, it is expected that the contract updates its internal state and -may return `CosmosMsg` in the `Reponse` to interact with other contracts, just -like in `execute`. In particular, you will most likely want to store the local -channel_id (`channel.endpoint.channel_id`) in the contract's storage, so it -knows what open channels it has (and can expose those via queries or maintain -state for each one). - -Once this has been called, you may expect to send and receive any number of -packets with the contract. The packets will only stop once the channel is closed -(which may never happen). - -### Channel Close - -A contract may request to close a channel that belongs to it via the following -`CosmosMsg::Ibc`: - -```rust -pub enum IbcMsg { - /// This will close an existing channel that is owned by this contract. - /// Port is auto-assigned to the contract's IBC port - CloseChannel { channel_id: String }, -} -``` - -Once a channel is closed, whether due to an IBC error, at our request, or at the -request of the other side, the following callback is made on the contract, which -allows it to take appropriate cleanup action: - -```rust -#[entry_point] -pub fn ibc_channel_close( - deps: DepsMut, - env: Env, - msg: IbcChannelCloseMsg, -) -> StdResult { } -``` - -### Packet Lifecycle - -Unfortunately the -[IBC spec on Packet Lifecycle](https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#packet-flow--handling) -is missing all useful diagrams, but it may provide some theoretical background -for this text if you wish to look. - -In short, IBC allows us to send packets from chain A to chain B and get a -response from them. The first step is the contract/module in chain A requesting -to send a packet. This is then relayed to chain B, where it "receives" the -packet and calculates an "acknowledgement" (which may contain a success result -or an error message, as opaque bytes to be interpreted by the sending contract). -The acknowledgement is then relayed back to chain A, completing the cycle. - -In some cases, the packet may never be delivered, and if it is proven not to be -delivered before the timeout, this can abort the packet, calling the "timeout" -handler on chain A. In this case, chain A sends and later gets "timeout". No -"receive" nor "acknowledgement" callbacks are ever executed. - -#### Sending a Packet - -In order to send a packet, a contract can simply return `IbcMsg::SendPacket` -along with the channel over which to send the packet (which you saved in -`ibc_channel_connect`), as well as opaque data bytes to be interpreted by the -other side. You must also return a timeout either as block height or block time -of the remote chain, just like in the ICS20 `Transfer` messages above: - -```rust -pub enum IbcMsg { - /// Sends an IBC packet with given data over the existing channel. - /// Data should be encoded in a format defined by the channel version, - /// and the module on the other side should know how to parse this. - SendPacket { - channel_id: String, - data: Binary, - /// when packet times out, measured on remote chain - timeout: IbcTimeout, - }, -} -``` - -For the content of the `data` field, we recommend that you model it on the -format of `ExecuteMsg` (an enum with serde) and encode it via -`cosmwasm_std::to_binary(&packet_msg)?`. This is the approach for a new protocol -you develop with cosmwasm contracts. If you are working with an existing -protocol, please read their spec and create the proper type along with JSON or -Protobuf encoders for it as the protocol requires. - -#### Receiving a Packet - -After a contract on chain A sends a packet, it is generally processed by the -contract on chain B on the other side of the channel. This is done by executing -the following entry point on chain B: - -```rust -#[entry_point] -pub fn ibc_packet_receive( - deps: DepsMut, - env: Env, - msg: IbcPacketReceiveMsg, -) -> StdResult { } -``` - -This is a very special entry point as it has a unique workflow. (Please see the -[Acknowledging Errors section](#Acknowledging-Errors) below to understand it -fully). - -Also note the different return response here (`IbcReceiveResponse` rather than -`IbcBasicResponse`). This is because it has an extra field -`acknowledgement: Binary`, which must be filled out. All successful message must -return an encoded `Acknowledgement` response in this field, that can be parsed -by the sending chain. - -The -[`IbcPacket` structure](https://github.com/CosmWasm/cosmwasm/blob/v0.15.0/packages/std/src/ibc.rs#L176-L187) -contains all information needed to process the receipt. This info has already -been verified by the core IBC modules via light client and merkle proofs. It -guarantees all metadata in the `IbcPacket` structure is valid, and the `data` -field was written on the remote chain. Furthermore, it guarantees that the -packet is processed at most once (zero times if it times out). Fields like -`dest.channel_id` and `sequence` have a similar trust level to `MessageInfo`, -which we use to authorize normal transactions. The `data` field should be -treated like the `ExecuteMsg` data, which is only as valid as the entity that -signed it. - -You can generally ignore `timeout_*` (this entry point is only called if it -hasn't yet timed out) and `sequence` (which is used by the IBC framework to -avoid duplicates). I generally use `dest.channel_id` like `info.sender` to -authenticate the packet, and parse `data` into a `PacketMsg` structure, using -the same encoding rules as we discussed in the last section. After that you can -process `PacketMsg` more or less like an `ExecuteMsg`, including calling into -other contracts. - -```rust -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] -pub struct IbcPacket { - /// The raw data send from the other side in the packet - pub data: Binary, - /// identifies the channel and port on the sending chain. - pub src: IbcEndpoint, - /// identifies the channel and port on the receiving chain. - pub dest: IbcEndpoint, - /// The sequence number of the packet on the given channel - pub sequence: u64, - pub timeout: IbcTimeout, -} -``` - -`IbcPacketReceiveMsg` is currently a wrapper around `IbcPacket`. - -##### Acknowledging Errors - -A major issue that is unique to `ibc_packet_receive` is that it is expected to -often reject an incoming packet, yet it cannot abort the transaction. We -actually expect all state changes from the contract (as well as dispatched -messages) to be reverted when the packet is rejected, but the transaction to -properly commit an acknowledgement with encoded error. In other words, this "IBC -Handler" will error and revert, but the "IBC Router" must succeed and commit an -acknowledgement message (that can be parsed by the sending chain as an error). - -The atomicity issue was first -[analyzed in the Cosmos SDK implementation](https://github.com/cosmos/ibc-go/issues/68) -and refined into -[changing semantics of the OnRecvPacket SDK method](https://github.com/cosmos/ibc-go/issues/91), -which was -[implemented in April 2021](https://github.com/cosmos/ibc-go/pull/107), likely -to be released with Cosmos SDK 0.43 or 0.44. Since we want the best, -future-proof interface for contracts, we will use an approach inspired by that -work, and add an adapter in `wasmd` until we can upgrade to a Cosmos SDK version -that implements this. - -After quite some -[discussion on how to encode the errors](https://github.com/CosmWasm/cosmwasm/issues/762), -we struggled to map this idea to the CosmWasm model. However, we also discovered -a deep similarity between these requirements and the -[submessage semantics](./SEMANTICS.md#submessages). It just requires some -careful coding on the contract developer's side to not throw errors. This -produced 3 suggestions on how to handle errors and rollbacks _inside -`ibc_packet_receive`_ - -1. If the message doesn't modify any state directly, you can simply put the - logic in a closure, and capture errors, converting them into error - acknowledgements. This would look something like the - [main dispatch loop in `ibc-reflect`](https://github.com/CosmWasm/cosmwasm/blob/cd784cd1148ee395574f3e564f102d0d7b5adcc3/contracts/ibc-reflect/src/contract.rs#L217-L248): - - ```rust - (|| { - // which local channel did this packet come on - let caller = packet.dest.channel_id; - let msg: PacketMsg = from_slice(&packet.data)?; - match msg { - PacketMsg::Dispatch { msgs } => receive_dispatch(deps, caller, msgs), - PacketMsg::WhoAmI {} => receive_who_am_i(deps, caller), - PacketMsg::Balances {} => receive_balances(deps, caller), - } - })() - .or_else(|e| { - // we try to capture all app-level errors and convert them into - // acknowledgement packets that contain an error code. - let acknowledgement = encode_ibc_error(format!("invalid packet: {}", e)); - Ok(IbcReceiveResponse { - acknowledgement, - submessages: vec![], - messages: vec![], - attributes: vec![], - }) - }) - ``` - -2. If we modify state with an external call, we need to wrap it in a - `submessage` and capture the error. This approach requires we use _exactly - one_ submessage. If we have multiple, we may commit #1 and rollback #2 (see - example 3 for that case). The main point is moving `messages` to - `submessages` and reformating the error in `reply`. Note that if you set the - `Response.data` field in `reply` it will override the acknowledgement - returned from the parent call. (See - [bottom of reply section](./SEMANTICS.md#handling-the-reply)). You can see a - similar example in how - [`ibc-reflect` handles `receive_dispatch`](https://github.com/CosmWasm/cosmwasm/blob/eebb9395ccf315320e3f2fcc526ee76788f89174/contracts/ibc-reflect/src/contract.rs#L307-L336). - Note how we use a unique reply ID for this and use that to catch any - execution failure and return an error acknowledgement instead: - - ```rust - fn receive_dispatch( - deps: DepsMut, - caller: String, - msgs: Vec, - ) -> StdResult { - // what is the reflect contract here - let reflect_addr = accounts(deps.storage).load(caller.as_bytes())?; - - // let them know we're fine - let acknowledgement = to_binary(&AcknowledgementMsg::::Ok(()))?; - // create the message to re-dispatch to the reflect contract - let reflect_msg = ReflectExecuteMsg::ReflectMsg { msgs }; - let wasm_msg = wasm_execute(reflect_addr, &reflect_msg, vec![])?; - - // we wrap it in a submessage to properly report errors - let sub_msg = SubMsg { - id: RECEIVE_DISPATCH_ID, - msg: wasm_msg.into(), - gas_limit: None, - reply_on: ReplyOn::Error, - }; - - Ok(IbcReceiveResponse { - acknowledgement, - submessages: vec![sub_msg], - messages: vec![], - attributes: vec![attr("action", "receive_dispatch")], - }) - } - - #[entry_point] - pub fn reply(deps: DepsMut, _env: Env, reply: Reply) -> StdResult { - match (reply.id, reply.result) { - (RECEIVE_DISPATCH_ID, ContractResult::Err(err)) => Ok(Response { - data: Some(encode_ibc_error(err)), - ..Response::default() - }), - (INIT_CALLBACK_ID, ContractResult::Ok(response)) => handle_init_callback(deps, response), - _ => Err(StdError::generic_err("invalid reply id or result")), - } - } - ``` - -3. For a more complex case, where we are modifying local state and possibly - sending multiple messages, we need to do a self-call via submessages. What I - mean is that we create a new `ExecuteMsg` variant, which returns an error if - called by anyone but the contract itself - (`if info.sender != env.contract.address { return Err() }`). When receiving - the IBC packet, we can create a submessage with `ExecuteMsg::DoReceivePacket` - and any args we need to pass down. - - `DoReceivePacket` should return a proper acknowledgement payload on success. - And return an error on failure, just like a normal `execute` call. However, - here we capture both success and error cases in the `reply` handler (use - `ReplyOn::Always`). For success, we return this data verbatim to be set as - the packet acknowledgement, and for errors, we encode them as we did above. - There is not any example code using this (yet), but it is just recombining - pieces we already have. For clarity, the `reply` statement should look - something like: - - ```rust - #[entry_point] - pub fn reply(_deps: DepsMut, _env: Env, reply: Reply) -> StdResult { - if reply.id != DO_IBC_RECEIVE_ID { - return Err(StdError::generic_err("invalid reply id")); - } - let data = match reply.result { - ContractResult::Ok(response) => response.data, - ContractResult::Err(err) => Some(encode_ibc_error(err)), - }; - Ok(Response { - data, - ..Response::default() - }) - } - ``` - -##### Standard Acknowledgement Envelope - -Although the ICS spec leave the actual acknowledgement as opaque bytes, it does -provide a recommendation for the format you can use, allowing contracts to -easily differentiate between success and error (and allow IBC explorers to label -such packets without knowing every protocol). - -It is defined as part of the -[ICS4 - Channel Spec](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/ibc/core/channel/v1/channel.proto#L134-L147). - -```proto -message Acknowledgement { - // response contains either a result or an error and must be non-empty - oneof response { - bytes result = 21; - string error = 22; - } -} -``` - -Although it suggests this is a Protobuf object, the ICS spec doesn't define -whether to encode it as JSON or Protobuf. In the ICS20 implementation, this is -JSON encoded when returned from a contract. In ICS27, the authors are discussing -using a Protobuf-encoded form of this structure. - -Note that it leaves the actual success response as app-specific bytes where you -can place anything, but does provide a standard way for an observer to check -success-or-error. If you are designing a new protocol, I encourage you to use -this struct in either of the encodings as the acknowledgement envelope. - -You can find a -[CosmWasm-compatible definition of this format](https://github.com/CosmWasm/cosmwasm-plus/blob/v0.6.0-beta1/contracts/cw20-ics20/src/ibc.rs#L52-L72) -as part of the `cw20-ics20` contract, along with JSON-encoding. Protobuf -encoding version can be produced upon request. - -#### Receiving an Acknowledgement - -If chain B successfully received the packet (even if the contract returned an -error message), chain A will eventually get an acknowledgement: - -```rust -#[entry_point] -/// never should be called as we do not send packets -pub fn ibc_packet_ack( - deps: DepsMut, - env: Env, - msg: IbcPacketAckMsg, -) -> StdResult { } -``` - -The -[`IbcAcknowledgement` structure](https://github.com/CosmWasm/cosmwasm/blob/v0.15.0/packages/std/src/ibc.rs#L195-L200) -contains both the original packet that was sent as well as the acknowledgement -bytes returned from executing the remote contract. You can use the -`original_packet` to -[map it the proper handler](https://github.com/CosmWasm/cosmwasm/blob/378b029707ebaed4505b3666c620bed69ff9a682/contracts/ibc-reflect-send/src/ibc.rs#L111-L136) -(after parsing your custom data format), and parse the `acknowledgement` there, -to determine how to respond: - -```rust -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] -pub struct IbcAcknowledgement { - pub acknowledgement: Binary, - pub original_packet: IbcPacket, -} -``` - -On success, you will want to commit the pending state. For some contracts like -`cw20-ics20`, you accept the tokens before sending the packet, so no need to -commit any more state. On other contracts, you may want to store the data -returned as part of the acknowledgement (like -[storing the remote address after calling "WhoAmI"](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta4/contracts/ibc-reflect-send/src/ibc.rs#L157-L192) -in our simple `ibc-reflect` example. - -On error, you will want to revert any state that was pending based on the -packet. For example, in ics20, if the -[remote chain rejects the packet](https://github.com/CosmWasm/cw-plus/blob/v0.10.0/contracts/cw20-ics20/src/ibc.rs#L248), -we must -[return the funds to the original sender](https://github.com/CosmWasm/cw-plus/blob/v0.10.0/contracts/cw20-ics20/src/ibc.rs#L291-L313). - -#### Handling Timeouts - -If the packet was not received on chain B before the timeout, we can be certain -that it will never be processed there. In such a case, a relayer can return a -timeout proof to cancel the pending packet. In such a case the calling contract -will never get `ibc_packet_ack`, but rather `ibc_packet_timeout`. One of the two -calls will eventually get called for each packet that is sent as long as there -is a functioning relayer. (In the absence of a functioning relayer, it will -never get a response). - -The timeout callback looks like this: - -```rust -#[entry_point] -/// never should be called as we do not send packets -pub fn ibc_packet_timeout( - deps: DepsMut, - env: Env, - msg: IbcPacketTimeoutMsg, -) -> StdResult {} -``` - -It is generally handled just like the error case in `ibc_packet_ack`, reverting -the state change from sending the packet (eg. if we send tokens over ICS20, both -[an ack failure](https://github.com/CosmWasm/cw-plus/blob/v0.10.0/contracts/cw20-ics20/src/ibc.rs#L248) -as well as -[a timeout](https://github.com/CosmWasm/cw-plus/blob/v0.10.0/contracts/cw20-ics20/src/ibc.rs#L261) -will return those tokens to the original sender. In fact they both dispatch to -the same `on_packet_failure` function). - -Note that like `ibc_packet_ack`, we get the original packet we sent, which must -contain all information needed to revert itself. Thus the ICS20 packet contains -the original sender address, even though that is unimportant in the receiving -chain. +[CosmWasm documentation]: https://cosmwasm.cosmos.network/ibc diff --git a/MIGRATING.md b/MIGRATING.md index b9cadf4b64..a645262f8e 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -4,6 +4,501 @@ This guide explains what is needed to upgrade contracts when migrating over major releases of `cosmwasm`. Note that you can also view the [complete CHANGELOG](./CHANGELOG.md) to understand the differences. +## 2.x.y -> 3.0.x + +- Update `cosmwasm-*` dependencies in Cargo.toml (skip the ones you don't use): + + ```toml + [dependencies] + cosmwasm-std = "3.0.1" + cosmwasm-schema = "3.0.1" + # ... + + [dev-dependencies] + cosmwasm-vm = "3.0.1" + # ... + ``` + + If you were using `cosmwasm-std`'s `abort` feature, you can remove it, as it + is the default now. The `cranelift` feature also needs to be removed. It + didn't do anything anymore since 2.2.0, and now it is removed completely. + + If you are using `cosmwasm-std` with `default-features = false` in a contract + (not a library), you need to enable the `exports` feature now. + + - If you were still using the deprecated functions `from_slice`, + `from_binary`, `to_vec` or `to_binary`, you now need to replace them with + the new equivalents: + + ```diff + -cosmwasm_std::from_slice(&data) + +cosmwasm_std::from_json(&data) + -cosmwasm_std::from_binary(&data) + +cosmwasm_std::from_json(&data) + -cosmwasm_std::to_vec(&data) + +cosmwasm_std::to_json_vec(&data) + -cosmwasm_std::to_binary(&data) + +cosmwasm_std::to_json_binary(&data) + ``` + + - `TransactionInfo` is now `non_exhaustive`, so if you were destructuring it + before, you will need to access the fields individually instead. Similarly, + `GovMsg` is also `non_exhaustive` now, so if you were matching on it, you + will need to use a wildcard pattern or access the fields individually. + + - Replace all calls of `{Uint256, Uint512, Int256, Int512}::new` with + `{Uint256, Uint512, Int256, Int512}::from_be_bytes`. Alternatively, you can + pass a `u128 / i128` to `new`. + + - Replace calls to the deprecated + `{Decimal, Decimal256, SignedDecimal, SignedDecimal256}::raw` with normal + constructors: + + ```diff + -Decimal::raw(value) + +Decimal::new(Uint128::new(value)) + -Decimal256::raw(value) + +Decimal256::new(Uint256::new(value)) + -SignedDecimal::raw(value) + +SignedDecimal::new(Int128::new(value)) + -SignedDecimal256::raw(value) + +SignedDecimal256::new(Int256::new(value)) + ``` + + - Replace all uses of `Uint256::from_u128` and `Int256::from_i128`: + + ```diff + -Uint256::from_u128(value) + +Uint256::new(value) + -Int256::from_i128(value) + +Int256::new(value) + ``` + + - If you were using `cosmwasm_std::MemoryStorage`, you need to replace it with + `cosmwasm_std::testing::MockStorage`. + + - The previously deprecated `mock_info` has been removed. Use `message_info` + instead: + + ```diff + -let info = mock_info("creator", &coins(1000, "earth")); + +let info = message_info(&mock_api.addr_make("creator), &coins(1000, "earth")); + ``` + + - `Coin::amount` has been changed to `Uint256` instead of `Uint128`, so you + probably have to change a lot of the math you do with it. For example: + + ```diff + -let amount = coin.amount * Uint128::new(2); + +let amount = coin.amount * Uint256::new(2); + ``` + + - `BankQuery::AllBalances` and `IbcQuery::ListChannels` have been removed + without replacement. If you were using them, you will need to redesign your + protocol to not rely on them. If you were using `BankQuery::AllBalances`, + you can use `BankQuery::Balance` instead. If you were using + `IbcQuery::ListChannels`, you can save the channel information for each + channel yourself in contract storage. + + - `ExternalApi`, `ExternalQuerier` and `ExternalStorage` exports have been + removed, as they are not intended to be used outside of cosmwasm-std. + + - We did some big changes to `StdError`. Most of the constructors have been + removed. Instead you can just convert any type implementing the `Error` + trait into `StdError` using the `?` operator. Optionally, you can add an + error kind using the new `.kind(...)` method. + + ```diff + -Err(StdError::generic_err("Invalid input")) + +Err(StdError::msg("Invalid input")) + + -let hrp = Hrp::parse(self.prefix).map_err(|e| StdError::generic_err(e.to_string()))?; + +let hrp = Hrp::parse(self.prefix)?; + ``` + + If you were using something like anyhow, you probably want to replace + `anyhow::Result` with `cosmwasm_std::StdResult`, since the new `StdError` + does not implement the `Error` trait anymore, so you cannot convert it into + `anyhow::Error` anymore. + + ```diff + -) -> anyhow::Result { + +) -> StdResult { + ``` + +## 1.5.x -> 2.0.x + +- Update `cosmwasm-*` dependencies in Cargo.toml (skip the ones you don't use): + + ```toml + [dependencies] + cosmwasm-std = "2.0.0" + # ... + + [dev-dependencies] + cosmwasm-schema = "2.0.0" + cosmwasm-vm = "2.0.0" + # ... + ``` + + If you were using cosmwasm-std's `ibc3` feature, you can remove it, as it is + the default now. Depending on your usage, you might have to enable the + `stargate` feature instead, since it was previously implied by `ibc3`. + + Also remove any uses of the `backtraces` feature. You can use a + `RUST_BACKTRACE=1` environment variable for this now. + + If you were using `cosmwasm-std` with `default-features = false`, you probably + want to enable the `std` feature now, as we might move certain existing + functionality to that feature in the future to support no_std environments: + + ```diff + -cosmwasm-std = { version = "2.0.0", default-features = false, features = [...] } + +cosmwasm-std = { version = "2.0.0", default-features = false, features = ["std", ...] } + ``` + +- If you want to use a feature that is only available on CosmWasm 2.0+ chains, + use this feature: + + ```diff + -cosmwasm-std = { version = "1.4.0", features = ["stargate"] } + +cosmwasm-std = { version = "1.4.0", features = ["stargate", "cosmwasm_2_0"] } + ``` + + Please note that `cosmwasm_2_0` implies `cosmwasm_1_4`, `cosmwasm_1_3` and so + on, so there is no need to set multiple. + +- `ContractInfoResponse::new` now takes all fields of the response as + parameters: + + ```diff + -ContractInfoResponse::new(code_id, creator) + +ContractInfoResponse::new(code_id, creator, admin, pinned, ibc_port) + ``` + + Please note that, in the future, this function signature can change between + minor versions. + +- Replace all uses of `SubMsgExecutionResponse` with `SubMsgResponse`. +- Replace all uses of `PartialEq<&str> for Addr` with `PartialEq for Addr` + like this: + + ```diff + -if addr == "admin" { + - // ... + -} + +let admin = deps.api.addr_validate("admin")?; + +if addr == admin { + + // ... + +} + ``` + + If you really want to compare the string representation (e.g. in tests), you + can use `Addr::as_str`: + + ```diff + -assert_eq!(addr, "admin"); + +assert_eq!(addr.as_str(), "admin"); + ``` + + But keep in mind that this is case sensitive (while addresses are not). + +- Replace all uses of `Mul for Uint128` and + `Mul for Uint256` with `Uint{128,256}::mul_floor`: + + ```diff + -Uint128::new(123456) * Decimal::percent(1); + +Uint128::new(123456).mul_floor(Decimal::percent(1)); + ``` + +- When calling `Coin::new`, you now have to explicitly specify the integer type: + + ```diff + -Coin::new(1234, "uatom") + +Coin::new(1234u128, "uatom") + ``` + +- When creating a `Binary` or `Size` instance from an inner value, you now have + to explicitly call `new`: + + ```diff + -Binary(vec![1u8]) + +Binary::new(vec![1u8]) + ``` + +- When accessing the inner value of a `CanonicalAddr` or `Binary`, use + `as_slice` instead: + + ```diff + -&canonical_addr.0 + +canonical_addr.as_slice() + ``` + +- If you use any `u128` or `i128` in storage or message types, replace them with + `Uint128` and `Int128` respectively to preserve the current serialization. + Failing to do this will result in deserialization errors! + + ```diff + #[cw_serde] + struct MyStorage { + - a: u128, + - b: i128, + + a: Uint128, + + b: Int128, + } + const map: Map = Map::new("map"); + + -const item: Item = Item::new("item"); + +const item: Item = Item::new("item"); + ``` + +- Replace all uses of `IbcReceiveResponse::set_ack` and + `IbcReceiveResponse::default` with calls to `IbcReceiveResponse::new`: + + ```diff + -Ok(IbcReceiveResponse::new().set_ack(b"{}")) + +Ok(IbcReceiveResponse::new(b"{}")) + + -Ok(IbcReceiveResponse::default()) + +Ok(IbcReceiveResponse::new(b"")) + ``` + +- Replace all uses of `CosmosMsg::Stargate` with `CosmosMsg::Any`: + + ```diff + -CosmosMsg::Stargate { type_url, value } + +CosmosMsg::Any(AnyMsg { type_url, value }) + ``` + +- Replace all direct construction of `StdError` with the use of the + corresponding constructor: + + ```diff + -StdError::GenericErr { msg } + +StdError::generic_err(msg) + ``` + +- Replace addresses in unit tests with valid Bech32 addresses. This has to be + done for all addresses that are validated or canonicalized during the test or + within the contract. The easiest way to do this is by using + `MockApi::addr_make`. It generates a Bech32 address from any string: + + ```diff + -let msg = InstantiateMsg { + - verifier: "verifier".to_string(), + - beneficiary: "beneficiary".to_string(), + -}; + +let msg = InstantiateMsg { + + verifier: deps.api.addr_make("verifier").to_string(), + + beneficiary: deps.api.addr_make("beneficiary").to_string(), + +}; + ``` + +- Replace addresses in integration tests using `cosmwasm-vm` with valid Bech32 + addresses. This has to be done for all addresses that are validated or + canonicalized during the test or within the contract. The easiest way to do + this is by using `MockApi::addr_make`. It generates a Bech32 address from any + string: + + ```diff + -let msg = InstantiateMsg { + - verifier: "verifier".to_string(), + - beneficiary: "beneficiary".to_string(), + -}; + +let msg = InstantiateMsg { + + verifier: instance.api().addr_make("verifier").to_string(), + + beneficiary: instance.api().addr_make("beneficiary").to_string(), + +}; + ``` + +- The `update_balance`, `set_denom_metadata`, `set_withdraw_address`, + `set_withdraw_addresses` and `clear_withdraw_addresses` functions were removed + from the `MockQuerier`. Use the newly exposed modules to access them directly: + + ```diff + -querier.update_balance("addr", coins(1000, "ATOM")); + +querier.bank.update_balance("addr", coins(1000, "ATOM")); + -querier.set_withdraw_address("delegator", "withdrawer"); + +querier.distribution.set_withdraw_address("delegator", "withdrawer"); + -querier.update_staking(denom, &[], &[]); + +querier.staking.update(denom, &[], &[]); + -querier.update_ibc(port_id, &[]); + +querier.ibc.update(port_id, &[]); + ``` + +- If you were using `QueryRequest::Stargate`, you might want to enable the + `cosmwasm_2_0` cargo feature and migrate to `QueryRequest::Grpc` instead. + While the stargate query sometimes returns protobuf-encoded data and sometimes + JSON encoded data, depending on the chain, the gRPC query always returns + protobuf-encoded data. + + ```diff + -deps.querier.query(&QueryRequest::Stargate { + - path: "/service.Path/ServiceMethod".to_string(), + - data: Binary::new(b"DATA"), + -})?; + +deps.querier.query(&QueryRequest::Grpc(GrpcQuery { + + path: "/service.Path/ServiceMethod".to_string(), + + data: Binary::new(b"DATA"), + +}))?; + ``` + +- A new `payload` field allows you to send arbitrary data from the original + contract into the `reply`. If you construct `SubMsg` manually, add the + `payload` field: + + ```diff + SubMsg { + id: 12, + + payload: Binary::default(), + msg: my_bank_send, + gas_limit: Some(12345u64), + reply_on: ReplyOn::Always, + }, + ``` + + or with data: + + ```diff + SubMsg { + id: 12, + + payload: Binary::new(vec![9, 8, 7, 6, 5]), + msg: my_bank_send, + gas_limit: Some(12345u64), + reply_on: ReplyOn::Always, + }, + ``` + + If you use a constructor function, you can set the payload as follows: + + ```diff + SubMsg::new(BankMsg::Send { + to_address: payout, + amount: coins(123456u128,"gold") + }) + +.with_payload(vec![9, 8, 7, 6, 5]) + ``` + + The payload data will then be available in the new field `Reply.payload` in + the `reply` entry point. This functionality is an optional addition introduced + in 2.0. To keep the CosmWasm 1.x behavior, just set payload to + `Binary::default()`. + +- In test code, replace calls to `mock_info` with `message_info`. This takes a + `&Addr` as the first argument which you get by using owned `Addr` in the test + bodies. + +## 1.4.x -> 1.5.0 + +- Update `cosmwasm-*` dependencies in Cargo.toml (skip the ones you don't use): + + ``` + [dependencies] + cosmwasm-std = "1.5.0" + cosmwasm-storage = "1.5.0" + # ... + + [dev-dependencies] + cosmwasm-schema = "1.5.0" + cosmwasm-vm = "1.5.0" + # ... + ``` + +## 1.3.x -> 1.4.0 + +- Update `cosmwasm-*` dependencies in Cargo.toml (skip the ones you don't use): + + ``` + [dependencies] + cosmwasm-std = "1.4.0" + cosmwasm-storage = "1.4.0" + # ... + + [dev-dependencies] + cosmwasm-schema = "1.4.0" + cosmwasm-vm = "1.4.0" + # ... + ``` + +- If you want to use a feature that is only available on CosmWasm 1.4+ chains, + use this feature: + + ```diff + -cosmwasm-std = { version = "1.4.0", features = ["stargate"] } + +cosmwasm-std = { version = "1.4.0", features = ["stargate", "cosmwasm_1_4"] } + ``` + + Please note that `cosmwasm_1_2` implies `cosmwasm_1_1`, and `cosmwasm_1_3` + implies `cosmwasm_1_2`, and so on, so there is no need to set multiple. + +## 1.2.x -> 1.3.0 + +- Update `cosmwasm-*` dependencies in Cargo.toml (skip the ones you don't use): + + ``` + [dependencies] + cosmwasm-std = "1.3.0" + cosmwasm-storage = "1.3.0" + # ... + + [dev-dependencies] + cosmwasm-schema = "1.3.0" + cosmwasm-vm = "1.3.0" + # ... + ``` + +- If you want to use a feature that is only available on CosmWasm 1.3+ chains, + use this feature: + + ```diff + -cosmwasm-std = { version = "1.3.0", features = ["stargate"] } + +cosmwasm-std = { version = "1.3.0", features = ["stargate", "cosmwasm_1_3"] } + ``` + + Please note that `cosmwasm_1_2` implies `cosmwasm_1_1`, and `cosmwasm_1_3` + implies `cosmwasm_1_2`, and so on, so there is no need to set multiple. + +## 1.1.x -> 1.2.0 + +- Update `cosmwasm-*` dependencies in Cargo.toml (skip the ones you don't use): + + ``` + [dependencies] + cosmwasm-std = "1.2.0" + cosmwasm-storage = "1.2.0" + # ... + + [dev-dependencies] + cosmwasm-schema = "1.2.0" + cosmwasm-vm = "1.2.0" + # ... + ``` + +- If you want to use a feature that is only available on CosmWasm 1.2+ chains, + use this feature: + + ```diff + -cosmwasm-std = { version = "1.1.0", features = ["stargate"] } + +cosmwasm-std = { version = "1.1.0", features = ["stargate", "cosmwasm_1_2"] } + ``` + + Please note that `cosmwasm_1_2` implies `cosmwasm_1_1`, so there is no need to + set both. + +- If you use mixed type multiplication between `Uint{64,128,256}` and + `Decimal{,256}`, check out + `mul_floor`/`checked_mul_floor`/`mul_ceil`/`checked_mul_ceil`. Mixed type + arithmetic [will be removed](https://github.com/CosmWasm/cosmwasm/issues/1485) + at some point. + + ```diff + let a = Uint128::new(123); + let b = Decimal::percent(150) + + -let c = a * b; + +let c = a.mul_floor(b); + ``` + ## 1.0.0 -> 1.1.0 - Update `cosmwasm-*` dependencies in Cargo.toml (skip the ones you don't use): @@ -20,7 +515,7 @@ major releases of `cosmwasm`. Note that you can also view the # ... ``` -- There are changes to how we generate schemas, resulting in less boilerplace +- There are changes to how we generate schemas, resulting in less boilerplate maintenance for smart contract devs. Old contracts will continue working for a while, but it's highly recommended to migrate now. @@ -197,9 +692,9 @@ arbitrary ones. annotations. See the [0.13 -> 0.14 entry](#013---014) where `#[entry_point]` was introduced. -- If your chain provides a custom queries, add the custom query type as a - generic argument to `cosmwasm_std::Deps`, `DepsMut`, `OwnedDeps` and - `QuerierWrapper`. Otherwise it defaults to `Empty`. E.g. +- If your chain provides a custom query, add the custom query type as a generic + argument to `cosmwasm_std::Deps`, `DepsMut`, `OwnedDeps` and `QuerierWrapper`. + Otherwise, it defaults to `Empty`. E.g. ```diff #[entry_point] @@ -938,38 +1433,39 @@ arbitrary ones. The existing `CanonicalAddr` remains unchanged and can be used in cases in which a compact binary representation is desired. For JSON state this does not - save much data (e.g. the bech32 address + save much data (e.g. the Bech32 address cosmos1pfq05em6sfkls66ut4m2257p7qwlk448h8mysz takes 45 bytes as direct ASCII - and 28 bytes when its canonical representation is base64 encoded). For fixed - length database keys `CanonicalAddr` remains handy though. + and 28 bytes when its canonical representation is base64 encoded). For + fixed-length database keys `CanonicalAddr` remains handy though. - Replace `StakingMsg::Withdraw` with `DistributionMsg::SetWithdrawAddress` and `DistributionMsg::WithdrawDelegatorReward`. `StakingMsg::Withdraw` was a shorthand for the two distribution messages. However, it was unintuitive - because it did not set the address for one withdraw only but for all following - withdrawls. Since withdrawls are [triggered by different + because it did not set the address for one withdrawal only but for all + following withdrawals. Since withdrawals are [triggered by different events][distribution docs] such as validators changing their commission rate, - an address that was set for a one-time withdrawl would be used for future - withdrawls not considered by the contract author. + an address that was set for a one-time withdrawal would be used for future + withdrawals not considered by the contract author. - If the contract never set a withdraw address other than the contract itself + If the contract never set a withdrawal address other than the contract itself (`env.contract.address`), you can simply replace `StakingMsg::Withdraw` with `DistributionMsg::WithdrawDelegatorReward`. It is then never changed from the - default. Otherwise you need to carefully track what the current withdraw - address is. A one-time change can be implemented by emitted 3 messages: + default. Otherwise, you need to carefully track what the current withdrawal + address is. A one-time change can be implemented by emitting 3 messages: 1. `SetWithdrawAddress { address: recipient }` to temporarily change the recipient - 2. `WithdrawDelegatorReward { validator }` to do a manual withdrawl from the + 2. `WithdrawDelegatorReward { validator }` to do a manual withdrawal from the given validator 3. `SetWithdrawAddress { address: env.contract.address.into() }` to change it - back for all future withdrawls + back for all future withdrawals - [distribution docs]: https://docs.cosmos.network/v0.42/modules/distribution/ + [distribution docs]: + https://docs.cosmos.network/main/build/modules/distribution - The block time in `env.block.time` is now a `Timestamp` which stores nanosecond precision. `env.block.time_nanos` was removed. If you need the - compnents as before, use + components as before, use ```rust let seconds = env.block.time.nanos() / 1_000_000_000; let nsecs = env.block.time.nanos() % 1_000_000_000; @@ -1083,7 +1579,7 @@ arbitrary ones. - Contracts now support any custom error type `E: ToString + From`. Previously this has been `StdError`, which you can still use. However, you can now create a much more structured error experience for your unit tests that - handels exactly the error cases of your contract. In order to get a convenient + handles exactly the error cases of your contract. In order to get a convenient implementation for `ToString` and `From`, we use the crate [thiserror](https://crates.io/crates/thiserror), which needs to be added to the contracts dependencies in `Cargo.toml`. To create the custom error, create @@ -1119,12 +1615,12 @@ arbitrary ones. - `fn handle`: `Result`, - `fn query`: `Result`. - If one of your funtions does not use the custom error, you can continue to use - `StdError` as before. I.e. you can have `handle` returning + If one of your functions does not use the custom error, you can continue to + use `StdError` as before. I.e. you can have `handle` returning `Result` and `query` returning `StdResult`. - You can have a top-hevel `init`/`migrate`/`handle`/`query` that returns a + You can have a top-level `init`/`migrate`/`handle`/`query` that returns a custom error but some of its implementations only return errors from the standard library (`StdResult` aka. `Result`). Then use `Ok(std_result?)` to convert @@ -1161,7 +1657,7 @@ arbitrary ones. } ``` - Once you got familiar with the concept, you can create different error types + Once you get familiar with the concept, you can create different error types for each of the contract's functions. You can also try a different error library than @@ -1413,8 +1909,8 @@ Contract code and uni tests: - `cosmwasm_storage::get_with_prefix`, `cosmwasm_storage::set_with_prefix`, `cosmwasm_storage::RepLog::commit`, `cosmwasm_std::ReadonlyStorage::get`, `cosmwasm_std::ReadonlyStorage::range`, `cosmwasm_std::Storage::set` and - `cosmwasm_std::Storage::remove` now return the value directly that was wrapped - in a result before. + `cosmwasm_std::Storage::remove` now returns the value directly that was + wrapped in a result before. - Error creator functions are now in type itself, e.g. `StdError::invalid_base64` instead of `invalid_base64`. The free functions are deprecated and will be removed before 1.0. @@ -1503,7 +1999,7 @@ Contract Code: - Complete overhaul of `cosmwasm::Error` into `cosmwasm_std::StdError`: - Auto generated snafu error constructor structs like `NotFound`/`ParseErr`/… - have been privatized in favour of error generation helpers like + have been privatized in favor of error generation helpers like `not_found`/`parse_err`/… - All error generator functions now return errors instead of results, such that e.g. `return unauthorized();` becomes `return Err(unauthorized());` @@ -1538,7 +2034,7 @@ Both: - `dependencies` was renamed to `mock_dependencies`. `mock_dependencies` and `mock_instance` take a 2nd argument to set the contract balance (visible for the querier). If you need to set more balances, use `mock_XX_with_balances`. - The follow code block explains: + The following code block explains: ```rust // before: balance as last arg in mock_env @@ -1560,7 +2056,7 @@ Integration Tests: - Before: `match err { ContractResult::Err(msg) => assert_eq!(msg, "Unauthorized"), ... }` - After: `match err { Err(StdError::Unauthorized{ .. }) => {}, ... }` -- Remove all imports / use of `ContractResult` +- Remove all imports/use of `ContractResult` - You must specify `CosmosMsg::Native` type when calling `cosmwasm_vm::testing::{handle, init}`. You will want to `use cosmwasm_std::{HandleResult, InitResult}` or @@ -1581,7 +2077,7 @@ All helper functions have been moved into a new `cosmwasm-schema` package. - Remove `serde_json` `[dev-dependency]` if there, as cosmwasm-schema will handle JSON output internally. - Update `examples/schema.rs` to look - [more like queue](https://github.com/CosmWasm/cosmwasm/blob/main/contracts/queue/examples/schema.rs), + [more like queue](https://github.com/CosmWasm/cosmwasm/blob/v0.8.0/contracts/queue/examples/schema.rs), but replacing all the imports and type names with those you currently have. - Regenerate schemas with `cargo schema` diff --git a/NOTICE b/NOTICE index 40383b7fff..5304feb5bf 100644 --- a/NOTICE +++ b/NOTICE @@ -1,7 +1,7 @@ Copyright 2019 Jehan Tremback Copyright 2019-2021 Confio OÜ Copyright 2019-2020 Simon Warta -Copyright 2021 Confio GmbH +Copyright 2021-2025 Confio GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index b71dab0b68..190d441e01 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,172 @@ # CosmWasm -[![CircleCI](https://circleci.com/gh/CosmWasm/cosmwasm/tree/main.svg?style=shield)](https://circleci.com/gh/CosmWasm/cosmwasm/tree/main) - -**WebAssembly Smart Contracts for the Cosmos SDK.** - -## Packages - -The following packages are maintained here: - -| Crate | Usage | Download | Docs | Coverage | -| ---------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------- | -| cosmwasm-crypto | Internal only | [![cosmwasm-crypto on crates.io](https://img.shields.io/crates/v/cosmwasm-crypto.svg)](https://crates.io/crates/cosmwasm-crypto) | [![Docs](https://docs.rs/cosmwasm-crypto/badge.svg)](https://docs.rs/cosmwasm-crypto) | [![Coverage][cov-badge-crypto]][cov-link-crypto] | -| cosmwasm-derive | Internal only | [![cosmwasm-derive on crates.io](https://img.shields.io/crates/v/cosmwasm-derive.svg)](https://crates.io/crates/cosmwasm-derive) | [![Docs](https://docs.rs/cosmwasm-derive/badge.svg)](https://docs.rs/cosmwasm-derive) | [![Coverage][cov-badge-derive]][cov-link-derive] | -| cosmwasm-schema | Contract development | [![cosmwasm-schema on crates.io](https://img.shields.io/crates/v/cosmwasm-schema.svg)](https://crates.io/crates/cosmwasm-schema) | [![Docs](https://docs.rs/cosmwasm-schema/badge.svg)](https://docs.rs/cosmwasm-schema) | [![Coverage][cov-badge-schema]][cov-link-schema] | -| cosmwasm-std | Contract development | [![cosmwasm-std on crates.io](https://img.shields.io/crates/v/cosmwasm-std.svg)](https://crates.io/crates/cosmwasm-std) | [![Docs](https://docs.rs/cosmwasm-std/badge.svg)](https://docs.rs/cosmwasm-std) | [![Coverage][cov-badge-std]][cov-link-std] | -| cosmwasm-storage | Contract development | [![cosmwasm-storage on crates.io](https://img.shields.io/crates/v/cosmwasm-storage.svg)](https://crates.io/crates/cosmwasm-storage) | [![Docs](https://docs.rs/cosmwasm-storage/badge.svg)](https://docs.rs/cosmwasm-storage) | [![Coverage][cov-badge-storage]][cov-link-storage] | -| cosmwasm-vm | Host environments | [![cosmwasm-vm on crates.io](https://img.shields.io/crates/v/cosmwasm-vm.svg)](https://crates.io/crates/cosmwasm-vm) | [![Docs](https://docs.rs/cosmwasm-vm/badge.svg)](https://docs.rs/cosmwasm-vm) | ([#1151]) | -| cosmwasm-check | Contract development | [![cosmwasm-check on crates.io](https://img.shields.io/crates/v/cosmwasm-check.svg)](https://crates.io/crates/cosmwasm-check) | `cosmwasm-check -h` | N/A | - -[cov-badge-crypto]: - https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-crypto -[cov-badge-derive]: - https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-derive -[cov-badge-schema]: - https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-schema -[cov-badge-std]: - https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-std -[cov-badge-storage]: - https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-storage -[cov-link-crypto]: - https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/crypto -[cov-link-derive]: - https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/derive -[cov-link-schema]: - https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/schema +![component][component-badge] +[![license][apache-badge]][apache-url] + +[component-badge]: https://img.shields.io/badge/CosmWasm-6343ae.svg +[apache-badge]: https://img.shields.io/badge/License-Apache%202.0-blue.svg +[apache-url]: LICENSE +[notice-url]: NOTICE + +**WebAssembly Smart Contracts for the Cosmos SDK** + +## Rust crates + +The following Rust crates are maintained in this repository: + +| Crate | Usage | Download | Docs | Coverage | +|------------------------------------|----------------------|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| +| cosmwasm‑check | Contract development | [![cosmwasm-check][crates-badge-cosmwasm-check]][crates-url-cosmwasm-check] | [![docs-cosmwasm-check][docs-badge-cosmwasm-check]][docs-url-cosmwasm-check] | ![cov-cosmwasm-check][cov-badge-cosmwasm-check] | +| cosmwasm‑core | Internal use only | [![cosmwasm-core][crates-badge-cosmwasm-core]][crates-url-cosmwasm-core] | [![docs-cosmwasm-core][docs-badge-cosmwasm-core]][docs-url-cosmwasm-core] | ![cov-cosmwasm-core][cov-badge-cosmwasm-core] | +| cosmwasm‑crypto | Internal use only | [![cosmwasm-crypto][crates-badge-cosmwasm-crypto]][crates-url-cosmwasm-crypto] | [![docs-cosmwasm-crypto][docs-badge-cosmwasm-crypto]][docs-url-cosmwasm-crypto] | ![cov-cosmwasm-crypto][cov-badge-cosmwasm-crypto] | +| cosmwasm‑derive | Internal use only | [![cosmwasm-derive][crates-badge-cosmwasm-derive]][crates-url-cosmwasm-derive] | [![docs-cosmwasm-derive][docs-badge-cosmwasm-derive]][docs-url-cosmwasm-derive] | ![cov-cosmwasm-derive][cov-badge-cosmwasm-derive] | +| cosmwasm‑schema | Contract development | [![cosmwasm-schema][crates-badge-cosmwasm-schema]][crates-url-cosmwasm-schema] | [![docs-cosmwasm-schema][docs-badge-cosmwasm-schema]][docs-url-cosmwasm-schema] | ![cov-cosmwasm-schema][cov-badge-cosmwasm-schema] | +| cosmwasm‑schema‑derive | Internal use only | [![cosmwasm-schema-derive][crates-badge-cosmwasm-schema-derive]][crates-url-cosmwasm-schema-derive] | [![docs-cosmwasm-schema-derive][docs-badge-cosmwasm-schema-derive]][docs-url-cosmwasm-schema-derive] | ![cov-cosmwasm-schema-derive][cov-badge-cosmwasm-schema-derive] | +| cosmwasm‑std | Contract development | [![cosmwasm-std][crates-badge-cosmwasm-std]][crates-url-cosmwasm-std] | [![docs-cosmwasm-std][docs-badge-cosmwasm-std]][docs-url-cosmwasm-std] | ![cov-cosmwasm-std][cov-badge-cosmwasm-std] | +| cosmwasm‑vm | Host environments | [![cosmwasm-vm][crates-badge-cosmwasm-vm]][crates-url-cosmwasm-vm] | [![docs-cosmwasm-vm][docs-badge-cosmwasm-vm]][docs-url-cosmwasm-vm] | ![cov-cosmwasm-vm][cov-badge-cosmwasm-vm] | +| cosmwasm‑vm‑derive | Internal use only | [![cosmwasm-vm-derive][crates-badge-cosmwasm-vm-derive]][crates-url-cosmwasm-vm-derive] | [![docs-cosmwasm-vm-derive][docs-badge-cosmwasm-vm-derive]][docs-url-cosmwasm-vm-derive] | ![cov-cosmwasm-vm-derive][cov-badge-cosmwasm-vm-derive] | +| cw‑schema | Contract development | [![cw-schema][crates-badge-cw-schema]][crates-url-cw-schema] | [![docs-cw-schema][docs-badge-cw-schema]][docs-url-cw-schema] | ![cov-cw-schema][cov-badge-cw-schema] | +| cw‑schema‑derive | Internal use only | [![cw-schema-derive][crates-badge-cw-schema-derive]][crates-url-cw-schema-derive] | [![docs-cw-schema-derive][docs-badge-cw-schema-derive]][docs-url-cw-schema-derive] | ![cov-cw-schema-derive][cov-badge-cw-schema-derive] | + +[crates-badge-cosmwasm-check]: https://img.shields.io/crates/v/cosmwasm-check.svg +[crates-url-cosmwasm-check]: https://crates.io/crates/cosmwasm-check +[docs-badge-cosmwasm-check]: https://docs.rs/cosmwasm-check/badge.svg +[docs-url-cosmwasm-check]: https://docs.rs/cosmwasm-check +[cov-badge-cosmwasm-check]: https://img.shields.io/badge/coverage-98%25%20%E2%94%82%20100%25%20%E2%94%82%20100%25-21b577.svg + +[crates-badge-cosmwasm-core]: https://img.shields.io/crates/v/cosmwasm-core.svg +[crates-url-cosmwasm-core]: https://crates.io/crates/cosmwasm-core +[docs-badge-cosmwasm-core]: https://docs.rs/cosmwasm-core/badge.svg +[docs-url-cosmwasm-core]: https://docs.rs/cosmwasm-core +[cov-badge-cosmwasm-core]: https://img.shields.io/badge/coverage-%E2%80%94%20%E2%94%82%20%E2%80%94%20%E2%94%82%20%E2%80%94-21b577.svg + +[crates-badge-cosmwasm-crypto]: https://img.shields.io/crates/v/cosmwasm-crypto.svg +[crates-url-cosmwasm-crypto]: https://crates.io/crates/cosmwasm-crypto +[docs-badge-cosmwasm-crypto]: https://docs.rs/cosmwasm-crypto/badge.svg +[docs-url-cosmwasm-crypto]: https://docs.rs/cosmwasm-crypto +[cov-badge-cosmwasm-crypto]: https://img.shields.io/badge/coverage-81%25%20%E2%94%82%2084%25%20%E2%94%82%2092%25-21b577.svg + +[crates-badge-cosmwasm-derive]: https://img.shields.io/crates/v/cosmwasm-derive.svg +[crates-url-cosmwasm-derive]: https://crates.io/crates/cosmwasm-derive +[docs-badge-cosmwasm-derive]: https://docs.rs/cosmwasm-derive/badge.svg +[docs-url-cosmwasm-derive]: https://docs.rs/cosmwasm-derive +[cov-badge-cosmwasm-derive]: https://img.shields.io/badge/coverage-84%25%20%E2%94%82%2085%25%20%E2%94%82%2094%25-21b577.svg + +[crates-badge-cosmwasm-schema]: https://img.shields.io/crates/v/cosmwasm-schema.svg +[crates-url-cosmwasm-schema]: https://crates.io/crates/cosmwasm-schema +[docs-badge-cosmwasm-schema]: https://docs.rs/cosmwasm-schema/badge.svg +[docs-url-cosmwasm-schema]: https://docs.rs/cosmwasm-schema +[cov-badge-cosmwasm-schema]: https://img.shields.io/badge/coverage-61%25%20%E2%94%82%2047%25%20%E2%94%82%2065%25-f52020.svg + +[crates-badge-cosmwasm-schema-derive]: https://img.shields.io/crates/v/cosmwasm-schema-derive.svg +[crates-url-cosmwasm-schema-derive]: https://crates.io/crates/cosmwasm-schema-derive +[docs-badge-cosmwasm-schema-derive]: https://docs.rs/cosmwasm-schema-derive/badge.svg +[docs-url-cosmwasm-schema-derive]: https://docs.rs/cosmwasm-schema-derive +[cov-badge-cosmwasm-schema-derive]: https://img.shields.io/badge/coverage-76%25%20%E2%94%82%2087%25%20%E2%94%82%2091%25-f4b01b.svg + +[crates-badge-cosmwasm-std]: https://img.shields.io/crates/v/cosmwasm-std.svg +[crates-url-cosmwasm-std]: https://crates.io/crates/cosmwasm-std +[docs-badge-cosmwasm-std]: https://docs.rs/cosmwasm-std/badge.svg +[docs-url-cosmwasm-std]: https://docs.rs/cosmwasm-std +[cov-badge-cosmwasm-std]: https://img.shields.io/badge/coverage-92%25%20%E2%94%82%2091%25%20%E2%94%82%2094%25-21b577.svg + +[crates-badge-cosmwasm-vm]: https://img.shields.io/crates/v/cosmwasm-vm.svg +[crates-url-cosmwasm-vm]: https://crates.io/crates/cosmwasm-vm +[docs-badge-cosmwasm-vm]: https://docs.rs/cosmwasm-vm/badge.svg +[docs-url-cosmwasm-vm]: https://docs.rs/cosmwasm-vm +[cov-badge-cosmwasm-vm]: https://img.shields.io/badge/coverage-79%25%20%E2%94%82%2083%25%20%E2%94%82%2090%25-f4b01b.svg + +[crates-badge-cosmwasm-vm-derive]: https://img.shields.io/crates/v/cosmwasm-vm-derive.svg +[crates-url-cosmwasm-vm-derive]: https://crates.io/crates/cosmwasm-vm-derive +[docs-badge-cosmwasm-vm-derive]: https://docs.rs/cosmwasm-vm-derive/badge.svg +[docs-url-cosmwasm-vm-derive]: https://docs.rs/cosmwasm-vm-derive +[cov-badge-cosmwasm-vm-derive]: https://img.shields.io/badge/coverage-0%25%20%E2%94%82%200%25%20%E2%94%82%200%25-f52020.svg + +[crates-badge-cw-schema]: https://img.shields.io/crates/v/cw-schema.svg +[crates-url-cw-schema]: https://crates.io/crates/cw-schema +[docs-badge-cw-schema]: https://docs.rs/cw-schema/badge.svg +[docs-url-cw-schema]: https://docs.rs/cw-schema +[cov-badge-cw-schema]: https://img.shields.io/badge/coverage-63%25%20%E2%94%82%2069%25%20%E2%94%82%2065%25-f4b01b.svg + +[crates-badge-cw-schema-derive]: https://img.shields.io/crates/v/cw-schema-derive.svg +[crates-url-cw-schema-derive]: https://crates.io/crates/cw-schema-derive +[docs-badge-cw-schema-derive]: https://docs.rs/cw-schema-derive/badge.svg +[docs-url-cw-schema-derive]: https://docs.rs/cw-schema-derive +[cov-badge-cw-schema-derive]: https://img.shields.io/badge/coverage-0%25%20%E2%94%82%200%25%20%E2%94%82%200%25-f52020.svg + +[cov-badge-crypto]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-crypto +[cov-badge-derive]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-derive +[cov-badge-schema]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-schema +[cov-badge-core]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-core +[cov-badge-std]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-std +[cov-badge-vm]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-vm +[cov-link-crypto]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/crypto +[cov-link-derive]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/derive +[cov-link-schema]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/schema +[cov-link-core]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/core [cov-link-std]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/std -[cov-link-storage]: - https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/storage -[#1151]: https://github.com/CosmWasm/cosmwasm/issues/1151 +[cov-link-vm]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/vm + +## Dependencies + +The following diagram shows the dependencies between the Rust crates in this repository: + +```mermaid +--- +config: + theme: 'forest' +--- + +graph BT + A("`**cosmwasm-core** + 3.0.2`") + + B("`**cosmwasm-std** + 3.0.2`") + + C("`**cosmwasm-crypto** + 3.0.2`") + + D("`**cosmwasm-vm** + 3.0.2`") + + E("`**cosmwasm-vm-derive** + 3.0.2`") + + F("`**cosmwasm-derive** + 3.0.2`") + + G("`**cosmwasm-schema** + 3.0.2`") + + H("`**cosmwasm-schema-derive** + 3.0.2`") + + I("`**cosmwasm-check** + 3.0.2`") + + J("`**cw-schema** + 3.0.2`") + + K("`**cw-schema-derive** + 3.0.2`") + + A --> B + A --> C + A --> D + C --> B + C --> D + B --> D + E --> D + F --> B + H --> G + B --> I + D --> I + G --> B + J --> B + J --> G + K --> J +``` ## Overview @@ -51,17 +180,10 @@ This code is compiled into Wasm bytecode as part of the smart contract. - [cosmwasm-std](https://github.com/CosmWasm/cosmwasm/tree/main/packages/std) - A crate in this workspace. Provides the bindings and all imports needed to build a smart contract. -- [cosmwasm-storage](https://github.com/CosmWasm/cosmwasm/tree/main/packages/storage) - - A crate in this workspace. This optional addition to `cosmwasm-std` includes - convenience helpers for interacting with storage. **This is being deprecated - in favor of - [`cw-storage-plus`](https://github.com/CosmWasm/cw-storage-plus).** See - [issue #1457](https://github.com/CosmWasm/cosmwasm/issues/1457). - [cw-storage-plus](https://github.com/CosmWasm/cw-storage-plus) - A crate which - fills the same role as `cosmwasm-storage`, but with much more powerful types + provides convenience helpers for interacting with storage with powerful types supporting composite primary keys, secondary indexes, automatic snapshotting, - and more. This is used in most modern contracts and likely going to be - stabilized (version `1.0.0`) soon. + and more. This is used in most modern contracts. **Building contracts:** @@ -76,15 +198,15 @@ This code is compiled into Wasm bytecode as part of the smart contract. Please submit your contract or interface via PR. - [rust-optimizer](https://github.com/cosmwasm/rust-optimizer) - A docker image and scripts to take your Rust code and produce the smallest possible Wasm - output, deterministically. This is designed both for preparing contracts for + output, deterministically. This is designed for preparing contracts for deployment as well as validating that a given deployed contract is based on some given source code, allowing a [similar contract verification algorithm](https://medium.com/coinmonks/how-to-verify-and-publish-on-etherscan-52cf25312945) as Etherscan. -- [serde-json-wasm](https://github.com/CosmWasm/serde-json-wasm) - A custom json - library, forked from `serde-json-core`. This provides an interface similar to - `serde-json`, but without any floating-point instructions (non-deterministic) - and producing builds around 40% of the code size. + + Building locally instead of using the docker image can + [leak some information about the directory structure of your system](https://github.com/CosmWasm/cosmwasm/issues/1918) + and makes the build non-reproducible. **Executing contracts:** @@ -111,42 +233,43 @@ You can see some examples of contracts under the `contracts` directory, which you can look at. They are simple and self-contained, primarily meant for testing purposes, but that also makes them easier to understand. -You can also look at [cosmwasm-plus](https://github.com/CosmWasm/cosmwasm-plus) -for examples and inspiration on more production-like contracts and also how we -call one contract from another. If you are working on DeFi or Tokens, please -look at the `cw20`, `cw721` and/or `cw1155` packages that define standard -interfaces as analogues to some popular ERC designs. (`cw20` is also inspired by -`erc777`). +You can also look at [cw-plus](https://github.com/CosmWasm/cw-plus) for examples +and inspiration on more production-like contracts and also how we call one +contract from another. If you are working on DeFi or Tokens, please look at the +`cw20`, `cw721` and/or `cw1155` packages that define standard interfaces as +analogues to some popular ERC designs. (`cw20` is also inspired by `erc777`). -If you want to get started building you own contract, the simplest way is to go +If you want to get started building your own contract, the simplest way is to go to the [cosmwasm-template](https://github.com/CosmWasm/cosmwasm-template) repository and follow the instructions. This will give you a simple contract along with tests, and a properly configured build environment. From there you can edit the code to add your desired logic and publish it as an independent repo. -We also recommend you review our [documentation site](https://docs.cosmwasm.com) -which contains a few tutorials to guide you in building your first contracts. We -also do public workshops on various topics about once a month. You can find -[past recordings under the "Videos" section](https://cosmwasm.com/resources), or -[join our Discord server](https://docs.cosmwasm.com/chat) to ask for help. +We also recommend you review our [documentation site](https://book.cosmwasm.com) +which contains a few tutorials to guide you in building your first contracts. +You can find past recordings of hackathon/conference workshops and presentations +on our [YouTube channel](https://www.youtube.com/@CosmWasm), or +[join our Discord server](https://chat.cosmwasm.com) to ask for help. ## Minimum Supported Rust Version (MSRV) -See [Minimum Supported Rust Version (MSRV)](./docs/MSRV.md). +See [Minimum Supported Rust Version (MSRV)] on Wiki. + +[Minimum Supported Rust Version (MSRV)]: https://github.com/CosmWasm/cosmwasm/wiki/Minimum-Supported-Rust-Version-(MSRV) ## API entry points -WebAssembly contracts are basically black boxes. The have no default entry +WebAssembly contracts are basically black boxes. They have no default entry points, and no access to the outside world by default. To make them useful, we need to add a few elements. If you haven't worked with WebAssembly before, please read an overview on -[how to create imports and exports](./EntryPoints.md) in general. +[how to create imports and exports](docs/IDL.md) in general. ### Exports -The required exports provided by the cosmwasm smart contract are: +The required exports provided by the CosmWasm smart contract are: ```rust // signal for 1.0 compatibility @@ -188,10 +311,11 @@ extern "C" fn ibc_packet_ack(env_ptr: u32, msg_ptr: u32) -> u32; extern "C" fn ibc_packet_timeout(env_ptr: u32, msg_ptr: u32) -> u32; ``` -`allocate`/`deallocate` allow the host to manage data within the Wasm VM. If -you're using Rust, you can implement them by simply -[re-exporting them from cosmwasm::exports](https://github.com/CosmWasm/cosmwasm/blob/v0.6.3/contracts/hackatom/src/lib.rs#L5). -`instantiate`, `execute` and `query` must be defined by your contract. +`allocate` and `deallocate` allow the host to manage data within the Wasm VM. If +you're using Rust, you get them automatically by using the `cosmwasm-std` crate. +Your contract can define the other entrypoints using the +`cosmwasm_std::entry_point` macro to get strong typing instead of raw memory +offsets. ### Imports @@ -199,7 +323,7 @@ The imports provided to give the contract access to the environment are: ```rust // This interface will compile into required Wasm imports. -// A complete documentation those functions is available in the VM that provides them: +// A complete documentation of those functions is available in the VM that provides them: // https://github.com/CosmWasm/cosmwasm/blob/v1.0.0-beta/packages/vm/src/instance.rs#L89-L206 extern "C" { fn db_read(key: u32) -> u32; @@ -228,6 +352,18 @@ extern "C" { recovery_param: u32, ) -> u64; + /// Verifies message hashes against a signature with a public key, using the + /// secp256r1 ECDSA parametrization. + /// Returns 0 on verification success, 1 on verification failure, and values + /// greater than 1 in case of error. + fn secp256r1_verify(message_hash_ptr: u32, signature_ptr: u32, public_key_ptr: u32) -> u32; + + fn secp256r1_recover_pubkey( + message_hash_ptr: u32, + signature_ptr: u32, + recovery_param: u32, + ) -> u64; + /// Verifies a message against a signature with a public key, using the /// ed25519 EdDSA scheme. /// Returns 0 on verification success, 1 on verification failure, and values @@ -252,11 +388,11 @@ extern "C" { ``` (from -[imports.rs](https://github.com/CosmWasm/cosmwasm/blob/main/packages/std/src/imports.rs)) +[imports.rs](https://github.com/CosmWasm/cosmwasm/blob/main/packages/vm/src/imports.rs)) You could actually implement a WebAssembly module in any language, and as long as you implement these functions, it will be interoperable, given the JSON data -passed around is the proper format. +passed around is in the proper format. Note that these u32 pointers refer to `Region` instances, containing the offset and length of some Wasm memory, to allow for safe access between the caller and @@ -279,12 +415,12 @@ pub struct Region { ``` (from -[memory.rs](https://github.com/CosmWasm/cosmwasm/blob/main/packages/std/src/memory.rs)) +[memory.rs](https://github.com/CosmWasm/cosmwasm/blob/main/packages/std/src/exports/memory.rs)) ## Implementing the Smart Contract If you followed the [instructions above](#Creating-a-smart-contract), you should -have a runable smart contract. You may notice that all of the Wasm exports are +have a runnable smart contract. You may notice that all the Wasm exports are taken care of by `lib.rs`, which you shouldn't need to modify. What you need to do is simply look in `contract.rs` and implement `instantiate` and `execute` functions, defining your custom `InstantiateMsg` and `ExecuteMsg` structs for @@ -336,7 +472,7 @@ pub trait Storage { /// /// The bound `start` is inclusive and `end` is exclusive. /// - /// If `start` is lexicographically greater than or equal to `end`, an empty range is described, mo matter of the order. + /// If `start` is lexicographically greater than or equal to `end`, an empty range is described, no matter of the order. fn range<'a>( &'a self, start: Option<&[u8]>, @@ -374,16 +510,15 @@ are only used in `#[cfg(test)]` blocks, they will never make it into the Note that for tests, you can use the `MockStorage` implementation which gives a generic in-memory hashtable in order to quickly test your logic. You can see a -[simple example how to write a test](https://github.com/CosmWasm/cosmwasm/blob/81b6702d3994c8c34fb51c53176993b7e672860b/contracts/hackatom/src/contract.rs#L70-L88) +[simple example of how to write a test](https://github.com/CosmWasm/cosmwasm/blob/81b6702d3994c8c34fb51c53176993b7e672860b/contracts/hackatom/src/contract.rs#L70-L88) in our sample contract. ## Testing the Smart Contract (wasm) You may also want to ensure the compiled contract interacts with the environment properly. To do so, you will want to create a canonical release build of the -`.wasm` file and then write tests in with the same VM tooling we will -use in production. This is a bit more complicated but we added some tools to -help in +`.wasm` file and then write tests with the same VM tooling we will use +in production. This is a bit more complicated, but we added some tools to help in [cosmwasm-vm](https://github.com/CosmWasm/cosmwasm/tree/main/packages/vm) which can be added as a `dev-dependency`. @@ -403,16 +538,16 @@ from the published rust code. For that, we have a separate repo, [rust-optimizer](https://github.com/CosmWasm/rust-optimizer) that provides a -[docker image](https://hub.docker.com/r/CosmWasm/rust-optimizer/tags) for -building. For more info, look at +[docker image](https://hub.docker.com/r/CosmWasm/optimizer/tags) for building. +For more info, look at [rust-optimizer README](https://github.com/CosmWasm/rust-optimizer/blob/master/README.md#usage), but the quickstart guide is: ```sh docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ + --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 + cosmwasm/optimizer:0.15.0 ``` It will output a highly size-optimized build as `contract.wasm` in `$CODE`. With @@ -429,9 +564,6 @@ like hashing or signature verification. ## Developing -The ultimate auto-updating guide to building this project is the CI -configuration in `.circleci/config.yml`. - For manually building this repo locally during development, here are a few commands. They assume you use a stable Rust version by default and have a nightly toolchain installed as well. @@ -449,7 +581,15 @@ nightly toolchain installed as well. **Contracts** | Step | Description | Command | -| ---- | -------------------------------- | -------------------------------------- | +|------|----------------------------------|----------------------------------------| | 1 | fast checks, rebuilds lock files | `./devtools/check_contracts_fast.sh` | | 2 | medium fast checks | `./devtools/check_contracts_medium.sh` | | 3 | slower checks | `./devtools/check_contracts_full.sh` | + +## License + +Licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) +(see [LICENSE][apache-url] and [NOTICE][notice-url]). + +Any contribution intentionally submitted for inclusion in this crate by you, +shall be licensed as above, without any additional terms or conditions. diff --git a/SECURITY.md b/SECURITY.md index ca63ebaee4..d74ab19653 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,5 +1,6 @@ # Security Policy -This repository is maintained by Confio as part of the CosmWasm stack. Please -see https://github.com/CosmWasm/advisories/blob/main/SECURITY.md for our -security policy. +This repository is part of the **CosmWasm** stack. +Please see the [Advisories] for its security policy. + +[Advisories]: https://github.com/CosmWasm/advisories/blob/main/SECURITY.md diff --git a/SEMANTICS.md b/SEMANTICS.md index 9f05d7e434..0c2c0fe9e5 100644 --- a/SEMANTICS.md +++ b/SEMANTICS.md @@ -1,384 +1,5 @@ -# Contract Semantics +This file was updated and moved to: -This document aims to clarify the semantics of how a CosmWasm contract interacts -with its environment. There are two main types of actions: _mutating_ actions, -which receive `DepsMut` and are able to modify the state of the blockchain, and -_query_ actions, which are run on a single node with read-only access to the -data. - -## Execution - -In the section below, we will discuss how the `execute` call works, but the same -semantics apply to any other _mutating_ action - `instantiate`, `migrate`, -`sudo`, etc. - -### SDK Context - -Before looking at CosmWasm, we should look at the (somewhat under-documented) -semantics enforced by the blockchain framework we integrate with - the -[Cosmos SDK](https://v1.cosmos.network/sdk). It is based upon the -[Tendermint BFT](https://tendermint.com/core/) Consensus Engine. Let us first -look how they process transactions before they arrive in CosmWasm (and after -they leave). - -First, the Tendermint engine will seek 2/3+ consensus on a list of transactions -to be included in the next block. This is done _without executing them_. They -are simply subjected to a minimal pre-filter by the Cosmos SDK module, to ensure -they are validly formatted transactions, with sufficient gas fees, and signed by -an account with sufficient fees to pay it. Notably, this means many transactions -that error may be included in a block. - -Once a block is committed (typically every 5s or so), the transactions are then -fed to the Cosmos SDK sequentially in order to execute them. Each one returns a -result or error along with event logs, which are recorded in the `TxResults` -section of the next block. The `AppHash` (or merkle proof or blockchain state) -after executing the block is also included in the next block. - -The Cosmos SDK `BaseApp` handles each transaction in an isolated context. It -first verifies all signatures and deducts the gas fees. It sets the "Gas Meter" -to limit the execution to the amount of gas paid for by the fees. Then it makes -an isolated context to run the transaction. This allows the code to read the -current state of the chain (after the last transaction finished), but it only -writes to a cache, which may be committed or rolled back on error. - -A transaction may consist of multiple messages and each one is executed in turn -under the same context and same gas limit. If all messages succeed, the context -will be committed to the underlying blockchain state and the results of all -messages will be stored in the `TxResult`. If one message fails, all later -messages are skipped and all state changes are reverted. This is very important -for atomicity. That means Alice and Bob can both sign a transaction with 2 -messages: Alice pays Bob 1000 ATOM, Bob pays Alice 50 ETH, and if Bob doesn't -have the funds in his account, Alice's payment will also be reverted. This is -just like a DB Transaction typically works. - -[`x/wasm`](https://github.com/CosmWasm/wasmd/tree/master/x/wasm) is a custom -Cosmos SDK module, which processes certain messages and uses them to upload, -instantiate, and execute smart contracts. In particular, it accepts a properly -signed -[`MsgExecuteContract`](https://github.com/CosmWasm/wasmd/blob/master/proto/cosmwasm/wasm/v1beta1/tx.proto#L76-L89), -routes it to -[`Keeper.Execute`](https://github.com/CosmWasm/wasmd/blob/master/x/wasm/keeper/keeper.go#L311-L355), -which loads the proper smart contract and calls `execute` on it. Note that this -method may either return a success (with data and events) or an error. In the -case of an error here, it will revert the entire transaction in the block. This -is the context we find ourselves in when our contract receives the `execute` -call. - -### Basic Execution - -When we implement a contract, we provide the following entry point: - -```rust -pub fn execute( - deps: DepsMut, - env: Env, - info: MessageInfo, - msg: ExecuteMsg, -) -> Result { } -``` - -With `DepsMut`, this can read and write to the backing `Storage`, as well as use -the `Api` to validate addresses, and `Query` the state of other contracts or -native modules. Once it is done, it returns either `Ok(Response)` or -`Err(ContractError)`. Let's examine what happens next: - -If it returns `Err`, this error is converted to a string representation -(`err.to_string()`), and this is returned to the SDK module. _All state changes -are reverted_ and `x/wasm` returns this error message, which will _generally_ -(see submessage exception below) abort the transaction, and return this same -error message to the external caller. - -If it returns `Ok`, the `Response` object is parsed and processed. Let's look at -the parts here: - -```rust -pub struct Response -where - T: Clone + fmt::Debug + PartialEq + JsonSchema, -{ - /// Optional list of "subcalls" to make. These will be executed in order - /// (and this contract's subcall_response entry point invoked) - /// *before* any of the "fire and forget" messages get executed. - pub submessages: Vec>, - /// After any submessages are processed, these are all dispatched in the host blockchain. - /// If they all succeed, then the transaction is committed. If any fail, then the transaction - /// and any local contract state changes are reverted. - pub messages: Vec>, - /// The attributes that will be emitted as part of a "wasm" event - pub attributes: Vec, - pub data: Option, -} -``` - -In the Cosmos SDK, a transaction returns a number of events to the user, along -with an optional data "result". This result is hashed into the next block hash -to be provable and can return some essential state (although in general client -apps rely on Events more). This result is more commonly used to pass results -between contracts or modules in the sdk. Note that the `ResultHash` includes -only the `Code` (non-zero meaning error) and `Result` (data) from the -transaction. Events and log are available via queries, but there are no -light-client proofs possible. - -If the contract sets `data`, this will be returned in the `result` field. -`attributes` is a list of `{key, value}` pairs which will be -[appended to a default event](https://github.com/CosmWasm/wasmd/blob/master/x/wasm/types/types.go#L302-L321). -The final result looks like this to the client: - -```json -{ - "type": "wasm", - "attributes": [ - { "key": "contract_addr", "value": "cosmos1234567890qwerty" }, - { "key": "custom-key-1", "value": "custom-value-1" }, - { "key": "custom-key-2", "value": "custom-value-2" } - ] -} -``` - -### Dispatching Messages - -Now let's move onto the `messages` field. Some contracts are fine only talking -with themselves, such as a cw20 contract just adjusting its balances on -transfers. But many want to move tokens (native or cw20) or call into other -contracts for more complex actions. This is where messages come in. We return -[`CosmosMsg`, which is a serializable representation](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta4/packages/std/src/results/cosmos_msg.rs#L18-L40) -of any external call the contract can make. It looks something like this (with -`stargate` feature flag enabled): - -```rust -pub enum CosmosMsg -where - T: Clone + fmt::Debug + PartialEq + JsonSchema, -{ - Bank(BankMsg), - /// This can be defined by each blockchain as a custom extension - Custom(T), - Staking(StakingMsg), - Distribution(DistributionMsg), - Stargate { - type_url: String, - value: Binary, - }, - Ibc(IbcMsg), - Wasm(WasmMsg), -} -``` - -If a contract returns two messages - M1 and M2, these will both be parsed and -executed in `x/wasm` _with the permissions of the contract_ (meaning -`info.sender` will be the contract not the original caller). If they return -success, they will emit a new event with the custom attributes, the `data` field -will be ignored, and any messages they return will also be processed. If they -return an error, the parent call will return an error, thus rolling back state -of the whole transaction. - -Note that the messages are executed _depth-first_. This means if contract A -returns M1 (`WasmMsg::Execute`) and M2 (`BankMsg::Send`), and contract B (from -the `WasmMsg::Execute`) returns N1 and N2 (eg. `StakingMsg` and -`DistributionMsg`), the order of execution would be **M1, N1, N2, M2**. - -This may be hard to understand at first. "Why can't I just call another -contract?", you may ask. However, we do this to prevent one of most widespread -and hardest to detect security holes in Ethereum contracts - reentrancy. We do -this by following the actor model, which doesn't nest function calls, but -returns messages that will be executed later. This means all state that is -carried over between one call and the next happens in storage and not in memory. -For more information on this design, I recommend you read -[our docs on the Actor Model](https://docs.cosmwasm.com/docs/1.0/architecture/actor). - -### Submessages - -As of CosmWasm 0.14 (April 2021), we have added yet one more way to dispatch -calls from the contract. A common request was the ability to get the result from -one of the messages you dispatched. For example, you want to create a new -contract with `WasmMsg::Instantiate`, but then you need to store the address of -the newly created contract in the caller. With `submessages`, this is now -possible. It also solves a similar use-case of capturing the error results, so -if you execute a message from eg. a cron contract, it can store the error -message and mark the message as run, rather than aborting the whole transaction. -It also allows for limiting the gas usage of the submessage (this is not -intended to be used for most cases, but is needed for eg. the cron job to -protect it from an infinite loop in the submessage burning all gas and aborting -the transaction). - -This makes use of `CosmosMsg` as above, but it wraps it inside a `SubMsg` -envelope: - -```rust -pub struct SubMsg -where - T: Clone + fmt::Debug + PartialEq + JsonSchema, -{ - pub id: u64, - pub msg: CosmosMsg, - pub gas_limit: Option, - pub reply_on: ReplyOn, -} - -pub enum ReplyOn { - /// Always perform a callback after SubMsg is processed - Always, - /// Only callback if SubMsg returned an error, no callback on success case - Error, - /// Only callback if SubMsg was successful, no callback on error case - Success, -} -``` - -What are the semantics of a submessage execution. First, we create a -sub-transaction context around the state, allowing it to read the latest state -written by the caller, but write to yet-another cache. If `gas_limit` is set, it -is sandboxed to how much gas it can use until it aborts with `OutOfGasError`. -This error is caught and returned to the caller like any other error returned -from contract execution (unless it burned the entire gas limit of the -transaction). What is more interesting is what happens on completion. - -If it return success, the temporary state is committed (into the caller's -cache), and the `Response` is processed as normal (an event is added to the -current EventManager, messages and submessages are executed). Once the -`Response` is fully processed, this may then be intercepted by the calling -contract (for `ReplyOn::Always` and `ReplyOn::Success`). On an error, the -subcall will revert any partial state changes due to this message, but not -revert any state changes in the calling contract. The error may then be -intercepted by the calling contract (for `ReplyOn::Always` and -`ReplyOn::Error`). _In this case, the messages error doesn't abort the whole -transaction_ - -Note, that error doesn't abort the whole transaction _if and only if_ the -`reply` is called - so in case of `ReplyOn::Always` and `ReplyOn::Error`. If the -submessage is called with `ReplyOn::Success` (or `ReplyOn::Never`, which makes -it effectively a normal message), the error in subsequent call would result in -failing whole transaction and not commit the changes for it. The rule here is as -follows: if for any reason you want your message handling to succeed on -submessage failure, you always have to reply on failure. - -Obviously - on the successful processing of sub-message, if the reply is not -called (in particular `ReplyOn::Error`), the whole transaction is assumed to -succeed, and is committed. - -#### Handling the Reply - -In order to make use of `submessages`, the calling contract must have an extra -entry point: - -```rust -#[entry_point] -pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result { } - -pub struct Reply { - pub id: u64, - /// ContractResult is just a nicely serializable version of `Result` - pub result: ContractResult, -} - -pub struct SubcallResponse { - pub events: Vec, - pub data: Option, -} -``` - -After the `submessage` is finished, the caller will get a chance to handle the -result. It will get the original `id` of the subcall so it can switch on how to -process this, and the `Result` of the execution, both success and error. Note -that it includes all events returned by the submessage, which applies to native -sdk modules as well (like Bank) as well as the data returned from below. This -and the original call id provide all context to continue processing it. If you -need more state, you must save some local context to the store (under the `id`) -before returning the `submessage` in the original `execute`, and load it in -`reply`. We explicitly prohibit passing information in contract memory, as that -is the key vector for reentrancy attacks, which are a large security surface -area in Ethereum. - -The `reply` call may return `Err` itself, in which case it is treated like the -caller errored, and aborting the transaction. However, on successful processing, -`reply` may return a normal `Response`, which will be processed as normal - -events added to the EventManager, and all `messages` and `submessages` -dispatched as described above. - -The one _critical difference_ with `reply`, is that we _do not drop data_. If -`reply` returns `data: Some(value)` in the `Response` object, we will overwrite -the `data` field returned by the caller. That is, if `execute` returns -`data: Some(b"first thought")` and the `reply` (with all the extra information -it is privy to) returns `data: Some(b"better idea")`, then this will be returned -to the caller of `execute` (either the client or another transaction), just as -if the original `execute` and returned `data: Some(b"better idea")`. If `reply` -returns `data: None`, it will not modify any previously set data state. If there -are multiple submessages all setting this, only the last one is used (they all -overwrite any previous `data` value). As a consequence, you can use -`data: Some(b"")` to clear previously set data. This will be represented as a -JSON string instead of `null` and handled as any other `Some` value. - -#### Order and Rollback - -Submessages (and their replies) are all executed before any `messages`. They -also follow the _depth first_ rules as with `messages`. Here is a simple -example. Contract A returns submessages S1 and S2, and message M1. Submessage S1 -returns message N1. The order will be: **S1, N1, reply(S1), S2, reply(S2), M1** - -Please keep in mind that submessage `execution` and `reply` can happen within -the context of another submessage. For example -`contract-A--submessage --> contract-B--submessage --> contract-C`. Then -`contract-B` can revert the state for `contract-C` and itself by returning `Err` -in the submessage `reply`, but not revert contract-A or the entire transaction. -It just ends up returning `Err` to contract-A's `reply` function. - -Note that errors are not handled with `ReplyOn::Success`, meaning, in such a -case, an error will be treated just like a normal `message` returning an error. -This diagram may help explain. Imagine a contract returned two submesssage - (a) -with `ReplyOn::Success` and (b) with `ReplyOn::Error`: - -| processing a) | processing b) | reply called | may overwrite result from reply | note | -| ------------- | ------------- | ------------ | ------------------------------- | ------------------------------------------------- | -| ok | ok | a) | a) | returns success | -| err | err | none | none | returns error (abort parent transaction) | -| err | ok | none | none | returns error (abort parent transaction) | -| ok | err | a)b) | a)b) | if both a) and b) overwrite, only b) will be used | - -## Query Semantics - -Until now, we have focused on the `Response` object, which allows us to execute -code in other contracts via the actor model. That is, each contract is run -sequentially, one after another, and no nested calls are possible. This is -essential to avoid reentrancy, which is when calling into another contract can -change my state while I am in the middle of a transaction. - -However, there are many times we need access to information from other contracts -in the middle of processing, such as determining the contract's bank balance -before sending funds. To enable this, we have exposed the _read only_ `Querier` -to enable _synchronous_ calls in the middle of the execution. By making it -read-only (and enforcing that in the VM level), we can prevent the possibility -of reentrancy, as the query cannot modify any state or execute our contract. - -When we "make a query", we serialize a -[`QueryRequest` struct](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta4/packages/std/src/query/mod.rs#L27-L48) -that represents all possible calls, and then pass that over FFI to the runtime, -where it is interpretted in the `x/wasm` SDK module. This is extensible with -blockchain-specific custom queries just like `CosmosMsg` accepts custom results. -Also note the ability to perform raw protobuf "Stargate" queries: - -```rust -pub enum QueryRequest { - Bank(BankQuery), - Custom(C), - Staking(StakingQuery), - Stargate { - /// this is the fully qualified service path used for routing, - /// eg. custom/cosmos_sdk.x.bank.v1.Query/QueryBalance - path: String, - /// this is the expected protobuf message type (not any), binary encoded - data: Binary, - }, - Ibc(IbcQuery), - Wasm(WasmQuery), -} -``` - -While this is flexible and needed encoding for the cross-language -representation, this is a bit of mouthful to generate and use when I just want -to find my bank balance. To help that, we often use -[`QuerierWrapper`](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta4/packages/std/src/traits.rs#L148-L314), -which wraps a `Querier` and exposes a lot of convenience methods that just use -`QueryRequest` and `Querier.raw_query` under the hood. - -You can read a longer explanation of the -[`Querier` design in our docs](https://docs.cosmwasm.com/0.13/architecture/query.html). +- [Semantics](https://docs.cosmwasm.com/core/architecture/semantics) +- [Transactions](https://docs.cosmwasm.com/core/architecture/transactions) +- [Reply](https://docs.cosmwasm.com/core/entrypoints/reply) diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000000..0fc7def1dd --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,240 @@ +version: '3' + +silent: true + +vars: + COSMWASM_CHECK_VERSION: 3.0.2 + TOOLCHAIN: +1.88.0 + +tasks: + + all: + desc: Runs all checks + summary: | + Runs all viable checks for cosmwasm. + Execute this task before pushing any changes. + This task takes a significant amount of time to complete. + cmds: + - task: clean + + build: + desc: Build all crates + cmds: + - cmd: cargo {{.TOOLCHAIN}} build --workspace + + build-cw-schema: + desc: Build cw-schema + cmds: + - cmd: cargo {{.TOOLCHAIN}} build -p cw-schema + + check-contracts: + desc: Performs checks for all contracts + cmds: + - task: install-cosmwasm-check + - cmd: ./devtools/check-contracts.sh + + check-contracts-parallel: + desc: Performs checks in parallel for all contracts + cmds: + - task: install-cosmwasm-check + - cmd: ./devtools/check-contracts.sh parallel + + check-contracts-fast: + desc: Performs checks for all contracts without reinstalling cosmwasm-check tool + cmds: + - cmd: ./devtools/check-contracts.sh + + check-contracts-fast-parallel: + desc: Performs checks in parallel for all contracts without reinstalling cosmwasm-check tool + cmds: + - cmd: ./devtools/check-contracts.sh parallel + + clean: + desc: Removes compiled artifacts for crates + cmds: + - cmd: cargo clean + + clean-all: + desc: Removes all compiled artifacts (crates and contracts) + cmds: + - task: clean + - cmd: ./devtools/clean-contracts.sh + + cov: + desc: Generates code coverage report for all crates in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo {{.TOOLCHAIN}} llvm-cov --workspace --no-cfg-coverage + + cov-cosmwasm-check: + desc: Generates code coverage report for cosmwasm-check in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo {{.TOOLCHAIN}} llvm-cov -p cosmwasm-check --no-cfg-coverage + + cov-badge-cosmwasm-check: + desc: Generates the detailed code coverage badge for cosmwasm-check + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo {{.TOOLCHAIN}} llvm-cov --no-cfg-coverage -p cosmwasm-check --json --summary-only | coverio + + cov-cosmwasm-core: + desc: Generates code coverage report for cosmwasm-core in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cosmwasm-core --no-cfg-coverage + + cov-badge-cosmwasm-core: + desc: Generates the detailed code coverage badge for cosmwasm-core + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cosmwasm-core --json --summary-only | coverio + + cov-cosmwasm-crypto: + desc: Generates code coverage report for cosmwasm-crypto in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cosmwasm-crypto --no-cfg-coverage + + cov-badge-cosmwasm-crypto: + desc: Generates the detailed code coverage badge for cosmwasm-crypto + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cosmwasm-crypto --json --summary-only | coverio + + cov-cw-schema: + desc: Generates code coverage report for cw-schema in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cw-schema --no-cfg-coverage + + cov-badge-cw-schema: + desc: Generates the detailed code coverage badge for cw-schema + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cw-schema --json --summary-only | coverio + + cov-cw-schema-derive: + desc: Generates code coverage report for cw-schema-derive in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cw-schema-derive --no-cfg-coverage + + cov-badge-cw-schema-derive: + desc: Generates the detailed code coverage badge for cw-schema-derive + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cw-schema-derive --json --summary-only | coverio + + cov-cosmwasm-derive: + desc: Generates code coverage report for cosmwasm-derive in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cosmwasm-derive --no-cfg-coverage + + cov-badge-cosmwasm-derive: + desc: Generates the detailed code coverage badge for cosmwasm-derive + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cosmwasm-derive --json --summary-only | coverio + + cov-go-gen: + desc: Generates code coverage report for go-gen in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo {{.TOOLCHAIN}} llvm-cov -p go-gen --no-cfg-coverage + + cov-badge-go-gen: + desc: Generates the detailed code coverage badge for go-gen + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo {{.TOOLCHAIN}} llvm-cov --no-cfg-coverage -p go-gen --json --summary-only | coverio + + cov-cosmwasm-schema: + desc: Generates code coverage report for cosmwasm-schema in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cosmwasm-schema --no-cfg-coverage + + cov-badge-cosmwasm-schema: + desc: Generates the detailed code coverage badge for cosmwasm-schema + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cosmwasm-schema --json --summary-only | coverio + + cov-cosmwasm-schema-derive: + desc: Generates code coverage report for cosmwasm-schema-derive in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cosmwasm-schema-derive --no-cfg-coverage + + cov-badge-cosmwasm-schema-derive: + desc: Generates the detailed code coverage badge for cosmwasm-schema-derive + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cosmwasm-schema-derive --json --summary-only | coverio + + cov-cosmwasm-std: + desc: Generates code coverage report for cosmwasm-std in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cosmwasm-std --no-cfg-coverage + + cov-badge-cosmwasm-std: + desc: Generates the detailed code coverage badge for cosmwasm-std + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cosmwasm-std --json --summary-only | coverio + + cov-cosmwasm-vm: + desc: Generates code coverage report for cosmwasm-vm in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cosmwasm-vm --no-cfg-coverage + + cov-badge-cosmwasm-vm: + desc: Generates the detailed code coverage badge for cosmwasm-vm + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cosmwasm-vm --json --summary-only | coverio + + cov-cosmwasm-vm-derive: + desc: Generates code coverage report for cosmwasm-vm-derive in text format + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov -p cosmwasm-vm-derive --no-cfg-coverage + + cov-badge-cosmwasm-vm-derive: + desc: Generates the detailed code coverage badge for cosmwasm-vm-derive + cmds: + - cmd: cargo llvm-cov clean + - cmd: cargo +1.82.0 llvm-cov --no-cfg-coverage -p cosmwasm-vm-derive --json --summary-only | coverio + + install-cosmwasm-check: + desc: Installs cosmwasm-check tool (released version and currently developed version) + cmds: + # Install recently released cosmwasm-check and rename it to cosmwasm-check-release + - cmd: cargo {{.TOOLCHAIN}} install cosmwasm-check@{{.COSMWASM_CHECK_VERSION}} --locked --force + - cmd: mv ~/.cargo/bin/cosmwasm-check ~/.cargo/bin/cosmwasm-check-release + # Install currently developed version of cosmwasm-check + - cmd: cargo {{.TOOLCHAIN}} install --path ./packages/check --locked --force + + test: + desc: Runs all tests + cmds: + - cmd: cargo {{.TOOLCHAIN}} test --workspace + + test-cosmwasm-core: + desc: Runs tests for cosmwasm-core + cmds: + - cmd: cargo {{.TOOLCHAIN}} test -p cosmwasm-core + + test-cw-schema: + desc: Runs tests for cw-schema + cmds: + - cmd: cargo {{.TOOLCHAIN}} test -p cw-schema + + update-schemas: + desc: Updates schemas for all contracts + cmds: + - cmd: ./devtools/update-schemas.sh diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index b1de3c37b8..0000000000 --- a/codecov.yml +++ /dev/null @@ -1,35 +0,0 @@ -comment: false - -coverage: - status: - project: - default: - threshold: 0.05% - patch: - default: - threshold: 0.05% - -ignore: - - "contracts" - # Disabled due to "cargo_tarpaulin: Failed to get test coverage! Error: Failed to run tests: Error running test - SIGILL raised in 5835" - - "packages/vm" - -flags: - cosmwasm-crypto: - paths: - - packages/crypto/ - cosmwasm-derive: - paths: - - packages/derive/ - cosmwasm-schema: - paths: - - packages/schema/ - cosmwasm-schema-derive: - paths: - - packages/schema-derive/ - cosmwasm-std: - paths: - - packages/std/ - cosmwasm-storage: - paths: - - packages/storage/ diff --git a/contracts/README.md b/contracts/README.md index 30e1103c01..74e6a7c1cc 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -2,12 +2,49 @@ Those contracts are made for development purpose only. For more realistic example contracts, see -[cosmwasm-examples](https://github.com/CosmWasm/cosmwasm-examples). +[cw-plus](https://github.com/CosmWasm/cw-plus/tree/main/contracts). + +## The contracts + +Introducing the development contracts in the order they were created. + +1. **hackatom** is the very first development contract that was created at a + Cosmos Hackatom in Berlin in 2019, the event where CosmWasm was born. It is a + very basic escrow contract. During the years of CosmWasm development, many + more test cases were hacked into it. +2. **queue** shows and tests the newly added iterator support + ([#181](https://github.com/CosmWasm/cosmwasm/pull/181)). +3. **reflect** is an evolution of the + [mask contract](https://medium.com/cosmwasm/introducing-the-mask-41d11e51bccf), + which allows the user to send messages to the contract which are then emitted + with the contract as the sender. It later got support to handle sub messages + and replies ([#796](https://github.com/CosmWasm/cosmwasm/pull/796)). +4. **staking** is a staking derivatives example showing how the contract itself + can be a delegator. +5. **burner** shows how contract migrations work, which were added in CosmWasm + 0.9 ([#413](https://github.com/CosmWasm/cosmwasm/pull/413)). It shuts down + the contract my clearing all state and sending all tokens to a given address. +6. **ibc-reflect**/**ibc-reflect-send** are inspired by the idea of Interchain + Accounts and demonstrate the power of contract to contract IBC. + ibc-reflect-send receives a message on chain A and sends it to an ibc-reflect + instance on chain B where the message is executed. +7. **crypto-verify** shows how to use the CosmWasm crypto APIs for signature + verification ([#783](https://github.com/CosmWasm/cosmwasm/pull/783)). +8. **floaty** emits float operations when compiled to Wasm and allows us to test + how tooling and the runtime deal with those operations + ([#970](https://github.com/CosmWasm/cosmwasm/pull/970)). +9. **cyberpunk** is an attempt to cleanup hackatom and make writing runtime + tests (cosmwasm-vm/wamsmvm) easier by avoid the need for the escrow setup + that hackatom has. +10. **virus** is a contract that reproduces itself and does nothing useful + beyond that, showing how to use instantiate2 from a contract. +11. **empty** is an empty contract that does nothing. It is used to test that we + can store contracts with no entry points. ## Optimized builds Those development contracts are used for testing in other repos, e.g. in -[wasmvm](https://github.com/CosmWasm/wasmvm/tree/master/api/testdata) or +[wasmvm](https://github.com/CosmWasm/wasmvm/tree/main/testdata) or [cosmjs](https://github.com/cosmos/cosmjs/tree/main/scripts/wasmd/contracts). They are [built and deployed](https://github.com/CosmWasm/cosmwasm/releases) by @@ -15,50 +52,72 @@ the CI for every release tag. In case you need to build them manually for some reason, use the following commands: ```sh +# cd to the repo root first + +docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="devcontract_cache_burner",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/optimizer:0.15.0 ./contracts/burner + +docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="devcontract_cache_crypto_verify",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/optimizer:0.15.0 ./contracts/crypto-verify + +docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="devcontract_cache_cyberpunk",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/optimizer:0.15.0 ./contracts/cyberpunk + +docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="devcontract_cache_floaty",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/optimizer:0.15.0 ./contracts/floaty + docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_burner",target=/code/contracts/burner/target \ + --mount type=volume,source="devcontract_cache_hackatom",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/burner + cosmwasm/optimizer:0.15.0 ./contracts/hackatom docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_crypto_verify",target=/code/contracts/crypto-verify/target \ + --mount type=volume,source="devcontract_cache_ibc_reflect",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/crypto-verify + cosmwasm/optimizer:0.15.0 ./contracts/ibc-reflect docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_floaty",target=/code/contracts/floaty/target \ + --mount type=volume,source="devcontract_cache_ibc_reflect_send",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/floaty + cosmwasm/optimizer:0.15.0 ./contracts/ibc-reflect-send docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_hackatom",target=/code/contracts/hackatom/target \ + --mount type=volume,source="devcontract_cache_queue",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/hackatom + cosmwasm/optimizer:0.15.0 ./contracts/queue docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_ibc_reflect",target=/code/contracts/ibc-reflect/target \ + --mount type=volume,source="devcontract_cache_reflect",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/ibc-reflect + cosmwasm/optimizer:0.15.0 ./contracts/reflect docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_ibc_reflect_send",target=/code/contracts/ibc-reflect-send/target \ + --mount type=volume,source="devcontract_cache_staking",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/ibc-reflect-send + cosmwasm/optimizer:0.15.0 ./contracts/staking docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_queue",target=/code/contracts/queue/target \ + --mount type=volume,source="devcontract_cache_virus",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/queue + cosmwasm/optimizer:0.15.0 ./contracts/virus docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_reflect",target=/code/contracts/reflect/target \ + --mount type=volume,source="devcontract_cache_empty",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/reflect + cosmwasm/optimizer:0.15.0 ./contracts/empty docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_staking",target=/code/contracts/staking/target \ + --mount type=volume,source="devcontract_cache_ibc2",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/staking + cosmwasm/optimizer:0.15.0 ./contracts/ibc2 ``` ## Entry points @@ -74,3 +133,4 @@ points in order to demonstrate and test the flexibility we have. | queue | yes | yes | | reflect | yes | no | | staking | yes | no | +| virus | no | no | diff --git a/contracts/burner/.cargo/config b/contracts/burner/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/burner/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/burner/.cargo/config.toml b/contracts/burner/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/burner/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/burner/Cargo.lock b/contracts/burner/Cargo.lock index 9aa8268e05..50659ae272 100644 --- a/contracts/burner/Cargo.lock +++ b/contracts/burner/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,85 +17,274 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "base64ct" -version = "1.5.0" +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "burner" @@ -104,42 +293,84 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cosmwasm-vm", - "schemars", + "schemars 0.8.21", "serde", ] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] + +[[package]] +name = "bytecheck" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -147,55 +378,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -203,196 +473,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -409,22 +616,61 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cw-schema" +version = "3.0.3-dev" +dependencies = [ + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "darling" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ "darling_core", "darling_macro", @@ -432,75 +678,134 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.87", ] [[package]] name = "darling_macro" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "der" -version = "0.6.0" +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -508,13 +813,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -525,57 +830,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -598,46 +923,110 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -645,97 +1034,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -749,720 +1143,1305 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" - -[[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "wasm-bindgen", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "k256" -version = "0.11.3" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "loupe" -version = "0.1.3" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ + "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "mach" -version = "0.3.2" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "memchr" -version = "2.4.1" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ - "autocfg", + "equivalent", + "hashbrown 0.15.2", ] [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "adler", - "autocfg", + "hermit-abi", + "libc", + "windows-sys 0.59.0", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "hermit-abi", - "libc", + "either", ] [[package]] -name = "object" -version = "0.25.3" +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "memchr", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.28.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", ] [[package]] -name = "once_cell" -version = "1.8.0" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "libc" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] -name = "pin-project-lite" -version = "0.2.7" +name = "libloading" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] -name = "pkcs8" -version = "0.9.0" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "der", - "spki", + "bitflags 2.5.0", + "libc", + "redox_syscall", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "autocfg", + "scopeguard", ] [[package]] -name = "proc-macro2" -version = "1.0.27" +name = "log" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" -dependencies = [ - "unicode-xid", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "ptr_meta" -version = "0.1.4" +name = "mach2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ - "ptr_meta_derive", + "libc", ] [[package]] -name = "ptr_meta_derive" -version = "0.1.4" +name = "memchr" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] -name = "quote" -version = "1.0.9" +name = "memmap2" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ - "proc-macro2", + "libc", ] [[package]] -name = "rand" -version = "0.8.4" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ "libc", - "rand_chacha", - "rand_core 0.6.3", - "rand_hc", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "memoffset" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", + "autocfg", ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ - "getrandom 0.1.16", + "adler", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "miniz_oxide" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ - "getrandom 0.2.3", + "adler2", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" dependencies = [ - "rand_core 0.6.3", + "munge_macro", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "munge_macro" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "memchr", + "minimal-lexical", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "num-bigint" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "bitflags", + "num-integer", + "num-traits", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "num-traits", ] [[package]] -name = "region" -version = "3.0.0" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "autocfg", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "winapi", + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", ] [[package]] -name = "rend" -version = "0.3.6" +name = "object" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ - "bytecheck", + "memchr", ] [[package]] -name = "rfc6979" -version = "0.3.0" +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", + "supports-color 2.1.0", + "supports-color 3.0.2", ] [[package]] -name = "rkyv" -version = "0.7.36" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", ] [[package]] -name = "rkyv_derive" -version = "0.7.36" +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", ] [[package]] -name = "rustc-demangle" -version = "0.1.20" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "rustc-hash" -version = "1.1.0" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "rustversion" -version = "1.0.5" +name = "pin-project-lite" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "ryu" -version = "1.0.5" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "schemars" -version = "0.8.6" +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "schemars_derive" -version = "0.8.6" +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ + "proc-macro-error-attr", "proc-macro2", "quote", - "serde_derive_internals", - "syn", + "syn 1.0.109", + "version_check", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "proc-macro-error-attr" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] [[package]] -name = "sec1" -version = "0.3.0" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "serde" -version = "1.0.126" +name = "proc-macro2" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "serde_derive", + "unicode-ident", ] [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "ptr_meta" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "serde", + "ptr_meta_derive 0.1.4", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "ptr_meta" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" dependencies = [ - "serde", + "ptr_meta_derive 0.3.0", ] [[package]] -name = "serde_derive" -version = "1.0.126" +name = "ptr_meta_derive" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "serde_derive_internals" -version = "0.25.0" +name = "ptr_meta_derive" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "serde_json" -version = "1.0.64" +name = "quote" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "itoa", - "ryu", - "serde", + "proc-macro2", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "rancor" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "ptr_meta 0.3.0", ] [[package]] -name = "sha2" -version = "0.10.3" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "rand_chacha", + "rand_core", ] [[package]] -name = "signature" -version = "1.5.0" +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "ppv-lite86", + "rand_core", ] [[package]] -name = "smallvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" - -[[package]] -name = "spki" -version = "0.6.0" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "base64ct", - "der", + "getrandom", ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] [[package]] -name = "strsim" -version = "0.10.0" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] [[package]] -name = "subtle" -version = "2.4.1" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] [[package]] -name = "syn" -version = "1.0.73" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "syn 2.0.87", ] [[package]] -name = "target-lexicon" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" - -[[package]] -name = "tempfile" -version = "3.2.0" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "cfg-if", - "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "thiserror" -version = "1.0.26" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "thiserror-impl", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "regex-syntax" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "tracing" -version = "0.1.26" +name = "region" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" +dependencies = [ + "bytecheck 0.8.0", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ + "cc", "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" +dependencies = [ + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1470,71 +2449,126 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.15" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "twox-hash" +version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "lazy_static", + "cfg-if", + "static_assertions", ] +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + [[package]] name = "typenum" -version = "1.15.0" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "uint" -version = "0.9.3" +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] [[package]] -name = "version_check" -version = "0.9.3" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1542,24 +2576,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1567,113 +2601,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1683,252 +2699,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/burner/Cargo.toml b/contracts/burner/Cargo.toml index 93a74b7efe..f93b2becbf 100644 --- a/contracts/burner/Cargo.toml +++ b/contracts/burner/Cargo.toml @@ -1,13 +1,14 @@ [package] name = "burner" version = "0.0.0" -authors = ["Ethan Frey "] +authors = [ + "Ethan Frey ", + "Simon Warta ", +] edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -22,19 +23,10 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# for quicker tests, cargo test --lib -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = ["iterator"] } -schemars = "0.8.3" +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_1_4", "iterator"] } +schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] diff --git a/contracts/burner/LICENSE b/contracts/burner/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/contracts/burner/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/contracts/burner/NOTICE b/contracts/burner/NOTICE deleted file mode 100644 index b8f34a8f13..0000000000 --- a/contracts/burner/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2020 Ethan Frey - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/contracts/burner/schema/burner.json b/contracts/burner/schema/burner.json index 58e102e12e..10b6b3c68a 100644 --- a/contracts/burner/schema/burner.json +++ b/contracts/burner/schema/burner.json @@ -16,10 +16,26 @@ "title": "MigrateMsg", "type": "object", "required": [ + "denoms", "payout" ], "properties": { + "delete": { + "description": "Optional amount of items to delete in this call. If it is not provided, nothing will be deleted. You can delete further items in a subsequent execute call.", + "default": 0, + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "denoms": { + "description": "The denoms of the final payout. Balances of tokens not listed here will remain in the account untouched.", + "type": "array", + "items": { + "type": "string" + } + }, "payout": { + "description": "The address we send all remaining balance to. See denoms below for the denoms to consider.", "type": "string" } }, diff --git a/contracts/burner/schema/cw_schema/burner.json b/contracts/burner/schema/cw_schema/burner.json new file mode 100644 index 0000000000..f64dc6f693 --- /dev/null +++ b/contracts/burner/schema/cw_schema/burner.json @@ -0,0 +1,61 @@ +{ + "contract_name": "burner", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "burner_msg_InstantiateMsg", + "description": "A placeholder where we don't take any input", + "type": "struct", + "properties": {} + } + ] + }, + "execute": null, + "query": null, + "migrate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "burner_msg_MigrateMsg", + "type": "struct", + "properties": { + "delete": { + "defaulting": true, + "description": "Optional amount of items to delete in this call.\nIf it is not provided, nothing will be deleted.\nYou can delete further items in a subsequent execute call.", + "value": 3 + }, + "denoms": { + "description": "The denoms of the final payout. Balances of tokens not listed here\nwill remain in the account untouched.", + "value": 2 + }, + "payout": { + "description": "The address we send all remaining balance to. See denoms\nbelow for the denoms to consider.", + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] + }, + "sudo": null, + "responses": null +} diff --git a/contracts/burner/schema/cw_schema/raw/instantiate.json b/contracts/burner/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..0021e2f768 --- /dev/null +++ b/contracts/burner/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,12 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "burner_msg_InstantiateMsg", + "description": "A placeholder where we don't take any input", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/burner/schema/cw_schema/raw/migrate.json b/contracts/burner/schema/cw_schema/raw/migrate.json new file mode 100644 index 0000000000..47eb1fe952 --- /dev/null +++ b/contracts/burner/schema/cw_schema/raw/migrate.json @@ -0,0 +1,40 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "burner_msg_MigrateMsg", + "type": "struct", + "properties": { + "delete": { + "defaulting": true, + "description": "Optional amount of items to delete in this call.\nIf it is not provided, nothing will be deleted.\nYou can delete further items in a subsequent execute call.", + "value": 3 + }, + "denoms": { + "description": "The denoms of the final payout. Balances of tokens not listed here\nwill remain in the account untouched.", + "value": 2 + }, + "payout": { + "description": "The address we send all remaining balance to. See denoms\nbelow for the denoms to consider.", + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] +} diff --git a/contracts/burner/schema/raw/instantiate.json b/contracts/burner/schema/raw/instantiate.json new file mode 100644 index 0000000000..b055cda393 --- /dev/null +++ b/contracts/burner/schema/raw/instantiate.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "A placeholder where we don't take any input", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/burner/schema/raw/migrate.json b/contracts/burner/schema/raw/migrate.json new file mode 100644 index 0000000000..f4adeb0f87 --- /dev/null +++ b/contracts/burner/schema/raw/migrate.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "type": "object", + "required": [ + "denoms", + "payout" + ], + "properties": { + "delete": { + "description": "Optional amount of items to delete in this call. If it is not provided, nothing will be deleted. You can delete further items in a subsequent execute call.", + "default": 0, + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "denoms": { + "description": "The denoms of the final payout. Balances of tokens not listed here will remain in the account untouched.", + "type": "array", + "items": { + "type": "string" + } + }, + "payout": { + "description": "The address we send all remaining balance to. See denoms below for the denoms to consider.", + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/burner/examples/schema.rs b/contracts/burner/src/bin/schema.rs similarity index 100% rename from contracts/burner/examples/schema.rs rename to contracts/burner/src/bin/schema.rs diff --git a/contracts/burner/src/contract.rs b/contracts/burner/src/contract.rs index e486be5b18..64c148fbc5 100644 --- a/contracts/burner/src/contract.rs +++ b/contracts/burner/src/contract.rs @@ -1,8 +1,10 @@ use cosmwasm_std::{ - entry_point, BankMsg, DepsMut, Env, MessageInfo, Order, Response, StdError, StdResult, + entry_point, BankMsg, Coin, DepsMut, Env, MessageInfo, Order, Response, StdError, StdResult, + Storage, }; +use std::collections::BTreeSet; -use crate::msg::{InstantiateMsg, MigrateMsg}; +use crate::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg}; #[entry_point] pub fn instantiate( @@ -11,94 +13,250 @@ pub fn instantiate( _info: MessageInfo, _msg: InstantiateMsg, ) -> StdResult { - Err(StdError::generic_err( + Err(StdError::msg( "You can only use this contract for migrations", )) } #[entry_point] pub fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> StdResult { - // delete all state - let keys: Vec<_> = deps - .storage - .range(None, None, Order::Ascending) - .map(|(k, _)| k) - .collect(); - let count = keys.len(); - for k in keys { - deps.storage.remove(&k); + let denom_len = msg.denoms.len(); + let denoms = BTreeSet::::from_iter(msg.denoms); // Ensure uniqueness + if denoms.len() != denom_len { + return Err(StdError::msg("Denoms not unique")); + } + + // get balance and send to recipient + let mut balances = Vec::::with_capacity(denoms.len()); + for denom in denoms { + let balance = deps.querier.query_balance(&env.contract.address, denom)?; + balances.push(balance); } - // get balance and send all to recipient - let balance = deps.querier.query_all_balances(env.contract.address)?; let send = BankMsg::Send { to_address: msg.payout.clone(), - amount: balance, + amount: balances, }; - let data_msg = format!("burnt {} keys", count).into_bytes(); + let deleted = cleanup(deps.storage, msg.delete as usize); Ok(Response::new() .add_message(send) - .add_attribute("action", "burn") + .add_attribute("action", "migrate") .add_attribute("payout", msg.payout) - .set_data(data_msg)) + .add_attribute("deleted_entries", deleted.to_string())) +} + +#[entry_point] +pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> StdResult { + match msg { + ExecuteMsg::Cleanup { limit } => execute_cleanup(deps, env, info, limit), + } +} + +pub fn execute_cleanup( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + limit: Option, +) -> StdResult { + let limit = limit.unwrap_or(u32::MAX) as usize; + let deleted = cleanup(deps.storage, limit); + + Ok(Response::new() + .add_attribute("action", "cleanup") + .add_attribute("deleted_entries", deleted.to_string())) +} + +fn cleanup(storage: &mut dyn Storage, mut limit: usize) -> usize { + let mut deleted = 0; + const PER_SCAN: usize = 20; + loop { + let take_this_scan = std::cmp::min(PER_SCAN, limit); + let keys: Vec<_> = storage + .range_keys(None, None, Order::Ascending) + .take(take_this_scan) + .collect(); + let deleted_this_scan = keys.len(); + for k in keys { + storage.remove(&k); + } + deleted += deleted_this_scan; + // decrease the number of elements we can still take + limit -= deleted_this_scan; + if limit == 0 || deleted_this_scan < take_this_scan { + break; + } + } + + deleted } #[cfg(test)] mod tests { use super::*; use cosmwasm_std::testing::{ - mock_dependencies, mock_dependencies_with_balance, mock_env, mock_info, + message_info, mock_dependencies, mock_dependencies_with_balance, mock_env, }; - use cosmwasm_std::{coins, StdError, Storage, SubMsg}; + use cosmwasm_std::{coin, coins, Attribute, Storage, SubMsg}; + + /// Gets the value of the first attribute with the given key + fn first_attr(data: impl AsRef<[Attribute]>, search_key: &str) -> Option { + data.as_ref().iter().find_map(|a| { + if a.key == search_key { + Some(a.value.clone()) + } else { + None + } + }) + } #[test] fn instantiate_fails() { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make("creator"); + let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(1000, "earth")); + let info = message_info(&creator, &coins(1000, "earth")); // we can just call .unwrap() to assert this was a success let res = instantiate(deps.as_mut(), mock_env(), info, msg); - match res.unwrap_err() { - StdError::GenericErr { msg, .. } => { - assert_eq!(msg, "You can only use this contract for migrations") - } - _ => panic!("expected migrate error message"), - } + assert!(res + .unwrap_err() + .to_string() + .ends_with("You can only use this contract for migrations")); } #[test] - fn migrate_cleans_up_data() { - let mut deps = mock_dependencies_with_balance(&coins(123456, "gold")); + fn migrate_sends_one_balance() { + let initial_balance = vec![coin(123456, "gold"), coin(77, "silver")]; + let mut deps = mock_dependencies_with_balance(&initial_balance); + let payout = String::from("someone else"); - // store some sample data - deps.storage.set(b"foo", b"bar"); - deps.storage.set(b"key2", b"data2"); - deps.storage.set(b"key3", b"cool stuff"); - let cnt = deps.storage.range(None, None, Order::Ascending).count(); - assert_eq!(3, cnt); + // malformed denoms + let msg = MigrateMsg { + payout: payout.clone(), + denoms: vec!["gold".to_string(), "silver".to_string(), "gold".to_string()], + delete: 0, + }; + let err = migrate(deps.as_mut(), mock_env(), msg).unwrap_err(); + assert!(err.to_string().ends_with("Denoms not unique")); + + // One denom + let msg = MigrateMsg { + payout: payout.clone(), + denoms: vec!["gold".to_string()], + delete: 0, + }; + let res = migrate(deps.as_mut(), mock_env(), msg).unwrap(); + // check payout + assert_eq!(res.messages.len(), 1); + let msg = res.messages.first().expect("no message"); + assert_eq!( + msg, + &SubMsg::new(BankMsg::Send { + to_address: payout, + amount: coins(123456, "gold"), + }) + ); + } + + // as above but this time we want all gold and silver + #[test] + fn migrate_sends_two_balances() { + let initial_balance = vec![coin(123456, "gold"), coin(77, "silver")]; + let mut deps = mock_dependencies_with_balance(&initial_balance); // change the verifier via migrate let payout = String::from("someone else"); let msg = MigrateMsg { payout: payout.clone(), + denoms: vec!["silver".to_string(), "gold".to_string()], + delete: 0, }; let res = migrate(deps.as_mut(), mock_env(), msg).unwrap(); // check payout - assert_eq!(1, res.messages.len()); - let msg = res.messages.get(0).expect("no message"); + assert_eq!(res.messages.len(), 1); + let msg = res.messages.first().expect("no message"); assert_eq!( msg, &SubMsg::new(BankMsg::Send { to_address: payout, - amount: coins(123456, "gold"), + amount: vec![coin(123456, "gold"), coin(77, "silver")], }) ); + } + + #[test] + fn migrate_with_delete() { + let mut deps = mock_dependencies_with_balance(&coins(123456, "gold")); + + // store some sample data + deps.storage.set(b"foo", b"bar"); + deps.storage.set(b"key2", b"data2"); + deps.storage.set(b"key3", b"cool stuff"); + let cnt = deps.storage.range(None, None, Order::Ascending).count(); + assert_eq!(cnt, 3); + + // migrate all of the data in one go + let msg = MigrateMsg { + payout: "user".to_string(), + denoms: vec![], + delete: 100, + }; + migrate(deps.as_mut(), mock_env(), msg).unwrap(); + + // no more data + let cnt = deps.storage.range(None, None, Order::Ascending).count(); + assert_eq!(cnt, 0); + } + + #[test] + fn execute_cleans_up_data() { + let mut deps = mock_dependencies_with_balance(&coins(123456, "gold")); + + let anon = deps.api.addr_make("anon"); + + // store some sample data + deps.storage.set(b"foo", b"bar"); + deps.storage.set(b"key2", b"data2"); + deps.storage.set(b"key3", b"cool stuff"); + let cnt = deps.storage.range(None, None, Order::Ascending).count(); + assert_eq!(cnt, 3); + + // change the verifier via migrate + let payout = String::from("someone else"); + let msg = MigrateMsg { + payout, + denoms: vec![], + delete: 0, + }; + let _res = migrate(deps.as_mut(), mock_env(), msg).unwrap(); + + let res = execute( + deps.as_mut(), + mock_env(), + message_info(&anon, &[]), + ExecuteMsg::Cleanup { limit: Some(2) }, + ) + .unwrap(); + assert_eq!(first_attr(res.attributes, "deleted_entries").unwrap(), "2"); + + // One item should be left + let cnt = deps.storage.range(None, None, Order::Ascending).count(); + assert_eq!(cnt, 1); + + let res = execute( + deps.as_mut(), + mock_env(), + message_info(&anon, &[]), + ExecuteMsg::Cleanup { limit: Some(2) }, + ) + .unwrap(); + assert_eq!(first_attr(res.attributes, "deleted_entries").unwrap(), "1"); - // check there is no data in storage + // Now all are gone let cnt = deps.storage.range(None, None, Order::Ascending).count(); - assert_eq!(0, cnt); + assert_eq!(cnt, 0); } } diff --git a/contracts/burner/src/msg.rs b/contracts/burner/src/msg.rs index f948004231..a45552c461 100644 --- a/contracts/burner/src/msg.rs +++ b/contracts/burner/src/msg.rs @@ -2,9 +2,31 @@ use cosmwasm_schema::cw_serde; #[cw_serde] pub struct MigrateMsg { + /// The address we send all remaining balance to. See denoms + /// below for the denoms to consider. pub payout: String, + /// The denoms of the final payout. Balances of tokens not listed here + /// will remain in the account untouched. + pub denoms: Vec, + /// Optional amount of items to delete in this call. + /// If it is not provided, nothing will be deleted. + /// You can delete further items in a subsequent execute call. + #[serde(default)] + pub delete: u32, } /// A placeholder where we don't take any input #[cw_serde] pub struct InstantiateMsg {} + +#[cw_serde] +pub enum ExecuteMsg { + /// Cleans up the given number of state elements. + /// Call this multiple times to incrementally clean up state. + Cleanup { + /// The number of state elements to delete. + /// + /// Set this to None for unlimited cleanup (if your state is small or you are feeling YOLO) + limit: Option, + }, +} diff --git a/contracts/burner/tests/integration.rs b/contracts/burner/tests/integration.rs index 8f30c2cca7..8529cbf8e3 100644 --- a/contracts/burner/tests/integration.rs +++ b/contracts/burner/tests/integration.rs @@ -1,26 +1,11 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests. -//! 1. First copy them over verbatum, -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) - -use cosmwasm_std::{coins, BankMsg, ContractResult, Order, Response, SubMsg}; -use cosmwasm_vm::testing::{instantiate, migrate, mock_env, mock_info, mock_instance}; - -use burner::msg::{InstantiateMsg, MigrateMsg}; + +use cosmwasm_std::{coins, Attribute, BankMsg, ContractResult, Order, Response, SubMsg}; +use cosmwasm_vm::testing::{execute, instantiate, migrate, mock_env, mock_info, mock_instance}; + +use burner::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg}; use cosmwasm_vm::Storage; // This line will test the output of cargo wasm @@ -28,6 +13,17 @@ static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/bu // You can uncomment this line instead to test productionified build from rust-optimizer // static WASM: &[u8] = include_bytes!("../contract.wasm"); +/// Gets the value of the first attribute with the given key +fn first_attr(data: impl AsRef<[Attribute]>, search_key: &str) -> Option { + data.as_ref().iter().find_map(|a| { + if a.key == search_key { + Some(a.value.clone()) + } else { + None + } + }) +} + #[test] fn instantiate_fails() { let mut deps = mock_instance(WASM, &[]); @@ -39,35 +35,26 @@ fn instantiate_fails() { let msg = res.unwrap_err(); assert_eq!( msg, - "Generic error: You can only use this contract for migrations" + "kind: Other, error: You can only use this contract for migrations" ); } #[test] -fn migrate_cleans_up_data() { +fn migrate_sends_funds() { let mut deps = mock_instance(WASM, &coins(123456, "gold")); - // store some sample data - deps.with_storage(|storage| { - storage.set(b"foo", b"bar").0.unwrap(); - storage.set(b"key2", b"data2").0.unwrap(); - storage.set(b"key3", b"cool stuff").0.unwrap(); - let iter_id = storage.scan(None, None, Order::Ascending).0.unwrap(); - let cnt = storage.all(iter_id).0.unwrap().len(); - assert_eq!(3, cnt); - Ok(()) - }) - .unwrap(); - // change the verifier via migrate let payout = String::from("someone else"); + let msg = MigrateMsg { payout: payout.clone(), + denoms: vec!["gold".to_string()], + delete: 0, }; let res: Response = migrate(&mut deps, mock_env(), msg).unwrap(); // check payout assert_eq!(1, res.messages.len()); - let msg = res.messages.get(0).expect("no message"); + let msg = res.messages.first().expect("no message"); assert_eq!( msg, &SubMsg::new(BankMsg::Send { @@ -75,12 +62,65 @@ fn migrate_cleans_up_data() { amount: coins(123456, "gold"), }), ); +} + +#[test] +fn execute_cleans_up_data() { + let mut deps = mock_instance(WASM, &coins(123456, "gold")); + + // store some sample data + deps.with_storage(|storage| { + storage.set(b"foo", b"bar").0.unwrap(); + storage.set(b"key2", b"data2").0.unwrap(); + storage.set(b"key3", b"cool stuff").0.unwrap(); + let iter_id = storage.scan(None, None, Order::Ascending).0.unwrap(); + let cnt = storage.all(iter_id).0.unwrap().len(); + assert_eq!(cnt, 3); + Ok(()) + }) + .unwrap(); + + // change the verifier via migrate + let payout = String::from("someone else"); + let msg = MigrateMsg { + payout, + denoms: vec![], + delete: 0, + }; + let _res: Response = migrate(&mut deps, mock_env(), msg).unwrap(); + + let res: Response = execute( + &mut deps, + mock_env(), + mock_info("anon", &[]), + ExecuteMsg::Cleanup { limit: Some(2) }, + ) + .unwrap(); + assert_eq!(first_attr(res.attributes, "deleted_entries").unwrap(), "2"); + + // One item should be left + deps.with_storage(|storage| { + let iter_id = storage.scan(None, None, Order::Ascending).0.unwrap(); + let cnt = storage.all(iter_id).0.unwrap().len(); + assert_eq!(cnt, 1); + Ok(()) + }) + .unwrap(); + + let res: Response = execute( + &mut deps, + mock_env(), + mock_info("anon", &[]), + ExecuteMsg::Cleanup { limit: Some(2) }, + ) + .unwrap(); + assert_eq!(first_attr(res.attributes, "deleted_entries").unwrap(), "1"); // check there is no data in storage deps.with_storage(|storage| { let iter_id = storage.scan(None, None, Order::Ascending).0.unwrap(); let cnt = storage.all(iter_id).0.unwrap().len(); - assert_eq!(0, cnt); + assert_eq!(cnt, 0); Ok(()) }) .unwrap(); diff --git a/contracts/crypto-verify/.cargo/config b/contracts/crypto-verify/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/crypto-verify/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/crypto-verify/.cargo/config.toml b/contracts/crypto-verify/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/crypto-verify/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/crypto-verify/Cargo.lock b/contracts/crypto-verify/Cargo.lock index 89c1b0fa67..efd214fe17 100644 --- a/contracts/crypto-verify/Cargo.lock +++ b/contracts/crypto-verify/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,124 +17,355 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.5.0" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bech32" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.0.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -142,55 +373,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -198,204 +468,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -414,113 +613,212 @@ dependencies = [ name = "crypto-verify" version = "0.0.0" dependencies = [ + "base64", "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cosmwasm-vm", "hex", "hex-literal", + "p256", "rlp", - "schemars", + "schemars 0.8.21", "serde", - "sha2 0.10.3", + "sha2", "sha3", ] [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "darling" -version = "0.13.0" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "darling_core", - "darling_macro", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +name = "cw-schema" +version = "3.0.3-dev" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", "strsim", - "syn", + "syn 2.0.87", ] [[package]] name = "darling_macro" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -528,13 +826,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -545,57 +843,79 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", ] [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -618,46 +938,110 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -665,97 +1049,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -765,9 +1154,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e4590e13640f19f249fe3e4eca5113bc4289f2497710378190e7f4bd96f45b" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" @@ -775,226 +1164,510 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "k256" -version = "0.11.3" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "keccak" -version = "0.1.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libc" -version = "0.2.126" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cfg-if", - "winapi", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "log" -version = "0.4.14" +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "cfg-if", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ - "quote", - "syn", + "equivalent", + "hashbrown 0.15.2", ] [[package]] -name = "mach" -version = "0.3.2" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.59.0", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "memmap2" -version = "0.5.0" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "libc", + "either", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "autocfg", + "wasm-bindgen", ] [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "adler", - "autocfg", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ - "hermit-abi", + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", "libc", + "redox_syscall", ] [[package]] -name = "object" -version = "0.25.3" +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", ] [[package]] name = "object" -version = "0.28.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.11.2", + "flate2", + "hashbrown 0.14.5", "indexmap", "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.8.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] + +[[package]] +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pkcs8" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", @@ -1002,9 +1675,28 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.87", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro-error" @@ -1015,7 +1707,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1030,13 +1722,35 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1045,7 +1759,16 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "ptr_meta_derive", + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", ] [[package]] @@ -1056,28 +1779,46 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", "rand_chacha", - "rand_core 0.6.3", - "rand_hc", + "rand_core", ] [[package]] @@ -1087,162 +1828,208 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core", ] [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.1.16", + "getrandom", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "getrandom 0.2.3", + "either", + "rayon-core", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "rand_core 0.6.3", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "bitflags 2.5.0", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "ref-cast-impl", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ - "bitflags", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "region" -version = "3.0.0" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ - "winapi", + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", ] [[package]] name = "rend" -version = "0.3.6" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" dependencies = [ - "bytecheck", + "bytecheck 0.8.0", ] [[package]] name = "rfc6979" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", "rend", "rkyv_derive", - "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "rlp" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54369147e3e7796c9b885c7304db87ca3d09a0a98f72843d532868675bbfba8" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", "rustc-hex", ] +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1256,59 +2043,143 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schemars" -version = "0.8.6" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" dependencies = [ "dyn-clone", - "schemars_derive", + "ref-cast", + "schemars_derive 1.0.4", "serde", "serde_json", ] [[package]] name = "schemars_derive" -version = "0.8.6" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.87", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "schemars_derive" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", @@ -1319,120 +2190,164 @@ dependencies = [ ] [[package]] -name = "serde" -version = "1.0.126" +name = "self_cell" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ - "serde", + "serde_derive", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "serde-wasm-bindgen" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" dependencies = [ + "js-sys", "serde", + "wasm-bindgen", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_derive_internals" -version = "0.25.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "serde_with" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "sha2" -version = "0.10.3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "cpufeatures", + "digest", ] [[package]] name = "sha3" -version = "0.10.2" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a31480366ec990f395a61b7c08122d99bd40544fdb5abcfc1b06bb29994312c" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.3", + "digest", "keccak", ] +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signature" -version = "1.5.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "digest", + "rand_core", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "smallvec" -version = "1.6.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "spki" -version = "0.6.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -1452,147 +2367,285 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "target-lexicon" -version = "0.12.2" +name = "syn" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "tempfile" -version = "3.2.0" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1600,24 +2653,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1625,113 +2678,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1741,252 +2776,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/crypto-verify/Cargo.toml b/contracts/crypto-verify/Cargo.toml index 0661d6c484..bebf079d03 100644 --- a/contracts/crypto-verify/Cargo.toml +++ b/contracts/crypto-verify/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -22,26 +20,18 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# for quicker tests, cargo test --lib -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] +base64 = "0.22.0" cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = ["iterator"] } -cosmwasm-storage = { path = "../../packages/storage", features = ["iterator"] } +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_2_1", "iterator"] } hex = "0.4" +p256 = { version = "0.13.2", default-features = false, features = ["alloc", "ecdsa"] } rlp = "0.5" -schemars = "0.8.3" +schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } sha2 = "0.10" sha3 = "0.10" [dev-dependencies] cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } -hex-literal = "0.3.1" +hex-literal = "0.4.1" diff --git a/contracts/crypto-verify/schema/crypto-verify.json b/contracts/crypto-verify/schema/crypto-verify.json index aae5dd104b..728ed09898 100644 --- a/contracts/crypto-verify/schema/crypto-verify.json +++ b/contracts/crypto-verify/schema/crypto-verify.json @@ -59,7 +59,52 @@ "additionalProperties": false }, { - "description": "Ethereum text verification (compatible to the eth_sign RPC/web3 enpoint). This cannot be used to verify transaction.\n\nSee https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#sign", + "description": "Cosmos format (secp256r1 verification scheme).", + "type": "object", + "required": [ + "verify_secp256_r1_signature" + ], + "properties": { + "verify_secp256_r1_signature": { + "type": "object", + "required": [ + "message", + "public_key", + "signature" + ], + "properties": { + "message": { + "description": "Message to verify.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "public_key": { + "description": "Serialized compressed (33 bytes) or uncompressed (65 bytes) public key.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "Serialized signature. Cosmos format (64 bytes).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Ethereum text verification (compatible to the eth_sign RPC/web3 endpoint). This cannot be used to verify transaction.\n\nSee https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#sign", "type": "object", "required": [ "verify_ethereum_text" @@ -86,7 +131,7 @@ ] }, "signer_address": { - "description": "Signer address. This is matched case insensitive, so you can provide checksummed and non-checksummed addresses. Checksums are not validated.", + "description": "Signer address. This is matched case insensitive, so you can provide check-summed and non-check-summed addresses. Checksums are not validated.", "type": "string" } }, @@ -264,6 +309,191 @@ } }, "additionalProperties": false + }, + { + "description": "Webauthn component verification", + "type": "object", + "required": [ + "verify_webauthn" + ], + "properties": { + "verify_webauthn": { + "type": "object", + "required": [ + "authenticator_data", + "challenge", + "client_data_json", + "r", + "s", + "x", + "y" + ], + "properties": { + "authenticator_data": { + "description": "Authenticator data", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "challenge": { + "description": "Challenge value", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "client_data_json": { + "description": "Client data (JSON encoded)", + "type": "string" + }, + "r": { + "description": "r component of signature\n\nThe representation of this component is a big-endian encoded 256bit integer", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "s": { + "description": "s component of signature\n\nThe representation of this component is a big-endian encoded 256bit integer", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "x": { + "description": "X coordinate of public key point\n\nUntagged big-endian serialized byte sequence representing the X coordinate on the secp256r1 elliptic curve", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "y": { + "description": "Y coordinate of public key point\n\nUntagged big-endian serialized byte sequence representing the Y coordinate on the secp256r1 elliptic curve", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "BLS12-381 pairing equality verification (where the key is an element of G1)", + "type": "object", + "required": [ + "verify_bls12_pairing_equality_g1" + ], + "properties": { + "verify_bls12_pairing_equality_g1": { + "type": "object", + "required": [ + "dst", + "msg", + "pubkey", + "signature" + ], + "properties": { + "dst": { + "description": "The `dst` component used to hash the message to the curve", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "msg": { + "description": "The message that should be verified", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "pubkey": { + "description": "The public key point in its compressed format (element of G1)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "The signature point in its compressed format (element of G2)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "BLS12-381 pairing equality verification (where the key is an element of G2)", + "type": "object", + "required": [ + "verify_bls12_pairing_equality_g2" + ], + "properties": { + "verify_bls12_pairing_equality_g2": { + "type": "object", + "required": [ + "dst", + "msg", + "pubkey", + "signature" + ], + "properties": { + "dst": { + "description": "The `dst` component used to hash the message to the curve", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "msg": { + "description": "The message that should be verified", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "pubkey": { + "description": "The public key point in its compressed format (element of G2)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "The signature point in its compressed format (element of G1)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false } ], "definitions": { @@ -297,6 +527,34 @@ }, "additionalProperties": false }, + "verify_bls12_pairing_equality_g1": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "verify_bls12_pairing_equality_g2": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false + }, "verify_cosmos_signature": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "VerifyResponse", @@ -339,6 +597,20 @@ }, "additionalProperties": false }, + "verify_secp256_r1_signature": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false + }, "verify_tendermint_batch": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "VerifyResponse", @@ -366,6 +638,20 @@ } }, "additionalProperties": false + }, + "verify_webauthn": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false } } } diff --git a/contracts/crypto-verify/schema/cw_schema/crypto-verify.json b/contracts/crypto-verify/schema/cw_schema/crypto-verify.json new file mode 100644 index 0000000000..ca902142b9 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/crypto-verify.json @@ -0,0 +1,468 @@ +{ + "contract_name": "crypto-verify", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] + }, + "execute": null, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_QueryMsg", + "type": "enum", + "cases": { + "list_verification_schemes": { + "description": "Returns a list of supported verification schemes.\nNo pagination - this is a short list.", + "type": "named", + "properties": {} + }, + "verify_bls12_pairing_equality_g1": { + "description": "BLS12-381 pairing equality verification (where the key is an element of G1)", + "type": "named", + "properties": { + "dst": { + "description": "The `dst` component used to hash the message to the curve", + "value": 1 + }, + "msg": { + "description": "The message that should be verified", + "value": 1 + }, + "pubkey": { + "description": "The public key point in its compressed format (element of G1)", + "value": 1 + }, + "signature": { + "description": "The signature point in its compressed format (element of G2)", + "value": 1 + } + } + }, + "verify_bls12_pairing_equality_g2": { + "description": "BLS12-381 pairing equality verification (where the key is an element of G2)", + "type": "named", + "properties": { + "dst": { + "description": "The `dst` component used to hash the message to the curve", + "value": 1 + }, + "msg": { + "description": "The message that should be verified", + "value": 1 + }, + "pubkey": { + "description": "The public key point in its compressed format (element of G2)", + "value": 1 + }, + "signature": { + "description": "The signature point in its compressed format (element of G1)", + "value": 1 + } + } + }, + "verify_cosmos_signature": { + "description": "Cosmos format (secp256k1 verification scheme).", + "type": "named", + "properties": { + "message": { + "description": "Message to verify.", + "value": 1 + }, + "public_key": { + "description": "Serialized compressed (33 bytes) or uncompressed (65 bytes) public key.", + "value": 1 + }, + "signature": { + "description": "Serialized signature. Cosmos format (64 bytes).", + "value": 1 + } + } + }, + "verify_ethereum_text": { + "description": "Ethereum text verification (compatible to the eth_sign RPC/web3 endpoint).\nThis cannot be used to verify transaction.\n\nSee https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#sign", + "type": "named", + "properties": { + "message": { + "description": "Message to verify. This will be wrapped in the standard container\n`\"\\x19Ethereum Signed Message:\\n\" + len(message) + message` before verification.", + "value": 2 + }, + "signature": { + "description": "Serialized signature. Fixed length format (64 bytes `r` and `s` plus the one byte `v`).", + "value": 1 + }, + "signer_address": { + "description": "Signer address.\nThis is matched case insensitive, so you can provide check-summed and non-check-summed addresses. Checksums are not validated.", + "value": 2 + } + } + }, + "verify_ethereum_transaction": { + "type": "named", + "properties": { + "chain_id": { + "value": 3 + }, + "data": { + "value": 1 + }, + "from": { + "description": "Ethereum address in hex format (42 characters, starting with 0x)", + "value": 2 + }, + "gas_limit": { + "value": 4 + }, + "gas_price": { + "value": 4 + }, + "nonce": { + "value": 3 + }, + "r": { + "value": 1 + }, + "s": { + "value": 1 + }, + "to": { + "description": "Ethereum address in hex format (42 characters, starting with 0x)", + "value": 2 + }, + "v": { + "value": 3 + }, + "value": { + "value": 4 + } + } + }, + "verify_secp256_r1_signature": { + "description": "Cosmos format (secp256r1 verification scheme).", + "type": "named", + "properties": { + "message": { + "description": "Message to verify.", + "value": 1 + }, + "public_key": { + "description": "Serialized compressed (33 bytes) or uncompressed (65 bytes) public key.", + "value": 1 + }, + "signature": { + "description": "Serialized signature. Cosmos format (64 bytes).", + "value": 1 + } + } + }, + "verify_tendermint_batch": { + "description": "Tendermint format (batch ed25519 verification scheme).", + "type": "named", + "properties": { + "messages": { + "description": "Messages to verify.", + "value": 5 + }, + "public_keys": { + "description": "Serialized public keys. Tendermint format (32 bytes).", + "value": 5 + }, + "signatures": { + "description": "Serialized signatures. Tendermint format (64 bytes).", + "value": 5 + } + } + }, + "verify_tendermint_signature": { + "description": "Tendermint format (ed25519 verification scheme).", + "type": "named", + "properties": { + "message": { + "description": "Message to verify.", + "value": 1 + }, + "public_key": { + "description": "Serialized public key. Tendermint format (32 bytes).", + "value": 1 + }, + "signature": { + "description": "Serialized signature. Tendermint format (64 bytes).", + "value": 1 + } + } + }, + "verify_webauthn": { + "description": "Webauthn component verification", + "type": "named", + "properties": { + "authenticator_data": { + "description": "Authenticator data", + "value": 1 + }, + "challenge": { + "description": "Challenge value", + "value": 1 + }, + "client_data_json": { + "description": "Client data (JSON encoded)", + "value": 2 + }, + "r": { + "description": "r component of signature\n\nThe representation of this component is a big-endian encoded 256bit integer", + "value": 1 + }, + "s": { + "description": "s component of signature\n\nThe representation of this component is a big-endian encoded 256bit integer", + "value": 1 + }, + "x": { + "description": "X coordinate of public key point\n\nUntagged big-endian serialized byte sequence representing the X coordinate on the secp256r1 elliptic curve", + "value": 1 + }, + "y": { + "description": "Y coordinate of public key point\n\nUntagged big-endian serialized byte sequence representing the Y coordinate on the secp256r1 elliptic curve", + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "list_verification_schemes": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_ListVerificationsResponse", + "type": "struct", + "properties": { + "verification_schemes": { + "value": 2 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] + }, + "verify_bls12_pairing_equality_g1": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + }, + "verify_bls12_pairing_equality_g2": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + }, + "verify_cosmos_signature": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + }, + "verify_ethereum_text": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + }, + "verify_ethereum_transaction": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + }, + "verify_secp256_r1_signature": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + }, + "verify_tendermint_batch": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + }, + "verify_tendermint_signature": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + }, + "verify_webauthn": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] + } + } +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/instantiate.json b/contracts/crypto-verify/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..f2f2faf797 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,11 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/query.json b/contracts/crypto-verify/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..44bcfc02f4 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/query.json @@ -0,0 +1,252 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_QueryMsg", + "type": "enum", + "cases": { + "list_verification_schemes": { + "description": "Returns a list of supported verification schemes.\nNo pagination - this is a short list.", + "type": "named", + "properties": {} + }, + "verify_bls12_pairing_equality_g1": { + "description": "BLS12-381 pairing equality verification (where the key is an element of G1)", + "type": "named", + "properties": { + "dst": { + "description": "The `dst` component used to hash the message to the curve", + "value": 1 + }, + "msg": { + "description": "The message that should be verified", + "value": 1 + }, + "pubkey": { + "description": "The public key point in its compressed format (element of G1)", + "value": 1 + }, + "signature": { + "description": "The signature point in its compressed format (element of G2)", + "value": 1 + } + } + }, + "verify_bls12_pairing_equality_g2": { + "description": "BLS12-381 pairing equality verification (where the key is an element of G2)", + "type": "named", + "properties": { + "dst": { + "description": "The `dst` component used to hash the message to the curve", + "value": 1 + }, + "msg": { + "description": "The message that should be verified", + "value": 1 + }, + "pubkey": { + "description": "The public key point in its compressed format (element of G2)", + "value": 1 + }, + "signature": { + "description": "The signature point in its compressed format (element of G1)", + "value": 1 + } + } + }, + "verify_cosmos_signature": { + "description": "Cosmos format (secp256k1 verification scheme).", + "type": "named", + "properties": { + "message": { + "description": "Message to verify.", + "value": 1 + }, + "public_key": { + "description": "Serialized compressed (33 bytes) or uncompressed (65 bytes) public key.", + "value": 1 + }, + "signature": { + "description": "Serialized signature. Cosmos format (64 bytes).", + "value": 1 + } + } + }, + "verify_ethereum_text": { + "description": "Ethereum text verification (compatible to the eth_sign RPC/web3 endpoint).\nThis cannot be used to verify transaction.\n\nSee https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#sign", + "type": "named", + "properties": { + "message": { + "description": "Message to verify. This will be wrapped in the standard container\n`\"\\x19Ethereum Signed Message:\\n\" + len(message) + message` before verification.", + "value": 2 + }, + "signature": { + "description": "Serialized signature. Fixed length format (64 bytes `r` and `s` plus the one byte `v`).", + "value": 1 + }, + "signer_address": { + "description": "Signer address.\nThis is matched case insensitive, so you can provide check-summed and non-check-summed addresses. Checksums are not validated.", + "value": 2 + } + } + }, + "verify_ethereum_transaction": { + "type": "named", + "properties": { + "chain_id": { + "value": 3 + }, + "data": { + "value": 1 + }, + "from": { + "description": "Ethereum address in hex format (42 characters, starting with 0x)", + "value": 2 + }, + "gas_limit": { + "value": 4 + }, + "gas_price": { + "value": 4 + }, + "nonce": { + "value": 3 + }, + "r": { + "value": 1 + }, + "s": { + "value": 1 + }, + "to": { + "description": "Ethereum address in hex format (42 characters, starting with 0x)", + "value": 2 + }, + "v": { + "value": 3 + }, + "value": { + "value": 4 + } + } + }, + "verify_secp256_r1_signature": { + "description": "Cosmos format (secp256r1 verification scheme).", + "type": "named", + "properties": { + "message": { + "description": "Message to verify.", + "value": 1 + }, + "public_key": { + "description": "Serialized compressed (33 bytes) or uncompressed (65 bytes) public key.", + "value": 1 + }, + "signature": { + "description": "Serialized signature. Cosmos format (64 bytes).", + "value": 1 + } + } + }, + "verify_tendermint_batch": { + "description": "Tendermint format (batch ed25519 verification scheme).", + "type": "named", + "properties": { + "messages": { + "description": "Messages to verify.", + "value": 5 + }, + "public_keys": { + "description": "Serialized public keys. Tendermint format (32 bytes).", + "value": 5 + }, + "signatures": { + "description": "Serialized signatures. Tendermint format (64 bytes).", + "value": 5 + } + } + }, + "verify_tendermint_signature": { + "description": "Tendermint format (ed25519 verification scheme).", + "type": "named", + "properties": { + "message": { + "description": "Message to verify.", + "value": 1 + }, + "public_key": { + "description": "Serialized public key. Tendermint format (32 bytes).", + "value": 1 + }, + "signature": { + "description": "Serialized signature. Tendermint format (64 bytes).", + "value": 1 + } + } + }, + "verify_webauthn": { + "description": "Webauthn component verification", + "type": "named", + "properties": { + "authenticator_data": { + "description": "Authenticator data", + "value": 1 + }, + "challenge": { + "description": "Challenge value", + "value": 1 + }, + "client_data_json": { + "description": "Client data (JSON encoded)", + "value": 2 + }, + "r": { + "description": "r component of signature\n\nThe representation of this component is a big-endian encoded 256bit integer", + "value": 1 + }, + "s": { + "description": "s component of signature\n\nThe representation of this component is a big-endian encoded 256bit integer", + "value": 1 + }, + "x": { + "description": "X coordinate of public key point\n\nUntagged big-endian serialized byte sequence representing the X coordinate on the secp256r1 elliptic curve", + "value": 1 + }, + "y": { + "description": "Y coordinate of public key point\n\nUntagged big-endian serialized byte sequence representing the Y coordinate on the secp256r1 elliptic curve", + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_list_verification_schemes.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_list_verification_schemes.json new file mode 100644 index 0000000000..929bcc91e6 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_list_verification_schemes.json @@ -0,0 +1,24 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_ListVerificationsResponse", + "type": "struct", + "properties": { + "verification_schemes": { + "value": 2 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_bls12_pairing_equality_g1.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_bls12_pairing_equality_g1.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_bls12_pairing_equality_g1.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_bls12_pairing_equality_g2.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_bls12_pairing_equality_g2.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_bls12_pairing_equality_g2.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_cosmos_signature.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_cosmos_signature.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_cosmos_signature.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_ethereum_text.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_ethereum_text.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_ethereum_text.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_ethereum_transaction.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_ethereum_transaction.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_ethereum_transaction.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_secp256_r1_signature.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_secp256_r1_signature.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_secp256_r1_signature.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_tendermint_batch.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_tendermint_batch.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_tendermint_batch.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_tendermint_signature.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_tendermint_signature.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_tendermint_signature.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_webauthn.json b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_webauthn.json new file mode 100644 index 0000000000..59d861ae15 --- /dev/null +++ b/contracts/crypto-verify/schema/cw_schema/raw/response_to_verify_webauthn.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "crypto_verify_msg_VerifyResponse", + "type": "struct", + "properties": { + "verifies": { + "value": 1 + } + } + }, + { + "name": "bool", + "type": "boolean" + } + ] +} diff --git a/contracts/crypto-verify/schema/raw/instantiate.json b/contracts/crypto-verify/schema/raw/instantiate.json new file mode 100644 index 0000000000..1352613d57 --- /dev/null +++ b/contracts/crypto-verify/schema/raw/instantiate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/query.json b/contracts/crypto-verify/schema/raw/query.json new file mode 100644 index 0000000000..f71e68a751 --- /dev/null +++ b/contracts/crypto-verify/schema/raw/query.json @@ -0,0 +1,498 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Cosmos format (secp256k1 verification scheme).", + "type": "object", + "required": [ + "verify_cosmos_signature" + ], + "properties": { + "verify_cosmos_signature": { + "type": "object", + "required": [ + "message", + "public_key", + "signature" + ], + "properties": { + "message": { + "description": "Message to verify.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "public_key": { + "description": "Serialized compressed (33 bytes) or uncompressed (65 bytes) public key.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "Serialized signature. Cosmos format (64 bytes).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Cosmos format (secp256r1 verification scheme).", + "type": "object", + "required": [ + "verify_secp256_r1_signature" + ], + "properties": { + "verify_secp256_r1_signature": { + "type": "object", + "required": [ + "message", + "public_key", + "signature" + ], + "properties": { + "message": { + "description": "Message to verify.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "public_key": { + "description": "Serialized compressed (33 bytes) or uncompressed (65 bytes) public key.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "Serialized signature. Cosmos format (64 bytes).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Ethereum text verification (compatible to the eth_sign RPC/web3 endpoint). This cannot be used to verify transaction.\n\nSee https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#sign", + "type": "object", + "required": [ + "verify_ethereum_text" + ], + "properties": { + "verify_ethereum_text": { + "type": "object", + "required": [ + "message", + "signature", + "signer_address" + ], + "properties": { + "message": { + "description": "Message to verify. This will be wrapped in the standard container `\"\\x19Ethereum Signed Message:\\n\" + len(message) + message` before verification.", + "type": "string" + }, + "signature": { + "description": "Serialized signature. Fixed length format (64 bytes `r` and `s` plus the one byte `v`).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signer_address": { + "description": "Signer address. This is matched case insensitive, so you can provide check-summed and non-check-summed addresses. Checksums are not validated.", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "verify_ethereum_transaction" + ], + "properties": { + "verify_ethereum_transaction": { + "type": "object", + "required": [ + "chain_id", + "data", + "from", + "gas_limit", + "gas_price", + "nonce", + "r", + "s", + "to", + "v", + "value" + ], + "properties": { + "chain_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "data": { + "$ref": "#/definitions/Binary" + }, + "from": { + "description": "Ethereum address in hex format (42 characters, starting with 0x)", + "type": "string" + }, + "gas_limit": { + "$ref": "#/definitions/Uint128" + }, + "gas_price": { + "$ref": "#/definitions/Uint128" + }, + "nonce": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "r": { + "$ref": "#/definitions/Binary" + }, + "s": { + "$ref": "#/definitions/Binary" + }, + "to": { + "description": "Ethereum address in hex format (42 characters, starting with 0x)", + "type": "string" + }, + "v": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "value": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Tendermint format (ed25519 verification scheme).", + "type": "object", + "required": [ + "verify_tendermint_signature" + ], + "properties": { + "verify_tendermint_signature": { + "type": "object", + "required": [ + "message", + "public_key", + "signature" + ], + "properties": { + "message": { + "description": "Message to verify.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "public_key": { + "description": "Serialized public key. Tendermint format (32 bytes).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "Serialized signature. Tendermint format (64 bytes).", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Tendermint format (batch ed25519 verification scheme).", + "type": "object", + "required": [ + "verify_tendermint_batch" + ], + "properties": { + "verify_tendermint_batch": { + "type": "object", + "required": [ + "messages", + "public_keys", + "signatures" + ], + "properties": { + "messages": { + "description": "Messages to verify.", + "type": "array", + "items": { + "$ref": "#/definitions/Binary" + } + }, + "public_keys": { + "description": "Serialized public keys. Tendermint format (32 bytes).", + "type": "array", + "items": { + "$ref": "#/definitions/Binary" + } + }, + "signatures": { + "description": "Serialized signatures. Tendermint format (64 bytes).", + "type": "array", + "items": { + "$ref": "#/definitions/Binary" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns a list of supported verification schemes. No pagination - this is a short list.", + "type": "object", + "required": [ + "list_verification_schemes" + ], + "properties": { + "list_verification_schemes": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Webauthn component verification", + "type": "object", + "required": [ + "verify_webauthn" + ], + "properties": { + "verify_webauthn": { + "type": "object", + "required": [ + "authenticator_data", + "challenge", + "client_data_json", + "r", + "s", + "x", + "y" + ], + "properties": { + "authenticator_data": { + "description": "Authenticator data", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "challenge": { + "description": "Challenge value", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "client_data_json": { + "description": "Client data (JSON encoded)", + "type": "string" + }, + "r": { + "description": "r component of signature\n\nThe representation of this component is a big-endian encoded 256bit integer", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "s": { + "description": "s component of signature\n\nThe representation of this component is a big-endian encoded 256bit integer", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "x": { + "description": "X coordinate of public key point\n\nUntagged big-endian serialized byte sequence representing the X coordinate on the secp256r1 elliptic curve", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "y": { + "description": "Y coordinate of public key point\n\nUntagged big-endian serialized byte sequence representing the Y coordinate on the secp256r1 elliptic curve", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "BLS12-381 pairing equality verification (where the key is an element of G1)", + "type": "object", + "required": [ + "verify_bls12_pairing_equality_g1" + ], + "properties": { + "verify_bls12_pairing_equality_g1": { + "type": "object", + "required": [ + "dst", + "msg", + "pubkey", + "signature" + ], + "properties": { + "dst": { + "description": "The `dst` component used to hash the message to the curve", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "msg": { + "description": "The message that should be verified", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "pubkey": { + "description": "The public key point in its compressed format (element of G1)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "The signature point in its compressed format (element of G2)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "BLS12-381 pairing equality verification (where the key is an element of G2)", + "type": "object", + "required": [ + "verify_bls12_pairing_equality_g2" + ], + "properties": { + "verify_bls12_pairing_equality_g2": { + "type": "object", + "required": [ + "dst", + "msg", + "pubkey", + "signature" + ], + "properties": { + "dst": { + "description": "The `dst` component used to hash the message to the curve", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "msg": { + "description": "The message that should be verified", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "pubkey": { + "description": "The public key point in its compressed format (element of G2)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "signature": { + "description": "The signature point in its compressed format (element of G1)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/crypto-verify/schema/raw/response_to_list_verification_schemes.json b/contracts/crypto-verify/schema/raw/response_to_list_verification_schemes.json new file mode 100644 index 0000000000..26fa42ab41 --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_list_verification_schemes.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListVerificationsResponse", + "type": "object", + "required": [ + "verification_schemes" + ], + "properties": { + "verification_schemes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_bls12_pairing_equality_g1.json b/contracts/crypto-verify/schema/raw/response_to_verify_bls12_pairing_equality_g1.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_bls12_pairing_equality_g1.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_bls12_pairing_equality_g2.json b/contracts/crypto-verify/schema/raw/response_to_verify_bls12_pairing_equality_g2.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_bls12_pairing_equality_g2.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_cosmos_signature.json b/contracts/crypto-verify/schema/raw/response_to_verify_cosmos_signature.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_cosmos_signature.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_ethereum_text.json b/contracts/crypto-verify/schema/raw/response_to_verify_ethereum_text.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_ethereum_text.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_ethereum_transaction.json b/contracts/crypto-verify/schema/raw/response_to_verify_ethereum_transaction.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_ethereum_transaction.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_secp256_r1_signature.json b/contracts/crypto-verify/schema/raw/response_to_verify_secp256_r1_signature.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_secp256_r1_signature.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_tendermint_batch.json b/contracts/crypto-verify/schema/raw/response_to_verify_tendermint_batch.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_tendermint_batch.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_tendermint_signature.json b/contracts/crypto-verify/schema/raw/response_to_verify_tendermint_signature.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_tendermint_signature.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/schema/raw/response_to_verify_webauthn.json b/contracts/crypto-verify/schema/raw/response_to_verify_webauthn.json new file mode 100644 index 0000000000..a2cdc3461c --- /dev/null +++ b/contracts/crypto-verify/schema/raw/response_to_verify_webauthn.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifyResponse", + "type": "object", + "required": [ + "verifies" + ], + "properties": { + "verifies": { + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/contracts/crypto-verify/examples/schema.rs b/contracts/crypto-verify/src/bin/schema.rs similarity index 100% rename from contracts/crypto-verify/examples/schema.rs rename to contracts/crypto-verify/src/bin/schema.rs diff --git a/contracts/crypto-verify/src/bls12_381.rs b/contracts/crypto-verify/src/bls12_381.rs new file mode 100644 index 0000000000..93d7120ffe --- /dev/null +++ b/contracts/crypto-verify/src/bls12_381.rs @@ -0,0 +1,34 @@ +use cosmwasm_std::{Api, HashFunction, StdResult, BLS12_381_G1_GENERATOR, BLS12_381_G2_GENERATOR}; + +/// Signature verification with public key in G1 (e.g. drand classic mainnet, ETH2 block headers). +/// +/// See https://hackmd.io/@benjaminion/bls12-381#Verification. +pub fn verify_g1( + api: &dyn Api, + signature: &[u8], + pubkey: &[u8], + msg: &[u8], + dst: &[u8], +) -> StdResult { + // The H(m) from the docs + let msg_hash = api.bls12_381_hash_to_g2(HashFunction::Sha256, msg, dst)?; + api.bls12_381_pairing_equality(&BLS12_381_G1_GENERATOR, signature, pubkey, &msg_hash) + .map_err(Into::into) +} + +/// Signature verification with public key in G2 (e.g. drand Quicknet) +/// +/// See https://hackmd.io/@benjaminion/bls12-381#Verification in combination with +/// https://hackmd.io/@benjaminion/bls12-381#Swapping-G1-and-G2. +pub fn verify_g2( + api: &dyn Api, + signature: &[u8], + pubkey: &[u8], + msg: &[u8], + dst: &[u8], +) -> StdResult { + // The H(m) from the docs + let msg_hash = api.bls12_381_hash_to_g1(HashFunction::Sha256, msg, dst)?; + api.bls12_381_pairing_equality(signature, &BLS12_381_G2_GENERATOR, &msg_hash, pubkey) + .map_err(Into::into) +} diff --git a/contracts/crypto-verify/src/contract.rs b/contracts/crypto-verify/src/contract.rs index 17d11b8a70..bbf52308a2 100644 --- a/contracts/crypto-verify/src/contract.rs +++ b/contracts/crypto-verify/src/contract.rs @@ -1,5 +1,5 @@ use cosmwasm_std::{ - entry_point, to_binary, Binary, Deps, DepsMut, Env, MessageInfo, QueryResponse, Response, + entry_point, to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, QueryResponse, Response, StdError, StdResult, Uint128, }; use sha2::{Digest, Sha256}; @@ -32,17 +32,27 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { message, signature, public_key, - } => to_binary(&query_verify_cosmos( + } => to_json_binary(&query_verify_cosmos( deps, - &message.0, - &signature.0, - &public_key.0, + message.as_slice(), + signature.as_slice(), + public_key.as_slice(), + )?), + QueryMsg::VerifySecp256R1Signature { + message, + signature, + public_key, + } => to_json_binary(&query_verify_secp256r1( + deps, + message.as_slice(), + signature.as_slice(), + public_key.as_slice(), )?), QueryMsg::VerifyEthereumText { message, signature, signer_address, - } => to_binary(&query_verify_ethereum_text( + } => to_json_binary(&query_verify_ethereum_text( deps, &message, &signature, @@ -60,30 +70,64 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { r, s, v, - } => to_binary(&query_verify_ethereum_transaction( + } => to_json_binary(&query_verify_ethereum_transaction( deps, from, to, nonce, gas_limit, gas_price, value, data, chain_id, r, s, v, )?), QueryMsg::VerifyTendermintSignature { message, signature, public_key, - } => to_binary(&query_verify_tendermint( + } => to_json_binary(&query_verify_tendermint( deps, - &message.0, - &signature.0, - &public_key.0, + message.as_slice(), + signature.as_slice(), + public_key.as_slice(), )?), QueryMsg::VerifyTendermintBatch { messages, signatures, public_keys, - } => to_binary(&query_verify_tendermint_batch( + } => to_json_binary(&query_verify_tendermint_batch( deps, &messages, &signatures, &public_keys, )?), - QueryMsg::ListVerificationSchemes {} => to_binary(&query_list_verifications(deps)?), + QueryMsg::ListVerificationSchemes {} => to_json_binary(&query_list_verifications(deps)?), + QueryMsg::VerifyWebauthn { + authenticator_data, + client_data_json, + challenge, + x, + y, + r, + s, + } => to_json_binary(&query_verify_webauthn( + deps, + &authenticator_data, + &client_data_json, + &challenge, + &x, + &y, + &r, + &s, + )?), + QueryMsg::VerifyBls12PairingEqualityG1 { + signature, + pubkey, + msg, + dst, + } => to_json_binary(&query_verify_bls12_pairing_g1( + deps, &signature, &pubkey, &msg, &dst, + )?), + QueryMsg::VerifyBls12PairingEqualityG2 { + signature, + pubkey, + msg, + dst, + } => to_json_binary(&query_verify_bls12_pairing_g2( + deps, &signature, &pubkey, &msg, &dst, + )?), } } @@ -106,6 +150,49 @@ pub fn query_verify_cosmos( } } +pub fn query_verify_secp256r1( + deps: Deps, + message: &[u8], + signature: &[u8], + public_key: &[u8], +) -> StdResult { + // Hashing + let hash = Sha256::digest(message); + + // Verification + let result = deps + .api + .secp256r1_verify(hash.as_ref(), signature, public_key); + match result { + Ok(verifies) => Ok(VerifyResponse { verifies }), + Err(err) => Err(err.into()), + } +} + +#[allow(clippy::too_many_arguments)] +pub fn query_verify_webauthn( + deps: Deps, + authenticator_data: &[u8], + client_data_json: &str, + challenge: &[u8], + x: &[u8], + y: &[u8], + r: &[u8], + s: &[u8], +) -> StdResult { + let verifies = crate::webauthn::verify( + deps.api, + authenticator_data, + client_data_json, + challenge, + x, + y, + r, + s, + )?; + Ok(VerifyResponse { verifies }) +} + pub fn query_verify_ethereum_text( deps: Deps, message: &str, @@ -123,7 +210,7 @@ pub fn query_verify_ethereum_text( // Decompose signature let (v, rs) = match signature.split_last() { Some(pair) => pair, - None => return Err(StdError::generic_err("Signature must not be empty")), + None => return Err(StdError::msg("Signature must not be empty")), }; let recovery = get_recovery_param(*v)?; @@ -211,15 +298,35 @@ pub fn query_list_verifications(deps: Deps) -> StdResult StdResult { + let verifies = crate::bls12_381::verify_g1(deps.api, signature, pubkey, msg, dst)?; + Ok(VerifyResponse { verifies }) +} + +pub fn query_verify_bls12_pairing_g2( + deps: Deps, + signature: &[u8], + pubkey: &[u8], + msg: &[u8], + dst: &[u8], +) -> StdResult { + let verifies = crate::bls12_381::verify_g2(deps.api, signature, pubkey, msg, dst)?; + Ok(VerifyResponse { verifies }) +} + #[cfg(test)] mod tests { use super::*; use cosmwasm_std::testing::{ - mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage, - }; - use cosmwasm_std::{ - from_slice, Binary, OwnedDeps, RecoverPubkeyError, StdError, VerificationError, + message_info, mock_dependencies, mock_env, MockApi, MockQuerier, MockStorage, }; + use cosmwasm_std::{from_json, OwnedDeps, StdErrorKind}; use hex_literal::hex; const CREATOR: &str = "creator"; @@ -247,8 +354,9 @@ mod tests { fn setup() -> OwnedDeps { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make(CREATOR); let msg = InstantiateMsg {}; - let info = mock_info(CREATOR, &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(0, res.messages.len()); deps @@ -268,13 +376,13 @@ mod tests { let public_key = hex::decode(SECP256K1_PUBLIC_KEY_HEX).unwrap(); let verify_msg = QueryMsg::VerifyCosmosSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: true }); } @@ -290,13 +398,13 @@ mod tests { let public_key = hex::decode(SECP256K1_PUBLIC_KEY_HEX).unwrap(); let verify_msg = QueryMsg::VerifyCosmosSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: false }); } @@ -310,19 +418,17 @@ mod tests { let public_key = vec![]; let verify_msg = QueryMsg::VerifyCosmosSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let res = query(deps.as_ref(), mock_env(), verify_msg); assert!(res.is_err()); - assert_eq!( - res.unwrap_err(), - StdError::VerificationErr { - source: VerificationError::InvalidPubkeyFormat - } - ) + assert!(matches!( + res.unwrap_err().kind(), + StdErrorKind::Cryptography, + )) } #[test] @@ -339,7 +445,7 @@ mod tests { signer_address: signer_address.into(), }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: true }); } @@ -360,7 +466,7 @@ mod tests { }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: false }); } @@ -380,7 +486,7 @@ mod tests { signer_address: signer_address.into(), }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: false }); // Broken signature @@ -391,12 +497,9 @@ mod tests { signer_address: signer_address.into(), }; let result = query(deps.as_ref(), mock_env(), verify_msg); - match result.unwrap_err() { - StdError::RecoverPubkeyErr { - source: RecoverPubkeyError::UnknownErr { .. }, - .. - } => {} - err => panic!("Unexpected error: {:?}", err), + match result.unwrap_err().kind() { + StdErrorKind::Cryptography => {} + err => panic!("Unexpected error: {err:?}"), } } @@ -447,7 +550,7 @@ mod tests { v, }; let raw = query(deps.as_ref(), mock_env(), msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: true }); } @@ -457,15 +560,15 @@ mod tests { let messages = [ED25519_MESSAGE_HEX, ED25519_MESSAGE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let public_keys = [ED25519_PUBLIC_KEY_HEX, ED25519_PUBLIC_KEY2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -475,7 +578,7 @@ mod tests { }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: true }); } @@ -487,18 +590,18 @@ mod tests { // One message let messages = [ED25519_MESSAGE_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // Multiple signatures //FIXME: Use different signatures / pubkeys let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // Multiple pubkeys let public_keys = [ED25519_PUBLIC_KEY_HEX, ED25519_PUBLIC_KEY_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -508,7 +611,7 @@ mod tests { }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: true }); } @@ -521,18 +624,18 @@ mod tests { //FIXME: Use different messages let messages = [ED25519_MESSAGE_HEX, ED25519_MESSAGE_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // Multiple signatures //FIXME: Use different signatures let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // One pubkey let public_keys = [ED25519_PUBLIC_KEY_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -542,7 +645,7 @@ mod tests { }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: true }); } @@ -553,17 +656,19 @@ mod tests { let mut messages: Vec = [ED25519_MESSAGE_HEX, ED25519_MESSAGE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // Alter one of the messages - messages[0].0[0] ^= 0x01; + let mut b: Vec<_> = messages.pop().unwrap().into(); + b[0] ^= 0x01; + messages.push(Binary::new(b)); let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let public_keys = [ED25519_PUBLIC_KEY_HEX, ED25519_PUBLIC_KEY2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -573,7 +678,7 @@ mod tests { }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: false }); } @@ -584,16 +689,16 @@ mod tests { let messages = [ED25519_MESSAGE_HEX, ED25519_MESSAGE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // One of the public keys is empty let public_keys = ["", ED25519_PUBLIC_KEY_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -603,12 +708,10 @@ mod tests { }; let res = query(deps.as_ref(), mock_env(), verify_msg); assert!(res.is_err()); - assert_eq!( - res.unwrap_err(), - StdError::VerificationErr { - source: VerificationError::InvalidPubkeyFormat, - } - ) + assert!(matches!( + res.unwrap_err().kind(), + StdErrorKind::Cryptography + )) } #[test] @@ -620,13 +723,13 @@ mod tests { let public_key = hex::decode(ED25519_PUBLIC_KEY_HEX).unwrap(); let verify_msg = QueryMsg::VerifyTendermintSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: true }); } @@ -642,13 +745,13 @@ mod tests { let public_key = hex::decode(ED25519_PUBLIC_KEY_HEX).unwrap(); let verify_msg = QueryMsg::VerifyTendermintSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let raw = query(deps.as_ref(), mock_env(), verify_msg).unwrap(); - let res: VerifyResponse = from_slice(&raw).unwrap(); + let res: VerifyResponse = from_json(raw).unwrap(); assert_eq!(res, VerifyResponse { verifies: false }); } @@ -662,18 +765,16 @@ mod tests { let public_key = vec![]; let verify_msg = QueryMsg::VerifyTendermintSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let res = query(deps.as_ref(), mock_env(), verify_msg); assert!(res.is_err()); - assert_eq!( - res.unwrap_err(), - StdError::VerificationErr { - source: VerificationError::InvalidPubkeyFormat - } - ) + assert!(matches!( + res.unwrap_err().kind(), + StdErrorKind::Cryptography, + )) } #[test] @@ -683,13 +784,14 @@ mod tests { let query_msg = QueryMsg::ListVerificationSchemes {}; let raw = query(deps.as_ref(), mock_env(), query_msg).unwrap(); - let res: ListVerificationsResponse = from_slice(&raw).unwrap(); + let res: ListVerificationsResponse = from_json(raw).unwrap(); assert_eq!( res, ListVerificationsResponse { verification_schemes: vec![ "secp256k1".into(), + "secp256r1".into(), "ed25519".into(), "ed25519_batch".into() ] diff --git a/contracts/crypto-verify/src/ethereum.rs b/contracts/crypto-verify/src/ethereum.rs index b47fe49335..79f64a6f2c 100644 --- a/contracts/crypto-verify/src/ethereum.rs +++ b/contracts/crypto-verify/src/ethereum.rs @@ -19,7 +19,7 @@ pub fn verify_transaction( ) -> StdResult { let sign_bytes = serialize_unsigned_transaction(to, nonce, gas, gas_price, value, data, chain_id); - let hash = Keccak256::digest(&sign_bytes); + let hash = Keccak256::digest(sign_bytes); let mut rs: Vec = Vec::with_capacity(64); rs.resize(32 - r.len(), 0); // Left pad r to 32 bytes rs.extend_from_slice(r); @@ -63,7 +63,7 @@ fn serialize_unsigned_transaction( /// Get the recovery param from the value `v` when no chain ID for replay protection is used. /// -/// This is needed for chain-agnostig aignatures like signed text. +/// This is needed for chain-agnostic signatures like signed text. /// /// See [EIP-155] for how `v` is composed. /// @@ -72,13 +72,13 @@ pub fn get_recovery_param(v: u8) -> StdResult { match v { 27 => Ok(0), 28 => Ok(1), - _ => Err(StdError::generic_err("Values of v other than 27 and 28 not supported. Replay protection (EIP-155) cannot be used here.")) + _ => Err(StdError::msg("Values of v other than 27 and 28 not supported. Replay protection (EIP-155) cannot be used here.")) } } /// Get the recovery param from the value `v` when a chain ID for replay protection is used. /// -/// This is needed for chain-agnostig aignatures like signed text. +/// This is needed for chain-agnostic signatures like signed text. /// /// See [EIP-155] for how `v` is composed. /// @@ -87,9 +87,8 @@ pub fn get_recovery_param_with_chain_id(v: u64, chain_id: u64) -> StdResult let recovery = v - chain_id * 2 - 35; match recovery { 0 | 1 => Ok(recovery as u8), - _ => Err(StdError::generic_err(format!( - "Calculated recovery parameter must be 0 or 1 but is {}.", - recovery + _ => Err(StdError::msg(format_args!( + "Calculated recovery parameter must be 0 or 1 but is {recovery}." ))), } } @@ -98,13 +97,13 @@ pub fn get_recovery_param_with_chain_id(v: u64, chain_id: u64) -> StdResult pub fn ethereum_address_raw(pubkey: &[u8]) -> StdResult<[u8; 20]> { let (tag, data) = match pubkey.split_first() { Some(pair) => pair, - None => return Err(StdError::generic_err("Public key must not be empty")), + None => return Err(StdError::msg("Public key must not be empty")), }; if *tag != 0x04 { - return Err(StdError::generic_err("Public key must start with 0x04")); + return Err(StdError::msg("Public key must start with 0x04")); } if data.len() != 64 { - return Err(StdError::generic_err("Public key must be 65 bytes long")); + return Err(StdError::msg("Public key must be 65 bytes long")); } let hash = Keccak256::digest(data); @@ -113,14 +112,12 @@ pub fn ethereum_address_raw(pubkey: &[u8]) -> StdResult<[u8; 20]> { pub fn decode_address(input: &str) -> StdResult<[u8; 20]> { if input.len() != 42 { - return Err(StdError::generic_err( - "Ethereum address must be 42 characters long", - )); + return Err(StdError::msg("Ethereum address must be 42 characters long")); } if !input.starts_with("0x") { - return Err(StdError::generic_err("Ethereum address must start wit 0x")); + return Err(StdError::msg("Ethereum address must start with 0x")); } - let data = hex::decode(&input[2..]).map_err(|_| StdError::generic_err("hex decoding error"))?; + let data = hex::decode(&input[2..])?; Ok(data.try_into().unwrap()) } diff --git a/contracts/crypto-verify/src/lib.rs b/contracts/crypto-verify/src/lib.rs index eefcabe019..c06473adb2 100644 --- a/contracts/crypto-verify/src/lib.rs +++ b/contracts/crypto-verify/src/lib.rs @@ -1,3 +1,5 @@ +mod bls12_381; pub mod contract; mod ethereum; pub mod msg; +mod webauthn; diff --git a/contracts/crypto-verify/src/msg.rs b/contracts/crypto-verify/src/msg.rs index e2a353e2f4..1ddb2b94ab 100644 --- a/contracts/crypto-verify/src/msg.rs +++ b/contracts/crypto-verify/src/msg.rs @@ -17,7 +17,17 @@ pub enum QueryMsg { /// Serialized compressed (33 bytes) or uncompressed (65 bytes) public key. public_key: Binary, }, - /// Ethereum text verification (compatible to the eth_sign RPC/web3 enpoint). + /// Cosmos format (secp256r1 verification scheme). + #[returns(VerifyResponse)] + VerifySecp256R1Signature { + /// Message to verify. + message: Binary, + /// Serialized signature. Cosmos format (64 bytes). + signature: Binary, + /// Serialized compressed (33 bytes) or uncompressed (65 bytes) public key. + public_key: Binary, + }, + /// Ethereum text verification (compatible to the eth_sign RPC/web3 endpoint). /// This cannot be used to verify transaction. /// /// See https://web3js.readthedocs.io/en/v1.2.0/web3-eth.html#sign @@ -29,7 +39,7 @@ pub enum QueryMsg { /// Serialized signature. Fixed length format (64 bytes `r` and `s` plus the one byte `v`). signature: Binary, /// Signer address. - /// This is matched case insensitive, so you can provide checksummed and non-checksummed addresses. Checksums are not validated. + /// This is matched case insensitive, so you can provide check-summed and non-check-summed addresses. Checksums are not validated. signer_address: String, }, #[returns(VerifyResponse)] @@ -72,6 +82,56 @@ pub enum QueryMsg { /// No pagination - this is a short list. #[returns(ListVerificationsResponse)] ListVerificationSchemes {}, + /// Webauthn component verification + #[returns(VerifyResponse)] + VerifyWebauthn { + /// Authenticator data + authenticator_data: Binary, + /// Client data (JSON encoded) + client_data_json: String, + /// Challenge value + challenge: Binary, + /// X coordinate of public key point + /// + /// Untagged big-endian serialized byte sequence representing the X coordinate on the secp256r1 elliptic curve + x: Binary, + /// Y coordinate of public key point + /// + /// Untagged big-endian serialized byte sequence representing the Y coordinate on the secp256r1 elliptic curve + y: Binary, + /// r component of signature + /// + /// The representation of this component is a big-endian encoded 256bit integer + r: Binary, + /// s component of signature + /// + /// The representation of this component is a big-endian encoded 256bit integer + s: Binary, + }, + /// BLS12-381 pairing equality verification (where the key is an element of G1) + #[returns(VerifyResponse)] + VerifyBls12PairingEqualityG1 { + /// The signature point in its compressed format (element of G2) + signature: Binary, + /// The public key point in its compressed format (element of G1) + pubkey: Binary, + /// The message that should be verified + msg: Binary, + /// The `dst` component used to hash the message to the curve + dst: Binary, + }, + /// BLS12-381 pairing equality verification (where the key is an element of G2) + #[returns(VerifyResponse)] + VerifyBls12PairingEqualityG2 { + /// The signature point in its compressed format (element of G1) + signature: Binary, + /// The public key point in its compressed format (element of G2) + pubkey: Binary, + /// The message that should be verified + msg: Binary, + /// The `dst` component used to hash the message to the curve + dst: Binary, + }, } #[cw_serde] @@ -85,5 +145,10 @@ pub struct ListVerificationsResponse { } pub(crate) fn list_verifications(_deps: Deps) -> Vec { - vec!["secp256k1".into(), "ed25519".into(), "ed25519_batch".into()] + vec![ + "secp256k1".into(), + "secp256r1".into(), + "ed25519".into(), + "ed25519_batch".into(), + ] } diff --git a/contracts/crypto-verify/src/webauthn.rs b/contracts/crypto-verify/src/webauthn.rs new file mode 100644 index 0000000000..462bdac0c6 --- /dev/null +++ b/contracts/crypto-verify/src/webauthn.rs @@ -0,0 +1,60 @@ +//! Adapted from + +use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; +use cosmwasm_std::{Api, StdResult}; +use p256::{ecdsa::Signature, elliptic_curve::sec1::FromEncodedPoint, EncodedPoint, PublicKey}; +use sha2::{digest::generic_array::GenericArray, Digest, Sha256}; + +#[allow(clippy::too_many_arguments)] +pub fn verify( + api: &dyn Api, + authenticator_data: &[u8], + client_data_json: &str, + challenge: &[u8], + x: &[u8], + y: &[u8], + r: &[u8], + s: &[u8], +) -> StdResult { + // We are making a lot of assumptions here about the coordinates, such as: + // + // - the length of the encoded bytes being correct + // - the point being an element of the curve + // - the conversion from the encoded coordinate to an affine point succeeding + // - the affine point actually being a valid public key + // - the signature could actually exist like this for a secp256r1 ECDSA key + // + // In production this should have proper error handling + let point = EncodedPoint::from_affine_coordinates(x.into(), y.into(), false); + let public_key = PublicKey::from_encoded_point(&point).unwrap(); + let signature = Signature::from_scalars( + GenericArray::clone_from_slice(r), + GenericArray::clone_from_slice(s), + ) + .unwrap(); + + // This is missing some checks of some bit flags + if authenticator_data.len() < 37 { + return Ok(false); + } + + // Is this an assertion? + if !client_data_json.contains("webauthn.get") { + return Ok(false); + } + + // Does the challenge belong to the client data? + let b64_challenge = URL_SAFE_NO_PAD.encode(challenge); + if !client_data_json.contains(b64_challenge.as_str()) { + return Ok(false); + } + + // Verify :D + let mut hasher = Sha256::new(); + hasher.update(authenticator_data); + hasher.update(Sha256::digest(client_data_json)); + let hash = hasher.finalize(); + + api.secp256r1_verify(&hash, &signature.to_bytes(), &public_key.to_sec1_bytes()) + .map_err(Into::into) +} diff --git a/contracts/crypto-verify/tests/integration.rs b/contracts/crypto-verify/tests/integration.rs index 4cdf2f3749..468fa38944 100644 --- a/contracts/crypto-verify/tests/integration.rs +++ b/contracts/crypto-verify/tests/integration.rs @@ -1,30 +1,15 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests. -//! 1. First copy them over verbatim, -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see init/execute(deps.as_mut(), ...) you must replace it with init/execute(&mut deps, ...) -//! 5. Anywhere you see query(deps.as_ref(), ...) you must replace it with query(&mut deps, ...) -//! (Use cosmwasm_vm::testing::{init, execute, query}, instead of the contract variants). use cosmwasm_std::{Binary, Response, Uint128}; use cosmwasm_vm::testing::{ - instantiate, mock_env, mock_info, mock_instance, query, MockApi, MockQuerier, MockStorage, + instantiate, mock_env, mock_info, mock_instance_with_gas_limit, query, MockApi, MockQuerier, + MockStorage, }; use cosmwasm_vm::{from_slice, Instance}; use hex_literal::hex; +use sha2::{Digest, Sha256}; use crypto_verify::msg::{InstantiateMsg, ListVerificationsResponse, QueryMsg, VerifyResponse}; @@ -37,6 +22,11 @@ const SECP256K1_MESSAGE_HEX: &str = "5c868fedb8026979ebd26f1ba07c27eedf4ff6d1044 const SECP256K1_SIGNATURE_HEX: &str = "207082eb2c3dfa0b454e0906051270ba4074ac93760ba9e7110cd9471475111151eb0dbbc9920e72146fb564f99d039802bf6ef2561446eb126ef364d21ee9c4"; const SECP256K1_PUBLIC_KEY_HEX: &str = "04051c1ee2190ecfb174bfe4f90763f2b4ff7517b70a2aec1876ebcfd644c4633fb03f3cfbd94b1f376e34592d9d41ccaf640bb751b00a1fadeb0c01157769eb73"; +const SECP256R1_MESSAGE_HEX: &str = + "4d55c99ef6bd54621662c3d110c3cb627c03d6311393b264ab97b90a4b15214a5593ba2510a53d63fb34be251facb697c973e11b665cb7920f1684b0031b4dd370cb927ca7168b0bf8ad285e05e9e31e34bc24024739fdc10b78586f29eff94412034e3b606ed850ec2c1900e8e68151fc4aee5adebb066eb6da4eaa5681378e"; +const SECP256R1_SIGNATURE_HEX: &str = "1cc628533d0004b2b20e7f4baad0b8bb5e0673db159bbccf92491aef61fc9620880e0bbf82a8cf818ed46ba03cf0fc6c898e36fca36cc7fdb1d2db7503634430"; +const SECP256R1_PUBLIC_KEY_HEX: &str = "04b8188bd68701fc396dab53125d4d28ea33a91daf6d21485f4770f6ea8c565dde423f058810f277f8fe076f6db56e9285a1bf2c2a1dae145095edd9c04970bc4a"; + // TEST 3 test vector from https://tools.ietf.org/html/rfc8032#section-7.1 const ED25519_MESSAGE_HEX: &str = "af82"; const ED25519_SIGNATURE_HEX: &str = "6291d657deec24024827e69c3abe01a30ce548a284743a445e3680d7db5ac3ac18ff9b538d16f290ae67f760984dc6594a7c15e9716ed28dc027beceea1ec40a"; @@ -54,10 +44,43 @@ const ED25519_SIGNATURE2_HEX: &str = "92a009a9f0d4cab8720e820b5f642540a2b27b5416 const ED25519_PUBLIC_KEY2_HEX: &str = "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c"; +// Vectors sourced from +const WEBAUTHN_PUBLIC_KEY_X: &[u8] = + &hex!("80d9326e49eb6314d03f58830369ea5bafbc4e2709b30bff1f4379586ca869d9"); +const WEBAUTHN_PUBLIC_KEY_Y: &[u8] = + &hex!("806ed746d8ac6c2779a472d8c1ed4c200b07978d9d8d8d862be8b7d4b7fb6350"); +const WEBAUTHN_CLIENT_DATA_JSON: &str = r#"{"type":"webauthn.get","challenge":"dGVzdA","origin":"https://funny-froyo-3f9b75.netlify.app"}"#; +const WEBAUTHN_CHALLENGE: &[u8] = &hex!("74657374"); +const WEBAUTHN_AUTHENTICATOR_DATA: &[u8] = + &hex!("e0b592a7dd54eedeec65206e031fc196b8e5915f9b389735860c83854f65dc0e1d00000000"); +const WEBAUTHN_SIGNATURE_R: &[u8] = + &hex!("32e005a53ae49a96ac88c715243638dd5c985fbd463c727d8eefd05bee4e2570"); +const WEBAUTHN_SIGNATURE_S: &[u8] = + &hex!("7a4fef4d0b11187f95f69eefbb428df8ac799bbd9305066b1e9c9fe9a5bcf8c4"); + +// See https://github.com/drand/kyber-bls12381/issues/22 and +// https://github.com/drand/drand/pull/1249 +const DOMAIN_HASH_TO_G1: &[u8] = b"BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_"; +const DOMAIN_HASH_TO_G2: &[u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_"; + +/// Public key League of Entropy Mainnet (curl -sS https://drand.cloudflare.com/info) +const PK_LEO_MAINNET: [u8; 48] = hex!("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31"); + +// Tests from quicknet (https://api.drand.sh/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/info) +const PK_QUICKNET: [u8; 96] = hex!("83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a"); + +fn build_drand_message(round: u64, previous_signature: &[u8]) -> Vec { + Sha256::new() + .chain_update(previous_signature) + .chain_update(round.to_be_bytes()) + .finalize() + .to_vec() +} + const DESERIALIZATION_LIMIT: usize = 20_000; fn setup() -> Instance { - let mut deps = mock_instance(WASM, &[]); + let mut deps = mock_instance_with_gas_limit(WASM, 10_000_000_000); let msg = InstantiateMsg {}; let info = mock_info(CREATOR, &[]); let res: Response = instantiate(&mut deps, mock_env(), info, msg).unwrap(); @@ -70,6 +93,76 @@ fn instantiate_works() { setup(); } +#[test] +fn bls12_381_verifies_g1() { + let mut deps = setup(); + + let previous_signature = hex::decode("a609e19a03c2fcc559e8dae14900aaefe517cb55c840f6e69bc8e4f66c8d18e8a609685d9917efbfb0c37f058c2de88f13d297c7e19e0ab24813079efe57a182554ff054c7638153f9b26a60e7111f71a0ff63d9571704905d3ca6df0b031747").unwrap(); + let signature = hex::decode("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42").unwrap(); + let round: u64 = 72785; + + let msg = build_drand_message(round, &previous_signature); + + let verify_msg = QueryMsg::VerifyBls12PairingEqualityG1 { + signature: signature.into(), + pubkey: PK_LEO_MAINNET.into(), + msg: msg.into(), + dst: DOMAIN_HASH_TO_G2.into(), + }; + + let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); + let res: VerifyResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); + + assert_eq!(res, VerifyResponse { verifies: true }); +} + +#[test] +fn bls12_381_verifies_g2() { + let mut deps = setup(); + + let signature = hex::decode("b75c69d0b72a5d906e854e808ba7e2accb1542ac355ae486d591aa9d43765482e26cd02df835d3546d23c4b13e0dfc92").unwrap(); + let round: u64 = 123; + + let msg = build_drand_message(round, b""); + + let verify_msg = QueryMsg::VerifyBls12PairingEqualityG2 { + signature: signature.into(), + pubkey: PK_QUICKNET.into(), + msg: msg.into(), + dst: DOMAIN_HASH_TO_G1.into(), + }; + + let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); + let res: VerifyResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); + + assert_eq!(res, VerifyResponse { verifies: true }); +} + +#[test] +fn bls12_381_errors() { + let mut deps = setup(); + + let mut previous_signature = hex::decode("a609e19a03c2fcc559e8dae14900aaefe517cb55c840f6e69bc8e4f66c8d18e8a609685d9917efbfb0c37f058c2de88f13d297c7e19e0ab24813079efe57a182554ff054c7638153f9b26a60e7111f71a0ff63d9571704905d3ca6df0b031747").unwrap(); + let signature = hex::decode("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42").unwrap(); + let round: u64 = 72785; + + previous_signature[0] ^= 0x3; + + let msg = build_drand_message(round, &previous_signature); + + let verify_msg = QueryMsg::VerifyBls12PairingEqualityG1 { + signature: signature.into(), + pubkey: PK_LEO_MAINNET.into(), + msg: msg.into(), + dst: DOMAIN_HASH_TO_G2.into(), + }; + + let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); + let res: VerifyResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); + + assert_eq!(res, VerifyResponse { verifies: false }); +} + #[test] fn cosmos_signature_verify_works() { let mut deps = setup(); @@ -79,9 +172,9 @@ fn cosmos_signature_verify_works() { let public_key = hex::decode(SECP256K1_PUBLIC_KEY_HEX).unwrap(); let verify_msg = QueryMsg::VerifyCosmosSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); @@ -101,9 +194,9 @@ fn cosmos_signature_verify_fails() { let public_key = hex::decode(SECP256K1_PUBLIC_KEY_HEX).unwrap(); let verify_msg = QueryMsg::VerifyCosmosSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); @@ -121,14 +214,76 @@ fn cosmos_signature_verify_errors() { let public_key = vec![]; let verify_msg = QueryMsg::VerifyCosmosSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), + }; + let res = query(&mut deps, mock_env(), verify_msg); + assert_eq!( + res.unwrap_err(), + "kind: Cryptography, error: Invalid public key format" + ) +} + +#[test] +fn secp256r1_signature_verify_works() { + let mut deps = setup(); + + let message = hex::decode(SECP256R1_MESSAGE_HEX).unwrap(); + let signature = hex::decode(SECP256R1_SIGNATURE_HEX).unwrap(); + let public_key = hex::decode(SECP256R1_PUBLIC_KEY_HEX).unwrap(); + + let verify_msg = QueryMsg::VerifySecp256R1Signature { + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), + }; + + let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); + let res: VerifyResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); + + assert_eq!(res, VerifyResponse { verifies: true }); +} + +#[test] +fn secp256r1_signature_verify_fails() { + let mut deps = setup(); + + let mut message = hex::decode(SECP256R1_MESSAGE_HEX).unwrap(); + // alter hash + message[0] ^= 0x01; + let signature = hex::decode(SECP256R1_SIGNATURE_HEX).unwrap(); + let public_key = hex::decode(SECP256R1_PUBLIC_KEY_HEX).unwrap(); + + let verify_msg = QueryMsg::VerifySecp256R1Signature { + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), + }; + + let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); + let res: VerifyResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); + + assert_eq!(res, VerifyResponse { verifies: false }); +} + +#[test] +fn secp256r1_signature_verify_errors() { + let mut deps = setup(); + + let message = hex::decode(SECP256R1_MESSAGE_HEX).unwrap(); + let signature = hex::decode(SECP256R1_SIGNATURE_HEX).unwrap(); + let public_key = vec![]; + + let verify_msg = QueryMsg::VerifySecp256R1Signature { + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let res = query(&mut deps, mock_env(), verify_msg); assert_eq!( res.unwrap_err(), - "Verification error: Invalid public key format" + "kind: Cryptography, error: Invalid public key format" ) } @@ -199,7 +354,7 @@ fn ethereum_signature_verify_fails_for_corrupted_signature() { }; let result = query(&mut deps, mock_env(), verify_msg); let msg = result.unwrap_err(); - assert_eq!(msg, "Recover pubkey error: Unknown error: 10"); + assert_eq!(msg, "kind: Cryptography, error: Unknown error: 10"); } #[test] @@ -262,9 +417,9 @@ fn tendermint_signature_verify_works() { let public_key = hex::decode(ED25519_PUBLIC_KEY_HEX).unwrap(); let verify_msg = QueryMsg::VerifyTendermintSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); @@ -284,9 +439,9 @@ fn tendermint_signature_verify_fails() { let public_key = hex::decode(ED25519_PUBLIC_KEY_HEX).unwrap(); let verify_msg = QueryMsg::VerifyTendermintSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); @@ -304,14 +459,14 @@ fn tendermint_signature_verify_errors() { let public_key = vec![]; let verify_msg = QueryMsg::VerifyTendermintSignature { - message: Binary(message), - signature: Binary(signature), - public_key: Binary(public_key), + message: Binary::new(message), + signature: Binary::new(signature), + public_key: Binary::new(public_key), }; let res = query(&mut deps, mock_env(), verify_msg); assert_eq!( res.unwrap_err(), - "Verification error: Invalid public key format" + "kind: Cryptography, error: Invalid public key format" ) } @@ -321,15 +476,15 @@ fn tendermint_signatures_batch_verify_works() { let messages = [ED25519_MESSAGE_HEX, ED25519_MESSAGE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let public_keys = [ED25519_PUBLIC_KEY_HEX, ED25519_PUBLIC_KEY2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -351,18 +506,18 @@ fn tendermint_signatures_batch_verify_message_multisig_works() { // One message let messages = [ED25519_MESSAGE_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // Multiple signatures //FIXME: Use different signatures / pubkeys let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // Multiple pubkeys let public_keys = [ED25519_PUBLIC_KEY_HEX, ED25519_PUBLIC_KEY_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -385,17 +540,17 @@ fn tendermint_signatures_batch_verify_single_public_key_works() { //FIXME: Use different messages / signatures let messages = [ED25519_MESSAGE_HEX, ED25519_MESSAGE_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // Multiple signatures let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // One pubkey let public_keys = [ED25519_PUBLIC_KEY_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -416,17 +571,20 @@ fn tendermint_signatures_batch_verify_fails() { let mut messages: Vec = [ED25519_MESSAGE_HEX, ED25519_MESSAGE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // Alter one of the messages - messages[1].0[0] ^= 0x01; + let mut b: Vec<_> = messages.swap_remove(0).into(); + b[0] ^= 0x01; + messages.push(Binary::new(b)); + messages.swap(0, 1); // swap them again to old order let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let public_keys = [ED25519_PUBLIC_KEY_HEX, ED25519_PUBLIC_KEY2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -447,16 +605,16 @@ fn tendermint_signatures_batch_verify_errors() { let messages = [ED25519_MESSAGE_HEX, ED25519_MESSAGE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let signatures = [ED25519_SIGNATURE_HEX, ED25519_SIGNATURE2_HEX] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); // One of the public keys is empty let public_keys = [ED25519_PUBLIC_KEY_HEX, ""] .iter() - .map(|m| Binary(hex::decode(m).unwrap())) + .map(|m| Binary::new(hex::decode(m).unwrap())) .collect(); let verify_msg = QueryMsg::VerifyTendermintBatch { @@ -467,10 +625,67 @@ fn tendermint_signatures_batch_verify_errors() { let res = query(&mut deps, mock_env(), verify_msg); assert_eq!( res.unwrap_err(), - "Verification error: Invalid public key format" + "kind: Cryptography, error: Invalid public key format" ) } +#[test] +fn webauthn_verify_works() { + let mut deps = setup(); + let verify_msg = QueryMsg::VerifyWebauthn { + authenticator_data: WEBAUTHN_AUTHENTICATOR_DATA.into(), + client_data_json: WEBAUTHN_CLIENT_DATA_JSON.into(), + challenge: WEBAUTHN_CHALLENGE.into(), + x: WEBAUTHN_PUBLIC_KEY_X.into(), + y: WEBAUTHN_PUBLIC_KEY_Y.into(), + r: WEBAUTHN_SIGNATURE_R.into(), + s: WEBAUTHN_SIGNATURE_S.into(), + }; + + let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); + let res: VerifyResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); + assert!(res.verifies); +} + +#[test] +fn webauthn_verify_errors() { + let mut deps = setup(); + + let mut r = WEBAUTHN_SIGNATURE_R.to_vec(); + r[0] ^= 3; + + let verify_msg = QueryMsg::VerifyWebauthn { + authenticator_data: WEBAUTHN_AUTHENTICATOR_DATA.into(), + client_data_json: WEBAUTHN_CLIENT_DATA_JSON.into(), + challenge: WEBAUTHN_CHALLENGE.into(), + x: WEBAUTHN_PUBLIC_KEY_X.into(), + y: WEBAUTHN_PUBLIC_KEY_Y.into(), + r: r.into(), + s: WEBAUTHN_SIGNATURE_S.into(), + }; + + let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); + let res: VerifyResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); + assert!(!res.verifies); + + let mut client_data_json = WEBAUTHN_CLIENT_DATA_JSON.to_string(); + client_data_json.push_str("tampering with hashes is fun"); + let verify_msg = QueryMsg::VerifyWebauthn { + authenticator_data: WEBAUTHN_AUTHENTICATOR_DATA.into(), + client_data_json, + challenge: WEBAUTHN_CHALLENGE.into(), + x: WEBAUTHN_PUBLIC_KEY_X.into(), + y: WEBAUTHN_PUBLIC_KEY_Y.into(), + r: WEBAUTHN_SIGNATURE_R.into(), + s: WEBAUTHN_SIGNATURE_S.into(), + }; + + let mut deps = setup(); + let raw = query(&mut deps, mock_env(), verify_msg).unwrap(); + let res: VerifyResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); + assert!(!res.verifies); +} + #[test] fn query_works() { let mut deps = setup(); @@ -485,6 +700,7 @@ fn query_works() { ListVerificationsResponse { verification_schemes: vec![ "secp256k1".into(), + "secp256r1".into(), "ed25519".into(), "ed25519_batch".into() ] diff --git a/contracts/cyberpunk/.cargo/config b/contracts/cyberpunk/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/cyberpunk/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/cyberpunk/.cargo/config.toml b/contracts/cyberpunk/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/cyberpunk/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/cyberpunk/Cargo.lock b/contracts/cyberpunk/Cargo.lock index bb60f23f9b..7c1d7f4ea3 100644 --- a/contracts/cyberpunk/Cargo.lock +++ b/contracts/cyberpunk/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,79 +17,271 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" -version = "0.5.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] -name = "base64ct" -version = "1.5.0" +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] + +[[package]] +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "1.2.1" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] [[package]] name = "blake2b_simd" -version = "0.5.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec", @@ -98,60 +290,99 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] -name = "block-buffer" -version = "0.10.2" +name = "bnum" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" -dependencies = [ - "generic-array", -] +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "bytecheck_derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -159,61 +390,100 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" -version = "0.1.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -221,204 +491,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "base64", + "base64 0.22.1", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -435,34 +634,73 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "cyberpunk" -version = "0.0.0" +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-storage", - "cosmwasm-vm", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cw-schema" +version = "3.0.3-dev" +dependencies = [ + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cyberpunk" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-vm", "rust-argon2", + "tempfile", "thiserror", ] [[package]] name = "darling" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ "darling_core", "darling_macro", @@ -470,75 +708,134 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.87", ] [[package]] name = "darling_macro" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -546,13 +843,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -563,57 +860,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -636,46 +953,116 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -683,97 +1070,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -787,652 +1179,1153 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "k256" -version = "0.11.3" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "quote", - "syn", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "mach" -version = "0.3.2" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.59.0", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "adler", - "autocfg", + "either", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "hermit-abi", - "libc", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" -dependencies = [ - "memchr", -] - -[[package]] -name = "object" -version = "0.28.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", ] [[package]] -name = "once_cell" -version = "1.8.0" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "libc" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] -name = "pin-project-lite" -version = "0.2.7" +name = "libloading" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] -name = "pkcs8" -version = "0.9.0" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "der", - "spki", + "bitflags 2.5.0", + "libc", + "redox_syscall", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "autocfg", + "scopeguard", ] [[package]] -name = "proc-macro2" -version = "1.0.27" +name = "log" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" -dependencies = [ - "unicode-xid", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "ptr_meta" -version = "0.1.4" +name = "mach2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ - "ptr_meta_derive", + "libc", ] [[package]] -name = "ptr_meta_derive" -version = "0.1.4" +name = "memchr" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] -name = "quote" -version = "1.0.9" +name = "memmap2" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ - "proc-macro2", + "libc", ] [[package]] -name = "rand" -version = "0.8.4" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ "libc", - "rand_chacha", - "rand_core 0.6.3", - "rand_hc", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "memoffset" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", + "autocfg", ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] -name = "rand_core" -version = "0.6.3" +name = "miniz_oxide" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ - "getrandom 0.2.3", + "adler", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "miniz_oxide" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ - "rand_core 0.6.3", + "adler2", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "munge_macro", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "munge_macro" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "bitflags", + "memchr", + "minimal-lexical", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "num-bigint" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "num-integer", + "num-traits", ] [[package]] -name = "region" -version = "3.0.0" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "num-traits", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "winapi", + "autocfg", ] [[package]] -name = "rend" -version = "0.3.6" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "bytecheck", + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", ] [[package]] -name = "rfc6979" -version = "0.3.0" +name = "object" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", + "memchr", ] [[package]] -name = "rkyv" -version = "0.7.36" +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", + "supports-color 2.1.0", + "supports-color 3.0.2", ] [[package]] -name = "rkyv_derive" -version = "0.7.36" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "proc-macro2", - "quote", - "syn", + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", ] [[package]] -name = "rust-argon2" -version = "0.8.3" +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "base64", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils", + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", ] [[package]] -name = "rustc-demangle" -version = "0.1.20" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "rustc-hash" -version = "1.1.0" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "rustversion" -version = "1.0.5" +name = "pin-project-lite" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "ryu" -version = "1.0.5" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "schemars" -version = "0.8.6" +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "schemars_derive" -version = "0.8.6" +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ + "proc-macro-error-attr", "proc-macro2", "quote", - "serde_derive_internals", - "syn", + "syn 1.0.109", + "version_check", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "proc-macro-error-attr" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] [[package]] -name = "sec1" -version = "0.3.0" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "serde" -version = "1.0.126" +name = "proc-macro2" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "serde_derive", + "unicode-ident", ] [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "ptr_meta" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "serde", + "ptr_meta_derive 0.1.4", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "ptr_meta" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" dependencies = [ - "serde", + "ptr_meta_derive 0.3.0", ] [[package]] -name = "serde_derive" -version = "1.0.126" +name = "ptr_meta_derive" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "serde_derive_internals" -version = "0.25.0" +name = "ptr_meta_derive" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "serde_json" -version = "1.0.64" +name = "quote" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "itoa", - "ryu", - "serde", + "proc-macro2", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "rancor" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "ptr_meta 0.3.0", ] [[package]] -name = "sha2" -version = "0.10.3" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "rand_chacha", + "rand_core", ] [[package]] -name = "signature" -version = "1.5.0" +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "ppv-lite86", + "rand_core", ] [[package]] -name = "smallvec" -version = "1.6.1" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] [[package]] -name = "spki" -version = "0.6.0" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "base64ct", - "der", + "either", + "rayon-core", ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" +dependencies = [ + "bytecheck 0.8.0", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" +dependencies = [ + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rust-argon2" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d9848531d60c9cbbcf9d166c885316c24bc0e2a9d3eba0956bb6cbbd79bc6e8" +dependencies = [ + "base64 0.21.7", + "blake2b_simd", + "constant_time_eq", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" @@ -1444,147 +2337,297 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", + "libc", + "xattr", ] [[package]] name = "target-lexicon" -version = "0.12.2" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.2.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "fastrand", + "rustix", + "windows-sys 0.52.0", ] [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64 0.22.1", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1592,24 +2635,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1617,113 +2660,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1733,252 +2758,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "which" -version = "4.1.0" +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/cyberpunk/Cargo.toml b/contracts/cyberpunk/Cargo.toml index b4cdca0d35..9f6046091c 100644 --- a/contracts/cyberpunk/Cargo.toml +++ b/contracts/cyberpunk/Cargo.toml @@ -20,20 +20,12 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# For quicker tests, cargo test --lib. for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["abort"] } -rust-argon2 = "0.8" -thiserror = "1.0" +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["cosmwasm_1_3", "exports", "std"] } +rust-argon2 = "2.1" +thiserror = "1.0.26" [dev-dependencies] -cosmwasm-storage = { path = "../../packages/storage", default-features = false } cosmwasm-vm = { path = "../../packages/vm", default-features = false } +tempfile = "3.1.0" diff --git a/contracts/cyberpunk/schema/cw_schema/cyberpunk.json b/contracts/cyberpunk/schema/cw_schema/cyberpunk.json new file mode 100644 index 0000000000..68e0f3dc46 --- /dev/null +++ b/contracts/cyberpunk/schema/cw_schema/cyberpunk.json @@ -0,0 +1,392 @@ +{ + "contract_name": "cyberpunk", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cyberpunk_msg_ExecuteMsg", + "type": "enum", + "cases": { + "allocate_large_memory": { + "description": "Allocate large amounts of memory without consuming much gas", + "type": "named", + "properties": { + "pages": { + "value": 1 + } + } + }, + "argon2": { + "description": "Hashes some data. Uses CPU and memory, but no external calls.", + "type": "named", + "properties": { + "mem_cost": { + "description": "The amount of memory requested (KB).", + "value": 1 + }, + "time_cost": { + "description": "The number of passes.", + "value": 1 + } + } + }, + "cpu_loop": { + "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "type": "named", + "properties": {} + }, + "debug": { + "description": "Does a bit of work and calls debug", + "type": "named", + "properties": {} + }, + "memory_loop": { + "description": "Infinite loop reading and writing memory", + "type": "named", + "properties": {} + }, + "message_loop": { + "description": "Infinite loop sending message to itself", + "type": "named", + "properties": {} + }, + "mirror_env": { + "description": "Returns the env for testing", + "type": "named", + "properties": {} + }, + "noop": { + "description": "Does nothing. This can be used for baseline contract execution performance measurements.", + "type": "named", + "properties": {} + }, + "panic": { + "description": "Trigger a panic to ensure framework handles gracefully", + "type": "named", + "properties": {} + }, + "storage_loop": { + "description": "Infinite loop making storage calls (to test when their limit hits)", + "type": "named", + "properties": {} + }, + "unreachable": { + "description": "In contrast to Panic, this does not use the panic handler.\n\nFrom :\n\"Generates the unreachable instruction, which causes an unconditional trap.\"", + "type": "named", + "properties": {} + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cyberpunk_msg_QueryMsg", + "type": "enum", + "cases": { + "denom": { + "description": "Queries `DenomMetadata` from the bank module and returns the result", + "type": "named", + "properties": { + "denom": { + "value": 1 + } + } + }, + "denoms": { + "description": "Queries `AllDenomMetadata` from the bank module repeatedly and returns all entries", + "type": "named", + "properties": {} + }, + "mirror_env": { + "description": "Returns the env for testing", + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "denom": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_metadata_DenomMetadata", + "description": "Replicates the cosmos-sdk bank module Metadata type", + "type": "struct", + "properties": { + "base": { + "value": 1 + }, + "denom_units": { + "value": 5 + }, + "description": { + "value": 1 + }, + "display": { + "value": 1 + }, + "name": { + "value": 1 + }, + "symbol": { + "value": 1 + }, + "uri": { + "value": 1 + }, + "uri_hash": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_metadata_DenomUnit", + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "struct", + "properties": { + "aliases": { + "value": 4 + }, + "denom": { + "value": 1 + }, + "exponent": { + "value": 3 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 2 + } + ] + }, + "denoms": { + "type": "v1", + "root": 6, + "definitions": [ + { + "name": "cosmwasm_std_metadata_DenomMetadata", + "description": "Replicates the cosmos-sdk bank module Metadata type", + "type": "struct", + "properties": { + "base": { + "value": 1 + }, + "denom_units": { + "value": 5 + }, + "description": { + "value": 1 + }, + "display": { + "value": 1 + }, + "name": { + "value": 1 + }, + "symbol": { + "value": 1 + }, + "uri": { + "value": 1 + }, + "uri_hash": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_metadata_DenomUnit", + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "struct", + "properties": { + "aliases": { + "value": 4 + }, + "denom": { + "value": 1 + }, + "exponent": { + "value": 3 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 2 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] + }, + "mirror_env": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_types_Env", + "type": "struct", + "properties": { + "block": { + "value": 1 + }, + "contract": { + "value": 9 + }, + "transaction": { + "description": "Information on the transaction this message was executed in.\nThe field is unset when the `MsgExecuteContract`/`MsgInstantiateContract`/`MsgMigrateContract`\nis not executed as part of a transaction.", + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_types_BlockInfo", + "type": "struct", + "properties": { + "chain_id": { + "value": 4 + }, + "height": { + "description": "The height of a block is the number of blocks preceding it in the blockchain.", + "value": 2 + }, + "time": { + "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md),\nwhich has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n```\n# use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo};\n# let env = Env {\n# block: BlockInfo {\n# height: 12_345,\n# time: Timestamp::from_nanos(1_571_797_419_879_305_533),\n# chain_id: \"cosmos-testnet-14002\".to_string(),\n# },\n# transaction: Some(TransactionInfo::new(3, Binary::from_hex(\"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3\").unwrap())),\n# contract: ContractInfo {\n# address: Addr::unchecked(\"contract\"),\n# },\n# };\n# extern crate chrono;\nuse chrono::NaiveDateTime;\nlet seconds = env.block.time.seconds();\nlet nsecs = env.block.time.subsec_nanos();\nlet dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32);\n```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n```\n# use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo};\n# let env = Env {\n# block: BlockInfo {\n# height: 12_345,\n# time: Timestamp::from_nanos(1_571_797_419_879_305_533),\n# chain_id: \"cosmos-testnet-14002\".to_string(),\n# },\n# transaction: Some(TransactionInfo::new(3, Binary::from_hex(\"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3\").unwrap())),\n# contract: ContractInfo {\n# address: Addr::unchecked(\"contract\"),\n# },\n# };\nlet millis = env.block.time.nanos() / 1_000_000;\n```", + "value": 3 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_types_TransactionInfo", + "type": "struct", + "properties": { + "hash": { + "defaulting": true, + "description": "Hash of the transaction.\n\nIf the blockchain's CosmWasm version is below 3.0, this field\nwill default to being empty.", + "value": 7 + }, + "index": { + "description": "The position of this transaction in the block. The first\ntransaction has index 0.\n\nThis allows you to get a unique transaction identifier in this chain\nusing the pair (`env.block.height`, `env.transaction.index`).\n", + "value": 6 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 5 + }, + { + "name": "cosmwasm_std_types_ContractInfo", + "type": "struct", + "properties": { + "address": { + "value": 10 + } + } + }, + { + "name": "cosmwasm_std_addresses_Addr", + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no\nassumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways\n1. Use `Addr::unchecked(input)`\n2. Use `let checked: Addr = deps.api.addr_validate(input)?`\n3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?`\n4. Deserialize from JSON. This must only be done from JSON that was validated before\nsuch as a contract's state. `Addr` must not be used in messages sent by the user\nbecause this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create\na mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String`\ninstance.", + "type": "address" + } + ] + } + } +} diff --git a/contracts/cyberpunk/schema/cw_schema/raw/execute.json b/contracts/cyberpunk/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..3abc225ca5 --- /dev/null +++ b/contracts/cyberpunk/schema/cw_schema/raw/execute.json @@ -0,0 +1,86 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cyberpunk_msg_ExecuteMsg", + "type": "enum", + "cases": { + "allocate_large_memory": { + "description": "Allocate large amounts of memory without consuming much gas", + "type": "named", + "properties": { + "pages": { + "value": 1 + } + } + }, + "argon2": { + "description": "Hashes some data. Uses CPU and memory, but no external calls.", + "type": "named", + "properties": { + "mem_cost": { + "description": "The amount of memory requested (KB).", + "value": 1 + }, + "time_cost": { + "description": "The number of passes.", + "value": 1 + } + } + }, + "cpu_loop": { + "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "type": "named", + "properties": {} + }, + "debug": { + "description": "Does a bit of work and calls debug", + "type": "named", + "properties": {} + }, + "memory_loop": { + "description": "Infinite loop reading and writing memory", + "type": "named", + "properties": {} + }, + "message_loop": { + "description": "Infinite loop sending message to itself", + "type": "named", + "properties": {} + }, + "mirror_env": { + "description": "Returns the env for testing", + "type": "named", + "properties": {} + }, + "noop": { + "description": "Does nothing. This can be used for baseline contract execution performance measurements.", + "type": "named", + "properties": {} + }, + "panic": { + "description": "Trigger a panic to ensure framework handles gracefully", + "type": "named", + "properties": {} + }, + "storage_loop": { + "description": "Infinite loop making storage calls (to test when their limit hits)", + "type": "named", + "properties": {} + }, + "unreachable": { + "description": "In contrast to Panic, this does not use the panic handler.\n\nFrom :\n\"Generates the unreachable instruction, which causes an unconditional trap.\"", + "type": "named", + "properties": {} + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] +} diff --git a/contracts/cyberpunk/schema/cw_schema/raw/instantiate.json b/contracts/cyberpunk/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..feb0a1bf43 --- /dev/null +++ b/contracts/cyberpunk/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,12 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/cyberpunk/schema/cw_schema/raw/query.json b/contracts/cyberpunk/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..4bc8f7af69 --- /dev/null +++ b/contracts/cyberpunk/schema/cw_schema/raw/query.json @@ -0,0 +1,35 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cyberpunk_msg_QueryMsg", + "type": "enum", + "cases": { + "denom": { + "description": "Queries `DenomMetadata` from the bank module and returns the result", + "type": "named", + "properties": { + "denom": { + "value": 1 + } + } + }, + "denoms": { + "description": "Queries `AllDenomMetadata` from the bank module repeatedly and returns all entries", + "type": "named", + "properties": {} + }, + "mirror_env": { + "description": "Returns the env for testing", + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/cyberpunk/schema/cw_schema/raw/response_to_denom.json b/contracts/cyberpunk/schema/cw_schema/raw/response_to_denom.json new file mode 100644 index 0000000000..8f45021c58 --- /dev/null +++ b/contracts/cyberpunk/schema/cw_schema/raw/response_to_denom.json @@ -0,0 +1,73 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_metadata_DenomMetadata", + "description": "Replicates the cosmos-sdk bank module Metadata type", + "type": "struct", + "properties": { + "base": { + "value": 1 + }, + "denom_units": { + "value": 5 + }, + "description": { + "value": 1 + }, + "display": { + "value": 1 + }, + "name": { + "value": 1 + }, + "symbol": { + "value": 1 + }, + "uri": { + "value": 1 + }, + "uri_hash": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_metadata_DenomUnit", + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "struct", + "properties": { + "aliases": { + "value": 4 + }, + "denom": { + "value": 1 + }, + "exponent": { + "value": 3 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 2 + } + ] +} diff --git a/contracts/cyberpunk/schema/cw_schema/raw/response_to_denoms.json b/contracts/cyberpunk/schema/cw_schema/raw/response_to_denoms.json new file mode 100644 index 0000000000..b951011e94 --- /dev/null +++ b/contracts/cyberpunk/schema/cw_schema/raw/response_to_denoms.json @@ -0,0 +1,78 @@ +{ + "type": "v1", + "root": 6, + "definitions": [ + { + "name": "cosmwasm_std_metadata_DenomMetadata", + "description": "Replicates the cosmos-sdk bank module Metadata type", + "type": "struct", + "properties": { + "base": { + "value": 1 + }, + "denom_units": { + "value": 5 + }, + "description": { + "value": 1 + }, + "display": { + "value": 1 + }, + "name": { + "value": 1 + }, + "symbol": { + "value": 1 + }, + "uri": { + "value": 1 + }, + "uri_hash": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_metadata_DenomUnit", + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "struct", + "properties": { + "aliases": { + "value": 4 + }, + "denom": { + "value": 1 + }, + "exponent": { + "value": 3 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 2 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] +} diff --git a/contracts/cyberpunk/schema/cw_schema/raw/response_to_mirror_env.json b/contracts/cyberpunk/schema/cw_schema/raw/response_to_mirror_env.json new file mode 100644 index 0000000000..bfe03090a4 --- /dev/null +++ b/contracts/cyberpunk/schema/cw_schema/raw/response_to_mirror_env.json @@ -0,0 +1,99 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_types_Env", + "type": "struct", + "properties": { + "block": { + "value": 1 + }, + "contract": { + "value": 9 + }, + "transaction": { + "description": "Information on the transaction this message was executed in.\nThe field is unset when the `MsgExecuteContract`/`MsgInstantiateContract`/`MsgMigrateContract`\nis not executed as part of a transaction.", + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_types_BlockInfo", + "type": "struct", + "properties": { + "chain_id": { + "value": 4 + }, + "height": { + "description": "The height of a block is the number of blocks preceding it in the blockchain.", + "value": 2 + }, + "time": { + "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md),\nwhich has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n```\n# use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo};\n# let env = Env {\n# block: BlockInfo {\n# height: 12_345,\n# time: Timestamp::from_nanos(1_571_797_419_879_305_533),\n# chain_id: \"cosmos-testnet-14002\".to_string(),\n# },\n# transaction: Some(TransactionInfo::new(3, Binary::from_hex(\"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3\").unwrap())),\n# contract: ContractInfo {\n# address: Addr::unchecked(\"contract\"),\n# },\n# };\n# extern crate chrono;\nuse chrono::NaiveDateTime;\nlet seconds = env.block.time.seconds();\nlet nsecs = env.block.time.subsec_nanos();\nlet dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32);\n```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n```\n# use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo};\n# let env = Env {\n# block: BlockInfo {\n# height: 12_345,\n# time: Timestamp::from_nanos(1_571_797_419_879_305_533),\n# chain_id: \"cosmos-testnet-14002\".to_string(),\n# },\n# transaction: Some(TransactionInfo::new(3, Binary::from_hex(\"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3\").unwrap())),\n# contract: ContractInfo {\n# address: Addr::unchecked(\"contract\"),\n# },\n# };\nlet millis = env.block.time.nanos() / 1_000_000;\n```", + "value": 3 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_types_TransactionInfo", + "type": "struct", + "properties": { + "hash": { + "defaulting": true, + "description": "Hash of the transaction.\n\nIf the blockchain's CosmWasm version is below 3.0, this field\nwill default to being empty.", + "value": 7 + }, + "index": { + "description": "The position of this transaction in the block. The first\ntransaction has index 0.\n\nThis allows you to get a unique transaction identifier in this chain\nusing the pair (`env.block.height`, `env.transaction.index`).\n", + "value": 6 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 5 + }, + { + "name": "cosmwasm_std_types_ContractInfo", + "type": "struct", + "properties": { + "address": { + "value": 10 + } + } + }, + { + "name": "cosmwasm_std_addresses_Addr", + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no\nassumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways\n1. Use `Addr::unchecked(input)`\n2. Use `let checked: Addr = deps.api.addr_validate(input)?`\n3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?`\n4. Deserialize from JSON. This must only be done from JSON that was validated before\nsuch as a contract's state. `Addr` must not be used in messages sent by the user\nbecause this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create\na mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String`\ninstance.", + "type": "address" + } + ] +} diff --git a/contracts/cyberpunk/schema/cyberpunk.json b/contracts/cyberpunk/schema/cyberpunk.json index 9439d30556..c0860a7bde 100644 --- a/contracts/cyberpunk/schema/cyberpunk.json +++ b/contracts/cyberpunk/schema/cyberpunk.json @@ -5,8 +5,9 @@ "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false }, "execute": { "$schema": "http://json-schema.org/draft-07/schema#", @@ -44,6 +45,114 @@ }, "additionalProperties": false }, + { + "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "type": "object", + "required": [ + "cpu_loop" + ], + "properties": { + "cpu_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop making storage calls (to test when their limit hits)", + "type": "object", + "required": [ + "storage_loop" + ], + "properties": { + "storage_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop reading and writing memory", + "type": "object", + "required": [ + "memory_loop" + ], + "properties": { + "memory_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop sending message to itself", + "type": "object", + "required": [ + "message_loop" + ], + "properties": { + "message_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Allocate large amounts of memory without consuming much gas", + "type": "object", + "required": [ + "allocate_large_memory" + ], + "properties": { + "allocate_large_memory": { + "type": "object", + "required": [ + "pages" + ], + "properties": { + "pages": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Trigger a panic to ensure framework handles gracefully", + "type": "object", + "required": [ + "panic" + ], + "properties": { + "panic": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "In contrast to Panic, this does not use the panic handler.\n\nFrom : \"Generates the unreachable instruction, which causes an unconditional trap.\"", + "type": "object", + "required": [ + "unreachable" + ], + "properties": { + "unreachable": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Returns the env for testing", "type": "object", @@ -57,6 +166,34 @@ } }, "additionalProperties": false + }, + { + "description": "Does a bit of work and calls debug", + "type": "object", + "required": [ + "debug" + ], + "properties": { + "debug": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Does nothing. This can be used for baseline contract execution performance measurements.", + "type": "object", + "required": [ + "noop" + ], + "properties": { + "noop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false } ] }, @@ -77,12 +214,202 @@ } }, "additionalProperties": false + }, + { + "description": "Queries `AllDenomMetadata` from the bank module repeatedly and returns all entries", + "type": "object", + "required": [ + "denoms" + ], + "properties": { + "denoms": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Queries `DenomMetadata` from the bank module and returns the result", + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false } ] }, "migrate": null, "sudo": null, "responses": { + "denom": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DenomMetadata", + "description": "Replicates the cosmos-sdk bank module Metadata type", + "type": "object", + "required": [ + "base", + "denom_units", + "description", + "display", + "name", + "symbol", + "uri", + "uri_hash" + ], + "properties": { + "base": { + "type": "string" + }, + "denom_units": { + "type": "array", + "items": { + "$ref": "#/definitions/DenomUnit" + } + }, + "description": { + "type": "string" + }, + "display": { + "type": "string" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "uri_hash": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "DenomUnit": { + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "object", + "required": [ + "aliases", + "denom", + "exponent" + ], + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "denom": { + "type": "string" + }, + "exponent": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "denoms": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_DenomMetadata", + "type": "array", + "items": { + "$ref": "#/definitions/DenomMetadata" + }, + "definitions": { + "DenomMetadata": { + "description": "Replicates the cosmos-sdk bank module Metadata type", + "type": "object", + "required": [ + "base", + "denom_units", + "description", + "display", + "name", + "symbol", + "uri", + "uri_hash" + ], + "properties": { + "base": { + "type": "string" + }, + "denom_units": { + "type": "array", + "items": { + "$ref": "#/definitions/DenomUnit" + } + }, + "description": { + "type": "string" + }, + "display": { + "type": "string" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "uri_hash": { + "type": "string" + } + }, + "additionalProperties": false + }, + "DenomUnit": { + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "object", + "required": [ + "aliases", + "denom", + "exponent" + ], + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "denom": { + "type": "string" + }, + "exponent": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, "mirror_env": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Env", @@ -110,11 +437,16 @@ ] } }, + "additionalProperties": false, "definitions": { "Addr": { "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", "type": "string" }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, "BlockInfo": { "type": "object", "required": [ @@ -133,14 +465,15 @@ "minimum": 0.0 }, "time": { - "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md), which has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; # extern crate chrono; use chrono::NaiveDateTime; let seconds = env.block.time.seconds(); let nsecs = env.block.time.subsec_nanos(); let dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32); ```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; let millis = env.block.time.nanos() / 1_000_000; ```", + "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md), which has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n``` # use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo::new(3, Binary::from_hex(\"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3\").unwrap())), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; # extern crate chrono; use chrono::NaiveDateTime; let seconds = env.block.time.seconds(); let nsecs = env.block.time.subsec_nanos(); let dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32); ```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n``` # use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo::new(3, Binary::from_hex(\"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3\").unwrap())), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; let millis = env.block.time.nanos() / 1_000_000; ```", "allOf": [ { "$ref": "#/definitions/Timestamp" } ] } - } + }, + "additionalProperties": false }, "ContractInfo": { "type": "object", @@ -151,7 +484,8 @@ "address": { "$ref": "#/definitions/Addr" } - } + }, + "additionalProperties": false }, "Timestamp": { "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", @@ -167,13 +501,23 @@ "index" ], "properties": { + "hash": { + "description": "Hash of the transaction.\n\nIf the blockchain's CosmWasm version is below 3.0, this field will default to being empty.", + "default": "", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, "index": { - "description": "The position of this transaction in the block. The first transaction has index 0.\n\nThis allows you to get a unique transaction indentifier in this chain using the pair (`env.block.height`, `env.transaction.index`).", + "description": "The position of this transaction in the block. The first transaction has index 0.\n\nThis allows you to get a unique transaction identifier in this chain using the pair (`env.block.height`, `env.transaction.index`).", "type": "integer", "format": "uint32", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "Uint64": { "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", diff --git a/contracts/cyberpunk/schema/raw/execute.json b/contracts/cyberpunk/schema/raw/execute.json new file mode 100644 index 0000000000..eeb2687ead --- /dev/null +++ b/contracts/cyberpunk/schema/raw/execute.json @@ -0,0 +1,188 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Hashes some data. Uses CPU and memory, but no external calls.", + "type": "object", + "required": [ + "argon2" + ], + "properties": { + "argon2": { + "type": "object", + "required": [ + "mem_cost", + "time_cost" + ], + "properties": { + "mem_cost": { + "description": "The amount of memory requested (KB).", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "time_cost": { + "description": "The number of passes.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "type": "object", + "required": [ + "cpu_loop" + ], + "properties": { + "cpu_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop making storage calls (to test when their limit hits)", + "type": "object", + "required": [ + "storage_loop" + ], + "properties": { + "storage_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop reading and writing memory", + "type": "object", + "required": [ + "memory_loop" + ], + "properties": { + "memory_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop sending message to itself", + "type": "object", + "required": [ + "message_loop" + ], + "properties": { + "message_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Allocate large amounts of memory without consuming much gas", + "type": "object", + "required": [ + "allocate_large_memory" + ], + "properties": { + "allocate_large_memory": { + "type": "object", + "required": [ + "pages" + ], + "properties": { + "pages": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Trigger a panic to ensure framework handles gracefully", + "type": "object", + "required": [ + "panic" + ], + "properties": { + "panic": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "In contrast to Panic, this does not use the panic handler.\n\nFrom : \"Generates the unreachable instruction, which causes an unconditional trap.\"", + "type": "object", + "required": [ + "unreachable" + ], + "properties": { + "unreachable": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns the env for testing", + "type": "object", + "required": [ + "mirror_env" + ], + "properties": { + "mirror_env": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Does a bit of work and calls debug", + "type": "object", + "required": [ + "debug" + ], + "properties": { + "debug": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Does nothing. This can be used for baseline contract execution performance measurements.", + "type": "object", + "required": [ + "noop" + ], + "properties": { + "noop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/cyberpunk/schema/raw/instantiate.json b/contracts/cyberpunk/schema/raw/instantiate.json new file mode 100644 index 0000000000..e12a3fda12 --- /dev/null +++ b/contracts/cyberpunk/schema/raw/instantiate.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/cyberpunk/schema/raw/query.json b/contracts/cyberpunk/schema/raw/query.json new file mode 100644 index 0000000000..47b493442f --- /dev/null +++ b/contracts/cyberpunk/schema/raw/query.json @@ -0,0 +1,56 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Returns the env for testing", + "type": "object", + "required": [ + "mirror_env" + ], + "properties": { + "mirror_env": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Queries `AllDenomMetadata` from the bank module repeatedly and returns all entries", + "type": "object", + "required": [ + "denoms" + ], + "properties": { + "denoms": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Queries `DenomMetadata` from the bank module and returns the result", + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/cyberpunk/schema/raw/response_to_denom.json b/contracts/cyberpunk/schema/raw/response_to_denom.json new file mode 100644 index 0000000000..3cf72b4ed6 --- /dev/null +++ b/contracts/cyberpunk/schema/raw/response_to_denom.json @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DenomMetadata", + "description": "Replicates the cosmos-sdk bank module Metadata type", + "type": "object", + "required": [ + "base", + "denom_units", + "description", + "display", + "name", + "symbol", + "uri", + "uri_hash" + ], + "properties": { + "base": { + "type": "string" + }, + "denom_units": { + "type": "array", + "items": { + "$ref": "#/definitions/DenomUnit" + } + }, + "description": { + "type": "string" + }, + "display": { + "type": "string" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "uri_hash": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "DenomUnit": { + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "object", + "required": [ + "aliases", + "denom", + "exponent" + ], + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "denom": { + "type": "string" + }, + "exponent": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/cyberpunk/schema/raw/response_to_denoms.json b/contracts/cyberpunk/schema/raw/response_to_denoms.json new file mode 100644 index 0000000000..f8c7afab75 --- /dev/null +++ b/contracts/cyberpunk/schema/raw/response_to_denoms.json @@ -0,0 +1,80 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_DenomMetadata", + "type": "array", + "items": { + "$ref": "#/definitions/DenomMetadata" + }, + "definitions": { + "DenomMetadata": { + "description": "Replicates the cosmos-sdk bank module Metadata type", + "type": "object", + "required": [ + "base", + "denom_units", + "description", + "display", + "name", + "symbol", + "uri", + "uri_hash" + ], + "properties": { + "base": { + "type": "string" + }, + "denom_units": { + "type": "array", + "items": { + "$ref": "#/definitions/DenomUnit" + } + }, + "description": { + "type": "string" + }, + "display": { + "type": "string" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "uri_hash": { + "type": "string" + } + }, + "additionalProperties": false + }, + "DenomUnit": { + "description": "Replicates the cosmos-sdk bank module DenomUnit type", + "type": "object", + "required": [ + "aliases", + "denom", + "exponent" + ], + "properties": { + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "denom": { + "type": "string" + }, + "exponent": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/cyberpunk/schema/raw/response_to_mirror_env.json b/contracts/cyberpunk/schema/raw/response_to_mirror_env.json new file mode 100644 index 0000000000..3a08838e4d --- /dev/null +++ b/contracts/cyberpunk/schema/raw/response_to_mirror_env.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Env", + "type": "object", + "required": [ + "block", + "contract" + ], + "properties": { + "block": { + "$ref": "#/definitions/BlockInfo" + }, + "contract": { + "$ref": "#/definitions/ContractInfo" + }, + "transaction": { + "description": "Information on the transaction this message was executed in. The field is unset when the `MsgExecuteContract`/`MsgInstantiateContract`/`MsgMigrateContract` is not executed as part of a transaction.", + "anyOf": [ + { + "$ref": "#/definitions/TransactionInfo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "BlockInfo": { + "type": "object", + "required": [ + "chain_id", + "height", + "time" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "height": { + "description": "The height of a block is the number of blocks preceding it in the blockchain.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "time": { + "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md), which has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n``` # use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo::new(3, Binary::from_hex(\"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3\").unwrap())), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; # extern crate chrono; use chrono::NaiveDateTime; let seconds = env.block.time.seconds(); let nsecs = env.block.time.subsec_nanos(); let dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32); ```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n``` # use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo::new(3, Binary::from_hex(\"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3\").unwrap())), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; let millis = env.block.time.nanos() / 1_000_000; ```", + "allOf": [ + { + "$ref": "#/definitions/Timestamp" + } + ] + } + }, + "additionalProperties": false + }, + "ContractInfo": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "$ref": "#/definitions/Addr" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "TransactionInfo": { + "type": "object", + "required": [ + "index" + ], + "properties": { + "hash": { + "description": "Hash of the transaction.\n\nIf the blockchain's CosmWasm version is below 3.0, this field will default to being empty.", + "default": "", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "index": { + "description": "The position of this transaction in the block. The first transaction has index 0.\n\nThis allows you to get a unique transaction identifier in this chain using the pair (`env.block.height`, `env.transaction.index`).", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/cyberpunk/examples/schema.rs b/contracts/cyberpunk/src/bin/schema.rs similarity index 100% rename from contracts/cyberpunk/examples/schema.rs rename to contracts/cyberpunk/src/bin/schema.rs diff --git a/contracts/cyberpunk/src/contract.rs b/contracts/cyberpunk/src/contract.rs index 7ea42967ac..63932ddf66 100644 --- a/contracts/cyberpunk/src/contract.rs +++ b/contracts/cyberpunk/src/contract.rs @@ -1,6 +1,6 @@ use cosmwasm_std::{ - entry_point, to_binary, Deps, DepsMut, Empty, Env, MessageInfo, QueryResponse, Response, - StdError, StdResult, + entry_point, to_json_binary, Api, DenomMetadata, Deps, DepsMut, Empty, Env, MessageInfo, + PageRequest, QueryResponse, Response, StdError, StdResult, WasmMsg, }; use crate::errors::ContractError; @@ -8,20 +8,17 @@ use crate::msg::{ExecuteMsg, QueryMsg}; #[entry_point] pub fn instantiate( - deps: DepsMut, + _deps: DepsMut, _env: Env, _info: MessageInfo, _msg: Empty, ) -> Result { - deps.api.debug("here we go 🚀"); - - // This adds some unrelated event attribute for testing purposes - Ok(Response::new().add_attribute("Let the", "hacking begin")) + Ok(Response::default()) } #[entry_point] pub fn execute( - _deps: DepsMut, + deps: DepsMut, env: Env, _info: MessageInfo, msg: ExecuteMsg, @@ -32,54 +29,266 @@ pub fn execute( Argon2 { mem_cost, time_cost, - } => execute::argon2(mem_cost, time_cost), - MirrorEnv {} => execute::mirror_env(env), + } => execute_argon2(mem_cost, time_cost), + CpuLoop {} => execute_cpu_loop(), + StorageLoop {} => execute_storage_loop(deps), + MemoryLoop {} => execute_memory_loop(), + MessageLoop {} => execute_message_loop(env), + AllocateLargeMemory { pages } => execute_allocate_large_memory(pages), + Panic {} => execute_panic(), + Unreachable {} => execute_unreachable(), + MirrorEnv {} => execute_mirror_env(env), + Debug {} => execute_debug(deps.api), + Noop {} => execute_noop(), } } -mod execute { - use super::*; +fn execute_argon2(mem_cost: u32, time_cost: u32) -> Result { + let password = b"password"; + let salt = b"othersalt"; + let config = argon2::Config { + variant: argon2::Variant::Argon2i, + version: argon2::Version::Version13, + mem_cost, + time_cost, + lanes: 4, + secret: &[], + ad: &[], + hash_length: 32, + }; + let hash = argon2::hash_encoded(password, salt, &config).map_err(StdError::from)?; + // let matches = argon2::verify_encoded(&hash, password).unwrap(); + // assert!(matches); + Ok(Response::new().set_data(hash.into_bytes())) + //Ok(Response::new()) +} + +fn execute_cpu_loop() -> Result { + #[allow(clippy::empty_loop)] + loop {} +} + +fn execute_storage_loop(deps: DepsMut) -> Result { + let mut test_case = 0u64; + loop { + deps.storage + .set(b"test.key", test_case.to_string().as_bytes()); + test_case += 1; + } +} + +fn execute_memory_loop() -> Result { + let mut data = vec![1usize]; + loop { + // add one element + data.push((*data.last().expect("must not be empty")) + 1); + } +} + +fn execute_message_loop(env: Env) -> Result { + let resp = Response::new().add_message(WasmMsg::Execute { + contract_addr: env.contract.address.into(), + msg: to_json_binary(&ExecuteMsg::MessageLoop {})?, + funds: vec![], + }); + Ok(resp) +} + +#[allow(unused_variables)] +fn execute_allocate_large_memory(pages: u32) -> Result { + // We create memory pages explicitly since Rust's default allocator seems to be clever enough + // to not grow memory for unused capacity like `Vec::::with_capacity(100 * 1024 * 1024)`. + // Even with std::alloc::alloc the memory did not grow beyond 1.5 MiB. + + #[cfg(target_arch = "wasm32")] + { + use core::arch::wasm32; + let old_size = wasm32::memory_grow(0, pages as usize); + if old_size == usize::max_value() { + return Err(StdError::msg("memory.grow failed").into()); + } + Ok(Response::new().set_data((old_size as u32).to_be_bytes())) + } + + #[cfg(not(target_arch = "wasm32"))] + Err(StdError::msg("Unsupported architecture").into()) +} + +fn execute_panic() -> Result { + // Uncomment your favourite panic case + + // panicked at 'This page intentionally faulted', src/contract.rs:53:5 + panic!("This page intentionally faulted"); + + // panicked at 'oh no (a = 3)', src/contract.rs:56:5 + // let a = 3; + // panic!("oh no (a = {a})"); + + // panicked at 'attempt to subtract with overflow', src/contract.rs:59:13 + // #[allow(arithmetic_overflow)] + // let _ = 5u32 - 8u32; + + // panicked at 'no entry found for key', src/contract.rs:62:13 + // let map = std::collections::HashMap::::new(); + // let _ = map["foo"]; +} + +fn execute_unreachable() -> Result { + #[cfg(target_arch = "wasm32")] + core::arch::wasm32::unreachable(); + + #[cfg(not(target_arch = "wasm32"))] + Err(StdError::msg("Unsupported architecture").into()) +} - pub fn argon2(mem_cost: u32, time_cost: u32) -> Result { - let password = b"password"; - let salt = b"othersalt"; +fn execute_mirror_env(env: Env) -> Result { + Ok(Response::new().set_data(to_json_binary(&env)?)) +} + +fn execute_debug(api: &dyn Api) -> Result { + api.debug("Hey, ho – let's go"); + + let password = b"password"; + let salt = b"othersalt"; + + for r in 1..10 { + api.debug(&format!("Round {r} starting")); let config = argon2::Config { variant: argon2::Variant::Argon2i, version: argon2::Version::Version13, - mem_cost, - time_cost, + mem_cost: 32, + time_cost: r, lanes: 4, - thread_mode: argon2::ThreadMode::Sequential, secret: &[], ad: &[], hash_length: 32, }; - let hash = argon2::hash_encoded(password, salt, &config) - .map_err(|e| StdError::generic_err(format!("hash_encoded errored: {}", e)))?; - // let matches = argon2::verify_encoded(&hash, password).unwrap(); - // assert!(matches); - Ok(Response::new().set_data(hash.into_bytes())) - //Ok(Response::new()) + let _hash = argon2::hash_encoded(password, salt, &config).unwrap(); + api.debug(&format!("Round {r} done")); } - pub fn mirror_env(env: Env) -> Result { - Ok(Response::new().set_data(to_binary(&env)?)) - } + api.debug("Work completed, bye"); + Ok(Response::default()) +} + +fn execute_noop() -> Result { + Ok(Response::new()) } #[entry_point] -pub fn query(_deps: Deps, env: Env, msg: QueryMsg) -> StdResult { +pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { use QueryMsg::*; match msg { - MirrorEnv {} => to_binary(&query::mirror_env(env)), + MirrorEnv {} => to_json_binary(&query_mirror_env(env)), + Denoms {} => to_json_binary(&query_denoms(deps)?), + Denom { denom } => to_json_binary(&query_denom(deps, denom)?), } } -mod query { +fn query_mirror_env(env: Env) -> Env { + env +} + +fn query_denoms(deps: Deps) -> StdResult> { + const PAGE_SIZE: u32 = 10; + let mut next_key = None; + let mut all_metadata = Vec::new(); + loop { + let page = deps.querier.query_all_denom_metadata(PageRequest { + key: next_key, + limit: PAGE_SIZE, + reverse: false, + })?; + + let len = page.metadata.len() as u32; + all_metadata.extend(page.metadata); + next_key = page.next_key; + + if next_key.is_none() || len < PAGE_SIZE { + break; + } + } + + Ok(all_metadata) +} + +fn query_denom(deps: Deps, denom: String) -> StdResult { + deps.querier.query_denom_metadata(denom) +} + +#[cfg(test)] +mod tests { use super::*; + use cosmwasm_std::testing::{ + message_info, mock_dependencies, mock_env, MockApi, MockQuerier, MockStorage, + }; + use cosmwasm_std::{from_json, DenomMetadata, DenomUnit, OwnedDeps}; + + fn setup() -> OwnedDeps { + let mut deps = mock_dependencies(); + let creator = deps.api.addr_make("creator"); + let msg = Empty {}; + let info = message_info(&creator, &[]); + let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); + assert_eq!(0, res.messages.len()); + deps + } + + #[test] + fn instantiate_works() { + setup(); + } + + #[test] + fn debug_works() { + let mut deps = setup(); + let caller = deps.api.addr_make("caller"); + + let msg = ExecuteMsg::Debug {}; + execute(deps.as_mut(), mock_env(), message_info(&caller, &[]), msg).unwrap(); + } + + #[test] + fn query_denoms_works() { + let mut deps = setup(); + + deps.querier.bank.set_denom_metadata( + &(0..98) + .map(|i| DenomMetadata { + symbol: format!("FOO{i}"), + name: "Foo".to_string(), + description: "Foo coin".to_string(), + denom_units: vec![DenomUnit { + denom: "ufoo".to_string(), + exponent: 8, + aliases: vec!["microfoo".to_string(), "foobar".to_string()], + }], + display: "FOO".to_string(), + base: format!("ufoo{i}"), + uri: "https://foo.bar".to_string(), + uri_hash: "foo".to_string(), + }) + .collect::>(), + ); + + let symbols: Vec = + from_json(query(deps.as_ref(), mock_env(), QueryMsg::Denoms {}).unwrap()).unwrap(); + + assert_eq!(symbols.len(), 98); + + let denom: DenomMetadata = from_json( + query( + deps.as_ref(), + mock_env(), + QueryMsg::Denom { + denom: "ufoo0".to_string(), + }, + ) + .unwrap(), + ) + .unwrap(); - pub fn mirror_env(env: Env) -> Env { - env + assert_eq!(denom.symbol, "FOO0"); } } diff --git a/contracts/cyberpunk/src/errors.rs b/contracts/cyberpunk/src/errors.rs index 970745b4cc..53c9be9908 100644 --- a/contracts/cyberpunk/src/errors.rs +++ b/contracts/cyberpunk/src/errors.rs @@ -1,7 +1,7 @@ use cosmwasm_std::StdError; use thiserror::Error; -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Debug)] pub enum ContractError { #[error("{0}")] /// this is needed so we can use `bucket.load(...)?` and have it auto-converted to the custom error diff --git a/contracts/cyberpunk/src/msg.rs b/contracts/cyberpunk/src/msg.rs index 98a03b0b7b..6dc9febca6 100644 --- a/contracts/cyberpunk/src/msg.rs +++ b/contracts/cyberpunk/src/msg.rs @@ -9,8 +9,29 @@ pub enum ExecuteMsg { /// The number of passes. time_cost: u32, }, + /// Infinite loop to burn cpu cycles (only run when metering is enabled) + CpuLoop {}, + /// Infinite loop making storage calls (to test when their limit hits) + StorageLoop {}, + /// Infinite loop reading and writing memory + MemoryLoop {}, + /// Infinite loop sending message to itself + MessageLoop {}, + /// Allocate large amounts of memory without consuming much gas + AllocateLargeMemory { pages: u32 }, + /// Trigger a panic to ensure framework handles gracefully + Panic {}, + /// In contrast to Panic, this does not use the panic handler. + /// + /// From : + /// "Generates the unreachable instruction, which causes an unconditional trap." + Unreachable {}, /// Returns the env for testing MirrorEnv {}, + /// Does a bit of work and calls debug + Debug {}, + /// Does nothing. This can be used for baseline contract execution performance measurements. + Noop {}, } #[cw_serde] @@ -19,4 +40,12 @@ pub enum QueryMsg { /// Returns the env for testing #[returns(cosmwasm_std::Env)] MirrorEnv {}, + + /// Queries `AllDenomMetadata` from the bank module repeatedly and returns all entries + #[returns(Vec)] + Denoms {}, + + /// Queries `DenomMetadata` from the bank module and returns the result + #[returns(cosmwasm_std::DenomMetadata)] + Denom { denom: String }, } diff --git a/contracts/cyberpunk/tests/integration.rs b/contracts/cyberpunk/tests/integration.rs index 3de369d239..13755b82f8 100644 --- a/contracts/cyberpunk/tests/integration.rs +++ b/contracts/cyberpunk/tests/integration.rs @@ -1,26 +1,14 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests as follows: -//! 1. Copy them over verbatim -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) - -use cosmwasm_std::{from_binary, Empty, Env, Response}; + +use cosmwasm_std::{from_json, Empty, Env, Response}; use cosmwasm_vm::testing::{ execute, instantiate, mock_env, mock_info, mock_instance, mock_instance_with_gas_limit, query, }; +use std::io::Write; +use std::time::SystemTime; +use tempfile::NamedTempFile; use cyberpunk::msg::{ExecuteMsg, QueryMsg}; @@ -28,7 +16,7 @@ static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/cy #[test] fn execute_argon2() { - let mut deps = mock_instance_with_gas_limit(WASM, 100_000_000_000_000); + let mut deps = mock_instance_with_gas_limit(WASM, 100_000_000_000); let init_info = mock_info("admin", &[]); let init_res: Response = instantiate(&mut deps, mock_env(), init_info, Empty {}).unwrap(); @@ -48,9 +36,88 @@ fn execute_argon2() { let gas_used = gas_before - deps.get_gas_left(); // Note: the exact gas usage depends on the Rust version used to compile Wasm, // which we only fix when using rust-optimizer, not integration tests. - let expected = 8635688250000; // +/- 20% - assert!(gas_used > expected * 80 / 100, "Gas used: {}", gas_used); - assert!(gas_used < expected * 120 / 100, "Gas used: {}", gas_used); + let expected = 8635688250; // +/- 20% + assert!(gas_used > expected * 80 / 100, "Gas used: {gas_used}"); + assert!(gas_used < expected * 120 / 100, "Gas used: {gas_used}"); +} + +// Test with +// cargo integration-test debug_works -- --nocapture +#[test] +fn debug_works() { + let mut deps = mock_instance_with_gas_limit(WASM, 100_000_000_000); + + let _res: Response = + instantiate(&mut deps, mock_env(), mock_info("admin", &[]), Empty {}).unwrap(); + + let msg = ExecuteMsg::Debug {}; + let _res: Response = execute(&mut deps, mock_env(), mock_info("caller", &[]), msg).unwrap(); + + let start = SystemTime::now(); + deps.set_debug_handler(move |msg, info| { + let gas = info.gas_remaining; + let runtime = SystemTime::now().duration_since(start).unwrap().as_micros(); + eprintln!("{msg} (gas: {gas}, runtime: {runtime}µs)"); + }); + + let msg = ExecuteMsg::Debug {}; + let _res: Response = execute(&mut deps, mock_env(), mock_info("caller", &[]), msg).unwrap(); + + eprintln!("Unsetting debug handler. From here nothing is printed anymore."); + deps.unset_debug_handler(); + + let msg = ExecuteMsg::Debug {}; + let _res: Response = execute(&mut deps, mock_env(), mock_info("caller", &[]), msg).unwrap(); +} + +// Test with +// cargo integration-test debug_timing -- --nocapture +#[test] +fn debug_timing() { + let mut deps = mock_instance_with_gas_limit(WASM, 100_000_000_000); + + let _res: Response = + instantiate(&mut deps, mock_env(), mock_info("admin", &[]), Empty {}).unwrap(); + + let mut last_time = None; + deps.set_debug_handler(move |msg, _info| { + if let Some(last_time) = last_time { + let diff = SystemTime::now() + .duration_since(last_time) + .unwrap_or_default() + .as_micros(); + eprintln!("{msg} (time since last debug: {diff}µs)"); + } else { + eprintln!("{msg}"); + } + + last_time = Some(SystemTime::now()); + }); + + let msg = ExecuteMsg::Debug {}; + let _res: Response = execute(&mut deps, mock_env(), mock_info("caller", &[]), msg).unwrap(); +} + +#[test] +fn debug_file() { + let mut deps = mock_instance_with_gas_limit(WASM, 100_000_000_000); + + let _res: Response = + instantiate(&mut deps, mock_env(), mock_info("admin", &[]), Empty {}).unwrap(); + + let temp_file = NamedTempFile::new().unwrap(); + let (mut temp_file, temp_path) = temp_file.into_parts(); + + deps.set_debug_handler(move |msg, _info| { + writeln!(temp_file, "{msg}").unwrap(); + }); + + let msg = ExecuteMsg::Debug {}; + let _res: Response = execute(&mut deps, mock_env(), mock_info("caller", &[]), msg).unwrap(); + + // check if file contains the expected output + let file_content = std::fs::read_to_string(temp_path).unwrap(); + assert!(file_content.contains("Round 9 done")); } #[test] @@ -70,13 +137,13 @@ fn test_env() { ) .unwrap(); - let received_env: Env = from_binary(&res.data.unwrap()).unwrap(); + let received_env: Env = from_json(res.data.unwrap()).unwrap(); assert_eq!(received_env, env); let env = mock_env(); let received_env: Env = - from_binary(&query(&mut deps, env.clone(), QueryMsg::MirrorEnv {}).unwrap()).unwrap(); + from_json(query(&mut deps, env.clone(), QueryMsg::MirrorEnv {}).unwrap()).unwrap(); assert_eq!(received_env, env); } diff --git a/contracts/empty/.cargo/config.toml b/contracts/empty/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/empty/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/empty/Cargo.lock b/contracts/empty/Cargo.lock new file mode 100644 index 0000000000..2369117621 --- /dev/null +++ b/contracts/empty/Cargo.lock @@ -0,0 +1,3006 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli 0.29.0", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.7.3", + "object 0.36.0", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] + +[[package]] +name = "bytecheck" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bytecheck_derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + +[[package]] +name = "cc" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clru" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "corosensei" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" +dependencies = [ + "autocfg", + "cfg-if", + "libc", + "scopeguard", + "windows-sys 0.59.0", +] + +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + +[[package]] +name = "cosmwasm-crypto" +version = "3.0.3-dev" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cosmwasm-schema" +version = "3.0.3-dev" +dependencies = [ + "cosmwasm-schema-derive", + "cw-schema", + "schemars 0.8.21", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cosmwasm-std" +version = "3.0.3-dev" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "cw-schema", + "derive_more 2.0.1", + "hex", + "rand_core", + "rmp-serde", + "schemars 0.8.21", + "serde", + "serde_json", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cosmwasm-vm" +version = "3.0.3-dev" +dependencies = [ + "bech32", + "blake2", + "bytes", + "clru", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-std", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", + "hex", + "rand_core", + "serde", + "serde_json", + "sha2", + "strum", + "thiserror", + "tracing", + "wasmer", + "wasmer-middlewares", + "wasmer-types", +] + +[[package]] +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" +dependencies = [ + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cw-schema" +version = "3.0.3-dev" +dependencies = [ + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derive_more" +version = "0.99.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "derive_more" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" +dependencies = [ + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "dynasm" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dynasmrt" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" +dependencies = [ + "byteorder", + "dynasm", + "memmap2 0.5.10", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "empty" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-vm", + "schemars 0.8.21", +] + +[[package]] +name = "enum-iterator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "enumset" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.87", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" +dependencies = [ + "bytecheck 0.8.0", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" +dependencies = [ + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +dependencies = [ + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", +] + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.87", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasmer" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" +dependencies = [ + "bindgen", + "bytes", + "cfg-if", + "cmake", + "indexmap", + "js-sys", + "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", + "target-lexicon", + "thiserror", + "tracing", + "ureq", + "wasm-bindgen", + "wasmer-compiler", + "wasmer-compiler-singlepass", + "wasmer-derive", + "wasmer-types", + "wasmer-vm", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmer-compiler" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" +dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", + "enumset", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", + "rkyv", + "self_cell", + "shared-buffer", + "smallvec", + "target-lexicon", + "thiserror", + "wasmer-types", + "wasmer-vm", + "wasmparser", + "windows-sys 0.59.0", + "xxhash-rust", +] + +[[package]] +name = "wasmer-compiler-singlepass" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" +dependencies = [ + "byteorder", + "dynasm", + "dynasmrt", + "enumset", + "gimli 0.28.1", + "more-asserts", + "rayon", + "smallvec", + "wasmer-compiler", + "wasmer-types", +] + +[[package]] +name = "wasmer-derive" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "wasmer-middlewares" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" +dependencies = [ + "wasmer", + "wasmer-types", + "wasmer-vm", +] + +[[package]] +name = "wasmer-types" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" +dependencies = [ + "bytecheck 0.6.12", + "enum-iterator", + "enumset", + "getrandom", + "hex", + "indexmap", + "more-asserts", + "rkyv", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", +] + +[[package]] +name = "wasmer-vm" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" +dependencies = [ + "backtrace", + "cc", + "cfg-if", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", + "region", + "scopeguard", + "thiserror", + "wasmer-types", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmparser" +version = "0.216.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" +dependencies = [ + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", +] + +[[package]] +name = "webpki-roots" +version = "0.26.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xattr" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/empty/Cargo.toml b/contracts/empty/Cargo.toml new file mode 100644 index 0000000000..70bcb40346 --- /dev/null +++ b/contracts/empty/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "empty" +version = "0.0.0" +authors = ["Christoph Otter "] +edition = "2021" +publish = false +license = "Apache-2.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[dependencies] +cosmwasm-schema = { path = "../../packages/schema" } +cosmwasm-std = { path = "../../packages/std", features = ["iterator"] } +schemars = "0.8.12" + +[dev-dependencies] +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/contracts/empty/README.md b/contracts/empty/README.md new file mode 100644 index 0000000000..8506f007b9 --- /dev/null +++ b/contracts/empty/README.md @@ -0,0 +1,4 @@ +# Empty Contract + +This is a minimal contract to test against. It has no functionality and only has +the minimum required to be a valid contract. diff --git a/contracts/empty/schema/cw_schema/empty.json b/contracts/empty/schema/cw_schema/empty.json new file mode 100644 index 0000000000..58d5e48c12 --- /dev/null +++ b/contracts/empty/schema/cw_schema/empty.json @@ -0,0 +1,11 @@ +{ + "contract_name": "empty", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": null, + "execute": null, + "query": null, + "migrate": null, + "sudo": null, + "responses": null +} diff --git a/contracts/empty/schema/empty.json b/contracts/empty/schema/empty.json new file mode 100644 index 0000000000..58d5e48c12 --- /dev/null +++ b/contracts/empty/schema/empty.json @@ -0,0 +1,11 @@ +{ + "contract_name": "empty", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": null, + "execute": null, + "query": null, + "migrate": null, + "sudo": null, + "responses": null +} diff --git a/contracts/empty/src/bin/schema.rs b/contracts/empty/src/bin/schema.rs new file mode 100644 index 0000000000..d240ff2b48 --- /dev/null +++ b/contracts/empty/src/bin/schema.rs @@ -0,0 +1,5 @@ +use cosmwasm_schema::write_api; + +fn main() { + write_api! {} +} diff --git a/contracts/empty/src/lib.rs b/contracts/empty/src/lib.rs new file mode 100644 index 0000000000..ce476b6e8d --- /dev/null +++ b/contracts/empty/src/lib.rs @@ -0,0 +1,2 @@ +// Make sure to reexport cosmwasm_std, so the standard entry points are kept in the final wasm +pub use cosmwasm_std; diff --git a/contracts/empty/tests/integration.rs b/contracts/empty/tests/integration.rs new file mode 100644 index 0000000000..cb88d32d52 --- /dev/null +++ b/contracts/empty/tests/integration.rs @@ -0,0 +1,15 @@ +//! This integration test tries to run and call the generated wasm. +//! It depends on a Wasm build being available, which you can create with `cargo wasm`. +//! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. + +use cosmwasm_vm::testing::mock_instance; + +// This line will test the output of cargo wasm +static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/empty.wasm"); +// You can uncomment this line instead to test productionified build from rust-optimizer +// static WASM: &[u8] = include_bytes!("../contract.wasm"); + +#[test] +fn validation_succeeds() { + mock_instance(WASM, &[]); +} diff --git a/contracts/floaty/.cargo/config b/contracts/floaty/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/floaty/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/floaty/.cargo/config.toml b/contracts/floaty/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/floaty/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/floaty/.vscode/settings.json b/contracts/floaty/.vscode/settings.json new file mode 100644 index 0000000000..11fee5dc5b --- /dev/null +++ b/contracts/floaty/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "rust-analyzer.cargo.target": "wasm32-unknown-unknown", + "rust-analyzer.cargo.extraEnv": { + "RUSTFLAGS": "-C target-feature=+nontrapping-fptoint" + } +} diff --git a/contracts/floaty/Cargo.lock b/contracts/floaty/Cargo.lock index 1f8896e463..852c5f7716 100644 --- a/contracts/floaty/Cargo.lock +++ b/contracts/floaty/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,118 +17,349 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "base64ct" -version = "1.5.0" +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -136,55 +367,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -192,204 +462,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -406,98 +605,196 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "darling" -version = "0.13.0" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "darling_core", - "darling_macro", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +name = "cw-schema" +version = "3.0.3-dev" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", ] [[package]] -name = "darling_macro" -version = "0.13.0" +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -505,13 +802,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -522,57 +819,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -595,57 +912,120 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "floaty" version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cosmwasm-vm", - "schemars", + "rand_chacha", + "schemars 0.8.21", "serde", - "thiserror", ] [[package]] @@ -655,97 +1035,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -759,230 +1144,520 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "k256" -version = "0.11.3" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "quote", - "syn", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "mach" -version = "0.3.2" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.59.0", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "adler", - "autocfg", + "either", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "hermit-abi", - "libc", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.25.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "memchr", -] + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] [[package]] name = "object" -version = "0.28.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.11.2", + "flate2", + "hashbrown 0.14.5", "indexmap", "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.8.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "pkcs8" -version = "0.9.0" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "der", - "spki", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro-error" @@ -993,7 +1668,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1008,13 +1683,35 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1023,7 +1720,16 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "ptr_meta_derive", + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", ] [[package]] @@ -1034,28 +1740,46 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", "rand_chacha", - "rand_core 0.6.3", - "rand_hc", + "rand_core", ] [[package]] @@ -1065,152 +1789,198 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core", ] [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.1.16", + "getrandom", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "getrandom 0.2.3", + "either", + "rayon-core", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "rand_core 0.6.3", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "bitflags 2.5.0", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "ref-cast-impl", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ - "bitflags", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "region" -version = "3.0.0" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ - "winapi", + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", ] [[package]] name = "rend" -version = "0.3.6" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" dependencies = [ - "bytecheck", + "bytecheck 0.8.0", ] [[package]] name = "rfc6979" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", "rend", "rkyv_derive", - "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", ] [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1218,178 +1988,295 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schemars" -version = "0.8.6" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" dependencies = [ "dyn-clone", - "schemars_derive", + "ref-cast", + "schemars_derive 1.0.4", "serde", "serde_json", ] [[package]] name = "schemars_derive" -version = "0.8.6" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.87", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "schemars_derive" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", "generic-array", - "pkcs8", "subtle", "zeroize", ] [[package]] -name = "serde" -version = "1.0.126" +name = "self_cell" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ - "serde", + "serde_derive", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "serde-wasm-bindgen" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" dependencies = [ + "js-sys", "serde", + "wasm-bindgen", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_derive_internals" -version = "0.25.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "serde_with" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "sha2" -version = "0.10.3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "cpufeatures", + "digest", ] [[package]] -name = "signature" -version = "1.5.0" +name = "shared-buffer" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "bytes", + "memmap2 0.6.2", ] [[package]] -name = "smallvec" -version = "1.6.1" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "spki" -version = "0.6.0" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "base64ct", - "der", + "digest", + "rand_core", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1404,147 +2291,285 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "target-lexicon" -version = "0.12.2" +name = "syn" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "tempfile" -version = "3.2.0" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" -dependencies = [ - "thiserror-impl", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1552,24 +2577,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1577,113 +2602,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1693,252 +2700,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/floaty/Cargo.toml b/contracts/floaty/Cargo.toml index e16a126438..ed724bb220 100644 --- a/contracts/floaty/Cargo.toml +++ b/contracts/floaty/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -22,21 +20,12 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# For quicker tests, cargo test --lib. for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } cosmwasm-std = { path = "../../packages/std" } -schemars = "0.8.3" +schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -thiserror = "1.0" +rand_chacha = { version = "0.3.1", default-features = false } [dev-dependencies] -cosmwasm-storage = { path = "../../packages/storage" } cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/contracts/floaty/README.md b/contracts/floaty/README.md new file mode 100644 index 0000000000..9212056517 --- /dev/null +++ b/contracts/floaty/README.md @@ -0,0 +1,13 @@ +# Floaty Contract + +This contract contains all WebAssembly floating point instructions. It is used +for testing the floating point support. + +In order to compile it, you need a nightly version of Rust and enable the +`nontrapping-fptoint` target-feature. This allows the usage of +[some more conversion instructions](https://github.com/WebAssembly/spec/blob/main/proposals/nontrapping-float-to-int-conversion/Overview.md). +To do this, run: + +```sh +RUSTFLAGS="-C link-arg=-s -C target-feature=+nontrapping-fptoint" cargo wasm +``` diff --git a/contracts/floaty/schema/cw_schema/floaty.json b/contracts/floaty/schema/cw_schema/floaty.json new file mode 100644 index 0000000000..f322c95302 --- /dev/null +++ b/contracts/floaty/schema/cw_schema/floaty.json @@ -0,0 +1,230 @@ +{ + "contract_name": "floaty", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] + }, + "execute": null, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "floaty_msg_QueryMsg", + "type": "enum", + "cases": { + "instructions": { + "description": "Returns a list of all instructions", + "type": "named", + "properties": {} + }, + "random_args_for": { + "description": "Returns valid random arguments for the given instruction", + "type": "named", + "properties": { + "instruction": { + "value": 1 + }, + "seed": { + "value": 2 + } + } + }, + "run": { + "description": "Runs the given instruction with the given arguments and returns the result", + "type": "named", + "properties": { + "args": { + "value": 5 + }, + "instruction": { + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "floaty_instructions_Value", + "type": "enum", + "cases": { + "f32": { + "type": "tuple", + "items": [ + 4 + ] + }, + "f64": { + "type": "tuple", + "items": [ + 2 + ] + }, + "u32": { + "type": "tuple", + "items": [ + 4 + ] + }, + "u64": { + "type": "tuple", + "items": [ + 2 + ] + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 3 + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "instructions": { + "type": "v1", + "root": 1, + "definitions": [ + { + "name": "String", + "type": "string" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] + }, + "random_args_for": { + "type": "v1", + "root": 3, + "definitions": [ + { + "name": "floaty_instructions_Value", + "type": "enum", + "cases": { + "f32": { + "type": "tuple", + "items": [ + 1 + ] + }, + "f64": { + "type": "tuple", + "items": [ + 2 + ] + }, + "u32": { + "type": "tuple", + "items": [ + 1 + ] + }, + "u64": { + "type": "tuple", + "items": [ + 2 + ] + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] + }, + "run": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "floaty_instructions_Value", + "type": "enum", + "cases": { + "f32": { + "type": "tuple", + "items": [ + 1 + ] + }, + "f64": { + "type": "tuple", + "items": [ + 2 + ] + }, + "u32": { + "type": "tuple", + "items": [ + 1 + ] + }, + "u64": { + "type": "tuple", + "items": [ + 2 + ] + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + } + ] + } + } +} diff --git a/contracts/floaty/schema/cw_schema/raw/instantiate.json b/contracts/floaty/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..feb0a1bf43 --- /dev/null +++ b/contracts/floaty/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,12 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/floaty/schema/cw_schema/raw/query.json b/contracts/floaty/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..9cbd015a07 --- /dev/null +++ b/contracts/floaty/schema/cw_schema/raw/query.json @@ -0,0 +1,92 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "floaty_msg_QueryMsg", + "type": "enum", + "cases": { + "instructions": { + "description": "Returns a list of all instructions", + "type": "named", + "properties": {} + }, + "random_args_for": { + "description": "Returns valid random arguments for the given instruction", + "type": "named", + "properties": { + "instruction": { + "value": 1 + }, + "seed": { + "value": 2 + } + } + }, + "run": { + "description": "Runs the given instruction with the given arguments and returns the result", + "type": "named", + "properties": { + "args": { + "value": 5 + }, + "instruction": { + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "floaty_instructions_Value", + "type": "enum", + "cases": { + "f32": { + "type": "tuple", + "items": [ + 4 + ] + }, + "f64": { + "type": "tuple", + "items": [ + 2 + ] + }, + "u32": { + "type": "tuple", + "items": [ + 4 + ] + }, + "u64": { + "type": "tuple", + "items": [ + 2 + ] + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 3 + } + ] +} diff --git a/contracts/floaty/schema/cw_schema/raw/response_to_instructions.json b/contracts/floaty/schema/cw_schema/raw/response_to_instructions.json new file mode 100644 index 0000000000..ba9dbee3df --- /dev/null +++ b/contracts/floaty/schema/cw_schema/raw/response_to_instructions.json @@ -0,0 +1,15 @@ +{ + "type": "v1", + "root": 1, + "definitions": [ + { + "name": "String", + "type": "string" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] +} diff --git a/contracts/floaty/schema/cw_schema/raw/response_to_random_args_for.json b/contracts/floaty/schema/cw_schema/raw/response_to_random_args_for.json new file mode 100644 index 0000000000..b1c630ec40 --- /dev/null +++ b/contracts/floaty/schema/cw_schema/raw/response_to_random_args_for.json @@ -0,0 +1,53 @@ +{ + "type": "v1", + "root": 3, + "definitions": [ + { + "name": "floaty_instructions_Value", + "type": "enum", + "cases": { + "f32": { + "type": "tuple", + "items": [ + 1 + ] + }, + "f64": { + "type": "tuple", + "items": [ + 2 + ] + }, + "u32": { + "type": "tuple", + "items": [ + 1 + ] + }, + "u64": { + "type": "tuple", + "items": [ + 2 + ] + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] +} diff --git a/contracts/floaty/schema/cw_schema/raw/response_to_run.json b/contracts/floaty/schema/cw_schema/raw/response_to_run.json new file mode 100644 index 0000000000..291ac3a110 --- /dev/null +++ b/contracts/floaty/schema/cw_schema/raw/response_to_run.json @@ -0,0 +1,48 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "floaty_instructions_Value", + "type": "enum", + "cases": { + "f32": { + "type": "tuple", + "items": [ + 1 + ] + }, + "f64": { + "type": "tuple", + "items": [ + 2 + ] + }, + "u32": { + "type": "tuple", + "items": [ + 1 + ] + }, + "u64": { + "type": "tuple", + "items": [ + 2 + ] + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + } + ] +} diff --git a/contracts/floaty/schema/floaty.json b/contracts/floaty/schema/floaty.json index 62f697a59f..3fb036613a 100644 --- a/contracts/floaty/schema/floaty.json +++ b/contracts/floaty/schema/floaty.json @@ -5,53 +5,51 @@ "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", "type": "object", - "required": [ - "beneficiary", - "verifier" - ], - "properties": { - "beneficiary": { - "type": "string" - }, - "verifier": { - "type": "string" - } - }, "additionalProperties": false }, - "execute": { + "execute": null, + "query": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", + "title": "QueryMsg", "oneOf": [ { - "description": "Releasing all funds in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", + "description": "Returns valid random arguments for the given instruction", "type": "object", "required": [ - "release" + "random_args_for" ], "properties": { - "release": { + "random_args_for": { "type": "object", + "required": [ + "instruction", + "seed" + ], + "properties": { + "instruction": { + "type": "string" + }, + "seed": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, "additionalProperties": false } }, "additionalProperties": false - } - ] - }, - "query": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "QueryMsg", - "oneOf": [ + }, { - "description": "returns a human-readable representation of the verifier use to ensure query path works in integration tests", + "description": "Returns a list of all instructions", "type": "object", "required": [ - "verifier" + "instructions" ], "properties": { - "verifier": { + "instructions": { "type": "object", "additionalProperties": false } @@ -59,19 +57,26 @@ "additionalProperties": false }, { - "description": "This returns cosmwasm_std::AllBalanceResponse to demo use of the querier", + "description": "Runs the given instruction with the given arguments and returns the result", "type": "object", "required": [ - "other_balance" + "run" ], "properties": { - "other_balance": { + "run": { "type": "object", "required": [ - "address" + "args", + "instruction" ], "properties": { - "address": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + "instruction": { "type": "string" } }, @@ -80,62 +85,212 @@ }, "additionalProperties": false } - ] + ], + "definitions": { + "Value": { + "oneOf": [ + { + "type": "object", + "required": [ + "u32" + ], + "properties": { + "u32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "u64" + ], + "properties": { + "u64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f32" + ], + "properties": { + "f32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f64" + ], + "properties": { + "f64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + ] + } + } }, "migrate": null, "sudo": null, "responses": { - "other_balance": { + "instructions": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AllBalanceResponse", - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "description": "Returns all non-zero coins held by this account.", - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - } + "title": "Array_of_String", + "type": "array", + "items": { + "type": "string" + } + }, + "random_args_for": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_Value", + "type": "array", + "items": { + "$ref": "#/definitions/Value" }, "definitions": { - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" + "Value": { + "oneOf": [ + { + "type": "object", + "required": [ + "u32" + ], + "properties": { + "u32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "u64" + ], + "properties": { + "u64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false }, - "denom": { - "type": "string" + { + "type": "object", + "required": [ + "f32" + ], + "properties": { + "f32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f64" + ], + "properties": { + "f64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false } - } - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" + ] } } }, - "verifier": { + "run": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "VerifierResponse", - "type": "object", - "required": [ - "verifier" - ], - "properties": { - "verifier": { - "type": "string" + "title": "Value", + "oneOf": [ + { + "type": "object", + "required": [ + "u32" + ], + "properties": { + "u32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "u64" + ], + "properties": { + "u64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f32" + ], + "properties": { + "f32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f64" + ], + "properties": { + "f64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false } - }, - "additionalProperties": false + ] } } } diff --git a/contracts/floaty/schema/raw/instantiate.json b/contracts/floaty/schema/raw/instantiate.json new file mode 100644 index 0000000000..e12a3fda12 --- /dev/null +++ b/contracts/floaty/schema/raw/instantiate.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/floaty/schema/raw/query.json b/contracts/floaty/schema/raw/query.json new file mode 100644 index 0000000000..376f327931 --- /dev/null +++ b/contracts/floaty/schema/raw/query.json @@ -0,0 +1,139 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Returns valid random arguments for the given instruction", + "type": "object", + "required": [ + "random_args_for" + ], + "properties": { + "random_args_for": { + "type": "object", + "required": [ + "instruction", + "seed" + ], + "properties": { + "instruction": { + "type": "string" + }, + "seed": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns a list of all instructions", + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "instructions": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Runs the given instruction with the given arguments and returns the result", + "type": "object", + "required": [ + "run" + ], + "properties": { + "run": { + "type": "object", + "required": [ + "args", + "instruction" + ], + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/Value" + } + }, + "instruction": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Value": { + "oneOf": [ + { + "type": "object", + "required": [ + "u32" + ], + "properties": { + "u32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "u64" + ], + "properties": { + "u64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f32" + ], + "properties": { + "f32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f64" + ], + "properties": { + "f64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + ] + } + } +} diff --git a/contracts/floaty/schema/raw/response_to_instructions.json b/contracts/floaty/schema/raw/response_to_instructions.json new file mode 100644 index 0000000000..4290cb1a21 --- /dev/null +++ b/contracts/floaty/schema/raw/response_to_instructions.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_String", + "type": "array", + "items": { + "type": "string" + } +} diff --git a/contracts/floaty/schema/raw/response_to_random_args_for.json b/contracts/floaty/schema/raw/response_to_random_args_for.json new file mode 100644 index 0000000000..4b9c97bed9 --- /dev/null +++ b/contracts/floaty/schema/raw/response_to_random_args_for.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_Value", + "type": "array", + "items": { + "$ref": "#/definitions/Value" + }, + "definitions": { + "Value": { + "oneOf": [ + { + "type": "object", + "required": [ + "u32" + ], + "properties": { + "u32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "u64" + ], + "properties": { + "u64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f32" + ], + "properties": { + "f32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f64" + ], + "properties": { + "f64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + ] + } + } +} diff --git a/contracts/floaty/schema/raw/response_to_run.json b/contracts/floaty/schema/raw/response_to_run.json new file mode 100644 index 0000000000..08c5730abf --- /dev/null +++ b/contracts/floaty/schema/raw/response_to_run.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Value", + "oneOf": [ + { + "type": "object", + "required": [ + "u32" + ], + "properties": { + "u32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "u64" + ], + "properties": { + "u64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f32" + ], + "properties": { + "f32": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "f64" + ], + "properties": { + "f64": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/floaty/src/bin/schema.rs b/contracts/floaty/src/bin/schema.rs new file mode 100644 index 0000000000..6a19141a53 --- /dev/null +++ b/contracts/floaty/src/bin/schema.rs @@ -0,0 +1,11 @@ +use cosmwasm_schema::write_api; + +use cosmwasm_std::Empty; +use floaty::msg::QueryMsg; + +fn main() { + write_api! { + instantiate: Empty, + query: QueryMsg, + } +} diff --git a/contracts/floaty/src/contract.rs b/contracts/floaty/src/contract.rs index bff2397899..9f7e8e4bff 100644 --- a/contracts/floaty/src/contract.rs +++ b/contracts/floaty/src/contract.rs @@ -1,259 +1,46 @@ use cosmwasm_std::{ - entry_point, from_slice, to_binary, to_vec, AllBalanceResponse, BankMsg, Deps, DepsMut, Env, - Event, MessageInfo, QueryResponse, Response, StdError, StdResult, + entry_point, to_json_binary, Deps, DepsMut, Empty, Env, MessageInfo, QueryResponse, Response, + StdResult, }; +use rand_chacha::rand_core::SeedableRng; -use crate::errors::HackError; -use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg, VerifierResponse}; -use crate::state::{State, CONFIG_KEY}; +#[cfg(target_arch = "wasm32")] +use crate::instructions::run_instruction; +use crate::{ + instructions::{random_args_for, Value, FLOAT_INSTRUCTIONS}, + msg::QueryMsg, +}; #[entry_point] pub fn instantiate( - deps: DepsMut, + _deps: DepsMut, _env: Env, - info: MessageInfo, - msg: InstantiateMsg, -) -> Result { - deps.api.debug("here we go 🚀"); - - deps.storage.set( - CONFIG_KEY, - &to_vec(&State { - verifier: deps.api.addr_validate(&msg.verifier)?, - beneficiary: deps.api.addr_validate(&msg.beneficiary)?, - funder: info.sender, - })?, - ); - - // This adds some unrelated event attribute for testing purposes - Ok(Response::new().add_attribute("Let the", "hacking begin")) + _info: MessageInfo, + _msg: Empty, +) -> Result { + Ok(Response::default()) } #[entry_point] -pub fn execute( - deps: DepsMut, - env: Env, - info: MessageInfo, - _msg: ExecuteMsg, -) -> Result { - let data = deps - .storage - .get(CONFIG_KEY) - .ok_or_else(|| StdError::not_found("State"))?; - let state: State = from_slice(&data)?; - - if info.sender == state.verifier { - let to_addr = state.beneficiary; - let balance = deps.querier.query_all_balances(env.contract.address)?; - - let mut fl = balance[0].amount.u128() as f64; - fl *= 0.3; - - let resp = Response::new() - .add_attribute("action", "release") - .add_attribute("destination", to_addr.clone()) - .add_attribute("foo", fl.to_string()) - .add_event(Event::new("hackatom").add_attribute("action", "release")) - .add_message(BankMsg::Send { - to_address: to_addr.into(), - amount: balance, - }) - .set_data([0xF0, 0x0B, 0xAA]); - Ok(resp) - } else { - Err(HackError::Unauthorized {}) - } -} - -pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { +pub fn query(_deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { match msg { - QueryMsg::Verifier {} => to_binary(&query_verifier(deps)?), - QueryMsg::OtherBalance { address } => to_binary(&query_other_balance(deps, address)?), + QueryMsg::RandomArgsFor { instruction, seed } => { + let mut rng = rand_chacha::ChaChaRng::seed_from_u64(seed); + to_json_binary(&random_args_for(&instruction, &mut rng)) + } + QueryMsg::Instructions {} => to_json_binary(&FLOAT_INSTRUCTIONS.to_vec()), + QueryMsg::Run { instruction, args } => to_json_binary(&query_run(&instruction, args)?), } } -fn query_verifier(deps: Deps) -> StdResult { - let data = deps - .storage - .get(CONFIG_KEY) - .ok_or_else(|| StdError::not_found("State"))?; - let state: State = from_slice(&data)?; - Ok(VerifierResponse { - verifier: state.verifier.into(), - }) -} - -fn query_other_balance(deps: Deps, address: String) -> StdResult { - let amount = deps.querier.query_all_balances(address)?; - Ok(AllBalanceResponse { amount }) -} - -#[cfg(test)] -mod tests { - use super::*; - use cosmwasm_std::testing::{ - mock_dependencies, mock_dependencies_with_balances, mock_env, mock_info, MOCK_CONTRACT_ADDR, - }; - use cosmwasm_std::Api as _; - // import trait Storage to get access to read - use cosmwasm_std::{attr, coins, Addr, Storage, SubMsg}; - - #[test] - fn proper_initialization() { - let mut deps = mock_dependencies(); - - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); - let expected_state = State { - verifier: deps.api.addr_validate(&verifier).unwrap(), - beneficiary: deps.api.addr_validate(&beneficiary).unwrap(), - funder: deps.api.addr_validate(&creator).unwrap(), - }; - - let msg = InstantiateMsg { - verifier, - beneficiary, - }; - let info = mock_info(creator.as_str(), &[]); - let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - assert_eq!(res.messages.len(), 0); - assert_eq!(res.attributes.len(), 1); - assert_eq!(res.attributes[0].key, "Let the"); - assert_eq!(res.attributes[0].value, "hacking begin"); - - // it worked, let's check the state - let data = deps.storage.get(CONFIG_KEY).expect("no data stored"); - let state: State = from_slice(&data).unwrap(); - assert_eq!(state, expected_state); - } - - #[test] - fn instantiate_and_query() { - let mut deps = mock_dependencies(); - - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); - let msg = InstantiateMsg { - verifier: verifier.clone(), - beneficiary, - }; - let info = mock_info(&creator, &[]); - let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - assert_eq!(0, res.messages.len()); - - // now let's query - let query_response = query_verifier(deps.as_ref()).unwrap(); - assert_eq!(query_response.verifier, verifier); - } - - #[test] - fn querier_callbacks_work() { - let rich_addr = String::from("foobar"); - let rich_balance = coins(10000, "gold"); - let deps = mock_dependencies_with_balances(&[(&rich_addr, &rich_balance)]); - - // querying with balance gets the balance - let bal = query_other_balance(deps.as_ref(), rich_addr).unwrap(); - assert_eq!(bal.amount, rich_balance); - - // querying other accounts gets none - let bal = query_other_balance(deps.as_ref(), String::from("someone else")).unwrap(); - assert_eq!(bal.amount, vec![]); - } - - #[test] - fn execute_release_works() { - let mut deps = mock_dependencies(); - - // initialize the store - let creator = String::from("creator"); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - - let instantiate_msg = InstantiateMsg { - verifier: verifier.clone(), - beneficiary: beneficiary.clone(), - }; - let init_amount = coins(1000, "earth"); - let init_info = mock_info(&creator, &init_amount); - let init_res = instantiate(deps.as_mut(), mock_env(), init_info, instantiate_msg).unwrap(); - assert_eq!(init_res.messages.len(), 0); - - // balance changed in init - deps.querier.update_balance(MOCK_CONTRACT_ADDR, init_amount); - - // beneficiary can release it - let execute_info = mock_info(verifier.as_str(), &[]); - let execute_res = execute( - deps.as_mut(), - mock_env(), - execute_info, - ExecuteMsg::Release {}, - ) - .unwrap(); - assert_eq!(execute_res.messages.len(), 1); - let msg = execute_res.messages.get(0).expect("no message"); - assert_eq!( - msg, - &SubMsg::new(BankMsg::Send { - to_address: beneficiary, - amount: coins(1000, "earth"), - }), - ); - assert_eq!( - execute_res.attributes, - vec![ - attr("action", "release"), - attr("destination", "benefits"), - attr("foo", "300") - ], - ); - assert_eq!(execute_res.data, Some(vec![0xF0, 0x0B, 0xAA].into())); - } - - #[test] - fn execute_release_fails_for_wrong_sender() { - let mut deps = mock_dependencies(); - - // initialize the store - let creator = String::from("creator"); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - - let instantiate_msg = InstantiateMsg { - verifier: verifier.clone(), - beneficiary: beneficiary.clone(), - }; - let init_amount = coins(1000, "earth"); - let init_info = mock_info(&creator, &init_amount); - let init_res = instantiate(deps.as_mut(), mock_env(), init_info, instantiate_msg).unwrap(); - assert_eq!(init_res.messages.len(), 0); - - // balance changed in init - deps.querier.update_balance(MOCK_CONTRACT_ADDR, init_amount); - - // beneficiary cannot release it - let execute_info = mock_info(beneficiary.as_str(), &[]); - let execute_res = execute( - deps.as_mut(), - mock_env(), - execute_info, - ExecuteMsg::Release {}, - ); - assert_eq!(execute_res.unwrap_err(), HackError::Unauthorized {}); +#[cfg_attr(not(target_arch = "wasm32"), allow(unused_variables))] +fn query_run(instruction: &str, args: Vec) -> StdResult { + #[cfg(not(target_arch = "wasm32"))] + panic!(); - // state should not change - let data = deps.storage.get(CONFIG_KEY).expect("no data stored"); - let state: State = from_slice(&data).unwrap(); - assert_eq!( - state, - State { - verifier: Addr::unchecked(verifier), - beneficiary: Addr::unchecked(beneficiary), - funder: Addr::unchecked(creator), - } - ); + #[cfg(target_arch = "wasm32")] + { + let result = run_instruction(instruction, &args); + Ok(result) } } diff --git a/contracts/floaty/src/errors.rs b/contracts/floaty/src/errors.rs deleted file mode 100644 index 7b46b00b63..0000000000 --- a/contracts/floaty/src/errors.rs +++ /dev/null @@ -1,12 +0,0 @@ -use cosmwasm_std::StdError; -use thiserror::Error; - -#[derive(Error, Debug, PartialEq)] -pub enum HackError { - #[error("{0}")] - /// this is needed so we can use `bucket.load(...)?` and have it auto-converted to the custom error - Std(#[from] StdError), - // this is whatever we want - #[error("Unauthorized")] - Unauthorized {}, -} diff --git a/contracts/floaty/src/floats.rs b/contracts/floaty/src/floats.rs new file mode 100644 index 0000000000..16b245d372 --- /dev/null +++ b/contracts/floaty/src/floats.rs @@ -0,0 +1,212 @@ +use rand_chacha::rand_core::RngCore; + +pub const INF_32: u32 = 0x7f800000; +pub const NEG_INF_32: u32 = 0xff800000; +pub const INF_64: u64 = 0x7ff0000000000000; +pub const NEG_INF_64: u64 = 0xfff0000000000000; + +const EXPONENT_MASK_32: u32 = 0x7f800000; +const EXPONENT_MASK_64: u64 = 0x7ff0000000000000; +const SIGN_MASK_32: u32 = 0x80000000; +const SIGN_MASK_64: u64 = 0x8000000000000000; +const MANTISSA_MASK_32: u32 = 0x007fffff; +const MANTISSA_MASK_64: u64 = 0x000fffffffffffff; + +/// Returns a random `f32`. +/// +/// We want to cover all classes of floats: NaNs, subnormals, infinities, and normal floats. +/// Because of that, we don't just generate a random `u32` and convert it to an `f32` +/// (that would make e.g. infinities highly unlikely) +/// Instead, we give each of these classes a probability of 25% and +/// then generate a random pattern within that class +pub fn random_f32(rng: &mut impl RngCore) -> f32 { + let decider = rng.next_u32(); + let bits = match decider % 4 { + 0 => { + // 25% chance of being a NaN + random_nan_32(rng) + } + 1 => { + // 25% chance of being a subnormal + random_subnormal_32(rng) + } + 2 => { + // 25% chance of being an infinite + if decider % 2 == 0 { + INF_32 + } else { + NEG_INF_32 + } + } + 3 => { + // 25% chance of being a random bit pattern + rng.next_u32() + } + _ => unreachable!(), + }; + f32::from_bits(bits) +} + +/// Returns a random `f64`. +/// +/// See [`random_f32`] for more details. +pub fn random_f64(rng: &mut impl RngCore) -> f64 { + let decider = rng.next_u64(); + let bits = match decider % 4 { + 0 => { + // 25% chance of being a NaN + random_nan_64(rng) + } + 1 => { + // 25% chance of being a subnormal + random_subnormal_64(rng) + } + 2 => { + // 25% chance of being an infinite + if decider % 2 == 0 { + INF_64 + } else { + NEG_INF_64 + } + } + 3 => { + // 25% chance of being a random bit pattern + rng.next_u64() + } + _ => unreachable!(), + }; + f64::from_bits(bits) +} + +/// Returns bits for a random NaN +pub fn random_nan_32(rng: &mut impl RngCore) -> u32 { + let mut rnd = rng.next_u32(); + if rnd == 0 { + // we don't want to return an infinity, so we just set the last bit to 1 + rnd = 1; + } + // Set the exponent to all 1s and remaining bits random + EXPONENT_MASK_32 | rnd +} + +/// Returns bits for a random NaN +pub fn random_nan_64(rng: &mut impl RngCore) -> u64 { + let mut rnd = rng.next_u64(); + if rnd == 0 { + // we don't want to return an infinity, so we just set the last bit to 1 + rnd = 1; + } + // Set the exponent to all 1s and remaining bits random + EXPONENT_MASK_64 | rnd +} + +/// Returns bits for a random subnormal +pub fn random_subnormal_32(rng: &mut impl RngCore) -> u32 { + // Set the exponent to all 0s and remaining bits random + let res = rng.next_u32() & (SIGN_MASK_32 | MANTISSA_MASK_32); + + if res == 0 { + // we don't want to return a zero, so we just return a fixed subnormal + SIGN_MASK_32 | MANTISSA_MASK_32 + } else { + res + } +} + +/// Returns bits for a random subnormal +pub fn random_subnormal_64(rng: &mut impl RngCore) -> u64 { + // Set the exponent to all 0s and remaining bits random + let res = rng.next_u64() & (SIGN_MASK_64 | MANTISSA_MASK_64); + + if res == 0 { + // we don't want to return a zero, so we just return a fixed subnormal + SIGN_MASK_64 | MANTISSA_MASK_64 + } else { + res + } +} + +#[cfg(test)] +mod tests { + use rand_chacha::rand_core::SeedableRng; + + use super::*; + + #[derive(Debug, Clone, Copy, PartialEq, Eq)] + pub enum Class { + Normal, + Subnormal, + Zero, + Infinite, + NaN, + } + + pub trait Classifier { + fn classify(&self) -> Class; + } + + impl Classifier for u32 { + fn classify(&self) -> Class { + let exponent = self & EXPONENT_MASK_32; + let mantissa = self & MANTISSA_MASK_32; + + match (exponent, mantissa) { + (0, 0) => Class::Zero, + (0, _) => Class::Subnormal, + (EXPONENT_MASK_32, 0) => Class::Infinite, + (EXPONENT_MASK_32, _) => Class::NaN, + _ => Class::Normal, + } + } + } + + impl Classifier for u64 { + fn classify(&self) -> Class { + let exponent = self & EXPONENT_MASK_64; + let mantissa = self & MANTISSA_MASK_64; + + match (exponent, mantissa) { + (0, 0) => Class::Zero, + (0, _) => Class::Subnormal, + (EXPONENT_MASK_64, 0) => Class::Infinite, + (EXPONENT_MASK_64, _) => Class::NaN, + _ => Class::Normal, + } + } + } + + #[test] + fn test_constants() { + assert_eq!(INF_32, f32::INFINITY.to_bits()); + assert_eq!(NEG_INF_32, f32::NEG_INFINITY.to_bits()); + assert_eq!(INF_64, f64::INFINITY.to_bits()); + assert_eq!(NEG_INF_64, f64::NEG_INFINITY.to_bits()); + } + + #[test] + fn test_classify() { + // for 32-bit floats + assert_eq!((-0f32).to_bits().classify(), Class::Zero); + assert_eq!(0u32.classify(), Class::Zero); + assert_eq!(1f32.to_bits().classify(), Class::Normal); + assert_eq!(INF_32.classify(), Class::Infinite); + assert_eq!(NEG_INF_32.classify(), Class::Infinite); + + // for 64-bit floats + assert_eq!((-0f64).to_bits().classify(), Class::Zero); + assert_eq!(0u64.classify(), Class::Zero); + assert_eq!(1f64.to_bits().classify(), Class::Normal); + assert_eq!(INF_64.classify(), Class::Infinite); + assert_eq!(NEG_INF_64.classify(), Class::Infinite); + + // random floats + let mut rng = rand_chacha::ChaChaRng::seed_from_u64(123456); + for _ in 0..1000 { + assert_eq!(random_subnormal_32(&mut rng).classify(), Class::Subnormal); + assert_eq!(random_nan_32(&mut rng).classify(), Class::NaN); + + assert_eq!(random_subnormal_64(&mut rng).classify(), Class::Subnormal); + assert_eq!(random_nan_64(&mut rng).classify(), Class::NaN); + } + } +} diff --git a/contracts/floaty/src/instructions.rs b/contracts/floaty/src/instructions.rs new file mode 100644 index 0000000000..d264330852 --- /dev/null +++ b/contracts/floaty/src/instructions.rs @@ -0,0 +1,555 @@ +use cosmwasm_schema::cw_serde; +use rand_chacha::rand_core::RngCore; + +use crate::floats::{random_f32, random_f64}; + +/// Not intended for direct usage +#[cfg_attr(not(target_arch = "wasm32"), allow(unused_macros))] +macro_rules! run_instr { + ($instr:expr, $input:expr, $input_ty:ty, $return_ty:ty) => {{ + let input: $input_ty = $input; + let ret: $return_ty; + unsafe { + core::arch::asm!("local.get {0}", $instr, "local.set {1}", in(local) input, out(local) ret) + }; + ret + }}; + ($instr:expr, $input1:expr, $input1_ty:ty, $input2:expr, $input2_ty:ty, $return_ty:ty) => {{ + let input1: $input1_ty = $input1; + let input2: $input2_ty = $input2; + let ret: $return_ty; + unsafe { + core::arch::asm!("local.get {0}", "local.get {1}", $instr, "local.set {2}", in(local) input1, in(local) input2, out(local) ret) + }; + ret + }}; +} +#[cfg_attr(not(target_arch = "wasm32"), allow(unused_imports))] +pub(crate) use run_instr; + +/// Helper to run a single WebAssembly instruction in a type-safe way +#[cfg_attr(not(target_arch = "wasm32"), allow(unused_macros))] +macro_rules! run { + ("f32.eq", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.eq", $input1, f32, $input2, f32, u32) + }; + ("f32.ne", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.ne", $input1, f32, $input2, f32, u32) + }; + ("f32.lt", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.lt", $input1, f32, $input2, f32, u32) + }; + ("f32.gt", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.gt", $input1, f32, $input2, f32, u32) + }; + ("f32.le", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.le", $input1, f32, $input2, f32, u32) + }; + ("f32.ge", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.ge", $input1, f32, $input2, f32, u32) + }; + ("f64.eq", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.eq", $input1, f64, $input2, f64, u32) + }; + ("f64.ne", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.ne", $input1, f64, $input2, f64, u32) + }; + ("f64.lt", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.lt", $input1, f64, $input2, f64, u32) + }; + ("f64.gt", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.gt", $input1, f64, $input2, f64, u32) + }; + ("f64.le", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.le", $input1, f64, $input2, f64, u32) + }; + ("f64.ge", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.ge", $input1, f64, $input2, f64, u32) + }; + // + ("f32.abs", $input:expr) => { + $crate::instructions::run_instr!("f32.abs", $input, f32, f32) + }; + ("f32.neg", $input:expr) => { + $crate::instructions::run_instr!("f32.neg", $input, f32, f32) + }; + ("f32.ceil", $input:expr) => { + $crate::instructions::run_instr!("f32.ceil", $input, f32, f32) + }; + ("f32.floor", $input:expr) => { + $crate::instructions::run_instr!("f32.floor", $input, f32, f32) + }; + ("f32.trunc", $input:expr) => { + $crate::instructions::run_instr!("f32.trunc", $input, f32, f32) + }; + ("f32.nearest", $input:expr) => { + $crate::instructions::run_instr!("f32.nearest", $input, f32, f32) + }; + ("f32.sqrt", $input:expr) => { + $crate::instructions::run_instr!("f32.sqrt", $input, f32, f32) + }; + ("f32.add", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.add", $input1, f32, $input2, f32, f32) + }; + ("f32.sub", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.sub", $input1, f32, $input2, f32, f32) + }; + ("f32.mul", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.mul", $input1, f32, $input2, f32, f32) + }; + ("f32.div", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.div", $input1, f32, $input2, f32, f32) + }; + ("f32.min", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.min", $input1, f32, $input2, f32, f32) + }; + ("f32.max", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.max", $input1, f32, $input2, f32, f32) + }; + ("f32.copysign", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f32.copysign", $input1, f32, $input2, f32, f32) + }; + ("f64.abs", $input:expr) => { + $crate::instructions::run_instr!("f64.abs", $input, f64, f64) + }; + ("f64.neg", $input:expr) => { + $crate::instructions::run_instr!("f64.neg", $input, f64, f64) + }; + ("f64.ceil", $input:expr) => { + $crate::instructions::run_instr!("f64.ceil", $input, f64, f64) + }; + ("f64.floor", $input:expr) => { + $crate::instructions::run_instr!("f64.floor", $input, f64, f64) + }; + ("f64.trunc", $input:expr) => { + $crate::instructions::run_instr!("f64.trunc", $input, f64, f64) + }; + ("f64.nearest", $input:expr) => { + $crate::instructions::run_instr!("f64.nearest", $input, f64, f64) + }; + ("f64.sqrt", $input:expr) => { + $crate::instructions::run_instr!("f64.sqrt", $input, f64, f64) + }; + ("f64.add", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.add", $input1, f64, $input2, f64, f64) + }; + ("f64.sub", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.sub", $input1, f64, $input2, f64, f64) + }; + ("f64.mul", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.mul", $input1, f64, $input2, f64, f64) + }; + ("f64.div", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.div", $input1, f64, $input2, f64, f64) + }; + ("f64.min", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.min", $input1, f64, $input2, f64, f64) + }; + ("f64.max", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.max", $input1, f64, $input2, f64, f64) + }; + ("f64.copysign", $input1:expr, $input2:expr) => { + $crate::instructions::run_instr!("f64.copysign", $input1, f64, $input2, f64, f64) + }; + // + ("i32.trunc_f32_s", $input:expr) => { + $crate::instructions::run_instr!("i32.trunc_f32_s", $input, f32, i32) + }; + ("i32.trunc_f32_u", $input:expr) => { + $crate::instructions::run_instr!("i32.trunc_f32_u", $input, f32, u32) + }; + ("i32.trunc_f64_s", $input:expr) => { + $crate::instructions::run_instr!("i32.trunc_f64_s", $input, f64, i32) + }; + ("i32.trunc_f64_u", $input:expr) => { + $crate::instructions::run_instr!("i32.trunc_f64_u", $input, f64, u32) + }; + // + ("i64.trunc_f32_s", $input:expr) => { + $crate::instructions::run_instr!("i64.trunc_f32_s", $input, f32, i64) + }; + ("i64.trunc_f32_u", $input:expr) => { + $crate::instructions::run_instr!("i64.trunc_f32_u", $input, f32, u64) + }; + ("i64.trunc_f64_s", $input:expr) => { + $crate::instructions::run_instr!("i64.trunc_f64_s", $input, f64, i64) + }; + ("i64.trunc_f64_u", $input:expr) => { + $crate::instructions::run_instr!("i64.trunc_f64_u", $input, f64, u64) + }; + // + ("f32.convert_i32_s", $input:expr) => { + $crate::instructions::run_instr!("f32.convert_i32_s", $input, i32, f32) + }; + ("f32.convert_i32_u", $input:expr) => { + $crate::instructions::run_instr!("f32.convert_i32_u", $input, u32, f32) + }; + ("f32.convert_i64_s", $input:expr) => { + $crate::instructions::run_instr!("f32.convert_i64_s", $input, i64, f32) + }; + ("f32.convert_i64_u", $input:expr) => { + $crate::instructions::run_instr!("f32.convert_i64_u", $input, u64, f32) + }; + ("f32.demote_f64", $input:expr) => { + $crate::instructions::run_instr!("f32.demote_f64", $input, f64, f32) + }; + ("f64.convert_i32_s", $input:expr) => { + $crate::instructions::run_instr!("f64.convert_i32_s", $input, i32, f64) + }; + ("f64.convert_i32_u", $input:expr) => { + $crate::instructions::run_instr!("f64.convert_i32_u", $input, u32, f64) + }; + ("f64.convert_i64_s", $input:expr) => { + $crate::instructions::run_instr!("f64.convert_i64_s", $input, i64, f64) + }; + ("f64.convert_i64_u", $input:expr) => { + $crate::instructions::run_instr!("f64.convert_i64_u", $input, u64, f64) + }; + ("f64.promote_f32", $input:expr) => { + $crate::instructions::run_instr!("f64.promote_f32", $input, f32, f64) + }; + // + ("i32.reinterpret_f32", $input:expr) => { + $crate::instructions::run_instr!("i32.reinterpret_f32", $input, f32, i32) + }; + ("i64.reinterpret_f64", $input:expr) => { + $crate::instructions::run_instr!("i64.reinterpret_f64", $input, f64, i64) + }; + ("f32.reinterpret_i32", $input:expr) => { + $crate::instructions::run_instr!("f32.reinterpret_i32", $input, u32, f32) + }; + ("f64.reinterpret_i64", $input:expr) => { + $crate::instructions::run_instr!("f64.reinterpret_i64", $input, u64, f64) + }; + // + ("i32.trunc_sat_f32_s", $input:expr) => { + $crate::instructions::run_instr!("i32.trunc_sat_f32_s", $input, f32, i32) + }; + ("i32.trunc_sat_f32_u", $input:expr) => { + $crate::instructions::run_instr!("i32.trunc_sat_f32_u", $input, f32, u32) + }; + ("i32.trunc_sat_f64_s", $input:expr) => { + $crate::instructions::run_instr!("i32.trunc_sat_f64_s", $input, f64, i32) + }; + ("i32.trunc_sat_f64_u", $input:expr) => { + $crate::instructions::run_instr!("i32.trunc_sat_f64_u", $input, f64, u32) + }; + ("i64.trunc_sat_f32_s", $input:expr) => { + $crate::instructions::run_instr!("i64.trunc_sat_f32_s", $input, f32, i64) + }; + ("i64.trunc_sat_f32_u", $input:expr) => { + $crate::instructions::run_instr!("i64.trunc_sat_f32_u", $input, f32, u64) + }; + ("i64.trunc_sat_f64_s", $input:expr) => { + $crate::instructions::run_instr!("i64.trunc_sat_f64_s", $input, f64, i64) + }; + ("i64.trunc_sat_f64_u", $input:expr) => { + $crate::instructions::run_instr!("i64.trunc_sat_f64_u", $input, f64, u64) + }; +} +#[cfg_attr(not(target_arch = "wasm32"), allow(unused_imports))] +pub(crate) use run; + +#[cw_serde] +pub enum Value { + U32(u32), + U64(u64), + F32(u32), + F64(u64), +} + +impl Value { + pub fn u32(&self) -> u32 { + match self { + Self::U32(x) => *x, + v => panic!("expected u32, got {:?}", v), + } + } + + pub fn u64(&self) -> u64 { + match self { + Self::U64(x) => *x, + v => panic!("expected u64, got {:?}", v), + } + } + + pub fn f32(&self) -> f32 { + match self { + Self::F32(x) => f32::from_bits(*x), + v => panic!("expected f32, got {:?}", v), + } + } + + pub fn f64(&self) -> f64 { + match self { + Self::F64(x) => f64::from_bits(*x), + v => panic!("expected f64, got {:?}", v), + } + } +} + +/// Runs the given instruction with random inputs +#[cfg(target_arch = "wasm32")] +pub fn run_instruction(instr: &str, args: &[Value]) -> Value { + use Value::*; + + let arg1 = || args.get(0).unwrap(); + let arg2 = || args.get(0).unwrap(); + + match instr { + "f32.eq" => U32(run!("f32.eq", arg1().f32(), arg2().f32())), + "f32.ne" => U32(run!("f32.ne", arg1().f32(), arg2().f32())), + "f32.lt" => U32(run!("f32.lt", arg1().f32(), arg2().f32())), + "f32.gt" => U32(run!("f32.gt", arg1().f32(), arg2().f32())), + "f32.le" => U32(run!("f32.le", arg1().f32(), arg2().f32())), + "f32.ge" => U32(run!("f32.ge", arg1().f32(), arg2().f32())), + "f64.eq" => U32(run!("f64.eq", arg1().f64(), arg2().f64())), + "f64.ne" => U32(run!("f64.ne", arg1().f64(), arg2().f64())), + "f64.lt" => U32(run!("f64.lt", arg1().f64(), arg2().f64())), + "f64.gt" => U32(run!("f64.gt", arg1().f64(), arg2().f64())), + "f64.le" => U32(run!("f64.le", arg1().f64(), arg2().f64())), + "f64.ge" => U32(run!("f64.ge", arg1().f64(), arg2().f64())), + // + "f32.abs" => U32(run!("f32.abs", arg1().f32()).to_bits()), + "f32.neg" => U32(run!("f32.neg", arg1().f32()).to_bits()), + "f32.ceil" => U32(run!("f32.ceil", arg1().f32()).to_bits()), + "f32.floor" => U32(run!("f32.floor", arg1().f32()).to_bits()), + "f32.trunc" => U32(run!("f32.trunc", arg1().f32()).to_bits()), + "f32.nearest" => U32(run!("f32.nearest", arg1().f32()).to_bits()), + "f32.sqrt" => U32(run!("f32.sqrt", arg1().f32()).to_bits()), + "f32.add" => U32(run!("f32.add", arg1().f32(), arg2().f32()).to_bits()), + "f32.sub" => U32(run!("f32.sub", arg1().f32(), arg2().f32()).to_bits()), + "f32.mul" => U32(run!("f32.mul", arg1().f32(), arg2().f32()).to_bits()), + "f32.div" => U32(run!("f32.div", arg1().f32(), arg2().f32()).to_bits()), + "f32.min" => U32(run!("f32.min", arg1().f32(), arg2().f32()).to_bits()), + "f32.max" => U32(run!("f32.max", arg1().f32(), arg2().f32()).to_bits()), + "f32.copysign" => U32(run!("f32.copysign", arg1().f32(), arg2().f32()).to_bits()), + "f64.abs" => U64(run!("f64.abs", arg1().f64()).to_bits()), + "f64.neg" => U64(run!("f64.neg", arg1().f64()).to_bits()), + "f64.ceil" => U64(run!("f64.ceil", arg1().f64()).to_bits()), + "f64.floor" => U64(run!("f64.floor", arg1().f64()).to_bits()), + "f64.trunc" => U64(run!("f64.trunc", arg1().f64()).to_bits()), + "f64.nearest" => U64(run!("f64.nearest", arg1().f64()).to_bits()), + "f64.sqrt" => U64(run!("f64.sqrt", arg1().f64()).to_bits()), + "f64.add" => U64(run!("f64.add", arg1().f64(), arg2().f64()).to_bits()), + "f64.sub" => U64(run!("f64.sub", arg1().f64(), arg2().f64()).to_bits()), + "f64.mul" => U64(run!("f64.mul", arg1().f64(), arg2().f64()).to_bits()), + "f64.div" => U64(run!("f64.div", arg1().f64(), arg2().f64()).to_bits()), + "f64.min" => U64(run!("f64.min", arg1().f64(), arg2().f64()).to_bits()), + "f64.max" => U64(run!("f64.max", arg1().f64(), arg2().f64()).to_bits()), + "f64.copysign" => U64(run!("f64.copysign", arg1().f64(), arg2().f64()).to_bits()), + // + "i32.trunc_f32_s" => U32(run!("i32.trunc_f32_s", arg1().f32()) as u32), + "i32.trunc_f32_u" => U32(run!("i32.trunc_f32_u", arg1().f32())), + "i32.trunc_f64_s" => U32(run!("i32.trunc_f64_s", arg1().f64()) as u32), + "i32.trunc_f64_u" => U32(run!("i32.trunc_f64_u", arg1().f64())), + // + "i64.trunc_f32_s" => U64(run!("i64.trunc_f32_s", arg1().f32()) as u64), + "i64.trunc_f32_u" => U64(run!("i64.trunc_f32_u", arg1().f32())), + "i64.trunc_f64_s" => U64(run!("i64.trunc_f64_s", arg1().f64()) as u64), + "i64.trunc_f64_u" => U64(run!("i64.trunc_f64_u", arg1().f64())), + // + "f32.convert_i32_s" => U32(run!("f32.convert_i32_s", arg1().u32() as i32).to_bits()), + "f32.convert_i32_u" => U32(run!("f32.convert_i32_u", arg1().u32()).to_bits()), + "f32.convert_i64_s" => U32(run!("f32.convert_i64_s", arg1().u64() as i64).to_bits()), + "f32.convert_i64_u" => U32(run!("f32.convert_i64_u", arg1().u64()).to_bits()), + "f32.demote_f64" => U32(run!("f32.demote_f64", arg1().f64()).to_bits()), + "f64.convert_i32_s" => U64(run!("f64.convert_i32_s", arg1().u32() as i32).to_bits()), + "f64.convert_i32_u" => U64(run!("f64.convert_i32_u", arg1().u32()).to_bits()), + "f64.convert_i64_s" => U64(run!("f64.convert_i64_s", arg1().u64() as i64).to_bits()), + "f64.convert_i64_u" => U64(run!("f64.convert_i64_u", arg1().u64()).to_bits()), + "f64.promote_f32" => U64(run!("f64.promote_f32", arg1().f32()).to_bits()), + // + "i32.reinterpret_f32" => U32(run!("i32.reinterpret_f32", arg1().f32()) as u32), + "i64.reinterpret_f64" => U64(run!("i64.reinterpret_f64", arg1().f64()) as u64), + "f32.reinterpret_i32" => U32(run!("f32.reinterpret_i32", arg1().u32()).to_bits() as u32), + "f64.reinterpret_i64" => U64(run!("f64.reinterpret_i64", arg1().u64()).to_bits() as u64), + // + "i32.trunc_sat_f32_s" => U32(run!("i32.trunc_sat_f32_s", arg1().f32()) as u32), + "i32.trunc_sat_f32_u" => U32(run!("i32.trunc_sat_f32_u", arg1().f32()) as u32), + "i32.trunc_sat_f64_s" => U32(run!("i32.trunc_sat_f64_s", arg1().f64()) as u32), + "i32.trunc_sat_f64_u" => U32(run!("i32.trunc_sat_f64_u", arg1().f64()) as u32), + "i64.trunc_sat_f32_s" => U64(run!("i64.trunc_sat_f32_s", arg1().f32()) as u64), + "i64.trunc_sat_f32_u" => U64(run!("i64.trunc_sat_f32_u", arg1().f32()) as u64), + "i64.trunc_sat_f64_s" => U64(run!("i64.trunc_sat_f64_s", arg1().f64()) as u64), + "i64.trunc_sat_f64_u" => U64(run!("i64.trunc_sat_f64_u", arg1().f64()) as u64), + _ => panic!("unknown instruction: {}", instr), + } +} + +pub fn random_args_for(instr: &str, rng: &mut impl RngCore) -> Vec { + let a = random_f32(rng); + let b = random_f32(rng); + let c = random_f64(rng); + let d = random_f64(rng); + let e = rng.next_u32(); + let f = rng.next_u64(); + + use Value::*; + + let f32x2 = vec![F32(a.to_bits()), F32(b.to_bits())]; + let f64x2 = vec![F64(c.to_bits()), F64(d.to_bits())]; + let f32 = vec![F32(a.to_bits())]; + let f64 = vec![F64(c.to_bits())]; + let u32 = vec![U32(e)]; + let u64 = vec![U64(f)]; + + match instr { + "f32.eq" => f32x2, + "f32.ne" => f32x2, + "f32.lt" => f32x2, + "f32.gt" => f32x2, + "f32.le" => f32x2, + "f32.ge" => f32x2, + "f64.eq" => f64x2, + "f64.ne" => f64x2, + "f64.lt" => f64x2, + "f64.gt" => f64x2, + "f64.le" => f64x2, + "f64.ge" => f64x2, + // + "f32.abs" => f32, + "f32.neg" => f32, + "f32.ceil" => f32, + "f32.floor" => f32, + "f32.trunc" => f32, + "f32.nearest" => f32, + "f32.sqrt" => f32, + "f32.add" => f32x2, + "f32.sub" => f32x2, + "f32.mul" => f32x2, + "f32.div" => f32x2, + "f32.min" => f32x2, + "f32.max" => f32x2, + "f32.copysign" => f32x2, + "f64.abs" => f64, + "f64.neg" => f64, + "f64.ceil" => f64, + "f64.floor" => f64, + "f64.trunc" => f64, + "f64.nearest" => f64, + "f64.sqrt" => f64, + "f64.add" => f64x2, + "f64.sub" => f64x2, + "f64.mul" => f64x2, + "f64.div" => f64x2, + "f64.min" => f64x2, + "f64.max" => f64x2, + "f64.copysign" => f64x2, + // + "i32.trunc_f32_s" => f32, + "i32.trunc_f32_u" => f32, + "i32.trunc_f64_s" => f64, + "i32.trunc_f64_u" => f64, + // + "i64.trunc_f32_s" => f32, + "i64.trunc_f32_u" => f32, + "i64.trunc_f64_s" => f64, + "i64.trunc_f64_u" => f64, + // + "f32.convert_i32_s" => u32, + "f32.convert_i32_u" => u32, + "f32.convert_i64_s" => u64, + "f32.convert_i64_u" => u64, + "f32.demote_f64" => f64, + "f64.convert_i32_s" => u32, + "f64.convert_i32_u" => u32, + "f64.convert_i64_s" => u64, + "f64.convert_i64_u" => u64, + "f64.promote_f32" => f32, + // + "i32.reinterpret_f32" => f32, + "i64.reinterpret_f64" => f64, + "f32.reinterpret_i32" => u32, + "f64.reinterpret_i64" => u64, + // + "i32.trunc_sat_f32_s" => f32, + "i32.trunc_sat_f32_u" => f32, + "i32.trunc_sat_f64_s" => f64, + "i32.trunc_sat_f64_u" => f64, + "i64.trunc_sat_f32_s" => f32, + "i64.trunc_sat_f32_u" => f32, + "i64.trunc_sat_f64_s" => f64, + "i64.trunc_sat_f64_u" => f64, + _ => panic!("unknown instruction: {}", instr), + } +} + +pub const FLOAT_INSTRUCTIONS: [&str; 70] = [ + "f32.eq", + "f32.ne", + "f32.lt", + "f32.gt", + "f32.le", + "f32.ge", + "f64.eq", + "f64.ne", + "f64.lt", + "f64.gt", + "f64.le", + "f64.ge", + // + "f32.abs", + "f32.neg", + "f32.ceil", + "f32.floor", + "f32.trunc", + "f32.nearest", + "f32.sqrt", + "f32.add", + "f32.sub", + "f32.mul", + "f32.div", + "f32.min", + "f32.max", + "f32.copysign", + "f64.abs", + "f64.neg", + "f64.ceil", + "f64.floor", + "f64.trunc", + "f64.nearest", + "f64.sqrt", + "f64.add", + "f64.sub", + "f64.mul", + "f64.div", + "f64.min", + "f64.max", + "f64.copysign", + // + "i32.trunc_f32_s", + "i32.trunc_f32_u", + "i32.trunc_f64_s", + "i32.trunc_f64_u", + // + "i64.trunc_f32_s", + "i64.trunc_f32_u", + "i64.trunc_f64_s", + "i64.trunc_f64_u", + // + "f32.convert_i32_s", + "f32.convert_i32_u", + "f32.convert_i64_s", + "f32.convert_i64_u", + "f32.demote_f64", + "f64.convert_i32_s", + "f64.convert_i32_u", + "f64.convert_i64_s", + "f64.convert_i64_u", + "f64.promote_f32", + // + "i32.reinterpret_f32", + "i64.reinterpret_f64", + "f32.reinterpret_i32", + "f64.reinterpret_i64", + // + "i32.trunc_sat_f32_s", + "i32.trunc_sat_f32_u", + "i32.trunc_sat_f64_s", + "i32.trunc_sat_f64_u", + "i64.trunc_sat_f32_s", + "i64.trunc_sat_f32_u", + "i64.trunc_sat_f64_s", + "i64.trunc_sat_f64_u", +]; diff --git a/contracts/floaty/src/lib.rs b/contracts/floaty/src/lib.rs index 0573cc96c3..ba67016d30 100644 --- a/contracts/floaty/src/lib.rs +++ b/contracts/floaty/src/lib.rs @@ -1,4 +1,7 @@ +#![cfg_attr(target_arch = "wasm32", feature(asm_experimental_arch))] + pub mod contract; -mod errors; +pub(crate) mod floats; +mod instructions; pub mod msg; pub mod state; diff --git a/contracts/floaty/src/msg.rs b/contracts/floaty/src/msg.rs index caa8fc4e3e..6baa9a1efe 100644 --- a/contracts/floaty/src/msg.rs +++ b/contracts/floaty/src/msg.rs @@ -1,30 +1,26 @@ use cosmwasm_schema::{cw_serde, QueryResponses}; -#[cw_serde] -pub struct InstantiateMsg { - pub verifier: String, - pub beneficiary: String, -} +use crate::instructions::Value; #[cw_serde] -pub enum ExecuteMsg { - /// Releasing all funds in the contract to the beneficiary. This is the only "proper" action of this demo contract. - Release {}, +pub enum ValueType { + Float, + Int, } #[cw_serde] #[derive(QueryResponses)] pub enum QueryMsg { - /// returns a human-readable representation of the verifier - /// use to ensure query path works in integration tests - #[returns(VerifierResponse)] - Verifier {}, - /// This returns cosmwasm_std::AllBalanceResponse to demo use of the querier - #[returns(cosmwasm_std::AllBalanceResponse)] - OtherBalance { address: String }, -} - -#[cw_serde] -pub struct VerifierResponse { - pub verifier: String, + /// Returns valid random arguments for the given instruction + #[returns(Vec)] + RandomArgsFor { instruction: String, seed: u64 }, + /// Returns a list of all instructions + #[returns(Vec)] + Instructions {}, + /// Runs the given instruction with the given arguments and returns the result + #[returns(Value)] + Run { + instruction: String, + args: Vec, + }, } diff --git a/contracts/floaty/tests/integration.rs b/contracts/floaty/tests/integration.rs index 5d3de04e58..593ae1d1e0 100644 --- a/contracts/floaty/tests/integration.rs +++ b/contracts/floaty/tests/integration.rs @@ -6,7 +6,6 @@ static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/fl // static WASM: &[u8] = include_bytes!("../contract.wasm"); #[test] -#[should_panic(expected = "Float operator detected")] -fn instantiate_fails() { - let mut _deps = mock_instance(WASM, &[]); +fn validation_succeeds() { + mock_instance(WASM, &[]); } diff --git a/contracts/hackatom/.cargo/config b/contracts/hackatom/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/hackatom/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/hackatom/.cargo/config.toml b/contracts/hackatom/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/hackatom/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/hackatom/Cargo.lock b/contracts/hackatom/Cargo.lock index 1e4b664d70..5e36190549 100644 --- a/contracts/hackatom/Cargo.lock +++ b/contracts/hackatom/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,118 +17,349 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "base64ct" -version = "1.5.0" +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -136,55 +367,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -192,204 +462,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -406,98 +605,196 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "darling" -version = "0.13.0" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "darling_core", - "darling_macro", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +name = "cw-schema" +version = "3.0.3-dev" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", ] [[package]] -name = "darling_macro" -version = "0.13.0" +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -505,13 +802,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -522,57 +819,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -595,46 +912,110 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -642,68 +1023,69 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] @@ -713,40 +1095,43 @@ version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cosmwasm-vm", - "schemars", + "schemars 0.8.21", "serde", - "sha2 0.10.3", + "sha2", "thiserror", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -760,230 +1145,520 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "k256" -version = "0.11.3" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "quote", - "syn", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "mach" -version = "0.3.2" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.59.0", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "adler", - "autocfg", + "either", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "hermit-abi", - "libc", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.25.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "memchr", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", ] [[package]] name = "object" -version = "0.28.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.11.2", + "flate2", + "hashbrown 0.14.5", "indexmap", "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.8.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "pkcs8" -version = "0.9.0" +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "der", - "spki", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro-error" @@ -994,7 +1669,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1009,13 +1684,35 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1024,7 +1721,16 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "ptr_meta_derive", + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", ] [[package]] @@ -1035,28 +1741,46 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", "rand_chacha", - "rand_core 0.6.3", - "rand_hc", + "rand_core", ] [[package]] @@ -1066,152 +1790,198 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core", ] [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.1.16", + "getrandom", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "getrandom 0.2.3", + "either", + "rayon-core", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "rand_core 0.6.3", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "bitflags 2.5.0", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "ref-cast-impl", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ - "bitflags", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "region" -version = "3.0.0" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ - "winapi", + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", ] [[package]] name = "rend" -version = "0.3.6" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" dependencies = [ - "bytecheck", + "bytecheck 0.8.0", ] [[package]] name = "rfc6979" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", "rend", "rkyv_derive", - "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", ] [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1219,178 +1989,295 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schemars" -version = "0.8.6" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" dependencies = [ "dyn-clone", - "schemars_derive", + "ref-cast", + "schemars_derive 1.0.4", "serde", "serde_json", ] [[package]] name = "schemars_derive" -version = "0.8.6" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.87", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "schemars_derive" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", "generic-array", - "pkcs8", "subtle", "zeroize", ] [[package]] -name = "serde" -version = "1.0.126" +name = "self_cell" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ - "serde", + "serde_derive", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "serde-wasm-bindgen" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" dependencies = [ + "js-sys", "serde", + "wasm-bindgen", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_derive_internals" -version = "0.25.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "serde_with" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "sha2" -version = "0.10.3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "cpufeatures", + "digest", ] [[package]] -name = "signature" -version = "1.5.0" +name = "shared-buffer" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "bytes", + "memmap2 0.6.2", ] [[package]] -name = "smallvec" -version = "1.6.1" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "spki" -version = "0.6.0" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "base64ct", - "der", + "digest", + "rand_core", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1405,147 +2292,285 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "target-lexicon" -version = "0.12.2" +name = "syn" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "tempfile" -version = "3.2.0" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" -dependencies = [ - "thiserror-impl", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1553,24 +2578,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1578,113 +2603,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1694,252 +2701,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/hackatom/Cargo.toml b/contracts/hackatom/Cargo.toml index 1a91f1100f..84e4405319 100644 --- a/contracts/hackatom/Cargo.toml +++ b/contracts/hackatom/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -22,22 +20,13 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# For quicker tests, cargo test --lib. for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["abort"] } -schemars = "0.8.3" +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["cosmwasm_2_2", "exports", "std"] } +schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } sha2 = "0.10" -thiserror = "1.0" +thiserror = "1.0.26" [dev-dependencies] -cosmwasm-storage = { path = "../../packages/storage", default-features = false } cosmwasm-vm = { path = "../../packages/vm", default-features = false } diff --git a/contracts/hackatom/schema/cw_schema/hackatom.json b/contracts/hackatom/schema/cw_schema/hackatom.json new file mode 100644 index 0000000000..10438be690 --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/hackatom.json @@ -0,0 +1,272 @@ +{ + "contract_name": "hackatom", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_InstantiateMsg", + "type": "struct", + "properties": { + "beneficiary": { + "value": 1 + }, + "verifier": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_ExecuteMsg", + "type": "enum", + "cases": { + "allocate_large_memory": { + "description": "Allocate large amounts of memory without consuming much gas", + "type": "named", + "properties": { + "pages": { + "value": 2 + } + } + }, + "cpu_loop": { + "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "type": "named", + "properties": {} + }, + "memory_loop": { + "description": "Infinite loop reading and writing memory", + "type": "named", + "properties": {} + }, + "message_loop": { + "description": "Infinite loop sending message to itself", + "type": "named", + "properties": {} + }, + "panic": { + "description": "Trigger a panic to ensure framework handles gracefully", + "type": "named", + "properties": {} + }, + "release": { + "description": "Releasing all funds of the given denom in the contract to the beneficiary.\nThis is the only \"proper\" action of this demo contract.", + "type": "named", + "properties": { + "denom": { + "value": 1 + } + } + }, + "storage_loop": { + "description": "Infinite loop making storage calls (to test when their limit hits)", + "type": "named", + "properties": {} + }, + "user_errors_in_api_calls": { + "description": "Starting with CosmWasm 0.10, some API calls return user errors back to the contract.\nThis triggers such user errors, ensuring the transaction does not fail in the backend.", + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_QueryMsg", + "type": "enum", + "cases": { + "get_int": { + "description": "GetInt returns a hardcoded u32 value", + "type": "named", + "properties": {} + }, + "recurse": { + "description": "Recurse will execute a query into itself up to depth-times and return\nEach step of the recursion may perform some extra work to test gas metering\n(`work` rounds of sha256 on contract).\nNow that we have Env, we can auto-calculate the address to recurse into", + "type": "named", + "properties": { + "depth": { + "value": 1 + }, + "work": { + "value": 1 + } + } + }, + "verifier": { + "description": "returns a human-readable representation of the verifier\nuse to ensure query path works in integration tests", + "type": "named", + "properties": {} + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] + }, + "migrate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_MigrateMsg", + "description": "MigrateMsg allows a privileged contract administrator to run\na migration on the contract. In this (demo) case it is just migrating\nfrom one hackatom code to the same code, but taking advantage of the\nmigration step to set a new validator.\n\nNote that the contract doesn't enforce permissions here, this is done\nby blockchain logic (in the future by blockchain governance)", + "type": "struct", + "properties": { + "verifier": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "sudo": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_SudoMsg", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call.\nThis is showing how we can expose \"admin\" functionality that can not be called by\nexternal users or contracts, but only trusted (native/Go) code in the blockchain", + "type": "enum", + "cases": { + "steal_funds": { + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "recipient": { + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 3 + }, + "denom": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 2 + } + ] + }, + "responses": { + "get_int": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_IntResponse", + "type": "struct", + "properties": { + "int": { + "value": 1 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] + }, + "recurse": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_RecurseResponse", + "type": "struct", + "properties": { + "hashed": { + "description": "hashed is the result of running sha256 \"work+1\" times on the contract's human address", + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + } + ] + }, + "verifier": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_VerifierResponse", + "type": "struct", + "properties": { + "verifier": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] + } + } +} diff --git a/contracts/hackatom/schema/cw_schema/raw/execute.json b/contracts/hackatom/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..e780a61427 --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/raw/execute.json @@ -0,0 +1,70 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_ExecuteMsg", + "type": "enum", + "cases": { + "allocate_large_memory": { + "description": "Allocate large amounts of memory without consuming much gas", + "type": "named", + "properties": { + "pages": { + "value": 2 + } + } + }, + "cpu_loop": { + "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "type": "named", + "properties": {} + }, + "memory_loop": { + "description": "Infinite loop reading and writing memory", + "type": "named", + "properties": {} + }, + "message_loop": { + "description": "Infinite loop sending message to itself", + "type": "named", + "properties": {} + }, + "panic": { + "description": "Trigger a panic to ensure framework handles gracefully", + "type": "named", + "properties": {} + }, + "release": { + "description": "Releasing all funds of the given denom in the contract to the beneficiary.\nThis is the only \"proper\" action of this demo contract.", + "type": "named", + "properties": { + "denom": { + "value": 1 + } + } + }, + "storage_loop": { + "description": "Infinite loop making storage calls (to test when their limit hits)", + "type": "named", + "properties": {} + }, + "user_errors_in_api_calls": { + "description": "Starting with CosmWasm 0.10, some API calls return user errors back to the contract.\nThis triggers such user errors, ensuring the transaction does not fail in the backend.", + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] +} diff --git a/contracts/hackatom/schema/cw_schema/raw/instantiate.json b/contracts/hackatom/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..17e197e1ca --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,22 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_InstantiateMsg", + "type": "struct", + "properties": { + "beneficiary": { + "value": 1 + }, + "verifier": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/hackatom/schema/cw_schema/raw/migrate.json b/contracts/hackatom/schema/cw_schema/raw/migrate.json new file mode 100644 index 0000000000..4af9d6707a --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/raw/migrate.json @@ -0,0 +1,20 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_MigrateMsg", + "description": "MigrateMsg allows a privileged contract administrator to run\na migration on the contract. In this (demo) case it is just migrating\nfrom one hackatom code to the same code, but taking advantage of the\nmigration step to set a new validator.\n\nNote that the contract doesn't enforce permissions here, this is done\nby blockchain logic (in the future by blockchain governance)", + "type": "struct", + "properties": { + "verifier": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/hackatom/schema/cw_schema/raw/query.json b/contracts/hackatom/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..223992cd32 --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/raw/query.json @@ -0,0 +1,40 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_QueryMsg", + "type": "enum", + "cases": { + "get_int": { + "description": "GetInt returns a hardcoded u32 value", + "type": "named", + "properties": {} + }, + "recurse": { + "description": "Recurse will execute a query into itself up to depth-times and return\nEach step of the recursion may perform some extra work to test gas metering\n(`work` rounds of sha256 on contract).\nNow that we have Env, we can auto-calculate the address to recurse into", + "type": "named", + "properties": { + "depth": { + "value": 1 + }, + "work": { + "value": 1 + } + } + }, + "verifier": { + "description": "returns a human-readable representation of the verifier\nuse to ensure query path works in integration tests", + "type": "named", + "properties": {} + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] +} diff --git a/contracts/hackatom/schema/cw_schema/raw/response_to_get_int.json b/contracts/hackatom/schema/cw_schema/raw/response_to_get_int.json new file mode 100644 index 0000000000..9d623647ea --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/raw/response_to_get_int.json @@ -0,0 +1,21 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_IntResponse", + "type": "struct", + "properties": { + "int": { + "value": 1 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] +} diff --git a/contracts/hackatom/schema/cw_schema/raw/response_to_recurse.json b/contracts/hackatom/schema/cw_schema/raw/response_to_recurse.json new file mode 100644 index 0000000000..e4a426b05e --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/raw/response_to_recurse.json @@ -0,0 +1,21 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_RecurseResponse", + "type": "struct", + "properties": { + "hashed": { + "description": "hashed is the result of running sha256 \"work+1\" times on the contract's human address", + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + } + ] +} diff --git a/contracts/hackatom/schema/cw_schema/raw/response_to_verifier.json b/contracts/hackatom/schema/cw_schema/raw/response_to_verifier.json new file mode 100644 index 0000000000..e6d15cc267 --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/raw/response_to_verifier.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_VerifierResponse", + "type": "struct", + "properties": { + "verifier": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/hackatom/schema/cw_schema/raw/sudo.json b/contracts/hackatom/schema/cw_schema/raw/sudo.json new file mode 100644 index 0000000000..9a57cde6fc --- /dev/null +++ b/contracts/hackatom/schema/cw_schema/raw/sudo.json @@ -0,0 +1,52 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "hackatom_msg_SudoMsg", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call.\nThis is showing how we can expose \"admin\" functionality that can not be called by\nexternal users or contracts, but only trusted (native/Go) code in the blockchain", + "type": "enum", + "cases": { + "steal_funds": { + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "recipient": { + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 3 + }, + "denom": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 2 + } + ] +} diff --git a/contracts/hackatom/schema/hackatom.json b/contracts/hackatom/schema/hackatom.json index 23ee0acdb8..707ee9da9d 100644 --- a/contracts/hackatom/schema/hackatom.json +++ b/contracts/hackatom/schema/hackatom.json @@ -25,7 +25,7 @@ "title": "ExecuteMsg", "oneOf": [ { - "description": "Releasing all funds in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", + "description": "Releasing all funds of the given denom in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", "type": "object", "required": [ "release" @@ -33,6 +33,14 @@ "properties": { "release": { "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, "additionalProperties": false } }, @@ -166,28 +174,6 @@ }, "additionalProperties": false }, - { - "description": "This returns cosmwasm_std::AllBalanceResponse to demo use of the querier", - "type": "object", - "required": [ - "other_balance" - ], - "properties": { - "other_balance": { - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, { "description": "Recurse will execute a query into itself up to depth-times and return Each step of the recursion may perform some extra work to test gas metering (`work` rounds of sha256 on contract). Now that we have Env, we can auto-calculate the address to recurse into", "type": "object", @@ -252,7 +238,7 @@ "sudo": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SudoMsg", - "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality than can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality that can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", "oneOf": [ { "type": "object", @@ -292,15 +278,16 @@ ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "$ref": "#/definitions/Uint256" }, "denom": { "type": "string" } - } + }, + "additionalProperties": false }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", "type": "string" } } @@ -322,44 +309,6 @@ }, "additionalProperties": false }, - "other_balance": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AllBalanceResponse", - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "description": "Returns all non-zero coins held by this account.", - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - } - }, - "definitions": { - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, "recurse": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "RecurseResponse", diff --git a/contracts/hackatom/schema/raw/execute.json b/contracts/hackatom/schema/raw/execute.json new file mode 100644 index 0000000000..c018dc234f --- /dev/null +++ b/contracts/hackatom/schema/raw/execute.json @@ -0,0 +1,136 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Releasing all funds of the given denom in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", + "type": "object", + "required": [ + "release" + ], + "properties": { + "release": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "type": "object", + "required": [ + "cpu_loop" + ], + "properties": { + "cpu_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop making storage calls (to test when their limit hits)", + "type": "object", + "required": [ + "storage_loop" + ], + "properties": { + "storage_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop reading and writing memory", + "type": "object", + "required": [ + "memory_loop" + ], + "properties": { + "memory_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop sending message to itself", + "type": "object", + "required": [ + "message_loop" + ], + "properties": { + "message_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Allocate large amounts of memory without consuming much gas", + "type": "object", + "required": [ + "allocate_large_memory" + ], + "properties": { + "allocate_large_memory": { + "type": "object", + "required": [ + "pages" + ], + "properties": { + "pages": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Trigger a panic to ensure framework handles gracefully", + "type": "object", + "required": [ + "panic" + ], + "properties": { + "panic": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Starting with CosmWasm 0.10, some API calls return user errors back to the contract. This triggers such user errors, ensuring the transaction does not fail in the backend.", + "type": "object", + "required": [ + "user_errors_in_api_calls" + ], + "properties": { + "user_errors_in_api_calls": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/hackatom/schema/raw/instantiate.json b/contracts/hackatom/schema/raw/instantiate.json new file mode 100644 index 0000000000..8639103d34 --- /dev/null +++ b/contracts/hackatom/schema/raw/instantiate.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "beneficiary", + "verifier" + ], + "properties": { + "beneficiary": { + "type": "string" + }, + "verifier": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/hackatom/schema/raw/migrate.json b/contracts/hackatom/schema/raw/migrate.json new file mode 100644 index 0000000000..2696e3ac26 --- /dev/null +++ b/contracts/hackatom/schema/raw/migrate.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "description": "MigrateMsg allows a privileged contract administrator to run a migration on the contract. In this (demo) case it is just migrating from one hackatom code to the same code, but taking advantage of the migration step to set a new validator.\n\nNote that the contract doesn't enforce permissions here, this is done by blockchain logic (in the future by blockchain governance)", + "type": "object", + "required": [ + "verifier" + ], + "properties": { + "verifier": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/hackatom/schema/raw/query.json b/contracts/hackatom/schema/raw/query.json new file mode 100644 index 0000000000..a00ee6aeab --- /dev/null +++ b/contracts/hackatom/schema/raw/query.json @@ -0,0 +1,64 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "returns a human-readable representation of the verifier use to ensure query path works in integration tests", + "type": "object", + "required": [ + "verifier" + ], + "properties": { + "verifier": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Recurse will execute a query into itself up to depth-times and return Each step of the recursion may perform some extra work to test gas metering (`work` rounds of sha256 on contract). Now that we have Env, we can auto-calculate the address to recurse into", + "type": "object", + "required": [ + "recurse" + ], + "properties": { + "recurse": { + "type": "object", + "required": [ + "depth", + "work" + ], + "properties": { + "depth": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "work": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "GetInt returns a hardcoded u32 value", + "type": "object", + "required": [ + "get_int" + ], + "properties": { + "get_int": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/hackatom/schema/raw/response_to_get_int.json b/contracts/hackatom/schema/raw/response_to_get_int.json new file mode 100644 index 0000000000..018fd695e1 --- /dev/null +++ b/contracts/hackatom/schema/raw/response_to_get_int.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "IntResponse", + "type": "object", + "required": [ + "int" + ], + "properties": { + "int": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false +} diff --git a/contracts/hackatom/schema/raw/response_to_recurse.json b/contracts/hackatom/schema/raw/response_to_recurse.json new file mode 100644 index 0000000000..3d50847ef9 --- /dev/null +++ b/contracts/hackatom/schema/raw/response_to_recurse.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RecurseResponse", + "type": "object", + "required": [ + "hashed" + ], + "properties": { + "hashed": { + "description": "hashed is the result of running sha256 \"work+1\" times on the contract's human address", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + } + } +} diff --git a/contracts/hackatom/schema/raw/response_to_verifier.json b/contracts/hackatom/schema/raw/response_to_verifier.json new file mode 100644 index 0000000000..fb04c86d67 --- /dev/null +++ b/contracts/hackatom/schema/raw/response_to_verifier.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifierResponse", + "type": "object", + "required": [ + "verifier" + ], + "properties": { + "verifier": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/hackatom/schema/raw/sudo.json b/contracts/hackatom/schema/raw/sudo.json new file mode 100644 index 0000000000..f75740e274 --- /dev/null +++ b/contracts/hackatom/schema/raw/sudo.json @@ -0,0 +1,57 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SudoMsg", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality that can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", + "oneOf": [ + { + "type": "object", + "required": [ + "steal_funds" + ], + "properties": { + "steal_funds": { + "type": "object", + "required": [ + "amount", + "recipient" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "recipient": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + } + } +} diff --git a/contracts/hackatom/examples/schema.rs b/contracts/hackatom/src/bin/schema.rs similarity index 100% rename from contracts/hackatom/examples/schema.rs rename to contracts/hackatom/src/bin/schema.rs diff --git a/contracts/hackatom/src/contract.rs b/contracts/hackatom/src/contract.rs index 8365b78b55..771a5f7147 100644 --- a/contracts/hackatom/src/contract.rs +++ b/contracts/hackatom/src/contract.rs @@ -1,9 +1,9 @@ use sha2::{Digest, Sha256}; use cosmwasm_std::{ - entry_point, from_slice, to_binary, to_vec, Addr, AllBalanceResponse, Api, BankMsg, - CanonicalAddr, Deps, DepsMut, Env, Event, MessageInfo, QueryRequest, QueryResponse, Response, - StdError, StdResult, WasmMsg, WasmQuery, + entry_point, from_json, to_json_binary, to_json_vec, Addr, Api, BankMsg, CanonicalAddr, Deps, + DepsMut, Env, Event, MessageInfo, MigrateInfo, QueryRequest, QueryResponse, Response, StdError, + StdErrorKind, StdResult, WasmMsg, WasmQuery, }; use crate::errors::HackError; @@ -24,7 +24,7 @@ pub fn instantiate( deps.storage.set( CONFIG_KEY, - &to_vec(&State { + &to_json_vec(&State { verifier: deps.api.addr_validate(&msg.verifier)?, beneficiary: deps.api.addr_validate(&msg.beneficiary)?, funder: info.sender, @@ -35,15 +35,28 @@ pub fn instantiate( Ok(Response::new().add_attribute("Let the", "hacking begin")) } +const CONTRACT_MIGRATE_VERSION: u64 = 420; + #[entry_point] -pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> Result { +#[migrate_version(CONTRACT_MIGRATE_VERSION)] +pub fn migrate( + deps: DepsMut, + _env: Env, + msg: MigrateMsg, + migrate_info: MigrateInfo, +) -> Result { + if let Some(old_version) = migrate_info.old_migrate_version { + if CONTRACT_MIGRATE_VERSION <= old_version { + return Err(HackError::Downgrade); + } + } let data = deps .storage .get(CONFIG_KEY) - .ok_or_else(|| StdError::not_found("State"))?; - let mut config: State = from_slice(&data)?; + .ok_or_else(|| StdError::msg("State not found"))?; + let mut config: State = from_json(data)?; config.verifier = deps.api.addr_validate(&msg.verifier)?; - deps.storage.set(CONFIG_KEY, &to_vec(&config)?); + deps.storage.set(CONFIG_KEY, &to_json_vec(&config)?); Ok(Response::default()) } @@ -69,7 +82,7 @@ pub fn execute( msg: ExecuteMsg, ) -> Result { match msg { - ExecuteMsg::Release {} => do_release(deps, env, info), + ExecuteMsg::Release { denom } => do_release(deps, env, info, denom), ExecuteMsg::CpuLoop {} => do_cpu_loop(), ExecuteMsg::StorageLoop {} => do_storage_loop(deps), ExecuteMsg::MemoryLoop {} => do_memory_loop(), @@ -80,16 +93,21 @@ pub fn execute( } } -fn do_release(deps: DepsMut, env: Env, info: MessageInfo) -> Result { +fn do_release( + deps: DepsMut, + env: Env, + info: MessageInfo, + denom: String, +) -> Result { let data = deps .storage .get(CONFIG_KEY) - .ok_or_else(|| StdError::not_found("State"))?; - let state: State = from_slice(&data)?; + .ok_or_else(|| StdError::msg("State not found"))?; + let state: State = from_json(data)?; if info.sender == state.verifier { let to_addr = state.beneficiary; - let balance = deps.querier.query_all_balances(env.contract.address)?; + let balance = deps.querier.query_balance(env.contract.address, denom)?; let resp = Response::new() .add_attribute("action", "release") @@ -97,7 +115,7 @@ fn do_release(deps: DepsMut, env: Env, info: MessageInfo) -> Result Result { fn do_message_loop(env: Env) -> Result { let resp = Response::new().add_message(WasmMsg::Execute { contract_addr: env.contract.address.into(), - msg: to_binary(&ExecuteMsg::MessageLoop {})?, + msg: to_json_binary(&ExecuteMsg::MessageLoop {})?, funds: vec![], }); Ok(resp) @@ -144,22 +162,22 @@ fn do_message_loop(env: Env) -> Result { #[allow(unused_variables)] fn do_allocate_large_memory(pages: u32) -> Result { - // We create memory pages explicitely since Rust's default allocator seems to be clever enough + // We create memory pages explicitly since Rust's default allocator seems to be clever enough // to not grow memory for unused capacity like `Vec::::with_capacity(100 * 1024 * 1024)`. - // Even with std::alloc::alloc the memory did now grow beyond 1.5 MiB. + // Even with std::alloc::alloc the memory did not grow beyond 1.5 MiB. #[cfg(target_arch = "wasm32")] { use core::arch::wasm32; let old_size = wasm32::memory_grow(0, pages as usize); if old_size == usize::max_value() { - return Err(StdError::generic_err("memory.grow failed").into()); + return Err(StdError::msg("memory.grow failed").into()); } Ok(Response::new().set_data((old_size as u32).to_be_bytes())) } #[cfg(not(target_arch = "wasm32"))] - Err(StdError::generic_err("Unsupported architecture").into()) + Err(StdError::msg("Unsupported architecture").into()) } fn do_panic() -> Result { @@ -185,63 +203,45 @@ fn do_user_errors_in_api_calls(api: &dyn Api) -> Result { // Canonicalize let empty = ""; - match api.addr_canonicalize(empty).unwrap_err() { - StdError::GenericErr { .. } => {} - err => { - return Err(StdError::generic_err(format!( - "Unexpected error in do_user_errors_in_api_calls: {:?}", - err - )) - .into()) - } - } - - let invalid_bech32 = - "bn9hhssomeltvhzgvuqkwjkpwxojfuigltwedayzxljucefikuieillowaticksoistqoynmgcnj219a"; - match api.addr_canonicalize(invalid_bech32).unwrap_err() { - StdError::GenericErr { .. } => {} + match api.addr_canonicalize(empty).unwrap_err().kind() { + StdErrorKind::Other => {} err => { - return Err(StdError::generic_err(format!( - "Unexpected error in do_user_errors_in_api_calls: {:?}", - err + return Err(StdError::msg(format_args!( + "Unexpected error in do_user_errors_in_api_calls: {err:?}" )) .into()) } } - // Humanize - - let empty: CanonicalAddr = vec![].into(); - match api.addr_humanize(&empty).unwrap_err() { - StdError::GenericErr { .. } => {} + let invalid = "bn9hhssomeltvhzgvuqkwjkpwxoj"; + match api.addr_canonicalize(invalid).unwrap_err().kind() { + StdErrorKind::Other => {} err => { - return Err(StdError::generic_err(format!( - "Unexpected error in do_user_errors_in_api_calls: {:?}", - err + return Err(StdError::msg(format_args!( + "Unexpected error in do_user_errors_in_api_calls: {err:?}" )) .into()) } } - let too_short: CanonicalAddr = vec![0xAA, 0xBB, 0xCC].into(); - match api.addr_humanize(&too_short).unwrap_err() { - StdError::GenericErr { .. } => {} + let too_long = "cosmwasm1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqehqqkz"; + match api.addr_canonicalize(too_long).unwrap_err().kind() { + StdErrorKind::Other => {} err => { - return Err(StdError::generic_err(format!( - "Unexpected error in do_user_errors_in_api_calls: {:?}", - err + return Err(StdError::msg(format_args!( + "Unexpected error in do_user_errors_in_api_calls: {err:?}" )) .into()) } } - let wrong_length: CanonicalAddr = vec![0xA6; 17].into(); - match api.addr_humanize(&wrong_length).unwrap_err() { - StdError::GenericErr { .. } => {} + // Humanize + let empty: CanonicalAddr = vec![].into(); + match api.addr_humanize(&empty).unwrap_err().kind() { + StdErrorKind::Other => {} err => { - return Err(StdError::generic_err(format!( - "Unexpected error in do_user_errors_in_api_calls: {:?}", - err + return Err(StdError::msg(format_args!( + "Unexpected error in do_user_errors_in_api_calls: {err:?}" )) .into()) } @@ -253,12 +253,11 @@ fn do_user_errors_in_api_calls(api: &dyn Api) -> Result { #[entry_point] pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { match msg { - QueryMsg::Verifier {} => to_binary(&query_verifier(deps)?), - QueryMsg::OtherBalance { address } => to_binary(&query_other_balance(deps, address)?), + QueryMsg::Verifier {} => to_json_binary(&query_verifier(deps)?), QueryMsg::Recurse { depth, work } => { - to_binary(&query_recurse(deps, depth, work, env.contract.address)?) + to_json_binary(&query_recurse(deps, depth, work, env.contract.address)?) } - QueryMsg::GetInt {} => to_binary(&query_int()), + QueryMsg::GetInt {} => to_json_binary(&query_int()), } } @@ -266,18 +265,13 @@ fn query_verifier(deps: Deps) -> StdResult { let data = deps .storage .get(CONFIG_KEY) - .ok_or_else(|| StdError::not_found("State"))?; - let state: State = from_slice(&data)?; + .ok_or_else(|| StdError::msg("State not found"))?; + let state: State = from_json(data)?; Ok(VerifierResponse { verifier: state.verifier.into(), }) } -fn query_other_balance(deps: Deps, address: String) -> StdResult { - let amount = deps.querier.query_all_balances(address)?; - Ok(AllBalanceResponse { amount }) -} - fn query_recurse(deps: Deps, depth: u32, work: u32, contract: Addr) -> StdResult { // perform all hashes as requested let mut hashed: Vec = contract.as_str().into(); @@ -298,7 +292,7 @@ fn query_recurse(deps: Deps, depth: u32, work: u32, contract: Addr) -> StdResult }; let query = QueryRequest::Wasm(WasmQuery::Smart { contract_addr: contract.into(), - msg: to_binary(&req)?, + msg: to_json_binary(&req)?, }); deps.querier.query(&query) } @@ -311,37 +305,36 @@ fn query_int() -> IntResponse { #[cfg(test)] mod tests { use super::*; - use cosmwasm_std::testing::{ - mock_dependencies, mock_dependencies_with_balances, mock_env, mock_info, MOCK_CONTRACT_ADDR, - }; + use cosmwasm_std::testing::{message_info, mock_dependencies, mock_env, MOCK_CONTRACT_ADDR}; // import trait Storage to get access to read - use cosmwasm_std::{coins, Binary, Storage, SubMsg}; + use cosmwasm_std::{coin, coins, Binary, Storage, SubMsg}; #[test] fn proper_initialization() { let mut deps = mock_dependencies(); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); + let creator = deps.api.addr_make("creator"); + let expected_state = State { - verifier: deps.api.addr_validate(&verifier).unwrap(), - beneficiary: deps.api.addr_validate(&beneficiary).unwrap(), - funder: deps.api.addr_validate(&creator).unwrap(), + verifier: verifier.clone(), + beneficiary: beneficiary.clone(), + funder: creator.clone(), }; let msg = InstantiateMsg { - verifier, - beneficiary, + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), }; - let info = mock_info(creator.as_str(), &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(res.messages.len(), 0); assert_eq!(res.attributes, [("Let the", "hacking begin")]); // it worked, let's check the state let data = deps.storage.get(CONFIG_KEY).expect("no data stored"); - let state: State = from_slice(&data).unwrap(); + let state: State = from_json(data).unwrap(); assert_eq!(state, expected_state); } @@ -349,47 +342,56 @@ mod tests { fn instantiate_and_query() { let mut deps = mock_dependencies(); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); + let creator = deps.api.addr_make("creator"); + let msg = InstantiateMsg { - verifier: verifier.clone(), - beneficiary, + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), }; - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(0, res.messages.len()); // now let's query let query_response = query_verifier(deps.as_ref()).unwrap(); - assert_eq!(query_response.verifier, verifier); + assert_eq!(query_response.verifier, verifier.as_str()); } #[test] fn migrate_verifier() { let mut deps = mock_dependencies(); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); + let creator = deps.api.addr_make("creator"); + let msg = InstantiateMsg { - verifier, - beneficiary, + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), }; - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(0, res.messages.len()); // check it is 'verifies' let query_response = query(deps.as_ref(), mock_env(), QueryMsg::Verifier {}).unwrap(); - assert_eq!(query_response.as_slice(), b"{\"verifier\":\"verifies\"}"); + assert_eq!( + query_response.as_slice(), + format!(r#"{{"verifier":"{verifier}"}}"#).as_bytes() + ); // change the verifier via migrate - let new_verifier = String::from("someone else"); + let new_verifier: String = deps.api.addr_make("someone else").into(); let msg = MigrateMsg { verifier: new_verifier.clone(), }; - let res = migrate(deps.as_mut(), mock_env(), msg).unwrap(); + let migrate_info = MigrateInfo { + sender: creator, + old_migrate_version: None, + }; + let res = migrate(deps.as_mut(), mock_env(), msg, migrate_info).unwrap(); assert_eq!(0, res.messages.len()); // check it is 'someone else' @@ -401,43 +403,35 @@ mod tests { fn sudo_can_steal_tokens() { let mut deps = mock_dependencies(); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); + let creator = deps.api.addr_make("creator"); + let msg = InstantiateMsg { - verifier, - beneficiary, + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), }; - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(0, res.messages.len()); // sudo takes any tax it wants - let to_address = String::from("community-pool"); + let to_address = deps.api.addr_make("community-pool"); let amount = coins(700, "gold"); let sys_msg = SudoMsg::StealFunds { - recipient: to_address.clone(), + recipient: to_address.to_string(), amount: amount.clone(), }; let res = sudo(deps.as_mut(), mock_env(), sys_msg).unwrap(); assert_eq!(1, res.messages.len()); - let msg = res.messages.get(0).expect("no message"); - assert_eq!(msg, &SubMsg::new(BankMsg::Send { to_address, amount })); - } - - #[test] - fn querier_callbacks_work() { - let rich_addr = String::from("foobar"); - let rich_balance = coins(10000, "gold"); - let deps = mock_dependencies_with_balances(&[(&rich_addr, &rich_balance)]); - - // querying with balance gets the balance - let bal = query_other_balance(deps.as_ref(), rich_addr).unwrap(); - assert_eq!(bal.amount, rich_balance); - - // querying other accounts gets none - let bal = query_other_balance(deps.as_ref(), String::from("someone else")).unwrap(); - assert_eq!(bal.amount, vec![]); + let msg = res.messages.first().expect("no message"); + assert_eq!( + msg, + &SubMsg::new(BankMsg::Send { + to_address: to_address.to_string(), + amount + }) + ); } #[test] @@ -445,87 +439,160 @@ mod tests { let mut deps = mock_dependencies(); // initialize the store - let creator = String::from("creator"); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); + let creator = deps.api.addr_make("creator"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); let instantiate_msg = InstantiateMsg { - verifier: verifier.clone(), - beneficiary: beneficiary.clone(), + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), }; let init_amount = coins(1000, "earth"); - let init_info = mock_info(&creator, &init_amount); - let init_res = instantiate(deps.as_mut(), mock_env(), init_info, instantiate_msg).unwrap(); + let info = message_info(&creator, &init_amount); + let init_res = instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); assert_eq!(init_res.messages.len(), 0); // balance changed in init - deps.querier.update_balance(MOCK_CONTRACT_ADDR, init_amount); + deps.querier + .bank + .update_balance(MOCK_CONTRACT_ADDR, init_amount); // beneficiary can release it - let execute_info = mock_info(verifier.as_str(), &[]); + let execute_info = message_info(&verifier, &[]); let execute_res = execute( deps.as_mut(), mock_env(), execute_info, - ExecuteMsg::Release {}, + ExecuteMsg::Release { + denom: "earth".to_string(), + }, ) .unwrap(); assert_eq!(execute_res.messages.len(), 1); - let msg = execute_res.messages.get(0).expect("no message"); + let msg = execute_res.messages.first().expect("no message"); assert_eq!( msg, &SubMsg::new(BankMsg::Send { - to_address: beneficiary, + to_address: beneficiary.to_string(), amount: coins(1000, "earth"), }), ); assert_eq!( execute_res.attributes, - vec![("action", "release"), ("destination", "benefits")], + vec![("action", "release"), ("destination", beneficiary.as_str())], ); assert_eq!(execute_res.data, Some(vec![0xF0, 0x0B, 0xAA].into())); } + #[test] + fn execute_release_can_be_called_multiple_times() { + let mut deps = mock_dependencies(); + + // initialize the store + let creator = deps.api.addr_make("creator"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); + + let instantiate_msg = InstantiateMsg { + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), + }; + let init_amount = vec![coin(1000, "earth"), coin(70, "sun")]; + let info = message_info(&creator, &init_amount); + instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); + + // balance changed in init + deps.querier + .bank + .update_balance(MOCK_CONTRACT_ADDR, init_amount); + + // beneficiary can release it + let execute_info = message_info(&verifier, &[]); + let execute_res = execute( + deps.as_mut(), + mock_env(), + execute_info, + ExecuteMsg::Release { + denom: "sun".to_string(), + }, + ) + .unwrap(); + assert_eq!(execute_res.messages.len(), 1); + let msg = execute_res.messages.first().expect("no message"); + assert_eq!( + msg, + &SubMsg::new(BankMsg::Send { + to_address: beneficiary.to_string(), + amount: coins(70, "sun"), + }), + ); + + // beneficiary can release it again + let execute_info = message_info(&verifier, &[]); + let execute_res = execute( + deps.as_mut(), + mock_env(), + execute_info, + ExecuteMsg::Release { + denom: "earth".to_string(), + }, + ) + .unwrap(); + assert_eq!(execute_res.messages.len(), 1); + let msg = execute_res.messages.first().expect("no message"); + assert_eq!( + msg, + &SubMsg::new(BankMsg::Send { + to_address: beneficiary.to_string(), + amount: coins(1000, "earth"), + }), + ); + } + #[test] fn execute_release_fails_for_wrong_sender() { let mut deps = mock_dependencies(); // initialize the store - let creator = String::from("creator"); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); + let creator = deps.api.addr_make("creator"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); let instantiate_msg = InstantiateMsg { - verifier: verifier.clone(), - beneficiary: beneficiary.clone(), + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), }; let init_amount = coins(1000, "earth"); - let init_info = mock_info(&creator, &init_amount); - let init_res = instantiate(deps.as_mut(), mock_env(), init_info, instantiate_msg).unwrap(); + let info = message_info(&creator, &init_amount); + let init_res = instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); assert_eq!(init_res.messages.len(), 0); // balance changed in init - deps.querier.update_balance(MOCK_CONTRACT_ADDR, init_amount); + deps.querier + .bank + .update_balance(MOCK_CONTRACT_ADDR, init_amount); // beneficiary cannot release it - let execute_info = mock_info(beneficiary.as_str(), &[]); + let execute_info = message_info(&beneficiary, &[]); let execute_res = execute( deps.as_mut(), mock_env(), execute_info, - ExecuteMsg::Release {}, + ExecuteMsg::Release { + denom: "earth".to_string(), + }, ); - assert_eq!(execute_res.unwrap_err(), HackError::Unauthorized {}); + assert_eq!(execute_res.unwrap_err().to_string(), "Unauthorized"); // state should not change let data = deps.storage.get(CONFIG_KEY).expect("no data stored"); - let state: State = from_slice(&data).unwrap(); + let state: State = from_json(data).unwrap(); assert_eq!( state, State { - verifier: Addr::unchecked(verifier), - beneficiary: Addr::unchecked(beneficiary), - funder: Addr::unchecked(creator), + verifier: verifier.clone(), + beneficiary: beneficiary.clone(), + funder: creator.clone(), } ); } @@ -536,19 +603,19 @@ mod tests { let mut deps = mock_dependencies(); // initialize the store - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); + let creator = deps.api.addr_make("creator"); let instantiate_msg = InstantiateMsg { - verifier, - beneficiary: beneficiary.clone(), + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), }; - let init_info = mock_info(&creator, &coins(1000, "earth")); - let init_res = instantiate(deps.as_mut(), mock_env(), init_info, instantiate_msg).unwrap(); + let info = message_info(&creator, &coins(1000, "earth")); + let init_res = instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); assert_eq!(0, init_res.messages.len()); - let execute_info = mock_info(&beneficiary, &[]); + let execute_info = message_info(&beneficiary, &[]); // this should panic let _ = execute( deps.as_mut(), @@ -562,15 +629,20 @@ mod tests { fn execute_user_errors_in_api_calls() { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make("creator"); + let anyone = deps.api.addr_make("anyone"); + let verifier = deps.api.addr_make("verifies"); + let beneficiary = deps.api.addr_make("benefits"); + let instantiate_msg = InstantiateMsg { - verifier: String::from("verifies"), - beneficiary: String::from("benefits"), + verifier: verifier.to_string(), + beneficiary: beneficiary.to_string(), }; - let init_info = mock_info("creator", &coins(1000, "earth")); - let init_res = instantiate(deps.as_mut(), mock_env(), init_info, instantiate_msg).unwrap(); - assert_eq!(0, init_res.messages.len()); + let info = message_info(&creator, &coins(1000, "earth")); + let response = instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); + assert_eq!(0, response.messages.len()); - let execute_info = mock_info("anyone", &[]); + let execute_info = message_info(&anyone, &[]); execute( deps.as_mut(), mock_env(), @@ -589,7 +661,7 @@ mod tests { let contract = Addr::unchecked("my-contract"); let bin_contract: &[u8] = b"my-contract"; - // return the unhashed value here + // return the un-hashed value here let no_work_query = query_recurse(deps.as_ref(), 0, 0, contract.clone()).unwrap(); assert_eq!(no_work_query.hashed, Binary::from(bin_contract)); diff --git a/contracts/hackatom/src/errors.rs b/contracts/hackatom/src/errors.rs index 7b46b00b63..1913a804f9 100644 --- a/contracts/hackatom/src/errors.rs +++ b/contracts/hackatom/src/errors.rs @@ -1,7 +1,7 @@ use cosmwasm_std::StdError; use thiserror::Error; -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Debug)] pub enum HackError { #[error("{0}")] /// this is needed so we can use `bucket.load(...)?` and have it auto-converted to the custom error @@ -9,4 +9,7 @@ pub enum HackError { // this is whatever we want #[error("Unauthorized")] Unauthorized {}, + // this is whatever we want + #[error("Downgrade is not supported")] + Downgrade, } diff --git a/contracts/hackatom/src/msg.rs b/contracts/hackatom/src/msg.rs index 16c454aadb..4a6b5cb924 100644 --- a/contracts/hackatom/src/msg.rs +++ b/contracts/hackatom/src/msg.rs @@ -21,7 +21,7 @@ pub struct MigrateMsg { } /// SudoMsg is only exposed for internal Cosmos SDK modules to call. -/// This is showing how we can expose "admin" functionality than can not be called by +/// This is showing how we can expose "admin" functionality that can not be called by /// external users or contracts, but only trusted (native/Go) code in the blockchain #[cw_serde] pub enum SudoMsg { @@ -35,8 +35,9 @@ pub enum SudoMsg { // https://github.com/cosmwasm/wasmd/issues/8#issuecomment-576146751 #[cw_serde] pub enum ExecuteMsg { - /// Releasing all funds in the contract to the beneficiary. This is the only "proper" action of this demo contract. - Release {}, + /// Releasing all funds of the given denom in the contract to the beneficiary. + /// This is the only "proper" action of this demo contract. + Release { denom: String }, /// Infinite loop to burn cpu cycles (only run when metering is enabled) CpuLoop {}, /// Infinite loop making storage calls (to test when their limit hits) @@ -61,9 +62,6 @@ pub enum QueryMsg { /// use to ensure query path works in integration tests #[returns(VerifierResponse)] Verifier {}, - /// This returns cosmwasm_std::AllBalanceResponse to demo use of the querier - #[returns(cosmwasm_std::AllBalanceResponse)] - OtherBalance { address: String }, /// Recurse will execute a query into itself up to depth-times and return /// Each step of the recursion may perform some extra work to test gas metering /// (`work` rounds of sha256 on contract). diff --git a/contracts/hackatom/tests/integration.rs b/contracts/hackatom/tests/integration.rs index 84bdf53153..c547823de8 100644 --- a/contracts/hackatom/tests/integration.rs +++ b/contracts/hackatom/tests/integration.rs @@ -1,31 +1,16 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests as follows: -//! 1. Copy them over verbatim -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) use cosmwasm_std::{ - assert_approx_eq, coins, from_binary, to_vec, Addr, AllBalanceResponse, BankMsg, Binary, - ContractResult, Empty, Response, SubMsg, + assert_approx_eq, coins, to_json_vec, Addr, BankMsg, Binary, ContractResult, Empty, + MigrateInfo, Response, SubMsg, }; use cosmwasm_vm::{ call_execute, from_slice, testing::{ - execute, instantiate, migrate, mock_env, mock_info, mock_instance, - mock_instance_with_balances, query, sudo, test_io, MOCK_CONTRACT_ADDR, + execute, instantiate, migrate_with_info, mock_env, mock_info, mock_instance, query, sudo, + test_io, MockApi, MOCK_CONTRACT_ADDR, }, Storage, VmError, }; @@ -37,10 +22,10 @@ static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/ha const DESERIALIZATION_LIMIT: usize = 20_000; -fn make_init_msg() -> (InstantiateMsg, String) { - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); +fn make_init_msg(api: &MockApi) -> (InstantiateMsg, String) { + let verifier = api.addr_make("verifies"); + let beneficiary = api.addr_make("benefits"); + let creator = api.addr_make("creator"); ( InstantiateMsg { verifier, @@ -53,11 +38,11 @@ fn make_init_msg() -> (InstantiateMsg, String) { #[test] fn proper_initialization() { let mut deps = mock_instance(WASM, &[]); - assert_eq!(deps.required_capabilities().len(), 0); + assert_eq!(deps.required_capabilities().len(), 7); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api().addr_make("verifies"); + let beneficiary = deps.api().addr_make("benefits"); + let creator = deps.api().addr_make("creator"); let expected_state = State { verifier: Addr::unchecked(&verifier), beneficiary: Addr::unchecked(&beneficiary), @@ -91,11 +76,11 @@ fn proper_initialization() { fn instantiate_and_query() { let mut deps = mock_instance(WASM, &[]); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api().addr_make("verifies"); + let beneficiary = deps.api().addr_make("benefits"); + let creator = deps.api().addr_make("creator"); let msg = InstantiateMsg { - verifier, + verifier: verifier.clone(), beneficiary, }; let info = mock_info(&creator, &coins(1000, "earth")); @@ -104,23 +89,26 @@ fn instantiate_and_query() { // now let's query let query_response = query(&mut deps, mock_env(), QueryMsg::Verifier {}).unwrap(); - assert_eq!(query_response.as_slice(), b"{\"verifier\":\"verifies\"}"); + assert_eq!( + query_response, + format!("{{\"verifier\":\"{verifier}\"}}").as_bytes() + ); // bad query returns parse error (pass wrong type - this connection is not enforced) - let qres = query(&mut deps, mock_env(), ExecuteMsg::Release {}); + let qres = query(&mut deps, mock_env(), ExecuteMsg::Panic {}); let msg = qres.unwrap_err(); - assert!(msg.contains("Error parsing")); + assert!(msg.contains("kind: Serialization"), "{msg}"); } #[test] fn migrate_verifier() { let mut deps = mock_instance(WASM, &[]); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api().addr_make("verifies"); + let beneficiary = deps.api().addr_make("benefits"); + let creator = deps.api().addr_make("creator"); let msg = InstantiateMsg { - verifier, + verifier: verifier.clone(), beneficiary, }; let info = mock_info(&creator, &[]); @@ -129,20 +117,28 @@ fn migrate_verifier() { // check it is 'verifies' let query_response = query(&mut deps, mock_env(), QueryMsg::Verifier {}).unwrap(); - assert_eq!(query_response.as_slice(), b"{\"verifier\":\"verifies\"}"); + assert_eq!( + query_response, + format!("{{\"verifier\":\"{verifier}\"}}").as_bytes() + ); // change the verifier via migrate + let someone_else = deps.api().addr_make("someone else"); let msg = MigrateMsg { - verifier: String::from("someone else"), + verifier: someone_else.clone(), + }; + let migrate_info = MigrateInfo { + sender: Addr::unchecked(creator), + old_migrate_version: None, }; - let res: Response = migrate(&mut deps, mock_env(), msg).unwrap(); + let res: Response = migrate_with_info(&mut deps, mock_env(), msg, migrate_info).unwrap(); assert_eq!(0, res.messages.len()); // check it is 'someone else' let query_response = query(&mut deps, mock_env(), QueryMsg::Verifier {}).unwrap(); assert_eq!( - query_response.as_slice(), - b"{\"verifier\":\"someone else\"}" + query_response, + format!("{{\"verifier\":\"{someone_else}\"}}").as_bytes() ); } @@ -150,9 +146,9 @@ fn migrate_verifier() { fn sudo_can_steal_tokens() { let mut deps = mock_instance(WASM, &[]); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); - let creator = String::from("creator"); + let verifier = deps.api().addr_make("verifies"); + let beneficiary = deps.api().addr_make("benefits"); + let creator = deps.api().addr_make("creator"); let msg = InstantiateMsg { verifier, beneficiary, @@ -162,7 +158,7 @@ fn sudo_can_steal_tokens() { assert_eq!(0, res.messages.len()); // sudo takes any tax it wants - let to_address = String::from("community-pool"); + let to_address = deps.api().addr_make("community-pool"); let amount = coins(700, "gold"); let sys_msg = SudoMsg::StealFunds { recipient: to_address.clone(), @@ -170,40 +166,19 @@ fn sudo_can_steal_tokens() { }; let res: Response = sudo(&mut deps, mock_env(), sys_msg).unwrap(); assert_eq!(1, res.messages.len()); - let msg = res.messages.get(0).expect("no message"); + let msg = res.messages.first().expect("no message"); assert_eq!(msg, &SubMsg::new(BankMsg::Send { to_address, amount })); } -#[test] -fn querier_callbacks_work() { - let rich_addr = String::from("foobar"); - let rich_balance = coins(10000, "gold"); - let mut deps = mock_instance_with_balances(WASM, &[(&rich_addr, &rich_balance)]); - - // querying with balance gets the balance - let query_msg = QueryMsg::OtherBalance { address: rich_addr }; - let query_response = query(&mut deps, mock_env(), query_msg).unwrap(); - let bal: AllBalanceResponse = from_binary(&query_response).unwrap(); - assert_eq!(bal.amount, rich_balance); - - // querying other accounts gets none - let query_msg = QueryMsg::OtherBalance { - address: String::from("someone else"), - }; - let query_response = query(&mut deps, mock_env(), query_msg).unwrap(); - let bal: AllBalanceResponse = from_binary(&query_response).unwrap(); - assert_eq!(bal.amount, vec![]); -} - #[test] fn fails_on_bad_init() { let mut deps = mock_instance(WASM, &[]); let info = mock_info("creator", &coins(1000, "earth")); // bad init returns parse error (pass wrong type - this connection is not enforced) let res: ContractResult = - instantiate(&mut deps, mock_env(), info, ExecuteMsg::Release {}); + instantiate(&mut deps, mock_env(), info, ExecuteMsg::Panic {}); let msg = res.unwrap_err(); - assert!(msg.contains("Error parsing")); + assert!(msg.contains("kind: Serialization"), "{msg}"); } #[test] @@ -211,9 +186,9 @@ fn execute_release_works() { let mut deps = mock_instance(WASM, &[]); // initialize the store - let creator = String::from("creator"); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); + let creator = deps.api().addr_make("creator"); + let verifier = deps.api().addr_make("verifies"); + let beneficiary = deps.api().addr_make("benefits"); let instantiate_msg = InstantiateMsg { verifier: verifier.clone(), @@ -234,20 +209,27 @@ fn execute_release_works() { // beneficiary can release it let execute_info = mock_info(&verifier, &[]); - let execute_res: Response = - execute(&mut deps, mock_env(), execute_info, ExecuteMsg::Release {}).unwrap(); + let execute_res: Response = execute( + &mut deps, + mock_env(), + execute_info, + ExecuteMsg::Release { + denom: "earth".to_string(), + }, + ) + .unwrap(); assert_eq!(execute_res.messages.len(), 1); - let msg = execute_res.messages.get(0).expect("no message"); + let msg = execute_res.messages.first().expect("no message"); assert_eq!( msg, &SubMsg::new(BankMsg::Send { - to_address: beneficiary, + to_address: beneficiary.clone(), amount: coins(1000, "earth"), }), ); assert_eq!( execute_res.attributes, - vec![("action", "release"), ("destination", "benefits")], + vec![("action", "release"), ("destination", beneficiary.as_str())], ); assert_eq!(execute_res.data, Some(vec![0xF0, 0x0B, 0xAA].into())); } @@ -257,9 +239,9 @@ fn execute_release_fails_for_wrong_sender() { let mut deps = mock_instance(WASM, &[]); // initialize the store - let creator = String::from("creator"); - let verifier = String::from("verifies"); - let beneficiary = String::from("benefits"); + let creator = deps.api().addr_make("creator"); + let verifier = deps.api().addr_make("verifies"); + let beneficiary = deps.api().addr_make("benefits"); let instantiate_msg = InstantiateMsg { verifier: verifier.clone(), @@ -280,8 +262,14 @@ fn execute_release_fails_for_wrong_sender() { // beneficiary cannot release it let execute_info = mock_info(&beneficiary, &[]); - let execute_res: ContractResult = - execute(&mut deps, mock_env(), execute_info, ExecuteMsg::Release {}); + let execute_res: ContractResult = execute( + &mut deps, + mock_env(), + execute_info, + ExecuteMsg::Release { + denom: "earth".to_string(), + }, + ); let msg = execute_res.unwrap_err(); assert!(msg.contains("Unauthorized")); @@ -310,7 +298,7 @@ fn execute_release_fails_for_wrong_sender() { fn execute_cpu_loop() { let mut deps = mock_instance(WASM, &[]); - let (instantiate_msg, creator) = make_init_msg(); + let (instantiate_msg, creator) = make_init_msg(deps.api()); let init_info = mock_info(creator.as_str(), &[]); let init_res: Response = instantiate(&mut deps, mock_env(), init_info, instantiate_msg).unwrap(); @@ -322,7 +310,7 @@ fn execute_cpu_loop() { &mut deps, &mock_env(), &execute_info, - &to_vec(&ExecuteMsg::CpuLoop {}).unwrap(), + &to_json_vec(&ExecuteMsg::CpuLoop {}).unwrap(), ); assert!(execute_res.is_err()); assert_eq!(deps.get_gas_left(), 0); @@ -332,7 +320,7 @@ fn execute_cpu_loop() { fn execute_storage_loop() { let mut deps = mock_instance(WASM, &[]); - let (instantiate_msg, creator) = make_init_msg(); + let (instantiate_msg, creator) = make_init_msg(deps.api()); let init_info = mock_info(creator.as_str(), &[]); let init_res: Response = instantiate(&mut deps, mock_env(), init_info, instantiate_msg).unwrap(); @@ -344,7 +332,7 @@ fn execute_storage_loop() { &mut deps, &mock_env(), &execute_info, - &to_vec(&ExecuteMsg::StorageLoop {}).unwrap(), + &to_json_vec(&ExecuteMsg::StorageLoop {}).unwrap(), ); assert!(execute_res.is_err()); assert_eq!(deps.get_gas_left(), 0); @@ -354,7 +342,7 @@ fn execute_storage_loop() { fn execute_memory_loop() { let mut deps = mock_instance(WASM, &[]); - let (instantiate_msg, creator) = make_init_msg(); + let (instantiate_msg, creator) = make_init_msg(deps.api()); let init_info = mock_info(creator.as_str(), &[]); let init_res: Response = instantiate(&mut deps, mock_env(), init_info, instantiate_msg).unwrap(); @@ -366,7 +354,7 @@ fn execute_memory_loop() { &mut deps, &mock_env(), &execute_info, - &to_vec(&ExecuteMsg::MemoryLoop {}).unwrap(), + &to_json_vec(&ExecuteMsg::MemoryLoop {}).unwrap(), ); assert!(execute_res.is_err()); assert_eq!(deps.get_gas_left(), 0); @@ -379,7 +367,7 @@ fn execute_memory_loop() { fn execute_allocate_large_memory() { let mut deps = mock_instance(WASM, &[]); - let (instantiate_msg, creator) = make_init_msg(); + let (instantiate_msg, creator) = make_init_msg(deps.api()); let init_info = mock_info(creator.as_str(), &[]); let init_res: Response = instantiate(&mut deps, mock_env(), init_info, instantiate_msg).unwrap(); @@ -405,9 +393,9 @@ fn execute_allocate_large_memory() { // Gas consumption is relatively small // Note: the exact gas usage depends on the Rust version used to compile Wasm, // which we only fix when using rust-optimizer, not integration tests. - assert_approx_eq!(gas_used, 4413600000, "0.2"); + assert_approx_eq!(gas_used, 9470400, "0.2"); let used = deps.memory_pages(); - assert_eq!(used, pages_before + 48, "Memory used: {} pages", used); + assert_eq!(used, pages_before + 48, "Memory used: {used} pages"); pages_before += 48; // Grow by 1600 pages (100 MiB) @@ -419,23 +407,24 @@ fn execute_allocate_large_memory() { execute_info, ExecuteMsg::AllocateLargeMemory { pages: 1600 }, ); - assert_eq!(result.unwrap_err(), "Generic error: memory.grow failed"); + assert_eq!( + result.unwrap_err(), + "kind: Other, error: memory.grow failed" + ); let gas_used = gas_before - deps.get_gas_left(); // Gas consumption is relatively small // Note: the exact gas usage depends on the Rust version used to compile Wasm, // which we only fix when using rust-optimizer, not integration tests. - let expected = 4859700000; // +/- 20% - assert!(gas_used > expected * 80 / 100, "Gas used: {}", gas_used); - assert!(gas_used < expected * 120 / 100, "Gas used: {}", gas_used); + assert_approx_eq!(gas_used, 8623090, "0.2"); let used = deps.memory_pages(); - assert_eq!(used, pages_before, "Memory used: {} pages", used); + assert_eq!(used, pages_before, "Memory used: {used} pages"); } #[test] fn execute_panic() { let mut deps = mock_instance(WASM, &[]); - let (instantiate_msg, creator) = make_init_msg(); + let (instantiate_msg, creator) = make_init_msg(deps.api()); let init_info = mock_info(creator.as_str(), &[]); let init_res: Response = instantiate(&mut deps, mock_env(), init_info, instantiate_msg).unwrap(); @@ -448,17 +437,18 @@ fn execute_panic() { &mut deps, &mock_env(), &execute_info, - &to_vec(&ExecuteMsg::Panic {}).unwrap(), + &to_json_vec(&ExecuteMsg::Panic {}).unwrap(), ); match execute_res.unwrap_err() { VmError::RuntimeErr { msg, .. } => { assert!( - msg.contains("Aborted: panicked at 'This page intentionally faulted'"), + msg.contains("Aborted: panicked") + && msg.contains("This page intentionally faulted"), "Must contain panic message" ); assert!(msg.contains("contract.rs:"), "Must contain file and line"); } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } @@ -466,7 +456,7 @@ fn execute_panic() { fn execute_user_errors_in_api_calls() { let mut deps = mock_instance(WASM, &[]); - let (instantiate_msg, creator) = make_init_msg(); + let (instantiate_msg, creator) = make_init_msg(deps.api()); let init_info = mock_info(creator.as_str(), &[]); let _init_res: Response = instantiate(&mut deps, mock_env(), init_info, instantiate_msg).unwrap(); diff --git a/contracts/ibc-callbacks/.cargo/config.toml b/contracts/ibc-callbacks/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/ibc-callbacks/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/ibc-callbacks/Cargo.lock b/contracts/ibc-callbacks/Cargo.lock new file mode 100644 index 0000000000..1963c1d6ea --- /dev/null +++ b/contracts/ibc-callbacks/Cargo.lock @@ -0,0 +1,2998 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.7.3", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] + +[[package]] +name = "bytecheck" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bytecheck_derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + +[[package]] +name = "cc" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clru" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "corosensei" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" +dependencies = [ + "autocfg", + "cfg-if", + "libc", + "scopeguard", + "windows-sys 0.59.0", +] + +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + +[[package]] +name = "cosmwasm-crypto" +version = "3.0.3-dev" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cosmwasm-schema" +version = "3.0.3-dev" +dependencies = [ + "cosmwasm-schema-derive", + "cw-schema", + "schemars 0.8.20", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cosmwasm-std" +version = "3.0.3-dev" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "cw-schema", + "derive_more 2.0.1", + "hex", + "rand_core", + "rmp-serde", + "schemars 0.8.20", + "serde", + "serde_json", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cosmwasm-vm" +version = "3.0.3-dev" +dependencies = [ + "bech32", + "blake2", + "bytes", + "clru", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-std", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", + "hex", + "rand_core", + "serde", + "serde_json", + "sha2", + "strum", + "thiserror", + "tracing", + "wasmer", + "wasmer-middlewares", + "wasmer-types", +] + +[[package]] +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" +dependencies = [ + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cw-schema" +version = "3.0.3-dev" +dependencies = [ + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck 0.5.0", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derive_more" +version = "0.99.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "derive_more" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" +dependencies = [ + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "dynasm" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dynasmrt" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" +dependencies = [ + "byteorder", + "dynasm", + "memmap2 0.5.10", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-iterator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "enumset" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "ibc-callbacks" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-vm", + "schemars 0.8.20", + "serde", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.87", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" +dependencies = [ + "bytecheck 0.8.0", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" +dependencies = [ + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0218ceea14babe24a4a5836f86ade86c1effbc198164e619194cb5069187e29" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.20", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed5a1ccce8ff962e31a165d41f6e2a2dd1245099dc4d594f5574a86cd90f4d3" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +dependencies = [ + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", +] + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.87", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasmer" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" +dependencies = [ + "bindgen", + "bytes", + "cfg-if", + "cmake", + "indexmap", + "js-sys", + "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", + "target-lexicon", + "thiserror", + "tracing", + "ureq", + "wasm-bindgen", + "wasmer-compiler", + "wasmer-compiler-singlepass", + "wasmer-derive", + "wasmer-types", + "wasmer-vm", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmer-compiler" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" +dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", + "enumset", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object", + "region", + "rkyv", + "self_cell", + "shared-buffer", + "smallvec", + "target-lexicon", + "thiserror", + "wasmer-types", + "wasmer-vm", + "wasmparser", + "windows-sys 0.59.0", + "xxhash-rust", +] + +[[package]] +name = "wasmer-compiler-singlepass" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" +dependencies = [ + "byteorder", + "dynasm", + "dynasmrt", + "enumset", + "gimli", + "more-asserts", + "rayon", + "smallvec", + "wasmer-compiler", + "wasmer-types", +] + +[[package]] +name = "wasmer-derive" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "wasmer-middlewares" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" +dependencies = [ + "wasmer", + "wasmer-types", + "wasmer-vm", +] + +[[package]] +name = "wasmer-types" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" +dependencies = [ + "bytecheck 0.6.12", + "enum-iterator", + "enumset", + "getrandom", + "hex", + "indexmap", + "more-asserts", + "rkyv", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", +] + +[[package]] +name = "wasmer-vm" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" +dependencies = [ + "backtrace", + "cc", + "cfg-if", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", + "region", + "scopeguard", + "thiserror", + "wasmer-types", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmparser" +version = "0.216.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" +dependencies = [ + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", +] + +[[package]] +name = "webpki-roots" +version = "0.26.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xattr" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/ibc-callbacks/Cargo.toml b/contracts/ibc-callbacks/Cargo.toml new file mode 100644 index 0000000000..5bca3e1c52 --- /dev/null +++ b/contracts/ibc-callbacks/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "ibc-callbacks" +version = "0.0.0" +authors = ["Christoph Otter "] +edition = "2021" +publish = false +license = "Apache-2.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[dependencies] +cosmwasm-schema = { path = "../../packages/schema" } +cosmwasm-std = { path = "../../packages/std", features = ["iterator", "stargate"] } +schemars = "0.8.3" +serde = { version = "1.0.103", default-features = false, features = ["derive"] } + +[dev-dependencies] +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator", "stargate"] } diff --git a/contracts/ibc-callbacks/README.md b/contracts/ibc-callbacks/README.md new file mode 100644 index 0000000000..949a2f0bf8 --- /dev/null +++ b/contracts/ibc-callbacks/README.md @@ -0,0 +1,8 @@ +# IBC Callbacks Contract + +This is a simple contract to demonstrate [IBC Callbacks]. It sends an ICS-20 transfer +message to a remote chain and writes to storage which callbacks were called. This +can then be queried using the `CallbackStats` query. + +[ibc callbacks]: + https://github.com/cosmos/ibc-go/blob/main/docs/architecture/adr-008-app-caller-cbs.md diff --git a/contracts/ibc-callbacks/schema/cw_schema/ibc-callbacks.json b/contracts/ibc-callbacks/schema/cw_schema/ibc-callbacks.json new file mode 100644 index 0000000000..8f465c9f49 --- /dev/null +++ b/contracts/ibc-callbacks/schema/cw_schema/ibc-callbacks.json @@ -0,0 +1,338 @@ +{ + "contract_name": "ibc-callbacks", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_callbacks_msg_ExecuteMsg", + "type": "enum", + "cases": { + "transfer": { + "type": "named", + "properties": { + "callback_type": { + "defaulting": true, + "description": "Who should receive callbacks for the message", + "value": 3 + }, + "channel_id": { + "description": "The channel to send the packet through", + "value": 1 + }, + "timeout_seconds": { + "description": "The amount of seconds from now the transfer should timeout at", + "value": 2 + }, + "to_address": { + "description": "Address on the destination chain", + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "ibc_callbacks_msg_CallbackType", + "type": "enum", + "cases": { + "both": { + "description": "Both the source contract and the destination address should receive callbacks", + "type": "unit" + }, + "dst": { + "description": "Only the destination address should receive callbacks", + "type": "unit" + }, + "src": { + "description": "Only this contract on the source chain should receive callbacks", + "type": "unit" + } + } + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_callbacks_msg_QueryMsg", + "type": "enum", + "cases": { + "callback_stats": { + "description": "Returns stats about what callbacks have been received", + "type": "named", + "properties": {} + } + } + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "callback_stats": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_callbacks_state_CallbackStats", + "description": "A counter for the number of times the respective callback has been called", + "type": "struct", + "properties": { + "ibc_ack_callbacks": { + "value": 14 + }, + "ibc_destination_callbacks": { + "value": 23 + }, + "ibc_timeout_callbacks": { + "value": 16 + } + } + }, + { + "name": "cosmwasm_std_ibc_callbacks_IbcAckCallbackMsg", + "type": "struct", + "properties": { + "acknowledgement": { + "value": 2 + }, + "original_packet": { + "value": 4 + }, + "relayer": { + "value": 13 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcAcknowledgement", + "type": "struct", + "properties": { + "data": { + "value": 3 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_ibc_IbcPacket", + "type": "struct", + "properties": { + "data": { + "description": "The raw data sent from the other side in the packet", + "value": 3 + }, + "dest": { + "description": "identifies the channel and port on the receiving chain.", + "value": 5 + }, + "sequence": { + "description": "The sequence number of the packet on the given channel", + "value": 7 + }, + "src": { + "description": "identifies the channel and port on the sending chain.", + "value": 5 + }, + "timeout": { + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcEndpoint", + "type": "struct", + "properties": { + "channel_id": { + "value": 6 + }, + "port_id": { + "value": 6 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_ibc_IbcTimeout", + "description": "In IBC each package must set at least one type of timeout:\nthe timestamp or the block height. Using this rather complex enum instead of\ntwo timeout fields we ensure that at least one timeout is set.", + "type": "struct", + "properties": { + "block": { + "value": 10 + }, + "timestamp": { + "value": 12 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeoutBlock", + "description": "IBCTimeoutHeight Height is a monotonically increasing data type\nthat can be compared against another Height for the purposes of updating and\nfreezing clients.\nOrdering is (revision_number, timeout_height)", + "type": "struct", + "properties": { + "height": { + "description": "block height after which the packet times out.\nthe height within the given revision", + "value": 7 + }, + "revision": { + "description": "the version that the client is currently on\n(e.g. after resetting the chain this could increment 1 as height drops to 0)", + "value": 7 + } + } + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 9 + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 11 + }, + { + "name": "cosmwasm_std_addresses_Addr", + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no\nassumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways\n1. Use `Addr::unchecked(input)`\n2. Use `let checked: Addr = deps.api.addr_validate(input)?`\n3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?`\n4. Deserialize from JSON. This must only be done from JSON that was validated before\nsuch as a contract's state. `Addr` must not be used in messages sent by the user\nbecause this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create\na mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String`\ninstance.", + "type": "address" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + }, + { + "name": "cosmwasm_std_ibc_callbacks_IbcTimeoutCallbackMsg", + "type": "struct", + "properties": { + "packet": { + "value": 4 + }, + "relayer": { + "value": 13 + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 15 + }, + { + "name": "cosmwasm_std_ibc_callbacks_IbcDestinationCallbackMsg", + "description": "The message type of the IBC destination callback.\n\nThe IBC destination callback is needed for cases where someone triggers the sending of an\nIBC packet through some other message (i.e. not through [`crate::IbcMsg::SendPacket`]) and\nyour contract needs to know that it received this.\nA prominent example is the [`crate::IbcMsg::Transfer`] message. Without callbacks, you cannot know\nthat someone sent you IBC coins.\n\nIt is important to validate that the packet and acknowledgement are what you expect them to be.\nFor example for a transfer message, the receiver is not necessarily the contract itself.\n\nThe callback is called when the packet is being acknowledged on the destination chain.\nThis happens for both synchronous and asynchronous acknowledgements.\n\nNote that there are some prerequisites that need to be fulfilled to receive destination callbacks:\n- The contract must implement the `ibc_destination_callback` entrypoint.\n- The IBC application in the destination chain must have support for the callbacks middleware.\n- You have to add serialized [`IbcCallbackRequest`] to a specific field of the message.\nFor `IbcMsg::Transfer`, this is the `memo` field and it needs to be json-encoded.", + "type": "struct", + "properties": { + "ack": { + "value": 2 + }, + "packet": { + "value": 4 + }, + "transfer": { + "defaulting": true, + "description": "When the underlying packet is a successful transfer message,\nthis field contains information about the transfer. Otherwise it is empty.\n\nThis is always empty on chains using CosmWasm < 3.0", + "value": 22 + } + } + }, + { + "name": "cosmwasm_std_ibc_callbacks_IbcTransferCallback", + "type": "struct", + "properties": { + "funds": { + "description": "The funds that were transferred.\n\nWhen the callback is executed, the transfer is completed already and the coins are now owned\nby the receiver.", + "value": 21 + }, + "receiver": { + "description": "Address of the receiver of the transfer.\nSince this is on the destination chain, this is a valid address.", + "value": 13 + }, + "sender": { + "description": "Address of the sender of the transfer.\nNote that this is *not* a valid address on the destination chain.", + "value": 6 + } + } + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 20 + }, + "denom": { + "value": 6 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 19 + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 18 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 17 + } + ] + } + } +} diff --git a/contracts/ibc-callbacks/schema/cw_schema/raw/execute.json b/contracts/ibc-callbacks/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..72c81f382f --- /dev/null +++ b/contracts/ibc-callbacks/schema/cw_schema/raw/execute.json @@ -0,0 +1,62 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_callbacks_msg_ExecuteMsg", + "type": "enum", + "cases": { + "transfer": { + "type": "named", + "properties": { + "callback_type": { + "defaulting": true, + "description": "Who should receive callbacks for the message", + "value": 3 + }, + "channel_id": { + "description": "The channel to send the packet through", + "value": 1 + }, + "timeout_seconds": { + "description": "The amount of seconds from now the transfer should timeout at", + "value": 2 + }, + "to_address": { + "description": "Address on the destination chain", + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "ibc_callbacks_msg_CallbackType", + "type": "enum", + "cases": { + "both": { + "description": "Both the source contract and the destination address should receive callbacks", + "type": "unit" + }, + "dst": { + "description": "Only the destination address should receive callbacks", + "type": "unit" + }, + "src": { + "description": "Only this contract on the source chain should receive callbacks", + "type": "unit" + } + } + } + ] +} diff --git a/contracts/ibc-callbacks/schema/cw_schema/raw/instantiate.json b/contracts/ibc-callbacks/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..feb0a1bf43 --- /dev/null +++ b/contracts/ibc-callbacks/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,12 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/ibc-callbacks/schema/cw_schema/raw/query.json b/contracts/ibc-callbacks/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..c872e76069 --- /dev/null +++ b/contracts/ibc-callbacks/schema/cw_schema/raw/query.json @@ -0,0 +1,17 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_callbacks_msg_QueryMsg", + "type": "enum", + "cases": { + "callback_stats": { + "description": "Returns stats about what callbacks have been received", + "type": "named", + "properties": {} + } + } + } + ] +} diff --git a/contracts/ibc-callbacks/schema/cw_schema/raw/response_to_callback_stats.json b/contracts/ibc-callbacks/schema/cw_schema/raw/response_to_callback_stats.json new file mode 100644 index 0000000000..a2f1e8115e --- /dev/null +++ b/contracts/ibc-callbacks/schema/cw_schema/raw/response_to_callback_stats.json @@ -0,0 +1,238 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_callbacks_state_CallbackStats", + "description": "A counter for the number of times the respective callback has been called", + "type": "struct", + "properties": { + "ibc_ack_callbacks": { + "value": 14 + }, + "ibc_destination_callbacks": { + "value": 23 + }, + "ibc_timeout_callbacks": { + "value": 16 + } + } + }, + { + "name": "cosmwasm_std_ibc_callbacks_IbcAckCallbackMsg", + "type": "struct", + "properties": { + "acknowledgement": { + "value": 2 + }, + "original_packet": { + "value": 4 + }, + "relayer": { + "value": 13 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcAcknowledgement", + "type": "struct", + "properties": { + "data": { + "value": 3 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_ibc_IbcPacket", + "type": "struct", + "properties": { + "data": { + "description": "The raw data sent from the other side in the packet", + "value": 3 + }, + "dest": { + "description": "identifies the channel and port on the receiving chain.", + "value": 5 + }, + "sequence": { + "description": "The sequence number of the packet on the given channel", + "value": 7 + }, + "src": { + "description": "identifies the channel and port on the sending chain.", + "value": 5 + }, + "timeout": { + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcEndpoint", + "type": "struct", + "properties": { + "channel_id": { + "value": 6 + }, + "port_id": { + "value": 6 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_ibc_IbcTimeout", + "description": "In IBC each package must set at least one type of timeout:\nthe timestamp or the block height. Using this rather complex enum instead of\ntwo timeout fields we ensure that at least one timeout is set.", + "type": "struct", + "properties": { + "block": { + "value": 10 + }, + "timestamp": { + "value": 12 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeoutBlock", + "description": "IBCTimeoutHeight Height is a monotonically increasing data type\nthat can be compared against another Height for the purposes of updating and\nfreezing clients.\nOrdering is (revision_number, timeout_height)", + "type": "struct", + "properties": { + "height": { + "description": "block height after which the packet times out.\nthe height within the given revision", + "value": 7 + }, + "revision": { + "description": "the version that the client is currently on\n(e.g. after resetting the chain this could increment 1 as height drops to 0)", + "value": 7 + } + } + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 9 + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 11 + }, + { + "name": "cosmwasm_std_addresses_Addr", + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no\nassumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways\n1. Use `Addr::unchecked(input)`\n2. Use `let checked: Addr = deps.api.addr_validate(input)?`\n3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?`\n4. Deserialize from JSON. This must only be done from JSON that was validated before\nsuch as a contract's state. `Addr` must not be used in messages sent by the user\nbecause this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create\na mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String`\ninstance.", + "type": "address" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + }, + { + "name": "cosmwasm_std_ibc_callbacks_IbcTimeoutCallbackMsg", + "type": "struct", + "properties": { + "packet": { + "value": 4 + }, + "relayer": { + "value": 13 + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 15 + }, + { + "name": "cosmwasm_std_ibc_callbacks_IbcDestinationCallbackMsg", + "description": "The message type of the IBC destination callback.\n\nThe IBC destination callback is needed for cases where someone triggers the sending of an\nIBC packet through some other message (i.e. not through [`crate::IbcMsg::SendPacket`]) and\nyour contract needs to know that it received this.\nA prominent example is the [`crate::IbcMsg::Transfer`] message. Without callbacks, you cannot know\nthat someone sent you IBC coins.\n\nIt is important to validate that the packet and acknowledgement are what you expect them to be.\nFor example for a transfer message, the receiver is not necessarily the contract itself.\n\nThe callback is called when the packet is being acknowledged on the destination chain.\nThis happens for both synchronous and asynchronous acknowledgements.\n\nNote that there are some prerequisites that need to be fulfilled to receive destination callbacks:\n- The contract must implement the `ibc_destination_callback` entrypoint.\n- The IBC application in the destination chain must have support for the callbacks middleware.\n- You have to add serialized [`IbcCallbackRequest`] to a specific field of the message.\nFor `IbcMsg::Transfer`, this is the `memo` field and it needs to be json-encoded.", + "type": "struct", + "properties": { + "ack": { + "value": 2 + }, + "packet": { + "value": 4 + }, + "transfer": { + "defaulting": true, + "description": "When the underlying packet is a successful transfer message,\nthis field contains information about the transfer. Otherwise it is empty.\n\nThis is always empty on chains using CosmWasm < 3.0", + "value": 22 + } + } + }, + { + "name": "cosmwasm_std_ibc_callbacks_IbcTransferCallback", + "type": "struct", + "properties": { + "funds": { + "description": "The funds that were transferred.\n\nWhen the callback is executed, the transfer is completed already and the coins are now owned\nby the receiver.", + "value": 21 + }, + "receiver": { + "description": "Address of the receiver of the transfer.\nSince this is on the destination chain, this is a valid address.", + "value": 13 + }, + "sender": { + "description": "Address of the sender of the transfer.\nNote that this is *not* a valid address on the destination chain.", + "value": 6 + } + } + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 20 + }, + "denom": { + "value": 6 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 19 + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 18 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 17 + } + ] +} diff --git a/contracts/ibc-callbacks/schema/ibc-callbacks.json b/contracts/ibc-callbacks/schema/ibc-callbacks.json new file mode 100644 index 0000000000..1c5e2fabd5 --- /dev/null +++ b/contracts/ibc-callbacks/schema/ibc-callbacks.json @@ -0,0 +1,404 @@ +{ + "contract_name": "ibc-callbacks", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "transfer" + ], + "properties": { + "transfer": { + "type": "object", + "required": [ + "channel_id", + "timeout_seconds", + "to_address" + ], + "properties": { + "callback_type": { + "description": "Who should receive callbacks for the message", + "default": "both", + "allOf": [ + { + "$ref": "#/definitions/CallbackType" + } + ] + }, + "channel_id": { + "description": "The channel to send the packet through", + "type": "string" + }, + "timeout_seconds": { + "description": "The amount of seconds from now the transfer should timeout at", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "to_address": { + "description": "Address on the destination chain", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "CallbackType": { + "oneOf": [ + { + "description": "Only this contract on the source chain should receive callbacks", + "type": "string", + "enum": [ + "src" + ] + }, + { + "description": "Only the destination address should receive callbacks", + "type": "string", + "enum": [ + "dst" + ] + }, + { + "description": "Both the source contract and the destination address should receive callbacks", + "type": "string", + "enum": [ + "both" + ] + } + ] + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Returns stats about what callbacks have been received", + "type": "object", + "required": [ + "callback_stats" + ], + "properties": { + "callback_stats": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "callback_stats": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CallbackStats", + "description": "A counter for the number of times the respective callback has been called", + "type": "object", + "required": [ + "ibc_ack_callbacks", + "ibc_destination_callbacks", + "ibc_timeout_callbacks" + ], + "properties": { + "ibc_ack_callbacks": { + "type": "array", + "items": { + "$ref": "#/definitions/IbcAckCallbackMsg" + } + }, + "ibc_destination_callbacks": { + "type": "array", + "items": { + "$ref": "#/definitions/IbcDestinationCallbackMsg" + } + }, + "ibc_timeout_callbacks": { + "type": "array", + "items": { + "$ref": "#/definitions/IbcTimeoutCallbackMsg" + } + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcAckCallbackMsg": { + "type": "object", + "required": [ + "acknowledgement", + "original_packet", + "relayer" + ], + "properties": { + "acknowledgement": { + "$ref": "#/definitions/IbcAcknowledgement" + }, + "original_packet": { + "$ref": "#/definitions/IbcPacket" + }, + "relayer": { + "$ref": "#/definitions/Addr" + } + }, + "additionalProperties": false + }, + "IbcAcknowledgement": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "IbcDestinationCallbackMsg": { + "description": "The message type of the IBC destination callback.\n\nThe IBC destination callback is needed for cases where someone triggers the sending of an IBC packet through some other message (i.e. not through [`crate::IbcMsg::SendPacket`]) and your contract needs to know that it received this. A prominent example is the [`crate::IbcMsg::Transfer`] message. Without callbacks, you cannot know that someone sent you IBC coins.\n\nIt is important to validate that the packet and acknowledgement are what you expect them to be. For example for a transfer message, the receiver is not necessarily the contract itself.\n\nThe callback is called when the packet is being acknowledged on the destination chain. This happens for both synchronous and asynchronous acknowledgements.\n\nNote that there are some prerequisites that need to be fulfilled to receive destination callbacks: - The contract must implement the `ibc_destination_callback` entrypoint. - The IBC application in the destination chain must have support for the callbacks middleware. - You have to add serialized [`IbcCallbackRequest`] to a specific field of the message. For `IbcMsg::Transfer`, this is the `memo` field and it needs to be json-encoded.", + "type": "object", + "required": [ + "ack", + "packet" + ], + "properties": { + "ack": { + "$ref": "#/definitions/IbcAcknowledgement" + }, + "packet": { + "$ref": "#/definitions/IbcPacket" + }, + "transfer": { + "description": "When the underlying packet is a successful transfer message, this field contains information about the transfer. Otherwise it is empty.\n\nThis is always empty on chains using CosmWasm < 3.0", + "anyOf": [ + { + "$ref": "#/definitions/IbcTransferCallback" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "IbcEndpoint": { + "type": "object", + "required": [ + "channel_id", + "port_id" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "port_id": { + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcPacket": { + "type": "object", + "required": [ + "data", + "dest", + "sequence", + "src", + "timeout" + ], + "properties": { + "data": { + "description": "The raw data sent from the other side in the packet", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "dest": { + "description": "identifies the channel and port on the receiving chain.", + "allOf": [ + { + "$ref": "#/definitions/IbcEndpoint" + } + ] + }, + "sequence": { + "description": "The sequence number of the packet on the given channel", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "src": { + "description": "identifies the channel and port on the sending chain.", + "allOf": [ + { + "$ref": "#/definitions/IbcEndpoint" + } + ] + }, + "timeout": { + "$ref": "#/definitions/IbcTimeout" + } + }, + "additionalProperties": false + }, + "IbcTimeout": { + "description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.", + "type": "object", + "properties": { + "block": { + "anyOf": [ + { + "$ref": "#/definitions/IbcTimeoutBlock" + }, + { + "type": "null" + } + ] + }, + "timestamp": { + "anyOf": [ + { + "$ref": "#/definitions/Timestamp" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "IbcTimeoutBlock": { + "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", + "type": "object", + "required": [ + "height", + "revision" + ], + "properties": { + "height": { + "description": "block height after which the packet times out. the height within the given revision", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "revision": { + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "IbcTimeoutCallbackMsg": { + "type": "object", + "required": [ + "packet", + "relayer" + ], + "properties": { + "packet": { + "$ref": "#/definitions/IbcPacket" + }, + "relayer": { + "$ref": "#/definitions/Addr" + } + }, + "additionalProperties": false + }, + "IbcTransferCallback": { + "type": "object", + "required": [ + "funds", + "receiver", + "sender" + ], + "properties": { + "funds": { + "description": "The funds that were transferred.\n\nWhen the callback is executed, the transfer is completed already and the coins are now owned by the receiver.", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "receiver": { + "description": "Address of the receiver of the transfer. Since this is on the destination chain, this is a valid address.", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, + "sender": { + "description": "Address of the sender of the transfer. Note that this is *not* a valid address on the destination chain.", + "type": "string" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + } + } +} diff --git a/contracts/ibc-callbacks/schema/raw/execute.json b/contracts/ibc-callbacks/schema/raw/execute.json new file mode 100644 index 0000000000..e5bed95bb4 --- /dev/null +++ b/contracts/ibc-callbacks/schema/raw/execute.json @@ -0,0 +1,76 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "transfer" + ], + "properties": { + "transfer": { + "type": "object", + "required": [ + "channel_id", + "timeout_seconds", + "to_address" + ], + "properties": { + "callback_type": { + "description": "Who should receive callbacks for the message", + "default": "both", + "allOf": [ + { + "$ref": "#/definitions/CallbackType" + } + ] + }, + "channel_id": { + "description": "The channel to send the packet through", + "type": "string" + }, + "timeout_seconds": { + "description": "The amount of seconds from now the transfer should timeout at", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "to_address": { + "description": "Address on the destination chain", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "CallbackType": { + "oneOf": [ + { + "description": "Only this contract on the source chain should receive callbacks", + "type": "string", + "enum": [ + "src" + ] + }, + { + "description": "Only the destination address should receive callbacks", + "type": "string", + "enum": [ + "dst" + ] + }, + { + "description": "Both the source contract and the destination address should receive callbacks", + "type": "string", + "enum": [ + "both" + ] + } + ] + } + } +} diff --git a/contracts/ibc-callbacks/schema/raw/instantiate.json b/contracts/ibc-callbacks/schema/raw/instantiate.json new file mode 100644 index 0000000000..e12a3fda12 --- /dev/null +++ b/contracts/ibc-callbacks/schema/raw/instantiate.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/ibc-callbacks/schema/raw/query.json b/contracts/ibc-callbacks/schema/raw/query.json new file mode 100644 index 0000000000..cb4a315dbe --- /dev/null +++ b/contracts/ibc-callbacks/schema/raw/query.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Returns stats about what callbacks have been received", + "type": "object", + "required": [ + "callback_stats" + ], + "properties": { + "callback_stats": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/ibc-callbacks/schema/raw/response_to_callback_stats.json b/contracts/ibc-callbacks/schema/raw/response_to_callback_stats.json new file mode 100644 index 0000000000..dd21966f82 --- /dev/null +++ b/contracts/ibc-callbacks/schema/raw/response_to_callback_stats.json @@ -0,0 +1,292 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CallbackStats", + "description": "A counter for the number of times the respective callback has been called", + "type": "object", + "required": [ + "ibc_ack_callbacks", + "ibc_destination_callbacks", + "ibc_timeout_callbacks" + ], + "properties": { + "ibc_ack_callbacks": { + "type": "array", + "items": { + "$ref": "#/definitions/IbcAckCallbackMsg" + } + }, + "ibc_destination_callbacks": { + "type": "array", + "items": { + "$ref": "#/definitions/IbcDestinationCallbackMsg" + } + }, + "ibc_timeout_callbacks": { + "type": "array", + "items": { + "$ref": "#/definitions/IbcTimeoutCallbackMsg" + } + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcAckCallbackMsg": { + "type": "object", + "required": [ + "acknowledgement", + "original_packet", + "relayer" + ], + "properties": { + "acknowledgement": { + "$ref": "#/definitions/IbcAcknowledgement" + }, + "original_packet": { + "$ref": "#/definitions/IbcPacket" + }, + "relayer": { + "$ref": "#/definitions/Addr" + } + }, + "additionalProperties": false + }, + "IbcAcknowledgement": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "IbcDestinationCallbackMsg": { + "description": "The message type of the IBC destination callback.\n\nThe IBC destination callback is needed for cases where someone triggers the sending of an IBC packet through some other message (i.e. not through [`crate::IbcMsg::SendPacket`]) and your contract needs to know that it received this. A prominent example is the [`crate::IbcMsg::Transfer`] message. Without callbacks, you cannot know that someone sent you IBC coins.\n\nIt is important to validate that the packet and acknowledgement are what you expect them to be. For example for a transfer message, the receiver is not necessarily the contract itself.\n\nThe callback is called when the packet is being acknowledged on the destination chain. This happens for both synchronous and asynchronous acknowledgements.\n\nNote that there are some prerequisites that need to be fulfilled to receive destination callbacks: - The contract must implement the `ibc_destination_callback` entrypoint. - The IBC application in the destination chain must have support for the callbacks middleware. - You have to add serialized [`IbcCallbackRequest`] to a specific field of the message. For `IbcMsg::Transfer`, this is the `memo` field and it needs to be json-encoded.", + "type": "object", + "required": [ + "ack", + "packet" + ], + "properties": { + "ack": { + "$ref": "#/definitions/IbcAcknowledgement" + }, + "packet": { + "$ref": "#/definitions/IbcPacket" + }, + "transfer": { + "description": "When the underlying packet is a successful transfer message, this field contains information about the transfer. Otherwise it is empty.\n\nThis is always empty on chains using CosmWasm < 3.0", + "anyOf": [ + { + "$ref": "#/definitions/IbcTransferCallback" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "IbcEndpoint": { + "type": "object", + "required": [ + "channel_id", + "port_id" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "port_id": { + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcPacket": { + "type": "object", + "required": [ + "data", + "dest", + "sequence", + "src", + "timeout" + ], + "properties": { + "data": { + "description": "The raw data sent from the other side in the packet", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "dest": { + "description": "identifies the channel and port on the receiving chain.", + "allOf": [ + { + "$ref": "#/definitions/IbcEndpoint" + } + ] + }, + "sequence": { + "description": "The sequence number of the packet on the given channel", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "src": { + "description": "identifies the channel and port on the sending chain.", + "allOf": [ + { + "$ref": "#/definitions/IbcEndpoint" + } + ] + }, + "timeout": { + "$ref": "#/definitions/IbcTimeout" + } + }, + "additionalProperties": false + }, + "IbcTimeout": { + "description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.", + "type": "object", + "properties": { + "block": { + "anyOf": [ + { + "$ref": "#/definitions/IbcTimeoutBlock" + }, + { + "type": "null" + } + ] + }, + "timestamp": { + "anyOf": [ + { + "$ref": "#/definitions/Timestamp" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "IbcTimeoutBlock": { + "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", + "type": "object", + "required": [ + "height", + "revision" + ], + "properties": { + "height": { + "description": "block height after which the packet times out. the height within the given revision", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "revision": { + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "IbcTimeoutCallbackMsg": { + "type": "object", + "required": [ + "packet", + "relayer" + ], + "properties": { + "packet": { + "$ref": "#/definitions/IbcPacket" + }, + "relayer": { + "$ref": "#/definitions/Addr" + } + }, + "additionalProperties": false + }, + "IbcTransferCallback": { + "type": "object", + "required": [ + "funds", + "receiver", + "sender" + ], + "properties": { + "funds": { + "description": "The funds that were transferred.\n\nWhen the callback is executed, the transfer is completed already and the coins are now owned by the receiver.", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "receiver": { + "description": "Address of the receiver of the transfer. Since this is on the destination chain, this is a valid address.", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, + "sender": { + "description": "Address of the sender of the transfer. Note that this is *not* a valid address on the destination chain.", + "type": "string" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/ibc-callbacks/src/bin/schema.rs b/contracts/ibc-callbacks/src/bin/schema.rs new file mode 100644 index 0000000000..f25266eaec --- /dev/null +++ b/contracts/ibc-callbacks/src/bin/schema.rs @@ -0,0 +1,12 @@ +use cosmwasm_schema::write_api; +use cosmwasm_std::Empty; +use ibc_callbacks::msg::{ExecuteMsg, QueryMsg}; + +fn main() { + // Clear & write standard API + write_api! { + instantiate: Empty, + query: QueryMsg, + execute: ExecuteMsg, + } +} diff --git a/contracts/ibc-callbacks/src/contract.rs b/contracts/ibc-callbacks/src/contract.rs new file mode 100644 index 0000000000..43728cd430 --- /dev/null +++ b/contracts/ibc-callbacks/src/contract.rs @@ -0,0 +1,158 @@ +use cosmwasm_std::{ + ensure, entry_point, to_json_binary, Binary, Deps, DepsMut, Empty, Env, IbcBasicResponse, + IbcDestinationCallbackMsg, IbcDstCallback, IbcSourceCallbackMsg, IbcSrcCallback, IbcTimeout, + MessageInfo, Response, StdError, StdResult, TransferMsgBuilder, +}; + +use crate::msg::{CallbackType, ExecuteMsg, QueryMsg}; +use crate::state::{load_stats, save_stats, CallbackStats}; + +#[entry_point] +pub fn instantiate( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: Empty, +) -> StdResult { + // initialize counts + let counts = CallbackStats::default(); + save_stats(deps.storage, &counts)?; + + Ok(Response::new().add_attribute("action", "instantiate")) +} + +/// Sends an `IbcMsg::Transfer` to the given `to_address` on the given `channel_id`. +#[entry_point] +pub fn execute( + _deps: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, +) -> StdResult { + match msg { + ExecuteMsg::Transfer { + to_address, + channel_id, + timeout_seconds, + callback_type, + } => execute_transfer( + env, + info, + to_address, + channel_id, + timeout_seconds, + callback_type, + ), + } +} + +fn execute_transfer( + env: Env, + info: MessageInfo, + to_address: String, + channel_id: String, + timeout_seconds: u32, + callback_type: CallbackType, +) -> StdResult { + let src_callback = IbcSrcCallback { + address: env.contract.address, + gas_limit: None, + }; + let dst_callback = IbcDstCallback { + address: to_address.clone(), + gas_limit: None, + }; + let coin = match &*info.funds { + [coin] if !coin.amount.is_zero() => coin, + _ => { + return Err(StdError::msg( + "Must send exactly one denom to trigger ics-20 transfer", + )) + } + }; + + let builder = TransferMsgBuilder::new( + channel_id, + to_address.clone(), + coin.clone(), + IbcTimeout::with_timestamp(env.block.time.plus_seconds(timeout_seconds as u64)), + ); + let transfer_msg = match callback_type { + CallbackType::Both => builder + .with_src_callback(src_callback) + .with_dst_callback(dst_callback) + .build(), + CallbackType::Src => builder.with_src_callback(src_callback).build(), + CallbackType::Dst => builder.with_dst_callback(dst_callback).build(), + }; + + Ok(Response::new() + .add_message(transfer_msg) + .add_attribute("action", "execute")) +} + +#[entry_point] +pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::CallbackStats {} => to_json_binary(&load_stats(deps.storage)?), + } +} + +/// This is the entrypoint that is called by the source chain when a callbacks-enabled IBC message +/// is acknowledged or times out. +#[entry_point] +pub fn ibc_source_callback( + deps: DepsMut, + _env: Env, + msg: IbcSourceCallbackMsg, +) -> StdResult { + let mut counts = load_stats(deps.storage)?; + + match msg { + IbcSourceCallbackMsg::Acknowledgement(ack) => { + // save the ack + counts.ibc_ack_callbacks.push(ack); + } + IbcSourceCallbackMsg::Timeout(timeout) => { + // save the timeout + counts.ibc_timeout_callbacks.push(timeout); + } + } + + save_stats(deps.storage, &counts)?; + + Ok(IbcBasicResponse::new().add_attribute("action", "ibc_source_callback")) +} + +#[entry_point] +pub fn ibc_destination_callback( + deps: DepsMut, + _env: Env, + msg: IbcDestinationCallbackMsg, +) -> StdResult { + let mut counts = load_stats(deps.storage)?; + + // Assert that the receiver has the funds in the message. + // This is just for testing purposes and to show that the funds are already available during + // the callback. + if let Some(transfer) = &msg.transfer { + for coin in &transfer.funds { + let balance = deps + .querier + .query_balance(&transfer.receiver, &coin.denom)?; + ensure!( + balance.amount >= coin.amount, + StdError::msg(format_args!( + "Didn't receive expected funds. expected: {coin}, have: {balance}" + )) + ); + } + } + + // save the receive + counts.ibc_destination_callbacks.push(msg); + + save_stats(deps.storage, &counts)?; + + Ok(IbcBasicResponse::new().add_attribute("action", "ibc_destination_callback")) +} diff --git a/contracts/ibc-callbacks/src/lib.rs b/contracts/ibc-callbacks/src/lib.rs new file mode 100644 index 0000000000..4934c19d5b --- /dev/null +++ b/contracts/ibc-callbacks/src/lib.rs @@ -0,0 +1,3 @@ +pub mod contract; +pub mod msg; +pub mod state; diff --git a/contracts/ibc-callbacks/src/msg.rs b/contracts/ibc-callbacks/src/msg.rs new file mode 100644 index 0000000000..d5cdb38f96 --- /dev/null +++ b/contracts/ibc-callbacks/src/msg.rs @@ -0,0 +1,36 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; + +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg { + /// Returns stats about what callbacks have been received + #[returns(crate::state::CallbackStats)] + CallbackStats {}, +} + +#[cw_serde] +pub enum ExecuteMsg { + Transfer { + /// Address on the destination chain + to_address: String, + /// The channel to send the packet through + channel_id: String, + /// The amount of seconds from now the transfer should timeout at + timeout_seconds: u32, + /// Who should receive callbacks for the message + #[serde(default)] + callback_type: CallbackType, + }, +} + +#[cw_serde] +#[derive(Default)] +pub enum CallbackType { + /// Only this contract on the source chain should receive callbacks + Src, + /// Only the destination address should receive callbacks + Dst, + /// Both the source contract and the destination address should receive callbacks + #[default] + Both, +} diff --git a/contracts/ibc-callbacks/src/state.rs b/contracts/ibc-callbacks/src/state.rs new file mode 100644 index 0000000000..3eeaca0c5e --- /dev/null +++ b/contracts/ibc-callbacks/src/state.rs @@ -0,0 +1,39 @@ +use std::any::type_name; + +use cosmwasm_schema::cw_serde; +use cosmwasm_std::{ + from_json, storage_keys::to_length_prefixed, to_json_vec, IbcAckCallbackMsg, + IbcDestinationCallbackMsg, IbcTimeoutCallbackMsg, StdError, StdResult, Storage, +}; +use serde::{de::DeserializeOwned, Serialize}; + +pub const KEY_STATS: &[u8] = b"counts"; + +/// A counter for the number of times the respective callback has been called +#[cw_serde] +#[derive(Default)] +pub struct CallbackStats { + pub ibc_ack_callbacks: Vec, + pub ibc_timeout_callbacks: Vec, + pub ibc_destination_callbacks: Vec, +} + +pub fn load_stats(storage: &dyn Storage) -> StdResult { + load_item(storage, KEY_STATS) +} + +pub fn save_stats(storage: &mut dyn Storage, counts: &CallbackStats) -> StdResult<()> { + save_item(storage, KEY_STATS, counts) +} + +fn load_item(storage: &dyn Storage, key: &[u8]) -> StdResult { + storage + .get(&to_length_prefixed(key)) + .ok_or_else(|| StdError::msg(format_args!("{} not found", type_name::()))) + .and_then(from_json) +} + +fn save_item(storage: &mut dyn Storage, key: &[u8], item: &T) -> StdResult<()> { + storage.set(&to_length_prefixed(key), &to_json_vec(item)?); + Ok(()) +} diff --git a/contracts/ibc-callbacks/tests/integration.rs b/contracts/ibc-callbacks/tests/integration.rs new file mode 100644 index 0000000000..9f02fedff8 --- /dev/null +++ b/contracts/ibc-callbacks/tests/integration.rs @@ -0,0 +1,15 @@ +//! This integration test tries to run and call the generated wasm. +//! It depends on a Wasm build being available, which you can create with `cargo wasm`. +//! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. + +use cosmwasm_vm::testing::mock_instance; + +// This line will test the output of cargo wasm +static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/ibc_callbacks.wasm"); +// You can uncomment this line instead to test productionified build from rust-optimizer +// static WASM: &[u8] = include_bytes!("../../artifacts/ibc_callbacks.wasm"); + +#[test] +fn validation_succeeds() { + mock_instance(WASM, &[]); +} diff --git a/contracts/ibc-reflect-send/.cargo/config b/contracts/ibc-reflect-send/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/ibc-reflect-send/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/ibc-reflect-send/.cargo/config.toml b/contracts/ibc-reflect-send/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/ibc-reflect-send/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/ibc-reflect-send/Cargo.lock b/contracts/ibc-reflect-send/Cargo.lock index 85313cae0f..72610af4c6 100644 --- a/contracts/ibc-reflect-send/Cargo.lock +++ b/contracts/ibc-reflect-send/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,118 +17,349 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "base64ct" -version = "1.5.0" +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -136,55 +367,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -192,204 +462,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -406,98 +605,196 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "darling" -version = "0.13.0" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "darling_core", - "darling_macro", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +name = "cw-schema" +version = "3.0.3-dev" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", ] [[package]] -name = "darling_macro" -version = "0.13.0" +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -505,13 +802,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -522,57 +819,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -595,46 +912,110 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -642,97 +1023,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -746,7 +1132,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] @@ -755,233 +1141,522 @@ version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cosmwasm-vm", - "schemars", + "schemars 0.8.21", "serde", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "k256" -version = "0.11.3" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "quote", - "syn", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "mach" -version = "0.3.2" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.59.0", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "adler", - "autocfg", + "either", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "hermit-abi", - "libc", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.25.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "memchr", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", ] [[package]] name = "object" -version = "0.28.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.11.2", + "flate2", + "hashbrown 0.14.5", "indexmap", "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.8.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "pkcs8" -version = "0.9.0" +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "der", - "spki", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro-error" @@ -992,7 +1667,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1007,13 +1682,35 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1022,7 +1719,16 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "ptr_meta_derive", + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", ] [[package]] @@ -1033,28 +1739,46 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", "rand_chacha", - "rand_core 0.6.3", - "rand_hc", + "rand_core", ] [[package]] @@ -1064,152 +1788,198 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core", ] [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.1.16", + "getrandom", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "getrandom 0.2.3", + "either", + "rayon-core", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "rand_core 0.6.3", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "bitflags 2.5.0", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "ref-cast-impl", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ - "bitflags", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "region" -version = "3.0.0" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ - "winapi", + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", ] [[package]] name = "rend" -version = "0.3.6" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" dependencies = [ - "bytecheck", + "bytecheck 0.8.0", ] [[package]] name = "rfc6979" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", "rend", "rkyv_derive", - "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", ] [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1217,178 +1987,295 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schemars" -version = "0.8.6" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" dependencies = [ "dyn-clone", - "schemars_derive", + "ref-cast", + "schemars_derive 1.0.4", "serde", "serde_json", ] [[package]] name = "schemars_derive" -version = "0.8.6" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.87", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "schemars_derive" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", "generic-array", - "pkcs8", "subtle", "zeroize", ] [[package]] -name = "serde" -version = "1.0.126" +name = "self_cell" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ - "serde", + "serde_derive", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "serde-wasm-bindgen" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" dependencies = [ + "js-sys", "serde", + "wasm-bindgen", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_derive_internals" -version = "0.25.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "serde_with" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "sha2" -version = "0.10.3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "cpufeatures", + "digest", ] [[package]] -name = "signature" -version = "1.5.0" +name = "shared-buffer" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "bytes", + "memmap2 0.6.2", ] [[package]] -name = "smallvec" -version = "1.6.1" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "spki" -version = "0.6.0" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "base64ct", - "der", + "digest", + "rand_core", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1403,147 +2290,285 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "target-lexicon" -version = "0.12.2" +name = "syn" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "tempfile" -version = "3.2.0" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" -dependencies = [ - "thiserror-impl", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1551,24 +2576,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1576,113 +2601,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1692,252 +2699,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/ibc-reflect-send/Cargo.toml b/contracts/ibc-reflect-send/Cargo.toml index 396f36b019..eab39b4e6c 100644 --- a/contracts/ibc-reflect-send/Cargo.toml +++ b/contracts/ibc-reflect-send/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -22,20 +20,10 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# for quicker tests, cargo test --lib -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } cosmwasm-std = { path = "../../packages/std", features = ["iterator", "staking", "stargate"] } -cosmwasm-storage = { path = "../../packages/storage", features = ["iterator"] } -schemars = "0.8.3" +schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] diff --git a/contracts/ibc-reflect-send/examples/schema.rs b/contracts/ibc-reflect-send/examples/schema.rs deleted file mode 100644 index 2f8a8d3e72..0000000000 --- a/contracts/ibc-reflect-send/examples/schema.rs +++ /dev/null @@ -1,20 +0,0 @@ -use std::env::current_dir; - -use cosmwasm_schema::{export_schema, schema_for, write_api}; - -use ibc_reflect_send::ibc_msg::PacketMsg; -use ibc_reflect_send::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; - -fn main() { - // Clear & write standard API - write_api! { - instantiate: InstantiateMsg, - execute: ExecuteMsg, - query: QueryMsg, - } - - // Schemas for inter-contract communication - let mut out_dir = current_dir().unwrap(); - out_dir.push("schema"); - export_schema(&schema_for!(PacketMsg), &out_dir); -} diff --git a/contracts/ibc-reflect-send/schema/cw_schema/ibc-reflect-send.json b/contracts/ibc-reflect-send/schema/cw_schema/ibc-reflect-send.json new file mode 100644 index 0000000000..255539f30d --- /dev/null +++ b/contracts/ibc-reflect-send/schema/cw_schema/ibc-reflect-send.json @@ -0,0 +1,707 @@ +{ + "contract_name": "ibc-reflect-send", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_InstantiateMsg", + "description": "This needs no info. Owner of the contract is whoever signed the InstantiateMsg.", + "type": "struct", + "properties": {} + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_ExecuteMsg", + "type": "enum", + "cases": { + "check_remote_balance": { + "type": "named", + "properties": { + "channel_id": { + "value": 1 + } + } + }, + "send_funds": { + "description": "If you sent funds to this contract, it will attempt to ibc transfer them\nto the account on the remote side of this channel.\nIf we don't have the address yet, this fails.", + "type": "named", + "properties": { + "reflect_channel_id": { + "description": "The channel id we use above to talk with the reflect contract", + "value": 1 + }, + "transfer_channel_id": { + "description": "The channel to use for ibctransfer. This is bound to a different\nport and handled by a different module.\nIt should connect to the same chain as the reflect_channel_id does", + "value": 1 + } + } + }, + "send_msgs": { + "type": "named", + "properties": { + "channel_id": { + "value": 1 + }, + "msgs": { + "value": 22 + } + } + }, + "update_admin": { + "description": "Changes the admin", + "type": "named", + "properties": { + "admin": { + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_results_cosmos_msg_CosmosMsg", + "type": "enum", + "cases": { + "bank": { + "type": "tuple", + "items": [ + 3 + ] + }, + "custom": { + "type": "tuple", + "items": [ + 7 + ] + }, + "distribution": { + "type": "tuple", + "items": [ + 9 + ] + }, + "gov": { + "type": "tuple", + "items": [ + 20 + ] + }, + "ibc": { + "type": "tuple", + "items": [ + 11 + ] + }, + "staking": { + "type": "tuple", + "items": [ + 8 + ] + }, + "stargate": { + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "named", + "properties": { + "type_url": { + "value": 1 + }, + "value": { + "value": 10 + } + } + }, + "wasm": { + "type": "tuple", + "items": [ + 19 + ] + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_BankMsg", + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "type": "enum", + "cases": { + "burn": { + "description": "This will burn the given coins from the contract's account.\nThere is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper.\nImportant if a contract controls significant token supply that must be retired.", + "type": "named", + "properties": { + "amount": { + "value": 6 + } + } + }, + "send": { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28).\n`from_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 6 + }, + "to_address": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 5 + }, + "denom": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 4 + }, + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + }, + { + "name": "cosmwasm_std_results_cosmos_msg_StakingMsg", + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "type": "enum", + "cases": { + "delegate": { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "validator": { + "value": 1 + } + } + }, + "redelegate": { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "dst_validator": { + "value": 1 + }, + "src_validator": { + "value": 1 + } + } + }, + "undelegate": { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "validator": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_DistributionMsg", + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "type": "enum", + "cases": { + "set_withdraw_address": { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "address": { + "description": "The `withdraw_address`", + "value": 1 + } + } + }, + "withdraw_delegator_reward": { + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "validator": { + "description": "The `validator_address`", + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_ibc_IbcMsg", + "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts\n(contracts that directly speak the IBC protocol via 6 entry points)", + "type": "enum", + "cases": { + "close_channel": { + "description": "This will close an existing channel that is owned by this contract.\nPort is auto-assigned to the contract's IBC port", + "type": "named", + "properties": { + "channel_id": { + "value": 1 + } + } + }, + "send_packet": { + "description": "Sends an IBC packet with given data over the existing channel.\nData should be encoded in a format defined by the channel version,\nand the module on the other side should know how to parse this.", + "type": "named", + "properties": { + "channel_id": { + "value": 1 + }, + "data": { + "value": 10 + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "value": 12 + } + } + }, + "transfer": { + "description": "Sends bank tokens owned by the contract to the given address on another chain.\nThe channel must already be established between the ibctransfer module on this chain\nand a matching module on the remote chain.\nWe cannot select the port_id, this is whatever the local chain has bound the ibctransfer\nmodule to.", + "type": "named", + "properties": { + "amount": { + "description": "packet data only supports one coin\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", + "value": 4 + }, + "channel_id": { + "description": "existing channel to send the tokens over", + "value": 1 + }, + "memo": { + "description": "An optional memo. See the blog post\n[\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b)\nfor more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently\nignored on older chains.\nIf you need support for both 1.x and 2.x chain with the same codebase,\nit is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer\nprotobuf encoder instead.", + "value": 18 + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "value": 12 + }, + "to_address": { + "description": "address on the remote chain to receive these tokens", + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeout", + "description": "In IBC each package must set at least one type of timeout:\nthe timestamp or the block height. Using this rather complex enum instead of\ntwo timeout fields we ensure that at least one timeout is set.", + "type": "struct", + "properties": { + "block": { + "value": 15 + }, + "timestamp": { + "value": 17 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeoutBlock", + "description": "IBCTimeoutHeight Height is a monotonically increasing data type\nthat can be compared against another Height for the purposes of updating and\nfreezing clients.\nOrdering is (revision_number, timeout_height)", + "type": "struct", + "properties": { + "height": { + "description": "block height after which the packet times out.\nthe height within the given revision", + "value": 14 + }, + "revision": { + "description": "the version that the client is currently on\n(e.g. after resetting the chain this could increment 1 as height drops to 0)", + "value": 14 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 13 + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 16 + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 1 + }, + { + "name": "cosmwasm_std_results_cosmos_msg_WasmMsg", + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "type": "enum", + "cases": { + "clear_admin": { + "description": "Clears the admin on the given contract, so no more migration possible.\nFails if this contract is not currently admin of the target contract.", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + } + } + }, + "execute": { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + }, + "funds": { + "value": 6 + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "value": 10 + } + } + }, + "instantiate": { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that\nwhen emitting the same Instantiate message multiple times,\nmultiple instances on different addresses will be generated. See also\nInstantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "admin": { + "value": 18 + }, + "code_id": { + "value": 14 + }, + "funds": { + "value": 6 + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should:\n- not be empty\n- not be bigger than 128 bytes (or some chain-specific limit)\n- not start / end with whitespace", + "value": 1 + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "value": 10 + } + } + }, + "migrate": { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to\ncustomize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "value": 10 + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "value": 14 + } + } + }, + "update_admin": { + "description": "Sets a new admin (for migrate) on the given contract.\nFails if this contract is not currently admin of the target contract.", + "type": "named", + "properties": { + "admin": { + "value": 1 + }, + "contract_addr": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_GovMsg", + "description": "This message type allows the contract interact with the [x/gov] module in order\nto cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n```\n# use cosmwasm_std::{\n# HexBinary,\n# Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo,\n# Response, QueryResponse,\n# };\n# type ExecuteMsg = ();\nuse cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point]\npub fn execute(\ndeps: DepsMut,\nenv: Env,\ninfo: MessageInfo,\nmsg: ExecuteMsg,\n) -> Result {\n// ...\nOk(Response::new().add_message(GovMsg::Vote {\nproposal_id: 4,\noption: VoteOption::Yes,\n}))\n}\n```\n\nCast a weighted vote:\n\n```\n# use cosmwasm_std::{\n# HexBinary,\n# Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo,\n# Response, QueryResponse,\n# };\n# type ExecuteMsg = ();\n# #[cfg(feature = \"cosmwasm_1_2\")]\nuse cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")]\n#[entry_point]\npub fn execute(\ndeps: DepsMut,\nenv: Env,\ninfo: MessageInfo,\nmsg: ExecuteMsg,\n) -> Result {\n// ...\nOk(Response::new().add_message(GovMsg::VoteWeighted {\nproposal_id: 4,\noptions: vec![\nWeightedVoteOption {\noption: VoteOption::Yes,\nweight: Decimal::percent(65),\n},\nWeightedVoteOption {\noption: VoteOption::Abstain,\nweight: Decimal::percent(35),\n},\n],\n}))\n}\n```", + "type": "enum", + "cases": { + "vote": { + "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", + "type": "named", + "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "value": 21 + }, + "proposal_id": { + "value": 14 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_VoteOption", + "type": "enum", + "cases": { + "abstain": { + "type": "unit" + }, + "no": { + "type": "unit" + }, + "no_with_veto": { + "type": "unit" + }, + "yes": { + "type": "unit" + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 2 + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_QueryMsg", + "type": "enum", + "cases": { + "account": { + "type": "named", + "properties": { + "channel_id": { + "value": 1 + } + } + }, + "admin": { + "type": "named", + "properties": {} + }, + "list_accounts": { + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "account": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_AccountInfo", + "type": "struct", + "properties": { + "channel_id": { + "value": 1 + }, + "last_update_time": { + "description": "last block balance was updated (0 is never)", + "value": 2 + }, + "remote_addr": { + "description": "in normal cases, it should be set, but there is a delay between binding\nthe channel and making a query and in that time it is empty", + "value": 3 + }, + "remote_balance": { + "value": 6 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 1 + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 5 + }, + "denom": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 4 + } + ] + }, + "admin": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_AdminResponse", + "type": "struct", + "properties": { + "admin": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "list_accounts": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_ListAccountsResponse", + "type": "struct", + "properties": { + "accounts": { + "value": 8 + } + } + }, + { + "name": "ibc_reflect_send_msg_AccountInfo", + "type": "struct", + "properties": { + "channel_id": { + "value": 2 + }, + "last_update_time": { + "description": "last block balance was updated (0 is never)", + "value": 3 + }, + "remote_addr": { + "description": "in normal cases, it should be set, but there is a delay between binding\nthe channel and making a query and in that time it is empty", + "value": 4 + }, + "remote_balance": { + "value": 7 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 2 + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 6 + }, + "denom": { + "value": 2 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 5 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] + } + } +} diff --git a/contracts/ibc-reflect-send/schema/cw_schema/raw/execute.json b/contracts/ibc-reflect-send/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..3ac93a17fd --- /dev/null +++ b/contracts/ibc-reflect-send/schema/cw_schema/raw/execute.json @@ -0,0 +1,493 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_ExecuteMsg", + "type": "enum", + "cases": { + "check_remote_balance": { + "type": "named", + "properties": { + "channel_id": { + "value": 1 + } + } + }, + "send_funds": { + "description": "If you sent funds to this contract, it will attempt to ibc transfer them\nto the account on the remote side of this channel.\nIf we don't have the address yet, this fails.", + "type": "named", + "properties": { + "reflect_channel_id": { + "description": "The channel id we use above to talk with the reflect contract", + "value": 1 + }, + "transfer_channel_id": { + "description": "The channel to use for ibctransfer. This is bound to a different\nport and handled by a different module.\nIt should connect to the same chain as the reflect_channel_id does", + "value": 1 + } + } + }, + "send_msgs": { + "type": "named", + "properties": { + "channel_id": { + "value": 1 + }, + "msgs": { + "value": 22 + } + } + }, + "update_admin": { + "description": "Changes the admin", + "type": "named", + "properties": { + "admin": { + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_results_cosmos_msg_CosmosMsg", + "type": "enum", + "cases": { + "bank": { + "type": "tuple", + "items": [ + 3 + ] + }, + "custom": { + "type": "tuple", + "items": [ + 7 + ] + }, + "distribution": { + "type": "tuple", + "items": [ + 9 + ] + }, + "gov": { + "type": "tuple", + "items": [ + 20 + ] + }, + "ibc": { + "type": "tuple", + "items": [ + 11 + ] + }, + "staking": { + "type": "tuple", + "items": [ + 8 + ] + }, + "stargate": { + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "named", + "properties": { + "type_url": { + "value": 1 + }, + "value": { + "value": 10 + } + } + }, + "wasm": { + "type": "tuple", + "items": [ + 19 + ] + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_BankMsg", + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "type": "enum", + "cases": { + "burn": { + "description": "This will burn the given coins from the contract's account.\nThere is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper.\nImportant if a contract controls significant token supply that must be retired.", + "type": "named", + "properties": { + "amount": { + "value": 6 + } + } + }, + "send": { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28).\n`from_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 6 + }, + "to_address": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 5 + }, + "denom": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 4 + }, + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + }, + { + "name": "cosmwasm_std_results_cosmos_msg_StakingMsg", + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "type": "enum", + "cases": { + "delegate": { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "validator": { + "value": 1 + } + } + }, + "redelegate": { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "dst_validator": { + "value": 1 + }, + "src_validator": { + "value": 1 + } + } + }, + "undelegate": { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "validator": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_DistributionMsg", + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "type": "enum", + "cases": { + "set_withdraw_address": { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "address": { + "description": "The `withdraw_address`", + "value": 1 + } + } + }, + "withdraw_delegator_reward": { + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "validator": { + "description": "The `validator_address`", + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_ibc_IbcMsg", + "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts\n(contracts that directly speak the IBC protocol via 6 entry points)", + "type": "enum", + "cases": { + "close_channel": { + "description": "This will close an existing channel that is owned by this contract.\nPort is auto-assigned to the contract's IBC port", + "type": "named", + "properties": { + "channel_id": { + "value": 1 + } + } + }, + "send_packet": { + "description": "Sends an IBC packet with given data over the existing channel.\nData should be encoded in a format defined by the channel version,\nand the module on the other side should know how to parse this.", + "type": "named", + "properties": { + "channel_id": { + "value": 1 + }, + "data": { + "value": 10 + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "value": 12 + } + } + }, + "transfer": { + "description": "Sends bank tokens owned by the contract to the given address on another chain.\nThe channel must already be established between the ibctransfer module on this chain\nand a matching module on the remote chain.\nWe cannot select the port_id, this is whatever the local chain has bound the ibctransfer\nmodule to.", + "type": "named", + "properties": { + "amount": { + "description": "packet data only supports one coin\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", + "value": 4 + }, + "channel_id": { + "description": "existing channel to send the tokens over", + "value": 1 + }, + "memo": { + "description": "An optional memo. See the blog post\n[\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b)\nfor more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently\nignored on older chains.\nIf you need support for both 1.x and 2.x chain with the same codebase,\nit is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer\nprotobuf encoder instead.", + "value": 18 + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "value": 12 + }, + "to_address": { + "description": "address on the remote chain to receive these tokens", + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeout", + "description": "In IBC each package must set at least one type of timeout:\nthe timestamp or the block height. Using this rather complex enum instead of\ntwo timeout fields we ensure that at least one timeout is set.", + "type": "struct", + "properties": { + "block": { + "value": 15 + }, + "timestamp": { + "value": 17 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeoutBlock", + "description": "IBCTimeoutHeight Height is a monotonically increasing data type\nthat can be compared against another Height for the purposes of updating and\nfreezing clients.\nOrdering is (revision_number, timeout_height)", + "type": "struct", + "properties": { + "height": { + "description": "block height after which the packet times out.\nthe height within the given revision", + "value": 14 + }, + "revision": { + "description": "the version that the client is currently on\n(e.g. after resetting the chain this could increment 1 as height drops to 0)", + "value": 14 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 13 + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 16 + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 1 + }, + { + "name": "cosmwasm_std_results_cosmos_msg_WasmMsg", + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "type": "enum", + "cases": { + "clear_admin": { + "description": "Clears the admin on the given contract, so no more migration possible.\nFails if this contract is not currently admin of the target contract.", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + } + } + }, + "execute": { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + }, + "funds": { + "value": 6 + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "value": 10 + } + } + }, + "instantiate": { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that\nwhen emitting the same Instantiate message multiple times,\nmultiple instances on different addresses will be generated. See also\nInstantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "admin": { + "value": 18 + }, + "code_id": { + "value": 14 + }, + "funds": { + "value": 6 + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should:\n- not be empty\n- not be bigger than 128 bytes (or some chain-specific limit)\n- not start / end with whitespace", + "value": 1 + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "value": 10 + } + } + }, + "migrate": { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to\ncustomize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "value": 10 + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "value": 14 + } + } + }, + "update_admin": { + "description": "Sets a new admin (for migrate) on the given contract.\nFails if this contract is not currently admin of the target contract.", + "type": "named", + "properties": { + "admin": { + "value": 1 + }, + "contract_addr": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_GovMsg", + "description": "This message type allows the contract interact with the [x/gov] module in order\nto cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n```\n# use cosmwasm_std::{\n# HexBinary,\n# Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo,\n# Response, QueryResponse,\n# };\n# type ExecuteMsg = ();\nuse cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point]\npub fn execute(\ndeps: DepsMut,\nenv: Env,\ninfo: MessageInfo,\nmsg: ExecuteMsg,\n) -> Result {\n// ...\nOk(Response::new().add_message(GovMsg::Vote {\nproposal_id: 4,\noption: VoteOption::Yes,\n}))\n}\n```\n\nCast a weighted vote:\n\n```\n# use cosmwasm_std::{\n# HexBinary,\n# Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo,\n# Response, QueryResponse,\n# };\n# type ExecuteMsg = ();\n# #[cfg(feature = \"cosmwasm_1_2\")]\nuse cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")]\n#[entry_point]\npub fn execute(\ndeps: DepsMut,\nenv: Env,\ninfo: MessageInfo,\nmsg: ExecuteMsg,\n) -> Result {\n// ...\nOk(Response::new().add_message(GovMsg::VoteWeighted {\nproposal_id: 4,\noptions: vec![\nWeightedVoteOption {\noption: VoteOption::Yes,\nweight: Decimal::percent(65),\n},\nWeightedVoteOption {\noption: VoteOption::Abstain,\nweight: Decimal::percent(35),\n},\n],\n}))\n}\n```", + "type": "enum", + "cases": { + "vote": { + "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", + "type": "named", + "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "value": 21 + }, + "proposal_id": { + "value": 14 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_VoteOption", + "type": "enum", + "cases": { + "abstain": { + "type": "unit" + }, + "no": { + "type": "unit" + }, + "no_with_veto": { + "type": "unit" + }, + "yes": { + "type": "unit" + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 2 + } + ] +} diff --git a/contracts/ibc-reflect-send/schema/cw_schema/raw/instantiate.json b/contracts/ibc-reflect-send/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..b4fa05043a --- /dev/null +++ b/contracts/ibc-reflect-send/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,12 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_InstantiateMsg", + "description": "This needs no info. Owner of the contract is whoever signed the InstantiateMsg.", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/ibc-reflect-send/schema/cw_schema/raw/query.json b/contracts/ibc-reflect-send/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..32986cd7ad --- /dev/null +++ b/contracts/ibc-reflect-send/schema/cw_schema/raw/query.json @@ -0,0 +1,32 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_QueryMsg", + "type": "enum", + "cases": { + "account": { + "type": "named", + "properties": { + "channel_id": { + "value": 1 + } + } + }, + "admin": { + "type": "named", + "properties": {} + }, + "list_accounts": { + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_account.json b/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_account.json new file mode 100644 index 0000000000..cd70d2a9d1 --- /dev/null +++ b/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_account.json @@ -0,0 +1,64 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_AccountInfo", + "type": "struct", + "properties": { + "channel_id": { + "value": 1 + }, + "last_update_time": { + "description": "last block balance was updated (0 is never)", + "value": 2 + }, + "remote_addr": { + "description": "in normal cases, it should be set, but there is a delay between binding\nthe channel and making a query and in that time it is empty", + "value": 3 + }, + "remote_balance": { + "value": 6 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 1 + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 5 + }, + "denom": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 4 + } + ] +} diff --git a/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_admin.json b/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_admin.json new file mode 100644 index 0000000000..a69a7d8503 --- /dev/null +++ b/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_admin.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_AdminResponse", + "type": "struct", + "properties": { + "admin": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_list_accounts.json b/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_list_accounts.json new file mode 100644 index 0000000000..dea22e21a7 --- /dev/null +++ b/contracts/ibc-reflect-send/schema/cw_schema/raw/response_to_list_accounts.json @@ -0,0 +1,78 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_send_msg_ListAccountsResponse", + "type": "struct", + "properties": { + "accounts": { + "value": 8 + } + } + }, + { + "name": "ibc_reflect_send_msg_AccountInfo", + "type": "struct", + "properties": { + "channel_id": { + "value": 2 + }, + "last_update_time": { + "description": "last block balance was updated (0 is never)", + "value": 3 + }, + "remote_addr": { + "description": "in normal cases, it should be set, but there is a delay between binding\nthe channel and making a query and in that time it is empty", + "value": 4 + }, + "remote_balance": { + "value": 7 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 2 + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 6 + }, + "denom": { + "value": 2 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 5 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] +} diff --git a/contracts/ibc-reflect-send/schema/ibc-reflect-send.json b/contracts/ibc-reflect-send/schema/ibc-reflect-send.json index 5f6fe80a2c..16c0d987f2 100644 --- a/contracts/ibc-reflect-send/schema/ibc-reflect-send.json +++ b/contracts/ibc-reflect-send/schema/ibc-reflect-send.json @@ -140,7 +140,8 @@ "to_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -164,7 +165,8 @@ "$ref": "#/definitions/Coin" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -183,12 +185,13 @@ ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "$ref": "#/definitions/Uint256" }, "denom": { "type": "string" } - } + }, + "additionalProperties": false }, "CosmosMsg_for_Empty": { "oneOf": [ @@ -241,7 +244,8 @@ "additionalProperties": false }, { - "description": "A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "deprecated": true, "type": "object", "required": [ "stargate" @@ -260,7 +264,8 @@ "value": { "$ref": "#/definitions/Binary" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -323,13 +328,14 @@ "description": "The `withdraw_address`", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", "type": "object", "required": [ "withdraw_delegator_reward" @@ -345,7 +351,8 @@ "description": "The `validator_address`", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -353,10 +360,12 @@ ] }, "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false }, "GovMsg": { + "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```", "oneOf": [ { "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", @@ -368,19 +377,25 @@ "vote": { "type": "object", "required": [ - "proposal_id", - "vote" + "option", + "proposal_id" ], "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "allOf": [ + { + "$ref": "#/definitions/VoteOption" + } + ] + }, "proposal_id": { "type": "integer", "format": "uint64", "minimum": 0.0 - }, - "vote": { - "$ref": "#/definitions/VoteOption" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -415,9 +430,16 @@ ] }, "channel_id": { - "description": "exisiting channel to send the tokens over", + "description": "existing channel to send the tokens over", "type": "string" }, + "memo": { + "description": "An optional memo. See the blog post [\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead.", + "type": [ + "string", + "null" + ] + }, "timeout": { "description": "when packet times out, measured on remote chain", "allOf": [ @@ -430,7 +452,8 @@ "description": "address on the remote chain to receive these tokens", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -464,7 +487,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -485,7 +509,8 @@ "channel_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -516,7 +541,8 @@ } ] } - } + }, + "additionalProperties": false }, "IbcTimeoutBlock": { "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", @@ -533,12 +559,13 @@ "minimum": 0.0 }, "revision": { - "description": "the version that the client is currently on (eg. after reseting the chain this could increment 1 as height drops to 0)", + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", "type": "integer", "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "StakingMsg": { "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", @@ -563,7 +590,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -588,7 +616,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -617,7 +646,8 @@ "src_validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -632,8 +662,8 @@ } ] }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", "type": "string" }, "Uint64": { @@ -684,13 +714,14 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address.", "type": "object", "required": [ "instantiate" @@ -723,7 +754,7 @@ } }, "label": { - "description": "A human-readbale label for the contract", + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", "type": "string" }, "msg": { @@ -734,7 +765,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -771,7 +803,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -796,7 +829,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -817,7 +851,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -927,12 +962,13 @@ ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "$ref": "#/definitions/Uint256" }, "denom": { "type": "string" } - } + }, + "additionalProperties": false }, "Timestamp": { "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", @@ -942,8 +978,8 @@ } ] }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", "type": "string" }, "Uint64": { @@ -1026,12 +1062,13 @@ ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "$ref": "#/definitions/Uint256" }, "denom": { "type": "string" } - } + }, + "additionalProperties": false }, "Timestamp": { "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", @@ -1041,8 +1078,8 @@ } ] }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", "type": "string" }, "Uint64": { diff --git a/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_balances.json b/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_balances.json new file mode 100644 index 0000000000..f8cd0c5f1c --- /dev/null +++ b/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_balances.json @@ -0,0 +1,73 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AcknowledgementMsgBalances", + "description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", + "oneOf": [ + { + "type": "object", + "required": [ + "ok" + ], + "properties": { + "ok": { + "$ref": "#/definitions/BalancesResponse" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "BalancesResponse": { + "description": "This is the success response we send on ack for PacketMsg::Balance. Just acknowledge success or error", + "type": "object", + "required": [ + "account", + "balances" + ], + "properties": { + "account": { + "type": "string" + }, + "balances": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + }, + "additionalProperties": false + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + } + } +} diff --git a/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_dispatch.json b/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_dispatch.json new file mode 100644 index 0000000000..5c010f5bd1 --- /dev/null +++ b/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_dispatch.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AcknowledgementMsgDispatch", + "description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", + "oneOf": [ + { + "type": "object", + "required": [ + "ok" + ], + "properties": { + "ok": { + "type": "null" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_who_am_i.json b/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_who_am_i.json new file mode 100644 index 0000000000..f706c655de --- /dev/null +++ b/contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_who_am_i.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AcknowledgementMsgWhoAmI", + "description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", + "oneOf": [ + { + "type": "object", + "required": [ + "ok" + ], + "properties": { + "ok": { + "$ref": "#/definitions/WhoAmIResponse" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "WhoAmIResponse": { + "description": "This is the success response we send on ack for PacketMsg::WhoAmI. Return the caller's account address on the remote chain", + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/ibc-reflect-send/schema/packet_msg.json b/contracts/ibc-reflect-send/schema/ibc/packet_msg.json similarity index 79% rename from contracts/ibc-reflect-send/schema/packet_msg.json rename to contracts/ibc-reflect-send/schema/ibc/packet_msg.json index 1aeb3db835..3f71b24276 100644 --- a/contracts/ibc-reflect-send/schema/packet_msg.json +++ b/contracts/ibc-reflect-send/schema/ibc/packet_msg.json @@ -21,7 +21,8 @@ "$ref": "#/definitions/CosmosMsg_for_Empty" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -33,7 +34,8 @@ ], "properties": { "who_am_i": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -45,7 +47,8 @@ ], "properties": { "balances": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -78,7 +81,8 @@ "to_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -102,7 +106,8 @@ "$ref": "#/definitions/Coin" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -121,12 +126,13 @@ ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "$ref": "#/definitions/Uint256" }, "denom": { "type": "string" } - } + }, + "additionalProperties": false }, "CosmosMsg_for_Empty": { "oneOf": [ @@ -179,7 +185,8 @@ "additionalProperties": false }, { - "description": "A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "deprecated": true, "type": "object", "required": [ "stargate" @@ -198,7 +205,8 @@ "value": { "$ref": "#/definitions/Binary" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -261,13 +269,14 @@ "description": "The `withdraw_address`", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", "type": "object", "required": [ "withdraw_delegator_reward" @@ -283,7 +292,8 @@ "description": "The `validator_address`", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -291,10 +301,12 @@ ] }, "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false }, "GovMsg": { + "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```", "oneOf": [ { "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", @@ -306,19 +318,25 @@ "vote": { "type": "object", "required": [ - "proposal_id", - "vote" + "option", + "proposal_id" ], "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "allOf": [ + { + "$ref": "#/definitions/VoteOption" + } + ] + }, "proposal_id": { "type": "integer", "format": "uint64", "minimum": 0.0 - }, - "vote": { - "$ref": "#/definitions/VoteOption" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -353,9 +371,16 @@ ] }, "channel_id": { - "description": "exisiting channel to send the tokens over", + "description": "existing channel to send the tokens over", "type": "string" }, + "memo": { + "description": "An optional memo. See the blog post [\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead.", + "type": [ + "string", + "null" + ] + }, "timeout": { "description": "when packet times out, measured on remote chain", "allOf": [ @@ -368,7 +393,8 @@ "description": "address on the remote chain to receive these tokens", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -402,7 +428,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -423,7 +450,8 @@ "channel_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -454,7 +482,8 @@ } ] } - } + }, + "additionalProperties": false }, "IbcTimeoutBlock": { "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", @@ -471,12 +500,13 @@ "minimum": 0.0 }, "revision": { - "description": "the version that the client is currently on (eg. after reseting the chain this could increment 1 as height drops to 0)", + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", "type": "integer", "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "StakingMsg": { "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", @@ -501,7 +531,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -526,7 +557,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -555,7 +587,8 @@ "src_validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -570,8 +603,8 @@ } ] }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", "type": "string" }, "Uint64": { @@ -622,13 +655,14 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address.", "type": "object", "required": [ "instantiate" @@ -661,7 +695,7 @@ } }, "label": { - "description": "A human-readbale label for the contract", + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", "type": "string" }, "msg": { @@ -672,7 +706,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -709,7 +744,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -734,7 +770,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -755,7 +792,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/ibc-reflect/schema/packet_msg.json b/contracts/ibc-reflect-send/schema/raw/execute.json similarity index 59% rename from contracts/ibc-reflect/schema/packet_msg.json rename to contracts/ibc-reflect-send/schema/raw/execute.json index 11f1cb38eb..ba99d4ab96 100644 --- a/contracts/ibc-reflect/schema/packet_msg.json +++ b/contracts/ibc-reflect-send/schema/raw/execute.json @@ -1,19 +1,45 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "PacketMsg", + "title": "ExecuteMsg", "oneOf": [ { + "description": "Changes the admin", "type": "object", "required": [ - "dispatch" + "update_admin" ], "properties": { - "dispatch": { + "update_admin": { "type": "object", "required": [ + "admin" + ], + "properties": { + "admin": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "send_msgs" + ], + "properties": { + "send_msgs": { + "type": "object", + "required": [ + "channel_id", "msgs" ], "properties": { + "channel_id": { + "type": "string" + }, "msgs": { "type": "array", "items": { @@ -29,24 +55,47 @@ { "type": "object", "required": [ - "who_am_i" + "check_remote_balance" ], "properties": { - "who_am_i": { + "check_remote_balance": { "type": "object", + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "string" + } + }, "additionalProperties": false } }, "additionalProperties": false }, { + "description": "If you sent funds to this contract, it will attempt to ibc transfer them to the account on the remote side of this channel. If we don't have the address yet, this fails.", "type": "object", "required": [ - "balances" + "send_funds" ], "properties": { - "balances": { + "send_funds": { "type": "object", + "required": [ + "reflect_channel_id", + "transfer_channel_id" + ], + "properties": { + "reflect_channel_id": { + "description": "The channel id we use above to talk with the reflect contract", + "type": "string" + }, + "transfer_channel_id": { + "description": "The channel to use for ibctransfer. This is bound to a different port and handled by a different module. It should connect to the same chain as the reflect_channel_id does", + "type": "string" + } + }, "additionalProperties": false } }, @@ -80,7 +129,8 @@ "to_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -104,7 +154,8 @@ "$ref": "#/definitions/Coin" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -123,12 +174,13 @@ ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "$ref": "#/definitions/Uint256" }, "denom": { "type": "string" } - } + }, + "additionalProperties": false }, "CosmosMsg_for_Empty": { "oneOf": [ @@ -157,7 +209,32 @@ "additionalProperties": false }, { - "description": "A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "object", + "required": [ + "staking" + ], + "properties": { + "staking": { + "$ref": "#/definitions/StakingMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "distribution" + ], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionMsg" + } + }, + "additionalProperties": false + }, + { + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "deprecated": true, "type": "object", "required": [ "stargate" @@ -176,7 +253,8 @@ "value": { "$ref": "#/definitions/Binary" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -219,11 +297,64 @@ } ] }, + "DistributionMsg": { + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "set_withdraw_address" + ], + "properties": { + "set_withdraw_address": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The `withdraw_address`", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "withdraw_delegator_reward" + ], + "properties": { + "withdraw_delegator_reward": { + "type": "object", + "required": [ + "validator" + ], + "properties": { + "validator": { + "description": "The `validator_address`", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false }, "GovMsg": { + "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```", "oneOf": [ { "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", @@ -235,19 +366,25 @@ "vote": { "type": "object", "required": [ - "proposal_id", - "vote" + "option", + "proposal_id" ], "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "allOf": [ + { + "$ref": "#/definitions/VoteOption" + } + ] + }, "proposal_id": { "type": "integer", "format": "uint64", "minimum": 0.0 - }, - "vote": { - "$ref": "#/definitions/VoteOption" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -282,9 +419,16 @@ ] }, "channel_id": { - "description": "exisiting channel to send the tokens over", + "description": "existing channel to send the tokens over", "type": "string" }, + "memo": { + "description": "An optional memo. See the blog post [\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead.", + "type": [ + "string", + "null" + ] + }, "timeout": { "description": "when packet times out, measured on remote chain", "allOf": [ @@ -297,7 +441,8 @@ "description": "address on the remote chain to receive these tokens", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -331,7 +476,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -352,7 +498,8 @@ "channel_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -383,7 +530,8 @@ } ] } - } + }, + "additionalProperties": false }, "IbcTimeoutBlock": { "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", @@ -400,12 +548,100 @@ "minimum": 0.0 }, "revision": { - "description": "the version that the client is currently on (eg. after reseting the chain this could increment 1 as height drops to 0)", + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", "type": "integer", "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false + }, + "StakingMsg": { + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "delegate" + ], + "properties": { + "delegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "undelegate" + ], + "properties": { + "undelegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "redelegate" + ], + "properties": { + "redelegate": { + "type": "object", + "required": [ + "amount", + "dst_validator", + "src_validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "dst_validator": { + "type": "string" + }, + "src_validator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] }, "Timestamp": { "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", @@ -415,8 +651,8 @@ } ] }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", "type": "string" }, "Uint64": { @@ -467,13 +703,14 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address.", "type": "object", "required": [ "instantiate" @@ -506,7 +743,7 @@ } }, "label": { - "description": "A human-readbale label for the contract", + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", "type": "string" }, "msg": { @@ -517,7 +754,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -554,7 +792,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -579,7 +818,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -600,7 +840,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/ibc-reflect-send/schema/raw/instantiate.json b/contracts/ibc-reflect-send/schema/raw/instantiate.json new file mode 100644 index 0000000000..4eb2ede310 --- /dev/null +++ b/contracts/ibc-reflect-send/schema/raw/instantiate.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "This needs no info. Owner of the contract is whoever signed the InstantiateMsg.", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/ibc-reflect-send/schema/raw/query.json b/contracts/ibc-reflect-send/schema/raw/query.json new file mode 100644 index 0000000000..05a60cc1b8 --- /dev/null +++ b/contracts/ibc-reflect-send/schema/raw/query.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "admin" + ], + "properties": { + "admin": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list_accounts" + ], + "properties": { + "list_accounts": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "object", + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/ibc-reflect-send/schema/raw/response_to_account.json b/contracts/ibc-reflect-send/schema/raw/response_to_account.json new file mode 100644 index 0000000000..3726662485 --- /dev/null +++ b/contracts/ibc-reflect-send/schema/raw/response_to_account.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountInfo", + "type": "object", + "required": [ + "channel_id", + "last_update_time", + "remote_balance" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "last_update_time": { + "description": "last block balance was updated (0 is never)", + "allOf": [ + { + "$ref": "#/definitions/Timestamp" + } + ] + }, + "remote_addr": { + "description": "in normal cases, it should be set, but there is a delay between binding the channel and making a query and in that time it is empty", + "type": [ + "string", + "null" + ] + }, + "remote_balance": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/ibc-reflect-send/schema/raw/response_to_admin.json b/contracts/ibc-reflect-send/schema/raw/response_to_admin.json new file mode 100644 index 0000000000..627be7a025 --- /dev/null +++ b/contracts/ibc-reflect-send/schema/raw/response_to_admin.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AdminResponse", + "type": "object", + "required": [ + "admin" + ], + "properties": { + "admin": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/ibc-reflect-send/schema/raw/response_to_list_accounts.json b/contracts/ibc-reflect-send/schema/raw/response_to_list_accounts.json new file mode 100644 index 0000000000..3a26517c9b --- /dev/null +++ b/contracts/ibc-reflect-send/schema/raw/response_to_list_accounts.json @@ -0,0 +1,86 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListAccountsResponse", + "type": "object", + "required": [ + "accounts" + ], + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountInfo" + } + } + }, + "additionalProperties": false, + "definitions": { + "AccountInfo": { + "type": "object", + "required": [ + "channel_id", + "last_update_time", + "remote_balance" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "last_update_time": { + "description": "last block balance was updated (0 is never)", + "allOf": [ + { + "$ref": "#/definitions/Timestamp" + } + ] + }, + "remote_addr": { + "description": "in normal cases, it should be set, but there is a delay between binding the channel and making a query and in that time it is empty", + "type": [ + "string", + "null" + ] + }, + "remote_balance": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + }, + "additionalProperties": false + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/ibc-reflect/examples/schema.rs b/contracts/ibc-reflect-send/src/bin/schema.rs similarity index 74% rename from contracts/ibc-reflect/examples/schema.rs rename to contracts/ibc-reflect-send/src/bin/schema.rs index 74b3408387..984c6923cf 100644 --- a/contracts/ibc-reflect/examples/schema.rs +++ b/contracts/ibc-reflect-send/src/bin/schema.rs @@ -1,24 +1,26 @@ use std::env::current_dir; +use std::fs::create_dir_all; use cosmwasm_schema::{export_schema, export_schema_with_title, schema_for, write_api}; -use cosmwasm_std::Empty; -use ibc_reflect::msg::{ - AcknowledgementMsg, BalancesResponse, DispatchResponse, InstantiateMsg, PacketMsg, QueryMsg, - WhoAmIResponse, +use ibc_reflect_send::ibc_msg::{ + AcknowledgementMsg, BalancesResponse, DispatchResponse, PacketMsg, WhoAmIResponse, }; +use ibc_reflect_send::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; fn main() { // Clear & write standard API write_api! { instantiate: InstantiateMsg, + execute: ExecuteMsg, query: QueryMsg, - migrate: Empty, } // Schemas for inter-contract communication let mut out_dir = current_dir().unwrap(); out_dir.push("schema"); + out_dir.push("ibc"); + create_dir_all(&out_dir).unwrap(); export_schema(&schema_for!(PacketMsg), &out_dir); export_schema_with_title( &schema_for!(AcknowledgementMsg), diff --git a/contracts/ibc-reflect-send/src/contract.rs b/contracts/ibc-reflect-send/src/contract.rs index 3784fc57cd..1801483d95 100644 --- a/contracts/ibc-reflect-send/src/contract.rs +++ b/contracts/ibc-reflect-send/src/contract.rs @@ -1,6 +1,6 @@ use cosmwasm_std::{ - entry_point, to_binary, CosmosMsg, Deps, DepsMut, Env, IbcMsg, MessageInfo, Order, - QueryResponse, Response, StdError, StdResult, + entry_point, to_json_binary, CosmosMsg, Deps, DepsMut, Env, IbcMsg, MessageInfo, QueryResponse, + Response, StdError, StdResult, }; use crate::ibc::PACKET_LIFETIME; @@ -9,7 +9,7 @@ use crate::msg::{ AccountInfo, AccountResponse, AdminResponse, ExecuteMsg, InstantiateMsg, ListAccountsResponse, QueryMsg, }; -use crate::state::{accounts, accounts_read, config, config_read, Config}; +use crate::state::{load_account, load_config, range_accounts, save_config, Config}; #[entry_point] pub fn instantiate( @@ -20,7 +20,7 @@ pub fn instantiate( ) -> StdResult { // we store the reflect_id for creating accounts later let cfg = Config { admin: info.sender }; - config(deps.storage).save(&cfg)?; + save_config(deps.storage, &cfg)?; Ok(Response::new().add_attribute("action", "instantiate")) } @@ -48,12 +48,12 @@ pub fn handle_update_admin( new_admin: String, ) -> StdResult { // auth check - let mut cfg = config(deps.storage).load()?; + let mut cfg = load_config(deps.storage)?; if info.sender != cfg.admin { - return Err(StdError::generic_err("Only admin may set new admin")); + return Err(StdError::msg("Only admin may set new admin")); } cfg.admin = deps.api.addr_validate(&new_admin)?; - config(deps.storage).save(&cfg)?; + save_config(deps.storage, &cfg)?; Ok(Response::new() .add_attribute("action", "handle_update_admin") @@ -68,18 +68,18 @@ pub fn handle_send_msgs( msgs: Vec, ) -> StdResult { // auth check - let cfg = config(deps.storage).load()?; + let cfg = load_config(deps.storage)?; if info.sender != cfg.admin { - return Err(StdError::generic_err("Only admin may send messages")); + return Err(StdError::msg("Only admin may send messages")); } // ensure the channel exists (not found if not registered) - accounts(deps.storage).load(channel_id.as_bytes())?; + load_account(deps.storage, &channel_id)?; // construct a packet to send let packet = PacketMsg::Dispatch { msgs }; let msg = IbcMsg::SendPacket { channel_id, - data: to_binary(&packet)?, + data: to_json_binary(&packet)?, timeout: env.block.time.plus_seconds(PACKET_LIFETIME).into(), }; @@ -96,18 +96,18 @@ pub fn handle_check_remote_balance( channel_id: String, ) -> StdResult { // auth check - let cfg = config(deps.storage).load()?; + let cfg = load_config(deps.storage)?; if info.sender != cfg.admin { - return Err(StdError::generic_err("Only admin may send messages")); + return Err(StdError::msg("Only admin may send messages")); } // ensure the channel exists (not found if not registered) - accounts(deps.storage).load(channel_id.as_bytes())?; + load_account(deps.storage, &channel_id)?; // construct a packet to send let packet = PacketMsg::Balances {}; let msg = IbcMsg::SendPacket { channel_id, - data: to_binary(&packet)?, + data: to_json_binary(&packet)?, timeout: env.block.time.plus_seconds(PACKET_LIFETIME).into(), }; @@ -130,22 +130,22 @@ pub fn handle_send_funds( let amount = match info.funds.pop() { Some(coin) => coin, None => { - return Err(StdError::generic_err( + return Err(StdError::msg( "you must send the coins you wish to ibc transfer", )) } }; // if there are any more coins, reject the message if !info.funds.is_empty() { - return Err(StdError::generic_err("you can only ibc transfer one coin")); + return Err(StdError::msg("you can only ibc transfer one coin")); } // load remote account - let data = accounts(deps.storage).load(reflect_channel_id.as_bytes())?; + let data = load_account(deps.storage, &reflect_channel_id)?; let remote_addr = match data.remote_addr { Some(addr) => addr, None => { - return Err(StdError::generic_err( + return Err(StdError::msg( "We don't have the remote address for this channel", )) } @@ -157,6 +157,7 @@ pub fn handle_send_funds( to_address: remote_addr, amount, timeout: env.block.time.plus_seconds(PACKET_LIFETIME).into(), + memo: None, }; let res = Response::new() @@ -168,23 +169,21 @@ pub fn handle_send_funds( #[entry_point] pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { match msg { - QueryMsg::Admin {} => to_binary(&query_admin(deps)?), - QueryMsg::Account { channel_id } => to_binary(&query_account(deps, channel_id)?), - QueryMsg::ListAccounts {} => to_binary(&query_list_accounts(deps)?), + QueryMsg::Admin {} => to_json_binary(&query_admin(deps)?), + QueryMsg::Account { channel_id } => to_json_binary(&query_account(deps, channel_id)?), + QueryMsg::ListAccounts {} => to_json_binary(&query_list_accounts(deps)?), } } fn query_account(deps: Deps, channel_id: String) -> StdResult { - let account = accounts_read(deps.storage).load(channel_id.as_bytes())?; + let account = load_account(deps.storage, &channel_id)?; Ok(account.into()) } fn query_list_accounts(deps: Deps) -> StdResult { - let accounts: StdResult> = accounts_read(deps.storage) - .range(None, None, Order::Ascending) + let accounts: StdResult> = range_accounts(deps.storage) .map(|r| { - let (k, account) = r?; - let channel_id = String::from_utf8(k)?; + let (channel_id, account) = r?; Ok(AccountInfo::convert(channel_id, account)) }) .collect(); @@ -194,7 +193,7 @@ fn query_list_accounts(deps: Deps) -> StdResult { } fn query_admin(deps: Deps) -> StdResult { - let Config { admin } = config_read(deps.storage).load()?; + let Config { admin } = load_config(deps.storage)?; Ok(AdminResponse { admin: admin.into(), }) @@ -203,19 +202,20 @@ fn query_admin(deps: Deps) -> StdResult { #[cfg(test)] mod tests { use super::*; - use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; + use cosmwasm_std::testing::{message_info, mock_dependencies, mock_env}; const CREATOR: &str = "creator"; #[test] fn instantiate_works() { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make(CREATOR); let msg = InstantiateMsg {}; - let info = mock_info(CREATOR, &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(0, res.messages.len()); let admin = query_admin(deps.as_ref()).unwrap(); - assert_eq!(CREATOR, admin.admin.as_str()); + assert_eq!(admin.admin.as_str(), creator.as_str()); } } diff --git a/contracts/ibc-reflect-send/src/ibc.rs b/contracts/ibc-reflect-send/src/ibc.rs index dca8cbf78c..ac1fffbce2 100644 --- a/contracts/ibc-reflect-send/src/ibc.rs +++ b/contracts/ibc-reflect-send/src/ibc.rs @@ -1,13 +1,14 @@ use cosmwasm_std::{ - entry_point, from_slice, to_binary, DepsMut, Env, IbcBasicResponse, IbcChannelCloseMsg, - IbcChannelConnectMsg, IbcChannelOpenMsg, IbcMsg, IbcOrder, IbcPacketAckMsg, - IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, StdError, StdResult, + entry_point, from_json, to_json_binary, Binary, DepsMut, Env, Ibc3ChannelOpenResponse, + IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, + IbcChannelOpenResponse, IbcMsg, IbcOrder, IbcPacketAckMsg, IbcPacketReceiveMsg, + IbcPacketTimeoutMsg, IbcReceiveResponse, Never, StdError, StdResult, }; use crate::ibc_msg::{ AcknowledgementMsg, BalancesResponse, DispatchResponse, PacketMsg, WhoAmIResponse, }; -use crate::state::{accounts, AccountData}; +use crate::state::{may_load_account, remove_account, save_account, AccountData}; pub const IBC_APP_VERSION: &str = "ibc-reflect-v1"; @@ -16,30 +17,34 @@ pub const IBC_APP_VERSION: &str = "ibc-reflect-v1"; pub const PACKET_LIFETIME: u64 = 60 * 60; #[entry_point] -/// enforces ordering and versioing constraints -pub fn ibc_channel_open(_deps: DepsMut, _env: Env, msg: IbcChannelOpenMsg) -> StdResult<()> { +/// enforces ordering and versioning constraints +pub fn ibc_channel_open( + _deps: DepsMut, + _env: Env, + msg: IbcChannelOpenMsg, +) -> StdResult { let channel = msg.channel(); if channel.order != IbcOrder::Ordered { - return Err(StdError::generic_err("Only supports ordered channels")); + return Err(StdError::msg("Only supports ordered channels")); } if channel.version.as_str() != IBC_APP_VERSION { - return Err(StdError::generic_err(format!( - "Must set version to `{}`", - IBC_APP_VERSION + return Err(StdError::msg(format_args!( + "Must set version to `{IBC_APP_VERSION}`" ))); } if let Some(counter_version) = msg.counterparty_version() { if counter_version != IBC_APP_VERSION { - return Err(StdError::generic_err(format!( - "Counterparty version must be `{}`", - IBC_APP_VERSION + return Err(StdError::msg(format_args!( + "Counterparty version must be `{IBC_APP_VERSION}`" ))); } } - Ok(()) + Ok(Some(Ibc3ChannelOpenResponse { + version: IBC_APP_VERSION.to_string(), + })) } #[entry_point] @@ -53,15 +58,15 @@ pub fn ibc_channel_connect( let channel_id = &channel.endpoint.channel_id; - // create an account holder the channel exists (not found if not registered) + // create an account holder when the channel exists (not found if not registered) let data = AccountData::default(); - accounts(deps.storage).save(channel_id.as_bytes(), &data)?; + save_account(deps.storage, channel_id, &data)?; // construct a packet to send let packet = PacketMsg::WhoAmI {}; let msg = IbcMsg::SendPacket { channel_id: channel_id.clone(), - data: to_binary(&packet)?, + data: to_json_binary(&packet)?, timeout: env.block.time.plus_seconds(PACKET_LIFETIME).into(), }; @@ -82,7 +87,7 @@ pub fn ibc_channel_close( // remove the channel let channel_id = &channel.endpoint.channel_id; - accounts(deps.storage).remove(channel_id.as_bytes()); + remove_account(deps.storage, channel_id); Ok(IbcBasicResponse::new() .add_attribute("action", "ibc_close") @@ -95,10 +100,8 @@ pub fn ibc_packet_receive( _deps: DepsMut, _env: Env, _packet: IbcPacketReceiveMsg, -) -> StdResult { - Ok(IbcReceiveResponse::new() - .set_ack(b"{}") - .add_attribute("action", "ibc_packet_ack")) +) -> Result { + Ok(IbcReceiveResponse::new(Binary::from(b"{}")).add_attribute("action", "ibc_packet_ack")) } #[entry_point] @@ -107,21 +110,21 @@ pub fn ibc_packet_ack( env: Env, msg: IbcPacketAckMsg, ) -> StdResult { - // which local channel was this packet send from + // which local channel was this packet sent from let caller = msg.original_packet.src.channel_id; // we need to parse the ack based on our request - let packet: PacketMsg = from_slice(&msg.original_packet.data)?; + let packet: PacketMsg = from_json(msg.original_packet.data)?; match packet { PacketMsg::Dispatch { .. } => { - let res: AcknowledgementMsg = from_slice(&msg.acknowledgement.data)?; + let res: AcknowledgementMsg = from_json(msg.acknowledgement.data)?; acknowledge_dispatch(deps, caller, res) } PacketMsg::WhoAmI {} => { - let res: AcknowledgementMsg = from_slice(&msg.acknowledgement.data)?; + let res: AcknowledgementMsg = from_json(msg.acknowledgement.data)?; acknowledge_who_am_i(deps, caller, res) } PacketMsg::Balances {} => { - let res: AcknowledgementMsg = from_slice(&msg.acknowledgement.data)?; + let res: AcknowledgementMsg = from_json(msg.acknowledgement.data)?; acknowledge_balances(deps, env, caller, res) } } @@ -148,25 +151,22 @@ fn acknowledge_who_am_i( // ignore errors (but mention in log) let WhoAmIResponse { account } = match ack { AcknowledgementMsg::Ok(res) => res, - AcknowledgementMsg::Err(e) => { + AcknowledgementMsg::Error(e) => { return Ok(IbcBasicResponse::new() .add_attribute("action", "acknowledge_who_am_i") .add_attribute("error", e)) } }; - - accounts(deps.storage).update(caller.as_bytes(), |acct| -> StdResult<_> { - match acct { - Some(mut acct) => { - // set the account the first time - if acct.remote_addr.is_none() { - acct.remote_addr = Some(account); - } - Ok(acct) + match may_load_account(deps.storage, &caller)? { + Some(mut acct) => { + // set the account the first time + if acct.remote_addr.is_none() { + acct.remote_addr = Some(account); } - None => Err(StdError::generic_err("no account to update")), + save_account(deps.storage, &caller, &acct)?; } - })?; + None => return Err(StdError::msg("no account to update")), + } Ok(IbcBasicResponse::new().add_attribute("action", "acknowledge_who_am_i")) } @@ -181,33 +181,34 @@ fn acknowledge_balances( // ignore errors (but mention in log) let BalancesResponse { account, balances } = match ack { AcknowledgementMsg::Ok(res) => res, - AcknowledgementMsg::Err(e) => { + AcknowledgementMsg::Error(e) => { return Ok(IbcBasicResponse::new() .add_attribute("action", "acknowledge_balances") .add_attribute("error", e)) } }; - accounts(deps.storage).update(caller.as_bytes(), |acct| -> StdResult<_> { - match acct { - Some(acct) => { - if let Some(old_addr) = acct.remote_addr { - if old_addr != account { - return Err(StdError::generic_err(format!( - "remote account changed from {} to {}", - old_addr, account - ))); - } + match may_load_account(deps.storage, &caller)? { + Some(acct) => { + if let Some(old_addr) = acct.remote_addr { + if old_addr != account { + return Err(StdError::msg(format_args!( + "remote account changed from {old_addr} to {account}" + ))); } - Ok(AccountData { + } + save_account( + deps.storage, + &caller, + &AccountData { last_update_time: env.block.time, remote_addr: Some(account), remote_balance: balances, - }) - } - None => Err(StdError::generic_err("no account to update")), + }, + )?; } - })?; + None => return Err(StdError::msg("no account to update")), + } Ok(IbcBasicResponse::new().add_attribute("action", "acknowledge_balances")) } @@ -229,9 +230,9 @@ mod tests { use crate::msg::{AccountResponse, ExecuteMsg, InstantiateMsg, QueryMsg}; use cosmwasm_std::testing::{ - mock_dependencies, mock_env, mock_ibc_channel_connect_ack, mock_ibc_channel_open_init, - mock_ibc_channel_open_try, mock_ibc_packet_ack, mock_info, MockApi, MockQuerier, - MockStorage, + message_info, mock_dependencies, mock_env, mock_ibc_channel_connect_ack, + mock_ibc_channel_open_init, mock_ibc_channel_open_try, mock_ibc_packet_ack, MockApi, + MockQuerier, MockStorage, }; use cosmwasm_std::{coin, coins, BankMsg, CosmosMsg, IbcAcknowledgement, OwnedDeps}; @@ -239,8 +240,9 @@ mod tests { fn setup() -> OwnedDeps { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make(CREATOR); let msg = InstantiateMsg {}; - let info = mock_info(CREATOR, &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(0, res.messages.len()); deps @@ -266,7 +268,7 @@ mod tests { channel_id: packet_channel, .. }) => assert_eq!(packet_channel.as_str(), channel_id), - o => panic!("Unexpected message: {:?}", o), + o => panic!("Unexpected message: {o:?}"), }; } @@ -309,7 +311,7 @@ mod tests { channel_id: channel_id.into(), }; let r = query(deps.as_ref(), mock_env(), q).unwrap(); - let acct: AccountResponse = from_slice(&r).unwrap(); + let acct: AccountResponse = from_json(r).unwrap(); assert!(acct.remote_addr.is_none()); assert!(acct.remote_balance.is_empty()); assert_eq!(0, acct.last_update_time.nanos()); @@ -323,7 +325,7 @@ mod tests { channel_id: channel_id.into(), }; let r = query(deps.as_ref(), mock_env(), q).unwrap(); - let acct: AccountResponse = from_slice(&r).unwrap(); + let acct: AccountResponse = from_json(r).unwrap(); assert_eq!(acct.remote_addr.unwrap(), remote_addr); assert!(acct.remote_balance.is_empty()); assert_eq!(0, acct.last_update_time.nanos()); @@ -336,6 +338,7 @@ mod tests { // init contract let mut deps = setup(); + let creator = deps.api.addr_make(CREATOR); // channel handshake connect(deps.as_mut(), channel_id); // get feedback from WhoAmI packet @@ -351,7 +354,7 @@ mod tests { channel_id: channel_id.into(), msgs: msgs_to_dispatch, }; - let info = mock_info(CREATOR, &[]); + let info = message_info(&creator, &[]); let mut res = execute(deps.as_mut(), mock_env(), info, handle_msg).unwrap(); assert_eq!(1, res.messages.len()); let msg = match res.messages.swap_remove(0).msg { @@ -363,7 +366,7 @@ mod tests { msg.original_packet.data = data; msg } - o => panic!("Unexpected message: {:?}", o), + o => panic!("Unexpected message: {o:?}"), }; let res = ibc_packet_ack(deps.as_mut(), mock_env(), msg).unwrap(); // no actions expected, but let's check the events to see it was dispatched properly @@ -379,6 +382,7 @@ mod tests { // init contract let mut deps = setup(); + let creator = deps.api.addr_make(CREATOR); // channel handshake connect(deps.as_mut(), reflect_channel_id); // get feedback from WhoAmI packet @@ -389,7 +393,7 @@ mod tests { reflect_channel_id: "random-channel".into(), transfer_channel_id: transfer_channel_id.into(), }; - let info = mock_info(CREATOR, &coins(12344, "utrgd")); + let info = message_info(&creator, &coins(12344, "utrgd")); execute(deps.as_mut(), mock_env(), info, msg).unwrap_err(); // let's try with no sent funds in the message @@ -397,7 +401,7 @@ mod tests { reflect_channel_id: reflect_channel_id.into(), transfer_channel_id: transfer_channel_id.into(), }; - let info = mock_info(CREATOR, &[]); + let info = message_info(&creator, &[]); execute(deps.as_mut(), mock_env(), info, msg).unwrap_err(); // 3rd times the charm @@ -405,7 +409,7 @@ mod tests { reflect_channel_id: reflect_channel_id.into(), transfer_channel_id: transfer_channel_id.into(), }; - let info = mock_info(CREATOR, &coins(12344, "utrgd")); + let info = message_info(&creator, &coins(12344, "utrgd")); let res = execute(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(1, res.messages.len()); match &res.messages[0].msg { @@ -414,14 +418,16 @@ mod tests { to_address, amount, timeout, + memo, }) => { assert_eq!(transfer_channel_id, channel_id.as_str()); assert_eq!(remote_addr, to_address.as_str()); assert_eq!(&coin(12344, "utrgd"), amount); assert!(timeout.block().is_none()); assert!(timeout.timestamp().is_some()); + assert!(memo.is_none()); } - o => panic!("unexpected message: {:?}", o), + o => panic!("unexpected message: {o:?}"), } } } diff --git a/contracts/ibc-reflect-send/src/ibc_msg.rs b/contracts/ibc-reflect-send/src/ibc_msg.rs index d395388c3a..ca6041218c 100644 --- a/contracts/ibc-reflect-send/src/ibc_msg.rs +++ b/contracts/ibc-reflect-send/src/ibc_msg.rs @@ -1,4 +1,5 @@ -use cosmwasm_std::{Coin, ContractResult, CosmosMsg}; +use cosmwasm_schema::cw_serde; +use cosmwasm_std::{Coin, CosmosMsg}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -11,9 +12,35 @@ pub enum PacketMsg { Balances {}, } -/// All IBC acknowledgements are wrapped in `ContractResult`. -/// The success value depends on the PacketMsg variant. -pub type AcknowledgementMsg = ContractResult; +/// A custom acknowledgement type. +/// The success type `T` depends on the PacketMsg variant. +/// +/// This could be refactored to use [StdAck] at some point. However, +/// it has a different success variant name ("ok" vs. "result") and +/// a JSON payload instead of a binary payload. +/// +/// [StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512 +#[cw_serde] +pub enum AcknowledgementMsg { + Ok(S), + Error(String), +} + +impl AcknowledgementMsg { + pub fn unwrap(self) -> S { + match self { + AcknowledgementMsg::Ok(data) => data, + AcknowledgementMsg::Error(err) => panic!("{}", err), + } + } + + pub fn unwrap_err(self) -> String { + match self { + AcknowledgementMsg::Ok(_) => panic!("not an error"), + AcknowledgementMsg::Error(err) => err, + } + } +} /// This is the success response we send on ack for PacketMsg::Dispatch. /// Just acknowledge success or error diff --git a/contracts/ibc-reflect-send/src/state.rs b/contracts/ibc-reflect-send/src/state.rs index a44d66b1d5..79ac1110fc 100644 --- a/contracts/ibc-reflect-send/src/state.rs +++ b/contracts/ibc-reflect-send/src/state.rs @@ -1,13 +1,16 @@ use serde::{Deserialize, Serialize}; -use cosmwasm_std::{Addr, Coin, Storage, Timestamp}; -use cosmwasm_storage::{ - bucket, bucket_read, singleton, singleton_read, Bucket, ReadonlyBucket, ReadonlySingleton, - Singleton, +use cosmwasm_std::{ + from_json, + storage_keys::{namespace_with_key, to_length_prefixed}, + to_json_vec, Addr, Coin, Order, StdError, StdResult, Storage, Timestamp, }; pub const KEY_CONFIG: &[u8] = b"config"; +/// accounts is lookup of channel_id to reflect contract pub const PREFIX_ACCOUNTS: &[u8] = b"accounts"; +/// Upper bound for ranging over accounts +const PREFIX_ACCOUNTS_UPPER_BOUND: &[u8] = b"accountt"; // spellchecker:disable-line #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] pub struct Config { @@ -27,19 +30,52 @@ pub struct AccountData { pub remote_balance: Vec, } -/// accounts is lookup of channel_id to reflect contract -pub fn accounts(storage: &mut dyn Storage) -> Bucket { - bucket(storage, PREFIX_ACCOUNTS) +pub fn may_load_account(storage: &dyn Storage, id: &str) -> StdResult> { + storage + .get(&namespace_with_key(&[PREFIX_ACCOUNTS], id.as_bytes())) + .map(from_json) + .transpose() +} + +pub fn load_account(storage: &dyn Storage, id: &str) -> StdResult { + may_load_account(storage, id)?.ok_or_else(|| StdError::msg(format!("account {id} not found"))) +} + +pub fn save_account(storage: &mut dyn Storage, id: &str, account: &AccountData) -> StdResult<()> { + storage.set( + &namespace_with_key(&[PREFIX_ACCOUNTS], id.as_bytes()), + &to_json_vec(account)?, + ); + Ok(()) +} + +pub fn remove_account(storage: &mut dyn Storage, id: &str) { + storage.remove(&namespace_with_key(&[PREFIX_ACCOUNTS], id.as_bytes())); } -pub fn accounts_read(storage: &dyn Storage) -> ReadonlyBucket { - bucket_read(storage, PREFIX_ACCOUNTS) +pub fn range_accounts( + storage: &dyn Storage, +) -> impl Iterator> + '_ { + let prefix = to_length_prefixed(PREFIX_ACCOUNTS); + let upper_bound = to_length_prefixed(PREFIX_ACCOUNTS_UPPER_BOUND); + storage + .range(Some(&prefix), Some(&upper_bound), Order::Ascending) + .map(|(key, val)| { + Ok(( + String::from_utf8(key[PREFIX_ACCOUNTS.len() + 2..].to_vec())?, + from_json(val)?, + )) + }) } -pub fn config(storage: &mut dyn Storage) -> Singleton { - singleton(storage, KEY_CONFIG) +pub fn load_config(storage: &dyn Storage) -> StdResult { + storage + .get(&to_length_prefixed(KEY_CONFIG)) + .ok_or_else(|| StdError::msg("config not found")) + .and_then(from_json) } -pub fn config_read(storage: &dyn Storage) -> ReadonlySingleton { - singleton_read(storage, KEY_CONFIG) +pub fn save_config(storage: &mut dyn Storage, item: &Config) -> StdResult<()> { + storage.set(&to_length_prefixed(KEY_CONFIG), &to_json_vec(item)?); + Ok(()) } diff --git a/contracts/ibc-reflect-send/tests/integration.rs b/contracts/ibc-reflect-send/tests/integration.rs index c0c2977b83..452a80fc55 100644 --- a/contracts/ibc-reflect-send/tests/integration.rs +++ b/contracts/ibc-reflect-send/tests/integration.rs @@ -1,21 +1,6 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests. -//! 1. First copy them over verbatum, -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) use cosmwasm_std::testing::{ mock_ibc_channel_connect_ack, mock_ibc_channel_open_init, mock_ibc_channel_open_try, @@ -72,7 +57,7 @@ fn connect(deps: &mut Instance, channel_id: & channel_id: packet_channel, .. }) => assert_eq!(packet_channel.as_str(), channel_id), - o => panic!("Unexpected message: {:?}", o), + o => panic!("Unexpected message: {o:?}"), }; } @@ -183,7 +168,7 @@ fn dispatch_message_send_and_ack() { msg.original_packet.data = data; msg } - o => panic!("Unexpected message: {:?}", o), + o => panic!("Unexpected message: {o:?}"), }; let res: IbcBasicResponse = ibc_packet_ack(&mut deps, mock_env(), msg).unwrap(); // no actions expected, but let's check the events to see it was dispatched properly @@ -234,13 +219,15 @@ fn send_remote_funds() { to_address, amount, timeout, + memo, }) => { assert_eq!(transfer_channel_id, channel_id.as_str()); assert_eq!(remote_addr, to_address.as_str()); assert_eq!(&coin(12344, "utrgd"), amount); assert!(timeout.block().is_none()); assert!(timeout.timestamp().is_some()); + assert!(memo.is_none()); } - o => panic!("unexpected message: {:?}", o), + o => panic!("unexpected message: {o:?}"), } } diff --git a/contracts/ibc-reflect/.cargo/config b/contracts/ibc-reflect/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/ibc-reflect/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/ibc-reflect/.cargo/config.toml b/contracts/ibc-reflect/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/ibc-reflect/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/ibc-reflect/Cargo.lock b/contracts/ibc-reflect/Cargo.lock index 63e0de31ec..db9a0268e6 100644 --- a/contracts/ibc-reflect/Cargo.lock +++ b/contracts/ibc-reflect/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,118 +17,349 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "base64ct" -version = "1.5.0" +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -136,55 +367,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -192,204 +462,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -406,98 +605,196 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "darling" -version = "0.13.0" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "darling_core", - "darling_macro", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +name = "cw-schema" +version = "3.0.3-dev" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", ] [[package]] -name = "darling_macro" -version = "0.13.0" +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -505,13 +802,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -522,57 +819,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -595,46 +912,110 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -642,97 +1023,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -746,7 +1132,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] @@ -755,233 +1141,522 @@ version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cosmwasm-vm", - "schemars", + "schemars 0.8.21", "serde", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "k256" -version = "0.11.3" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "quote", - "syn", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "mach" -version = "0.3.2" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.59.0", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "adler", - "autocfg", + "either", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "hermit-abi", - "libc", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.25.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "memchr", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", ] [[package]] name = "object" -version = "0.28.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.11.2", + "flate2", + "hashbrown 0.14.5", "indexmap", "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.8.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "pkcs8" -version = "0.9.0" +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "der", - "spki", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro-error" @@ -992,7 +1667,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1007,13 +1682,35 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1022,7 +1719,16 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "ptr_meta_derive", + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", ] [[package]] @@ -1033,28 +1739,46 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", "rand_chacha", - "rand_core 0.6.3", - "rand_hc", + "rand_core", ] [[package]] @@ -1064,152 +1788,198 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core", ] [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.1.16", + "getrandom", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "getrandom 0.2.3", + "either", + "rayon-core", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "rand_core 0.6.3", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "bitflags 2.5.0", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "ref-cast-impl", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ - "bitflags", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "region" -version = "3.0.0" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ - "winapi", + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", ] [[package]] name = "rend" -version = "0.3.6" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" dependencies = [ - "bytecheck", + "bytecheck 0.8.0", ] [[package]] name = "rfc6979" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", "rend", "rkyv_derive", - "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", ] [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1217,178 +1987,295 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schemars" -version = "0.8.6" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" dependencies = [ "dyn-clone", - "schemars_derive", + "ref-cast", + "schemars_derive 1.0.4", "serde", "serde_json", ] [[package]] name = "schemars_derive" -version = "0.8.6" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.87", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "schemars_derive" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", "generic-array", - "pkcs8", "subtle", "zeroize", ] [[package]] -name = "serde" -version = "1.0.126" +name = "self_cell" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ - "serde", + "serde_derive", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "serde-wasm-bindgen" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" dependencies = [ + "js-sys", "serde", + "wasm-bindgen", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_derive_internals" -version = "0.25.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "serde_with" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "sha2" -version = "0.10.3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "cpufeatures", + "digest", ] [[package]] -name = "signature" -version = "1.5.0" +name = "shared-buffer" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "bytes", + "memmap2 0.6.2", ] [[package]] -name = "smallvec" -version = "1.6.1" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "spki" -version = "0.6.0" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "base64ct", - "der", + "digest", + "rand_core", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1403,147 +2290,285 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "target-lexicon" -version = "0.12.2" +name = "syn" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "tempfile" -version = "3.2.0" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" -dependencies = [ - "thiserror-impl", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1551,24 +2576,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1576,113 +2601,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1692,252 +2699,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/ibc-reflect/Cargo.toml b/contracts/ibc-reflect/Cargo.toml index ca0b44bd38..e2f13e8b42 100644 --- a/contracts/ibc-reflect/Cargo.toml +++ b/contracts/ibc-reflect/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -22,20 +20,10 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# for quicker tests, cargo test --lib -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = ["iterator", "ibc3"] } -cosmwasm-storage = { path = "../../packages/storage", features = ["iterator"] } -schemars = "0.8.3" +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_2_2", "iterator", "stargate"] } +schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] diff --git a/contracts/ibc-reflect/README.md b/contracts/ibc-reflect/README.md index 0a9aad788d..459e894839 100644 --- a/contracts/ibc-reflect/README.md +++ b/contracts/ibc-reflect/README.md @@ -2,7 +2,7 @@ This is a simple contract to demonstrate using contracts using IBC messages. The first case we build is to simulate the `reflect` contract on another chain. That -is, you can send a message over IBC to the reflect contract and it will +is, you can send a message over IBC to the `reflect` contract, and it will "reflect" that message on the remote chain as if it sent it. This is inspired by @@ -25,7 +25,7 @@ point), it will create a new `reflect` contract instance. The reflect `code_id` must be set when initializing the factory. This `reflect` contract address will be saved and connected to the channel. -Once the channel is fully established and the reflect contract instantiated it +Once the channel is fully established and the `reflect` contract instantiated it will expect a `RunTx` message, which contains `Vec`. When this message is received, it will execute it on the `reflect` contract, performing the requested action on behalf of the remote user. diff --git a/contracts/ibc-reflect/schema/acknowledgement_msg_balances.json b/contracts/ibc-reflect/schema/acknowledgement_msg_balances.json deleted file mode 100644 index 20e956cd3f..0000000000 --- a/contracts/ibc-reflect/schema/acknowledgement_msg_balances.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AcknowledgementMsgBalances", - "description": "This is the final result type that is created and serialized in a contract for every init/execute/migrate call. The VM then deserializes this type to distinguish between successful and failed executions.\n\nWe use a custom type here instead of Rust's Result because we want to be able to define the serialization, which is a public interface. Every language that compiles to Wasm and runs in the ComsWasm VM needs to create the same JSON representation.\n\n# Examples\n\nSuccess:\n\n``` # use cosmwasm_std::{to_vec, ContractResult, Response}; let response: Response = Response::default(); let result: ContractResult = ContractResult::Ok(response); assert_eq!(to_vec(&result).unwrap(), br#\"{\"ok\":{\"messages\":[],\"attributes\":[],\"events\":[],\"data\":null}}\"#); ```\n\nFailure:\n\n``` # use cosmwasm_std::{to_vec, ContractResult, Response}; let error_msg = String::from(\"Something went wrong\"); let result: ContractResult = ContractResult::Err(error_msg); assert_eq!(to_vec(&result).unwrap(), br#\"{\"error\":\"Something went wrong\"}\"#); ```", - "oneOf": [ - { - "type": "object", - "required": [ - "ok" - ], - "properties": { - "ok": { - "$ref": "#/definitions/BalancesResponse" - } - }, - "additionalProperties": false - }, - { - "description": "An error type that every custom error created by contract developers can be converted to. This could potientially have more structure, but String is the easiest.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string" - } - }, - "additionalProperties": false - } - ], - "definitions": { - "BalancesResponse": { - "description": "This is the success response we send on ack for PacketMsg::Balance. Just acknowledge success or error", - "type": "object", - "required": [ - "account", - "balances" - ], - "properties": { - "account": { - "type": "string" - }, - "balances": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - } - }, - "additionalProperties": false - }, - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } -} diff --git a/contracts/ibc-reflect/schema/acknowledgement_msg_dispatch.json b/contracts/ibc-reflect/schema/acknowledgement_msg_dispatch.json deleted file mode 100644 index e89f54b65d..0000000000 --- a/contracts/ibc-reflect/schema/acknowledgement_msg_dispatch.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AcknowledgementMsgDispatch", - "description": "This is the final result type that is created and serialized in a contract for every init/execute/migrate call. The VM then deserializes this type to distinguish between successful and failed executions.\n\nWe use a custom type here instead of Rust's Result because we want to be able to define the serialization, which is a public interface. Every language that compiles to Wasm and runs in the ComsWasm VM needs to create the same JSON representation.\n\n# Examples\n\nSuccess:\n\n``` # use cosmwasm_std::{to_vec, ContractResult, Response}; let response: Response = Response::default(); let result: ContractResult = ContractResult::Ok(response); assert_eq!(to_vec(&result).unwrap(), br#\"{\"ok\":{\"messages\":[],\"attributes\":[],\"events\":[],\"data\":null}}\"#); ```\n\nFailure:\n\n``` # use cosmwasm_std::{to_vec, ContractResult, Response}; let error_msg = String::from(\"Something went wrong\"); let result: ContractResult = ContractResult::Err(error_msg); assert_eq!(to_vec(&result).unwrap(), br#\"{\"error\":\"Something went wrong\"}\"#); ```", - "oneOf": [ - { - "type": "object", - "required": [ - "ok" - ], - "properties": { - "ok": { - "type": "null" - } - }, - "additionalProperties": false - }, - { - "description": "An error type that every custom error created by contract developers can be converted to. This could potientially have more structure, but String is the easiest.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string" - } - }, - "additionalProperties": false - } - ] -} diff --git a/contracts/ibc-reflect/schema/acknowledgement_msg_who_am_i.json b/contracts/ibc-reflect/schema/acknowledgement_msg_who_am_i.json deleted file mode 100644 index 57c0933f8c..0000000000 --- a/contracts/ibc-reflect/schema/acknowledgement_msg_who_am_i.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AcknowledgementMsgWhoAmI", - "description": "This is the final result type that is created and serialized in a contract for every init/execute/migrate call. The VM then deserializes this type to distinguish between successful and failed executions.\n\nWe use a custom type here instead of Rust's Result because we want to be able to define the serialization, which is a public interface. Every language that compiles to Wasm and runs in the ComsWasm VM needs to create the same JSON representation.\n\n# Examples\n\nSuccess:\n\n``` # use cosmwasm_std::{to_vec, ContractResult, Response}; let response: Response = Response::default(); let result: ContractResult = ContractResult::Ok(response); assert_eq!(to_vec(&result).unwrap(), br#\"{\"ok\":{\"messages\":[],\"attributes\":[],\"events\":[],\"data\":null}}\"#); ```\n\nFailure:\n\n``` # use cosmwasm_std::{to_vec, ContractResult, Response}; let error_msg = String::from(\"Something went wrong\"); let result: ContractResult = ContractResult::Err(error_msg); assert_eq!(to_vec(&result).unwrap(), br#\"{\"error\":\"Something went wrong\"}\"#); ```", - "oneOf": [ - { - "type": "object", - "required": [ - "ok" - ], - "properties": { - "ok": { - "$ref": "#/definitions/WhoAmIResponse" - } - }, - "additionalProperties": false - }, - { - "description": "An error type that every custom error created by contract developers can be converted to. This could potientially have more structure, but String is the easiest.", - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "type": "string" - } - }, - "additionalProperties": false - } - ], - "definitions": { - "WhoAmIResponse": { - "description": "This is the success response we send on ack for PacketMsg::WhoAmI. Return the caller's account address on the remote chain", - "type": "object", - "required": [ - "account" - ], - "properties": { - "account": { - "type": "string" - } - }, - "additionalProperties": false - } - } -} diff --git a/contracts/ibc-reflect/schema/cw_schema/ibc-reflect.json b/contracts/ibc-reflect/schema/cw_schema/ibc-reflect.json new file mode 100644 index 0000000000..b21b9d1d98 --- /dev/null +++ b/contracts/ibc-reflect/schema/cw_schema/ibc-reflect.json @@ -0,0 +1,186 @@ +{ + "contract_name": "ibc-reflect", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_InstantiateMsg", + "description": "Just needs to know the code_id of a reflect contract to spawn sub-accounts", + "type": "struct", + "properties": { + "reflect_code_id": { + "value": 1 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_ExecuteMsg", + "type": "enum", + "cases": { + "async_ack": { + "type": "named", + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "value": 3 + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "value": 1 + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "value": 2 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_math_uint64_Uint64", + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding,\nsuch that the full u64 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n```\n# use cosmwasm_std::Uint64;\nlet a = Uint64::from(42u64);\nassert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32);\nassert_eq!(b.u64(), 70);\n```", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_ibc_IbcAcknowledgement", + "type": "struct", + "properties": { + "data": { + "value": 4 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_QueryMsg", + "type": "enum", + "cases": { + "account": { + "description": "Returns (reflect) account that is attached to this channel,\nor none.", + "type": "named", + "properties": { + "channel_id": { + "value": 1 + } + } + }, + "list_accounts": { + "description": "Returns all (channel, reflect_account) pairs.\nNo pagination - this is a test contract", + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "migrate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] + }, + "sudo": null, + "responses": { + "account": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_AccountResponse", + "type": "struct", + "properties": { + "account": { + "value": 2 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 1 + } + ] + }, + "list_accounts": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_ListAccountsResponse", + "type": "struct", + "properties": { + "accounts": { + "value": 3 + } + } + }, + { + "name": "ibc_reflect_msg_AccountInfo", + "type": "struct", + "properties": { + "account": { + "value": 2 + }, + "channel_id": { + "value": 2 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] + } + } +} diff --git a/contracts/ibc-reflect/schema/cw_schema/raw/execute.json b/contracts/ibc-reflect/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..f9355b4a9d --- /dev/null +++ b/contracts/ibc-reflect/schema/cw_schema/raw/execute.json @@ -0,0 +1,54 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_ExecuteMsg", + "type": "enum", + "cases": { + "async_ack": { + "type": "named", + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "value": 3 + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "value": 1 + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "value": 2 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_math_uint64_Uint64", + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding,\nsuch that the full u64 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n```\n# use cosmwasm_std::Uint64;\nlet a = Uint64::from(42u64);\nassert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32);\nassert_eq!(b.u64(), 70);\n```", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_ibc_IbcAcknowledgement", + "type": "struct", + "properties": { + "data": { + "value": 4 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + } + ] +} diff --git a/contracts/ibc-reflect/schema/cw_schema/raw/instantiate.json b/contracts/ibc-reflect/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..f218703b6d --- /dev/null +++ b/contracts/ibc-reflect/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,22 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_InstantiateMsg", + "description": "Just needs to know the code_id of a reflect contract to spawn sub-accounts", + "type": "struct", + "properties": { + "reflect_code_id": { + "value": 1 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + } + ] +} diff --git a/contracts/ibc-reflect/schema/cw_schema/raw/migrate.json b/contracts/ibc-reflect/schema/cw_schema/raw/migrate.json new file mode 100644 index 0000000000..feb0a1bf43 --- /dev/null +++ b/contracts/ibc-reflect/schema/cw_schema/raw/migrate.json @@ -0,0 +1,12 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/ibc-reflect/schema/cw_schema/raw/query.json b/contracts/ibc-reflect/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..67cc393e95 --- /dev/null +++ b/contracts/ibc-reflect/schema/cw_schema/raw/query.json @@ -0,0 +1,30 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_QueryMsg", + "type": "enum", + "cases": { + "account": { + "description": "Returns (reflect) account that is attached to this channel,\nor none.", + "type": "named", + "properties": { + "channel_id": { + "value": 1 + } + } + }, + "list_accounts": { + "description": "Returns all (channel, reflect_account) pairs.\nNo pagination - this is a test contract", + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/ibc-reflect/schema/cw_schema/raw/response_to_account.json b/contracts/ibc-reflect/schema/cw_schema/raw/response_to_account.json new file mode 100644 index 0000000000..f5f5bfd996 --- /dev/null +++ b/contracts/ibc-reflect/schema/cw_schema/raw/response_to_account.json @@ -0,0 +1,24 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_AccountResponse", + "type": "struct", + "properties": { + "account": { + "value": 2 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 1 + } + ] +} diff --git a/contracts/ibc-reflect/schema/cw_schema/raw/response_to_list_accounts.json b/contracts/ibc-reflect/schema/cw_schema/raw/response_to_list_accounts.json new file mode 100644 index 0000000000..0bc0507032 --- /dev/null +++ b/contracts/ibc-reflect/schema/cw_schema/raw/response_to_list_accounts.json @@ -0,0 +1,36 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc_reflect_msg_ListAccountsResponse", + "type": "struct", + "properties": { + "accounts": { + "value": 3 + } + } + }, + { + "name": "ibc_reflect_msg_AccountInfo", + "type": "struct", + "properties": { + "account": { + "value": 2 + }, + "channel_id": { + "value": 2 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] +} diff --git a/contracts/ibc-reflect/schema/ibc-reflect.json b/contracts/ibc-reflect/schema/ibc-reflect.json index dbe9a1c1c8..184a592afa 100644 --- a/contracts/ibc-reflect/schema/ibc-reflect.json +++ b/contracts/ibc-reflect/schema/ibc-reflect.json @@ -19,7 +19,74 @@ }, "additionalProperties": false }, - "execute": null, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "async_ack" + ], + "properties": { + "async_ack": { + "type": "object", + "required": [ + "ack", + "channel_id", + "packet_sequence" + ], + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "allOf": [ + { + "$ref": "#/definitions/IbcAcknowledgement" + } + ] + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "type": "string" + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "IbcAcknowledgement": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, "query": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryMsg", @@ -65,8 +132,9 @@ "migrate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false }, "sudo": null, "responses": { diff --git a/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_balance.json b/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_balance.json new file mode 100644 index 0000000000..e71a82d789 --- /dev/null +++ b/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_balance.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AcknowledgementMsgBalance", + "description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", + "oneOf": [ + { + "type": "object", + "required": [ + "ok" + ], + "properties": { + "ok": { + "$ref": "#/definitions/BalanceResponse" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "BalanceResponse": { + "description": "This is the success response we send on ack for PacketMsg::Balance. Just acknowledge success or error", + "type": "object", + "required": [ + "account", + "balance" + ], + "properties": { + "account": { + "type": "string" + }, + "balance": { + "$ref": "#/definitions/Coin" + } + }, + "additionalProperties": false + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + } + } +} diff --git a/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_dispatch.json b/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_dispatch.json new file mode 100644 index 0000000000..5c010f5bd1 --- /dev/null +++ b/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_dispatch.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AcknowledgementMsgDispatch", + "description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", + "oneOf": [ + { + "type": "object", + "required": [ + "ok" + ], + "properties": { + "ok": { + "type": "null" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_who_am_i.json b/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_who_am_i.json new file mode 100644 index 0000000000..f706c655de --- /dev/null +++ b/contracts/ibc-reflect/schema/ibc/acknowledgement_msg_who_am_i.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AcknowledgementMsgWhoAmI", + "description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", + "oneOf": [ + { + "type": "object", + "required": [ + "ok" + ], + "properties": { + "ok": { + "$ref": "#/definitions/WhoAmIResponse" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "WhoAmIResponse": { + "description": "This is the success response we send on ack for PacketMsg::WhoAmI. Return the caller's account address on the remote chain", + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/ibc-reflect/schema/ibc/packet_msg.json b/contracts/ibc-reflect/schema/ibc/packet_msg.json new file mode 100644 index 0000000000..c9521904e9 --- /dev/null +++ b/contracts/ibc-reflect/schema/ibc/packet_msg.json @@ -0,0 +1,907 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PacketMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "dispatch" + ], + "properties": { + "dispatch": { + "type": "object", + "required": [ + "msgs" + ], + "properties": { + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/CosmosMsg_for_Empty" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "who_am_i" + ], + "properties": { + "who_am_i": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "balance" + ], + "properties": { + "balance": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "panic" + ], + "properties": { + "panic": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "return_err" + ], + "properties": { + "return_err": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "return_msgs" + ], + "properties": { + "return_msgs": { + "type": "object", + "required": [ + "msgs" + ], + "properties": { + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/CosmosMsg_for_Empty" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "no_ack" + ], + "properties": { + "no_ack": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AnyMsg": { + "description": "A message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "object", + "required": [ + "type_url", + "value" + ], + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "BankMsg": { + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "oneOf": [ + { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "send" + ], + "properties": { + "send": { + "type": "object", + "required": [ + "amount", + "to_address" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "to_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CosmosMsg_for_Empty": { + "oneOf": [ + { + "type": "object", + "required": [ + "bank" + ], + "properties": { + "bank": { + "$ref": "#/definitions/BankMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + }, + { + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "deprecated": true, + "type": "object", + "required": [ + "stargate" + ], + "properties": { + "stargate": { + "type": "object", + "required": [ + "type_url", + "value" + ], + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "`CosmosMsg::Any` replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "$ref": "#/definitions/AnyMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ibc" + ], + "properties": { + "ibc": { + "$ref": "#/definitions/IbcMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wasm" + ], + "properties": { + "wasm": { + "$ref": "#/definitions/WasmMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "gov" + ], + "properties": { + "gov": { + "$ref": "#/definitions/GovMsg" + } + }, + "additionalProperties": false + } + ] + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false + }, + "GovMsg": { + "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```", + "oneOf": [ + { + "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", + "type": "object", + "required": [ + "vote" + ], + "properties": { + "vote": { + "type": "object", + "required": [ + "option", + "proposal_id" + ], + "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "allOf": [ + { + "$ref": "#/definitions/VoteOption" + } + ] + }, + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address.", + "type": "object", + "required": [ + "vote_weighted" + ], + "properties": { + "vote_weighted": { + "type": "object", + "required": [ + "options", + "proposal_id" + ], + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/WeightedVoteOption" + } + }, + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "IbcAcknowledgement": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "IbcMsg": { + "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)", + "oneOf": [ + { + "description": "Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to.", + "type": "object", + "required": [ + "transfer" + ], + "properties": { + "transfer": { + "type": "object", + "required": [ + "amount", + "channel_id", + "timeout", + "to_address" + ], + "properties": { + "amount": { + "description": "packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] + }, + "channel_id": { + "description": "existing channel to send the tokens over", + "type": "string" + }, + "memo": { + "description": "An optional memo. See the blog post [\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead.", + "type": [ + "string", + "null" + ] + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "allOf": [ + { + "$ref": "#/definitions/IbcTimeout" + } + ] + }, + "to_address": { + "description": "address on the remote chain to receive these tokens", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Sends an IBC packet with given data over the existing channel. Data should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.", + "type": "object", + "required": [ + "send_packet" + ], + "properties": { + "send_packet": { + "type": "object", + "required": [ + "channel_id", + "data", + "timeout" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "data": { + "$ref": "#/definitions/Binary" + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "allOf": [ + { + "$ref": "#/definitions/IbcTimeout" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Acknowledges a packet that this contract received over IBC. This allows acknowledging a packet that was not acknowledged yet in the `ibc_packet_receive` call.", + "type": "object", + "required": [ + "write_acknowledgement" + ], + "properties": { + "write_acknowledgement": { + "type": "object", + "required": [ + "ack", + "channel_id", + "packet_sequence" + ], + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "allOf": [ + { + "$ref": "#/definitions/IbcAcknowledgement" + } + ] + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "type": "string" + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This will close an existing channel that is owned by this contract. Port is auto-assigned to the contract's IBC port", + "type": "object", + "required": [ + "close_channel" + ], + "properties": { + "close_channel": { + "type": "object", + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "IbcTimeout": { + "description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.", + "type": "object", + "properties": { + "block": { + "anyOf": [ + { + "$ref": "#/definitions/IbcTimeoutBlock" + }, + { + "type": "null" + } + ] + }, + "timestamp": { + "anyOf": [ + { + "$ref": "#/definitions/Timestamp" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "IbcTimeoutBlock": { + "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", + "type": "object", + "required": [ + "height", + "revision" + ], + "properties": { + "height": { + "description": "block height after which the packet times out. the height within the given revision", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "revision": { + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "VoteOption": { + "type": "string", + "enum": [ + "yes", + "no", + "abstain", + "no_with_veto" + ] + }, + "WasmMsg": { + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "oneOf": [ + { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "execute" + ], + "properties": { + "execute": { + "type": "object", + "required": [ + "contract_addr", + "funds", + "msg" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "instantiate" + ], + "properties": { + "instantiate": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code using a predictable address derivation algorithm implemented in [`cosmwasm_std::instantiate2_address`].\n\nThis is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). `sender` is automatically filled with the current contract's address. `fix_msg` is automatically set to false.", + "type": "object", + "required": [ + "instantiate2" + ], + "properties": { + "instantiate2": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg", + "salt" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "salt": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "migrate" + ], + "properties": { + "migrate": { + "type": "object", + "required": [ + "contract_addr", + "msg", + "new_code_id" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "update_admin" + ], + "properties": { + "update_admin": { + "type": "object", + "required": [ + "admin", + "contract_addr" + ], + "properties": { + "admin": { + "type": "string" + }, + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "clear_admin" + ], + "properties": { + "clear_admin": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "WeightedVoteOption": { + "type": "object", + "required": [ + "option", + "weight" + ], + "properties": { + "option": { + "$ref": "#/definitions/VoteOption" + }, + "weight": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/ibc-reflect/schema/raw/execute.json b/contracts/ibc-reflect/schema/raw/execute.json new file mode 100644 index 0000000000..6eabd78e56 --- /dev/null +++ b/contracts/ibc-reflect/schema/raw/execute.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "async_ack" + ], + "properties": { + "async_ack": { + "type": "object", + "required": [ + "ack", + "channel_id", + "packet_sequence" + ], + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "allOf": [ + { + "$ref": "#/definitions/IbcAcknowledgement" + } + ] + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "type": "string" + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "IbcAcknowledgement": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/ibc-reflect/schema/raw/instantiate.json b/contracts/ibc-reflect/schema/raw/instantiate.json new file mode 100644 index 0000000000..1320f1a0b9 --- /dev/null +++ b/contracts/ibc-reflect/schema/raw/instantiate.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "Just needs to know the code_id of a reflect contract to spawn sub-accounts", + "type": "object", + "required": [ + "reflect_code_id" + ], + "properties": { + "reflect_code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false +} diff --git a/contracts/ibc-reflect/schema/raw/migrate.json b/contracts/ibc-reflect/schema/raw/migrate.json new file mode 100644 index 0000000000..767c659ed6 --- /dev/null +++ b/contracts/ibc-reflect/schema/raw/migrate.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/ibc-reflect/schema/raw/query.json b/contracts/ibc-reflect/schema/raw/query.json new file mode 100644 index 0000000000..2fb7b34e6f --- /dev/null +++ b/contracts/ibc-reflect/schema/raw/query.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Returns (reflect) account that is attached to this channel, or none.", + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "object", + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns all (channel, reflect_account) pairs. No pagination - this is a test contract", + "type": "object", + "required": [ + "list_accounts" + ], + "properties": { + "list_accounts": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/ibc-reflect/schema/raw/response_to_account.json b/contracts/ibc-reflect/schema/raw/response_to_account.json new file mode 100644 index 0000000000..84edc87b94 --- /dev/null +++ b/contracts/ibc-reflect/schema/raw/response_to_account.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountResponse", + "type": "object", + "properties": { + "account": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false +} diff --git a/contracts/ibc-reflect/schema/raw/response_to_list_accounts.json b/contracts/ibc-reflect/schema/raw/response_to_list_accounts.json new file mode 100644 index 0000000000..22591bd068 --- /dev/null +++ b/contracts/ibc-reflect/schema/raw/response_to_list_accounts.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListAccountsResponse", + "type": "object", + "required": [ + "accounts" + ], + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountInfo" + } + } + }, + "additionalProperties": false, + "definitions": { + "AccountInfo": { + "type": "object", + "required": [ + "account", + "channel_id" + ], + "properties": { + "account": { + "type": "string" + }, + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/ibc-reflect/src/bin/schema.rs b/contracts/ibc-reflect/src/bin/schema.rs new file mode 100644 index 0000000000..9f296e98f7 --- /dev/null +++ b/contracts/ibc-reflect/src/bin/schema.rs @@ -0,0 +1,42 @@ +use std::env::current_dir; +use std::fs::create_dir_all; + +use cosmwasm_schema::{export_schema, export_schema_with_title, schema_for, write_api}; +use cosmwasm_std::Empty; + +use ibc_reflect::msg::{ + AcknowledgementMsg, BalanceResponse, DispatchResponse, ExecuteMsg, InstantiateMsg, PacketMsg, + QueryMsg, WhoAmIResponse, +}; + +fn main() { + // Clear & write standard API + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + migrate: Empty, + } + + // Schemas for inter-contract communication + let mut out_dir = current_dir().unwrap(); + out_dir.push("schema"); + out_dir.push("ibc"); + create_dir_all(&out_dir).unwrap(); + export_schema(&schema_for!(PacketMsg), &out_dir); + export_schema_with_title( + &schema_for!(AcknowledgementMsg), + &out_dir, + "AcknowledgementMsgBalance", + ); + export_schema_with_title( + &schema_for!(AcknowledgementMsg), + &out_dir, + "AcknowledgementMsgDispatch", + ); + export_schema_with_title( + &schema_for!(AcknowledgementMsg), + &out_dir, + "AcknowledgementMsgWhoAmI", + ); +} diff --git a/contracts/ibc-reflect/src/contract.rs b/contracts/ibc-reflect/src/contract.rs index a43e581461..dfe7c5984c 100644 --- a/contracts/ibc-reflect/src/contract.rs +++ b/contracts/ibc-reflect/src/contract.rs @@ -1,17 +1,21 @@ use cosmwasm_std::{ - entry_point, from_slice, to_binary, wasm_execute, BankMsg, Binary, CosmosMsg, Deps, DepsMut, - Empty, Env, Event, Ibc3ChannelOpenResponse, IbcBasicResponse, IbcChannelCloseMsg, - IbcChannelConnectMsg, IbcChannelOpenMsg, IbcChannelOpenResponse, IbcOrder, IbcPacketAckMsg, - IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, MessageInfo, Order, - QueryResponse, Reply, Response, StdError, StdResult, SubMsg, SubMsgResponse, SubMsgResult, - WasmMsg, + entry_point, from_json, to_json_binary, wasm_execute, Binary, CosmosMsg, Deps, DepsMut, Empty, + Env, Event, Ibc3ChannelOpenResponse, IbcAcknowledgement, IbcBasicResponse, IbcChannelCloseMsg, + IbcChannelConnectMsg, IbcChannelOpenMsg, IbcChannelOpenResponse, IbcMsg, IbcOrder, + IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, MessageInfo, + Never, QueryResponse, Reply, Response, StdError, StdResult, SubMsg, SubMsgResponse, + SubMsgResult, WasmMsg, }; use crate::msg::{ - AccountInfo, AccountResponse, AcknowledgementMsg, BalancesResponse, DispatchResponse, - InstantiateMsg, ListAccountsResponse, PacketMsg, QueryMsg, ReflectExecuteMsg, WhoAmIResponse, + AccountInfo, AccountResponse, AcknowledgementMsg, BalanceResponse, DispatchResponse, + ExecuteMsg, InstantiateMsg, ListAccountsResponse, PacketMsg, QueryMsg, ReflectExecuteMsg, + ReturnMsgsResponse, WhoAmIResponse, +}; +use crate::state::{ + load_account, load_item, may_load_account, range_accounts, remove_account, save_account, + save_item, Config, KEY_CONFIG, KEY_PENDING_CHANNEL, }; -use crate::state::{accounts, accounts_read, config, pending_channel, Config}; pub const IBC_APP_VERSION: &str = "ibc-reflect-v1"; pub const RECEIVE_DISPATCH_ID: u64 = 1234; @@ -28,11 +32,39 @@ pub fn instantiate( let cfg = Config { reflect_code_id: msg.reflect_code_id, }; - config(deps.storage).save(&cfg)?; + save_item(deps.storage, KEY_CONFIG, &cfg)?; Ok(Response::new().add_attribute("action", "instantiate")) } +#[entry_point] +pub fn execute( + _deps: DepsMut, + _env: Env, + _info: MessageInfo, + msg: ExecuteMsg, +) -> StdResult { + match msg { + ExecuteMsg::AsyncAck { + channel_id, + packet_sequence, + ack, + } => execute_async_ack(channel_id, packet_sequence.u64(), ack), + } +} + +fn execute_async_ack( + channel_id: String, + packet_sequence: u64, + ack: IbcAcknowledgement, +) -> StdResult { + Ok(Response::new().add_message(IbcMsg::WriteAcknowledgement { + channel_id, + packet_sequence, + ack, + })) +} + #[entry_point] pub fn reply(deps: DepsMut, _env: Env, reply: Reply) -> StdResult { match (reply.id, reply.result) { @@ -40,7 +72,7 @@ pub fn reply(deps: DepsMut, _env: Env, reply: Reply) -> StdResult { Ok(Response::new().set_data(encode_ibc_error(err))) } (INIT_CALLBACK_ID, SubMsgResult::Ok(response)) => handle_init_callback(deps, response), - _ => Err(StdError::generic_err("invalid reply id or result")), + _ => Err(StdError::msg("invalid reply id or result")), } } @@ -59,27 +91,23 @@ fn parse_contract_from_event(events: Vec) -> Option { pub fn handle_init_callback(deps: DepsMut, response: SubMsgResponse) -> StdResult { // we use storage to pass info from the caller to the reply - let id = pending_channel(deps.storage).load()?; - pending_channel(deps.storage).remove(); + let id: String = load_item(deps.storage, KEY_PENDING_CHANNEL)?; + deps.storage.remove(KEY_PENDING_CHANNEL); // parse contract info from events let contract_addr = match parse_contract_from_event(response.events) { Some(addr) => deps.api.addr_validate(&addr), - None => Err(StdError::generic_err( + None => Err(StdError::msg( "No _contract_address found in callback events", )), }?; // store id -> contract_addr if it is empty // id comes from: `let chan_id = msg.endpoint.channel_id;` in `ibc_channel_connect` - accounts(deps.storage).update(id.as_bytes(), |val| -> StdResult<_> { - match val { - Some(_) => Err(StdError::generic_err( - "Cannot register over an existing channel", - )), - None => Ok(contract_addr), - } - })?; + match may_load_account(deps.storage, &id)? { + Some(_) => return Err(StdError::msg("Cannot register over an existing channel")), + None => save_account(deps.storage, &id, &contract_addr)?, + } Ok(Response::new().add_attribute("action", "execute_init_callback")) } @@ -87,26 +115,25 @@ pub fn handle_init_callback(deps: DepsMut, response: SubMsgResponse) -> StdResul #[entry_point] pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { match msg { - QueryMsg::Account { channel_id } => to_binary(&query_account(deps, channel_id)?), - QueryMsg::ListAccounts {} => to_binary(&query_list_accounts(deps)?), + QueryMsg::Account { channel_id } => to_json_binary(&query_account(deps, channel_id)?), + QueryMsg::ListAccounts {} => to_json_binary(&query_list_accounts(deps)?), } } pub fn query_account(deps: Deps, channel_id: String) -> StdResult { - let account = accounts_read(deps.storage).load(channel_id.as_bytes())?; + let account = load_account(deps.storage, &channel_id)?; Ok(AccountResponse { account: Some(account.into()), }) } pub fn query_list_accounts(deps: Deps) -> StdResult { - let accounts: StdResult> = accounts_read(deps.storage) - .range(None, None, Order::Ascending) + let accounts: StdResult> = range_accounts(deps.storage) .map(|item| { let (key, account) = item?; Ok(AccountInfo { account: account.into(), - channel_id: String::from_utf8(key)?, + channel_id: key, }) }) .collect(); @@ -116,7 +143,7 @@ pub fn query_list_accounts(deps: Deps) -> StdResult { } #[entry_point] -/// enforces ordering and versioing constraints +/// enforces ordering and versioning constraints pub fn ibc_channel_open( _deps: DepsMut, _env: Env, @@ -125,16 +152,15 @@ pub fn ibc_channel_open( let channel = msg.channel(); if channel.order != IbcOrder::Ordered { - return Err(StdError::generic_err("Only supports ordered channels")); + return Err(StdError::msg("Only supports ordered channels")); } // In ibcv3 we don't check the version string passed in the message // and only check the counterparty version. if let Some(counter_version) = msg.counterparty_version() { if counter_version != IBC_APP_VERSION { - return Err(StdError::generic_err(format!( - "Counterparty version must be `{}`", - IBC_APP_VERSION + return Err(StdError::msg(format_args!( + "Counterparty version must be `{IBC_APP_VERSION}`" ))); } } @@ -153,7 +179,7 @@ pub fn ibc_channel_connect( msg: IbcChannelConnectMsg, ) -> StdResult { let channel = msg.channel(); - let cfg = config(deps.storage).load()?; + let cfg: Config = load_item(deps.storage, KEY_CONFIG)?; let chan_id = &channel.endpoint.channel_id; let msg = WasmMsg::Instantiate { @@ -161,12 +187,12 @@ pub fn ibc_channel_connect( code_id: cfg.reflect_code_id, msg: b"{}".into(), funds: vec![], - label: format!("ibc-reflect-{}", chan_id), + label: format!("ibc-reflect-{chan_id}"), }; let msg = SubMsg::reply_on_success(msg, INIT_CALLBACK_ID); // store the channel id for the reply handler - pending_channel(deps.storage).save(chan_id)?; + save_item(deps.storage, KEY_PENDING_CHANNEL, chan_id)?; Ok(IbcBasicResponse::new() .add_submessage(msg) @@ -176,41 +202,20 @@ pub fn ibc_channel_connect( } #[entry_point] -/// On closed channel, we take all tokens from reflect contract to this contract. -/// We also delete the channel entry from accounts. +/// On closed channel, we delete the channel entry from accounts. pub fn ibc_channel_close( deps: DepsMut, - env: Env, + _env: Env, msg: IbcChannelCloseMsg, ) -> StdResult { let channel = msg.channel(); // get contract address and remove lookup let channel_id = channel.endpoint.channel_id.as_str(); - let reflect_addr = accounts(deps.storage).load(channel_id.as_bytes())?; - accounts(deps.storage).remove(channel_id.as_bytes()); - - // transfer current balance if any (steal the money) - let amount = deps.querier.query_all_balances(&reflect_addr)?; - let messages: Vec> = if !amount.is_empty() { - let bank_msg = BankMsg::Send { - to_address: env.contract.address.into(), - amount, - }; - let reflect_msg = ReflectExecuteMsg::ReflectMsg { - msgs: vec![bank_msg.into()], - }; - let wasm_msg = wasm_execute(reflect_addr, &reflect_msg, vec![])?; - vec![SubMsg::new(wasm_msg)] - } else { - vec![] - }; - let steal_funds = !messages.is_empty(); + remove_account(deps.storage, channel_id); Ok(IbcBasicResponse::new() - .add_submessages(messages) .add_attribute("action", "ibc_close") - .add_attribute("channel_id", channel_id) - .add_attribute("steal_funds", steal_funds.to_string())) + .add_attribute("channel_id", channel_id)) } /// this is a no-op just to test how this integrates with wasmd @@ -219,69 +224,68 @@ pub fn migrate(_deps: DepsMut, _env: Env, _msg: Empty) -> StdResult { Ok(Response::default()) } -// this encode an error or error message into a proper acknowledgement to the recevier +// this encode an error or error message into a proper acknowledgement to the receiver fn encode_ibc_error(msg: impl Into) -> Binary { // this cannot error, unwrap to keep the interface simple - to_binary(&AcknowledgementMsg::<()>::Err(msg.into())).unwrap() + to_json_binary(&AcknowledgementMsg::<()>::Error(msg.into())).unwrap() } #[entry_point] -/// we look for a the proper reflect contract to relay to and send the message +/// we look for the proper reflect contract to relay to and send the message /// We cannot return any meaningful response value as we do not know the response value /// of execution. We just return ok if we dispatched, error if we failed to dispatch pub fn ibc_packet_receive( deps: DepsMut, _env: Env, msg: IbcPacketReceiveMsg, -) -> StdResult { +) -> Result { // put this in a closure so we can convert all error responses into acknowledgements (|| { let packet = msg.packet; // which local channel did this packet come on let caller = packet.dest.channel_id; - let msg: PacketMsg = from_slice(&packet.data)?; + let msg: PacketMsg = from_json(packet.data)?; match msg { PacketMsg::Dispatch { msgs } => receive_dispatch(deps, caller, msgs), PacketMsg::WhoAmI {} => receive_who_am_i(deps, caller), - PacketMsg::Balances {} => receive_balances(deps, caller), + PacketMsg::Balance { denom } => receive_balance(deps, caller, denom), + PacketMsg::Panic {} => execute_panic(), + PacketMsg::ReturnErr { text } => execute_error(text), + PacketMsg::ReturnMsgs { msgs } => execute_return_msgs(msgs), + PacketMsg::NoAck {} => Ok(IbcReceiveResponse::without_ack()), } })() .or_else(|e| { // we try to capture all app-level errors and convert them into // acknowledgement packets that contain an error code. - let acknowledgement = encode_ibc_error(format!("invalid packet: {}", e)); - Ok(IbcReceiveResponse::new() - .set_ack(acknowledgement) + let acknowledgement = encode_ibc_error(format!("invalid packet: {e}")); + Ok(IbcReceiveResponse::new(acknowledgement) .add_event(Event::new("ibc").add_attribute("packet", "receive"))) }) } // processes PacketMsg::WhoAmI variant fn receive_who_am_i(deps: DepsMut, caller: String) -> StdResult { - let account = accounts(deps.storage).load(caller.as_bytes())?; + let account = load_account(deps.storage, &caller)?; let response = WhoAmIResponse { account: account.into(), }; - let acknowledgement = to_binary(&AcknowledgementMsg::Ok(response))?; + let acknowledgement = to_json_binary(&AcknowledgementMsg::Ok(response))?; // and we are golden - Ok(IbcReceiveResponse::new() - .set_ack(acknowledgement) - .add_attribute("action", "receive_who_am_i")) + Ok(IbcReceiveResponse::new(acknowledgement).add_attribute("action", "receive_who_am_i")) } -// processes PacketMsg::Balances variant -fn receive_balances(deps: DepsMut, caller: String) -> StdResult { - let account = accounts(deps.storage).load(caller.as_bytes())?; - let balances = deps.querier.query_all_balances(&account)?; - let response = BalancesResponse { +// processes PacketMsg::Balance variant +fn receive_balance(deps: DepsMut, caller: String, denom: String) -> StdResult { + let account = load_account(deps.storage, &caller)?; + let balance = deps.querier.query_balance(&account, denom)?; + let response = BalanceResponse { account: account.into(), - balances, + balance, }; - let acknowledgement = to_binary(&AcknowledgementMsg::Ok(response))?; + let acknowledgement = to_json_binary(&AcknowledgementMsg::Ok(response))?; // and we are golden - Ok(IbcReceiveResponse::new() - .set_ack(acknowledgement) - .add_attribute("action", "receive_balances")) + Ok(IbcReceiveResponse::new(acknowledgement).add_attribute("action", "receive_balance")) } // processes PacketMsg::Dispatch variant @@ -291,10 +295,10 @@ fn receive_dispatch( msgs: Vec, ) -> StdResult { // what is the reflect contract here - let reflect_addr = accounts(deps.storage).load(caller.as_bytes())?; + let reflect_addr = load_account(deps.storage, &caller)?; // let them know we're fine - let acknowledgement = to_binary(&AcknowledgementMsg::::Ok(()))?; + let acknowledgement = to_json_binary(&AcknowledgementMsg::::Ok(()))?; // create the message to re-dispatch to the reflect contract let reflect_msg = ReflectExecuteMsg::ReflectMsg { msgs }; let wasm_msg = wasm_execute(reflect_addr, &reflect_msg, vec![])?; @@ -302,12 +306,27 @@ fn receive_dispatch( // we wrap it in a submessage to properly report errors let msg = SubMsg::reply_on_error(wasm_msg, RECEIVE_DISPATCH_ID); - Ok(IbcReceiveResponse::new() - .set_ack(acknowledgement) + Ok(IbcReceiveResponse::new(acknowledgement) .add_submessage(msg) .add_attribute("action", "receive_dispatch")) } +fn execute_panic() -> StdResult { + panic!("This page intentionally faulted"); +} + +fn execute_error(text: String) -> StdResult { + Err(StdError::msg(text)) +} + +fn execute_return_msgs(msgs: Vec) -> StdResult { + let acknowledgement = to_json_binary(&AcknowledgementMsg::::Ok(()))?; + + Ok(IbcReceiveResponse::new(acknowledgement) + .add_messages(msgs) + .add_attribute("action", "receive_dispatch")) +} + #[entry_point] /// never should be called as we do not send packets pub fn ibc_packet_ack( @@ -332,11 +351,11 @@ pub fn ibc_packet_timeout( mod tests { use super::*; use cosmwasm_std::testing::{ - mock_dependencies, mock_env, mock_ibc_channel_close_init, mock_ibc_channel_connect_ack, - mock_ibc_channel_open_init, mock_ibc_channel_open_try, mock_ibc_packet_recv, mock_info, - mock_wasmd_attr, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR, + message_info, mock_dependencies, mock_env, mock_ibc_channel_close_init, + mock_ibc_channel_connect_ack, mock_ibc_channel_open_init, mock_ibc_channel_open_try, + mock_ibc_packet_recv, mock_wasmd_attr, MockApi, MockQuerier, MockStorage, }; - use cosmwasm_std::{attr, coin, coins, from_slice, BankMsg, OwnedDeps, WasmMsg}; + use cosmwasm_std::{attr, coin, coins, from_json, BankMsg, OwnedDeps, WasmMsg}; const CREATOR: &str = "creator"; // code id of the reflect contract @@ -346,12 +365,13 @@ mod tests { fn setup() -> OwnedDeps { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make(CREATOR); let msg = InstantiateMsg { reflect_code_id: REFLECT_ID, }; - let info = mock_info(CREATOR, &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - assert_eq!(0, res.messages.len()); + assert_eq!(res.messages.len(), 0); deps } @@ -385,12 +405,17 @@ mod tests { res.events[0] ); let id = res.messages[0].id; + let payload = res.messages[0].payload.clone(); // fake a reply and ensure this works + #[allow(deprecated)] let response = Reply { id, + payload, + gas_used: 1234567, result: SubMsgResult::Ok(SubMsgResponse { events: fake_events(&account), + msg_responses: vec![], data: None, }), }; @@ -400,11 +425,12 @@ mod tests { #[test] fn instantiate_works() { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make(CREATOR); let msg = InstantiateMsg { reflect_code_id: 17, }; - let info = mock_info("creator", &[]); + let info = message_info(&creator, &[]); let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(0, res.messages.len()) } @@ -429,6 +455,7 @@ mod tests { fn proper_handshake_flow() { let mut deps = setup(); let channel_id = "channel-1234"; + let reflect_addr = deps.api.addr_make(REFLECT_ADDR); // first we try to open with a valid handshake let handshake_open = @@ -442,6 +469,7 @@ mod tests { // and set up a reflect account assert_eq!(1, res.messages.len()); let id = res.messages[0].id; + let payload = res.messages[0].payload.clone(); if let CosmosMsg::Wasm(WasmMsg::Instantiate { admin, code_id, @@ -460,14 +488,18 @@ mod tests { // no accounts set yet let raw = query(deps.as_ref(), mock_env(), QueryMsg::ListAccounts {}).unwrap(); - let res: ListAccountsResponse = from_slice(&raw).unwrap(); + let res: ListAccountsResponse = from_json(raw).unwrap(); assert_eq!(0, res.accounts.len()); // fake a reply and ensure this works + #[allow(deprecated)] let response = Reply { id, + payload, + gas_used: 1234567, result: SubMsgResult::Ok(SubMsgResponse { - events: fake_events(REFLECT_ADDR), + events: fake_events(reflect_addr.as_str()), + msg_responses: vec![], data: None, }), }; @@ -475,12 +507,12 @@ mod tests { // ensure this is now registered let raw = query(deps.as_ref(), mock_env(), QueryMsg::ListAccounts {}).unwrap(); - let res: ListAccountsResponse = from_slice(&raw).unwrap(); + let res: ListAccountsResponse = from_json(raw).unwrap(); assert_eq!(1, res.accounts.len()); assert_eq!( &res.accounts[0], &AccountInfo { - account: REFLECT_ADDR.into(), + account: reflect_addr.to_string(), channel_id: channel_id.to_string(), } ); @@ -494,8 +526,8 @@ mod tests { }, ) .unwrap(); - let res: AccountResponse = from_slice(&raw).unwrap(); - assert_eq!(res.account.unwrap(), REFLECT_ADDR); + let res: AccountResponse = from_json(raw).unwrap(); + assert_eq!(res.account.unwrap(), reflect_addr.as_str()); } #[test] @@ -503,7 +535,7 @@ mod tests { let mut deps = setup(); let channel_id = "channel-123"; - let account = "acct-123"; + let account = deps.api.addr_make("acct-123"); // receive a packet for an unregistered channel returns app-level error (not Result::Err) let msgs_to_dispatch = vec![BankMsg::Send { @@ -524,21 +556,22 @@ mod tests { res.events[0] ); // acknowledgement is an error - let ack: AcknowledgementMsg = from_slice(&res.acknowledgement).unwrap(); + let ack: AcknowledgementMsg = + from_json(res.acknowledgement.unwrap()).unwrap(); assert_eq!( ack.unwrap_err(), - "invalid packet: cosmwasm_std::addresses::Addr not found" + "invalid packet: kind: Other, error: account channel-123 not found" ); // register the channel - connect(deps.as_mut(), channel_id, account); + connect(deps.as_mut(), channel_id, &account); // receive a packet for an unregistered channel returns app-level error (not Result::Err) let msg = mock_ibc_packet_recv(channel_id, &ibc_msg).unwrap(); let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap(); // assert app-level success - let ack: AcknowledgementMsg<()> = from_slice(&res.acknowledgement).unwrap(); + let ack: AcknowledgementMsg<()> = from_json(res.acknowledgement.unwrap()).unwrap(); ack.unwrap(); // and we dispatch the BankMsg via submessage @@ -552,10 +585,10 @@ mod tests { funds, }) = &res.messages[0].msg { - assert_eq!(account, contract_addr.as_str()); + assert_eq!(account.as_str(), contract_addr); assert_eq!(0, funds.len()); // parse the message - should callback with proper channel_id - let rmsg: ReflectExecuteMsg = from_slice(msg).unwrap(); + let rmsg: ReflectExecuteMsg = from_json(msg).unwrap(); assert_eq!( rmsg, ReflectExecuteMsg::ReflectMsg { @@ -575,8 +608,9 @@ mod tests { // we didn't dispatch anything assert_eq!(0, res.messages.len()); // acknowledgement is an error - let ack: AcknowledgementMsg = from_slice(&res.acknowledgement).unwrap(); - assert_eq!(ack.unwrap_err(), "invalid packet: Error parsing into type ibc_reflect::msg::PacketMsg: unknown variant `reflect_code_id`, expected one of `dispatch`, `who_am_i`, `balances`"); + let ack: AcknowledgementMsg = + from_json(res.acknowledgement.unwrap()).unwrap(); + assert_eq!(ack.unwrap_err(), "invalid packet: kind: Serialization, error: unknown variant `reflect_code_id`, expected one of `dispatch`, `who_am_i`, `balance`, `panic`, `return_err`, `return_msgs`, `no_ack` at line 1 column 18"); } #[test] @@ -584,53 +618,27 @@ mod tests { let mut deps = setup(); let channel_id = "channel-123"; - let account = "acct-123"; + let account = deps.api.addr_make("acct-123"); // register the channel - connect(deps.as_mut(), channel_id, account); + connect(deps.as_mut(), channel_id, &account); // assign it some funds let funds = vec![coin(123456, "uatom"), coin(7654321, "tgrd")]; - deps.querier.update_balance(account, funds.clone()); + deps.querier.bank.update_balance(&account, funds.clone()); // channel should be listed and have balance let raw = query(deps.as_ref(), mock_env(), QueryMsg::ListAccounts {}).unwrap(); - let res: ListAccountsResponse = from_slice(&raw).unwrap(); + let res: ListAccountsResponse = from_json(raw).unwrap(); assert_eq!(1, res.accounts.len()); - let balance = deps.as_ref().querier.query_all_balances(account).unwrap(); - assert_eq!(funds, balance); // close the channel let channel = mock_ibc_channel_close_init(channel_id, IbcOrder::Ordered, IBC_APP_VERSION); let res = ibc_channel_close(deps.as_mut(), mock_env(), channel).unwrap(); - - // it pulls out all money from the reflect contract - assert_eq!(1, res.messages.len()); - if let CosmosMsg::Wasm(WasmMsg::Execute { - contract_addr, msg, .. - }) = &res.messages[0].msg - { - assert_eq!(contract_addr.as_str(), account); - let reflect: ReflectExecuteMsg = from_slice(msg).unwrap(); - match reflect { - ReflectExecuteMsg::ReflectMsg { msgs } => { - assert_eq!(1, msgs.len()); - assert_eq!( - &msgs[0], - &BankMsg::Send { - to_address: MOCK_CONTRACT_ADDR.into(), - amount: funds - } - .into() - ) - } - } - } else { - panic!("Unexpected message: {:?}", &res.messages[0]); - } + assert_eq!(res.messages.len(), 0); // and removes the account lookup let raw = query(deps.as_ref(), mock_env(), QueryMsg::ListAccounts {}).unwrap(); - let res: ListAccountsResponse = from_slice(&raw).unwrap(); + let res: ListAccountsResponse = from_json(raw).unwrap(); assert_eq!(0, res.accounts.len()); } } diff --git a/contracts/ibc-reflect/src/msg.rs b/contracts/ibc-reflect/src/msg.rs index 9e9551be00..6299b6f959 100644 --- a/contracts/ibc-reflect/src/msg.rs +++ b/contracts/ibc-reflect/src/msg.rs @@ -1,5 +1,5 @@ use cosmwasm_schema::{cw_serde, QueryResponses}; -use cosmwasm_std::{Coin, ContractResult, CosmosMsg}; +use cosmwasm_std::{Coin, CosmosMsg, IbcAcknowledgement, Uint64}; /// Just needs to know the code_id of a reflect contract to spawn sub-accounts #[cw_serde] @@ -7,6 +7,18 @@ pub struct InstantiateMsg { pub reflect_code_id: u64, } +#[cw_serde] +pub enum ExecuteMsg { + AsyncAck { + /// Existing channel where the packet was received + channel_id: String, + /// Sequence number of the packet that was received + packet_sequence: Uint64, + /// The acknowledgement to send back + ack: IbcAcknowledgement, + }, +} + #[cw_serde] #[derive(QueryResponses)] pub enum QueryMsg { @@ -45,12 +57,42 @@ pub enum ReflectExecuteMsg { pub enum PacketMsg { Dispatch { msgs: Vec }, WhoAmI {}, - Balances {}, + Balance { denom: String }, + Panic {}, + ReturnErr { text: String }, + ReturnMsgs { msgs: Vec }, + NoAck {}, +} + +/// A custom acknowledgement type. +/// The success type `T` depends on the PacketMsg variant. +/// +/// This could be refactored to use [StdAck] at some point. However, +/// it has a different success variant name ("ok" vs. "result") and +/// a JSON payload instead of a binary payload. +/// +/// [StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512 +#[cw_serde] +pub enum AcknowledgementMsg { + Ok(S), + Error(String), } -/// All acknowledgements are wrapped in `ContractResult`. -/// The success value depends on the PacketMsg variant. -pub type AcknowledgementMsg = ContractResult; +impl AcknowledgementMsg { + pub fn unwrap(self) -> S { + match self { + AcknowledgementMsg::Ok(data) => data, + AcknowledgementMsg::Error(err) => panic!("{}", err), + } + } + + pub fn unwrap_err(self) -> String { + match self { + AcknowledgementMsg::Ok(_) => panic!("not an error"), + AcknowledgementMsg::Error(err) => err, + } + } +} /// This is the success response we send on ack for PacketMsg::Dispatch. /// Just acknowledge success or error @@ -66,7 +108,11 @@ pub struct WhoAmIResponse { /// This is the success response we send on ack for PacketMsg::Balance. /// Just acknowledge success or error #[cw_serde] -pub struct BalancesResponse { +pub struct BalanceResponse { pub account: String, - pub balances: Vec, + pub balance: Coin, } + +/// This is the success response we send on ack for PacketMsg::ReturnMsgs. +/// Just acknowledge success or error +pub type ReturnMsgsResponse = (); diff --git a/contracts/ibc-reflect/src/state.rs b/contracts/ibc-reflect/src/state.rs index 9b0bbfe524..21669a7294 100644 --- a/contracts/ibc-reflect/src/state.rs +++ b/contracts/ibc-reflect/src/state.rs @@ -1,39 +1,70 @@ -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; +use std::any::type_name; -use cosmwasm_std::{Addr, Storage}; -use cosmwasm_storage::{ - bucket, bucket_read, singleton, singleton_read, Bucket, ReadonlyBucket, ReadonlySingleton, - Singleton, +use cosmwasm_std::{ + from_json, + storage_keys::{namespace_with_key, to_length_prefixed}, + to_json_vec, Addr, Order, StdError, StdResult, Storage, }; +use schemars::JsonSchema; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; pub const KEY_CONFIG: &[u8] = b"config"; pub const KEY_PENDING_CHANNEL: &[u8] = b"pending"; pub const PREFIX_ACCOUNTS: &[u8] = b"accounts"; +/// Upper bound for ranging over accounts +const PREFIX_ACCOUNTS_UPPER_BOUND: &[u8] = b"accountt"; // spellchecker:disable-line #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct Config { pub reflect_code_id: u64, } -/// accounts is lookup of channel_id to reflect contract -pub fn accounts(storage: &mut dyn Storage) -> Bucket { - bucket(storage, PREFIX_ACCOUNTS) +pub fn may_load_account(storage: &dyn Storage, id: &str) -> StdResult> { + storage + .get(&namespace_with_key(&[PREFIX_ACCOUNTS], id.as_bytes())) + .map(from_json) + .transpose() +} + +pub fn load_account(storage: &dyn Storage, id: &str) -> StdResult { + may_load_account(storage, id)?.ok_or_else(|| StdError::msg(format!("account {id} not found"))) +} + +pub fn save_account(storage: &mut dyn Storage, id: &str, account: &Addr) -> StdResult<()> { + storage.set( + &namespace_with_key(&[PREFIX_ACCOUNTS], id.as_bytes()), + &to_json_vec(account)?, + ); + Ok(()) } -pub fn accounts_read(storage: &dyn Storage) -> ReadonlyBucket { - bucket_read(storage, PREFIX_ACCOUNTS) +pub fn remove_account(storage: &mut dyn Storage, id: &str) { + storage.remove(&namespace_with_key(&[PREFIX_ACCOUNTS], id.as_bytes())); } -pub fn config(storage: &mut dyn Storage) -> Singleton { - singleton(storage, KEY_CONFIG) +pub fn range_accounts( + storage: &dyn Storage, +) -> impl Iterator> + '_ { + let prefix = to_length_prefixed(PREFIX_ACCOUNTS); + let upper_bound = to_length_prefixed(PREFIX_ACCOUNTS_UPPER_BOUND); + storage + .range(Some(&prefix), Some(&upper_bound), Order::Ascending) + .map(|(key, val)| { + Ok(( + String::from_utf8(key[PREFIX_ACCOUNTS.len() + 2..].to_vec())?, + from_json(val)?, + )) + }) } -pub fn config_read(storage: &dyn Storage) -> ReadonlySingleton { - singleton_read(storage, KEY_CONFIG) +pub fn load_item(storage: &dyn Storage, key: &[u8]) -> StdResult { + storage + .get(&to_length_prefixed(key)) + .ok_or_else(|| StdError::msg(format!("{} not found", type_name::()))) + .and_then(from_json) } -/// pending_channel is used to pass info from ibc_channel_connect to the reply handler -pub fn pending_channel(storage: &mut dyn Storage) -> Singleton { - singleton(storage, KEY_PENDING_CHANNEL) +pub fn save_item(storage: &mut dyn Storage, key: &[u8], item: &T) -> StdResult<()> { + storage.set(&to_length_prefixed(key), &to_json_vec(item)?); + Ok(()) } diff --git a/contracts/ibc-reflect/tests/integration.rs b/contracts/ibc-reflect/tests/integration.rs index d28e3369a4..2dfe49a547 100644 --- a/contracts/ibc-reflect/tests/integration.rs +++ b/contracts/ibc-reflect/tests/integration.rs @@ -1,21 +1,6 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests. -//! 1. First copy them over verbatum, -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) use cosmwasm_std::testing::{ mock_ibc_channel_connect_ack, mock_ibc_channel_open_init, mock_ibc_channel_open_try, @@ -91,12 +76,17 @@ fn connect( res.events[0] ); let id = res.messages[0].id; + let payload = res.messages[0].payload.clone(); // fake a reply and ensure this works + #[allow(deprecated)] let response = Reply { id, + payload, + gas_used: 1234567, result: SubMsgResult::Ok(SubMsgResponse { events: fake_events(&account), + msg_responses: vec![], data: None, }), }; @@ -136,6 +126,7 @@ fn enforce_version_in_handshake() { fn proper_handshake_flow() { let mut deps = setup(); let channel_id = "channel-432"; + let reflect_addr = deps.api().addr_make(REFLECT_ADDR); // first we try to open with a valid handshake let handshake_open = mock_ibc_channel_open_init(channel_id, IbcOrder::Ordered, IBC_APP_VERSION); @@ -149,6 +140,7 @@ fn proper_handshake_flow() { // and set up a reflect account assert_eq!(1, res.messages.len()); let id = res.messages[0].id; + let payload = res.messages[0].payload.clone(); if let CosmosMsg::Wasm(WasmMsg::Instantiate { admin, code_id, @@ -171,10 +163,14 @@ fn proper_handshake_flow() { assert_eq!(0, res.accounts.len()); // we get the callback from reflect + #[allow(deprecated)] let response = Reply { id, + payload, + gas_used: 1234567, result: SubMsgResult::Ok(SubMsgResponse { - events: fake_events(REFLECT_ADDR), + events: fake_events(reflect_addr.as_str()), + msg_responses: vec![], data: None, }), }; @@ -188,7 +184,7 @@ fn proper_handshake_flow() { assert_eq!( &res.accounts[0], &AccountInfo { - account: REFLECT_ADDR.into(), + account: reflect_addr.to_string(), channel_id: channel_id.to_string(), } ); @@ -203,7 +199,7 @@ fn proper_handshake_flow() { ) .unwrap(); let res: AccountResponse = from_slice(&raw, DESERIALIZATION_LIMIT).unwrap(); - assert_eq!(res.account.unwrap(), REFLECT_ADDR); + assert_eq!(res.account.unwrap(), reflect_addr.as_str()); } #[test] @@ -211,7 +207,7 @@ fn handle_dispatch_packet() { let mut deps = setup(); let channel_id = "channel-123"; - let account = "acct-123"; + let account = deps.api().addr_make("acct-123"); // receive a packet for an unregistered channel returns app-level error (not Result::Err) let msgs_to_dispatch = vec![BankMsg::Send { @@ -233,14 +229,14 @@ fn handle_dispatch_packet() { ); // acknowledgement is an error let ack: AcknowledgementMsg = - from_slice(&res.acknowledgement, DESERIALIZATION_LIMIT).unwrap(); + from_slice(&res.acknowledgement.unwrap(), DESERIALIZATION_LIMIT).unwrap(); assert_eq!( ack.unwrap_err(), - "invalid packet: cosmwasm_std::addresses::Addr not found" + "invalid packet: kind: Other, error: account channel-123 not found" ); // register the channel - connect(&mut deps, channel_id, account); + connect(&mut deps, channel_id, &account); // receive a packet for an unregistered channel returns app-level error (not Result::Err) let msg = mock_ibc_packet_recv(channel_id, &ibc_msg).unwrap(); @@ -248,7 +244,7 @@ fn handle_dispatch_packet() { // assert app-level success let ack: AcknowledgementMsg = - from_slice(&res.acknowledgement, DESERIALIZATION_LIMIT).unwrap(); + from_slice(&res.acknowledgement.unwrap(), DESERIALIZATION_LIMIT).unwrap(); ack.unwrap(); // and we dispatch the BankMsg @@ -286,6 +282,6 @@ fn handle_dispatch_packet() { assert_eq!(0, res.messages.len()); // acknowledgement is an error let ack: AcknowledgementMsg = - from_slice(&res.acknowledgement, DESERIALIZATION_LIMIT).unwrap(); - assert_eq!(ack.unwrap_err(), "invalid packet: Error parsing into type ibc_reflect::msg::PacketMsg: unknown variant `reflect_code_id`, expected one of `dispatch`, `who_am_i`, `balances`"); + from_slice(&res.acknowledgement.unwrap(), DESERIALIZATION_LIMIT).unwrap(); + assert_eq!(ack.unwrap_err(), "invalid packet: kind: Serialization, error: unknown variant `reflect_code_id`, expected one of `dispatch`, `who_am_i`, `balance`, `panic`, `return_err`, `return_msgs`, `no_ack` at line 1 column 18"); } diff --git a/contracts/ibc2/.cargo/config.toml b/contracts/ibc2/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/ibc2/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/ibc2/Cargo.lock b/contracts/ibc2/Cargo.lock new file mode 100644 index 0000000000..53a97609a7 --- /dev/null +++ b/contracts/ibc2/Cargo.lock @@ -0,0 +1,1361 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + +[[package]] +name = "cosmwasm-crypto" +version = "3.0.3-dev" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cosmwasm-schema" +version = "3.0.3-dev" +dependencies = [ + "cosmwasm-schema-derive", + "cw-schema", + "schemars 0.8.21", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cosmwasm-std" +version = "3.0.3-dev" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "cw-schema", + "derive_more", + "hex", + "rand_core", + "rmp-serde", + "schemars 0.8.21", + "serde", + "serde_json", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cw-schema" +version = "3.0.3-dev" +dependencies = [ + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "ibc2" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "schemars 0.8.21", + "serde", + "thiserror", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/contracts/ibc2/Cargo.toml b/contracts/ibc2/Cargo.toml new file mode 100644 index 0000000000..4b2b148704 --- /dev/null +++ b/contracts/ibc2/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "ibc2" +version = "0.0.0" +authors = ["Tomasz Kulik "] +edition = "2021" +publish = false +license = "Apache-2.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[dependencies] +cosmwasm-schema = { path = "../../packages/schema" } +cosmwasm-std = { path = "../../packages/std", features = ["ibc2"] } +schemars = "0.8.3" +serde = { version = "1.0.103", default-features = false, features = ["derive"] } +thiserror = "1.0.26" diff --git a/contracts/ibc2/schema/cw_schema/ibc2.json b/contracts/ibc2/schema/cw_schema/ibc2.json new file mode 100644 index 0000000000..9dba27d405 --- /dev/null +++ b/contracts/ibc2/schema/cw_schema/ibc2.json @@ -0,0 +1,153 @@ +{ + "contract_name": "ibc2", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] + }, + "execute": null, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc2_msg_QueryMsg", + "type": "enum", + "cases": { + "query_state": { + "type": "named", + "properties": {} + } + } + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "query_state": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc2_state_State", + "type": "struct", + "properties": { + "ibc2_packet_ack_counter": { + "value": 1 + }, + "ibc2_packet_receive_counter": { + "value": 1 + }, + "ibc2_packet_timeout_counter": { + "value": 1 + }, + "last_packet_sent": { + "value": 8 + }, + "last_packet_seq": { + "value": 3 + }, + "last_source_client": { + "value": 2 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_ibc2_Ibc2PacketSendMsg", + "description": "Ibc2PacketSendMsg represents a payload sent event in the IBC2 protocol.\nSince sending IBCv2 packet is permissionless, the IBC protocol introduces\nan extra entry point, in which the application can verify the message sent from\na port ID belonging to the contract.\n\nIt includes details about the source and destination clients, the sequence\nnumber of the packet and the signer that sent the message.", + "type": "struct", + "properties": { + "destination_client": { + "description": "The identifier of the client that was the intended recipient.", + "value": 2 + }, + "packet_sequence": { + "description": "The sequence number of the sent packet.", + "value": 3 + }, + "payload": { + "description": "The payload to be sent.", + "value": 5 + }, + "signer": { + "description": "The address of the signer that sent the packet.", + "value": 7 + }, + "source_client": { + "description": "The identifier of the client that originally sent the packet.", + "value": 2 + } + } + }, + { + "name": "cosmwasm_std_ibc2_Ibc2Payload", + "description": "Payload value should be encoded in a format defined by the channel version,\nand the module on the other side should know how to parse this.", + "type": "struct", + "properties": { + "destination_port": { + "description": "The port id on the chain where the packet is sent to.", + "value": 2 + }, + "encoding": { + "description": "Encoding used to serialize the [Ibc2Payload::value].", + "value": 2 + }, + "source_port": { + "description": "The port id on the chain where the packet is sent from.", + "value": 2 + }, + "value": { + "description": "Encoded payload data.", + "value": 6 + }, + "version": { + "description": "Version of the receiving contract.", + "value": 2 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_addresses_Addr", + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no\nassumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways\n1. Use `Addr::unchecked(input)`\n2. Use `let checked: Addr = deps.api.addr_validate(input)?`\n3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?`\n4. Deserialize from JSON. This must only be done from JSON that was validated before\nsuch as a contract's state. `Addr` must not be used in messages sent by the user\nbecause this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create\na mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String`\ninstance.", + "type": "address" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 4 + } + ] + } + } +} diff --git a/contracts/ibc2/schema/cw_schema/raw/instantiate.json b/contracts/ibc2/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..feb0a1bf43 --- /dev/null +++ b/contracts/ibc2/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,12 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/ibc2/schema/cw_schema/raw/query.json b/contracts/ibc2/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..4116fbefa0 --- /dev/null +++ b/contracts/ibc2/schema/cw_schema/raw/query.json @@ -0,0 +1,16 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc2_msg_QueryMsg", + "type": "enum", + "cases": { + "query_state": { + "type": "named", + "properties": {} + } + } + } + ] +} diff --git a/contracts/ibc2/schema/cw_schema/raw/response_to_query_state.json b/contracts/ibc2/schema/cw_schema/raw/response_to_query_state.json new file mode 100644 index 0000000000..697bb5607e --- /dev/null +++ b/contracts/ibc2/schema/cw_schema/raw/response_to_query_state.json @@ -0,0 +1,115 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "ibc2_state_State", + "type": "struct", + "properties": { + "ibc2_packet_ack_counter": { + "value": 1 + }, + "ibc2_packet_receive_counter": { + "value": 1 + }, + "ibc2_packet_timeout_counter": { + "value": 1 + }, + "last_packet_sent": { + "value": 8 + }, + "last_packet_seq": { + "value": 3 + }, + "last_source_client": { + "value": 2 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_ibc2_Ibc2PacketSendMsg", + "description": "Ibc2PacketSendMsg represents a payload sent event in the IBC2 protocol.\nSince sending IBCv2 packet is permissionless, the IBC protocol introduces\nan extra entry point, in which the application can verify the message sent from\na port ID belonging to the contract.\n\nIt includes details about the source and destination clients, the sequence\nnumber of the packet and the signer that sent the message.", + "type": "struct", + "properties": { + "destination_client": { + "description": "The identifier of the client that was the intended recipient.", + "value": 2 + }, + "packet_sequence": { + "description": "The sequence number of the sent packet.", + "value": 3 + }, + "payload": { + "description": "The payload to be sent.", + "value": 5 + }, + "signer": { + "description": "The address of the signer that sent the packet.", + "value": 7 + }, + "source_client": { + "description": "The identifier of the client that originally sent the packet.", + "value": 2 + } + } + }, + { + "name": "cosmwasm_std_ibc2_Ibc2Payload", + "description": "Payload value should be encoded in a format defined by the channel version,\nand the module on the other side should know how to parse this.", + "type": "struct", + "properties": { + "destination_port": { + "description": "The port id on the chain where the packet is sent to.", + "value": 2 + }, + "encoding": { + "description": "Encoding used to serialize the [Ibc2Payload::value].", + "value": 2 + }, + "source_port": { + "description": "The port id on the chain where the packet is sent from.", + "value": 2 + }, + "value": { + "description": "Encoded payload data.", + "value": 6 + }, + "version": { + "description": "Version of the receiving contract.", + "value": 2 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_addresses_Addr", + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no\nassumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways\n1. Use `Addr::unchecked(input)`\n2. Use `let checked: Addr = deps.api.addr_validate(input)?`\n3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?`\n4. Deserialize from JSON. This must only be done from JSON that was validated before\nsuch as a contract's state. `Addr` must not be used in messages sent by the user\nbecause this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create\na mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String`\ninstance.", + "type": "address" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 4 + } + ] +} diff --git a/contracts/ibc2/schema/ibc2.json b/contracts/ibc2/schema/ibc2.json new file mode 100644 index 0000000000..7bc29f5444 --- /dev/null +++ b/contracts/ibc2/schema/ibc2.json @@ -0,0 +1,176 @@ +{ + "contract_name": "ibc2", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false + }, + "execute": null, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "query_state" + ], + "properties": { + "query_state": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "query_state": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "State", + "type": "object", + "required": [ + "ibc2_packet_ack_counter", + "ibc2_packet_receive_counter", + "ibc2_packet_timeout_counter", + "last_packet_seq", + "last_source_client" + ], + "properties": { + "ibc2_packet_ack_counter": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "ibc2_packet_receive_counter": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "ibc2_packet_timeout_counter": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "last_packet_sent": { + "anyOf": [ + { + "$ref": "#/definitions/Ibc2PacketSendMsg" + }, + { + "type": "null" + } + ] + }, + "last_packet_seq": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "last_source_client": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Ibc2PacketSendMsg": { + "description": "Ibc2PacketSendMsg represents a payload sent event in the IBC2 protocol. Since sending IBCv2 packet is permissionless, the IBC protocol introduces an extra entry point, in which the application can verify the message sent from a port ID belonging to the contract.\n\nIt includes details about the source and destination clients, the sequence number of the packet and the signer that sent the message.", + "type": "object", + "required": [ + "destination_client", + "packet_sequence", + "payload", + "signer", + "source_client" + ], + "properties": { + "destination_client": { + "description": "The identifier of the client that was the intended recipient.", + "type": "string" + }, + "packet_sequence": { + "description": "The sequence number of the sent packet.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "payload": { + "description": "The payload to be sent.", + "allOf": [ + { + "$ref": "#/definitions/Ibc2Payload" + } + ] + }, + "signer": { + "description": "The address of the signer that sent the packet.", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, + "source_client": { + "description": "The identifier of the client that originally sent the packet.", + "type": "string" + } + }, + "additionalProperties": false + }, + "Ibc2Payload": { + "description": "Payload value should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.", + "type": "object", + "required": [ + "destination_port", + "encoding", + "source_port", + "value", + "version" + ], + "properties": { + "destination_port": { + "description": "The port id on the chain where the packet is sent to.", + "type": "string" + }, + "encoding": { + "description": "Encoding used to serialize the [Ibc2Payload::value].", + "type": "string" + }, + "source_port": { + "description": "The port id on the chain where the packet is sent from.", + "type": "string" + }, + "value": { + "description": "Encoded payload data.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "version": { + "description": "Version of the receiving contract.", + "type": "string" + } + }, + "additionalProperties": false + } + } + } + } +} diff --git a/contracts/ibc2/schema/raw/instantiate.json b/contracts/ibc2/schema/raw/instantiate.json new file mode 100644 index 0000000000..e12a3fda12 --- /dev/null +++ b/contracts/ibc2/schema/raw/instantiate.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/ibc2/schema/raw/query.json b/contracts/ibc2/schema/raw/query.json new file mode 100644 index 0000000000..60e28f8dde --- /dev/null +++ b/contracts/ibc2/schema/raw/query.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "query_state" + ], + "properties": { + "query_state": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/ibc2/schema/raw/response_to_query_state.json b/contracts/ibc2/schema/raw/response_to_query_state.json new file mode 100644 index 0000000000..45cfe66804 --- /dev/null +++ b/contracts/ibc2/schema/raw/response_to_query_state.json @@ -0,0 +1,140 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "State", + "type": "object", + "required": [ + "ibc2_packet_ack_counter", + "ibc2_packet_receive_counter", + "ibc2_packet_timeout_counter", + "last_packet_seq", + "last_source_client" + ], + "properties": { + "ibc2_packet_ack_counter": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "ibc2_packet_receive_counter": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "ibc2_packet_timeout_counter": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "last_packet_sent": { + "anyOf": [ + { + "$ref": "#/definitions/Ibc2PacketSendMsg" + }, + { + "type": "null" + } + ] + }, + "last_packet_seq": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "last_source_client": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Ibc2PacketSendMsg": { + "description": "Ibc2PacketSendMsg represents a payload sent event in the IBC2 protocol. Since sending IBCv2 packet is permissionless, the IBC protocol introduces an extra entry point, in which the application can verify the message sent from a port ID belonging to the contract.\n\nIt includes details about the source and destination clients, the sequence number of the packet and the signer that sent the message.", + "type": "object", + "required": [ + "destination_client", + "packet_sequence", + "payload", + "signer", + "source_client" + ], + "properties": { + "destination_client": { + "description": "The identifier of the client that was the intended recipient.", + "type": "string" + }, + "packet_sequence": { + "description": "The sequence number of the sent packet.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "payload": { + "description": "The payload to be sent.", + "allOf": [ + { + "$ref": "#/definitions/Ibc2Payload" + } + ] + }, + "signer": { + "description": "The address of the signer that sent the packet.", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, + "source_client": { + "description": "The identifier of the client that originally sent the packet.", + "type": "string" + } + }, + "additionalProperties": false + }, + "Ibc2Payload": { + "description": "Payload value should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.", + "type": "object", + "required": [ + "destination_port", + "encoding", + "source_port", + "value", + "version" + ], + "properties": { + "destination_port": { + "description": "The port id on the chain where the packet is sent to.", + "type": "string" + }, + "encoding": { + "description": "Encoding used to serialize the [Ibc2Payload::value].", + "type": "string" + }, + "source_port": { + "description": "The port id on the chain where the packet is sent from.", + "type": "string" + }, + "value": { + "description": "Encoded payload data.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "version": { + "description": "Version of the receiving contract.", + "type": "string" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/ibc2/src/bin/schema.rs b/contracts/ibc2/src/bin/schema.rs new file mode 100644 index 0000000000..0c0d018f2f --- /dev/null +++ b/contracts/ibc2/src/bin/schema.rs @@ -0,0 +1,10 @@ +use cosmwasm_schema::write_api; +use cosmwasm_std::Empty; +use ibc2::msg::QueryMsg; + +fn main() { + write_api! { + instantiate: Empty, + query: QueryMsg, + } +} diff --git a/contracts/ibc2/src/contract.rs b/contracts/ibc2/src/contract.rs new file mode 100644 index 0000000000..fe4b12db7a --- /dev/null +++ b/contracts/ibc2/src/contract.rs @@ -0,0 +1,171 @@ +use cosmwasm_std::{ + entry_point, from_json, to_json_vec, Binary, Deps, DepsMut, Empty, Env, Ibc2Msg, + Ibc2PacketAckMsg, Ibc2PacketReceiveMsg, Ibc2PacketSendMsg, Ibc2PacketTimeoutMsg, Ibc2Payload, + IbcAcknowledgement, IbcBasicResponse, IbcReceiveResponse, MessageInfo, QueryResponse, Response, + StdAck, StdError, StdResult, +}; + +use crate::msg::{IbcPayload, QueryMsg}; +use crate::state::{State, STATE_KEY}; + +#[entry_point] +pub fn instantiate( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: Empty, +) -> StdResult { + deps.storage.set( + STATE_KEY, + &to_json_vec(&State { + ibc2_packet_ack_counter: 0, + ibc2_packet_receive_counter: 0, + ibc2_packet_timeout_counter: 0, + last_source_client: "".to_owned(), + last_packet_seq: 0, + last_packet_sent: None, + })?, + ); + + Ok(Response::new()) +} + +#[entry_point] +pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::QueryState {} => { + let data = deps + .storage + .get(STATE_KEY) + .ok_or_else(|| StdError::msg("State not found."))?; + Ok(Binary::from(data)) + } + } +} + +#[entry_point] +pub fn ibc2_packet_ack( + deps: DepsMut, + _env: Env, + _msg: Ibc2PacketAckMsg, +) -> StdResult { + let data = deps + .storage + .get(STATE_KEY) + .ok_or_else(|| StdError::msg("State not found."))?; + let state: State = from_json(data)?; + + deps.storage.set( + STATE_KEY, + &to_json_vec(&State { + ibc2_packet_ack_counter: state.ibc2_packet_ack_counter + 1, + ..state + })?, + ); + + Ok(IbcBasicResponse::default()) +} + +#[entry_point] +pub fn ibc2_packet_receive( + deps: DepsMut, + env: Env, + msg: Ibc2PacketReceiveMsg, +) -> StdResult { + let binary_payload = &msg.payload.value; + let json_payload: IbcPayload = from_json(binary_payload)?; + + let data = deps + .storage + .get(STATE_KEY) + .ok_or_else(|| StdError::msg("State not found."))?; + let state: State = from_json(data)?; + + deps.storage.set( + STATE_KEY, + &to_json_vec(&State { + ibc2_packet_receive_counter: state.ibc2_packet_receive_counter + 1, + last_source_client: msg.source_client.clone(), + last_packet_seq: msg.packet_sequence, + ..state + })?, + ); + let new_payload = Ibc2Payload::new( + msg.payload.destination_port, + msg.payload.source_port, + msg.payload.version, + msg.payload.encoding, + msg.payload.value, + ); + let new_msg = Ibc2Msg::SendPacket { + source_client: msg.source_client, + payloads: vec![new_payload], + timeout: env.block.time.plus_minutes(1_u64), + }; + + let resp = if json_payload.response_without_ack { + IbcReceiveResponse::without_ack().add_attribute("action", "handle_increment") + } else { + IbcReceiveResponse::new(StdAck::success(b"\x01")) + .add_message(new_msg) + .add_attribute("action", "handle_increment") + }; + + if json_payload.send_async_ack_for_prev_msg { + Ok( + resp.add_message(cosmwasm_std::Ibc2Msg::WriteAcknowledgement { + source_client: state.last_source_client, + packet_sequence: state.last_packet_seq, + ack: IbcAcknowledgement::new([1, 2, 3]), + }), + ) + } else { + Ok(resp) + } +} + +#[entry_point] +pub fn ibc2_packet_timeout( + deps: DepsMut, + _env: Env, + _msg: Ibc2PacketTimeoutMsg, +) -> StdResult { + let data = deps + .storage + .get(STATE_KEY) + .ok_or_else(|| StdError::msg("State not found."))?; + let state: State = from_json(data)?; + + deps.storage.set( + STATE_KEY, + &to_json_vec(&State { + ibc2_packet_timeout_counter: state.ibc2_packet_timeout_counter + 1, + ..state + })?, + ); + + Ok(IbcBasicResponse::default()) +} + +#[entry_point] +pub fn ibc2_packet_send( + deps: DepsMut, + _env: Env, + msg: Ibc2PacketSendMsg, +) -> StdResult { + let data = deps + .storage + .get(STATE_KEY) + .ok_or_else(|| StdError::msg("State not found."))?; + let state: State = from_json(data)?; + + deps.storage.set( + STATE_KEY, + &to_json_vec(&State { + last_packet_sent: Some(msg), + ..state + })?, + ); + + Ok(IbcBasicResponse::default()) +} diff --git a/contracts/ibc2/src/lib.rs b/contracts/ibc2/src/lib.rs new file mode 100644 index 0000000000..4934c19d5b --- /dev/null +++ b/contracts/ibc2/src/lib.rs @@ -0,0 +1,3 @@ +pub mod contract; +pub mod msg; +pub mod state; diff --git a/contracts/ibc2/src/msg.rs b/contracts/ibc2/src/msg.rs new file mode 100644 index 0000000000..0d934b0a3f --- /dev/null +++ b/contracts/ibc2/src/msg.rs @@ -0,0 +1,14 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; + +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg { + #[returns(crate::state::State)] + QueryState {}, +} + +#[cw_serde] +pub struct IbcPayload { + pub response_without_ack: bool, + pub send_async_ack_for_prev_msg: bool, +} diff --git a/contracts/ibc2/src/state.rs b/contracts/ibc2/src/state.rs new file mode 100644 index 0000000000..7bccee268f --- /dev/null +++ b/contracts/ibc2/src/state.rs @@ -0,0 +1,15 @@ +use cosmwasm_schema::cw_serde; +use cosmwasm_std::Ibc2PacketSendMsg; + +#[cw_serde] +#[derive(Default, Eq)] +pub struct State { + pub ibc2_packet_ack_counter: u32, + pub ibc2_packet_receive_counter: u32, + pub ibc2_packet_timeout_counter: u32, + pub last_source_client: String, + pub last_packet_seq: u64, + pub last_packet_sent: Option, +} + +pub const STATE_KEY: &[u8] = b"state"; diff --git a/contracts/ibc2/tests/integration.rs b/contracts/ibc2/tests/integration.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/contracts/ibc2/tests/integration.rs @@ -0,0 +1 @@ + diff --git a/contracts/nested-contracts/.cargo/config.toml b/contracts/nested-contracts/.cargo/config.toml new file mode 100644 index 0000000000..c30aa6328e --- /dev/null +++ b/contracts/nested-contracts/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +schema = "run --bin schema" +integration-test = "test --lib integration_tests" diff --git a/contracts/nested-contracts/Cargo.lock b/contracts/nested-contracts/Cargo.lock new file mode 100644 index 0000000000..db6f6fbb4e --- /dev/null +++ b/contracts/nested-contracts/Cargo.lock @@ -0,0 +1,1170 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "anyhow" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rayon", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cosmwasm-core" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b6dc17e7fd89d0a0a58f12ef33f0bbdf09a6a14c3dfb383eae665e5889250e" + +[[package]] +name = "cosmwasm-crypto" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2f53285517db3e33d825b3e46301efe845135778527e1295154413b2f0469e" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a782b93fae93e57ca8ad3e9e994e784583f5933aeaaa5c80a545c4b437be2047" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "cosmwasm-schema" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bc0d4d85e83438ab9a0fea9348446f7268bc016aacfebce37e998559f151294" +dependencies = [ + "cosmwasm-schema-derive", + "schemars", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edf5c8adac41bb7751c050d7c4c18675be19ee128714454454575e894424eeef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "cosmwasm-std" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf82335c14bd94eeb4d3c461b7aa419ecd7ea13c2efe24b97cd972bdb8044e7d" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "derive_more", + "hex", + "rand_core", + "rmp-serde", + "schemars", + "serde", + "serde-json-wasm", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "cw-multi-test" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0ae276e7a06ad1b7e7da78a3d68aba80634cde30ee7fe8259a94e653603fef8" +dependencies = [ + "anyhow", + "bech32", + "cosmwasm-std", + "cw-storage-plus", + "cw-utils", + "derivative", + "itertools 0.13.0", + "prost", + "schemars", + "serde", + "sha2", + "thiserror", +] + +[[package]] +name = "cw-storage-plus" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" +dependencies = [ + "cosmwasm-std", + "schemars", + "serde", +] + +[[package]] +name = "cw-utils" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "semver", + "serde", + "thiserror", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "inner-contract" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "cw2", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "nested-contracts" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-multi-test", + "cw-storage-plus", + "cw2", + "inner-contract", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" +dependencies = [ + "anyhow", + "itertools 0.13.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.77", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-json-wasm" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05da0d153dd4595bdffd5099dc0e9ce425b205ee648eb93437ff7302af8c9a5" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] diff --git a/contracts/nested-contracts/Cargo.toml b/contracts/nested-contracts/Cargo.toml new file mode 100644 index 0000000000..05807748e0 --- /dev/null +++ b/contracts/nested-contracts/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "nested-contracts" +version = "0.0.0" +authors = ["Aumetra Weisman "] +edition = "2021" +publish = false +license = "Apache-2.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[package.metadata.scripts] +optimize = """docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/optimizer:0.15.0 +""" + +[dependencies] +cosmwasm-schema = "2.1.0" +# Enable "cosmwasm_2_0" feature if you only deploy to chains that have CosmWasm 2.0 or higher. +cosmwasm-std = { version = "2.1.0", features = ["cosmwasm_1_4"] } +cw-storage-plus = "2.0.0" +cw2 = "2.0.0" +schemars = "0.8.16" +serde = { version = "1.0.197", default-features = false, features = ["derive"] } +thiserror = { version = "1.0.58" } +inner-contract = { path = "./inner-contract" } + +[dev-dependencies] +cw-multi-test = "2.0.0" diff --git a/contracts/nested-contracts/README.md b/contracts/nested-contracts/README.md new file mode 100644 index 0000000000..40be5c0f91 --- /dev/null +++ b/contracts/nested-contracts/README.md @@ -0,0 +1,6 @@ +# Nested contracts test + +This contract doesn't do anything. Actually will panic at runtime. It simply +asserts at compile-time that it is possible to use another contract as a +dependency without using hacks such as the `library` feature, and conditional +`#[entry_point]` compilation. diff --git a/contracts/nested-contracts/inner-contract/.cargo/config.toml b/contracts/nested-contracts/inner-contract/.cargo/config.toml new file mode 100644 index 0000000000..f5659c71d9 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/.cargo/config.toml @@ -0,0 +1,5 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +schema = "run --bin schema" +integration-test = "test --lib integration_tests" diff --git a/contracts/nested-contracts/inner-contract/Cargo.lock b/contracts/nested-contracts/inner-contract/Cargo.lock new file mode 100644 index 0000000000..94d11f2ce4 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/Cargo.lock @@ -0,0 +1,1132 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "anyhow" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rayon", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cosmwasm-core" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d905990ef3afb5753bb709dc7de88e9e370aa32bcc2f31731d4b533b63e82490" + +[[package]] +name = "cosmwasm-crypto" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b2a7bd9c1dd9a377a4dc0f4ad97d24b03c33798cd5a6d7ceb8869b41c5d2f2d" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029910b409398fdf81955d7301b906caf81f2c42b013ea074fbd89720229c424" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "cosmwasm-schema" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bc0d4d85e83438ab9a0fea9348446f7268bc016aacfebce37e998559f151294" +dependencies = [ + "cosmwasm-schema-derive", + "schemars", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edf5c8adac41bb7751c050d7c4c18675be19ee128714454454575e894424eeef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "cosmwasm-std" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51dec99a2e478715c0a4277f0dbeadbb8466500eb7dec873d0924edd086e77f1" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "derive_more", + "hex", + "rand_core", + "schemars", + "serde", + "serde-json-wasm", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "cw-multi-test" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0ae276e7a06ad1b7e7da78a3d68aba80634cde30ee7fe8259a94e653603fef8" +dependencies = [ + "anyhow", + "bech32", + "cosmwasm-std", + "cw-storage-plus", + "cw-utils", + "derivative", + "itertools 0.13.0", + "prost", + "schemars", + "serde", + "sha2", + "thiserror", +] + +[[package]] +name = "cw-storage-plus" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" +dependencies = [ + "cosmwasm-std", + "schemars", + "serde", +] + +[[package]] +name = "cw-utils" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "semver", + "serde", + "thiserror", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "inner-contract" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-multi-test", + "cw-storage-plus", + "cw2", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" +dependencies = [ + "anyhow", + "itertools 0.13.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.77", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-json-wasm" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05da0d153dd4595bdffd5099dc0e9ce425b205ee648eb93437ff7302af8c9a5" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] diff --git a/contracts/nested-contracts/inner-contract/Cargo.toml b/contracts/nested-contracts/inner-contract/Cargo.toml new file mode 100644 index 0000000000..d456adba5d --- /dev/null +++ b/contracts/nested-contracts/inner-contract/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "inner-contract" +version = "0.0.0" +authors = ["Aumetra Weisman "] +edition = "2021" +publish = false +license = "Apache-2.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[package.metadata.scripts] +optimize = """docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/optimizer:0.15.0 +""" + +[dependencies] +cosmwasm-schema = "2.1.0" +# Enable "cosmwasm_2_0" feature if you only deploy to chains that have CosmWasm 2.0 or higher. +cosmwasm-std = { version = "2.1.0", features = ["cosmwasm_1_4"] } +cw-storage-plus = "2.0.0" +cw2 = "2.0.0" +schemars = "0.8.16" +serde = { version = "1.0.197", default-features = false, features = ["derive"] } +thiserror = { version = "1.0.58" } + +[dev-dependencies] +cw-multi-test = "2.0.0" diff --git a/contracts/nested-contracts/inner-contract/schema/inner-contract.json b/contracts/nested-contracts/inner-contract/schema/inner-contract.json new file mode 100644 index 0000000000..ea234f4c81 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/schema/inner-contract.json @@ -0,0 +1,26 @@ +{ + "contract_name": "inner-contract", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "type": "string", + "enum": [] + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "type": "string", + "enum": [] + }, + "migrate": null, + "sudo": null, + "responses": {} +} diff --git a/contracts/nested-contracts/inner-contract/schema/raw/execute.json b/contracts/nested-contracts/inner-contract/schema/raw/execute.json new file mode 100644 index 0000000000..b3d18b4768 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/schema/raw/execute.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "type": "string", + "enum": [] +} diff --git a/contracts/nested-contracts/inner-contract/schema/raw/instantiate.json b/contracts/nested-contracts/inner-contract/schema/raw/instantiate.json new file mode 100644 index 0000000000..1352613d57 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/schema/raw/instantiate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/nested-contracts/inner-contract/schema/raw/query.json b/contracts/nested-contracts/inner-contract/schema/raw/query.json new file mode 100644 index 0000000000..0f592a1af0 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/schema/raw/query.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "type": "string", + "enum": [] +} diff --git a/contracts/nested-contracts/inner-contract/src/bin/schema.rs b/contracts/nested-contracts/inner-contract/src/bin/schema.rs new file mode 100644 index 0000000000..58922cb80f --- /dev/null +++ b/contracts/nested-contracts/inner-contract/src/bin/schema.rs @@ -0,0 +1,11 @@ +use cosmwasm_schema::write_api; + +use inner_contract::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + } +} diff --git a/contracts/nested-contracts/inner-contract/src/contract.rs b/contracts/nested-contracts/inner-contract/src/contract.rs new file mode 100644 index 0000000000..4a503292b1 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/src/contract.rs @@ -0,0 +1,40 @@ +use cosmwasm_std::entry_point; +use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult}; +// use cw2::set_contract_version; + +use crate::error::ContractError; +use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +/* +// version info for migration info +const CONTRACT_NAME: &str = "crates.io:inner-contract"; +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); +*/ + +#[entry_point] +pub fn instantiate( + _deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: InstantiateMsg, +) -> Result { + unimplemented!() +} + +#[entry_point] +pub fn execute( + _deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: ExecuteMsg, +) -> Result { + unimplemented!() +} + +#[entry_point] +pub fn query(_deps: Deps, _env: Env, _msg: QueryMsg) -> StdResult { + unimplemented!() +} + +#[cfg(test)] +mod tests {} diff --git a/contracts/nested-contracts/inner-contract/src/error.rs b/contracts/nested-contracts/inner-contract/src/error.rs new file mode 100644 index 0000000000..40dab9ff31 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/src/error.rs @@ -0,0 +1,8 @@ +use cosmwasm_std::StdError; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum ContractError { + #[error("{0}")] + Std(#[from] StdError), +} diff --git a/contracts/nested-contracts/inner-contract/src/lib.rs b/contracts/nested-contracts/inner-contract/src/lib.rs new file mode 100644 index 0000000000..dfedc9dc61 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/src/lib.rs @@ -0,0 +1,6 @@ +pub mod contract; +mod error; +pub mod msg; +pub mod state; + +pub use crate::error::ContractError; diff --git a/contracts/nested-contracts/inner-contract/src/msg.rs b/contracts/nested-contracts/inner-contract/src/msg.rs new file mode 100644 index 0000000000..3b6b9b272c --- /dev/null +++ b/contracts/nested-contracts/inner-contract/src/msg.rs @@ -0,0 +1,11 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; + +#[cw_serde] +pub struct InstantiateMsg {} + +#[cw_serde] +pub enum ExecuteMsg {} + +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg {} diff --git a/contracts/nested-contracts/inner-contract/src/state.rs b/contracts/nested-contracts/inner-contract/src/state.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/contracts/nested-contracts/inner-contract/src/state.rs @@ -0,0 +1 @@ + diff --git a/contracts/nested-contracts/schema/nested-contracts.json b/contracts/nested-contracts/schema/nested-contracts.json new file mode 100644 index 0000000000..222280e9dc --- /dev/null +++ b/contracts/nested-contracts/schema/nested-contracts.json @@ -0,0 +1,26 @@ +{ + "contract_name": "nested-contracts", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "type": "string", + "enum": [] + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "type": "string", + "enum": [] + }, + "migrate": null, + "sudo": null, + "responses": {} +} diff --git a/contracts/nested-contracts/schema/raw/execute.json b/contracts/nested-contracts/schema/raw/execute.json new file mode 100644 index 0000000000..b3d18b4768 --- /dev/null +++ b/contracts/nested-contracts/schema/raw/execute.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "type": "string", + "enum": [] +} diff --git a/contracts/nested-contracts/schema/raw/instantiate.json b/contracts/nested-contracts/schema/raw/instantiate.json new file mode 100644 index 0000000000..1352613d57 --- /dev/null +++ b/contracts/nested-contracts/schema/raw/instantiate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/nested-contracts/schema/raw/query.json b/contracts/nested-contracts/schema/raw/query.json new file mode 100644 index 0000000000..0f592a1af0 --- /dev/null +++ b/contracts/nested-contracts/schema/raw/query.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "type": "string", + "enum": [] +} diff --git a/contracts/nested-contracts/src/bin/schema.rs b/contracts/nested-contracts/src/bin/schema.rs new file mode 100644 index 0000000000..c58d415636 --- /dev/null +++ b/contracts/nested-contracts/src/bin/schema.rs @@ -0,0 +1,11 @@ +use cosmwasm_schema::write_api; + +use nested_contracts::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + } +} diff --git a/contracts/nested-contracts/src/contract.rs b/contracts/nested-contracts/src/contract.rs new file mode 100644 index 0000000000..0408ccfb81 --- /dev/null +++ b/contracts/nested-contracts/src/contract.rs @@ -0,0 +1,45 @@ +#![allow(unreachable_code, clippy::diverging_sub_expression)] + +use cosmwasm_std::entry_point; +use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult}; +// use cw2::set_contract_version; + +use crate::error::ContractError; +use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +/* +// version info for migration info +const CONTRACT_NAME: &str = "crates.io:nested-contracts"; +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); +*/ + +#[entry_point] +pub fn instantiate( + deps: DepsMut, + env: Env, + info: MessageInfo, + _msg: InstantiateMsg, +) -> Result { + inner_contract::contract::instantiate(deps, env, info, todo!()).unwrap(); + unimplemented!() +} + +#[entry_point] +pub fn execute( + deps: DepsMut, + env: Env, + info: MessageInfo, + _msg: ExecuteMsg, +) -> Result { + inner_contract::contract::execute(deps, env, info, todo!()).unwrap(); + unimplemented!() +} + +#[entry_point] +pub fn query(deps: Deps, env: Env, _msg: QueryMsg) -> StdResult { + inner_contract::contract::query(deps, env, todo!()).unwrap(); + unimplemented!() +} + +#[cfg(test)] +mod tests {} diff --git a/contracts/nested-contracts/src/error.rs b/contracts/nested-contracts/src/error.rs new file mode 100644 index 0000000000..40dab9ff31 --- /dev/null +++ b/contracts/nested-contracts/src/error.rs @@ -0,0 +1,8 @@ +use cosmwasm_std::StdError; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum ContractError { + #[error("{0}")] + Std(#[from] StdError), +} diff --git a/contracts/nested-contracts/src/lib.rs b/contracts/nested-contracts/src/lib.rs new file mode 100644 index 0000000000..dfedc9dc61 --- /dev/null +++ b/contracts/nested-contracts/src/lib.rs @@ -0,0 +1,6 @@ +pub mod contract; +mod error; +pub mod msg; +pub mod state; + +pub use crate::error::ContractError; diff --git a/contracts/nested-contracts/src/msg.rs b/contracts/nested-contracts/src/msg.rs new file mode 100644 index 0000000000..3b6b9b272c --- /dev/null +++ b/contracts/nested-contracts/src/msg.rs @@ -0,0 +1,11 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; + +#[cw_serde] +pub struct InstantiateMsg {} + +#[cw_serde] +pub enum ExecuteMsg {} + +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg {} diff --git a/contracts/nested-contracts/src/state.rs b/contracts/nested-contracts/src/state.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/contracts/nested-contracts/src/state.rs @@ -0,0 +1 @@ + diff --git a/contracts/nested-contracts/tests/integration.rs b/contracts/nested-contracts/tests/integration.rs new file mode 100644 index 0000000000..6a9dbcc41f --- /dev/null +++ b/contracts/nested-contracts/tests/integration.rs @@ -0,0 +1,4 @@ +#[test] +fn empty_test() { + // This is a placeholder for future integration tests if needed. +} diff --git a/contracts/queue/.cargo/config b/contracts/queue/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/queue/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/queue/.cargo/config.toml b/contracts/queue/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/queue/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/queue/Cargo.lock b/contracts/queue/Cargo.lock index 7887dbb95c..2ae98b7359 100644 --- a/contracts/queue/Cargo.lock +++ b/contracts/queue/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,118 +17,349 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "base64ct" -version = "1.5.0" +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -136,55 +367,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -192,196 +462,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -398,22 +605,61 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cw-schema" +version = "3.0.3-dev" +dependencies = [ + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "darling" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ "darling_core", "darling_macro", @@ -421,75 +667,134 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.87", ] [[package]] name = "darling_macro" -version = "0.13.0" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "der" -version = "0.6.0" +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -497,13 +802,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -514,57 +819,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -587,46 +912,110 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -634,97 +1023,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -738,803 +1132,1443 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" - -[[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "wasm-bindgen", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "k256" -version = "0.11.3" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "loupe" -version = "0.1.3" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ + "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "mach" -version = "0.3.2" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "memchr" -version = "2.4.1" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ - "autocfg", + "equivalent", + "hashbrown 0.15.2", ] [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "adler", - "autocfg", + "hermit-abi", + "libc", + "windows-sys 0.59.0", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "hermit-abi", - "libc", + "either", ] [[package]] -name = "object" -version = "0.25.3" +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "memchr", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.28.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", ] [[package]] -name = "once_cell" -version = "1.8.0" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "libc" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] -name = "pin-project-lite" -version = "0.2.7" +name = "libloading" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] -name = "pkcs8" -version = "0.9.0" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "der", - "spki", + "bitflags 2.5.0", + "libc", + "redox_syscall", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "autocfg", + "scopeguard", ] [[package]] -name = "proc-macro2" -version = "1.0.27" +name = "log" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" -dependencies = [ - "unicode-xid", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "ptr_meta" -version = "0.1.4" +name = "mach2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ - "ptr_meta_derive", + "libc", ] [[package]] -name = "ptr_meta_derive" -version = "0.1.4" +name = "memchr" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] -name = "queue" -version = "0.0.0" +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-vm", - "schemars", - "serde", + "libc", ] [[package]] -name = "quote" -version = "1.0.9" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ - "proc-macro2", + "libc", ] [[package]] -name = "rand" -version = "0.8.4" +name = "memoffset" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ - "libc", - "rand_chacha", - "rand_core 0.6.3", - "rand_hc", + "autocfg", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", -] +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] -name = "rand_core" -version = "0.5.1" +name = "miniz_oxide" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ - "getrandom 0.1.16", + "adler", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "miniz_oxide" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ - "getrandom 0.2.3", + "adler2", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" dependencies = [ - "rand_core 0.6.3", + "munge_macro", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "munge_macro" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "memchr", + "minimal-lexical", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "num-bigint" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "bitflags", + "num-integer", + "num-traits", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "num-traits", ] [[package]] -name = "region" -version = "3.0.0" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "autocfg", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "winapi", + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", ] [[package]] -name = "rend" -version = "0.3.6" +name = "object" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ - "bytecheck", + "memchr", ] [[package]] -name = "rfc6979" -version = "0.3.0" +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", + "supports-color 2.1.0", + "supports-color 3.0.2", ] [[package]] -name = "rkyv" -version = "0.7.36" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", ] [[package]] -name = "rkyv_derive" -version = "0.7.36" +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", ] [[package]] -name = "rustc-demangle" -version = "0.1.20" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "rustc-hash" -version = "1.1.0" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "rustversion" -version = "1.0.5" +name = "pin-project-lite" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "ryu" -version = "1.0.5" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "schemars" -version = "0.8.6" +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "schemars_derive" -version = "0.8.6" +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ + "proc-macro-error-attr", "proc-macro2", "quote", - "serde_derive_internals", - "syn", + "syn 1.0.109", + "version_check", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "proc-macro-error-attr" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] [[package]] -name = "sec1" -version = "0.3.0" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "serde" -version = "1.0.126" +name = "proc-macro2" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "serde_derive", + "unicode-ident", ] [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "ptr_meta" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "serde", + "ptr_meta_derive 0.1.4", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "ptr_meta" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" dependencies = [ - "serde", + "ptr_meta_derive 0.3.0", ] [[package]] -name = "serde_derive" -version = "1.0.126" +name = "ptr_meta_derive" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "serde_derive_internals" -version = "0.25.0" +name = "ptr_meta_derive" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "serde_json" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +name = "queue" +version = "0.0.0" dependencies = [ - "itoa", - "ryu", + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-vm", + "schemars 0.8.21", "serde", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "quote" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "proc-macro2", ] [[package]] -name = "sha2" -version = "0.10.3" +name = "rancor" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" dependencies = [ - "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "ptr_meta 0.3.0", ] [[package]] -name = "signature" -version = "1.5.0" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "rand_chacha", + "rand_core", ] [[package]] -name = "smallvec" -version = "1.6.1" +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] [[package]] -name = "spki" -version = "0.6.0" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "base64ct", - "der", + "getrandom", ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] [[package]] -name = "strsim" -version = "0.10.0" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] [[package]] -name = "subtle" -version = "2.4.1" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] [[package]] -name = "syn" -version = "1.0.73" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "syn 2.0.87", ] [[package]] -name = "target-lexicon" -version = "0.12.2" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] [[package]] -name = "tempfile" -version = "3.2.0" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "cfg-if", + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +dependencies = [ + "bitflags 1.3.2", "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "mach2", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" +dependencies = [ + "bytecheck 0.8.0", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" +dependencies = [ + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" -dependencies = [ - "thiserror-impl", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1542,24 +2576,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1567,113 +2601,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1683,252 +2699,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/queue/Cargo.toml b/contracts/queue/Cargo.toml index 5743c2dacb..6058e82513 100644 --- a/contracts/queue/Cargo.toml +++ b/contracts/queue/Cargo.toml @@ -1,13 +1,14 @@ [package] name = "queue" version = "0.0.0" -authors = ["Simon Warta ", "Ethan Frey "] +authors = [ + "Ethan Frey ", + "Simon Warta ", +] edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -22,21 +23,12 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# For quicker tests, cargo test --lib. for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] -# this is to demonstrate conditional entry-points for cosmwasm-plus style -library = [] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = ["iterator"] } -schemars = "0.8.3" +# cosmwasm_1_4 is enabled here for more efficient `range_keys` and `range_values` +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_1_4", "iterator"] } +schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/contracts/queue/schema/cw_schema/queue.json b/contracts/queue/schema/cw_schema/queue.json new file mode 100644 index 0000000000..a7d3cea6a2 --- /dev/null +++ b/contracts/queue/schema/cw_schema/queue.json @@ -0,0 +1,226 @@ +{ + "contract_name": "queue", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_ExecuteMsg", + "type": "enum", + "cases": { + "dequeue": { + "type": "named", + "properties": {} + }, + "enqueue": { + "type": "named", + "properties": { + "value": { + "value": 1 + } + } + } + } + }, + { + "name": "i32", + "type": "integer", + "precision": 32, + "signed": true + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_QueryMsg", + "type": "enum", + "cases": { + "count": { + "type": "named", + "properties": {} + }, + "list": { + "type": "named", + "properties": {} + }, + "open_iterators": { + "description": "Opens the given number of iterators for no reason other than testing.\nReturns and `Empty` response.", + "type": "named", + "properties": { + "count": { + "value": 1 + } + } + }, + "reducer": { + "type": "named", + "properties": {} + }, + "sum": { + "type": "named", + "properties": {} + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] + }, + "migrate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_MigrateMsg", + "type": "struct", + "properties": {} + } + ] + }, + "sudo": null, + "responses": { + "count": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_CountResponse", + "type": "struct", + "properties": { + "count": { + "value": 1 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] + }, + "list": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_ListResponse", + "type": "struct", + "properties": { + "early": { + "description": "List all IDs lower than 0x20", + "value": 2 + }, + "empty": { + "description": "List an empty range, both bounded", + "value": 2 + }, + "late": { + "description": "List all IDs starting from 0x20", + "value": 2 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] + }, + "open_iterators": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] + }, + "reducer": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_ReducerResponse", + "type": "struct", + "properties": { + "counters": { + "value": 3 + } + } + }, + { + "name": "i32", + "type": "integer", + "precision": 32, + "signed": true + }, + { + "name": "(i32, i32)", + "type": "tuple", + "items": [ + 1, + 1 + ] + }, + { + "name": "alloc::vec::Vec<(i32, i32)>", + "type": "array", + "items": 2 + } + ] + }, + "sum": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_SumResponse", + "type": "struct", + "properties": { + "sum": { + "value": 1 + } + } + }, + { + "name": "i32", + "type": "integer", + "precision": 32, + "signed": true + } + ] + } + } +} diff --git a/contracts/queue/schema/cw_schema/raw/execute.json b/contracts/queue/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..ea1ebbc4e9 --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/execute.json @@ -0,0 +1,30 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_ExecuteMsg", + "type": "enum", + "cases": { + "dequeue": { + "type": "named", + "properties": {} + }, + "enqueue": { + "type": "named", + "properties": { + "value": { + "value": 1 + } + } + } + } + }, + { + "name": "i32", + "type": "integer", + "precision": 32, + "signed": true + } + ] +} diff --git a/contracts/queue/schema/cw_schema/raw/instantiate.json b/contracts/queue/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..28d9ee2033 --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,11 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/queue/schema/cw_schema/raw/migrate.json b/contracts/queue/schema/cw_schema/raw/migrate.json new file mode 100644 index 0000000000..e4ed816552 --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/migrate.json @@ -0,0 +1,11 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_MigrateMsg", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/queue/schema/cw_schema/raw/query.json b/contracts/queue/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..b5d2f0d1b1 --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/query.json @@ -0,0 +1,43 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_QueryMsg", + "type": "enum", + "cases": { + "count": { + "type": "named", + "properties": {} + }, + "list": { + "type": "named", + "properties": {} + }, + "open_iterators": { + "description": "Opens the given number of iterators for no reason other than testing.\nReturns and `Empty` response.", + "type": "named", + "properties": { + "count": { + "value": 1 + } + } + }, + "reducer": { + "type": "named", + "properties": {} + }, + "sum": { + "type": "named", + "properties": {} + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] +} diff --git a/contracts/queue/schema/cw_schema/raw/response_to_count.json b/contracts/queue/schema/cw_schema/raw/response_to_count.json new file mode 100644 index 0000000000..7aa40fef5e --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/response_to_count.json @@ -0,0 +1,21 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_CountResponse", + "type": "struct", + "properties": { + "count": { + "value": 1 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] +} diff --git a/contracts/queue/schema/cw_schema/raw/response_to_list.json b/contracts/queue/schema/cw_schema/raw/response_to_list.json new file mode 100644 index 0000000000..554bd3238d --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/response_to_list.json @@ -0,0 +1,35 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_ListResponse", + "type": "struct", + "properties": { + "early": { + "description": "List all IDs lower than 0x20", + "value": 2 + }, + "empty": { + "description": "List an empty range, both bounded", + "value": 2 + }, + "late": { + "description": "List all IDs starting from 0x20", + "value": 2 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 1 + } + ] +} diff --git a/contracts/queue/schema/cw_schema/raw/response_to_open_iterators.json b/contracts/queue/schema/cw_schema/raw/response_to_open_iterators.json new file mode 100644 index 0000000000..feb0a1bf43 --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/response_to_open_iterators.json @@ -0,0 +1,12 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_empty_Empty", + "description": "An empty struct that serves as a placeholder in different places,\nsuch as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but\ncontains no meaningful data. Previously we used enums without cases,\nbut those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/queue/schema/cw_schema/raw/response_to_reducer.json b/contracts/queue/schema/cw_schema/raw/response_to_reducer.json new file mode 100644 index 0000000000..e1726c2671 --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/response_to_reducer.json @@ -0,0 +1,34 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_ReducerResponse", + "type": "struct", + "properties": { + "counters": { + "value": 3 + } + } + }, + { + "name": "i32", + "type": "integer", + "precision": 32, + "signed": true + }, + { + "name": "(i32, i32)", + "type": "tuple", + "items": [ + 1, + 1 + ] + }, + { + "name": "alloc::vec::Vec<(i32, i32)>", + "type": "array", + "items": 2 + } + ] +} diff --git a/contracts/queue/schema/cw_schema/raw/response_to_sum.json b/contracts/queue/schema/cw_schema/raw/response_to_sum.json new file mode 100644 index 0000000000..d5606602d1 --- /dev/null +++ b/contracts/queue/schema/cw_schema/raw/response_to_sum.json @@ -0,0 +1,21 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "queue_msg_SumResponse", + "type": "struct", + "properties": { + "sum": { + "value": 1 + } + } + }, + { + "name": "i32", + "type": "integer", + "precision": 32, + "signed": true + } + ] +} diff --git a/contracts/queue/schema/queue.json b/contracts/queue/schema/queue.json index f46c4f00e1..b0277edb42 100644 --- a/contracts/queue/schema/queue.json +++ b/contracts/queue/schema/queue.json @@ -198,8 +198,9 @@ "open_iterators": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Empty", - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false }, "reducer": { "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/contracts/queue/schema/raw/execute.json b/contracts/queue/schema/raw/execute.json new file mode 100644 index 0000000000..1877209732 --- /dev/null +++ b/contracts/queue/schema/raw/execute.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "enqueue" + ], + "properties": { + "enqueue": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "dequeue" + ], + "properties": { + "dequeue": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/queue/schema/raw/instantiate.json b/contracts/queue/schema/raw/instantiate.json new file mode 100644 index 0000000000..1352613d57 --- /dev/null +++ b/contracts/queue/schema/raw/instantiate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/queue/schema/raw/migrate.json b/contracts/queue/schema/raw/migrate.json new file mode 100644 index 0000000000..7fbe8c5708 --- /dev/null +++ b/contracts/queue/schema/raw/migrate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/queue/schema/raw/query.json b/contracts/queue/schema/raw/query.json new file mode 100644 index 0000000000..3c61d5fc57 --- /dev/null +++ b/contracts/queue/schema/raw/query.json @@ -0,0 +1,82 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "sum" + ], + "properties": { + "sum": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "reducer" + ], + "properties": { + "reducer": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list" + ], + "properties": { + "list": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Opens the given number of iterators for no reason other than testing. Returns and `Empty` response.", + "type": "object", + "required": [ + "open_iterators" + ], + "properties": { + "open_iterators": { + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/queue/schema/raw/response_to_count.json b/contracts/queue/schema/raw/response_to_count.json new file mode 100644 index 0000000000..cf6f1c3cdd --- /dev/null +++ b/contracts/queue/schema/raw/response_to_count.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CountResponse", + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false +} diff --git a/contracts/queue/schema/raw/response_to_list.json b/contracts/queue/schema/raw/response_to_list.json new file mode 100644 index 0000000000..e4da637795 --- /dev/null +++ b/contracts/queue/schema/raw/response_to_list.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListResponse", + "type": "object", + "required": [ + "early", + "empty", + "late" + ], + "properties": { + "early": { + "description": "List all IDs lower than 0x20", + "type": "array", + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "empty": { + "description": "List an empty range, both bounded", + "type": "array", + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "late": { + "description": "List all IDs starting from 0x20", + "type": "array", + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "additionalProperties": false +} diff --git a/contracts/queue/schema/raw/response_to_open_iterators.json b/contracts/queue/schema/raw/response_to_open_iterators.json new file mode 100644 index 0000000000..24261a11f8 --- /dev/null +++ b/contracts/queue/schema/raw/response_to_open_iterators.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Empty", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/queue/schema/raw/response_to_reducer.json b/contracts/queue/schema/raw/response_to_reducer.json new file mode 100644 index 0000000000..612b4029a8 --- /dev/null +++ b/contracts/queue/schema/raw/response_to_reducer.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReducerResponse", + "type": "object", + "required": [ + "counters" + ], + "properties": { + "counters": { + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "integer", + "format": "int32" + } + ], + "maxItems": 2, + "minItems": 2 + } + } + }, + "additionalProperties": false +} diff --git a/contracts/queue/schema/raw/response_to_sum.json b/contracts/queue/schema/raw/response_to_sum.json new file mode 100644 index 0000000000..c8133fe4e0 --- /dev/null +++ b/contracts/queue/schema/raw/response_to_sum.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SumResponse", + "type": "object", + "required": [ + "sum" + ], + "properties": { + "sum": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false +} diff --git a/contracts/queue/examples/schema.rs b/contracts/queue/src/bin/schema.rs similarity index 100% rename from contracts/queue/examples/schema.rs rename to contracts/queue/src/bin/schema.rs diff --git a/contracts/queue/src/contract.rs b/contracts/queue/src/contract.rs index 381ed0fcd6..fe9a4446f6 100644 --- a/contracts/queue/src/contract.rs +++ b/contracts/queue/src/contract.rs @@ -1,6 +1,6 @@ use cosmwasm_std::{ - entry_point, from_slice, to_binary, to_vec, Binary, Deps, DepsMut, Empty, Env, MessageInfo, - Order, QueryResponse, Response, StdResult, Storage, + entry_point, from_json, to_json_binary, to_json_vec, Binary, Deps, DepsMut, Empty, Env, + MessageInfo, Order, QueryResponse, Response, StdResult, Storage, }; use crate::msg::{ @@ -42,16 +42,16 @@ fn handle_enqueue(deps: DepsMut, value: i32) -> StdResult { fn enqueue(storage: &mut dyn Storage, value: i32) -> StdResult<()> { // find the last element in the queue and extract key - let last_item = storage.range(None, None, Order::Descending).next(); + let last_item = storage.range_keys(None, None, Order::Descending).next(); let new_key = match last_item { None => FIRST_KEY, - Some((key, _value)) => { + Some(key) => { let last_key = u32::from_be_bytes(key.try_into().unwrap()); (last_key + 1).to_be_bytes() } }; - let new_value = to_vec(&Item { value })?; + let new_value = to_json_vec(&Item { value })?; storage.set(&new_key, &new_value); Ok(()) @@ -66,18 +66,17 @@ fn handle_dequeue(deps: DepsMut) -> StdResult { if let Some((key, value)) = first { // remove from storage and return old value deps.storage.remove(&key); - res.data = Some(Binary(value)); + res.data = Some(Binary::new(value)); } Ok(res) } -#[cfg_attr(not(feature = "library"), entry_point)] +#[entry_point] pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> StdResult { // clear all let keys: Vec<_> = deps .storage - .range(None, None, Order::Ascending) - .map(|(key, _)| key) + .range_keys(None, None, Order::Ascending) .collect(); for key in keys { deps.storage.remove(&key); @@ -93,24 +92,27 @@ pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> StdResult StdResult { match msg { - QueryMsg::Count {} => to_binary(&query_count(deps)), - QueryMsg::Sum {} => to_binary(&query_sum(deps)?), - QueryMsg::Reducer {} => to_binary(&query_reducer(deps)?), - QueryMsg::List {} => to_binary(&query_list(deps)), - QueryMsg::OpenIterators { count } => to_binary(&query_open_iterators(deps, count)), + QueryMsg::Count {} => to_json_binary(&query_count(deps)), + QueryMsg::Sum {} => to_json_binary(&query_sum(deps)?), + QueryMsg::Reducer {} => to_json_binary(&query_reducer(deps)?), + QueryMsg::List {} => to_json_binary(&query_list(deps)), + QueryMsg::OpenIterators { count } => to_json_binary(&query_open_iterators(deps, count)), } } fn query_count(deps: Deps) -> CountResponse { - let count = deps.storage.range(None, None, Order::Ascending).count() as u32; + let count = deps + .storage + .range_keys(None, None, Order::Ascending) + .count() as u32; CountResponse { count } } fn query_sum(deps: Deps) -> StdResult { let values: StdResult> = deps .storage - .range(None, None, Order::Ascending) - .map(|(_, v)| from_slice(&v)) + .range_values(None, None, Order::Ascending) + .map(from_json) .collect(); let sum = values?.iter().fold(0, |s, v| s + v.value); Ok(SumResponse { sum }) @@ -121,18 +123,18 @@ fn query_reducer(deps: Deps) -> StdResult { // val: StdResult for val in deps .storage - .range(None, None, Order::Ascending) - .map(|(_, v)| from_slice::(&v)) + .range_values(None, None, Order::Ascending) + .map(|v| from_json::(&v)) { // this returns error on parse error let my_val = val?.value; // now, let's do second iterator let sum: i32 = deps .storage - .range(None, None, Order::Ascending) + .range_values(None, None, Order::Ascending) // get value. ignore parse errors, just count as 0 - .map(|(_, v)| { - from_slice::(&v) + .map(|v| { + from_json::(&v) .map(|v| v.value) .expect("error in item") }) @@ -149,18 +151,18 @@ fn query_list(deps: Deps) -> ListResponse { const THRESHOLD: [u8; 4] = [0x00, 0x00, 0x00, 0x20]; let empty: Vec = deps .storage - .range(Some(&THRESHOLD), Some(&THRESHOLD), Order::Ascending) - .map(|(k, _)| u32::from_be_bytes(k.try_into().unwrap())) + .range_keys(Some(&THRESHOLD), Some(&THRESHOLD), Order::Ascending) + .map(|k| u32::from_be_bytes(k.try_into().unwrap())) .collect(); let early: Vec = deps .storage - .range(None, Some(&THRESHOLD), Order::Ascending) - .map(|(k, _)| u32::from_be_bytes(k.try_into().unwrap())) + .range_keys(None, Some(&THRESHOLD), Order::Ascending) + .map(|k| u32::from_be_bytes(k.try_into().unwrap())) .collect(); let late: Vec = deps .storage - .range(Some(&THRESHOLD), None, Order::Ascending) - .map(|(k, _)| u32::from_be_bytes(k.try_into().unwrap())) + .range_keys(Some(&THRESHOLD), None, Order::Ascending) + .map(|k| u32::from_be_bytes(k.try_into().unwrap())) .collect(); ListResponse { empty, early, late } } @@ -177,14 +179,15 @@ fn query_open_iterators(deps: Deps, count: u32) -> Empty { mod tests { use super::*; use cosmwasm_std::testing::{ - mock_dependencies_with_balance, mock_env, mock_info, MockApi, MockQuerier, MockStorage, + message_info, mock_dependencies_with_balance, mock_env, MockApi, MockQuerier, MockStorage, }; - use cosmwasm_std::{coins, from_binary, OwnedDeps}; + use cosmwasm_std::{coins, from_json, OwnedDeps}; /// Instantiates a contract with no elements fn create_contract() -> (OwnedDeps, MessageInfo) { let mut deps = mock_dependencies_with_balance(&coins(1000, "earth")); - let info = mock_info("creator", &coins(1000, "earth")); + let creator = deps.api.addr_make("creator"); + let info = message_info(&creator, &coins(1000, "earth")); let res = instantiate(deps.as_mut(), mock_env(), info.clone(), InstantiateMsg {}).unwrap(); assert_eq!(0, res.messages.len()); (deps, info) @@ -268,7 +271,7 @@ mod tests { // ensure we popped properly assert!(res.data.is_some()); let data = res.data.unwrap(); - let state: Item = from_slice(data.as_slice()).unwrap(); + let state: Item = from_json(data.as_slice()).unwrap(); assert_eq!(state.value, 25); assert_eq!(get_count(deps.as_ref()), 1); @@ -338,7 +341,7 @@ mod tests { let query_msg = QueryMsg::List {}; let ids: ListResponse = - from_binary(&query(deps.as_ref(), mock_env(), query_msg).unwrap()).unwrap(); + from_json(query(deps.as_ref(), mock_env(), query_msg).unwrap()).unwrap(); assert_eq!(ids.empty, Vec::::new()); assert_eq!(ids.early, vec![0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f]); assert_eq!(ids.late, vec![0x20, 0x21, 0x22, 0x23, 0x24]); diff --git a/contracts/queue/tests/integration.rs b/contracts/queue/tests/integration.rs index 98a5b21f54..4d64eaa5c0 100644 --- a/contracts/queue/tests/integration.rs +++ b/contracts/queue/tests/integration.rs @@ -1,23 +1,8 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests as follows: -//! 1. Copy them over verbatim -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) - -use cosmwasm_std::{from_binary, from_slice, MessageInfo, Response}; + +use cosmwasm_std::{from_json, MessageInfo, Response}; use cosmwasm_vm::{ testing::{ execute, instantiate, migrate, mock_env, mock_info, mock_instance_with_gas_limit, query, @@ -36,7 +21,7 @@ static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/qu /// Instantiates a contract with no elements fn create_contract() -> (Instance, MessageInfo) { - let gas_limit = 1_000_000_000_000; // ~1ms, enough for many executions within one instance + let gas_limit = 1_000_000_000; // ~1ms, enough for many executions within one instance let mut deps = mock_instance_with_gas_limit(WASM, gas_limit); let creator = String::from("creator"); let info = mock_info(&creator, &[]); @@ -48,13 +33,13 @@ fn create_contract() -> (Instance, MessageInf fn get_count(deps: &mut Instance) -> u32 { let data = query(deps, mock_env(), QueryMsg::Count {}).unwrap(); - let res: CountResponse = from_binary(&data).unwrap(); + let res: CountResponse = from_json(data).unwrap(); res.count } fn get_sum(deps: &mut Instance) -> i32 { let data = query(deps, mock_env(), QueryMsg::Sum {}).unwrap(); - let res: SumResponse = from_binary(&data).unwrap(); + let res: SumResponse = from_json(data).unwrap(); res.sum } @@ -128,7 +113,7 @@ fn push_and_pop() { // ensure we popped properly assert!(res.data.is_some()); let data = res.data.unwrap(); - let item: Item = from_slice(data.as_slice()).unwrap(); + let item: Item = from_json(data).unwrap(); assert_eq!(item.value, 25); assert_eq!(get_count(&mut deps), 1); @@ -169,7 +154,7 @@ fn push_and_reduce() { assert_eq!(get_count(&mut deps), 4); assert_eq!(get_sum(&mut deps), 130); let data = query(&mut deps, mock_env(), QueryMsg::Reducer {}).unwrap(); - let counters = from_binary::(&data).unwrap().counters; + let counters = from_json::(&data).unwrap().counters; assert_eq!(counters, vec![(40, 85), (15, 125), (85, 0), (-10, 140)]); } @@ -223,7 +208,7 @@ fn query_list() { // since we count up to 0x20 in early, we get early and late both with data let query_msg = QueryMsg::List {}; - let ids: ListResponse = from_binary(&query(&mut deps, mock_env(), query_msg).unwrap()).unwrap(); + let ids: ListResponse = from_json(query(&mut deps, mock_env(), query_msg).unwrap()).unwrap(); assert_eq!(ids.empty, Vec::::new()); assert_eq!(ids.early, vec![0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f]); assert_eq!(ids.late, vec![0x20, 0x21, 0x22, 0x23, 0x24]); diff --git a/contracts/reflect/.cargo/config b/contracts/reflect/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/reflect/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/reflect/.cargo/config.toml b/contracts/reflect/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/reflect/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/reflect/Cargo.lock b/contracts/reflect/Cargo.lock index 10257afce6..807fdd8680 100644 --- a/contracts/reflect/Cargo.lock +++ b/contracts/reflect/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,118 +17,349 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "base64ct" -version = "1.5.0" +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -136,55 +367,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -192,204 +462,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -406,98 +605,196 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "darling" -version = "0.13.0" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "darling_core", - "darling_macro", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +name = "cw-schema" +version = "3.0.3-dev" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", ] [[package]] -name = "darling_macro" -version = "0.13.0" +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -505,13 +802,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -522,57 +819,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -595,46 +912,110 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -642,97 +1023,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -746,230 +1132,520 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "k256" -version = "0.11.3" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "quote", - "syn", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "mach" -version = "0.3.2" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.59.0", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "adler", - "autocfg", + "either", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "hermit-abi", - "libc", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.25.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "memchr", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", ] [[package]] name = "object" -version = "0.28.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.11.2", + "flate2", + "hashbrown 0.14.5", "indexmap", "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.8.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "pkcs8" -version = "0.9.0" +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "der", - "spki", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro-error" @@ -980,7 +1656,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -995,13 +1671,35 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1010,7 +1708,16 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "ptr_meta_derive", + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", ] [[package]] @@ -1021,28 +1728,46 @@ checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", "rand_chacha", - "rand_core 0.6.3", - "rand_hc", + "rand_core", ] [[package]] @@ -1052,68 +1777,65 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core", ] [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.1.16", + "getrandom", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "getrandom 0.2.3", + "either", + "rayon-core", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "rand_core 0.6.3", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "bitflags 2.5.0", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "ref-cast-impl", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ - "bitflags", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] @@ -1122,95 +1844,143 @@ version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cosmwasm-vm", - "schemars", + "schemars 0.8.21", "serde", "thiserror", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "region" -version = "3.0.0" +name = "regex-automata" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ - "winapi", + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", ] [[package]] name = "rend" -version = "0.3.6" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" dependencies = [ - "bytecheck", + "bytecheck 0.8.0", ] [[package]] name = "rfc6979" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] name = "rkyv" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", "rend", "rkyv_derive", - "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.36" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", ] [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1218,178 +1988,295 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schemars" -version = "0.8.6" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" dependencies = [ "dyn-clone", - "schemars_derive", + "ref-cast", + "schemars_derive 1.0.4", "serde", "serde_json", ] [[package]] name = "schemars_derive" -version = "0.8.6" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.87", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "schemars_derive" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", "generic-array", - "pkcs8", "subtle", "zeroize", ] [[package]] -name = "serde" -version = "1.0.103" +name = "self_cell" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" -dependencies = [ - "serde_derive", -] +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ - "serde", + "serde_derive", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "serde-wasm-bindgen" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" dependencies = [ + "js-sys", "serde", + "wasm-bindgen", ] [[package]] name = "serde_derive" -version = "1.0.103" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_derive_internals" -version = "0.25.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "serde_with" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "sha2" -version = "0.10.3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "cpufeatures", + "digest", ] [[package]] -name = "signature" -version = "1.5.0" +name = "shared-buffer" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "bytes", + "memmap2 0.6.2", ] [[package]] -name = "smallvec" -version = "1.6.1" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "spki" -version = "0.6.0" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "base64ct", - "der", + "digest", + "rand_core", ] +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1404,147 +2291,285 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "target-lexicon" -version = "0.12.2" +name = "syn" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "tempfile" -version = "3.2.0" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" -dependencies = [ - "thiserror-impl", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1552,24 +2577,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1577,113 +2602,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1693,252 +2700,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/reflect/Cargo.toml b/contracts/reflect/Cargo.toml index eab872fe3e..f9defb56fc 100644 --- a/contracts/reflect/Cargo.toml +++ b/contracts/reflect/Cargo.toml @@ -2,13 +2,11 @@ name = "reflect" version = "0.0.0" authors = ["Ethan Frey "] +description = "Reflect messages to use for test cases - based on cw-mask" edition = "2021" publish = false -description = "Reflect messages to use for test cases - based on cw-mask" license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -23,22 +21,12 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# for quicker tests, cargo test --lib -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["staking", "stargate", "cosmwasm_1_1"] } -cosmwasm-storage = { path = "../../packages/storage", default-features = false } -schemars = "0.8.3" -serde = { version = "=1.0.103", default-features = false, features = ["derive"] } -thiserror = "1.0" +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["cosmwasm_2_2", "exports", "staking", "stargate", "std"] } +schemars = "0.8.12" +serde = { version = "1.0.103", default-features = false, features = ["derive"] } +thiserror = "1.0.26" [dev-dependencies] cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["stargate"] } diff --git a/contracts/reflect/LICENSE b/contracts/reflect/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/contracts/reflect/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/contracts/reflect/NOTICE b/contracts/reflect/NOTICE deleted file mode 100644 index b8f34a8f13..0000000000 --- a/contracts/reflect/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2020 Ethan Frey - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/contracts/reflect/README.md b/contracts/reflect/README.md index 12d559bade..49897f0122 100644 --- a/contracts/reflect/README.md +++ b/contracts/reflect/README.md @@ -29,12 +29,12 @@ cargo generate --git https://github.com/confio/cosmwasm-template.git --name YOUR ``` You will now have a new folder called `YOUR_NAME_HERE` (I hope you changed that -to something else) containing a simple working contract and build system that +to something else) containing a simple working contract and a build system that you can customize. ## Create a Repo -After generating, you have a initialized local git repo, but no commits, and no +After generating, you have an initialized local git repo, but no commits, and no remote. Go to a server (eg. github) and create a new upstream repo (called `YOUR-GIT-URL` below). Then run the following: @@ -49,8 +49,8 @@ git push -u origin main ## CI Support -We have templates for both github actions and Circle CI in the generated -project, so you can get up an running with CI right away. One note is that the +We have templates for both GitHub actions and Circle CI in the generated +project, so you can get up and running with CI right away. One note is that the CI runs all `cargo` commands with `--locked` to ensure it uses the exact same versions as you have locally. This also means you must have an up-to-date `Cargo.lock` file, which is not auto-generated. @@ -63,9 +63,8 @@ be done simply by running `cargo check` or `cargo unit-test` Once you have your custom repo, you should check out [Developing](./Developing.md) to explain more on how to run tests and develop -code. Or go through the -[online tutorial](https://www.cosmwasm.com/docs/getting-started/intro) to get a -better feel of how to develop. +code. Or go through the [online tutorial](https://book.cosmwasm.com/index.html) +to get a better feel of how to develop. [Publishing](./Publishing.md) contains useful information on how to publish your contract to the world, once you are ready to deploy it on a running blockchain. @@ -73,5 +72,5 @@ And [Importing](./Importing.md) contains information about pulling in other contracts or crates that have been published. Please replace this README file with information about your specific project. -You can keep the `Developing.md` and `Publishing.md` files as useful referenced, +You can keep the `Developing.md` and `Publishing.md` files as useful references, but please set some proper description in the README. diff --git a/contracts/reflect/rustfmt.toml b/contracts/reflect/rustfmt.toml deleted file mode 100644 index 11a85e6a9c..0000000000 --- a/contracts/reflect/rustfmt.toml +++ /dev/null @@ -1,15 +0,0 @@ -# stable -newline_style = "unix" -hard_tabs = false -tab_spaces = 4 - -# unstable... should we require `rustup run nightly cargo fmt` ? -# or just update the style guide when they are stable? -#fn_single_line = true -#format_code_in_doc_comments = true -#overflow_delimited_expr = true -#reorder_impl_items = true -#struct_field_align_threshold = 20 -#struct_lit_single_line = true -#report_todo = "Always" - diff --git a/contracts/reflect/schema/cw_schema/raw/execute.json b/contracts/reflect/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..ea452d4684 --- /dev/null +++ b/contracts/reflect/schema/cw_schema/raw/execute.json @@ -0,0 +1,666 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_ExecuteMsg", + "type": "enum", + "cases": { + "change_owner": { + "type": "named", + "properties": { + "owner": { + "value": 3 + } + } + }, + "reflect_msg": { + "type": "named", + "properties": { + "msgs": { + "value": 27 + } + } + }, + "reflect_sub_msg": { + "type": "named", + "properties": { + "msgs": { + "value": 31 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_CosmosMsg_reflect_msg_CustomMsg_", + "type": "enum", + "cases": { + "any": { + "description": "`CosmosMsg::Any` replaces the \"stargate message\" – a message wrapped\nin a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any)\nthat is supported by the chain. It behaves the same as\n`CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because\na chain running CosmWasm < 2.0 cannot process this.", + "type": "tuple", + "items": [ + 11 + ] + }, + "bank": { + "type": "tuple", + "items": [ + 2 + ] + }, + "custom": { + "type": "tuple", + "items": [ + 7 + ] + }, + "distribution": { + "type": "tuple", + "items": [ + 10 + ] + }, + "gov": { + "type": "tuple", + "items": [ + 22 + ] + }, + "ibc": { + "type": "tuple", + "items": [ + 12 + ] + }, + "staking": { + "type": "tuple", + "items": [ + 9 + ] + }, + "stargate": { + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "named", + "properties": { + "type_url": { + "value": 3 + }, + "value": { + "value": 8 + } + } + }, + "wasm": { + "type": "tuple", + "items": [ + 21 + ] + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_BankMsg", + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "type": "enum", + "cases": { + "burn": { + "description": "This will burn the given coins from the contract's account.\nThere is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper.\nImportant if a contract controls significant token supply that must be retired.", + "type": "named", + "properties": { + "amount": { + "value": 6 + } + } + }, + "send": { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28).\n`from_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 6 + }, + "to_address": { + "value": 3 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 5 + }, + "denom": { + "value": 3 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 4 + }, + { + "name": "reflect_msg_CustomMsg", + "description": "CustomMsg is an override of CosmosMsg::Custom to show this works and can be extended in the contract", + "type": "enum", + "cases": { + "debug": { + "type": "tuple", + "items": [ + 3 + ] + }, + "raw": { + "type": "tuple", + "items": [ + 8 + ] + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_results_cosmos_msg_StakingMsg", + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "type": "enum", + "cases": { + "delegate": { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "validator": { + "value": 3 + } + } + }, + "redelegate": { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "dst_validator": { + "value": 3 + }, + "src_validator": { + "value": 3 + } + } + }, + "undelegate": { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "validator": { + "value": 3 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_DistributionMsg", + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "type": "enum", + "cases": { + "fund_community_pool": { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2).\n`depositor` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "description": "The amount to spend", + "value": 6 + } + } + }, + "set_withdraw_address": { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "address": { + "description": "The `withdraw_address`", + "value": 3 + } + } + }, + "withdraw_delegator_reward": { + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "validator": { + "description": "The `validator_address`", + "value": 3 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_AnyMsg", + "description": "A message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto).\nThis is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "struct", + "properties": { + "type_url": { + "value": 3 + }, + "value": { + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcMsg", + "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts\n(contracts that directly speak the IBC protocol via 6 entry points)", + "type": "enum", + "cases": { + "close_channel": { + "description": "This will close an existing channel that is owned by this contract.\nPort is auto-assigned to the contract's IBC port", + "type": "named", + "properties": { + "channel_id": { + "value": 3 + } + } + }, + "send_packet": { + "description": "Sends an IBC packet with given data over the existing channel.\nData should be encoded in a format defined by the channel version,\nand the module on the other side should know how to parse this.", + "type": "named", + "properties": { + "channel_id": { + "value": 3 + }, + "data": { + "value": 8 + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "value": 13 + } + } + }, + "transfer": { + "description": "Sends bank tokens owned by the contract to the given address on another chain.\nThe channel must already be established between the ibctransfer module on this chain\nand a matching module on the remote chain.\nWe cannot select the port_id, this is whatever the local chain has bound the ibctransfer\nmodule to.", + "type": "named", + "properties": { + "amount": { + "description": "packet data only supports one coin\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", + "value": 4 + }, + "channel_id": { + "description": "existing channel to send the tokens over", + "value": 3 + }, + "memo": { + "description": "An optional memo. See the blog post\n[\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b)\nfor more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently\nignored on older chains.\nIf you need support for both 1.x and 2.x chain with the same codebase,\nit is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer\nprotobuf encoder instead.", + "value": 19 + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "value": 13 + }, + "to_address": { + "description": "address on the remote chain to receive these tokens", + "value": 3 + } + } + }, + "write_acknowledgement": { + "description": "Acknowledges a packet that this contract received over IBC.\nThis allows acknowledging a packet that was not acknowledged yet in the `ibc_packet_receive` call.", + "type": "named", + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "value": 20 + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "value": 3 + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "value": 15 + } + } + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeout", + "description": "In IBC each package must set at least one type of timeout:\nthe timestamp or the block height. Using this rather complex enum instead of\ntwo timeout fields we ensure that at least one timeout is set.", + "type": "struct", + "properties": { + "block": { + "value": 16 + }, + "timestamp": { + "value": 18 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeoutBlock", + "description": "IBCTimeoutHeight Height is a monotonically increasing data type\nthat can be compared against another Height for the purposes of updating and\nfreezing clients.\nOrdering is (revision_number, timeout_height)", + "type": "struct", + "properties": { + "height": { + "description": "block height after which the packet times out.\nthe height within the given revision", + "value": 15 + }, + "revision": { + "description": "the version that the client is currently on\n(e.g. after resetting the chain this could increment 1 as height drops to 0)", + "value": 15 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 14 + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 17 + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 3 + }, + { + "name": "cosmwasm_std_ibc_IbcAcknowledgement", + "type": "struct", + "properties": { + "data": { + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_WasmMsg", + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "type": "enum", + "cases": { + "clear_admin": { + "description": "Clears the admin on the given contract, so no more migration possible.\nFails if this contract is not currently admin of the target contract.", + "type": "named", + "properties": { + "contract_addr": { + "value": 3 + } + } + }, + "execute": { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "contract_addr": { + "value": 3 + }, + "funds": { + "value": 6 + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "value": 8 + } + } + }, + "instantiate": { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that\nwhen emitting the same Instantiate message multiple times,\nmultiple instances on different addresses will be generated. See also\nInstantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "admin": { + "value": 19 + }, + "code_id": { + "value": 15 + }, + "funds": { + "value": 6 + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should:\n- not be empty\n- not be bigger than 128 bytes (or some chain-specific limit)\n- not start / end with whitespace", + "value": 3 + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "value": 8 + } + } + }, + "instantiate2": { + "description": "Instantiates a new contracts from previously uploaded Wasm code\nusing a predictable address derivation algorithm implemented in\n[`cosmwasm_std::instantiate2_address`].\n\nThis is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96).\n`sender` is automatically filled with the current contract's address.\n`fix_msg` is automatically set to false.", + "type": "named", + "properties": { + "admin": { + "value": 19 + }, + "code_id": { + "value": 15 + }, + "funds": { + "value": 6 + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should:\n- not be empty\n- not be bigger than 128 bytes (or some chain-specific limit)\n- not start / end with whitespace", + "value": 3 + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "value": 8 + }, + "salt": { + "value": 8 + } + } + }, + "migrate": { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to\ncustomize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "contract_addr": { + "value": 3 + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "value": 8 + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "value": 15 + } + } + }, + "update_admin": { + "description": "Sets a new admin (for migrate) on the given contract.\nFails if this contract is not currently admin of the target contract.", + "type": "named", + "properties": { + "admin": { + "value": 3 + }, + "contract_addr": { + "value": 3 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_GovMsg", + "description": "This message type allows the contract interact with the [x/gov] module in order\nto cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n```\n# use cosmwasm_std::{\n# HexBinary,\n# Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo,\n# Response, QueryResponse,\n# };\n# type ExecuteMsg = ();\nuse cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point]\npub fn execute(\ndeps: DepsMut,\nenv: Env,\ninfo: MessageInfo,\nmsg: ExecuteMsg,\n) -> Result {\n// ...\nOk(Response::new().add_message(GovMsg::Vote {\nproposal_id: 4,\noption: VoteOption::Yes,\n}))\n}\n```\n\nCast a weighted vote:\n\n```\n# use cosmwasm_std::{\n# HexBinary,\n# Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo,\n# Response, QueryResponse,\n# };\n# type ExecuteMsg = ();\n# #[cfg(feature = \"cosmwasm_1_2\")]\nuse cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")]\n#[entry_point]\npub fn execute(\ndeps: DepsMut,\nenv: Env,\ninfo: MessageInfo,\nmsg: ExecuteMsg,\n) -> Result {\n// ...\nOk(Response::new().add_message(GovMsg::VoteWeighted {\nproposal_id: 4,\noptions: vec![\nWeightedVoteOption {\noption: VoteOption::Yes,\nweight: Decimal::percent(65),\n},\nWeightedVoteOption {\noption: VoteOption::Abstain,\nweight: Decimal::percent(35),\n},\n],\n}))\n}\n```", + "type": "enum", + "cases": { + "vote": { + "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", + "type": "named", + "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "value": 23 + }, + "proposal_id": { + "value": 15 + } + } + }, + "vote_weighted": { + "description": "This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address.", + "type": "named", + "properties": { + "options": { + "value": 26 + }, + "proposal_id": { + "value": 15 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_VoteOption", + "type": "enum", + "cases": { + "abstain": { + "type": "unit" + }, + "no": { + "type": "unit" + }, + "no_with_veto": { + "type": "unit" + }, + "yes": { + "type": "unit" + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_WeightedVoteOption", + "type": "struct", + "properties": { + "option": { + "value": 23 + }, + "weight": { + "value": 25 + } + } + }, + { + "name": "cosmwasm_std_math_decimal_Decimal", + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "decimal", + "precision": 128, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 24 + }, + { + "name": "alloc::vec::Vec>", + "type": "array", + "items": 1 + }, + { + "name": "cosmwasm_std_results_submessages_SubMsg_reflect_msg_CustomMsg_", + "description": "A submessage that will guarantee a `reply` call on success or error, depending on\nthe `reply_on` setting. If you do not need to process the result, use regular messages instead.\n\nNote: On error the submessage execution will revert any partial state changes due to this message,\nbut not revert any state changes in the calling contract. If this is required, it must be done\nmanually in the `reply` entry point.", + "type": "struct", + "properties": { + "gas_limit": { + "description": "Gas limit measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).\n\nSetting this to `None` means unlimited. Then the submessage execution can consume all gas of the\ncurrent execution context.", + "value": 29 + }, + "id": { + "description": "An arbitrary ID chosen by the contract.\nThis is typically used to match `Reply`s in the `reply` entry point to the submessage.", + "value": 15 + }, + "msg": { + "value": 1 + }, + "payload": { + "defaulting": true, + "description": "Some arbitrary data that the contract can set in an application specific way.\nThis is just passed into the `reply` entry point and is not stored to state.\nAny encoding can be used. If `id` is used to identify a particular action,\nthe encoding can also be different for each of those actions since you can match `id`\nfirst and then start processing the `payload`.\n\nThe environment restricts the length of this field in order to avoid abuse. The limit\nis environment specific and can change over time. The initial default is 128 KiB.\n\nUnset/nil/null cannot be differentiated from empty data.\n\nOn chains running CosmWasm 1.x this field will be ignored.", + "value": 8 + }, + "reply_on": { + "value": 30 + } + } + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 15 + }, + { + "name": "cosmwasm_std_results_submessages_ReplyOn", + "description": "Use this to define when the contract gets a response callback.\nIf you only need it for errors or success you can select just those in order\nto save gas.", + "type": "enum", + "cases": { + "always": { + "description": "Always perform a callback after SubMsg is processed", + "type": "unit" + }, + "error": { + "description": "Only callback if SubMsg returned an error, no callback on success case", + "type": "unit" + }, + "never": { + "description": "Never make a callback - this is like the original CosmosMsg semantics", + "type": "unit" + }, + "success": { + "description": "Only callback if SubMsg was successful, no callback on error case", + "type": "unit" + } + } + }, + { + "name": "alloc::vec::Vec>", + "type": "array", + "items": 28 + } + ] +} diff --git a/contracts/reflect/schema/cw_schema/raw/instantiate.json b/contracts/reflect/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..1ed35a6dcc --- /dev/null +++ b/contracts/reflect/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,11 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/reflect/schema/cw_schema/raw/query.json b/contracts/reflect/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..225eab50c4 --- /dev/null +++ b/contracts/reflect/schema/cw_schema/raw/query.json @@ -0,0 +1,418 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_QueryMsg", + "type": "enum", + "cases": { + "capitalized": { + "description": "This will call out to SpecialQuery::Capitalized", + "type": "named", + "properties": { + "text": { + "value": 1 + } + } + }, + "chain": { + "description": "Queries the blockchain and returns the result untouched", + "type": "named", + "properties": { + "request": { + "value": 2 + } + } + }, + "owner": { + "type": "named", + "properties": {} + }, + "raw": { + "description": "Queries another contract and returns the data", + "type": "named", + "properties": { + "contract": { + "value": 1 + }, + "key": { + "value": 5 + } + } + }, + "sub_msg_result": { + "description": "If there was a previous ReflectSubMsg with this ID, returns cosmwasm_std::Reply", + "type": "named", + "properties": { + "id": { + "value": 16 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_query_QueryRequest_reflect_msg_SpecialQuery_", + "type": "enum", + "cases": { + "bank": { + "type": "tuple", + "items": [ + 3 + ] + }, + "custom": { + "type": "tuple", + "items": [ + 10 + ] + }, + "distribution": { + "type": "tuple", + "items": [ + 12 + ] + }, + "grpc": { + "type": "tuple", + "items": [ + 17 + ] + }, + "ibc": { + "type": "tuple", + "items": [ + 13 + ] + }, + "staking": { + "type": "tuple", + "items": [ + 11 + ] + }, + "stargate": { + "description": "A Stargate query is encoded the same way as abci_query, with path and protobuf encoded request data.\nThe format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md).\nThe response is protobuf encoded data directly without a JSON response wrapper.\nThe caller is responsible for compiling the proper protobuf definitions for both requests and responses.", + "type": "named", + "properties": { + "data": { + "description": "this is the expected protobuf message type (not any), binary encoded", + "value": 5 + }, + "path": { + "description": "this is the fully qualified service path used for routing,\neg. \"/cosmos_sdk.x.bank.v1.Query/QueryBalance\"", + "value": 1 + } + } + }, + "wasm": { + "type": "tuple", + "items": [ + 15 + ] + } + } + }, + { + "name": "cosmwasm_std_query_bank_BankQuery", + "type": "enum", + "cases": { + "all_denom_metadata": { + "description": "This calls into the native bank module for querying metadata for all bank tokens that have a metadata entry.\nReturn value is AllDenomMetadataResponse", + "type": "named", + "properties": { + "pagination": { + "value": 9 + } + } + }, + "balance": { + "description": "This calls into the native bank module for one denomination\nReturn value is BalanceResponse", + "type": "named", + "properties": { + "address": { + "value": 1 + }, + "denom": { + "value": 1 + } + } + }, + "denom_metadata": { + "description": "This calls into the native bank module for querying metadata for a specific bank token.\nReturn value is DenomMetadataResponse", + "type": "named", + "properties": { + "denom": { + "value": 1 + } + } + }, + "supply": { + "description": "This calls into the native bank module for querying the total supply of one denomination.\nIt does the same as the SupplyOf call in Cosmos SDK's RPC API.\nReturn value is of type SupplyResponse.", + "type": "named", + "properties": { + "denom": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_pagination_PageRequest", + "description": "Simplified version of the PageRequest type for pagination from the cosmos-sdk", + "type": "struct", + "properties": { + "key": { + "value": 6 + }, + "limit": { + "value": 7 + }, + "reverse": { + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 5 + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "bool", + "type": "boolean" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 4 + }, + { + "name": "reflect_msg_SpecialQuery", + "description": "An implementation of QueryRequest::Custom to show this works and can be extended in the contract", + "type": "enum", + "cases": { + "capitalized": { + "type": "named", + "properties": { + "text": { + "value": 1 + } + } + }, + "ping": { + "type": "named", + "properties": {} + } + } + }, + { + "name": "cosmwasm_std_query_staking_StakingQuery", + "type": "enum", + "cases": { + "all_delegations": { + "description": "AllDelegations will return all delegations by the delegator", + "type": "named", + "properties": { + "delegator": { + "value": 1 + } + } + }, + "all_validators": { + "description": "Returns all validators in the currently active validator set.\n\nThe query response type is `AllValidatorsResponse`.", + "type": "named", + "properties": {} + }, + "bonded_denom": { + "description": "Returns the denomination that can be bonded (if there are multiple native tokens on the chain)", + "type": "named", + "properties": {} + }, + "delegation": { + "description": "Delegation will return more detailed info on a particular\ndelegation, defined by delegator/validator pair", + "type": "named", + "properties": { + "delegator": { + "value": 1 + }, + "validator": { + "value": 1 + } + } + }, + "validator": { + "description": "Returns the validator at the given address. Returns None if the validator is\nnot part of the currently active validator set.\n\nThe query response type is `ValidatorResponse`.", + "type": "named", + "properties": { + "address": { + "description": "The validator's address (e.g. cosmosvaloper1...)", + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_query_distribution_DistributionQuery", + "type": "enum", + "cases": { + "delegation_rewards": { + "description": "See ", + "type": "named", + "properties": { + "delegator_address": { + "value": 1 + }, + "validator_address": { + "value": 1 + } + } + }, + "delegation_total_rewards": { + "description": "See ", + "type": "named", + "properties": { + "delegator_address": { + "value": 1 + } + } + }, + "delegator_validators": { + "description": "See ", + "type": "named", + "properties": { + "delegator_address": { + "value": 1 + } + } + }, + "delegator_withdraw_address": { + "description": "See ", + "type": "named", + "properties": { + "delegator_address": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_query_ibc_IbcQuery", + "description": "These are queries to the various IBC modules to see the state of the contract's\nIBC connection.\nMost of these will return errors if the contract is not \"ibc enabled\".", + "type": "enum", + "cases": { + "channel": { + "description": "Lists all information for a (portID, channelID) pair.\nIf port_id is omitted, it will default to the contract's own channel.\n(To save a PortId{} call)\n\nReturns a `ChannelResponse`.", + "type": "named", + "properties": { + "channel_id": { + "value": 1 + }, + "port_id": { + "value": 14 + } + } + }, + "port_id": { + "description": "Gets the Port ID the current contract is bound to.\n\nReturns a `PortIdResponse`.", + "type": "named", + "properties": {} + } + } + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 1 + }, + { + "name": "cosmwasm_std_query_wasm_WasmQuery", + "type": "enum", + "cases": { + "code_info": { + "description": "Returns a [`CodeInfoResponse`] with metadata of the code", + "type": "named", + "properties": { + "code_id": { + "value": 16 + } + } + }, + "contract_info": { + "description": "Returns a [`ContractInfoResponse`] with metadata on the contract from the runtime", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + } + } + }, + "raw": { + "description": "this queries the raw kv-store of the contract.\nreturns the raw, unparsed data stored at that key, which may be an empty vector if not present", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + }, + "key": { + "description": "Key is the raw key used in the contracts Storage", + "value": 5 + } + } + }, + "smart": { + "description": "this queries the public API of another contract at a known address (with known ABI)\nReturn value is whatever the contract returns (caller should know), wrapped in a\nContractResult that is JSON encoded.", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + }, + "msg": { + "description": "msg is the json-encoded QueryMsg struct", + "value": 5 + } + } + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_query_GrpcQuery", + "description": "Queries the chain using a grpc query.\nThis allows to query information that is not exposed in our API.\nThe chain needs to allowlist the supported queries.\nThe drawback of this query is that you have to handle the protobuf encoding and decoding yourself.\n\nThe returned data is protobuf encoded. The protobuf type depends on the query.\nBecause of this, using it with the [`query`](crate::QuerierWrapper::query) function will result\nin a deserialization error.\nUse [`raw_query`](crate::Querier::raw_query) or [`query_grpc`](crate::QuerierWrapper::query_grpc)\ninstead.\n\nTo find the path, as well as the request and response types,\nyou can query the chain's gRPC endpoint using a tool like\n[grpcurl](https://github.com/fullstorydev/grpcurl).", + "type": "struct", + "properties": { + "data": { + "description": "The expected protobuf message type (not [Any](https://protobuf.dev/programming-guides/proto3/#any)), binary encoded", + "value": 5 + }, + "path": { + "description": "The fully qualified endpoint path used for routing.\nIt follows the format `/service_path/method_name`,\neg. \"/cosmos.authz.v1beta1.Query/Grants\"", + "value": 1 + } + } + } + ] +} diff --git a/contracts/reflect/schema/cw_schema/raw/response_to_capitalized.json b/contracts/reflect/schema/cw_schema/raw/response_to_capitalized.json new file mode 100644 index 0000000000..fc0f99d231 --- /dev/null +++ b/contracts/reflect/schema/cw_schema/raw/response_to_capitalized.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_CapitalizedResponse", + "type": "struct", + "properties": { + "text": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/reflect/schema/cw_schema/raw/response_to_chain.json b/contracts/reflect/schema/cw_schema/raw/response_to_chain.json new file mode 100644 index 0000000000..c7a8eea25d --- /dev/null +++ b/contracts/reflect/schema/cw_schema/raw/response_to_chain.json @@ -0,0 +1,20 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_ChainResponse", + "type": "struct", + "properties": { + "data": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + } + ] +} diff --git a/contracts/reflect/schema/cw_schema/raw/response_to_owner.json b/contracts/reflect/schema/cw_schema/raw/response_to_owner.json new file mode 100644 index 0000000000..64bbcdad55 --- /dev/null +++ b/contracts/reflect/schema/cw_schema/raw/response_to_owner.json @@ -0,0 +1,19 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_OwnerResponse", + "type": "struct", + "properties": { + "owner": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/reflect/schema/cw_schema/raw/response_to_raw.json b/contracts/reflect/schema/cw_schema/raw/response_to_raw.json new file mode 100644 index 0000000000..24ff92bef1 --- /dev/null +++ b/contracts/reflect/schema/cw_schema/raw/response_to_raw.json @@ -0,0 +1,21 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_RawResponse", + "type": "struct", + "properties": { + "data": { + "description": "The returned value of the raw query. Empty data can be the\nresult of a non-existent key or an empty value. We cannot\ndifferentiate those two cases in cross contract queries.", + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + } + ] +} diff --git a/contracts/reflect/schema/cw_schema/raw/response_to_sub_msg_result.json b/contracts/reflect/schema/cw_schema/raw/response_to_sub_msg_result.json new file mode 100644 index 0000000000..81a0b77fc1 --- /dev/null +++ b/contracts/reflect/schema/cw_schema/raw/response_to_sub_msg_result.json @@ -0,0 +1,144 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_submessages_Reply", + "description": "The result object returned to `reply`. We always get the ID from the submessage\nback and then must handle success and error cases ourselves.", + "type": "struct", + "properties": { + "gas_used": { + "defaulting": true, + "description": "The amount of gas used by the submessage,\nmeasured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).\n\nThis only contains a useful value on chains running CosmWasm 2.0 or higher.\nOn older chains, this field is always 0.", + "value": 1 + }, + "id": { + "description": "The ID that the contract set when emitting the `SubMsg`.\nUse this to identify which submessage triggered the `reply`.", + "value": 1 + }, + "payload": { + "defaulting": true, + "description": "Some arbitrary data that the contract set when emitting the `SubMsg`.\nThis is just passed into the `reply` entry point and is not stored to state.\n\nUnset/nil/null cannot be differentiated from empty data.\n\nOn chains running CosmWasm 1.x this field is never filled.", + "value": 2 + }, + "result": { + "value": 3 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_results_submessages_SubMsgResult", + "description": "This is the result type that is returned from a sub message execution.\n\nWe use a custom type here instead of Rust's Result because we want to be able to\ndefine the serialization, which is a public interface. Every language that compiles\nto Wasm and runs in the ComsWasm VM needs to create the same JSON representation.\n\nUntil version 1.0.0-beta5, `ContractResult` was used instead\nof this type. Once serialized, the two types are the same. However, in the Rust type\nsystem we want different types for clarity and documentation reasons.\n\n# Examples\n\nSuccess:\n\n```\n# use cosmwasm_std::{to_json_string, Binary, Event, SubMsgResponse, SubMsgResult};\n#[allow(deprecated)]\nlet response = SubMsgResponse {\ndata: Some(Binary::from_base64(\"MTIzCg==\").unwrap()),\nevents: vec![Event::new(\"wasm\").add_attribute(\"foo\", \"bar\")],\nmsg_responses: vec![],\n};\nlet result: SubMsgResult = SubMsgResult::Ok(response);\nassert_eq!(\nto_json_string(&result).unwrap(),\nr#\"{\"ok\":{\"events\":[{\"type\":\"wasm\",\"attributes\":[{\"key\":\"foo\",\"value\":\"bar\"}]}],\"data\":\"MTIzCg==\",\"msg_responses\":[]}}\"#,\n);\n```\n\nFailure:\n\n```\n# use cosmwasm_std::{to_json_string, SubMsgResult, Response};\nlet error_msg = String::from(\"Something went wrong\");\nlet result = SubMsgResult::Err(error_msg);\nassert_eq!(to_json_string(&result).unwrap(), r#\"{\"error\":\"Something went wrong\"}\"#);\n```", + "type": "enum", + "cases": { + "error": { + "description": "An error type that every custom error created by contract developers can be converted to.\nThis could potentially have more structure, but String is the easiest.", + "type": "tuple", + "items": [ + 6 + ] + }, + "ok": { + "type": "tuple", + "items": [ + 4 + ] + } + } + }, + { + "name": "cosmwasm_std_results_submessages_SubMsgResponse", + "description": "The information we get back from a successful sub message execution", + "type": "struct", + "properties": { + "data": { + "value": 10 + }, + "events": { + "description": "The Cosmos SDK events emitted by the submessage.\n\nThis is only filled if the submessage was itself a [`crate::WasmMsg`].\nThe reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic,\nso the VM only returns events of wasm messages, which we know are deterministic.\n\n[not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events", + "value": 9 + }, + "msg_responses": { + "defaulting": true, + "description": "The responses from the messages emitted by the submessage.\nIn most cases, this is equivalent to the Cosmos SDK's [MsgResponses], which usually contains a [single message].\nHowever, wasmd allows chains to translate a single contract message into multiple SDK messages.\nIn that case all the MsgResponses from each are concatenated into this flattened `Vec`.\n\n[MsgResponses]: https://github.com/cosmos/cosmos-sdk/blob/316750cc8cd8b3296fa233f4da2e39cbcdc34517/proto/cosmos/base/abci/v1beta1/abci.proto#L106-L109\n[single message]: https://github.com/cosmos/cosmos-sdk/blob/v0.50.4/baseapp/baseapp.go#L1020-L1023", + "value": 12 + } + } + }, + { + "name": "cosmwasm_std_results_events_Event", + "description": "A full [*Cosmos SDK* event].\n\nThis version uses string attributes (similar to [*Cosmos SDK* StringEvent]),\nwhich then get magically converted to bytes for Tendermint somewhere between\nthe Rust-Go interface, JSON deserialization and the `NewEvent` call in Cosmos SDK.\n\n[*Cosmos SDK* event]: https://docs.cosmos.network/main/learn/advanced/events\n[*Cosmos SDK* StringEvent]: https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/base/abci/v1beta1/abci.proto#L56-L70", + "type": "struct", + "properties": { + "attributes": { + "description": "The attributes to be included in the event.\n\nYou can learn more about these from [*Cosmos SDK* docs].\n\n[*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events", + "value": 8 + }, + "type": { + "description": "The event type. This is renamed to \"ty\" because \"type\" is reserved in Rust. This sucks, we know.", + "value": 6 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_results_events_Attribute", + "description": "An key value pair that is used in the context of event attributes in logs", + "type": "struct", + "properties": { + "key": { + "value": 6 + }, + "value": { + "value": 6 + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 7 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 5 + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 2 + }, + { + "name": "cosmwasm_std_results_submessages_MsgResponse", + "type": "struct", + "properties": { + "type_url": { + "value": 6 + }, + "value": { + "value": 2 + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 11 + } + ] +} diff --git a/contracts/reflect/schema/cw_schema/reflect.json b/contracts/reflect/schema/cw_schema/reflect.json new file mode 100644 index 0000000000..8b94deda84 --- /dev/null +++ b/contracts/reflect/schema/cw_schema/reflect.json @@ -0,0 +1,1327 @@ +{ + "contract_name": "reflect", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_ExecuteMsg", + "type": "enum", + "cases": { + "change_owner": { + "type": "named", + "properties": { + "owner": { + "value": 3 + } + } + }, + "reflect_msg": { + "type": "named", + "properties": { + "msgs": { + "value": 27 + } + } + }, + "reflect_sub_msg": { + "type": "named", + "properties": { + "msgs": { + "value": 31 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_CosmosMsg_reflect_msg_CustomMsg_", + "type": "enum", + "cases": { + "any": { + "description": "`CosmosMsg::Any` replaces the \"stargate message\" – a message wrapped\nin a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any)\nthat is supported by the chain. It behaves the same as\n`CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because\na chain running CosmWasm < 2.0 cannot process this.", + "type": "tuple", + "items": [ + 11 + ] + }, + "bank": { + "type": "tuple", + "items": [ + 2 + ] + }, + "custom": { + "type": "tuple", + "items": [ + 7 + ] + }, + "distribution": { + "type": "tuple", + "items": [ + 10 + ] + }, + "gov": { + "type": "tuple", + "items": [ + 22 + ] + }, + "ibc": { + "type": "tuple", + "items": [ + 12 + ] + }, + "staking": { + "type": "tuple", + "items": [ + 9 + ] + }, + "stargate": { + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "named", + "properties": { + "type_url": { + "value": 3 + }, + "value": { + "value": 8 + } + } + }, + "wasm": { + "type": "tuple", + "items": [ + 21 + ] + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_BankMsg", + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "type": "enum", + "cases": { + "burn": { + "description": "This will burn the given coins from the contract's account.\nThere is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper.\nImportant if a contract controls significant token supply that must be retired.", + "type": "named", + "properties": { + "amount": { + "value": 6 + } + } + }, + "send": { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28).\n`from_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 6 + }, + "to_address": { + "value": 3 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 5 + }, + "denom": { + "value": 3 + } + } + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 4 + }, + { + "name": "reflect_msg_CustomMsg", + "description": "CustomMsg is an override of CosmosMsg::Custom to show this works and can be extended in the contract", + "type": "enum", + "cases": { + "debug": { + "type": "tuple", + "items": [ + 3 + ] + }, + "raw": { + "type": "tuple", + "items": [ + 8 + ] + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_results_cosmos_msg_StakingMsg", + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "type": "enum", + "cases": { + "delegate": { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "validator": { + "value": 3 + } + } + }, + "redelegate": { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "dst_validator": { + "value": 3 + }, + "src_validator": { + "value": 3 + } + } + }, + "undelegate": { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "value": 4 + }, + "validator": { + "value": 3 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_DistributionMsg", + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "type": "enum", + "cases": { + "fund_community_pool": { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2).\n`depositor` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "amount": { + "description": "The amount to spend", + "value": 6 + } + } + }, + "set_withdraw_address": { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "address": { + "description": "The `withdraw_address`", + "value": 3 + } + } + }, + "withdraw_delegator_reward": { + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50).\n`delegator_address` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "validator": { + "description": "The `validator_address`", + "value": 3 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_AnyMsg", + "description": "A message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto).\nThis is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "struct", + "properties": { + "type_url": { + "value": 3 + }, + "value": { + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcMsg", + "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts\n(contracts that directly speak the IBC protocol via 6 entry points)", + "type": "enum", + "cases": { + "close_channel": { + "description": "This will close an existing channel that is owned by this contract.\nPort is auto-assigned to the contract's IBC port", + "type": "named", + "properties": { + "channel_id": { + "value": 3 + } + } + }, + "send_packet": { + "description": "Sends an IBC packet with given data over the existing channel.\nData should be encoded in a format defined by the channel version,\nand the module on the other side should know how to parse this.", + "type": "named", + "properties": { + "channel_id": { + "value": 3 + }, + "data": { + "value": 8 + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "value": 13 + } + } + }, + "transfer": { + "description": "Sends bank tokens owned by the contract to the given address on another chain.\nThe channel must already be established between the ibctransfer module on this chain\nand a matching module on the remote chain.\nWe cannot select the port_id, this is whatever the local chain has bound the ibctransfer\nmodule to.", + "type": "named", + "properties": { + "amount": { + "description": "packet data only supports one coin\nhttps://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", + "value": 4 + }, + "channel_id": { + "description": "existing channel to send the tokens over", + "value": 3 + }, + "memo": { + "description": "An optional memo. See the blog post\n[\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b)\nfor more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently\nignored on older chains.\nIf you need support for both 1.x and 2.x chain with the same codebase,\nit is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer\nprotobuf encoder instead.", + "value": 19 + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "value": 13 + }, + "to_address": { + "description": "address on the remote chain to receive these tokens", + "value": 3 + } + } + }, + "write_acknowledgement": { + "description": "Acknowledges a packet that this contract received over IBC.\nThis allows acknowledging a packet that was not acknowledged yet in the `ibc_packet_receive` call.", + "type": "named", + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "value": 20 + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "value": 3 + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "value": 15 + } + } + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeout", + "description": "In IBC each package must set at least one type of timeout:\nthe timestamp or the block height. Using this rather complex enum instead of\ntwo timeout fields we ensure that at least one timeout is set.", + "type": "struct", + "properties": { + "block": { + "value": 16 + }, + "timestamp": { + "value": 18 + } + } + }, + { + "name": "cosmwasm_std_ibc_IbcTimeoutBlock", + "description": "IBCTimeoutHeight Height is a monotonically increasing data type\nthat can be compared against another Height for the purposes of updating and\nfreezing clients.\nOrdering is (revision_number, timeout_height)", + "type": "struct", + "properties": { + "height": { + "description": "block height after which the packet times out.\nthe height within the given revision", + "value": 15 + }, + "revision": { + "description": "the version that the client is currently on\n(e.g. after resetting the chain this could increment 1 as height drops to 0)", + "value": 15 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 14 + }, + { + "name": "cosmwasm_std_timestamp_Timestamp", + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n```\n# use cosmwasm_std::Timestamp;\nlet ts = Timestamp::from_nanos(1_000_000_202);\nassert_eq!(ts.nanos(), 1_000_000_202);\nassert_eq!(ts.seconds(), 1);\nassert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2);\nassert_eq!(ts.nanos(), 3_000_000_202);\nassert_eq!(ts.seconds(), 3);\nassert_eq!(ts.subsec_nanos(), 202);\n```", + "type": "timestamp" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 17 + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 3 + }, + { + "name": "cosmwasm_std_ibc_IbcAcknowledgement", + "type": "struct", + "properties": { + "data": { + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_WasmMsg", + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "type": "enum", + "cases": { + "clear_admin": { + "description": "Clears the admin on the given contract, so no more migration possible.\nFails if this contract is not currently admin of the target contract.", + "type": "named", + "properties": { + "contract_addr": { + "value": 3 + } + } + }, + "execute": { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "contract_addr": { + "value": 3 + }, + "funds": { + "value": 6 + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "value": 8 + } + } + }, + "instantiate": { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that\nwhen emitting the same Instantiate message multiple times,\nmultiple instances on different addresses will be generated. See also\nInstantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "admin": { + "value": 19 + }, + "code_id": { + "value": 15 + }, + "funds": { + "value": 6 + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should:\n- not be empty\n- not be bigger than 128 bytes (or some chain-specific limit)\n- not start / end with whitespace", + "value": 3 + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "value": 8 + } + } + }, + "instantiate2": { + "description": "Instantiates a new contracts from previously uploaded Wasm code\nusing a predictable address derivation algorithm implemented in\n[`cosmwasm_std::instantiate2_address`].\n\nThis is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96).\n`sender` is automatically filled with the current contract's address.\n`fix_msg` is automatically set to false.", + "type": "named", + "properties": { + "admin": { + "value": 19 + }, + "code_id": { + "value": 15 + }, + "funds": { + "value": 6 + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should:\n- not be empty\n- not be bigger than 128 bytes (or some chain-specific limit)\n- not start / end with whitespace", + "value": 3 + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "value": 8 + }, + "salt": { + "value": 8 + } + } + }, + "migrate": { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to\ncustomize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96).\n`sender` is automatically filled with the current contract's address.", + "type": "named", + "properties": { + "contract_addr": { + "value": 3 + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "value": 8 + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "value": 15 + } + } + }, + "update_admin": { + "description": "Sets a new admin (for migrate) on the given contract.\nFails if this contract is not currently admin of the target contract.", + "type": "named", + "properties": { + "admin": { + "value": 3 + }, + "contract_addr": { + "value": 3 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_GovMsg", + "description": "This message type allows the contract interact with the [x/gov] module in order\nto cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n```\n# use cosmwasm_std::{\n# HexBinary,\n# Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo,\n# Response, QueryResponse,\n# };\n# type ExecuteMsg = ();\nuse cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point]\npub fn execute(\ndeps: DepsMut,\nenv: Env,\ninfo: MessageInfo,\nmsg: ExecuteMsg,\n) -> Result {\n// ...\nOk(Response::new().add_message(GovMsg::Vote {\nproposal_id: 4,\noption: VoteOption::Yes,\n}))\n}\n```\n\nCast a weighted vote:\n\n```\n# use cosmwasm_std::{\n# HexBinary,\n# Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo,\n# Response, QueryResponse,\n# };\n# type ExecuteMsg = ();\n# #[cfg(feature = \"cosmwasm_1_2\")]\nuse cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")]\n#[entry_point]\npub fn execute(\ndeps: DepsMut,\nenv: Env,\ninfo: MessageInfo,\nmsg: ExecuteMsg,\n) -> Result {\n// ...\nOk(Response::new().add_message(GovMsg::VoteWeighted {\nproposal_id: 4,\noptions: vec![\nWeightedVoteOption {\noption: VoteOption::Yes,\nweight: Decimal::percent(65),\n},\nWeightedVoteOption {\noption: VoteOption::Abstain,\nweight: Decimal::percent(35),\n},\n],\n}))\n}\n```", + "type": "enum", + "cases": { + "vote": { + "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", + "type": "named", + "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "value": 23 + }, + "proposal_id": { + "value": 15 + } + } + }, + "vote_weighted": { + "description": "This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address.", + "type": "named", + "properties": { + "options": { + "value": 26 + }, + "proposal_id": { + "value": 15 + } + } + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_VoteOption", + "type": "enum", + "cases": { + "abstain": { + "type": "unit" + }, + "no": { + "type": "unit" + }, + "no_with_veto": { + "type": "unit" + }, + "yes": { + "type": "unit" + } + } + }, + { + "name": "cosmwasm_std_results_cosmos_msg_WeightedVoteOption", + "type": "struct", + "properties": { + "option": { + "value": 23 + }, + "weight": { + "value": 25 + } + } + }, + { + "name": "cosmwasm_std_math_decimal_Decimal", + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "decimal", + "precision": 128, + "signed": false + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 24 + }, + { + "name": "alloc::vec::Vec>", + "type": "array", + "items": 1 + }, + { + "name": "cosmwasm_std_results_submessages_SubMsg_reflect_msg_CustomMsg_", + "description": "A submessage that will guarantee a `reply` call on success or error, depending on\nthe `reply_on` setting. If you do not need to process the result, use regular messages instead.\n\nNote: On error the submessage execution will revert any partial state changes due to this message,\nbut not revert any state changes in the calling contract. If this is required, it must be done\nmanually in the `reply` entry point.", + "type": "struct", + "properties": { + "gas_limit": { + "description": "Gas limit measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).\n\nSetting this to `None` means unlimited. Then the submessage execution can consume all gas of the\ncurrent execution context.", + "value": 29 + }, + "id": { + "description": "An arbitrary ID chosen by the contract.\nThis is typically used to match `Reply`s in the `reply` entry point to the submessage.", + "value": 15 + }, + "msg": { + "value": 1 + }, + "payload": { + "defaulting": true, + "description": "Some arbitrary data that the contract can set in an application specific way.\nThis is just passed into the `reply` entry point and is not stored to state.\nAny encoding can be used. If `id` is used to identify a particular action,\nthe encoding can also be different for each of those actions since you can match `id`\nfirst and then start processing the `payload`.\n\nThe environment restricts the length of this field in order to avoid abuse. The limit\nis environment specific and can change over time. The initial default is 128 KiB.\n\nUnset/nil/null cannot be differentiated from empty data.\n\nOn chains running CosmWasm 1.x this field will be ignored.", + "value": 8 + }, + "reply_on": { + "value": 30 + } + } + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 15 + }, + { + "name": "cosmwasm_std_results_submessages_ReplyOn", + "description": "Use this to define when the contract gets a response callback.\nIf you only need it for errors or success you can select just those in order\nto save gas.", + "type": "enum", + "cases": { + "always": { + "description": "Always perform a callback after SubMsg is processed", + "type": "unit" + }, + "error": { + "description": "Only callback if SubMsg returned an error, no callback on success case", + "type": "unit" + }, + "never": { + "description": "Never make a callback - this is like the original CosmosMsg semantics", + "type": "unit" + }, + "success": { + "description": "Only callback if SubMsg was successful, no callback on error case", + "type": "unit" + } + } + }, + { + "name": "alloc::vec::Vec>", + "type": "array", + "items": 28 + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_QueryMsg", + "type": "enum", + "cases": { + "capitalized": { + "description": "This will call out to SpecialQuery::Capitalized", + "type": "named", + "properties": { + "text": { + "value": 1 + } + } + }, + "chain": { + "description": "Queries the blockchain and returns the result untouched", + "type": "named", + "properties": { + "request": { + "value": 2 + } + } + }, + "owner": { + "type": "named", + "properties": {} + }, + "raw": { + "description": "Queries another contract and returns the data", + "type": "named", + "properties": { + "contract": { + "value": 1 + }, + "key": { + "value": 5 + } + } + }, + "sub_msg_result": { + "description": "If there was a previous ReflectSubMsg with this ID, returns cosmwasm_std::Reply", + "type": "named", + "properties": { + "id": { + "value": 16 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_query_QueryRequest_reflect_msg_SpecialQuery_", + "type": "enum", + "cases": { + "bank": { + "type": "tuple", + "items": [ + 3 + ] + }, + "custom": { + "type": "tuple", + "items": [ + 10 + ] + }, + "distribution": { + "type": "tuple", + "items": [ + 12 + ] + }, + "grpc": { + "type": "tuple", + "items": [ + 17 + ] + }, + "ibc": { + "type": "tuple", + "items": [ + 13 + ] + }, + "staking": { + "type": "tuple", + "items": [ + 11 + ] + }, + "stargate": { + "description": "A Stargate query is encoded the same way as abci_query, with path and protobuf encoded request data.\nThe format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md).\nThe response is protobuf encoded data directly without a JSON response wrapper.\nThe caller is responsible for compiling the proper protobuf definitions for both requests and responses.", + "type": "named", + "properties": { + "data": { + "description": "this is the expected protobuf message type (not any), binary encoded", + "value": 5 + }, + "path": { + "description": "this is the fully qualified service path used for routing,\neg. \"/cosmos_sdk.x.bank.v1.Query/QueryBalance\"", + "value": 1 + } + } + }, + "wasm": { + "type": "tuple", + "items": [ + 15 + ] + } + } + }, + { + "name": "cosmwasm_std_query_bank_BankQuery", + "type": "enum", + "cases": { + "all_denom_metadata": { + "description": "This calls into the native bank module for querying metadata for all bank tokens that have a metadata entry.\nReturn value is AllDenomMetadataResponse", + "type": "named", + "properties": { + "pagination": { + "value": 9 + } + } + }, + "balance": { + "description": "This calls into the native bank module for one denomination\nReturn value is BalanceResponse", + "type": "named", + "properties": { + "address": { + "value": 1 + }, + "denom": { + "value": 1 + } + } + }, + "denom_metadata": { + "description": "This calls into the native bank module for querying metadata for a specific bank token.\nReturn value is DenomMetadataResponse", + "type": "named", + "properties": { + "denom": { + "value": 1 + } + } + }, + "supply": { + "description": "This calls into the native bank module for querying the total supply of one denomination.\nIt does the same as the SupplyOf call in Cosmos SDK's RPC API.\nReturn value is of type SupplyResponse.", + "type": "named", + "properties": { + "denom": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_pagination_PageRequest", + "description": "Simplified version of the PageRequest type for pagination from the cosmos-sdk", + "type": "struct", + "properties": { + "key": { + "value": 6 + }, + "limit": { + "value": 7 + }, + "reverse": { + "value": 8 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 5 + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "bool", + "type": "boolean" + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 4 + }, + { + "name": "reflect_msg_SpecialQuery", + "description": "An implementation of QueryRequest::Custom to show this works and can be extended in the contract", + "type": "enum", + "cases": { + "capitalized": { + "type": "named", + "properties": { + "text": { + "value": 1 + } + } + }, + "ping": { + "type": "named", + "properties": {} + } + } + }, + { + "name": "cosmwasm_std_query_staking_StakingQuery", + "type": "enum", + "cases": { + "all_delegations": { + "description": "AllDelegations will return all delegations by the delegator", + "type": "named", + "properties": { + "delegator": { + "value": 1 + } + } + }, + "all_validators": { + "description": "Returns all validators in the currently active validator set.\n\nThe query response type is `AllValidatorsResponse`.", + "type": "named", + "properties": {} + }, + "bonded_denom": { + "description": "Returns the denomination that can be bonded (if there are multiple native tokens on the chain)", + "type": "named", + "properties": {} + }, + "delegation": { + "description": "Delegation will return more detailed info on a particular\ndelegation, defined by delegator/validator pair", + "type": "named", + "properties": { + "delegator": { + "value": 1 + }, + "validator": { + "value": 1 + } + } + }, + "validator": { + "description": "Returns the validator at the given address. Returns None if the validator is\nnot part of the currently active validator set.\n\nThe query response type is `ValidatorResponse`.", + "type": "named", + "properties": { + "address": { + "description": "The validator's address (e.g. cosmosvaloper1...)", + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_query_distribution_DistributionQuery", + "type": "enum", + "cases": { + "delegation_rewards": { + "description": "See ", + "type": "named", + "properties": { + "delegator_address": { + "value": 1 + }, + "validator_address": { + "value": 1 + } + } + }, + "delegation_total_rewards": { + "description": "See ", + "type": "named", + "properties": { + "delegator_address": { + "value": 1 + } + } + }, + "delegator_validators": { + "description": "See ", + "type": "named", + "properties": { + "delegator_address": { + "value": 1 + } + } + }, + "delegator_withdraw_address": { + "description": "See ", + "type": "named", + "properties": { + "delegator_address": { + "value": 1 + } + } + } + } + }, + { + "name": "cosmwasm_std_query_ibc_IbcQuery", + "description": "These are queries to the various IBC modules to see the state of the contract's\nIBC connection.\nMost of these will return errors if the contract is not \"ibc enabled\".", + "type": "enum", + "cases": { + "channel": { + "description": "Lists all information for a (portID, channelID) pair.\nIf port_id is omitted, it will default to the contract's own channel.\n(To save a PortId{} call)\n\nReturns a `ChannelResponse`.", + "type": "named", + "properties": { + "channel_id": { + "value": 1 + }, + "port_id": { + "value": 14 + } + } + }, + "port_id": { + "description": "Gets the Port ID the current contract is bound to.\n\nReturns a `PortIdResponse`.", + "type": "named", + "properties": {} + } + } + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 1 + }, + { + "name": "cosmwasm_std_query_wasm_WasmQuery", + "type": "enum", + "cases": { + "code_info": { + "description": "Returns a [`CodeInfoResponse`] with metadata of the code", + "type": "named", + "properties": { + "code_id": { + "value": 16 + } + } + }, + "contract_info": { + "description": "Returns a [`ContractInfoResponse`] with metadata on the contract from the runtime", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + } + } + }, + "raw": { + "description": "this queries the raw kv-store of the contract.\nreturns the raw, unparsed data stored at that key, which may be an empty vector if not present", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + }, + "key": { + "description": "Key is the raw key used in the contracts Storage", + "value": 5 + } + } + }, + "smart": { + "description": "this queries the public API of another contract at a known address (with known ABI)\nReturn value is whatever the contract returns (caller should know), wrapped in a\nContractResult that is JSON encoded.", + "type": "named", + "properties": { + "contract_addr": { + "value": 1 + }, + "msg": { + "description": "msg is the json-encoded QueryMsg struct", + "value": 5 + } + } + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_query_GrpcQuery", + "description": "Queries the chain using a grpc query.\nThis allows to query information that is not exposed in our API.\nThe chain needs to allowlist the supported queries.\nThe drawback of this query is that you have to handle the protobuf encoding and decoding yourself.\n\nThe returned data is protobuf encoded. The protobuf type depends on the query.\nBecause of this, using it with the [`query`](crate::QuerierWrapper::query) function will result\nin a deserialization error.\nUse [`raw_query`](crate::Querier::raw_query) or [`query_grpc`](crate::QuerierWrapper::query_grpc)\ninstead.\n\nTo find the path, as well as the request and response types,\nyou can query the chain's gRPC endpoint using a tool like\n[grpcurl](https://github.com/fullstorydev/grpcurl).", + "type": "struct", + "properties": { + "data": { + "description": "The expected protobuf message type (not [Any](https://protobuf.dev/programming-guides/proto3/#any)), binary encoded", + "value": 5 + }, + "path": { + "description": "The fully qualified endpoint path used for routing.\nIt follows the format `/service_path/method_name`,\neg. \"/cosmos.authz.v1beta1.Query/Grants\"", + "value": 1 + } + } + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "capitalized": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_CapitalizedResponse", + "type": "struct", + "properties": { + "text": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "chain": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_ChainResponse", + "type": "struct", + "properties": { + "data": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + } + ] + }, + "owner": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_OwnerResponse", + "type": "struct", + "properties": { + "owner": { + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "raw": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "reflect_msg_RawResponse", + "type": "struct", + "properties": { + "data": { + "description": "The returned value of the raw query. Empty data can be the\nresult of a non-existent key or an empty value. We cannot\ndifferentiate those two cases in cross contract queries.", + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + } + ] + }, + "sub_msg_result": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "cosmwasm_std_results_submessages_Reply", + "description": "The result object returned to `reply`. We always get the ID from the submessage\nback and then must handle success and error cases ourselves.", + "type": "struct", + "properties": { + "gas_used": { + "defaulting": true, + "description": "The amount of gas used by the submessage,\nmeasured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).\n\nThis only contains a useful value on chains running CosmWasm 2.0 or higher.\nOn older chains, this field is always 0.", + "value": 1 + }, + "id": { + "description": "The ID that the contract set when emitting the `SubMsg`.\nUse this to identify which submessage triggered the `reply`.", + "value": 1 + }, + "payload": { + "defaulting": true, + "description": "Some arbitrary data that the contract set when emitting the `SubMsg`.\nThis is just passed into the `reply` entry point and is not stored to state.\n\nUnset/nil/null cannot be differentiated from empty data.\n\nOn chains running CosmWasm 1.x this field is never filled.", + "value": 2 + }, + "result": { + "value": 3 + } + } + }, + { + "name": "u64", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "cosmwasm_std_binary_Binary", + "description": "Binary is a wrapper around Vec to add base64 de/serialization\nwith serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec.\nSee also .", + "type": "binary" + }, + { + "name": "cosmwasm_std_results_submessages_SubMsgResult", + "description": "This is the result type that is returned from a sub message execution.\n\nWe use a custom type here instead of Rust's Result because we want to be able to\ndefine the serialization, which is a public interface. Every language that compiles\nto Wasm and runs in the ComsWasm VM needs to create the same JSON representation.\n\nUntil version 1.0.0-beta5, `ContractResult` was used instead\nof this type. Once serialized, the two types are the same. However, in the Rust type\nsystem we want different types for clarity and documentation reasons.\n\n# Examples\n\nSuccess:\n\n```\n# use cosmwasm_std::{to_json_string, Binary, Event, SubMsgResponse, SubMsgResult};\n#[allow(deprecated)]\nlet response = SubMsgResponse {\ndata: Some(Binary::from_base64(\"MTIzCg==\").unwrap()),\nevents: vec![Event::new(\"wasm\").add_attribute(\"foo\", \"bar\")],\nmsg_responses: vec![],\n};\nlet result: SubMsgResult = SubMsgResult::Ok(response);\nassert_eq!(\nto_json_string(&result).unwrap(),\nr#\"{\"ok\":{\"events\":[{\"type\":\"wasm\",\"attributes\":[{\"key\":\"foo\",\"value\":\"bar\"}]}],\"data\":\"MTIzCg==\",\"msg_responses\":[]}}\"#,\n);\n```\n\nFailure:\n\n```\n# use cosmwasm_std::{to_json_string, SubMsgResult, Response};\nlet error_msg = String::from(\"Something went wrong\");\nlet result = SubMsgResult::Err(error_msg);\nassert_eq!(to_json_string(&result).unwrap(), r#\"{\"error\":\"Something went wrong\"}\"#);\n```", + "type": "enum", + "cases": { + "error": { + "description": "An error type that every custom error created by contract developers can be converted to.\nThis could potentially have more structure, but String is the easiest.", + "type": "tuple", + "items": [ + 6 + ] + }, + "ok": { + "type": "tuple", + "items": [ + 4 + ] + } + } + }, + { + "name": "cosmwasm_std_results_submessages_SubMsgResponse", + "description": "The information we get back from a successful sub message execution", + "type": "struct", + "properties": { + "data": { + "value": 10 + }, + "events": { + "description": "The Cosmos SDK events emitted by the submessage.\n\nThis is only filled if the submessage was itself a [`crate::WasmMsg`].\nThe reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic,\nso the VM only returns events of wasm messages, which we know are deterministic.\n\n[not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events", + "value": 9 + }, + "msg_responses": { + "defaulting": true, + "description": "The responses from the messages emitted by the submessage.\nIn most cases, this is equivalent to the Cosmos SDK's [MsgResponses], which usually contains a [single message].\nHowever, wasmd allows chains to translate a single contract message into multiple SDK messages.\nIn that case all the MsgResponses from each are concatenated into this flattened `Vec`.\n\n[MsgResponses]: https://github.com/cosmos/cosmos-sdk/blob/316750cc8cd8b3296fa233f4da2e39cbcdc34517/proto/cosmos/base/abci/v1beta1/abci.proto#L106-L109\n[single message]: https://github.com/cosmos/cosmos-sdk/blob/v0.50.4/baseapp/baseapp.go#L1020-L1023", + "value": 12 + } + } + }, + { + "name": "cosmwasm_std_results_events_Event", + "description": "A full [*Cosmos SDK* event].\n\nThis version uses string attributes (similar to [*Cosmos SDK* StringEvent]),\nwhich then get magically converted to bytes for Tendermint somewhere between\nthe Rust-Go interface, JSON deserialization and the `NewEvent` call in Cosmos SDK.\n\n[*Cosmos SDK* event]: https://docs.cosmos.network/main/learn/advanced/events\n[*Cosmos SDK* StringEvent]: https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/base/abci/v1beta1/abci.proto#L56-L70", + "type": "struct", + "properties": { + "attributes": { + "description": "The attributes to be included in the event.\n\nYou can learn more about these from [*Cosmos SDK* docs].\n\n[*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events", + "value": 8 + }, + "type": { + "description": "The event type. This is renamed to \"ty\" because \"type\" is reserved in Rust. This sucks, we know.", + "value": 6 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_results_events_Attribute", + "description": "An key value pair that is used in the context of event attributes in logs", + "type": "struct", + "properties": { + "key": { + "value": 6 + }, + "value": { + "value": 6 + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 7 + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 5 + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 2 + }, + { + "name": "cosmwasm_std_results_submessages_MsgResponse", + "type": "struct", + "properties": { + "type_url": { + "value": 6 + }, + "value": { + "value": 2 + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 11 + } + ] + } + } +} diff --git a/contracts/reflect/schema/raw/execute.json b/contracts/reflect/schema/raw/execute.json new file mode 100644 index 0000000000..8c6d05b83f --- /dev/null +++ b/contracts/reflect/schema/raw/execute.json @@ -0,0 +1,1134 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "reflect_msg" + ], + "properties": { + "reflect_msg": { + "type": "object", + "required": [ + "msgs" + ], + "properties": { + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/CosmosMsg_for_CustomMsg" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "reflect_sub_msg" + ], + "properties": { + "reflect_sub_msg": { + "type": "object", + "required": [ + "msgs" + ], + "properties": { + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/SubMsg_for_CustomMsg" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "change_owner" + ], + "properties": { + "change_owner": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AnyMsg": { + "description": "A message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "object", + "required": [ + "type_url", + "value" + ], + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "BankMsg": { + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "oneOf": [ + { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "send" + ], + "properties": { + "send": { + "type": "object", + "required": [ + "amount", + "to_address" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "to_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CosmosMsg_for_CustomMsg": { + "oneOf": [ + { + "type": "object", + "required": [ + "bank" + ], + "properties": { + "bank": { + "$ref": "#/definitions/BankMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "$ref": "#/definitions/CustomMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "staking" + ], + "properties": { + "staking": { + "$ref": "#/definitions/StakingMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "distribution" + ], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionMsg" + } + }, + "additionalProperties": false + }, + { + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "deprecated": true, + "type": "object", + "required": [ + "stargate" + ], + "properties": { + "stargate": { + "type": "object", + "required": [ + "type_url", + "value" + ], + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "`CosmosMsg::Any` replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "$ref": "#/definitions/AnyMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ibc" + ], + "properties": { + "ibc": { + "$ref": "#/definitions/IbcMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wasm" + ], + "properties": { + "wasm": { + "$ref": "#/definitions/WasmMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "gov" + ], + "properties": { + "gov": { + "$ref": "#/definitions/GovMsg" + } + }, + "additionalProperties": false + } + ] + }, + "CustomMsg": { + "description": "CustomMsg is an override of CosmosMsg::Custom to show this works and can be extended in the contract", + "oneOf": [ + { + "type": "object", + "required": [ + "debug" + ], + "properties": { + "debug": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "raw" + ], + "properties": { + "raw": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + ] + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "DistributionMsg": { + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "set_withdraw_address" + ], + "properties": { + "set_withdraw_address": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The `withdraw_address`", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "withdraw_delegator_reward" + ], + "properties": { + "withdraw_delegator_reward": { + "type": "object", + "required": [ + "validator" + ], + "properties": { + "validator": { + "description": "The `validator_address`", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "GovMsg": { + "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```", + "oneOf": [ + { + "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", + "type": "object", + "required": [ + "vote" + ], + "properties": { + "vote": { + "type": "object", + "required": [ + "option", + "proposal_id" + ], + "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "allOf": [ + { + "$ref": "#/definitions/VoteOption" + } + ] + }, + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address.", + "type": "object", + "required": [ + "vote_weighted" + ], + "properties": { + "vote_weighted": { + "type": "object", + "required": [ + "options", + "proposal_id" + ], + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/WeightedVoteOption" + } + }, + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "IbcAcknowledgement": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "IbcMsg": { + "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)", + "oneOf": [ + { + "description": "Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to.", + "type": "object", + "required": [ + "transfer" + ], + "properties": { + "transfer": { + "type": "object", + "required": [ + "amount", + "channel_id", + "timeout", + "to_address" + ], + "properties": { + "amount": { + "description": "packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] + }, + "channel_id": { + "description": "existing channel to send the tokens over", + "type": "string" + }, + "memo": { + "description": "An optional memo. See the blog post [\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead.", + "type": [ + "string", + "null" + ] + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "allOf": [ + { + "$ref": "#/definitions/IbcTimeout" + } + ] + }, + "to_address": { + "description": "address on the remote chain to receive these tokens", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Sends an IBC packet with given data over the existing channel. Data should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.", + "type": "object", + "required": [ + "send_packet" + ], + "properties": { + "send_packet": { + "type": "object", + "required": [ + "channel_id", + "data", + "timeout" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "data": { + "$ref": "#/definitions/Binary" + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "allOf": [ + { + "$ref": "#/definitions/IbcTimeout" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Acknowledges a packet that this contract received over IBC. This allows acknowledging a packet that was not acknowledged yet in the `ibc_packet_receive` call.", + "type": "object", + "required": [ + "write_acknowledgement" + ], + "properties": { + "write_acknowledgement": { + "type": "object", + "required": [ + "ack", + "channel_id", + "packet_sequence" + ], + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "allOf": [ + { + "$ref": "#/definitions/IbcAcknowledgement" + } + ] + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "type": "string" + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This will close an existing channel that is owned by this contract. Port is auto-assigned to the contract's IBC port", + "type": "object", + "required": [ + "close_channel" + ], + "properties": { + "close_channel": { + "type": "object", + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "IbcTimeout": { + "description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.", + "type": "object", + "properties": { + "block": { + "anyOf": [ + { + "$ref": "#/definitions/IbcTimeoutBlock" + }, + { + "type": "null" + } + ] + }, + "timestamp": { + "anyOf": [ + { + "$ref": "#/definitions/Timestamp" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "IbcTimeoutBlock": { + "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", + "type": "object", + "required": [ + "height", + "revision" + ], + "properties": { + "height": { + "description": "block height after which the packet times out. the height within the given revision", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "revision": { + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "ReplyOn": { + "description": "Use this to define when the contract gets a response callback. If you only need it for errors or success you can select just those in order to save gas.", + "oneOf": [ + { + "description": "Always perform a callback after SubMsg is processed", + "type": "string", + "enum": [ + "always" + ] + }, + { + "description": "Only callback if SubMsg returned an error, no callback on success case", + "type": "string", + "enum": [ + "error" + ] + }, + { + "description": "Only callback if SubMsg was successful, no callback on error case", + "type": "string", + "enum": [ + "success" + ] + }, + { + "description": "Never make a callback - this is like the original CosmosMsg semantics", + "type": "string", + "enum": [ + "never" + ] + } + ] + }, + "StakingMsg": { + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "delegate" + ], + "properties": { + "delegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "undelegate" + ], + "properties": { + "undelegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "redelegate" + ], + "properties": { + "redelegate": { + "type": "object", + "required": [ + "amount", + "dst_validator", + "src_validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "dst_validator": { + "type": "string" + }, + "src_validator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "SubMsg_for_CustomMsg": { + "description": "A submessage that will guarantee a `reply` call on success or error, depending on the `reply_on` setting. If you do not need to process the result, use regular messages instead.\n\nNote: On error the submessage execution will revert any partial state changes due to this message, but not revert any state changes in the calling contract. If this is required, it must be done manually in the `reply` entry point.", + "type": "object", + "required": [ + "id", + "msg", + "reply_on" + ], + "properties": { + "gas_limit": { + "description": "Gas limit measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).\n\nSetting this to `None` means unlimited. Then the submessage execution can consume all gas of the current execution context.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "id": { + "description": "An arbitrary ID chosen by the contract. This is typically used to match `Reply`s in the `reply` entry point to the submessage.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "msg": { + "$ref": "#/definitions/CosmosMsg_for_CustomMsg" + }, + "payload": { + "description": "Some arbitrary data that the contract can set in an application specific way. This is just passed into the `reply` entry point and is not stored to state. Any encoding can be used. If `id` is used to identify a particular action, the encoding can also be different for each of those actions since you can match `id` first and then start processing the `payload`.\n\nThe environment restricts the length of this field in order to avoid abuse. The limit is environment specific and can change over time. The initial default is 128 KiB.\n\nUnset/nil/null cannot be differentiated from empty data.\n\nOn chains running CosmWasm 1.x this field will be ignored.", + "default": "", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "reply_on": { + "$ref": "#/definitions/ReplyOn" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "VoteOption": { + "type": "string", + "enum": [ + "yes", + "no", + "abstain", + "no_with_veto" + ] + }, + "WasmMsg": { + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "oneOf": [ + { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "execute" + ], + "properties": { + "execute": { + "type": "object", + "required": [ + "contract_addr", + "funds", + "msg" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "instantiate" + ], + "properties": { + "instantiate": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code using a predictable address derivation algorithm implemented in [`cosmwasm_std::instantiate2_address`].\n\nThis is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). `sender` is automatically filled with the current contract's address. `fix_msg` is automatically set to false.", + "type": "object", + "required": [ + "instantiate2" + ], + "properties": { + "instantiate2": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg", + "salt" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "salt": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "migrate" + ], + "properties": { + "migrate": { + "type": "object", + "required": [ + "contract_addr", + "msg", + "new_code_id" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "update_admin" + ], + "properties": { + "update_admin": { + "type": "object", + "required": [ + "admin", + "contract_addr" + ], + "properties": { + "admin": { + "type": "string" + }, + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "clear_admin" + ], + "properties": { + "clear_admin": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "WeightedVoteOption": { + "type": "object", + "required": [ + "option", + "weight" + ], + "properties": { + "option": { + "$ref": "#/definitions/VoteOption" + }, + "weight": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/reflect/schema/raw/instantiate.json b/contracts/reflect/schema/raw/instantiate.json new file mode 100644 index 0000000000..1352613d57 --- /dev/null +++ b/contracts/reflect/schema/raw/instantiate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/reflect/schema/raw/query.json b/contracts/reflect/schema/raw/query.json new file mode 100644 index 0000000000..44793b3caf --- /dev/null +++ b/contracts/reflect/schema/raw/query.json @@ -0,0 +1,789 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This will call out to SpecialQuery::Capitalized", + "type": "object", + "required": [ + "capitalized" + ], + "properties": { + "capitalized": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Queries the blockchain and returns the result untouched", + "type": "object", + "required": [ + "chain" + ], + "properties": { + "chain": { + "type": "object", + "required": [ + "request" + ], + "properties": { + "request": { + "$ref": "#/definitions/QueryRequest_for_SpecialQuery" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Queries another contract and returns the data", + "type": "object", + "required": [ + "raw" + ], + "properties": { + "raw": { + "type": "object", + "required": [ + "contract", + "key" + ], + "properties": { + "contract": { + "type": "string" + }, + "key": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "If there was a previous ReflectSubMsg with this ID, returns cosmwasm_std::Reply", + "type": "object", + "required": [ + "sub_msg_result" + ], + "properties": { + "sub_msg_result": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "BankQuery": { + "oneOf": [ + { + "description": "This calls into the native bank module for querying the total supply of one denomination. It does the same as the SupplyOf call in Cosmos SDK's RPC API. Return value is of type SupplyResponse.", + "type": "object", + "required": [ + "supply" + ], + "properties": { + "supply": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This calls into the native bank module for one denomination Return value is BalanceResponse", + "type": "object", + "required": [ + "balance" + ], + "properties": { + "balance": { + "type": "object", + "required": [ + "address", + "denom" + ], + "properties": { + "address": { + "type": "string" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This calls into the native bank module for querying metadata for a specific bank token. Return value is DenomMetadataResponse", + "type": "object", + "required": [ + "denom_metadata" + ], + "properties": { + "denom_metadata": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This calls into the native bank module for querying metadata for all bank tokens that have a metadata entry. Return value is AllDenomMetadataResponse", + "type": "object", + "required": [ + "all_denom_metadata" + ], + "properties": { + "all_denom_metadata": { + "type": "object", + "properties": { + "pagination": { + "anyOf": [ + { + "$ref": "#/definitions/PageRequest" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "DistributionQuery": { + "oneOf": [ + { + "description": "See ", + "type": "object", + "required": [ + "delegator_withdraw_address" + ], + "properties": { + "delegator_withdraw_address": { + "type": "object", + "required": [ + "delegator_address" + ], + "properties": { + "delegator_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "See ", + "type": "object", + "required": [ + "delegation_rewards" + ], + "properties": { + "delegation_rewards": { + "type": "object", + "required": [ + "delegator_address", + "validator_address" + ], + "properties": { + "delegator_address": { + "type": "string" + }, + "validator_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "See ", + "type": "object", + "required": [ + "delegation_total_rewards" + ], + "properties": { + "delegation_total_rewards": { + "type": "object", + "required": [ + "delegator_address" + ], + "properties": { + "delegator_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "See ", + "type": "object", + "required": [ + "delegator_validators" + ], + "properties": { + "delegator_validators": { + "type": "object", + "required": [ + "delegator_address" + ], + "properties": { + "delegator_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "GrpcQuery": { + "description": "Queries the chain using a grpc query. This allows to query information that is not exposed in our API. The chain needs to allowlist the supported queries. The drawback of this query is that you have to handle the protobuf encoding and decoding yourself.\n\nThe returned data is protobuf encoded. The protobuf type depends on the query. Because of this, using it with the [`query`](crate::QuerierWrapper::query) function will result in a deserialization error. Use [`raw_query`](crate::Querier::raw_query) or [`query_grpc`](crate::QuerierWrapper::query_grpc) instead.\n\nTo find the path, as well as the request and response types, you can query the chain's gRPC endpoint using a tool like [grpcurl](https://github.com/fullstorydev/grpcurl).", + "type": "object", + "required": [ + "data", + "path" + ], + "properties": { + "data": { + "description": "The expected protobuf message type (not [Any](https://protobuf.dev/programming-guides/proto3/#any)), binary encoded", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "path": { + "description": "The fully qualified endpoint path used for routing. It follows the format `/service_path/method_name`, eg. \"/cosmos.authz.v1beta1.Query/Grants\"", + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcQuery": { + "description": "These are queries to the various IBC modules to see the state of the contract's IBC connection. Most of these will return errors if the contract is not \"ibc enabled\".", + "oneOf": [ + { + "description": "Gets the Port ID the current contract is bound to.\n\nReturns a `PortIdResponse`.", + "type": "object", + "required": [ + "port_id" + ], + "properties": { + "port_id": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Lists all information for a (portID, channelID) pair. If port_id is omitted, it will default to the contract's own channel. (To save a PortId{} call)\n\nReturns a `ChannelResponse`.", + "type": "object", + "required": [ + "channel" + ], + "properties": { + "channel": { + "type": "object", + "required": [ + "channel_id" + ], + "properties": { + "channel_id": { + "type": "string" + }, + "port_id": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "PageRequest": { + "description": "Simplified version of the PageRequest type for pagination from the cosmos-sdk", + "type": "object", + "required": [ + "limit", + "reverse" + ], + "properties": { + "key": { + "anyOf": [ + { + "$ref": "#/definitions/Binary" + }, + { + "type": "null" + } + ] + }, + "limit": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "reverse": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "QueryRequest_for_SpecialQuery": { + "oneOf": [ + { + "type": "object", + "required": [ + "bank" + ], + "properties": { + "bank": { + "$ref": "#/definitions/BankQuery" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "$ref": "#/definitions/SpecialQuery" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "staking" + ], + "properties": { + "staking": { + "$ref": "#/definitions/StakingQuery" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "distribution" + ], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionQuery" + } + }, + "additionalProperties": false + }, + { + "description": "A Stargate query is encoded the same way as abci_query, with path and protobuf encoded request data. The format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md). The response is protobuf encoded data directly without a JSON response wrapper. The caller is responsible for compiling the proper protobuf definitions for both requests and responses.", + "deprecated": true, + "type": "object", + "required": [ + "stargate" + ], + "properties": { + "stargate": { + "type": "object", + "required": [ + "data", + "path" + ], + "properties": { + "data": { + "description": "this is the expected protobuf message type (not any), binary encoded", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "path": { + "description": "this is the fully qualified service path used for routing, eg. \"/cosmos_sdk.x.bank.v1.Query/QueryBalance\"", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ibc" + ], + "properties": { + "ibc": { + "$ref": "#/definitions/IbcQuery" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wasm" + ], + "properties": { + "wasm": { + "$ref": "#/definitions/WasmQuery" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "grpc" + ], + "properties": { + "grpc": { + "$ref": "#/definitions/GrpcQuery" + } + }, + "additionalProperties": false + } + ] + }, + "SpecialQuery": { + "description": "An implementation of QueryRequest::Custom to show this works and can be extended in the contract", + "oneOf": [ + { + "type": "object", + "required": [ + "ping" + ], + "properties": { + "ping": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "capitalized" + ], + "properties": { + "capitalized": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "StakingQuery": { + "oneOf": [ + { + "description": "Returns the denomination that can be bonded (if there are multiple native tokens on the chain)", + "type": "object", + "required": [ + "bonded_denom" + ], + "properties": { + "bonded_denom": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "AllDelegations will return all delegations by the delegator", + "type": "object", + "required": [ + "all_delegations" + ], + "properties": { + "all_delegations": { + "type": "object", + "required": [ + "delegator" + ], + "properties": { + "delegator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Delegation will return more detailed info on a particular delegation, defined by delegator/validator pair", + "type": "object", + "required": [ + "delegation" + ], + "properties": { + "delegation": { + "type": "object", + "required": [ + "delegator", + "validator" + ], + "properties": { + "delegator": { + "type": "string" + }, + "validator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns all validators in the currently active validator set.\n\nThe query response type is `AllValidatorsResponse`.", + "type": "object", + "required": [ + "all_validators" + ], + "properties": { + "all_validators": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns the validator at the given address. Returns None if the validator is not part of the currently active validator set.\n\nThe query response type is `ValidatorResponse`.", + "type": "object", + "required": [ + "validator" + ], + "properties": { + "validator": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The validator's address (e.g. cosmosvaloper1...)", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "WasmQuery": { + "oneOf": [ + { + "description": "this queries the public API of another contract at a known address (with known ABI) Return value is whatever the contract returns (caller should know), wrapped in a ContractResult that is JSON encoded.", + "type": "object", + "required": [ + "smart" + ], + "properties": { + "smart": { + "type": "object", + "required": [ + "contract_addr", + "msg" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded QueryMsg struct", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "this queries the raw kv-store of the contract. returns the raw, unparsed data stored at that key, which may be an empty vector if not present", + "type": "object", + "required": [ + "raw" + ], + "properties": { + "raw": { + "type": "object", + "required": [ + "contract_addr", + "key" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "key": { + "description": "Key is the raw key used in the contracts Storage", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns a [`ContractInfoResponse`] with metadata on the contract from the runtime", + "type": "object", + "required": [ + "contract_info" + ], + "properties": { + "contract_info": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns a [`CodeInfoResponse`] with metadata of the code", + "type": "object", + "required": [ + "code_info" + ], + "properties": { + "code_info": { + "type": "object", + "required": [ + "code_id" + ], + "properties": { + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + } + } +} diff --git a/contracts/reflect/schema/raw/response_to_capitalized.json b/contracts/reflect/schema/raw/response_to_capitalized.json new file mode 100644 index 0000000000..543a4fa4c4 --- /dev/null +++ b/contracts/reflect/schema/raw/response_to_capitalized.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CapitalizedResponse", + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/reflect/schema/raw/response_to_chain.json b/contracts/reflect/schema/raw/response_to_chain.json new file mode 100644 index 0000000000..aa0adb0fc6 --- /dev/null +++ b/contracts/reflect/schema/raw/response_to_chain.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ChainResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + } + } +} diff --git a/contracts/reflect/schema/raw/response_to_owner.json b/contracts/reflect/schema/raw/response_to_owner.json new file mode 100644 index 0000000000..d91dde1494 --- /dev/null +++ b/contracts/reflect/schema/raw/response_to_owner.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerResponse", + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/reflect/schema/raw/response_to_raw.json b/contracts/reflect/schema/raw/response_to_raw.json new file mode 100644 index 0000000000..85774defd5 --- /dev/null +++ b/contracts/reflect/schema/raw/response_to_raw.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RawResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "description": "The returned value of the raw query. Empty data can be the result of a non-existent key or an empty value. We cannot differentiate those two cases in cross contract queries.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + } + } +} diff --git a/contracts/reflect/schema/raw/response_to_sub_msg_result.json b/contracts/reflect/schema/raw/response_to_sub_msg_result.json new file mode 100644 index 0000000000..3cdcf41dd8 --- /dev/null +++ b/contracts/reflect/schema/raw/response_to_sub_msg_result.json @@ -0,0 +1,165 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Reply", + "description": "The result object returned to `reply`. We always get the ID from the submessage back and then must handle success and error cases ourselves.", + "type": "object", + "required": [ + "id", + "result" + ], + "properties": { + "gas_used": { + "description": "The amount of gas used by the submessage, measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).\n\nThis only contains a useful value on chains running CosmWasm 2.0 or higher. On older chains, this field is always 0.", + "default": 0, + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "id": { + "description": "The ID that the contract set when emitting the `SubMsg`. Use this to identify which submessage triggered the `reply`.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "payload": { + "description": "Some arbitrary data that the contract set when emitting the `SubMsg`. This is just passed into the `reply` entry point and is not stored to state.\n\nUnset/nil/null cannot be differentiated from empty data.\n\nOn chains running CosmWasm 1.x this field is never filled.", + "default": "", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "result": { + "$ref": "#/definitions/SubMsgResult" + } + }, + "additionalProperties": false, + "definitions": { + "Attribute": { + "description": "An key value pair that is used in the context of event attributes in logs", + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Event": { + "description": "A full [*Cosmos SDK* event].\n\nThis version uses string attributes (similar to [*Cosmos SDK* StringEvent]), which then get magically converted to bytes for Tendermint somewhere between the Rust-Go interface, JSON deserialization and the `NewEvent` call in Cosmos SDK.\n\n[*Cosmos SDK* event]: https://docs.cosmos.network/main/learn/advanced/events [*Cosmos SDK* StringEvent]: https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/base/abci/v1beta1/abci.proto#L56-L70", + "type": "object", + "required": [ + "attributes", + "type" + ], + "properties": { + "attributes": { + "description": "The attributes to be included in the event.\n\nYou can learn more about these from [*Cosmos SDK* docs].\n\n[*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events", + "type": "array", + "items": { + "$ref": "#/definitions/Attribute" + } + }, + "type": { + "description": "The event type. This is renamed to \"ty\" because \"type\" is reserved in Rust. This sucks, we know.", + "type": "string" + } + }, + "additionalProperties": false + }, + "MsgResponse": { + "type": "object", + "required": [ + "type_url", + "value" + ], + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, + "SubMsgResponse": { + "description": "The information we get back from a successful sub message execution", + "type": "object", + "required": [ + "events" + ], + "properties": { + "data": { + "deprecated": true, + "anyOf": [ + { + "$ref": "#/definitions/Binary" + }, + { + "type": "null" + } + ] + }, + "events": { + "description": "The Cosmos SDK events emitted by the submessage.\n\nThis is only filled if the submessage was itself a [`crate::WasmMsg`]. The reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic, so the VM only returns events of wasm messages, which we know are deterministic.\n\n[not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events", + "type": "array", + "items": { + "$ref": "#/definitions/Event" + } + }, + "msg_responses": { + "description": "The responses from the messages emitted by the submessage. In most cases, this is equivalent to the Cosmos SDK's [MsgResponses], which usually contains a [single message]. However, wasmd allows chains to translate a single contract message into multiple SDK messages. In that case all the MsgResponses from each are concatenated into this flattened `Vec`.\n\n[MsgResponses]: https://github.com/cosmos/cosmos-sdk/blob/316750cc8cd8b3296fa233f4da2e39cbcdc34517/proto/cosmos/base/abci/v1beta1/abci.proto#L106-L109 [single message]: https://github.com/cosmos/cosmos-sdk/blob/v0.50.4/baseapp/baseapp.go#L1020-L1023", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/MsgResponse" + } + } + }, + "additionalProperties": false + }, + "SubMsgResult": { + "description": "This is the result type that is returned from a sub message execution.\n\nWe use a custom type here instead of Rust's Result because we want to be able to define the serialization, which is a public interface. Every language that compiles to Wasm and runs in the ComsWasm VM needs to create the same JSON representation.\n\nUntil version 1.0.0-beta5, `ContractResult` was used instead of this type. Once serialized, the two types are the same. However, in the Rust type system we want different types for clarity and documentation reasons.\n\n# Examples\n\nSuccess:\n\n``` # use cosmwasm_std::{to_json_string, Binary, Event, SubMsgResponse, SubMsgResult}; #[allow(deprecated)] let response = SubMsgResponse { data: Some(Binary::from_base64(\"MTIzCg==\").unwrap()), events: vec![Event::new(\"wasm\").add_attribute(\"foo\", \"bar\")], msg_responses: vec![], }; let result: SubMsgResult = SubMsgResult::Ok(response); assert_eq!( to_json_string(&result).unwrap(), r#\"{\"ok\":{\"events\":[{\"type\":\"wasm\",\"attributes\":[{\"key\":\"foo\",\"value\":\"bar\"}]}],\"data\":\"MTIzCg==\",\"msg_responses\":[]}}\"#, ); ```\n\nFailure:\n\n``` # use cosmwasm_std::{to_json_string, SubMsgResult, Response}; let error_msg = String::from(\"Something went wrong\"); let result = SubMsgResult::Err(error_msg); assert_eq!(to_json_string(&result).unwrap(), r#\"{\"error\":\"Something went wrong\"}\"#); ```", + "oneOf": [ + { + "type": "object", + "required": [ + "ok" + ], + "properties": { + "ok": { + "$ref": "#/definitions/SubMsgResponse" + } + }, + "additionalProperties": false + }, + { + "description": "An error type that every custom error created by contract developers can be converted to. This could potentially have more structure, but String is the easiest.", + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + } + } +} diff --git a/contracts/reflect/schema/reflect.json b/contracts/reflect/schema/reflect.json index 515e97eac5..80c8ac7533 100644 --- a/contracts/reflect/schema/reflect.json +++ b/contracts/reflect/schema/reflect.json @@ -83,6 +83,23 @@ } ], "definitions": { + "AnyMsg": { + "description": "A message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "object", + "required": [ + "type_url", + "value" + ], + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, "BankMsg": { "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", "oneOf": [ @@ -109,7 +126,8 @@ "to_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -133,7 +151,8 @@ "$ref": "#/definitions/Coin" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -152,12 +171,13 @@ ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "$ref": "#/definitions/Uint256" }, "denom": { "type": "string" } - } + }, + "additionalProperties": false }, "CosmosMsg_for_CustomMsg": { "oneOf": [ @@ -210,7 +230,8 @@ "additionalProperties": false }, { - "description": "A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "deprecated": true, "type": "object", "required": [ "stargate" @@ -229,7 +250,21 @@ "value": { "$ref": "#/definitions/Binary" } - } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "`CosmosMsg::Any` replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.", + "type": "object", + "required": [ + "any" + ], + "properties": { + "any": { + "$ref": "#/definitions/AnyMsg" } }, "additionalProperties": false @@ -301,6 +336,10 @@ } ] }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, "DistributionMsg": { "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", "oneOf": [ @@ -321,13 +360,14 @@ "description": "The `withdraw_address`", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", "type": "object", "required": [ "withdraw_delegator_reward" @@ -343,7 +383,34 @@ "description": "The `validator_address`", "type": "string" } - } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -351,6 +418,7 @@ ] }, "GovMsg": { + "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```", "oneOf": [ { "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", @@ -362,25 +430,74 @@ "vote": { "type": "object", "required": [ - "proposal_id", - "vote" + "option", + "proposal_id" ], "properties": { + "option": { + "description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.", + "allOf": [ + { + "$ref": "#/definitions/VoteOption" + } + ] + }, "proposal_id": { "type": "integer", "format": "uint64", "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address.", + "type": "object", + "required": [ + "vote_weighted" + ], + "properties": { + "vote_weighted": { + "type": "object", + "required": [ + "options", + "proposal_id" + ], + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/WeightedVoteOption" + } }, - "vote": { - "$ref": "#/definitions/VoteOption" + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false } ] }, + "IbcAcknowledgement": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false + }, "IbcMsg": { "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)", "oneOf": [ @@ -409,9 +526,16 @@ ] }, "channel_id": { - "description": "exisiting channel to send the tokens over", + "description": "existing channel to send the tokens over", "type": "string" }, + "memo": { + "description": "An optional memo. See the blog post [\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead.", + "type": [ + "string", + "null" + ] + }, "timeout": { "description": "when packet times out, measured on remote chain", "allOf": [ @@ -424,7 +548,8 @@ "description": "address on the remote chain to receive these tokens", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -458,7 +583,47 @@ } ] } - } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Acknowledges a packet that this contract received over IBC. This allows acknowledging a packet that was not acknowledged yet in the `ibc_packet_receive` call.", + "type": "object", + "required": [ + "write_acknowledgement" + ], + "properties": { + "write_acknowledgement": { + "type": "object", + "required": [ + "ack", + "channel_id", + "packet_sequence" + ], + "properties": { + "ack": { + "description": "The acknowledgement to send back", + "allOf": [ + { + "$ref": "#/definitions/IbcAcknowledgement" + } + ] + }, + "channel_id": { + "description": "Existing channel where the packet was received", + "type": "string" + }, + "packet_sequence": { + "description": "Sequence number of the packet that was received", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -479,7 +644,8 @@ "channel_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -510,7 +676,8 @@ } ] } - } + }, + "additionalProperties": false }, "IbcTimeoutBlock": { "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", @@ -527,21 +694,45 @@ "minimum": 0.0 }, "revision": { - "description": "the version that the client is currently on (eg. after reseting the chain this could increment 1 as height drops to 0)", + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", "type": "integer", "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "ReplyOn": { "description": "Use this to define when the contract gets a response callback. If you only need it for errors or success you can select just those in order to save gas.", - "type": "string", - "enum": [ - "always", - "error", - "success", - "never" + "oneOf": [ + { + "description": "Always perform a callback after SubMsg is processed", + "type": "string", + "enum": [ + "always" + ] + }, + { + "description": "Only callback if SubMsg returned an error, no callback on success case", + "type": "string", + "enum": [ + "error" + ] + }, + { + "description": "Only callback if SubMsg was successful, no callback on error case", + "type": "string", + "enum": [ + "success" + ] + }, + { + "description": "Never make a callback - this is like the original CosmosMsg semantics", + "type": "string", + "enum": [ + "never" + ] + } ] }, "StakingMsg": { @@ -567,7 +758,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -592,7 +784,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -621,7 +814,8 @@ "src_validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -638,7 +832,7 @@ ], "properties": { "gas_limit": { - "description": "Gas limit measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).", + "description": "Gas limit measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).\n\nSetting this to `None` means unlimited. Then the submessage execution can consume all gas of the current execution context.", "type": [ "integer", "null" @@ -655,10 +849,20 @@ "msg": { "$ref": "#/definitions/CosmosMsg_for_CustomMsg" }, + "payload": { + "description": "Some arbitrary data that the contract can set in an application specific way. This is just passed into the `reply` entry point and is not stored to state. Any encoding can be used. If `id` is used to identify a particular action, the encoding can also be different for each of those actions since you can match `id` first and then start processing the `payload`.\n\nThe environment restricts the length of this field in order to avoid abuse. The limit is environment specific and can change over time. The initial default is 128 KiB.\n\nUnset/nil/null cannot be differentiated from empty data.\n\nOn chains running CosmWasm 1.x this field will be ignored.", + "default": "", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, "reply_on": { "$ref": "#/definitions/ReplyOn" } - } + }, + "additionalProperties": false }, "Timestamp": { "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", @@ -668,8 +872,8 @@ } ] }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", "type": "string" }, "Uint64": { @@ -720,13 +924,14 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address.", "type": "object", "required": [ "instantiate" @@ -759,7 +964,7 @@ } }, "label": { - "description": "A human-readbale label for the contract", + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", "type": "string" }, "msg": { @@ -770,7 +975,63 @@ } ] } - } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code using a predictable address derivation algorithm implemented in [`cosmwasm_std::instantiate2_address`].\n\nThis is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). `sender` is automatically filled with the current contract's address. `fix_msg` is automatically set to false.", + "type": "object", + "required": [ + "instantiate2" + ], + "properties": { + "instantiate2": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg", + "salt" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "salt": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -807,7 +1068,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -832,7 +1094,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -853,12 +1116,29 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false } ] + }, + "WeightedVoteOption": { + "type": "object", + "required": [ + "option", + "weight" + ], + "properties": { + "option": { + "$ref": "#/definitions/VoteOption" + }, + "weight": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false } } }, @@ -993,7 +1273,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1018,28 +1299,56 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "This calls into the native bank module for all denominations. Note that this may be much more expensive than Balance and should be avoided if possible. Return value is AllBalanceResponse.", + "description": "This calls into the native bank module for querying metadata for a specific bank token. Return value is DenomMetadataResponse", "type": "object", "required": [ - "all_balances" + "denom_metadata" ], "properties": { - "all_balances": { + "denom_metadata": { "type": "object", "required": [ - "address" + "denom" ], "properties": { - "address": { + "denom": { "type": "string" } - } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This calls into the native bank module for querying metadata for all bank tokens that have a metadata entry. Return value is AllDenomMetadataResponse", + "type": "object", + "required": [ + "all_denom_metadata" + ], + "properties": { + "all_denom_metadata": { + "type": "object", + "properties": { + "pagination": { + "anyOf": [ + { + "$ref": "#/definitions/PageRequest" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1050,39 +1359,138 @@ "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, - "IbcQuery": { - "description": "These are queries to the various IBC modules to see the state of the contract's IBC connection. These will return errors if the contract is not \"ibc enabled\"", + "DistributionQuery": { "oneOf": [ { - "description": "Gets the Port ID the current contract is bound to.\n\nReturns a `PortIdResponse`.", + "description": "See ", "type": "object", "required": [ - "port_id" + "delegator_withdraw_address" ], "properties": { - "port_id": { - "type": "object" + "delegator_withdraw_address": { + "type": "object", + "required": [ + "delegator_address" + ], + "properties": { + "delegator_address": { + "type": "string" + } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "Lists all channels that are bound to a given port. If `port_id` is omitted, this list all channels bound to the contract's port.\n\nReturns a `ListChannelsResponse`.", + "description": "See ", "type": "object", "required": [ - "list_channels" + "delegation_rewards" ], "properties": { - "list_channels": { + "delegation_rewards": { "type": "object", + "required": [ + "delegator_address", + "validator_address" + ], "properties": { - "port_id": { - "type": [ - "string", - "null" - ] + "delegator_address": { + "type": "string" + }, + "validator_address": { + "type": "string" } - } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "See ", + "type": "object", + "required": [ + "delegation_total_rewards" + ], + "properties": { + "delegation_total_rewards": { + "type": "object", + "required": [ + "delegator_address" + ], + "properties": { + "delegator_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "See ", + "type": "object", + "required": [ + "delegator_validators" + ], + "properties": { + "delegator_validators": { + "type": "object", + "required": [ + "delegator_address" + ], + "properties": { + "delegator_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "GrpcQuery": { + "description": "Queries the chain using a grpc query. This allows to query information that is not exposed in our API. The chain needs to allowlist the supported queries. The drawback of this query is that you have to handle the protobuf encoding and decoding yourself.\n\nThe returned data is protobuf encoded. The protobuf type depends on the query. Because of this, using it with the [`query`](crate::QuerierWrapper::query) function will result in a deserialization error. Use [`raw_query`](crate::Querier::raw_query) or [`query_grpc`](crate::QuerierWrapper::query_grpc) instead.\n\nTo find the path, as well as the request and response types, you can query the chain's gRPC endpoint using a tool like [grpcurl](https://github.com/fullstorydev/grpcurl).", + "type": "object", + "required": [ + "data", + "path" + ], + "properties": { + "data": { + "description": "The expected protobuf message type (not [Any](https://protobuf.dev/programming-guides/proto3/#any)), binary encoded", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "path": { + "description": "The fully qualified endpoint path used for routing. It follows the format `/service_path/method_name`, eg. \"/cosmos.authz.v1beta1.Query/Grants\"", + "type": "string" + } + }, + "additionalProperties": false + }, + "IbcQuery": { + "description": "These are queries to the various IBC modules to see the state of the contract's IBC connection. Most of these will return errors if the contract is not \"ibc enabled\".", + "oneOf": [ + { + "description": "Gets the Port ID the current contract is bound to.\n\nReturns a `PortIdResponse`.", + "type": "object", + "required": [ + "port_id" + ], + "properties": { + "port_id": { + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -1109,13 +1517,43 @@ "null" ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false } ] }, + "PageRequest": { + "description": "Simplified version of the PageRequest type for pagination from the cosmos-sdk", + "type": "object", + "required": [ + "limit", + "reverse" + ], + "properties": { + "key": { + "anyOf": [ + { + "$ref": "#/definitions/Binary" + }, + { + "type": "null" + } + ] + }, + "limit": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "reverse": { + "type": "boolean" + } + }, + "additionalProperties": false + }, "QueryRequest_for_SpecialQuery": { "oneOf": [ { @@ -1154,8 +1592,21 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "distribution" + ], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionQuery" + } + }, + "additionalProperties": false + }, { "description": "A Stargate query is encoded the same way as abci_query, with path and protobuf encoded request data. The format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md). The response is protobuf encoded data directly without a JSON response wrapper. The caller is responsible for compiling the proper protobuf definitions for both requests and responses.", + "deprecated": true, "type": "object", "required": [ "stargate" @@ -1177,10 +1628,11 @@ ] }, "path": { - "description": "this is the fully qualified service path used for routing, eg. custom/cosmos_sdk.x.bank.v1.Query/QueryBalance", + "description": "this is the fully qualified service path used for routing, eg. \"/cosmos_sdk.x.bank.v1.Query/QueryBalance\"", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1208,6 +1660,18 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "grpc" + ], + "properties": { + "grpc": { + "$ref": "#/definitions/GrpcQuery" + } + }, + "additionalProperties": false } ] }, @@ -1260,7 +1724,8 @@ ], "properties": { "bonded_denom": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -1281,7 +1746,8 @@ "delegator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1306,7 +1772,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1319,7 +1786,8 @@ ], "properties": { "all_validators": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -1338,10 +1806,11 @@ ], "properties": { "address": { - "description": "The validator's address (e.g. (e.g. cosmosvaloper1...))", + "description": "The validator's address (e.g. cosmosvaloper1...)", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1375,7 +1844,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1405,13 +1875,14 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false }, { - "description": "returns a ContractInfoResponse with metadata on the contract from the runtime", + "description": "Returns a [`ContractInfoResponse`] with metadata on the contract from the runtime", "type": "object", "required": [ "contract_info" @@ -1426,7 +1897,32 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns a [`CodeInfoResponse`] with metadata of the code", + "type": "object", + "required": [ + "code_info" + ], + "properties": { + "code_info": { + "type": "object", + "required": [ + "code_id" + ], + "properties": { + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1521,16 +2017,33 @@ "result" ], "properties": { + "gas_used": { + "description": "The amount of gas used by the submessage, measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).\n\nThis only contains a useful value on chains running CosmWasm 2.0 or higher. On older chains, this field is always 0.", + "default": 0, + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, "id": { "description": "The ID that the contract set when emitting the `SubMsg`. Use this to identify which submessage triggered the `reply`.", "type": "integer", "format": "uint64", "minimum": 0.0 }, + "payload": { + "description": "Some arbitrary data that the contract set when emitting the `SubMsg`. This is just passed into the `reply` entry point and is not stored to state.\n\nUnset/nil/null cannot be differentiated from empty data.\n\nOn chains running CosmWasm 1.x this field is never filled.", + "default": "", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, "result": { "$ref": "#/definitions/SubMsgResult" } }, + "additionalProperties": false, "definitions": { "Attribute": { "description": "An key value pair that is used in the context of event attributes in logs", @@ -1546,14 +2059,15 @@ "value": { "type": "string" } - } + }, + "additionalProperties": false }, "Binary": { "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, "Event": { - "description": "A full [*Cosmos SDK* event].\n\nThis version uses string attributes (similar to [*Cosmos SDK* StringEvent]), which then get magically converted to bytes for Tendermint somewhere between the Rust-Go interface, JSON deserialization and the `NewEvent` call in Cosmos SDK.\n\n[*Cosmos SDK* event]: https://docs.cosmos.network/main/core/events.html [*Cosmos SDK* StringEvent]: https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/base/abci/v1beta1/abci.proto#L56-L70", + "description": "A full [*Cosmos SDK* event].\n\nThis version uses string attributes (similar to [*Cosmos SDK* StringEvent]), which then get magically converted to bytes for Tendermint somewhere between the Rust-Go interface, JSON deserialization and the `NewEvent` call in Cosmos SDK.\n\n[*Cosmos SDK* event]: https://docs.cosmos.network/main/learn/advanced/events [*Cosmos SDK* StringEvent]: https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/base/abci/v1beta1/abci.proto#L56-L70", "type": "object", "required": [ "attributes", @@ -1561,7 +2075,7 @@ ], "properties": { "attributes": { - "description": "The attributes to be included in the event.\n\nYou can learn more about these from [*Cosmos SDK* docs].\n\n[*Cosmos SDK* docs]: https://docs.cosmos.network/main/core/events.html", + "description": "The attributes to be included in the event.\n\nYou can learn more about these from [*Cosmos SDK* docs].\n\n[*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events", "type": "array", "items": { "$ref": "#/definitions/Attribute" @@ -1571,16 +2085,34 @@ "description": "The event type. This is renamed to \"ty\" because \"type\" is reserved in Rust. This sucks, we know.", "type": "string" } - } + }, + "additionalProperties": false + }, + "MsgResponse": { + "type": "object", + "required": [ + "type_url", + "value" + ], + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false }, "SubMsgResponse": { - "description": "The information we get back from a successful sub message execution, with full Cosmos SDK events.", + "description": "The information we get back from a successful sub message execution", "type": "object", "required": [ "events" ], "properties": { "data": { + "deprecated": true, "anyOf": [ { "$ref": "#/definitions/Binary" @@ -1591,15 +2123,25 @@ ] }, "events": { + "description": "The Cosmos SDK events emitted by the submessage.\n\nThis is only filled if the submessage was itself a [`crate::WasmMsg`]. The reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic, so the VM only returns events of wasm messages, which we know are deterministic.\n\n[not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events", "type": "array", "items": { "$ref": "#/definitions/Event" } + }, + "msg_responses": { + "description": "The responses from the messages emitted by the submessage. In most cases, this is equivalent to the Cosmos SDK's [MsgResponses], which usually contains a [single message]. However, wasmd allows chains to translate a single contract message into multiple SDK messages. In that case all the MsgResponses from each are concatenated into this flattened `Vec`.\n\n[MsgResponses]: https://github.com/cosmos/cosmos-sdk/blob/316750cc8cd8b3296fa233f4da2e39cbcdc34517/proto/cosmos/base/abci/v1beta1/abci.proto#L106-L109 [single message]: https://github.com/cosmos/cosmos-sdk/blob/v0.50.4/baseapp/baseapp.go#L1020-L1023", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/MsgResponse" + } } - } + }, + "additionalProperties": false }, "SubMsgResult": { - "description": "This is the result type that is returned from a sub message execution.\n\nWe use a custom type here instead of Rust's Result because we want to be able to define the serialization, which is a public interface. Every language that compiles to Wasm and runs in the ComsWasm VM needs to create the same JSON representation.\n\nUntil version 1.0.0-beta5, `ContractResult` was used instead of this type. Once serialized, the two types are the same. However, in the Rust type system we want different types for clarity and documenation reasons.\n\n# Examples\n\nSuccess:\n\n``` # use cosmwasm_std::{to_vec, Binary, Event, SubMsgResponse, SubMsgResult}; let response = SubMsgResponse { data: Some(Binary::from_base64(\"MTIzCg==\").unwrap()), events: vec![Event::new(\"wasm\").add_attribute(\"fo\", \"ba\")], }; let result: SubMsgResult = SubMsgResult::Ok(response); assert_eq!(to_vec(&result).unwrap(), br#\"{\"ok\":{\"events\":[{\"type\":\"wasm\",\"attributes\":[{\"key\":\"fo\",\"value\":\"ba\"}]}],\"data\":\"MTIzCg==\"}}\"#); ```\n\nFailure:\n\n``` # use cosmwasm_std::{to_vec, SubMsgResult, Response}; let error_msg = String::from(\"Something went wrong\"); let result = SubMsgResult::Err(error_msg); assert_eq!(to_vec(&result).unwrap(), br#\"{\"error\":\"Something went wrong\"}\"#); ```", + "description": "This is the result type that is returned from a sub message execution.\n\nWe use a custom type here instead of Rust's Result because we want to be able to define the serialization, which is a public interface. Every language that compiles to Wasm and runs in the ComsWasm VM needs to create the same JSON representation.\n\nUntil version 1.0.0-beta5, `ContractResult` was used instead of this type. Once serialized, the two types are the same. However, in the Rust type system we want different types for clarity and documentation reasons.\n\n# Examples\n\nSuccess:\n\n``` # use cosmwasm_std::{to_json_string, Binary, Event, SubMsgResponse, SubMsgResult}; #[allow(deprecated)] let response = SubMsgResponse { data: Some(Binary::from_base64(\"MTIzCg==\").unwrap()), events: vec![Event::new(\"wasm\").add_attribute(\"foo\", \"bar\")], msg_responses: vec![], }; let result: SubMsgResult = SubMsgResult::Ok(response); assert_eq!( to_json_string(&result).unwrap(), r#\"{\"ok\":{\"events\":[{\"type\":\"wasm\",\"attributes\":[{\"key\":\"foo\",\"value\":\"bar\"}]}],\"data\":\"MTIzCg==\",\"msg_responses\":[]}}\"#, ); ```\n\nFailure:\n\n``` # use cosmwasm_std::{to_json_string, SubMsgResult, Response}; let error_msg = String::from(\"Something went wrong\"); let result = SubMsgResult::Err(error_msg); assert_eq!(to_json_string(&result).unwrap(), r#\"{\"error\":\"Something went wrong\"}\"#); ```", "oneOf": [ { "type": "object", @@ -1614,7 +2156,7 @@ "additionalProperties": false }, { - "description": "An error type that every custom error created by contract developers can be converted to. This could potientially have more structure, but String is the easiest.", + "description": "An error type that every custom error created by contract developers can be converted to. This could potentially have more structure, but String is the easiest.", "type": "object", "required": [ "error" diff --git a/contracts/reflect/examples/schema.rs b/contracts/reflect/src/bin/schema.rs similarity index 100% rename from contracts/reflect/examples/schema.rs rename to contracts/reflect/src/bin/schema.rs diff --git a/contracts/reflect/src/contract.rs b/contracts/reflect/src/contract.rs index f760a9a271..8ee454db22 100644 --- a/contracts/reflect/src/contract.rs +++ b/contracts/reflect/src/contract.rs @@ -1,6 +1,6 @@ use cosmwasm_std::{ - entry_point, to_binary, to_vec, Binary, ContractResult, CosmosMsg, Deps, DepsMut, Env, - MessageInfo, QueryRequest, QueryResponse, Reply, Response, StdError, StdResult, SubMsg, + entry_point, to_json_binary, to_json_vec, Binary, ContractResult, CosmosMsg, Deps, DepsMut, + Env, MessageInfo, QueryRequest, QueryResponse, Reply, Response, StdError, StdResult, SubMsg, SystemResult, }; @@ -9,7 +9,7 @@ use crate::msg::{ CapitalizedResponse, ChainResponse, CustomMsg, ExecuteMsg, InstantiateMsg, OwnerResponse, QueryMsg, RawResponse, SpecialQuery, SpecialResponse, }; -use crate::state::{config, config_read, replies, replies_read, State}; +use crate::state::{load_config, load_reply, save_config, save_reply, State}; #[entry_point] pub fn instantiate( @@ -19,7 +19,7 @@ pub fn instantiate( _msg: InstantiateMsg, ) -> StdResult> { let state = State { owner: info.sender }; - config(deps.storage).save(&state)?; + save_config(deps.storage, &state)?; Ok(Response::default()) } @@ -43,7 +43,7 @@ pub fn try_reflect( info: MessageInfo, msgs: Vec>, ) -> Result, ReflectError> { - let state = config(deps.storage).load()?; + let state = load_config(deps.storage)?; if info.sender != state.owner { return Err(ReflectError::NotCurrentOwner { @@ -67,7 +67,7 @@ pub fn try_reflect_subcall( info: MessageInfo, msgs: Vec>, ) -> Result, ReflectError> { - let state = config(deps.storage).load()?; + let state = load_config(deps.storage)?; if info.sender != state.owner { return Err(ReflectError::NotCurrentOwner { expected: state.owner.into(), @@ -91,42 +91,44 @@ pub fn try_change_owner( new_owner: String, ) -> Result, ReflectError> { let api = deps.api; - config(deps.storage).update(|mut state| { - if info.sender != state.owner { - return Err(ReflectError::NotCurrentOwner { - expected: state.owner.into(), - actual: info.sender.into(), - }); - } - state.owner = api.addr_validate(&new_owner)?; - Ok(state) - })?; + + let mut state = load_config(deps.storage)?; + + if info.sender != state.owner { + return Err(ReflectError::NotCurrentOwner { + expected: state.owner.into(), + actual: info.sender.into(), + }); + } + state.owner = api.addr_validate(&new_owner)?; + + save_config(deps.storage, &state)?; + Ok(Response::new() .add_attribute("action", "change_owner") .add_attribute("owner", new_owner)) } -/// This just stores the result for future query +/// This just stores the result for future queries #[entry_point] pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result { - let key = msg.id.to_be_bytes(); - replies(deps.storage).save(&key, &msg)?; + save_reply(deps.storage, msg.id, &msg)?; Ok(Response::default()) } #[entry_point] pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { match msg { - QueryMsg::Owner {} => to_binary(&query_owner(deps)?), - QueryMsg::Capitalized { text } => to_binary(&query_capitalized(deps, text)?), - QueryMsg::Chain { request } => to_binary(&query_chain(deps, &request)?), - QueryMsg::Raw { contract, key } => to_binary(&query_raw(deps, contract, key)?), - QueryMsg::SubMsgResult { id } => to_binary(&query_subcall(deps, id)?), + QueryMsg::Owner {} => to_json_binary(&query_owner(deps)?), + QueryMsg::Capitalized { text } => to_json_binary(&query_capitalized(deps, text)?), + QueryMsg::Chain { request } => to_json_binary(&query_chain(deps, &request)?), + QueryMsg::Raw { contract, key } => to_json_binary(&query_raw(deps, contract, key)?), + QueryMsg::SubMsgResult { id } => to_json_binary(&query_subcall(deps, id)?), } } fn query_owner(deps: Deps) -> StdResult { - let state = config_read(deps.storage).load()?; + let state = load_config(deps.storage)?; let resp = OwnerResponse { owner: state.owner.into(), }; @@ -134,8 +136,7 @@ fn query_owner(deps: Deps) -> StdResult { } fn query_subcall(deps: Deps, id: u64) -> StdResult { - let key = id.to_be_bytes(); - replies_read(deps.storage).load(&key) + load_reply(deps.storage, id) } fn query_capitalized(deps: Deps, text: String) -> StdResult { @@ -148,17 +149,15 @@ fn query_chain( deps: Deps, request: &QueryRequest, ) -> StdResult { - let raw = to_vec(request).map_err(|serialize_err| { - StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) + let raw = to_json_vec(request).map_err(|serialize_err| { + StdError::msg(format_args!("Serializing QueryRequest: {serialize_err}")) })?; match deps.querier.raw_query(&raw) { - SystemResult::Err(system_err) => Err(StdError::generic_err(format!( - "Querier system error: {}", - system_err + SystemResult::Err(system_err) => Err(StdError::msg(format_args!( + "Querier system error: {system_err}" ))), - SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( - "Querier contract error: {}", - contract_err + SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::msg(format_args!( + "Querier contract error: {contract_err}" ))), SystemResult::Ok(ContractResult::Ok(value)) => Ok(ChainResponse { data: value }), } @@ -175,18 +174,19 @@ fn query_raw(deps: Deps, contract: String, key: Binary) -> StdResu mod tests { use super::*; use crate::testing::mock_dependencies_with_custom_querier; - use cosmwasm_std::testing::{mock_env, mock_info, MOCK_CONTRACT_ADDR}; + use cosmwasm_std::testing::{message_info, mock_env, MOCK_CONTRACT_ADDR}; use cosmwasm_std::{ - coin, coins, from_binary, AllBalanceResponse, BankMsg, BankQuery, Binary, Event, - StakingMsg, StdError, SubMsgResponse, SubMsgResult, + coin, coins, from_json, BalanceResponse, BankMsg, BankQuery, Binary, Event, StakingMsg, + SubMsgResponse, SubMsgResult, }; #[test] - fn proper_instantialization() { + fn proper_initialization() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(1000, "earth")); + let info = message_info(&creator, &coins(1000, "earth")); // we can just call .unwrap() to assert this was a success let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); @@ -194,15 +194,16 @@ mod tests { // it worked, let's query the state let value = query_owner(deps.as_ref()).unwrap(); - assert_eq!("creator", value.owner.as_str()); + assert_eq!(value.owner, creator.to_string()); } #[test] fn reflect() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); let payload = vec![BankMsg::Send { @@ -214,7 +215,7 @@ mod tests { let msg = ExecuteMsg::ReflectMsg { msgs: payload.clone(), }; - let info = mock_info("creator", &[]); + let info = message_info(&creator, &[]); let res = execute(deps.as_mut(), mock_env(), info, msg).unwrap(); let payload: Vec<_> = payload.into_iter().map(SubMsg::new).collect(); assert_eq!(payload, res.messages); @@ -223,9 +224,11 @@ mod tests { #[test] fn reflect_requires_owner() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); + let random = deps.api.addr_make("random"); let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); // signer is not owner @@ -236,36 +239,41 @@ mod tests { .into()]; let msg = ExecuteMsg::ReflectMsg { msgs: payload }; - let info = mock_info("random", &[]); + let info = message_info(&random, &[]); let res = execute(deps.as_mut(), mock_env(), info, msg); match res.unwrap_err() { ReflectError::NotCurrentOwner { .. } => {} - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } #[test] fn reflect_reject_empty_msgs() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - let info = mock_info("creator", &[]); + let info = message_info(&creator, &[]); let payload = vec![]; let msg = ExecuteMsg::ReflectMsg { msgs: payload }; let err = execute(deps.as_mut(), mock_env(), info, msg).unwrap_err(); - assert_eq!(err, ReflectError::MessagesEmpty); + assert_eq!( + err.to_string(), + "Messages empty. Must reflect at least one message" + ); } #[test] fn reflect_multiple_messages() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); let payload = vec![ @@ -275,7 +283,7 @@ mod tests { } .into(), // make sure we can pass through custom native messages - CustomMsg::Raw(Binary(b"{\"foo\":123}".to_vec())).into(), + CustomMsg::Raw(Binary::new(b"{\"foo\":123}".to_vec())).into(), CustomMsg::Debug("Hi, Dad!".to_string()).into(), StakingMsg::Delegate { validator: String::from("validator"), @@ -287,7 +295,7 @@ mod tests { let msg = ExecuteMsg::ReflectMsg { msgs: payload.clone(), }; - let info = mock_info("creator", &[]); + let info = message_info(&creator, &[]); let res = execute(deps.as_mut(), mock_env(), info, msg).unwrap(); let payload: Vec<_> = payload.into_iter().map(SubMsg::new).collect(); assert_eq!(payload, res.messages); @@ -296,65 +304,70 @@ mod tests { #[test] fn change_owner_works() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - let info = mock_info("creator", &[]); - let new_owner = String::from("friend"); - let msg = ExecuteMsg::ChangeOwner { owner: new_owner }; + let info = message_info(&creator, &[]); + let new_owner = deps.api.addr_make("friend"); + let msg = ExecuteMsg::ChangeOwner { + owner: new_owner.to_string(), + }; let res = execute(deps.as_mut(), mock_env(), info, msg).unwrap(); // should change state assert_eq!(0, res.messages.len()); let value = query_owner(deps.as_ref()).unwrap(); - assert_eq!("friend", value.owner.as_str()); + assert_eq!(value.owner, new_owner.as_str()); } #[test] fn change_owner_requires_current_owner_as_sender() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); + let random = deps.api.addr_make("random"); + let friend = deps.api.addr_make("friend"); let msg = InstantiateMsg {}; - let creator = String::from("creator"); - let info = mock_info(&creator, &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - let random = String::from("random"); - let info = mock_info(&random, &[]); - let new_owner = String::from("friend"); - let msg = ExecuteMsg::ChangeOwner { owner: new_owner }; + let info = message_info(&random, &[]); + let msg = ExecuteMsg::ChangeOwner { + owner: friend.to_string(), + }; let err = execute(deps.as_mut(), mock_env(), info, msg).unwrap_err(); assert_eq!( - err, - ReflectError::NotCurrentOwner { - expected: creator, - actual: random - } + err.to_string(), + "Permission denied: the sender is not the current owner" ); } #[test] fn change_owner_errors_for_invalid_new_address() { let mut deps = mock_dependencies_with_custom_querier(&[]); - let creator = String::from("creator"); + let creator = deps.api.addr_make("creator"); let msg = InstantiateMsg {}; - let info = mock_info(&creator, &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); let msg = ExecuteMsg::ChangeOwner { owner: String::from("x"), }; let err = execute(deps.as_mut(), mock_env(), info, msg).unwrap_err(); match err { - ReflectError::Std(StdError::GenericErr { msg, .. }) => { - assert!(msg.contains("human address too short")) + ReflectError::Std(err) => { + assert!( + err.to_string().contains("kind: Other, error: parse failed"), + "{err}" + ) } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -366,7 +379,7 @@ mod tests { text: "demo one".to_string(), }; let response = query(deps.as_ref(), mock_env(), msg).unwrap(); - let value: CapitalizedResponse = from_binary(&response).unwrap(); + let value: CapitalizedResponse = from_json(response).unwrap(); assert_eq!(value.text, "DEMO ONE"); } @@ -376,32 +389,34 @@ mod tests { // with bank query let msg = QueryMsg::Chain { - request: BankQuery::AllBalances { + request: BankQuery::Balance { address: MOCK_CONTRACT_ADDR.to_string(), + denom: "ucosm".to_string(), } .into(), }; let response = query(deps.as_ref(), mock_env(), msg).unwrap(); - let outer: ChainResponse = from_binary(&response).unwrap(); - let inner: AllBalanceResponse = from_binary(&outer.data).unwrap(); - assert_eq!(inner.amount, coins(123, "ucosm")); + let outer: ChainResponse = from_json(response).unwrap(); + let inner: BalanceResponse = from_json(outer.data).unwrap(); + assert_eq!(inner.amount, coin(123, "ucosm")); // with custom query let msg = QueryMsg::Chain { request: SpecialQuery::Ping {}.into(), }; let response = query(deps.as_ref(), mock_env(), msg).unwrap(); - let outer: ChainResponse = from_binary(&response).unwrap(); - let inner: SpecialResponse = from_binary(&outer.data).unwrap(); + let outer: ChainResponse = from_json(response).unwrap(); + let inner: SpecialResponse = from_json(outer.data).unwrap(); assert_eq!(inner.msg, "pong"); } #[test] fn reflect_subcall() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); let id = 123u64; @@ -416,7 +431,7 @@ mod tests { let msg = ExecuteMsg::ReflectSubMsg { msgs: vec![payload.clone()], }; - let info = mock_info("creator", &[]); + let info = message_info(&creator, &[]); let mut res = execute(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(1, res.messages.len()); let msg = res.messages.pop().expect("must have a message"); @@ -427,23 +442,33 @@ mod tests { #[test] fn reply_and_query() { let mut deps = mock_dependencies_with_custom_querier(&[]); + let creator = deps.api.addr_make("creator"); let msg = InstantiateMsg {}; - let info = mock_info("creator", &coins(2, "token")); + let info = message_info(&creator, &coins(2, "token")); let _res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); let id = 123u64; + let payload = Binary::from(b"my dear"); let data = Binary::from(b"foobar"); let events = vec![Event::new("message").add_attribute("signer", "caller-addr")]; + let gas_used = 1234567u64; + #[allow(deprecated)] let result = SubMsgResult::Ok(SubMsgResponse { events: events.clone(), data: Some(data.clone()), + msg_responses: vec![], }); - let subcall = Reply { id, result }; - let res = reply(deps.as_mut(), mock_env(), subcall).unwrap(); + let the_reply = Reply { + id, + payload, + gas_used, + result, + }; + let res = reply(deps.as_mut(), mock_env(), the_reply).unwrap(); assert_eq!(0, res.messages.len()); - // query for a non-existant id + // query for a non-existent id let qres = query( deps.as_ref(), mock_env(), @@ -453,10 +478,13 @@ mod tests { // query for the real id let raw = query(deps.as_ref(), mock_env(), QueryMsg::SubMsgResult { id }).unwrap(); - let qres: Reply = from_binary(&raw).unwrap(); + let qres: Reply = from_json(raw).unwrap(); assert_eq!(qres.id, id); let result = qres.result.unwrap(); - assert_eq!(result.data, Some(data)); + #[allow(deprecated)] + { + assert_eq!(result.data, Some(data)); + } assert_eq!(result.events, events); } } diff --git a/contracts/reflect/src/errors.rs b/contracts/reflect/src/errors.rs index 98db940523..3d05bc0b91 100644 --- a/contracts/reflect/src/errors.rs +++ b/contracts/reflect/src/errors.rs @@ -1,7 +1,7 @@ use cosmwasm_std::StdError; use thiserror::Error; -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Debug)] pub enum ReflectError { #[error("{0}")] // let thiserror implement From for you diff --git a/contracts/reflect/src/state.rs b/contracts/reflect/src/state.rs index b1d52aa3e6..6761145bba 100644 --- a/contracts/reflect/src/state.rs +++ b/contracts/reflect/src/state.rs @@ -1,10 +1,10 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use cosmwasm_std::{Addr, Reply, Storage}; -use cosmwasm_storage::{ - bucket, bucket_read, singleton, singleton_read, Bucket, ReadonlyBucket, ReadonlySingleton, - Singleton, +use cosmwasm_std::{ + from_json, + storage_keys::{namespace_with_key, to_length_prefixed}, + to_json_vec, Addr, Reply, StdError, StdResult, Storage, }; const CONFIG_KEY: &[u8] = b"config"; @@ -15,18 +15,33 @@ pub struct State { pub owner: Addr, } -pub fn config(storage: &mut dyn Storage) -> Singleton { - singleton(storage, CONFIG_KEY) +pub fn load_reply(storage: &dyn Storage, id: u64) -> StdResult { + storage + .get(&namespace_with_key(&[RESULT_PREFIX], &id.to_be_bytes())) + .ok_or_else(|| StdError::msg(format!("reply {id} not found"))) + .and_then(from_json) } -pub fn config_read(storage: &dyn Storage) -> ReadonlySingleton { - singleton_read(storage, CONFIG_KEY) +pub fn save_reply(storage: &mut dyn Storage, id: u64, reply: &Reply) -> StdResult<()> { + storage.set( + &namespace_with_key(&[RESULT_PREFIX], &id.to_be_bytes()), + &to_json_vec(reply)?, + ); + Ok(()) } -pub fn replies(storage: &mut dyn Storage) -> Bucket { - bucket(storage, RESULT_PREFIX) +pub fn remove_reply(storage: &mut dyn Storage, id: u64) { + storage.remove(&namespace_with_key(&[RESULT_PREFIX], &id.to_be_bytes())); } -pub fn replies_read(storage: &dyn Storage) -> ReadonlyBucket { - bucket_read(storage, RESULT_PREFIX) +pub fn load_config(storage: &dyn Storage) -> StdResult { + storage + .get(&to_length_prefixed(CONFIG_KEY)) + .ok_or_else(|| StdError::msg("config not found")) + .and_then(from_json) +} + +pub fn save_config(storage: &mut dyn Storage, item: &State) -> StdResult<()> { + storage.set(&to_length_prefixed(CONFIG_KEY), &to_json_vec(item)?); + Ok(()) } diff --git a/contracts/reflect/src/testing.rs b/contracts/reflect/src/testing.rs index 8f6ce714b1..f46dac69ed 100644 --- a/contracts/reflect/src/testing.rs +++ b/contracts/reflect/src/testing.rs @@ -3,7 +3,7 @@ use std::marker::PhantomData; use crate::msg::{SpecialQuery, SpecialResponse}; use cosmwasm_std::testing::{MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR}; -use cosmwasm_std::{to_binary, Binary, Coin, ContractResult, OwnedDeps, SystemResult}; +use cosmwasm_std::{to_json_binary, Binary, Coin, ContractResult, OwnedDeps, SystemResult}; /// A drop-in replacement for cosmwasm_std::testing::mock_dependencies /// this uses our CustomQuerier. @@ -26,18 +26,18 @@ pub fn custom_query_execute(query: &SpecialQuery) -> ContractResult { SpecialQuery::Ping {} => "pong".to_string(), SpecialQuery::Capitalized { text } => text.to_uppercase(), }; - to_binary(&SpecialResponse { msg }).into() + to_json_binary(&SpecialResponse { msg }).into() } #[cfg(test)] mod tests { use super::*; - use cosmwasm_std::{from_binary, QuerierWrapper, QueryRequest}; + use cosmwasm_std::{from_json, QuerierWrapper, QueryRequest}; #[test] fn custom_query_execute_ping() { let res = custom_query_execute(&SpecialQuery::Ping {}).unwrap(); - let response: SpecialResponse = from_binary(&res).unwrap(); + let response: SpecialResponse = from_json(res).unwrap(); assert_eq!(response.msg, "pong"); } @@ -47,7 +47,7 @@ mod tests { text: "fOObaR".to_string(), }) .unwrap(); - let response: SpecialResponse = from_binary(&res).unwrap(); + let response: SpecialResponse = from_json(res).unwrap(); assert_eq!(response.msg, "FOOBAR"); } diff --git a/contracts/reflect/tests/integration.rs b/contracts/reflect/tests/integration.rs index 4df7685dc8..9cf64b85b3 100644 --- a/contracts/reflect/tests/integration.rs +++ b/contracts/reflect/tests/integration.rs @@ -1,26 +1,11 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests as follows: -//! 1. Copy them over verbatim -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) use cosmwasm_std::{ - coin, coins, from_binary, BankMsg, BankQuery, Binary, Coin, ContractResult, Event, - QueryRequest, Reply, Response, StakingMsg, SubMsg, SubMsgResponse, SubMsgResult, - SupplyResponse, SystemResult, + coin, coins, from_json, BankMsg, BankQuery, Binary, Coin, ContractResult, Event, QueryRequest, + Reply, Response, StakingMsg, SubMsg, SubMsgResponse, SubMsgResult, SupplyResponse, + SystemResult, }; use cosmwasm_vm::{ testing::{ @@ -83,7 +68,7 @@ fn proper_initialization() { // it worked, let's query the state let res = query(&mut deps, mock_env(), QueryMsg::Owner {}).unwrap(); - let value: OwnerResponse = from_binary(&res).unwrap(); + let value: OwnerResponse = from_json(res).unwrap(); assert_eq!("creator", value.owner.as_str()); } @@ -102,7 +87,7 @@ fn reflect() { } .into(), // make sure we can pass through custom native messages - CustomMsg::Raw(Binary(b"{\"foo\":123}".to_vec())).into(), + CustomMsg::Raw(Binary::new(b"{\"foo\":123}".to_vec())).into(), CustomMsg::Debug("Hi, Dad!".to_string()).into(), StakingMsg::Delegate { validator: String::from("validator"), @@ -152,15 +137,17 @@ fn transfer() { let _res: Response = instantiate(&mut deps, mock_env(), info, msg).unwrap(); let info = mock_info("creator", &[]); - let new_owner = String::from("friend"); - let msg = ExecuteMsg::ChangeOwner { owner: new_owner }; + let new_owner = deps.api().addr_make("friend"); + let msg = ExecuteMsg::ChangeOwner { + owner: new_owner.to_string(), + }; let res: Response = execute(&mut deps, mock_env(), info, msg).unwrap(); // should change state assert_eq!(0, res.messages.len()); let res = query(&mut deps, mock_env(), QueryMsg::Owner {}).unwrap(); - let value: OwnerResponse = from_binary(&res).unwrap(); - assert_eq!("friend", value.owner.as_str()); + let value: OwnerResponse = from_json(res).unwrap(); + assert_eq!(value.owner, new_owner.as_str()); } #[test] @@ -203,8 +190,8 @@ fn supply_query() { ) .unwrap(); - let res: ChainResponse = from_binary(&res).unwrap(); - let res: SupplyResponse = from_binary(&res.data).unwrap(); + let res: ChainResponse = from_json(res).unwrap(); + let res: SupplyResponse = from_json(res.data).unwrap(); assert_eq!(res.amount, coin(25, "OSMO")); } @@ -225,7 +212,7 @@ fn dispatch_custom_query() { }, ) .unwrap(); - let value: CapitalizedResponse = from_binary(&res).unwrap(); + let value: CapitalizedResponse = from_json(res).unwrap(); assert_eq!(value.text, "DEMO ONE"); } @@ -266,25 +253,37 @@ fn reply_and_query() { let _res: Response = instantiate(&mut deps, mock_env(), info, msg).unwrap(); let id = 123u64; + let payload = Binary::from(b"my dear"); let data = Binary::from(b"foobar"); let events = vec![Event::new("message").add_attribute("signer", "caller-addr")]; + let gas_used = 1234567u64; + #[allow(deprecated)] let result = SubMsgResult::Ok(SubMsgResponse { events: events.clone(), data: Some(data.clone()), + msg_responses: vec![], }); - let subcall = Reply { id, result }; - let res: Response = reply(&mut deps, mock_env(), subcall).unwrap(); + let the_reply = Reply { + id, + payload, + gas_used, + result, + }; + let res: Response = reply(&mut deps, mock_env(), the_reply).unwrap(); assert_eq!(0, res.messages.len()); - // query for a non-existant id + // query for a non-existent id let qres = query(&mut deps, mock_env(), QueryMsg::SubMsgResult { id: 65432 }); assert!(qres.is_err()); // query for the real id let raw = query(&mut deps, mock_env(), QueryMsg::SubMsgResult { id }).unwrap(); - let qres: Reply = from_binary(&raw).unwrap(); + let qres: Reply = from_json(raw).unwrap(); assert_eq!(qres.id, id); let result = qres.result.unwrap(); - assert_eq!(result.data, Some(data)); + #[allow(deprecated)] + { + assert_eq!(result.data, Some(data)); + } assert_eq!(result.events, events); } diff --git a/contracts/replier/.cargo/config.toml b/contracts/replier/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/replier/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/replier/Cargo.lock b/contracts/replier/Cargo.lock new file mode 100644 index 0000000000..0ca7016e62 --- /dev/null +++ b/contracts/replier/Cargo.lock @@ -0,0 +1,1356 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + +[[package]] +name = "cosmwasm-crypto" +version = "3.0.3-dev" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cosmwasm-schema" +version = "3.0.3-dev" +dependencies = [ + "cosmwasm-schema-derive", + "cw-schema", + "schemars 0.8.21", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cosmwasm-std" +version = "3.0.3-dev" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "cw-schema", + "derive_more", + "hex", + "rand_core", + "rmp-serde", + "schemars 0.8.21", + "serde", + "serde_json", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cw-schema" +version = "3.0.3-dev" +dependencies = [ + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "replier" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "schemars 0.8.21", + "serde", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/contracts/replier/Cargo.toml b/contracts/replier/Cargo.toml new file mode 100644 index 0000000000..bb9f4aa2ab --- /dev/null +++ b/contracts/replier/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "replier" +version = "0.0.0" +authors = ["Tomasz Kulik "] +edition = "2021" +publish = false +license = "Apache-2.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[dependencies] +cosmwasm-schema = { path = "../../packages/schema" } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["cosmwasm_1_4", "exports", "iterator", "std"] } +schemars = "0.8.12" +serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/contracts/replier/schema/cw_schema/raw/execute.json b/contracts/replier/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..ebe63f2df5 --- /dev/null +++ b/contracts/replier/schema/cw_schema/raw/execute.json @@ -0,0 +1,48 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "replier_ExecuteMsg", + "type": "struct", + "properties": { + "exec_error": { + "value": 2 + }, + "messages": { + "value": 3 + }, + "msg_id": { + "value": 1 + }, + "reply_error": { + "value": 2 + }, + "reply_on_never": { + "value": 2 + }, + "return_order_in_reply": { + "value": 2 + }, + "set_data_in_exec_and_reply": { + "value": 2 + } + } + }, + { + "name": "u8", + "type": "integer", + "precision": 8, + "signed": false + }, + { + "name": "bool", + "type": "boolean" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] +} diff --git a/contracts/replier/schema/cw_schema/raw/instantiate.json b/contracts/replier/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..437ca05acd --- /dev/null +++ b/contracts/replier/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,11 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "replier_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/replier/schema/cw_schema/raw/query.json b/contracts/replier/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..4b6ce0ad09 --- /dev/null +++ b/contracts/replier/schema/cw_schema/raw/query.json @@ -0,0 +1,11 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "replier_QueryMsg", + "type": "enum", + "cases": {} + } + ] +} diff --git a/contracts/replier/schema/cw_schema/replier.json b/contracts/replier/schema/cw_schema/replier.json new file mode 100644 index 0000000000..51340354bf --- /dev/null +++ b/contracts/replier/schema/cw_schema/replier.json @@ -0,0 +1,78 @@ +{ + "contract_name": "replier", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "replier_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "replier_ExecuteMsg", + "type": "struct", + "properties": { + "exec_error": { + "value": 2 + }, + "messages": { + "value": 3 + }, + "msg_id": { + "value": 1 + }, + "reply_error": { + "value": 2 + }, + "reply_on_never": { + "value": 2 + }, + "return_order_in_reply": { + "value": 2 + }, + "set_data_in_exec_and_reply": { + "value": 2 + } + } + }, + { + "name": "u8", + "type": "integer", + "precision": 8, + "signed": false + }, + { + "name": "bool", + "type": "boolean" + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "replier_QueryMsg", + "type": "enum", + "cases": {} + } + ] + }, + "migrate": null, + "sudo": null, + "responses": {} +} diff --git a/contracts/replier/schema/raw/execute.json b/contracts/replier/schema/raw/execute.json new file mode 100644 index 0000000000..70cc2b9774 --- /dev/null +++ b/contracts/replier/schema/raw/execute.json @@ -0,0 +1,86 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "type": "object", + "required": [ + "exec_error", + "messages", + "msg_id", + "reply_error", + "reply_on_never", + "return_order_in_reply", + "set_data_in_exec_and_reply" + ], + "properties": { + "exec_error": { + "type": "boolean" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecuteMsg" + } + }, + "msg_id": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "reply_error": { + "type": "boolean" + }, + "reply_on_never": { + "type": "boolean" + }, + "return_order_in_reply": { + "type": "boolean" + }, + "set_data_in_exec_and_reply": { + "type": "boolean" + } + }, + "additionalProperties": false, + "definitions": { + "ExecuteMsg": { + "type": "object", + "required": [ + "exec_error", + "messages", + "msg_id", + "reply_error", + "reply_on_never", + "return_order_in_reply", + "set_data_in_exec_and_reply" + ], + "properties": { + "exec_error": { + "type": "boolean" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecuteMsg" + } + }, + "msg_id": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "reply_error": { + "type": "boolean" + }, + "reply_on_never": { + "type": "boolean" + }, + "return_order_in_reply": { + "type": "boolean" + }, + "set_data_in_exec_and_reply": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/replier/schema/raw/instantiate.json b/contracts/replier/schema/raw/instantiate.json new file mode 100644 index 0000000000..1352613d57 --- /dev/null +++ b/contracts/replier/schema/raw/instantiate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/replier/schema/raw/query.json b/contracts/replier/schema/raw/query.json new file mode 100644 index 0000000000..0f592a1af0 --- /dev/null +++ b/contracts/replier/schema/raw/query.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "type": "string", + "enum": [] +} diff --git a/contracts/replier/schema/replier.json b/contracts/replier/schema/replier.json new file mode 100644 index 0000000000..9d7459ea61 --- /dev/null +++ b/contracts/replier/schema/replier.json @@ -0,0 +1,106 @@ +{ + "contract_name": "replier", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "type": "object", + "required": [ + "exec_error", + "messages", + "msg_id", + "reply_error", + "reply_on_never", + "return_order_in_reply", + "set_data_in_exec_and_reply" + ], + "properties": { + "exec_error": { + "type": "boolean" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecuteMsg" + } + }, + "msg_id": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "reply_error": { + "type": "boolean" + }, + "reply_on_never": { + "type": "boolean" + }, + "return_order_in_reply": { + "type": "boolean" + }, + "set_data_in_exec_and_reply": { + "type": "boolean" + } + }, + "additionalProperties": false, + "definitions": { + "ExecuteMsg": { + "type": "object", + "required": [ + "exec_error", + "messages", + "msg_id", + "reply_error", + "reply_on_never", + "return_order_in_reply", + "set_data_in_exec_and_reply" + ], + "properties": { + "exec_error": { + "type": "boolean" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecuteMsg" + } + }, + "msg_id": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "reply_error": { + "type": "boolean" + }, + "reply_on_never": { + "type": "boolean" + }, + "return_order_in_reply": { + "type": "boolean" + }, + "set_data_in_exec_and_reply": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "type": "string", + "enum": [] + }, + "migrate": null, + "sudo": null, + "responses": {} +} diff --git a/contracts/floaty/examples/schema.rs b/contracts/replier/src/bin/schema.rs similarity index 73% rename from contracts/floaty/examples/schema.rs rename to contracts/replier/src/bin/schema.rs index b0a8a02b01..f370eb6b4e 100644 --- a/contracts/floaty/examples/schema.rs +++ b/contracts/replier/src/bin/schema.rs @@ -1,6 +1,6 @@ use cosmwasm_schema::write_api; -use floaty::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use replier::{ExecuteMsg, InstantiateMsg, QueryMsg}; fn main() { write_api! { diff --git a/contracts/replier/src/lib.rs b/contracts/replier/src/lib.rs new file mode 100644 index 0000000000..24fa0ad23a --- /dev/null +++ b/contracts/replier/src/lib.rs @@ -0,0 +1,154 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; +use cosmwasm_std::{ + entry_point, from_json, to_json_binary, to_json_vec, Binary, Deps, DepsMut, Env, MessageInfo, + QueryResponse, Reply, ReplyOn, Response, StdError, StdResult, SubMsg, WasmMsg, +}; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +const SET_DATA_IN_EXEC_AND_REPLY_FLAG: u64 = 0x100; +const RETURN_ORDER_IN_REPLY_FLAG: u64 = 0x200; +const REPLY_ERROR_FLAG: u64 = 0x400; + +#[cw_serde] +pub struct InstantiateMsg {} + +#[cw_serde] +pub struct ExecuteMsg { + msg_id: u8, + set_data_in_exec_and_reply: bool, + return_order_in_reply: bool, + exec_error: bool, + reply_error: bool, + reply_on_never: bool, + messages: Vec, +} + +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg {} + +pub const CONFIG_KEY: &[u8] = b"config"; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct State { + pub order: Vec, +} + +#[entry_point] +pub fn instantiate( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: InstantiateMsg, +) -> StdResult { + deps.storage + .set(CONFIG_KEY, &to_json_vec(&State { order: vec![] })?); + Ok(Response::new()) +} + +#[entry_point] +pub fn execute( + deps: DepsMut, + env: Env, + _info: MessageInfo, + msg: ExecuteMsg, +) -> StdResult { + let data = deps.storage.get(CONFIG_KEY).unwrap(); + let mut config: State = from_json(data)?; + if msg.msg_id <= 1 { + config.order.clear(); + } + config.order.extend([0xEE, msg.msg_id]); + deps.storage.set(CONFIG_KEY, &to_json_vec(&config)?); + + let mut resp = Response::new(); + + if msg.set_data_in_exec_and_reply { + resp = resp.set_data(Binary::new(vec![0xEE, msg.msg_id])); + } + + if msg.exec_error { + return Err(StdError::msg(format_args!( + "Err in exec msg_id: {}", + msg.msg_id + ))); + } + + for next_msg in msg.messages { + let wasm_msg = WasmMsg::Execute { + contract_addr: env.contract.address.to_string(), + msg: to_json_binary(&next_msg).unwrap(), + funds: vec![], + }; + let mut msg_id: u64 = msg.msg_id.into(); + if msg.set_data_in_exec_and_reply { + msg_id |= SET_DATA_IN_EXEC_AND_REPLY_FLAG; + } + if msg.return_order_in_reply { + msg_id |= RETURN_ORDER_IN_REPLY_FLAG; + } + if msg.reply_error { + msg_id |= REPLY_ERROR_FLAG; + } + + let submsg = SubMsg { + id: msg_id, + payload: Binary::default(), + msg: wasm_msg.into(), + gas_limit: None, + reply_on: if next_msg.reply_on_never { + ReplyOn::Never + } else { + ReplyOn::Always + }, + }; + resp = resp.add_submessage(submsg); + } + Ok(resp) +} + +#[entry_point] +pub fn query(_deps: Deps, _env: Env, _msg: QueryMsg) -> StdResult { + Ok(QueryResponse::new(vec![])) +} + +#[entry_point] +pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> StdResult { + let msg_id = msg.id & 0xFF; + let should_set_data = msg.id & SET_DATA_IN_EXEC_AND_REPLY_FLAG != 0; + let should_set_order = msg.id & RETURN_ORDER_IN_REPLY_FLAG != 0; + let should_return_error = msg.id & REPLY_ERROR_FLAG != 0; + + let data = deps.storage.get(CONFIG_KEY).unwrap(); + let mut config: State = from_json(data)?; + config.order.extend([0xBB, msg_id as u8]); + deps.storage.set(CONFIG_KEY, &to_json_vec(&config)?); + + if should_return_error { + return Err(StdError::msg(format_args!( + "Err in reply msg_id: {}", + msg_id + ))); + } + + let result = if msg.result.is_ok() { + msg.result.unwrap() + } else { + return Ok(Response::new()); + }; + + if should_set_order { + Ok(Response::new().set_data(Binary::new(config.order))) + } else if should_set_data { + Ok(Response::new().set_data(Binary::new( + result + .msg_responses + .into_iter() + .flat_map(|resp| resp.value.as_slice().to_vec()) + .chain([0xBB, msg_id as u8]) + .collect(), + ))) + } else { + Ok(Response::new()) + } +} diff --git a/contracts/replier/tests/integration.rs b/contracts/replier/tests/integration.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/contracts/replier/tests/integration.rs @@ -0,0 +1 @@ + diff --git a/contracts/staking/.cargo/config b/contracts/staking/.cargo/config deleted file mode 100644 index 8d4bc738b1..0000000000 --- a/contracts/staking/.cargo/config +++ /dev/null @@ -1,6 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -integration-test = "test --test integration" -schema = "run --example schema" diff --git a/contracts/staking/.cargo/config.toml b/contracts/staking/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/staking/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/staking/Cargo.lock b/contracts/staking/Cargo.lock index 8e9bd98fab..10ac9f3188 100644 --- a/contracts/staking/Cargo.lock +++ b/contracts/staking/Cargo.lock @@ -1,14 +1,14 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.15.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.24.0", + "gimli 0.29.0", ] [[package]] @@ -17,118 +17,349 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom 0.2.3", + "cfg-if", "once_cell", "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", - "object 0.25.3", + "miniz_oxide 0.7.3", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "base64ct" -version = "1.5.0" +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "generic-array", + "digest", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] [[package]] name = "bytecheck" -version = "0.6.7" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314889ea31cda264cb7c3d6e6e5c9415a987ecb0e72c17c00d36fbb881d34abe" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ - "bytecheck_derive", - "ptr_meta", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "bytecheck_derive" -version = "0.6.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2b3b92c135dae665a6f760205b89187638e83bed17ef3e44e83c712cf30600" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.69" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -136,55 +367,94 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clru" -version = "0.4.0" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "corosensei" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9847f90f32a50b0dcbd68bc23ff242798b13080b97b0569f6ed96a45ce4cf2cd" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" dependencies = [ "autocfg", "cfg-if", "libc", "scopeguard", - "windows-sys", + "windows-sys 0.59.0", ] +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + [[package]] name = "cosmwasm-crypto" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "digest 0.10.3", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.3", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cosmwasm-schema" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "cosmwasm-schema-derive", - "schemars", + "cw-schema", + "schemars 0.8.21", "serde", "serde_json", "thiserror", @@ -192,204 +462,133 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "cosmwasm-std" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ "base64", + "bech32", + "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "cw-schema", + "derive_more 2.0.1", "hex", - "schemars", + "rand_core", + "rmp-serde", + "schemars 0.8.21", "serde", - "serde-json-wasm", + "serde_json", + "sha2", + "static_assertions", "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.1.9" -dependencies = [ - "cosmwasm-std", - "serde", ] [[package]] name = "cosmwasm-vm" -version = "1.1.9" +version = "3.0.3-dev" dependencies = [ - "bitflags", - "bytecheck", + "bech32", + "blake2", + "bytes", "clru", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-std", - "enumset", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", "hex", - "loupe", - "parity-wasm", - "schemars", + "rand_core", "serde", "serde_json", - "sha2 0.10.3", + "sha2", + "strum", "thiserror", + "tracing", "wasmer", "wasmer-middlewares", + "wasmer-types", ] [[package]] -name = "cpufeatures" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" dependencies = [ - "libc", + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.26.1", - "log", - "regalloc", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" - -[[package]] -name = "cranelift-entity" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" - -[[package]] -name = "cranelift-frontend" -version = "0.82.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-utils" -version = "0.8.8" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", - "lazy_static", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.8" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2b443d17d49dad5ef0ede301c3179cc923b8822f3393b4d2c28c269dd4a122" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.3", + "rand_core", "subtle", "zeroize", ] @@ -406,104 +605,196 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "darling" -version = "0.13.0" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "darling_core", - "darling_macro", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +name = "cw-schema" +version = "3.0.3-dev" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", ] [[package]] -name = "darling_macro" -version = "0.13.0" +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive_more" +version = "0.99.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "generic-array", + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] [[package]] -name = "doc-comment" -version = "0.3.3" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "dynasm" @@ -511,13 +802,13 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -528,57 +819,77 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] name = "ecdsa" -version = "0.14.3" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd46e0c364655e5baf2f5e99b603e7a09905da9966d7928d7470af393b28670" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest", "elliptic-curve", "rfc6979", "signature", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + [[package]] name = "ed25519-zebra" -version = "3.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.3", - "serde", - "sha2 0.9.5", - "thiserror", + "rand_core", + "sha2", "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" -version = "0.12.2" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c47abd0a791d2ac0c7aa1118715f85b83689e4522c4e3a244e159d4fc9848a8d" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.3", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.3", + "rand_core", "sec1", "subtle", "zeroize", @@ -601,46 +912,110 @@ checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "enumset" -version = "1.0.7" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e76129da36102af021b8e5000dab2c1c30dbef85c1e482beeff8da5dde0e0b0" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.5.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", ] [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "ff" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df689201f395c6b90dfe87127685f8dbfc083a5e779e613575d8bd7314300c3e" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.3", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -648,97 +1023,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "forward_ref" -version = "1.0.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] -name = "getrandom" -version = "0.2.3" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "fallible-iterator", + "indexmap", + "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] -name = "gimli" -version = "0.26.1" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7391856def869c1c81063a03457c676fbcd419709c3dfb33d8d319de484b154d" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core", "subtle", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "allocator-api2", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "hex" @@ -752,673 +1132,1174 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "indexmap" -version = "1.7.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "autocfg", - "hashbrown 0.11.2", - "serde", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "itoa" -version = "0.4.7" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "js-sys" -version = "0.3.55" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "k256" -version = "0.11.3" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8a5a96d92d849c4499d99461da81c9cdc1467418a8ed2aaeb407e8d85940ed" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.3", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "leb128" -version = "0.2.4" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "libc" -version = "0.2.126" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libloading" -version = "0.7.0" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "cfg-if", - "winapi", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "log" -version = "0.4.14" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "loupe" -version = "0.1.3" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "indexmap", - "loupe-derive", - "rustversion", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "loupe-derive" -version = "0.1.3" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "quote", - "syn", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "mach" -version = "0.3.2" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "libc", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] [[package]] -name = "memmap2" -version = "0.5.0" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.59.0", ] [[package]] -name = "memoffset" -version = "0.6.4" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -dependencies = [ - "autocfg", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "adler", - "autocfg", + "either", ] [[package]] -name = "more-asserts" -version = "0.2.1" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "num_cpus" -version = "1.13.0" +name = "js-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "hermit-abi", - "libc", + "wasm-bindgen", ] [[package]] -name = "object" -version = "0.25.3" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "memchr", + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", ] [[package]] -name = "object" -version = "0.28.3" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "parity-wasm" -version = "0.42.2" +name = "libc" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] -name = "pin-project-lite" -version = "0.2.7" +name = "libloading" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] -name = "pkcs8" -version = "0.9.0" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "der", - "spki", + "bitflags 2.5.0", + "libc", + "redox_syscall", ] [[package]] -name = "ppv-lite86" -version = "0.2.10" +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "autocfg", + "scopeguard", ] [[package]] -name = "proc-macro2" -version = "1.0.27" +name = "log" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" -dependencies = [ - "unicode-xid", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "ptr_meta" -version = "0.1.4" +name = "mach2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ - "ptr_meta_derive", + "libc", ] [[package]] -name = "ptr_meta_derive" -version = "0.1.4" +name = "memchr" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] -name = "quote" -version = "1.0.9" +name = "memmap2" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ - "proc-macro2", + "libc", ] [[package]] -name = "rand" -version = "0.8.4" +name = "memmap2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" dependencies = [ "libc", - "rand_chacha", - "rand_core 0.6.3", - "rand_hc", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "memoffset" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", + "autocfg", ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ - "getrandom 0.1.16", + "adler", ] [[package]] -name = "rand_core" -version = "0.6.3" +name = "miniz_oxide" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ - "getrandom 0.2.3", + "adler2", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" dependencies = [ - "rand_core 0.6.3", + "munge_macro", ] [[package]] -name = "rayon" -version = "1.5.1" +name = "munge_macro" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "memchr", + "minimal-lexical", ] [[package]] -name = "redox_syscall" -version = "0.2.9" +name = "num-bigint" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "bitflags", + "num-integer", + "num-traits", ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "log", - "rustc-hash", - "smallvec", + "num-traits", ] [[package]] -name = "region" -version = "3.0.0" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", + "autocfg", ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "winapi", + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", ] [[package]] -name = "rend" -version = "0.3.6" +name = "object" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ - "bytecheck", + "memchr", ] [[package]] -name = "rfc6979" -version = "0.3.0" +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c86280f057430a52f4861551b092a01b419b8eacefc7c995eacb9dc132fe32" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", + "supports-color 2.1.0", + "supports-color 3.0.2", ] [[package]] -name = "rkyv" -version = "0.7.36" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230ae2981a885590b0dc84e0b24c0ed23ad24f7adc0eb824b26cafa961f7c36" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "bytecheck", - "hashbrown 0.12.0", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", ] [[package]] -name = "rkyv_derive" -version = "0.7.36" +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc752d5925dbcb324522f3a4c93193d17f107b2e11810913aa3ad352fa01480" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", ] [[package]] -name = "rustc-demangle" -version = "0.1.20" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "rustc-hash" -version = "1.1.0" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "rustversion" -version = "1.0.5" +name = "pin-project-lite" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] -name = "ryu" -version = "1.0.5" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "schemars" -version = "0.8.6" +name = "prettyplease" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a48d098c2a7fdf5740b19deb1181b4fb8a9e68e03ae517c14cde04b5725409" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", + "proc-macro2", + "syn 2.0.87", ] [[package]] -name = "schemars_derive" -version = "0.8.6" +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9ea2a613fe4cd7118b2bb101a25d8ae6192e1975179b67b2f17afd11e70ac8" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ + "proc-macro-error-attr", "proc-macro2", "quote", - "serde_derive_internals", - "syn", + "syn 1.0.109", + "version_check", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "proc-macro-error-attr" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] [[package]] -name = "seahash" -version = "4.1.0" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] [[package]] -name = "sec1" -version = "0.3.0" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "serde" -version = "1.0.126" +name = "proc-macro2" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "serde_derive", + "unicode-ident", ] [[package]] -name = "serde-json-wasm" -version = "0.4.1" +name = "ptr_meta" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "serde", + "ptr_meta_derive 0.1.4", ] [[package]] -name = "serde_bytes" -version = "0.11.5" +name = "ptr_meta" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" dependencies = [ - "serde", + "ptr_meta_derive 0.3.0", ] [[package]] -name = "serde_derive" -version = "1.0.126" +name = "ptr_meta_derive" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "serde_derive_internals" -version = "0.25.0" +name = "ptr_meta_derive" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] -name = "serde_json" -version = "1.0.64" +name = "quote" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "itoa", - "ryu", - "serde", + "proc-macro2", ] [[package]] -name = "sha2" -version = "0.9.5" +name = "rancor" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures 0.1.5", - "digest 0.9.0", - "opaque-debug", + "ptr_meta 0.3.0", ] [[package]] -name = "sha2" -version = "0.10.3" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "cfg-if", - "cpufeatures 0.2.2", - "digest 0.10.3", + "rand_chacha", + "rand_core", ] [[package]] -name = "signature" -version = "1.5.0" +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "digest 0.10.3", - "rand_core 0.6.3", + "ppv-lite86", + "rand_core", ] [[package]] -name = "smallvec" -version = "1.6.1" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] [[package]] -name = "snafu" -version = "0.6.10" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab12d3c261b2308b0d80c26fffb58d17eba81a4be97890101f416b478c79ca7" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "doc-comment", - "snafu-derive", + "either", + "rayon-core", ] [[package]] -name = "snafu-derive" -version = "0.6.10" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "spki" -version = "0.6.0" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "base64ct", - "der", + "bitflags 2.5.0", ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] [[package]] -name = "staking" +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" +dependencies = [ + "bytecheck 0.8.0", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" +dependencies = [ + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "snafu" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418b8136fec49956eba89be7da2847ec1909df92a9ae4178b5ff0ff092c8d95e" +dependencies = [ + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a4812a669da00d17d8266a0439eddcacbc88b17f732f927e52eeb9d196f7fb5" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "staking" version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", "cosmwasm-vm", - "schemars", + "schemars 0.8.21", "serde", "snafu", ] @@ -1431,147 +2312,285 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] [[package]] name = "syn" -version = "1.0.73" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "target-lexicon" -version = "0.12.2" +name = "syn" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "tempfile" -version = "3.2.0" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" -dependencies = [ - "thiserror-impl", -] +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "thiserror-impl" -version = "1.0.26" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "tracing" -version = "0.1.26" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "tracing-attributes" -version = "0.1.15" +name = "ureq" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "url" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ - "lazy_static", + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "uint" -version = "0.9.3" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1579,24 +2598,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1604,113 +2623,95 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmer" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8d8361c9d006ea3d7797de7bd6b1492ffd0f91a22430cfda6c1658ad57bedf" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" dependencies = [ + "bindgen", + "bytes", "cfg-if", + "cmake", "indexmap", "js-sys", - "loupe", "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", "target-lexicon", "thiserror", + "tracing", + "ureq", "wasm-bindgen", - "wasmer-artifact", "wasmer-compiler", - "wasmer-compiler-cranelift", "wasmer-compiler-singlepass", "wasmer-derive", - "wasmer-engine", - "wasmer-engine-dylib", - "wasmer-engine-universal", "wasmer-types", "wasmer-vm", - "winapi", -] - -[[package]] -name = "wasmer-artifact" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aaf9428c29c1d8ad2ac0e45889ba8a568a835e33fd058964e5e500f2f7ce325" -dependencies = [ - "enumset", - "loupe", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67a6cd866aed456656db2cfea96c18baabbd33f676578482b85c51e1ee19d2c" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", "enumset", - "loupe", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", "rkyv", - "serde", - "serde_bytes", + "self_cell", + "shared-buffer", "smallvec", "target-lexicon", "thiserror", "wasmer-types", + "wasmer-vm", "wasmparser", -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48be2f9f6495f08649e4f8b946a2cbbe119faf5a654aa1457f9504a99d23dae0" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "gimli 0.26.1", - "loupe", - "more-asserts", - "rayon", - "smallvec", - "target-lexicon", - "tracing", - "wasmer-compiler", - "wasmer-types", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-singlepass" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ca2a35204d8befa85062bc7aac259a8db8070b801b8a783770ba58231d729e" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "gimli 0.26.1", - "lazy_static", - "loupe", + "enumset", + "gimli 0.28.1", "more-asserts", "rayon", "smallvec", @@ -1720,252 +2721,309 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "2.3.0" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" dependencies = [ - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "wasmer-engine" -version = "2.3.0" +name = "wasmer-middlewares" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f98f010978c244db431b392aeab0661df7ea0822343334f8f2a920763548e45" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "loupe", - "memmap2", - "more-asserts", - "rustc-demangle", - "serde", - "serde_bytes", - "target-lexicon", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", + "wasmer", "wasmer-types", "wasmer-vm", ] [[package]] -name = "wasmer-engine-dylib" -version = "2.3.0" +name = "wasmer-types" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" dependencies = [ - "cfg-if", + "bytecheck 0.6.12", "enum-iterator", "enumset", - "leb128", - "libloading", - "loupe", - "object 0.28.3", + "getrandom", + "hex", + "indexmap", + "more-asserts", "rkyv", - "serde", - "tempfile", - "tracing", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-engine", - "wasmer-object", - "wasmer-types", - "wasmer-vm", - "which", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", ] [[package]] -name = "wasmer-engine-universal" -version = "2.3.0" +name = "wasmer-vm" +version = "5.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440dc3d93c9ca47865a4f4edd037ea81bf983b5796b59b3d712d844b32dbef15" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" dependencies = [ + "backtrace", + "cc", "cfg-if", - "enumset", - "leb128", - "loupe", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", "region", - "rkyv", - "wasmer-compiler", - "wasmer-engine", - "wasmer-engine-universal-artifact", + "scopeguard", + "thiserror", "wasmer-types", - "wasmer-vm", - "winapi", + "windows-sys 0.59.0", ] [[package]] -name = "wasmer-engine-universal-artifact" -version = "2.3.0" +name = "wasmparser" +version = "0.216.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" dependencies = [ - "enum-iterator", - "enumset", - "loupe", - "rkyv", - "thiserror", - "wasmer-artifact", - "wasmer-compiler", - "wasmer-types", + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", ] [[package]] -name = "wasmer-middlewares" -version = "2.3.0" +name = "webpki-roots" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7812438ed2f37203a37007cdb5332b8475cb2b16e15d51299b2647894e9ed3a" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ - "loupe", - "wasmer", - "wasmer-types", - "wasmer-vm", + "rustls-pki-types", ] [[package]] -name = "wasmer-object" -version = "2.3.0" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d831335ff3a44ecf451303f6f891175c642488036b92ceceb24ac8623a8fa8b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "object 0.28.3", - "thiserror", - "wasmer-compiler", - "wasmer-types", + "windows-targets", ] [[package]] -name = "wasmer-types" -version = "2.3.0" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "backtrace", - "enum-iterator", - "indexmap", - "loupe", - "more-asserts", - "rkyv", - "serde", - "thiserror", + "windows-targets", ] [[package]] -name = "wasmer-vm" -version = "2.3.0" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d965fa61f4dc4cdb35a54daaf7ecec3563fbb94154a6c35433f879466247dd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "backtrace", - "cc", - "cfg-if", - "corosensei", - "enum-iterator", - "indexmap", - "lazy_static", - "libc", - "loupe", - "mach", - "memoffset", - "more-asserts", - "region", - "rkyv", - "scopeguard", - "serde", - "thiserror", - "wasmer-artifact", - "wasmer-types", - "winapi", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "wasmparser" -version = "0.83.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] -name = "which" -version = "4.1.0" +name = "xattr" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ - "either", "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "yoke-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "zerocopy" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows-sys" -version = "0.33.0" +name = "zerocopy-derive" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43dbb096663629518eb1dfa72d80243ca5a6aca764cae62a2df70af760a9be75" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "windows_aarch64_msvc" -version = "0.33.0" +name = "zerofrom" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] [[package]] -name = "windows_i686_gnu" -version = "0.33.0" +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] -name = "windows_i686_msvc" -version = "0.33.0" +name = "zeroize" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.33.0" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.33.0" +name = "zerovec" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] [[package]] -name = "zeroize" -version = "1.5.7" +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/staking/Cargo.toml b/contracts/staking/Cargo.toml index 2cb5e43fa8..8087900bca 100644 --- a/contracts/staking/Cargo.toml +++ b/contracts/staking/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -22,22 +20,12 @@ panic = 'abort' incremental = false overflow-checks = true -[features] -# Add feature "cranelift" to default if you need 32 bit or ARM support -default = [] -# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines. -cranelift = ["cosmwasm-vm/cranelift"] -# for quicker tests, cargo test --lib -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"] - [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["staking"] } -cosmwasm-storage = { path = "../../packages/storage", default-features = false } -schemars = "0.8.3" +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["exports", "staking", "std"] } +schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -snafu = "0.6.6" +snafu = "0.8.2" [dev-dependencies] cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["staking"] } diff --git a/contracts/staking/LICENSE b/contracts/staking/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/contracts/staking/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/contracts/staking/NOTICE b/contracts/staking/NOTICE deleted file mode 100644 index b8f34a8f13..0000000000 --- a/contracts/staking/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2020 Ethan Frey - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/contracts/staking/README.md b/contracts/staking/README.md index 3221f42946..80e0cd3583 100644 --- a/contracts/staking/README.md +++ b/contracts/staking/README.md @@ -6,7 +6,7 @@ more complex logic upon. ## Functionality -One one side, this acts as a simplified ERC20-like token, holding a list of +On one side, this acts as a simplified ERC20-like token, holding a list of balances for multiple addresses, and exposing queries and transfers (no allowances and "transfer from" to focus the logic on the staking stuff). However, it has no initial balance. Instead, it mints and burns them based on @@ -22,11 +22,11 @@ unbonding period). To show an example of charging for such a service, we allow the contract owner to take a small exit tax, thus maybe 98% of the tokens will be unbonded and sent to the original account, and 2% of the tokens are not unbonded, but rather -transfered to the owners account. (The ownership can also be transfered). +transferred to the owners account. (The ownership can also be transferred). ## Using this project -You should check out [Developing](./Developing.md) to explain more on how to run +You should check out [Developing](../../README.md#developing) to explain more on how to run tests and develop code. Or go through the -[online tutorial](https://www.cosmwasm.com/docs/getting-started/intro) to get a -better feel of how to develop. +[online tutorial](https://book.cosmwasm.com/index.html) to get a better feel of +how to develop. diff --git a/contracts/staking/rustfmt.toml b/contracts/staking/rustfmt.toml deleted file mode 100644 index 11a85e6a9c..0000000000 --- a/contracts/staking/rustfmt.toml +++ /dev/null @@ -1,15 +0,0 @@ -# stable -newline_style = "unix" -hard_tabs = false -tab_spaces = 4 - -# unstable... should we require `rustup run nightly cargo fmt` ? -# or just update the style guide when they are stable? -#fn_single_line = true -#format_code_in_doc_comments = true -#overflow_delimited_expr = true -#reorder_impl_items = true -#struct_field_align_threshold = 20 -#struct_lit_single_line = true -#report_todo = "Always" - diff --git a/contracts/staking/schema/cw_schema/raw/execute.json b/contracts/staking/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..5ca9bc1df6 --- /dev/null +++ b/contracts/staking/schema/cw_schema/raw/execute.json @@ -0,0 +1,64 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_ExecuteMsg", + "type": "enum", + "cases": { + "bond": { + "description": "Bond will bond all staking tokens sent with the message and release derivative tokens", + "type": "named", + "properties": {} + }, + "bond_all_tokens": { + "description": "_BondAllTokens can only be called by the contract itself, after all rewards have been\nwithdrawn. This is an example of using \"callbacks\" in message flows.\nThis can only be invoked by the contract itself as a return from Reinvest", + "type": "named", + "properties": {} + }, + "claim": { + "description": "Claim is used to claim your native tokens that you previously \"unbonded\"\nafter the chain-defined waiting period (eg. 3 weeks)", + "type": "named", + "properties": {} + }, + "reinvest": { + "description": "Reinvest will check for all accumulated rewards, withdraw them, and\nre-bond them to the same validator. Anyone can call this, which updates\nthe value of the token (how much under custody).", + "type": "named", + "properties": {} + }, + "transfer": { + "description": "Transfer moves the derivative token", + "type": "named", + "properties": { + "amount": { + "value": 2 + }, + "recipient": { + "value": 1 + } + } + }, + "unbond": { + "description": "Unbond will \"burn\" the given amount of derivative tokens and send the unbonded\nstaking tokens to the message sender (after exit tax is deducted)", + "type": "named", + "properties": { + "amount": { + "value": 2 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + } + ] +} diff --git a/contracts/staking/schema/cw_schema/raw/instantiate.json b/contracts/staking/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..d2ec220ce2 --- /dev/null +++ b/contracts/staking/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,60 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_InstantiateMsg", + "type": "struct", + "properties": { + "decimals": { + "description": "decimal places of the derivative token (for UI)\nTODO: does this make sense? Do we need to normalize on this?\nWe don't even know the decimals of the native token", + "value": 2 + }, + "exit_tax": { + "description": "this is how much the owner takes as a cut when someone unbonds\nTODO", + "value": 3 + }, + "min_withdrawal": { + "description": "This is the minimum amount we will pull out to reinvest, as well as a minimum\nthat can be unbonded (to avoid needless staking tx)", + "value": 4 + }, + "name": { + "description": "name of the derivative token (FIXME: auto-generate?)", + "value": 1 + }, + "symbol": { + "description": "symbol / ticker of the derivative token", + "value": 1 + }, + "validator": { + "description": "This is the validator that all tokens will be bonded to", + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u8", + "type": "integer", + "precision": 8, + "signed": false + }, + { + "name": "cosmwasm_std_math_decimal_Decimal", + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "decimal", + "precision": 128, + "signed": false + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + } + ] +} diff --git a/contracts/staking/schema/cw_schema/raw/query.json b/contracts/staking/schema/cw_schema/raw/query.json new file mode 100644 index 0000000000..15062ec6fd --- /dev/null +++ b/contracts/staking/schema/cw_schema/raw/query.json @@ -0,0 +1,44 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_QueryMsg", + "type": "enum", + "cases": { + "balance": { + "description": "Balance shows the number of staking derivatives", + "type": "named", + "properties": { + "address": { + "value": 1 + } + } + }, + "claims": { + "description": "Claims shows the number of tokens this address can access when they are done unbonding", + "type": "named", + "properties": { + "address": { + "value": 1 + } + } + }, + "investment": { + "description": "Investment shows info on total staking tokens under custody,\nwith which validator, as well as how many derivative tokens are lists.\nIt also shows with the exit tax.", + "type": "named", + "properties": {} + }, + "token_info": { + "description": "TokenInfo shows the metadata of the token for UIs", + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + } + ] +} diff --git a/contracts/staking/schema/cw_schema/raw/response_to_balance.json b/contracts/staking/schema/cw_schema/raw/response_to_balance.json new file mode 100644 index 0000000000..a7bb8e0673 --- /dev/null +++ b/contracts/staking/schema/cw_schema/raw/response_to_balance.json @@ -0,0 +1,22 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_BalanceResponse", + "type": "struct", + "properties": { + "balance": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + } + ] +} diff --git a/contracts/staking/schema/cw_schema/raw/response_to_claims.json b/contracts/staking/schema/cw_schema/raw/response_to_claims.json new file mode 100644 index 0000000000..c827711e29 --- /dev/null +++ b/contracts/staking/schema/cw_schema/raw/response_to_claims.json @@ -0,0 +1,22 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_ClaimsResponse", + "type": "struct", + "properties": { + "claims": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + } + ] +} diff --git a/contracts/staking/schema/cw_schema/raw/response_to_investment.json b/contracts/staking/schema/cw_schema/raw/response_to_investment.json new file mode 100644 index 0000000000..52e118276f --- /dev/null +++ b/contracts/staking/schema/cw_schema/raw/response_to_investment.json @@ -0,0 +1,74 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_InvestmentResponse", + "type": "struct", + "properties": { + "exit_tax": { + "description": "this is how much the owner takes as a cut when someone unbonds", + "value": 5 + }, + "min_withdrawal": { + "description": "This is the minimum amount we will pull out to reinvest, as well as a minimum\nthat can be unbonded (to avoid needless staking tx)", + "value": 1 + }, + "nominal_value": { + "value": 5 + }, + "owner": { + "description": "owner created the contract and takes a cut", + "value": 3 + }, + "staked_tokens": { + "value": 2 + }, + "token_supply": { + "value": 1 + }, + "validator": { + "description": "All tokens are bonded to this validator", + "value": 3 + } + } + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 4 + }, + "denom": { + "value": 3 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "cosmwasm_std_math_decimal_Decimal", + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "decimal", + "precision": 128, + "signed": false + } + ] +} diff --git a/contracts/staking/schema/cw_schema/raw/response_to_token_info.json b/contracts/staking/schema/cw_schema/raw/response_to_token_info.json new file mode 100644 index 0000000000..0c4de90e0b --- /dev/null +++ b/contracts/staking/schema/cw_schema/raw/response_to_token_info.json @@ -0,0 +1,35 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_TokenInfoResponse", + "description": "TokenInfoResponse is info to display the derivative token in a UI", + "type": "struct", + "properties": { + "decimals": { + "description": "decimal places of the derivative token (for UI)", + "value": 2 + }, + "name": { + "description": "name of the derivative token", + "value": 1 + }, + "symbol": { + "description": "symbol / ticker of the derivative token", + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u8", + "type": "integer", + "precision": 8, + "signed": false + } + ] +} diff --git a/contracts/staking/schema/cw_schema/staking.json b/contracts/staking/schema/cw_schema/staking.json new file mode 100644 index 0000000000..cd00ba2686 --- /dev/null +++ b/contracts/staking/schema/cw_schema/staking.json @@ -0,0 +1,330 @@ +{ + "contract_name": "staking", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_InstantiateMsg", + "type": "struct", + "properties": { + "decimals": { + "description": "decimal places of the derivative token (for UI)\nTODO: does this make sense? Do we need to normalize on this?\nWe don't even know the decimals of the native token", + "value": 2 + }, + "exit_tax": { + "description": "this is how much the owner takes as a cut when someone unbonds\nTODO", + "value": 3 + }, + "min_withdrawal": { + "description": "This is the minimum amount we will pull out to reinvest, as well as a minimum\nthat can be unbonded (to avoid needless staking tx)", + "value": 4 + }, + "name": { + "description": "name of the derivative token (FIXME: auto-generate?)", + "value": 1 + }, + "symbol": { + "description": "symbol / ticker of the derivative token", + "value": 1 + }, + "validator": { + "description": "This is the validator that all tokens will be bonded to", + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u8", + "type": "integer", + "precision": 8, + "signed": false + }, + { + "name": "cosmwasm_std_math_decimal_Decimal", + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "decimal", + "precision": 128, + "signed": false + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_ExecuteMsg", + "type": "enum", + "cases": { + "bond": { + "description": "Bond will bond all staking tokens sent with the message and release derivative tokens", + "type": "named", + "properties": {} + }, + "bond_all_tokens": { + "description": "_BondAllTokens can only be called by the contract itself, after all rewards have been\nwithdrawn. This is an example of using \"callbacks\" in message flows.\nThis can only be invoked by the contract itself as a return from Reinvest", + "type": "named", + "properties": {} + }, + "claim": { + "description": "Claim is used to claim your native tokens that you previously \"unbonded\"\nafter the chain-defined waiting period (eg. 3 weeks)", + "type": "named", + "properties": {} + }, + "reinvest": { + "description": "Reinvest will check for all accumulated rewards, withdraw them, and\nre-bond them to the same validator. Anyone can call this, which updates\nthe value of the token (how much under custody).", + "type": "named", + "properties": {} + }, + "transfer": { + "description": "Transfer moves the derivative token", + "type": "named", + "properties": { + "amount": { + "value": 2 + }, + "recipient": { + "value": 1 + } + } + }, + "unbond": { + "description": "Unbond will \"burn\" the given amount of derivative tokens and send the unbonded\nstaking tokens to the message sender (after exit tax is deducted)", + "type": "named", + "properties": { + "amount": { + "value": 2 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + } + ] + }, + "query": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_QueryMsg", + "type": "enum", + "cases": { + "balance": { + "description": "Balance shows the number of staking derivatives", + "type": "named", + "properties": { + "address": { + "value": 1 + } + } + }, + "claims": { + "description": "Claims shows the number of tokens this address can access when they are done unbonding", + "type": "named", + "properties": { + "address": { + "value": 1 + } + } + }, + "investment": { + "description": "Investment shows info on total staking tokens under custody,\nwith which validator, as well as how many derivative tokens are lists.\nIt also shows with the exit tax.", + "type": "named", + "properties": {} + }, + "token_info": { + "description": "TokenInfo shows the metadata of the token for UIs", + "type": "named", + "properties": {} + } + } + }, + { + "name": "String", + "type": "string" + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "balance": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_BalanceResponse", + "type": "struct", + "properties": { + "balance": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + } + ] + }, + "claims": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_ClaimsResponse", + "type": "struct", + "properties": { + "claims": { + "value": 1 + } + } + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + } + ] + }, + "investment": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_InvestmentResponse", + "type": "struct", + "properties": { + "exit_tax": { + "description": "this is how much the owner takes as a cut when someone unbonds", + "value": 5 + }, + "min_withdrawal": { + "description": "This is the minimum amount we will pull out to reinvest, as well as a minimum\nthat can be unbonded (to avoid needless staking tx)", + "value": 1 + }, + "nominal_value": { + "value": 5 + }, + "owner": { + "description": "owner created the contract and takes a cut", + "value": 3 + }, + "staked_tokens": { + "value": 2 + }, + "token_supply": { + "value": 1 + }, + "validator": { + "description": "All tokens are bonded to this validator", + "value": 3 + } + } + }, + { + "name": "cosmwasm_std_math_uint128_Uint128", + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding,\nsuch that the full u128 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n```\n# use cosmwasm_std::Uint128;\nlet a = Uint128::from(123u128);\nassert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64);\nassert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32);\nassert_eq!(c.u128(), 70);\n```", + "type": "integer", + "precision": 128, + "signed": false + }, + { + "name": "cosmwasm_std_coin_Coin", + "type": "struct", + "properties": { + "amount": { + "value": 4 + }, + "denom": { + "value": 3 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "cosmwasm_std_math_uint256_Uint256", + "description": "An implementation of u256 that is using strings for JSON encoding/decoding,\nsuch that the full u256 range can be used for clients that convert JSON numbers to floats,\nlike JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types\nor `from_be_bytes` to provide big endian bytes:\n\n```\n# use cosmwasm_std::Uint256;\nlet a = Uint256::new(258u128);\nlet b = Uint256::from(258u16);\nlet c = Uint256::from_be_bytes([\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,\n0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,\n]);\nassert_eq!(a, b);\nassert_eq!(a, c);\n```", + "type": "integer", + "precision": 256, + "signed": false + }, + { + "name": "cosmwasm_std_math_decimal_Decimal", + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "decimal", + "precision": 128, + "signed": false + } + ] + }, + "token_info": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "staking_msg_TokenInfoResponse", + "description": "TokenInfoResponse is info to display the derivative token in a UI", + "type": "struct", + "properties": { + "decimals": { + "description": "decimal places of the derivative token (for UI)", + "value": 2 + }, + "name": { + "description": "name of the derivative token", + "value": 1 + }, + "symbol": { + "description": "symbol / ticker of the derivative token", + "value": 1 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u8", + "type": "integer", + "precision": 8, + "signed": false + } + ] + } + } +} diff --git a/contracts/staking/schema/raw/execute.json b/contracts/staking/schema/raw/execute.json new file mode 100644 index 0000000000..159d67cd90 --- /dev/null +++ b/contracts/staking/schema/raw/execute.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Transfer moves the derivative token", + "type": "object", + "required": [ + "transfer" + ], + "properties": { + "transfer": { + "type": "object", + "required": [ + "amount", + "recipient" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "recipient": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Bond will bond all staking tokens sent with the message and release derivative tokens", + "type": "object", + "required": [ + "bond" + ], + "properties": { + "bond": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Unbond will \"burn\" the given amount of derivative tokens and send the unbonded staking tokens to the message sender (after exit tax is deducted)", + "type": "object", + "required": [ + "unbond" + ], + "properties": { + "unbond": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Claim is used to claim your native tokens that you previously \"unbonded\" after the chain-defined waiting period (eg. 3 weeks)", + "type": "object", + "required": [ + "claim" + ], + "properties": { + "claim": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Reinvest will check for all accumulated rewards, withdraw them, and re-bond them to the same validator. Anyone can call this, which updates the value of the token (how much under custody).", + "type": "object", + "required": [ + "reinvest" + ], + "properties": { + "reinvest": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "_BondAllTokens can only be called by the contract itself, after all rewards have been withdrawn. This is an example of using \"callbacks\" in message flows. This can only be invoked by the contract itself as a return from Reinvest", + "type": "object", + "required": [ + "__bond_all_tokens" + ], + "properties": { + "__bond_all_tokens": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/staking/schema/raw/instantiate.json b/contracts/staking/schema/raw/instantiate.json new file mode 100644 index 0000000000..238129b9a2 --- /dev/null +++ b/contracts/staking/schema/raw/instantiate.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "decimals", + "exit_tax", + "min_withdrawal", + "name", + "symbol", + "validator" + ], + "properties": { + "decimals": { + "description": "decimal places of the derivative token (for UI) TODO: does this make sense? Do we need to normalize on this? We don't even know the decimals of the native token", + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "exit_tax": { + "description": "this is how much the owner takes as a cut when someone unbonds TODO", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "min_withdrawal": { + "description": "This is the minimum amount we will pull out to reinvest, as well as a minimum that can be unbonded (to avoid needless staking tx)", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] + }, + "name": { + "description": "name of the derivative token (FIXME: auto-generate?)", + "type": "string" + }, + "symbol": { + "description": "symbol / ticker of the derivative token", + "type": "string" + }, + "validator": { + "description": "This is the validator that all tokens will be bonded to", + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/staking/schema/raw/query.json b/contracts/staking/schema/raw/query.json new file mode 100644 index 0000000000..6427a6bc87 --- /dev/null +++ b/contracts/staking/schema/raw/query.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Balance shows the number of staking derivatives", + "type": "object", + "required": [ + "balance" + ], + "properties": { + "balance": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Claims shows the number of tokens this address can access when they are done unbonding", + "type": "object", + "required": [ + "claims" + ], + "properties": { + "claims": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "TokenInfo shows the metadata of the token for UIs", + "type": "object", + "required": [ + "token_info" + ], + "properties": { + "token_info": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Investment shows info on total staking tokens under custody, with which validator, as well as how many derivative tokens are lists. It also shows with the exit tax.", + "type": "object", + "required": [ + "investment" + ], + "properties": { + "investment": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/staking/schema/raw/response_to_balance.json b/contracts/staking/schema/raw/response_to_balance.json new file mode 100644 index 0000000000..7dcf4d4a51 --- /dev/null +++ b/contracts/staking/schema/raw/response_to_balance.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "BalanceResponse", + "type": "object", + "required": [ + "balance" + ], + "properties": { + "balance": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/staking/schema/raw/response_to_claims.json b/contracts/staking/schema/raw/response_to_claims.json new file mode 100644 index 0000000000..b393e85853 --- /dev/null +++ b/contracts/staking/schema/raw/response_to_claims.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ClaimsResponse", + "type": "object", + "required": [ + "claims" + ], + "properties": { + "claims": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/contracts/staking/schema/raw/response_to_investment.json b/contracts/staking/schema/raw/response_to_investment.json new file mode 100644 index 0000000000..97ae092e4c --- /dev/null +++ b/contracts/staking/schema/raw/response_to_investment.json @@ -0,0 +1,80 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InvestmentResponse", + "type": "object", + "required": [ + "exit_tax", + "min_withdrawal", + "nominal_value", + "owner", + "staked_tokens", + "token_supply", + "validator" + ], + "properties": { + "exit_tax": { + "description": "this is how much the owner takes as a cut when someone unbonds", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "min_withdrawal": { + "description": "This is the minimum amount we will pull out to reinvest, as well as a minimum that can be unbonded (to avoid needless staking tx)", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] + }, + "nominal_value": { + "$ref": "#/definitions/Decimal" + }, + "owner": { + "description": "owner created the contract and takes a cut", + "type": "string" + }, + "staked_tokens": { + "$ref": "#/definitions/Coin" + }, + "token_supply": { + "$ref": "#/definitions/Uint128" + }, + "validator": { + "description": "All tokens are bonded to this validator", + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint256" + }, + "denom": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" + } + } +} diff --git a/contracts/staking/schema/raw/response_to_token_info.json b/contracts/staking/schema/raw/response_to_token_info.json new file mode 100644 index 0000000000..76b139ecf9 --- /dev/null +++ b/contracts/staking/schema/raw/response_to_token_info.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TokenInfoResponse", + "description": "TokenInfoResponse is info to display the derivative token in a UI", + "type": "object", + "required": [ + "decimals", + "name", + "symbol" + ], + "properties": { + "decimals": { + "description": "decimal places of the derivative token (for UI)", + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, + "name": { + "description": "name of the derivative token", + "type": "string" + }, + "symbol": { + "description": "symbol / ticker of the derivative token", + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/contracts/staking/schema/staking.json b/contracts/staking/schema/staking.json index 3f395ac414..a56802bf28 100644 --- a/contracts/staking/schema/staking.json +++ b/contracts/staking/schema/staking.json @@ -30,7 +30,7 @@ ] }, "min_withdrawal": { - "description": "This is the minimum amount we will pull out to reinvest, as well as a minumum that can be unbonded (to avoid needless staking tx)", + "description": "This is the minimum amount we will pull out to reinvest, as well as a minimum that can be unbonded (to avoid needless staking tx)", "allOf": [ { "$ref": "#/definitions/Uint128" @@ -322,7 +322,7 @@ ] }, "min_withdrawal": { - "description": "This is the minimum amount we will pull out to reinvest, as well as a minumum that can be unbonded (to avoid needless staking tx)", + "description": "This is the minimum amount we will pull out to reinvest, as well as a minimum that can be unbonded (to avoid needless staking tx)", "allOf": [ { "$ref": "#/definitions/Uint128" @@ -357,12 +357,13 @@ ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "$ref": "#/definitions/Uint256" }, "denom": { "type": "string" } - } + }, + "additionalProperties": false }, "Decimal": { "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", @@ -371,6 +372,10 @@ "Uint128": { "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", "type": "string" + }, + "Uint256": { + "description": "An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `new` to create instances out of u128, `from` for other primitive uint types or `from_be_bytes` to provide big endian bytes:\n\n``` # use cosmwasm_std::Uint256; let a = Uint256::new(258u128); let b = Uint256::from(258u16); let c = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, ]); assert_eq!(a, b); assert_eq!(a, c); ```", + "type": "string" } } }, diff --git a/contracts/staking/examples/schema.rs b/contracts/staking/src/bin/schema.rs similarity index 100% rename from contracts/staking/examples/schema.rs rename to contracts/staking/src/bin/schema.rs diff --git a/contracts/staking/src/contract.rs b/contracts/staking/src/contract.rs index 5582652090..7f7e15d13c 100644 --- a/contracts/staking/src/contract.rs +++ b/contracts/staking/src/contract.rs @@ -1,7 +1,7 @@ use cosmwasm_std::{ - coin, entry_point, to_binary, BankMsg, Decimal, Deps, DepsMut, DistributionMsg, Env, - MessageInfo, QuerierWrapper, QueryResponse, Response, StakingMsg, StdError, StdResult, Uint128, - WasmMsg, + entry_point, to_json_binary, BankMsg, Coin, Decimal, Decimal256, Deps, DepsMut, + DistributionMsg, Env, MessageInfo, QuerierWrapper, QueryResponse, Response, StakingMsg, + StdError, StdErrorKind, StdResult, Uint128, Uint256, WasmMsg, }; use crate::errors::{StakingError, Unauthorized}; @@ -10,8 +10,8 @@ use crate::msg::{ TokenInfoResponse, }; use crate::state::{ - balances, balances_read, claims, claims_read, invest_info, invest_info_read, token_info, - token_info_read, total_supply, total_supply_read, InvestmentInfo, Supply, TokenInfo, + load_item, may_load_map, save_item, save_map, update_item, InvestmentInfo, Supply, TokenInfo, + KEY_INVESTMENT, KEY_TOKEN_INFO, KEY_TOTAL_SUPPLY, PREFIX_BALANCE, PREFIX_CLAIMS, }; const FALLBACK_RATIO: Decimal = Decimal::one(); @@ -26,7 +26,7 @@ pub fn instantiate( // ensure the validator is registered let validator = deps.querier.query_validator(msg.validator.clone())?; if validator.is_none() { - return Err(StdError::generic_err(format!( + return Err(StdError::msg(format_args!( "{} is not in the current validator set", msg.validator ))); @@ -37,7 +37,7 @@ pub fn instantiate( symbol: msg.symbol, decimals: msg.decimals, }; - token_info(deps.storage).save(&token)?; + save_item(deps.storage, KEY_TOKEN_INFO, &token)?; let denom = deps.querier.query_bonded_denom()?; let invest = InvestmentInfo { @@ -47,11 +47,11 @@ pub fn instantiate( validator: msg.validator, min_withdrawal: msg.min_withdrawal, }; - invest_info(deps.storage).save(&invest)?; + save_item(deps.storage, KEY_INVESTMENT, &invest)?; // set supply to 0 let supply = Supply::default(); - total_supply(deps.storage).save(&supply)?; + save_item(deps.storage, KEY_TOTAL_SUPPLY, &supply)?; Ok(Response::default()) } @@ -85,13 +85,17 @@ pub fn transfer( let rcpt_raw = deps.api.addr_canonicalize(&recipient)?; let sender_raw = deps.api.addr_canonicalize(info.sender.as_str())?; - let mut accounts = balances(deps.storage); - accounts.update(&sender_raw, |balance: Option| -> StdResult<_> { - Ok(balance.unwrap_or_default().checked_sub(send)?) - })?; - accounts.update(&rcpt_raw, |balance: Option| -> StdResult<_> { - Ok(balance.unwrap_or_default() + send) - })?; + let balance: Uint128 = + may_load_map(deps.storage, PREFIX_BALANCE, &sender_raw)?.unwrap_or_default(); + save_map( + deps.storage, + PREFIX_BALANCE, + &sender_raw, + balance.checked_sub(send)?, + )?; + let balance: Uint128 = + may_load_map(deps.storage, PREFIX_BALANCE, &rcpt_raw)?.unwrap_or_default(); + save_map(deps.storage, PREFIX_BALANCE, &rcpt_raw, balance + send)?; let res = Response::new() .add_attribute("action", "transfer") @@ -103,16 +107,15 @@ pub fn transfer( // get_bonded returns the total amount of delegations from contract // it ensures they are all the same denom -fn get_bonded(querier: &QuerierWrapper, contract_addr: impl Into) -> StdResult { +fn get_bonded(querier: &QuerierWrapper, contract_addr: impl Into) -> StdResult { let bonds = querier.query_all_delegations(contract_addr)?; if bonds.is_empty() { - return Ok(Uint128::new(0)); + return Ok(Uint256::zero()); } let denom = bonds[0].amount.denom.as_str(); - bonds.iter().fold(Ok(Uint128::new(0)), |racc, d| { - let acc = racc?; + bonds.iter().try_fold(Uint256::zero(), |acc, d| { if d.amount.denom.as_str() != denom { - Err(StdError::generic_err(format!( + Err(StdError::msg(format_args!( "different denoms in bonds: '{}' vs '{}'", denom, &d.amount.denom ))) @@ -122,9 +125,9 @@ fn get_bonded(querier: &QuerierWrapper, contract_addr: impl Into) -> Std }) } -fn assert_bonds(supply: &Supply, bonded: Uint128) -> StdResult<()> { +fn assert_bonds(supply: &Supply, bonded: Uint256) -> StdResult<()> { if supply.bonded != bonded { - Err(StdError::generic_err(format!( + Err(StdError::msg(format_args!( "Stored bonded {}, but query bonded: {}", supply.bonded, bonded ))) @@ -137,35 +140,35 @@ pub fn bond(deps: DepsMut, env: Env, info: MessageInfo) -> StdResult { let sender_raw = deps.api.addr_canonicalize(info.sender.as_str())?; // ensure we have the proper denom - let invest = invest_info_read(deps.storage).load()?; + let invest: InvestmentInfo = load_item(deps.storage, KEY_INVESTMENT)?; // payment finds the proper coin (or throws an error) let payment = info .funds .iter() .find(|x| x.denom == invest.bond_denom) - .ok_or_else(|| StdError::generic_err(format!("No {} tokens sent", &invest.bond_denom)))?; + .ok_or_else(|| StdError::msg(format_args!("No {} tokens sent", &invest.bond_denom)))?; // bonded is the total number of tokens we have delegated from this address let bonded = get_bonded(&deps.querier, env.contract.address)?; // calculate to_mint and update total supply - let mut totals = total_supply(deps.storage); - let mut supply = totals.load()?; + let mut supply: Supply = load_item(deps.storage, KEY_TOTAL_SUPPLY)?; // TODO: this is just temporary check - we should use dynamic query or have a way to recover assert_bonds(&supply, bonded)?; + // note that the conversion to Uint128 limits payment amounts to `u128::MAX` let to_mint = if supply.issued.is_zero() || bonded.is_zero() { - FALLBACK_RATIO * payment.amount + Uint128::try_from(payment.amount.mul_floor(FALLBACK_RATIO))? } else { - payment.amount.multiply_ratio(supply.issued, bonded) + Uint128::try_from(payment.amount.multiply_ratio(supply.issued, bonded))? }; supply.bonded = bonded + payment.amount; supply.issued += to_mint; - totals.save(&supply)?; + save_item(deps.storage, KEY_TOTAL_SUPPLY, &supply)?; // update the balance of the sender - balances(deps.storage).update(&sender_raw, |balance| -> StdResult<_> { - Ok(balance.unwrap_or_default() + to_mint) - })?; + let balance: Uint128 = + may_load_map(deps.storage, PREFIX_BALANCE, &sender_raw)?.unwrap_or_default(); + save_map(deps.storage, PREFIX_BALANCE, &sender_raw, balance + to_mint)?; // bond them to the validator let res = Response::new() @@ -181,10 +184,10 @@ pub fn bond(deps: DepsMut, env: Env, info: MessageInfo) -> StdResult { } pub fn unbond(deps: DepsMut, env: Env, info: MessageInfo, amount: Uint128) -> StdResult { - let invest = invest_info_read(deps.storage).load()?; + let invest: InvestmentInfo = load_item(deps.storage, KEY_INVESTMENT)?; // ensure it is big enough to care if amount < invest.min_withdrawal { - return Err(StdError::generic_err(format!( + return Err(StdError::msg(format_args!( "Must unbond at least {} {}", invest.min_withdrawal, invest.bond_denom ))); @@ -193,19 +196,23 @@ pub fn unbond(deps: DepsMut, env: Env, info: MessageInfo, amount: Uint128) -> St let sender_raw = deps.api.addr_canonicalize(info.sender.as_str())?; let owner_raw = deps.api.addr_canonicalize(invest.owner.as_str())?; - // calculate tax and remainer to unbond - let tax = amount * invest.exit_tax; + // calculate tax and remainder to unbond + let tax = amount.mul_floor(invest.exit_tax); // deduct all from the account - let mut accounts = balances(deps.storage); - accounts.update(&sender_raw, |balance| -> StdResult<_> { - Ok(balance.unwrap_or_default().checked_sub(amount)?) - })?; + let balance: Uint128 = + may_load_map(deps.storage, PREFIX_BALANCE, &sender_raw)?.unwrap_or_default(); + save_map( + deps.storage, + PREFIX_BALANCE, + &sender_raw, + balance.checked_sub(amount)?, + )?; if tax > Uint128::new(0) { // add tax to the owner - accounts.update(&owner_raw, |balance: Option| -> StdResult<_> { - Ok(balance.unwrap_or_default() + tax) - })?; + let balance: Uint128 = + may_load_map(deps.storage, PREFIX_BALANCE, &owner_raw)?.unwrap_or_default(); + save_map(deps.storage, PREFIX_BALANCE, &owner_raw, balance + tax)?; } // re-calculate bonded to ensure we have real values @@ -214,20 +221,19 @@ pub fn unbond(deps: DepsMut, env: Env, info: MessageInfo, amount: Uint128) -> St // calculate how many native tokens this is worth and update supply let remainder = amount.checked_sub(tax)?; - let mut totals = total_supply(deps.storage); - let mut supply = totals.load()?; + let mut supply: Supply = load_item(deps.storage, KEY_TOTAL_SUPPLY)?; // TODO: this is just temporary check - we should use dynamic query or have a way to recover assert_bonds(&supply, bonded)?; - let unbond = remainder.multiply_ratio(bonded, supply.issued); + let unbond = Uint256::from(remainder).multiply_ratio(bonded, supply.issued); supply.bonded = bonded.checked_sub(unbond)?; supply.issued = supply.issued.checked_sub(remainder)?; supply.claims += unbond; - totals.save(&supply)?; + save_item(deps.storage, KEY_TOTAL_SUPPLY, &supply)?; // add a claim to this user to get their tokens after the unbonding period - claims(deps.storage).update(&sender_raw, |claim| -> StdResult<_> { - Ok(claim.unwrap_or_default() + unbond) - })?; + let claim: Uint256 = + may_load_map(deps.storage, PREFIX_CLAIMS, &sender_raw)?.unwrap_or_default(); + save_map(deps.storage, PREFIX_CLAIMS, &sender_raw, claim + unbond)?; // unbond them let res = Response::new() @@ -237,37 +243,39 @@ pub fn unbond(deps: DepsMut, env: Env, info: MessageInfo, amount: Uint128) -> St .add_attribute("burnt", amount) .add_message(StakingMsg::Undelegate { validator: invest.validator, - amount: coin(unbond.u128(), &invest.bond_denom), + amount: Coin::new(unbond, &invest.bond_denom), }); Ok(res) } pub fn claim(deps: DepsMut, env: Env, info: MessageInfo) -> StdResult { // find how many tokens the contract has - let invest = invest_info_read(deps.storage).load()?; + let invest: InvestmentInfo = load_item(deps.storage, KEY_INVESTMENT)?; let mut balance = deps .querier .query_balance(env.contract.address, invest.bond_denom)?; - if balance.amount < invest.min_withdrawal { - return Err(StdError::generic_err( + if balance.amount < invest.min_withdrawal.into() { + return Err(StdError::msg( "Insufficient balance in contract to process claim", )); } // check how much to send - min(balance, claims[sender]), and reduce the claim let sender_raw = deps.api.addr_canonicalize(info.sender.as_str())?; - let mut to_send = balance.amount; - claims(deps.storage).update(sender_raw.as_slice(), |claim| -> StdResult<_> { - let claim = claim.ok_or_else(|| StdError::generic_err("no claim for this address"))?; - to_send = to_send.min(claim); - Ok(claim.checked_sub(to_send)?) - })?; + let claim = may_load_map(deps.storage, PREFIX_CLAIMS, &sender_raw)? + .ok_or_else(|| StdError::msg("no claim for this address"))?; + let to_send = balance.amount.min(claim); + save_map( + deps.storage, + PREFIX_CLAIMS, + &sender_raw, + claim.checked_sub(to_send)?, + )?; // update total supply (lower claim) - total_supply(deps.storage).update(|mut supply| -> StdResult<_> { - supply.claims = supply.claims.checked_sub(to_send)?; - Ok(supply) - })?; + let mut supply: Supply = load_item(deps.storage, KEY_TOTAL_SUPPLY)?; + supply.claims = supply.claims.checked_sub(to_send)?; + save_item(deps.storage, KEY_TOTAL_SUPPLY, &supply)?; // transfer tokens to the sender balance.amount = to_send; @@ -287,8 +295,8 @@ pub fn claim(deps: DepsMut, env: Env, info: MessageInfo) -> StdResult /// to reinvest the new earnings (and anything else that accumulated) pub fn reinvest(deps: DepsMut, env: Env, _info: MessageInfo) -> StdResult { let contract_addr = env.contract.address; - let invest = invest_info_read(deps.storage).load()?; - let msg = to_binary(&ExecuteMsg::_BondAllTokens {})?; + let invest: InvestmentInfo = load_item(deps.storage, KEY_INVESTMENT)?; + let msg = to_json_binary(&ExecuteMsg::_BondAllTokens {})?; // and bond them to the validator let res = Response::new() @@ -314,23 +322,25 @@ pub fn _bond_all_tokens( } // find how many tokens we have to bond - let invest = invest_info_read(deps.storage).load()?; + let invest: InvestmentInfo = load_item(deps.storage, KEY_INVESTMENT)?; let mut balance = deps .querier .query_balance(env.contract.address, &invest.bond_denom)?; // we deduct pending claims from our account balance before reinvesting. // if there is not enough funds, we just return a no-op - match total_supply(deps.storage).update(|mut supply| { - balance.amount = balance.amount.checked_sub(supply.claims)?; - // this just triggers the "no op" case if we don't have min_withdrawal left to reinvest - balance.amount.checked_sub(invest.min_withdrawal)?; - supply.bonded += balance.amount; - Ok(supply) - }) { + let updated: StdResult<_> = + update_item(deps.storage, KEY_TOTAL_SUPPLY, |mut supply: Supply| { + balance.amount = balance.amount.checked_sub(supply.claims)?; + // this just triggers the "no op" case if we don't have min_withdrawal left to reinvest + balance.amount.checked_sub(invest.min_withdrawal.into())?; + supply.bonded += balance.amount; + Ok(supply) + }); + match updated { Ok(_) => {} // if it is below the minimum, we do a no-op (do not revert other state from withdrawal) - Err(StdError::Overflow { .. }) => return Ok(Response::default()), + Err(e) if e.kind() == StdErrorKind::Overflow => return Ok(Response::default()), Err(e) => return Err(e.into()), } @@ -348,10 +358,10 @@ pub fn _bond_all_tokens( #[entry_point] pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { match msg { - QueryMsg::TokenInfo {} => to_binary(&query_token_info(deps)?), - QueryMsg::Investment {} => to_binary(&query_investment(deps)?), - QueryMsg::Balance { address } => to_binary(&query_balance(deps, &address)?), - QueryMsg::Claims { address } => to_binary(&query_claims(deps, &address)?), + QueryMsg::TokenInfo {} => to_json_binary(&query_token_info(deps)?), + QueryMsg::Investment {} => to_json_binary(&query_investment(deps)?), + QueryMsg::Balance { address } => to_json_binary(&query_balance(deps, &address)?), + QueryMsg::Claims { address } => to_json_binary(&query_claims(deps, &address)?), } } @@ -360,7 +370,7 @@ pub fn query_token_info(deps: Deps) -> StdResult { name, symbol, decimals, - } = token_info_read(deps.storage).load()?; + } = load_item(deps.storage, KEY_TOKEN_INFO)?; Ok(TokenInfoResponse { name, @@ -371,23 +381,19 @@ pub fn query_token_info(deps: Deps) -> StdResult { pub fn query_balance(deps: Deps, address: &str) -> StdResult { let address_raw = deps.api.addr_canonicalize(address)?; - let balance = balances_read(deps.storage) - .may_load(address_raw.as_slice())? - .unwrap_or_default(); + let balance = may_load_map(deps.storage, PREFIX_BALANCE, &address_raw)?.unwrap_or_default(); Ok(BalanceResponse { balance }) } pub fn query_claims(deps: Deps, address: &str) -> StdResult { let address_raw = deps.api.addr_canonicalize(address)?; - let claims = claims_read(deps.storage) - .may_load(address_raw.as_slice())? - .unwrap_or_default(); + let claims = may_load_map(deps.storage, PREFIX_CLAIMS, &address_raw)?.unwrap_or_default(); Ok(ClaimsResponse { claims }) } pub fn query_investment(deps: Deps) -> StdResult { - let invest = invest_info_read(deps.storage).load()?; - let supply = total_supply_read(deps.storage).load()?; + let invest: InvestmentInfo = load_item(deps.storage, KEY_INVESTMENT)?; + let supply: Supply = load_item(deps.storage, KEY_TOTAL_SUPPLY)?; let res = InvestmentResponse { owner: invest.owner.into(), @@ -395,11 +401,13 @@ pub fn query_investment(deps: Deps) -> StdResult { validator: invest.validator, min_withdrawal: invest.min_withdrawal, token_supply: supply.issued, - staked_tokens: coin(supply.bonded.u128(), &invest.bond_denom), + staked_tokens: Coin::new(supply.bonded, invest.bond_denom), nominal_value: if supply.issued.is_zero() { FALLBACK_RATIO } else { - Decimal::from_ratio(supply.bonded, supply.issued) + Decimal256::from_ratio(supply.bonded, supply.issued) + .try_into() + .map_err(|_| StdError::msg("nominal value too high"))? }, }; Ok(res) @@ -409,37 +417,39 @@ pub fn query_investment(deps: Deps) -> StdResult { mod tests { use super::*; use cosmwasm_std::testing::{ - mock_dependencies, mock_env, mock_info, MockQuerier, MOCK_CONTRACT_ADDR, + message_info, mock_dependencies, mock_env, MockQuerier, StakingQuerier, MOCK_CONTRACT_ADDR, + }; + use cosmwasm_std::{ + coin, coins, Addr, Coin, CosmosMsg, Decimal, FullDelegation, StdErrorKind, Validator, }; - use cosmwasm_std::{coins, Addr, Coin, CosmosMsg, Decimal, FullDelegation, Validator}; use std::str::FromStr; fn sample_validator(addr: &str) -> Validator { - Validator { - address: addr.to_owned(), - commission: Decimal::percent(3), - max_commission: Decimal::percent(10), - max_change_rate: Decimal::percent(1), - } + Validator::create( + addr.to_owned(), + Decimal::percent(3), + Decimal::percent(10), + Decimal::percent(1), + ) } fn sample_delegation(validator_addr: &str, amount: Coin) -> FullDelegation { - let can_redelegate = amount.clone(); - FullDelegation { - validator: validator_addr.to_owned(), - delegator: Addr::unchecked(MOCK_CONTRACT_ADDR), + FullDelegation::create( + Addr::unchecked(MOCK_CONTRACT_ADDR), + validator_addr.to_owned(), + amount.clone(), amount, - can_redelegate, - accumulated_rewards: Vec::new(), - } + vec![], + ) } fn set_validator(querier: &mut MockQuerier) { - querier.update_staking("ustake", &[sample_validator(DEFAULT_VALIDATOR)], &[]); + querier.staking = + StakingQuerier::new("ustake", &[sample_validator(DEFAULT_VALIDATOR)], &[]); } fn set_delegation(querier: &mut MockQuerier, amount: u128, denom: &str) { - querier.update_staking( + querier.staking.update( "ustake", &[sample_validator(DEFAULT_VALIDATOR)], &[sample_delegation(DEFAULT_VALIDATOR, coin(amount, denom))], @@ -459,21 +469,23 @@ mod tests { } } - fn get_balance(deps: Deps, addr: &str) -> Uint128 { - query_balance(deps, addr).unwrap().balance + fn get_balance(deps: Deps, addr: &Addr) -> Uint128 { + query_balance(deps, addr.as_str()).unwrap().balance } - fn get_claims(deps: Deps, addr: &str) -> Uint128 { - query_claims(deps, addr).unwrap().claims + fn get_claims(deps: Deps, addr: &Addr) -> Uint128 { + query_claims(deps, addr.as_str()).unwrap().claims } #[test] fn initialization_with_missing_validator() { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make("creator"); + deps.querier - .update_staking("ustake", &[sample_validator("john")], &[]); + .staking + .update("ustake", &[sample_validator("john")], &[]); - let creator = String::from("creator"); let msg = InstantiateMsg { name: "Cool Derivative".to_string(), symbol: "DRV".to_string(), @@ -482,22 +494,22 @@ mod tests { exit_tax: Decimal::percent(2), min_withdrawal: Uint128::new(50), }; - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); // make sure we can instantiate with this let res = instantiate(deps.as_mut(), mock_env(), info, msg); - match res.unwrap_err() { - StdError::GenericErr { msg, .. } => { - assert_eq!(msg, "my-validator is not in the current validator set") - } - _ => panic!("expected unregistered validator error"), - } + assert!(res + .unwrap_err() + .to_string() + .ends_with("my-validator is not in the current validator set")); } #[test] fn proper_initialization() { let mut deps = mock_dependencies(); - deps.querier.update_staking( + let creator = deps.api.addr_make("creator"); + + deps.querier.staking.update( "ustake", &[ sample_validator("john"), @@ -507,7 +519,6 @@ mod tests { &[], ); - let creator = String::from("creator"); let msg = InstantiateMsg { name: "Cool Derivative".to_string(), symbol: "DRV".to_string(), @@ -516,7 +527,7 @@ mod tests { exit_tax: Decimal::percent(2), min_withdrawal: Uint128::new(50), }; - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); // make sure we can instantiate with this let res = instantiate(deps.as_mut(), mock_env(), info, msg.clone()).unwrap(); @@ -535,7 +546,7 @@ mod tests { // investment info correct let invest = query_investment(deps.as_ref()).unwrap(); - assert_eq!(&invest.owner, &creator); + assert_eq!(&invest.owner, creator.as_str()); assert_eq!(&invest.validator, &msg.validator); assert_eq!(invest.exit_tax, msg.exit_tax); assert_eq!(invest.min_withdrawal, msg.min_withdrawal); @@ -550,18 +561,19 @@ mod tests { let mut deps = mock_dependencies(); set_validator(&mut deps.querier); - let creator = String::from("creator"); + let creator = deps.api.addr_make("creator"); + let bob = deps.api.addr_make("bob"); + let instantiate_msg = default_init(2, 50); - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); // make sure we can instantiate with this let res = instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); assert_eq!(0, res.messages.len()); // let's bond some tokens now - let bob = String::from("bob"); let bond_msg = ExecuteMsg::Bond {}; - let info = mock_info(&bob, &[coin(10, "random"), coin(1000, "ustake")]); + let info = message_info(&bob, &[coin(10, "random"), coin(1000, "ustake")]); // try to bond and make sure we trigger delegation let res = execute(deps.as_mut(), mock_env(), info, bond_msg).unwrap(); @@ -572,7 +584,7 @@ mod tests { assert_eq!(validator.as_str(), DEFAULT_VALIDATOR); assert_eq!(amount, &coin(1000, "ustake")); } - _ => panic!("Unexpected message: {:?}", delegate), + _ => panic!("Unexpected message: {delegate:?}"), } // bob got 1000 DRV for 1000 stake at a 1.0 ratio @@ -590,18 +602,21 @@ mod tests { let mut deps = mock_dependencies(); set_validator(&mut deps.querier); - let creator = String::from("creator"); + let creator = deps.api.addr_make("creator"); + let bob = deps.api.addr_make("bob"); + let alice = deps.api.addr_make("alice"); + let contract = deps.api.addr_make(MOCK_CONTRACT_ADDR); + let instantiate_msg = default_init(2, 50); - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); // make sure we can instantiate with this let res = instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); assert_eq!(0, res.messages.len()); // let's bond some tokens now - let bob = String::from("bob"); let bond_msg = ExecuteMsg::Bond {}; - let info = mock_info(&bob, &[coin(10, "random"), coin(1000, "ustake")]); + let info = message_info(&bob, &[coin(10, "random"), coin(1000, "ustake")]); let res = execute(deps.as_mut(), mock_env(), info, bond_msg).unwrap(); assert_eq!(1, res.messages.len()); @@ -610,10 +625,13 @@ mod tests { // fake a reinvestment (this must be sent by the contract itself) let rebond_msg = ExecuteMsg::_BondAllTokens {}; - let info = mock_info(MOCK_CONTRACT_ADDR, &[]); + let info = message_info(&contract, &[]); deps.querier - .update_balance(MOCK_CONTRACT_ADDR, coins(500, "ustake")); - let _ = execute(deps.as_mut(), mock_env(), info, rebond_msg).unwrap(); + .bank + .update_balance(&contract, coins(500, "ustake")); + let mut env = mock_env(); + env.contract.address = contract.clone(); + let _ = execute(deps.as_mut(), env, info, rebond_msg).unwrap(); // update the querier with new bond set_delegation(&mut deps.querier, 1500, "ustake"); @@ -626,9 +644,8 @@ mod tests { assert_eq!(invest.nominal_value, ratio); // we bond some other tokens and get a different issuance price (maintaining the ratio) - let alice = String::from("alice"); let bond_msg = ExecuteMsg::Bond {}; - let info = mock_info(&alice, &[coin(3000, "ustake")]); + let info = message_info(&alice, &[coin(3000, "ustake")]); let res = execute(deps.as_mut(), mock_env(), info, bond_msg).unwrap(); assert_eq!(1, res.messages.len()); @@ -649,26 +666,27 @@ mod tests { let mut deps = mock_dependencies(); set_validator(&mut deps.querier); - let creator = String::from("creator"); + let creator = deps.api.addr_make("creator"); + let bob = deps.api.addr_make("bob"); + let instantiate_msg = default_init(2, 50); - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); // make sure we can instantiate with this let res = instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); assert_eq!(0, res.messages.len()); // let's bond some tokens now - let bob = String::from("bob"); let bond_msg = ExecuteMsg::Bond {}; - let info = mock_info(&bob, &[coin(500, "photon")]); + let info = message_info(&bob, &[coin(500, "photon")]); // try to bond and make sure we trigger delegation let res = execute(deps.as_mut(), mock_env(), info, bond_msg); match res.unwrap_err() { - StakingError::Std { - original: StdError::GenericErr { msg, .. }, - } => assert_eq!(msg, "No ustake tokens sent"), - err => panic!("Unexpected error: {:?}", err), + StakingError::Std { original } => { + assert!(original.to_string().ends_with("No ustake tokens sent")) + } + err => panic!("Unexpected error: {err:?}"), }; } @@ -677,18 +695,20 @@ mod tests { let mut deps = mock_dependencies(); set_validator(&mut deps.querier); - let creator = String::from("creator"); + let creator = deps.api.addr_make("creator"); + let bob = deps.api.addr_make("bob"); + let contract = deps.api.addr_make(MOCK_CONTRACT_ADDR); + let instantiate_msg = default_init(10, 50); - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); // make sure we can instantiate with this let res = instantiate(deps.as_mut(), mock_env(), info, instantiate_msg).unwrap(); assert_eq!(0, res.messages.len()); // let's bond some tokens now - let bob = String::from("bob"); let bond_msg = ExecuteMsg::Bond {}; - let info = mock_info(&bob, &[coin(10, "random"), coin(1000, "ustake")]); + let info = message_info(&bob, &[coin(10, "random"), coin(1000, "ustake")]); let res = execute(deps.as_mut(), mock_env(), info, bond_msg).unwrap(); assert_eq!(1, res.messages.len()); @@ -698,26 +718,30 @@ mod tests { // fake a reinvestment (this must be sent by the contract itself) // after this, we see 1000 issues and 1500 bonded (and a price of 1.5) let rebond_msg = ExecuteMsg::_BondAllTokens {}; - let info = mock_info(MOCK_CONTRACT_ADDR, &[]); + let info = message_info(&contract, &[]); deps.querier - .update_balance(MOCK_CONTRACT_ADDR, coins(500, "ustake")); - let _ = execute(deps.as_mut(), mock_env(), info, rebond_msg).unwrap(); + .bank + .update_balance(&contract, coins(500, "ustake")); + let mut env = mock_env(); + env.contract.address = contract.clone(); + let _ = execute(deps.as_mut(), env, info, rebond_msg).unwrap(); // update the querier with new bond, lower balance set_delegation(&mut deps.querier, 1500, "ustake"); - deps.querier.update_balance(MOCK_CONTRACT_ADDR, vec![]); + deps.querier.bank.update_balance(&contract, vec![]); // creator now tries to unbond these tokens - this must fail let unbond_msg = ExecuteMsg::Unbond { amount: Uint128::new(600), }; - let info = mock_info(&creator, &[]); + let info = message_info(&creator, &[]); let res = execute(deps.as_mut(), mock_env(), info, unbond_msg); - match res.unwrap_err() { + let err = res.unwrap_err(); + match err { StakingError::Std { - original: StdError::Overflow { .. }, - } => {} - err => panic!("Unexpected error: {:?}", err), + original: std_err, .. + } if std_err.kind() == StdErrorKind::Overflow => (), + _ => panic!("Unexpected error: {err:?}"), } // bob unbonds 600 tokens at 10% tax... @@ -729,7 +753,7 @@ mod tests { let owner_cut = Uint128::new(60); let bobs_claim = Uint128::new(810); let bobs_balance = Uint128::new(400); - let info = mock_info(&bob, &[]); + let info = message_info(&bob, &[]); let res = execute(deps.as_mut(), mock_env(), info, unbond_msg).unwrap(); assert_eq!(1, res.messages.len()); let delegate = &res.messages[0].msg; @@ -738,7 +762,7 @@ mod tests { assert_eq!(validator.as_str(), DEFAULT_VALIDATOR); assert_eq!(amount, &coin(bobs_claim.u128(), "ustake")); } - _ => panic!("Unexpected message: {:?}", delegate), + _ => panic!("Unexpected message: {delegate:?}"), } // update the querier with new bond, lower balance diff --git a/contracts/staking/src/errors.rs b/contracts/staking/src/errors.rs index 9c55a497fd..55ee99c4fb 100644 --- a/contracts/staking/src/errors.rs +++ b/contracts/staking/src/errors.rs @@ -2,7 +2,7 @@ use cosmwasm_std::StdError; use snafu::Snafu; #[derive(Snafu, Debug)] -#[snafu(visibility = "pub(crate)")] +#[snafu(context(suffix(false)), visibility(pub(crate)))] pub enum StakingError { /// this is needed so we can use `bucket.load(...)?` and have it auto-converted to the custom error #[snafu(display("StdError: {}", original))] diff --git a/contracts/staking/src/msg.rs b/contracts/staking/src/msg.rs index 68f2ed42a3..d6ea51f1f2 100644 --- a/contracts/staking/src/msg.rs +++ b/contracts/staking/src/msg.rs @@ -19,7 +19,7 @@ pub struct InstantiateMsg { /// this is how much the owner takes as a cut when someone unbonds /// TODO pub exit_tax: Decimal, - /// This is the minimum amount we will pull out to reinvest, as well as a minumum + /// This is the minimum amount we will pull out to reinvest, as well as a minimum /// that can be unbonded (to avoid needless staking tx) pub min_withdrawal: Uint128, } @@ -99,7 +99,7 @@ pub struct InvestmentResponse { pub exit_tax: Decimal, /// All tokens are bonded to this validator pub validator: String, - /// This is the minimum amount we will pull out to reinvest, as well as a minumum + /// This is the minimum amount we will pull out to reinvest, as well as a minimum /// that can be unbonded (to avoid needless staking tx) pub min_withdrawal: Uint128, } diff --git a/contracts/staking/src/state.rs b/contracts/staking/src/state.rs index 99a9f3b9dc..46d0dc70bd 100644 --- a/contracts/staking/src/state.rs +++ b/contracts/staking/src/state.rs @@ -1,10 +1,12 @@ +use std::any::type_name; + use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use cosmwasm_std::{Addr, Decimal, Storage, Uint128}; -use cosmwasm_storage::{ - bucket, bucket_read, singleton, singleton_read, Bucket, ReadonlyBucket, ReadonlySingleton, - Singleton, +use cosmwasm_std::{ + from_json, + storage_keys::{namespace_with_key, to_length_prefixed}, + to_json_vec, Addr, CanonicalAddr, Decimal, StdError, StdResult, Storage, Uint128, Uint256, }; pub const KEY_INVESTMENT: &[u8] = b"invest"; @@ -14,22 +16,34 @@ pub const KEY_TOTAL_SUPPLY: &[u8] = b"total_supply"; pub const PREFIX_BALANCE: &[u8] = b"balance"; pub const PREFIX_CLAIMS: &[u8] = b"claim"; -/// balances are state of the erc20 tokens -pub fn balances(storage: &mut dyn Storage) -> Bucket { - bucket(storage, PREFIX_BALANCE) -} - -pub fn balances_read(storage: &dyn Storage) -> ReadonlyBucket { - bucket_read(storage, PREFIX_BALANCE) +pub fn may_load_map( + storage: &dyn Storage, + prefix: &[u8], + key: &CanonicalAddr, +) -> StdResult> { + storage + .get(&namespace_with_key(&[prefix], key)) + .map(from_json) + .transpose() } -/// claims are the claims to money being unbonded -pub fn claims(storage: &mut dyn Storage) -> Bucket { - bucket(storage, PREFIX_CLAIMS) +pub fn save_map( + storage: &mut dyn Storage, + prefix: &[u8], + key: &CanonicalAddr, + value: impl Serialize, +) -> StdResult<()> { + storage.set(&namespace_with_key(&[prefix], key), &to_json_vec(&value)?); + Ok(()) } -pub fn claims_read(storage: &dyn Storage) -> ReadonlyBucket { - bucket_read(storage, PREFIX_CLAIMS) +pub fn load_map( + storage: &dyn Storage, + prefix: &[u8], + key: &CanonicalAddr, +) -> StdResult { + may_load_map(storage, prefix, key)? + .ok_or_else(|| StdError::msg(format!("map value for {key} not found"))) } /// Investment info is fixed at initialization, and is used to control the function of the contract @@ -42,9 +56,9 @@ pub struct InvestmentInfo { /// this is how much the owner takes as a cut when someone unbonds pub exit_tax: Decimal, /// All tokens are bonded to this validator - /// addr_humanize/addr_canonicalize doesn't work for validator addrresses (e.g. cosmosvaloper1...) + /// addr_humanize/addr_canonicalize doesn't work for validator addresses (e.g. cosmosvaloper1...) pub validator: String, - /// This is the minimum amount we will pull out to reinvest, as well as a minumum + /// This is the minimum amount we will pull out to reinvest, as well as a minimum /// that can be unbonded (to avoid needless staking tx) pub min_withdrawal: Uint128, } @@ -66,31 +80,31 @@ pub struct Supply { /// issued is how many derivative tokens this contract has issued pub issued: Uint128, /// bonded is how many native tokens exist bonded to the validator - pub bonded: Uint128, + pub bonded: Uint256, /// claims is how many tokens need to be reserved paying back those who unbonded - pub claims: Uint128, -} - -pub fn invest_info(storage: &mut dyn Storage) -> Singleton { - singleton(storage, KEY_INVESTMENT) -} - -pub fn invest_info_read(storage: &dyn Storage) -> ReadonlySingleton { - singleton_read(storage, KEY_INVESTMENT) -} - -pub fn token_info(storage: &mut dyn Storage) -> Singleton { - singleton(storage, KEY_TOKEN_INFO) + pub claims: Uint256, } -pub fn token_info_read(storage: &dyn Storage) -> ReadonlySingleton { - singleton_read(storage, KEY_TOKEN_INFO) +pub fn load_item(storage: &dyn Storage, key: &[u8]) -> StdResult { + storage + .get(&to_length_prefixed(key)) + .ok_or_else(|| StdError::msg(format_args!("{} not found", type_name::()))) + .and_then(from_json) } -pub fn total_supply(storage: &mut dyn Storage) -> Singleton { - singleton(storage, KEY_TOTAL_SUPPLY) +pub fn save_item(storage: &mut dyn Storage, key: &[u8], item: &T) -> StdResult<()> { + storage.set(&to_length_prefixed(key), &to_json_vec(item)?); + Ok(()) } -pub fn total_supply_read(storage: &dyn Storage) -> ReadonlySingleton { - singleton_read(storage, KEY_TOTAL_SUPPLY) +pub fn update_item(storage: &mut dyn Storage, key: &[u8], action: A) -> Result +where + T: Serialize + DeserializeOwned, + A: FnOnce(T) -> Result, + E: From, +{ + let input = load_item(storage, key)?; + let output = action(input)?; + save_item(storage, key, &output)?; + Ok(output) } diff --git a/contracts/staking/tests/integration.rs b/contracts/staking/tests/integration.rs index cec0aba128..1dc938cccf 100644 --- a/contracts/staking/tests/integration.rs +++ b/contracts/staking/tests/integration.rs @@ -1,23 +1,8 @@ //! This integration test tries to run and call the generated wasm. //! It depends on a Wasm build being available, which you can create with `cargo wasm`. //! Then running `cargo integration-test` will validate we can properly call into that generated Wasm. -//! -//! You can easily convert unit tests to integration tests as follows: -//! 1. Copy them over verbatim -//! 2. Then change -//! let mut deps = mock_dependencies(20, &[]); -//! to -//! let mut deps = mock_instance(WASM, &[]); -//! 3. If you access raw storage, where ever you see something like: -//! deps.storage.get(CONFIG_KEY).expect("no data stored"); -//! replace it with: -//! deps.with_storage(|store| { -//! let data = store.get(CONFIG_KEY).expect("no data stored"); -//! //... -//! }); -//! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) -use cosmwasm_std::{coin, from_binary, ContractResult, Decimal, Response, Uint128, Validator}; +use cosmwasm_std::{coin, from_json, ContractResult, Decimal, Response, Uint128, Validator}; use cosmwasm_vm::testing::{ instantiate, mock_backend, mock_env, mock_info, mock_instance_options, query, }; @@ -34,12 +19,12 @@ static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/st // static WASM: &[u8] = include_bytes!("../contract.wasm"); fn sample_validator(addr: &str) -> Validator { - Validator { - address: addr.to_owned(), - commission: Decimal::percent(3), - max_commission: Decimal::percent(10), - max_change_rate: Decimal::percent(1), - } + Validator::create( + addr.to_owned(), + Decimal::percent(3), + Decimal::percent(10), + Decimal::percent(1), + ) } #[test] @@ -51,7 +36,7 @@ fn initialization_with_missing_validator() { let (instance_options, memory_limit) = mock_instance_options(); let mut deps = Instance::from_code(WASM, backend, instance_options, memory_limit).unwrap(); - let creator = String::from("creator"); + let creator = deps.api().addr_make("creator"); let msg = InstantiateMsg { name: "Cool Derivative".to_string(), symbol: "DRV".to_string(), @@ -67,7 +52,7 @@ fn initialization_with_missing_validator() { let msg = res.unwrap_err(); assert_eq!( msg, - "Generic error: my-validator is not in the current validator set" + "kind: Other, error: my-validator is not in the current validator set" ); } @@ -89,7 +74,7 @@ fn proper_initialization() { assert_eq!(deps.required_capabilities().len(), 1); assert!(deps.required_capabilities().contains("staking")); - let creator = String::from("creator"); + let creator = deps.api().addr_make("creator"); let msg = InstantiateMsg { name: "Cool Derivative".to_string(), symbol: "DRV".to_string(), @@ -106,7 +91,7 @@ fn proper_initialization() { // token info is proper let res = query(&mut deps, mock_env(), QueryMsg::TokenInfo {}).unwrap(); - let token: TokenInfoResponse = from_binary(&res).unwrap(); + let token: TokenInfoResponse = from_json(res).unwrap(); assert_eq!(&token.name, &msg.name); assert_eq!(&token.symbol, &msg.symbol); assert_eq!(token.decimals, msg.decimals); @@ -120,7 +105,7 @@ fn proper_initialization() { }, ) .unwrap(); - let bal: BalanceResponse = from_binary(&res).unwrap(); + let bal: BalanceResponse = from_json(res).unwrap(); assert_eq!(bal.balance, Uint128::new(0)); // no claims @@ -132,12 +117,12 @@ fn proper_initialization() { }, ) .unwrap(); - let claim: ClaimsResponse = from_binary(&res).unwrap(); + let claim: ClaimsResponse = from_json(res).unwrap(); assert_eq!(claim.claims, Uint128::new(0)); // investment info correct let res = query(&mut deps, mock_env(), QueryMsg::Investment {}).unwrap(); - let invest: InvestmentResponse = from_binary(&res).unwrap(); + let invest: InvestmentResponse = from_json(res).unwrap(); assert_eq!(&invest.owner, &creator); assert_eq!(&invest.validator, &msg.validator); assert_eq!(invest.exit_tax, msg.exit_tax); diff --git a/contracts/virus/.cargo/config.toml b/contracts/virus/.cargo/config.toml new file mode 100644 index 0000000000..f5174787c2 --- /dev/null +++ b/contracts/virus/.cargo/config.toml @@ -0,0 +1,6 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" +integration-test = "test --test integration" +schema = "run --bin schema" diff --git a/contracts/virus/Cargo.lock b/contracts/virus/Cargo.lock new file mode 100644 index 0000000000..677a084f63 --- /dev/null +++ b/contracts/virus/Cargo.lock @@ -0,0 +1,3008 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli 0.29.0", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools", + "num-bigint", + "num-integer", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "arrayvec", + "digest", + "educe", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "arrayvec", + "digest", + "num-bigint", + "rayon", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.7.3", + "object 0.36.0", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.87", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive 0.6.12", + "ptr_meta 0.1.4", + "simdutf8", +] + +[[package]] +name = "bytecheck" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c8f430744b23b54ad15161fcbc22d82a29b73eacbe425fea23ec822600bc6f" +dependencies = [ + "bytecheck_derive 0.8.0", + "ptr_meta 0.3.0", + "rancor", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bytecheck_derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + +[[package]] +name = "cc" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clru" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" + +[[package]] +name = "cmake" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +dependencies = [ + "cc", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "corosensei" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad067b451c08956709f8762dba86e049c124ea52858e3ab8d076ba2892caa437" +dependencies = [ + "autocfg", + "cfg-if", + "libc", + "scopeguard", + "windows-sys 0.59.0", +] + +[[package]] +name = "cosmwasm-core" +version = "3.0.3-dev" + +[[package]] +name = "cosmwasm-crypto" +version = "3.0.3-dev" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-bigint", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cosmwasm-schema" +version = "3.0.3-dev" +dependencies = [ + "cosmwasm-schema-derive", + "cw-schema", + "schemars 0.8.21", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cosmwasm-std" +version = "3.0.3-dev" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "cw-schema", + "derive_more 2.0.1", + "hex", + "rand_core", + "rmp-serde", + "schemars 0.8.21", + "serde", + "serde_json", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cosmwasm-vm" +version = "3.0.3-dev" +dependencies = [ + "bech32", + "blake2", + "bytes", + "clru", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-std", + "cosmwasm-vm-derive", + "crc32fast", + "derive_more 1.0.0-beta.6", + "hex", + "rand_core", + "serde", + "serde_json", + "sha2", + "strum", + "thiserror", + "tracing", + "wasmer", + "wasmer-middlewares", + "wasmer-types", +] + +[[package]] +name = "cosmwasm-vm-derive" +version = "3.0.3-dev" +dependencies = [ + "blake2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "cw-schema" +version = "3.0.3-dev" +dependencies = [ + "cw-schema-derive", + "indexmap", + "schemars 1.0.4", + "serde", + "serde_with", + "siphasher", + "typeid", +] + +[[package]] +name = "cw-schema-derive" +version = "3.0.3-dev" +dependencies = [ + "heck", + "itertools", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.87", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derive_more" +version = "0.99.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "derive_more" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" +dependencies = [ + "derive_more-impl 1.0.0-beta.6", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "dynasm" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dynasmrt" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" +dependencies = [ + "byteorder", + "dynasm", + "memmap2 0.5.10", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-iterator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "enumset" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.3", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +dependencies = [ + "adler2", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "munge" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64142d38c84badf60abf06ff9bd80ad2174306a5b11bd4706535090a30a419df" +dependencies = [ + "munge_macro", +] + +[[package]] +name = "munge_macro" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "ruzstd", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.87", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive 0.1.4", +] + +[[package]] +name = "ptr_meta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" +dependencies = [ + "ptr_meta_derive 0.3.0", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rancor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" +dependencies = [ + "ptr_meta 0.3.0", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "region" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach2", + "windows-sys 0.52.0", +] + +[[package]] +name = "rend" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" +dependencies = [ + "bytecheck 0.8.0", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rkyv" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" +dependencies = [ + "bytecheck 0.8.0", + "bytes", + "hashbrown 0.15.2", + "indexmap", + "munge", + "ptr_meta 0.3.0", + "rancor", + "rend", + "rkyv_derive", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.19", + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive 0.8.21", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "schemars_derive 1.0.4", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "schemars_derive" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "serde", + "serde_derive", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shared-buffer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.87", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tar" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +dependencies = [ + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots", +] + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "virus" +version = "0.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-vm", + "schemars 0.8.21", + "serde", + "thiserror", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.87", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasmer" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b104b9437e9100943fb01880cc210ebe250cc4aa2f7e121f068033a76d29cc4" +dependencies = [ + "bindgen", + "bytes", + "cfg-if", + "cmake", + "indexmap", + "js-sys", + "more-asserts", + "rustc-demangle", + "serde", + "serde-wasm-bindgen", + "shared-buffer", + "tar", + "target-lexicon", + "thiserror", + "tracing", + "ureq", + "wasm-bindgen", + "wasmer-compiler", + "wasmer-compiler-singlepass", + "wasmer-derive", + "wasmer-types", + "wasmer-vm", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmer-compiler" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9dd5c640b9e6dcc64bcad987b3133e19f1c9919a8e0c732eb11a33f650bbf54" +dependencies = [ + "backtrace", + "bytes", + "cfg-if", + "enum-iterator", + "enumset", + "leb128", + "libc", + "memmap2 0.6.2", + "more-asserts", + "object 0.32.2", + "region", + "rkyv", + "self_cell", + "shared-buffer", + "smallvec", + "target-lexicon", + "thiserror", + "wasmer-types", + "wasmer-vm", + "wasmparser", + "windows-sys 0.59.0", + "xxhash-rust", +] + +[[package]] +name = "wasmer-compiler-singlepass" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95cad6ba04afeb3a339529e880c3290f8516bc6324c3082155a79f00129f5a1" +dependencies = [ + "byteorder", + "dynasm", + "dynasmrt", + "enumset", + "gimli 0.28.1", + "more-asserts", + "rayon", + "smallvec", + "wasmer-compiler", + "wasmer-types", +] + +[[package]] +name = "wasmer-derive" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b4c4970530327054e6effa876eadfd57079866c7429e31fde2568d6354ec61d" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "wasmer-middlewares" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111eee5478867554d4496f89f472499fe90469f7473dbf90e466c1deb5505293" +dependencies = [ + "wasmer", + "wasmer-types", + "wasmer-vm", +] + +[[package]] +name = "wasmer-types" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "554f389473d61915754b1873c5ef392a1a75b55c7d616e2a78f67c1af45785ae" +dependencies = [ + "bytecheck 0.6.12", + "enum-iterator", + "enumset", + "getrandom", + "hex", + "indexmap", + "more-asserts", + "rkyv", + "sha2", + "target-lexicon", + "thiserror", + "xxhash-rust", +] + +[[package]] +name = "wasmer-vm" +version = "5.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b3f40e1e18d6cd040d6d1ea32affbf2f64ff059eff3b85614bccb8ff95c59b" +dependencies = [ + "backtrace", + "cc", + "cfg-if", + "corosensei", + "crossbeam-queue", + "dashmap", + "enum-iterator", + "fnv", + "indexmap", + "libc", + "mach2", + "memoffset", + "more-asserts", + "region", + "scopeguard", + "thiserror", + "wasmer-types", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmparser" +version = "0.216.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cc7c63191ae61c70befbe6045b9be65ef2082fa89421a386ae172cb1e08e92d" +dependencies = [ + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap", + "semver", +] + +[[package]] +name = "webpki-roots" +version = "0.26.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xattr" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/contracts/virus/Cargo.toml b/contracts/virus/Cargo.toml new file mode 100644 index 0000000000..14f3bea06d --- /dev/null +++ b/contracts/virus/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "virus" +version = "0.0.0" +authors = ["Simon Warta "] +edition = "2021" +publish = false +license = "Apache-2.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[dependencies] +cosmwasm-schema = { path = "../../packages/schema" } +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_1_2"] } +schemars = "0.8.12" +serde = { version = "1.0.103", default-features = false, features = ["derive"] } +thiserror = "1.0.26" + +[dev-dependencies] +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/contracts/virus/README.md b/contracts/virus/README.md new file mode 100644 index 0000000000..497dbf17e3 --- /dev/null +++ b/contracts/virus/README.md @@ -0,0 +1,3 @@ +# Virus contract + +A contract that clones itself over various levels. diff --git a/contracts/virus/schema/cw_schema/raw/execute.json b/contracts/virus/schema/cw_schema/raw/execute.json new file mode 100644 index 0000000000..449d4db5cc --- /dev/null +++ b/contracts/virus/schema/cw_schema/raw/execute.json @@ -0,0 +1,35 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "virus_msg_ExecuteMsg", + "type": "enum", + "cases": { + "spread": { + "type": "named", + "properties": { + "levels": { + "description": "The number of levels of spreading. When set to 0, the contract performs a no-op.", + "value": 2 + }, + "parent_path": { + "description": "A slash separated path to the instance creating this one.\nThe root is the empty string.", + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] +} diff --git a/contracts/virus/schema/cw_schema/raw/instantiate.json b/contracts/virus/schema/cw_schema/raw/instantiate.json new file mode 100644 index 0000000000..c0aecb0d42 --- /dev/null +++ b/contracts/virus/schema/cw_schema/raw/instantiate.json @@ -0,0 +1,11 @@ +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "virus_msg_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] +} diff --git a/contracts/virus/schema/cw_schema/virus.json b/contracts/virus/schema/cw_schema/virus.json new file mode 100644 index 0000000000..a48c8b1234 --- /dev/null +++ b/contracts/virus/schema/cw_schema/virus.json @@ -0,0 +1,55 @@ +{ + "contract_name": "virus", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "virus_msg_InstantiateMsg", + "type": "struct", + "properties": {} + } + ] + }, + "execute": { + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "virus_msg_ExecuteMsg", + "type": "enum", + "cases": { + "spread": { + "type": "named", + "properties": { + "levels": { + "description": "The number of levels of spreading. When set to 0, the contract performs a no-op.", + "value": 2 + }, + "parent_path": { + "description": "A slash separated path to the instance creating this one.\nThe root is the empty string.", + "value": 1 + } + } + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + } + ] + }, + "query": null, + "migrate": null, + "sudo": null, + "responses": null +} diff --git a/contracts/virus/schema/raw/execute.json b/contracts/virus/schema/raw/execute.json new file mode 100644 index 0000000000..0c6d37f103 --- /dev/null +++ b/contracts/virus/schema/raw/execute.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "spread" + ], + "properties": { + "spread": { + "type": "object", + "required": [ + "levels", + "parent_path" + ], + "properties": { + "levels": { + "description": "The number of levels of spreading. When set to 0, the contract performs a no-op.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "parent_path": { + "description": "A slash separated path to the instance creating this one. The root is the empty string.", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/contracts/virus/schema/raw/instantiate.json b/contracts/virus/schema/raw/instantiate.json new file mode 100644 index 0000000000..1352613d57 --- /dev/null +++ b/contracts/virus/schema/raw/instantiate.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false +} diff --git a/contracts/virus/schema/virus.json b/contracts/virus/schema/virus.json new file mode 100644 index 0000000000..71f03d0963 --- /dev/null +++ b/contracts/virus/schema/virus.json @@ -0,0 +1,50 @@ +{ + "contract_name": "virus", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "spread" + ], + "properties": { + "spread": { + "type": "object", + "required": [ + "levels", + "parent_path" + ], + "properties": { + "levels": { + "description": "The number of levels of spreading. When set to 0, the contract performs a no-op.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "parent_path": { + "description": "A slash separated path to the instance creating this one. The root is the empty string.", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "query": null, + "migrate": null, + "sudo": null, + "responses": null +} diff --git a/contracts/virus/src/bin/schema.rs b/contracts/virus/src/bin/schema.rs new file mode 100644 index 0000000000..3417811600 --- /dev/null +++ b/contracts/virus/src/bin/schema.rs @@ -0,0 +1,10 @@ +use cosmwasm_schema::write_api; + +use virus::msg::{ExecuteMsg, InstantiateMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + } +} diff --git a/contracts/virus/src/contract.rs b/contracts/virus/src/contract.rs new file mode 100644 index 0000000000..9fd358f5f0 --- /dev/null +++ b/contracts/virus/src/contract.rs @@ -0,0 +1,112 @@ +use cosmwasm_std::{ + entry_point, instantiate2_address, to_json_binary, Attribute, Binary, CodeInfoResponse, + ContractInfoResponse, DepsMut, Env, MessageInfo, Response, StdResult, WasmMsg, +}; + +use crate::errors::ContractError; +use crate::msg::{ExecuteMsg, InstantiateMsg}; + +#[entry_point] +pub fn instantiate( + _deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: InstantiateMsg, +) -> StdResult { + Ok(Response::new()) +} + +#[entry_point] +pub fn execute( + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, +) -> Result { + match msg { + ExecuteMsg::Spread { + parent_path, + levels, + } => execute_spread(deps, env, info, parent_path, levels), + } +} + +/// Basic reproduction number +const R0: u32 = 2; + +pub fn execute_spread( + deps: DepsMut, + env: Env, + _info: MessageInfo, + parent_path: String, + levels: u32, +) -> Result { + if levels == 0 { + return Ok(Response::new()); + } + + let creator = deps.api.addr_canonicalize(env.contract.address.as_str())?; + let ContractInfoResponse { code_id, .. } = deps + .querier + .query_wasm_contract_info(env.contract.address)?; + let CodeInfoResponse { checksum, .. } = deps.querier.query_wasm_code_info(code_id)?; + + let mut msgs = Vec::::new(); + let mut attributes = Vec::::new(); + for i in 0..R0 { + let path = format!("{parent_path}/{i}"); + let label = format!("Instance {path}"); + let salt = Binary::from(path.as_bytes()); + + attributes.push(Attribute::new(format!("path{i}"), path.clone())); + + let address = + deps.api + .addr_humanize(&instantiate2_address(checksum.as_ref(), &creator, &salt)?)?; + attributes.push(Attribute::new( + format!("predicted_address{i}"), + address.clone(), + )); + + msgs.push(WasmMsg::Instantiate2 { + admin: None, + code_id, + label, + msg: to_json_binary(&InstantiateMsg {})?, + funds: vec![], + salt, + }); + + // we know the address of the newly instantiated contract, so let's execute it right away + msgs.push(WasmMsg::Execute { + contract_addr: address.into(), + msg: to_json_binary(&ExecuteMsg::Spread { + parent_path: path, + levels: levels - 1, + })?, + funds: vec![], + }); + } + + Ok(Response::new() + .add_attributes(attributes) + .add_messages(msgs)) +} + +#[cfg(test)] +mod tests { + use super::*; + use cosmwasm_std::testing::{message_info, mock_dependencies, mock_env}; + + const CREATOR: &str = "creator"; + + #[test] + fn instantiate_works() { + let mut deps = mock_dependencies(); + let creator = deps.api.addr_make(CREATOR); + let msg = InstantiateMsg {}; + let info = message_info(&creator, &[]); + let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); + assert_eq!(res.messages.len(), 0); + } +} diff --git a/contracts/virus/src/errors.rs b/contracts/virus/src/errors.rs new file mode 100644 index 0000000000..dd4f4a4991 --- /dev/null +++ b/contracts/virus/src/errors.rs @@ -0,0 +1,11 @@ +use cosmwasm_std::{Instantiate2AddressError, StdError}; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum ContractError { + #[error("{0}")] + /// this is needed so we can use `bucket.load(...)?` and have it auto-converted to the custom error + Std(#[from] StdError), + #[error("{0}")] + Instantiate2Address(#[from] Instantiate2AddressError), +} diff --git a/contracts/virus/src/lib.rs b/contracts/virus/src/lib.rs new file mode 100644 index 0000000000..33208e28f1 --- /dev/null +++ b/contracts/virus/src/lib.rs @@ -0,0 +1,3 @@ +pub mod contract; +mod errors; +pub mod msg; diff --git a/contracts/virus/src/msg.rs b/contracts/virus/src/msg.rs new file mode 100644 index 0000000000..cdf26cc717 --- /dev/null +++ b/contracts/virus/src/msg.rs @@ -0,0 +1,15 @@ +use cosmwasm_schema::cw_serde; + +#[cw_serde] +pub struct InstantiateMsg {} + +#[cw_serde] +pub enum ExecuteMsg { + Spread { + /// A slash separated path to the instance creating this one. + /// The root is the empty string. + parent_path: String, + /// The number of levels of spreading. When set to 0, the contract performs a no-op. + levels: u32, + }, +} diff --git a/contracts/virus/tests/integration.rs b/contracts/virus/tests/integration.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/contracts/virus/tests/integration.rs @@ -0,0 +1 @@ + diff --git a/deny.toml b/deny.toml index 2fa6930cca..7811bf7e2c 100644 --- a/deny.toml +++ b/deny.toml @@ -1,10 +1,9 @@ -# This template contains all of the possible sections and their default values +# This template contains all the possible sections and their default values. # Note that all fields that take a lint level have these possible values: # * deny - An error will be produced and the check will fail # * warn - A warning will be produced, but the check will not fail -# * allow - No warning or error will be produced, though in some cases a note -# will be +# * allow - No warning or error will be produced, though in some cases a note will be # The values provided in this template are the default values that will be used # when any section or field is not specified in your own configuration @@ -70,8 +69,8 @@ unlicensed = "deny" # See https://spdx.org/licenses/ for list of possible licenses # [possible values: any SPDX 3.11 short identifier (+ optional exception)]. allow = [ - "Apache-2.0", "Apache-2.0 WITH LLVM-exception", + "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "CC0-1.0", @@ -128,8 +127,8 @@ exceptions = [ # and the crate will be checked normally, which may produce warnings or errors # depending on the rest of your configuration #license-files = [ - # Each entry is a crate relative path, and the (opaque) hash of its contents - #{ path = "LICENSE", hash = 0xbd0eed23 } +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } #] [licenses.private] @@ -202,7 +201,7 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"] allow-git = [] [sources.allow-org] -# 1 or more github.com organizations to allow git sources for +# 1 or more GitHub.com organizations to allow git sources for github = [] # 1 or more gitlab.com organizations to allow git sources for gitlab = [] diff --git a/devtools/build_min.sh b/devtools/build_min.sh index 880cd91293..c8f4166c4a 100755 --- a/devtools/build_min.sh +++ b/devtools/build_min.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" diff --git a/devtools/check-contracts.sh b/devtools/check-contracts.sh new file mode 100755 index 0000000000..b157c68249 --- /dev/null +++ b/devtools/check-contracts.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +if [[ "${1:-}" == "parallel" ]]; then + parallel=1 +else + parallel=0 +fi + +msg() { + if (( !parallel )); then + echo -e "\e[1;34m$1\e[0m \e[1;32m$2\e[0m" + fi +} + +check_contract() { + ( + contract_dir=$1 + contract="$(basename "$contract_dir" | tr - _)" + wasm="./target/wasm32-unknown-unknown/release/$contract.wasm" + + msg "CHANGE DIRECTORY" "$contract_dir" + cd "$contract_dir" || exit 1 + + msg "CHECK FORMATTING" "$contract" + cargo +"$2" fmt -- --check + + msg "RUN UNIT TESTS" "$contract" + cargo +"$2" test --lib --locked + + msg "BUILD WASM" "$contract" + RUSTFLAGS="$3" cargo +"$2" build --release --lib --locked --target wasm32-unknown-unknown + + msg "RUN LINTER" "$contract" + cargo +"$2" clippy --all-targets --tests -- -D warnings + + msg "RUN INTEGRATION TESTS" "$contract" + cargo +"$2" test --test integration --locked + + msg "GENERATE SCHEMA" "$contract" + cargo +"$2" run --bin schema --locked + + msg "ENSURE SCHEMA IS UP-TO-DATE" "$contract" + git diff --quiet ./schema + + msg "cosmwasm-check (release)" "$contract" + cosmwasm-check-release "$wasm" + + msg "cosmwasm-check (develop)" "$contract" + cosmwasm-check "$wasm" + ) +} + +contracts_stable=( + contracts/burner + contracts/crypto-verify + contracts/cyberpunk + contracts/empty + contracts/hackatom + contracts/ibc2 + contracts/ibc-callbacks + contracts/ibc-reflect + contracts/ibc-reflect-send + contracts/nested-contracts + contracts/queue + contracts/reflect + contracts/replier + contracts/staking + contracts/virus +) + +contracts_nightly=( + contracts/floaty +) + +toolchain_stable=1.82.0 +rustflags_stable="" + +toolchain_nightly=nightly-2024-09-01 +rustflags_nightly="-C target-feature=+nontrapping-fptoint" + +if (( parallel )); then + for dir in "${contracts_stable[@]}"; do + check_contract "$dir" "$toolchain_stable" "$rustflags_stable" > /dev/null & + done + for dir in "${contracts_nightly[@]}"; do + check_contract "$dir" "$toolchain_nightly" "$rustflags_nightly" > /dev/null & + done + wait +else + for dir in "${contracts_stable[@]}"; do + check_contract "$dir" "$toolchain_stable" "$rustflags_stable" + done + for dir in "${contracts_nightly[@]}"; do + check_contract "$dir" "$toolchain_nightly" "$rustflags_nightly" + done +fi diff --git a/devtools/check_contracts_fast.sh b/devtools/check_contracts_fast.sh index a0f03a009b..49e20eba0b 100755 --- a/devtools/check_contracts_fast.sh +++ b/devtools/check_contracts_fast.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" diff --git a/devtools/check_contracts_full.sh b/devtools/check_contracts_full.sh index 5a77cdd36e..fe4ecda001 100755 --- a/devtools/check_contracts_full.sh +++ b/devtools/check_contracts_full.sh @@ -1,7 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" +GLOBIGNORE="contracts/floaty/" for contract_dir in contracts/*/; do ( cd "$contract_dir" diff --git a/devtools/check_contracts_medium.sh b/devtools/check_contracts_medium.sh index 0dcf5346b3..f59952ecb7 100755 --- a/devtools/check_contracts_medium.sh +++ b/devtools/check_contracts_medium.sh @@ -1,7 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" +GLOBIGNORE="contracts/floaty/" for contract_dir in contracts/*/; do ( cd "$contract_dir" diff --git a/devtools/check_workspace.sh b/devtools/check_workspace.sh index 9609054c4c..966222a5fe 100755 --- a/devtools/check_workspace.sh +++ b/devtools/check_workspace.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" @@ -7,14 +7,14 @@ cargo fmt (cd packages/derive && cargo check && cargo clippy --all-targets -- -D warnings) ( cd packages/std + # default, min, all cargo check - cargo check --features iterator,staking,stargate + cargo check --no-default-features --features std + cargo check --features std,iterator,staking,stargate,cosmwasm_1_2 cargo wasm-debug - cargo wasm-debug --features iterator,staking,stargate - cargo clippy --all-targets --features iterator,staking,stargate -- -D warnings - cargo schema --features cosmwasm_1_1 + cargo wasm-debug --features std,iterator,staking,stargate + cargo clippy --all-targets --features std,iterator,staking,stargate -- -D warnings ) -(cd packages/storage && cargo build && cargo clippy --all-targets --features iterator -- -D warnings) (cd packages/schema && cargo build && cargo clippy --all-targets -- -D warnings) (cd packages/schema-derive && cargo build && cargo clippy --all-targets -- -D warnings) (cd packages/vm && cargo build --features iterator,stargate && cargo clippy --all-targets --features iterator,stargate -- -D warnings) diff --git a/devtools/clean-contracts.sh b/devtools/clean-contracts.sh new file mode 100755 index 0000000000..ffac27d82c --- /dev/null +++ b/devtools/clean-contracts.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +for dir in contracts/*/; do + ( + contract="$(basename "$dir" | tr - _)" + echo -e "\e[1;34mClean contract\e[0m \e[1;32m$contract\e[0m" + cd "$dir" || exit 1 + cargo clean + ) +done diff --git a/devtools/clean.sh b/devtools/clean.sh index 616c7846ad..ae8a28dfe9 100755 --- a/devtools/clean.sh +++ b/devtools/clean.sh @@ -1,9 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" (cd packages/std && cargo clean) (cd packages/crypto && cargo clean) -(cd packages/storage && cargo clean) (cd packages/schema && cargo clean) (cd packages/vm && cargo clean) diff --git a/devtools/clean_contracts.sh b/devtools/clean_contracts.sh index 96f08663b2..62aed3d386 100755 --- a/devtools/clean_contracts.sh +++ b/devtools/clean_contracts.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" diff --git a/devtools/deadlinks.py b/devtools/deadlinks.py index 79d3cc81f3..9dee04a9a8 100755 --- a/devtools/deadlinks.py +++ b/devtools/deadlinks.py @@ -72,7 +72,6 @@ def check_project(project): "cosmwasm_derive", "cosmwasm_schema", "cosmwasm_std", - "cosmwasm_storage", "cosmwasm_vm" ] diff --git a/devtools/format_contracts.sh b/devtools/format_contracts.sh new file mode 100755 index 0000000000..1d8d089a3f --- /dev/null +++ b/devtools/format_contracts.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +for contract_dir in contracts/*/; do + ( + cd "$contract_dir" + cargo fmt + ) +done diff --git a/devtools/format_md.sh b/devtools/format_md.sh index f45b8c6907..b800dc6d46 100755 --- a/devtools/format_md.sh +++ b/devtools/format_md.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" @@ -11,4 +11,4 @@ while getopts c option; do esac done -npx prettier@2.7.1 --$op "./**/*.md" +npx prettier@3.3.3 --$op "./**/*.md" diff --git a/devtools/format_sh.sh b/devtools/format_sh.sh index 236395b538..8e186911f2 100755 --- a/devtools/format_sh.sh +++ b/devtools/format_sh.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" diff --git a/devtools/format_yml.sh b/devtools/format_yml.sh index 142ca7a43b..4db25c50dd 100755 --- a/devtools/format_yml.sh +++ b/devtools/format_yml.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" @@ -11,4 +11,4 @@ while getopts c option; do esac done -npx prettier@2.7.1 --$op "./**/*.yml" +npx prettier@3.3.3 --$op "./**/*.yml" diff --git a/devtools/release_checks.sh b/devtools/release_checks.sh new file mode 100755 index 0000000000..3a53e932f8 --- /dev/null +++ b/devtools/release_checks.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Move to the workspace root +WORKSPACE_PATH=$(dirname $(cargo locate-project --workspace --message-format=plain)) +cd $WORKSPACE_PATH + +cargo build + +for contract_dir in contracts/*/; do + (cd "$contract_dir" && cargo build) +done diff --git a/devtools/set_version.sh b/devtools/set_version.sh deleted file mode 100755 index 5dd6bc9034..0000000000 --- a/devtools/set_version.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -set -o errexit -o nounset -o pipefail -command -v shellcheck >/dev/null && shellcheck "$0" - -gnused="$(command -v gsed || echo sed)" - -function print_usage() { - echo "Usage: $0 NEW_VERSION" - echo "" - echo "e.g. $0 0.8.0" -} - -if [ "$#" -ne 1 ]; then - print_usage - exit 1 -fi - -# Check repo -SCRIPT_DIR="$(realpath "$(dirname "$0")")" -if [[ "$(realpath "$SCRIPT_DIR/..")" != "$(pwd)" ]]; then - echo "Script must be called from the repo root" - exit 2 -fi - -# Ensure repo is not dirty -CHANGES_IN_REPO=$(git status --porcelain) -if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 3 -fi - -NEW="$1" -OLD=$("$gnused" -n -e 's/^version[[:space:]]*=[[:space:]]*"\(.*\)"/\1/p' packages/std/Cargo.toml) -echo "Updating old version $OLD to new version $NEW ..." - -FILES_MODIFIED=() - -for package_dir in packages/*/; do - CARGO_TOML="$package_dir/Cargo.toml" - # The `version = "1.0.0"` cases - "$gnused" -i -e "s/version[[:space:]]*=[[:space:]]*\"$OLD\"/version = \"$NEW\"/" "$CARGO_TOML" - # The `version = "=1.0.0"` cases - "$gnused" -i -e "s/version[[:space:]]*=[[:space:]]*\"=$OLD\"/version = \"=$NEW\"/" "$CARGO_TOML" - FILES_MODIFIED+=("$CARGO_TOML") -done - -cargo build -FILES_MODIFIED+=("Cargo.lock") - -for contract_dir in contracts/*/; do - CARGO_LOCK="$contract_dir/Cargo.lock" - - (cd "$contract_dir" && cargo build) - - FILES_MODIFIED+=("$CARGO_LOCK") -done - -echo "Staging ${FILES_MODIFIED[*]} ..." -git add "${FILES_MODIFIED[@]}" -git commit -m "Set version: $NEW" diff --git a/devtools/test_workspace.sh b/devtools/test_workspace.sh index 0fdcfb2012..39fe143df4 100755 --- a/devtools/test_workspace.sh +++ b/devtools/test_workspace.sh @@ -1,11 +1,11 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" cargo fmt (cd packages/crypto && cargo test) -(cd packages/std && cargo test --features iterator) -(cd packages/storage && cargo test --features iterator) +# A test inside the std package expects backtraces to be disabled +(cd packages/std && RUST_BACKTRACE=0 cargo test --features iterator,cosmwasm_1_2) (cd packages/schema && cargo test) (cd packages/schema-derive && cargo test) (cd packages/vm && cargo test --features iterator,stargate) diff --git a/devtools/update-schemas.sh b/devtools/update-schemas.sh new file mode 100755 index 0000000000..055dbe538f --- /dev/null +++ b/devtools/update-schemas.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +msg() { + echo -e "\e[1;34m$1\e[0m \e[1;32m$2\e[0m" +} + +check_contract() { + ( + contract_dir=$1 + contract="$(basename "$contract_dir" | tr - _)" + + msg "CHANGE DIRECTORY" "$contract_dir" + cd "$contract_dir" || exit 1 + + msg "UPDATE SCHEMA" "$contract" + cargo +"$2" run --bin schema --locked + ) +} + +contracts_stable=( + contracts/burner + contracts/crypto-verify + contracts/cyberpunk + contracts/empty + contracts/hackatom + contracts/ibc2 + contracts/ibc-callbacks + contracts/ibc-reflect + contracts/ibc-reflect-send + contracts/nested-contracts + contracts/queue + contracts/reflect + contracts/replier + contracts/staking + contracts/virus +) + +contracts_nightly=( + contracts/floaty +) + +toolchain_stable=1.82.0 +toolchain_nightly=nightly-2024-09-01 + +for dir in "${contracts_stable[@]}"; do + check_contract "$dir" "$toolchain_stable" +done +for dir in "${contracts_nightly[@]}"; do + check_contract "$dir" "$toolchain_nightly" +done diff --git a/devtools/update_crate.sh b/devtools/update_crate.sh new file mode 100755 index 0000000000..716bbaa5d3 --- /dev/null +++ b/devtools/update_crate.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +CRATE_NAME="$1" + +# Update root Cargo.lock +cargo update -p "$CRATE_NAME" + +for contract_dir in contracts/*/; do + ( + cd "$contract_dir" + cargo update -p "$CRATE_NAME" + ) || continue +done diff --git a/devtools/update_schemas.sh b/devtools/update_schemas.sh new file mode 100755 index 0000000000..b1d76a2450 --- /dev/null +++ b/devtools/update_schemas.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +for contract_dir in contracts/*/; do + ( + echo "Updating schema for $contract_dir" + cd "$contract_dir" + rm -r ./schema || true # ensure outdated schema files are deleted + cargo schema + ) +done diff --git a/docs/CAPABILITIES-BUILT-IN.md b/docs/CAPABILITIES-BUILT-IN.md new file mode 100644 index 0000000000..ae3f38c4a4 --- /dev/null +++ b/docs/CAPABILITIES-BUILT-IN.md @@ -0,0 +1,37 @@ +# Built-in capabilities + +Since capabilities can be created between contract and environment, we don't +know them all in the VM. This is a list of all built-in capabilities, but chains +might define others. + +- `iterator` is for storage backends that allow range queries. Not all types of + databases do that. There are trees that don't allow it and Secret Network does + not support iterators for other technical reasons. +- `stargate` is for messages and queries that came with the Cosmos SDK upgrade + "Stargate". It primarily includes protobuf messages and IBC support. +- `staking` is for chains with the Cosmos SDK staking module. There are Cosmos + chains that don't use this (e.g. Tgrade). +- `ibc2` is for messages and queries that came with the Cosmos SDK upgrade + "Ibc2". +- `cosmwasm_1_1` enables the `BankQuery::Supply` query. Only chains running + CosmWasm `1.1.0` or higher support this. +- `cosmwasm_1_2` enables the `GovMsg::VoteWeighted` and `WasmMsg::Instantiate2` + messages. Only chains running CosmWasm `1.2.0` or higher support this. +- `cosmwasm_1_3` enables the `BankQuery::AllDenomMetadata`, + `BankQuery::DenomMetadata` and `DistributionQuery::DelegatorWithdrawAddress` + queries, as well as `DistributionMsg::FundCommunityPool`. Only chains running + CosmWasm `1.3.0` or higher support this. +- `cosmwasm_1_4` enables the `DistributionQuery::DelegationRewards`, + `DistributionQuery::DelegationTotalRewards` and + `DistributionQuery::DelegatorValidators` queries. Only chains running CosmWasm + `1.4.0` or higher support this. +- `cosmwasm_2_0` enables `CosmosMsg::Any` and `QueryRequest::Grpc`. Only chains + running CosmWasm `2.0.0` or higher support this. +- `cosmwasm_2_1` enables `IbcMsg::WriteAcknowledgement`. Only chains running + CosmWasm `2.1.0` or higher support this. +- `cosmwasm_2_2` enables an optional additional `MigrateInfo` parameter for the + `migrate` entrypoint, as well as IBC Fees support with `IbcMsg::PayPacketFee`, + `IbcMsg::PayPacketFeeAsync` and `IbcQuery::FeeEnabledChannel`. Only chains + running CosmWasm `2.2.0` or higher support this. +- `cosmwasm_3_0` enables `WasmQuery::RawRange`. Only chains running CosmWasm + `3.0.0` or higher support this. diff --git a/docs/CAPABILITIES.md b/docs/CAPABILITIES.md index 2679f5dd7c..5d165c00cf 100644 --- a/docs/CAPABILITIES.md +++ b/docs/CAPABILITIES.md @@ -3,11 +3,17 @@ Capabilities are a mechanism to negotiate functionality between a contract and an environment (i.e. the chain that embeds cosmwasm-vm/[wasmvm]) in a very primitive way. The contract defines required capabilities. The environment -defines it's capabilities. If the required capabilities are all available, the +defines its capabilities. If the required capabilities are all available, the contract can be used. Doing this check when the contract is first stored ensures missing capabilities are detected early and not when a user tries to execute a certain code path. +Note that capabilities are _not_ suitable to prevent contracts from accessing +functionality. Their purpose is to signal to the contract that some +functionality is available. Contracts are free to ignore this fact and attempt +to use unavailable functionality anyway. Therefore, not enabling a capability on +the host is _not_ a way of preventing a contract from using that functionality. + ## Origin and Disambiguation Before August 2022, we had two types of "features": app level features in the @@ -81,18 +87,9 @@ function name in Rust and other CosmWasm smart contract languages such as Go. By convention, the name should be short and all lower ASCII alphanumerical plus underscores. -## Common capabilities - -Here is a list of capabilities created in the past. Since capabilities can be -created between contract and environment, we don't know them all in the VM. +## Built-in capabilities -- `iterator` is for storage backends that allow range queries. Not all types of - databases do that. There are trees that don't allow it and Secret Network does - not support iterators for other technical reasons. -- `stargate` is for messages and queries that came with the Cosmos SDK upgrade - "Stargate". It primarily includes protobuf messages and IBC support. -- `staking` is for chains with the Cosmos SDK staking module. There are Cosmos - chains that don't use this (e.g. Tgrade). +Here is a list of all [built-in capabilities](CAPABILITIES-BUILT-IN.md). ## What's a good capability? @@ -105,7 +102,7 @@ contract checks the availability early on. When functionality is always present in the VM (such as a new import implemented directly in the VM, see [#1299]), we should not use capability. They just create -fragmentation in the CosmWasm ecosystem and increase the barrier for adoption. +fragmentation in the CosmWasm ecosystem and increase the barrier to adoption. Instead the `check_wasm_imports` check is used to validate this when the contract is stored. diff --git a/docs/ERROR_HANDLING.md b/docs/ERROR_HANDLING.md new file mode 100644 index 0000000000..6c5f9d071a --- /dev/null +++ b/docs/ERROR_HANDLING.md @@ -0,0 +1,130 @@ +# Error handling for various entry points + +In this document we discuss how different types of errors during contract +execution are handled by wasmd and the blockchain. + +## Two levels of errors + +When cosmwasm-vm executes a contract, the caller receives a nested result type: +`VmResult>` with some success response `R`. The outer +`VmResult` is created by the host environment and the inner `ContractResult` is +created inside of the contract. Most application specific error should go into +`ContractResult` errors. This is what happens when you use `?` inside of your +contract implementations. The `VmResult` +[error cases](https://github.com/CosmWasm/cosmwasm/blob/v1.2.3/packages/vm/src/errors/vm_error.rs#L11-L148) +include e.g. + +- Caching errors such as a missing Wasm file or corrupted module +- Serialization problems in the contract-host communication +- Panics from panic handler in contract +- Errors in crypto API calls +- Out of gas +- Unreachable statements in the Wasm bytecode + +## Error handling + +Before version 2.0 those two error types were merged into one in wasmvm and +handled as one thing in the caller (wasmd). See for example +[Instantiate](https://github.com/CosmWasm/wasmvm/blob/v1.2.0/lib.go#L144-L151). +However, there was one exception to this: +[IBCPacketReceive](https://github.com/CosmWasm/wasmvm/blob/v1.2.0/lib.go#L535-L539). +Instead of returning only the contents of the `Ok` case, the whole +`IBCReceiveResult` is returned. This allows the caller to handle the two layers +of errors differently. + +As pointed out by our auditors from Oak Security, this +[was inconsistent](https://github.com/CosmWasm/wasmvm/issues/398). Historically +merging the two error types was the desired behaviour. When `IBCPacketReceive` +came in, we needed the differentiation to be available in wasmd, which is why +the API was different than the others. + +In wasmvm >= 2.0 (wasmd >= 0.51), we +[always return the contract result](https://github.com/CosmWasm/wasmvm/blob/v2.0.0-rc.2/lib.go#L132) +and let wasmd handle it. Apart from making everything more consistent, this also +allows wasmd to handle contract errors differently from VM errors. + +Most errors returned by sub-messages are +[redacted](https://github.com/CosmWasm/wasmd/blob/v0.51.0-rc.1/x/wasm/keeper/msg_dispatcher.go#L205) +by wasmd before passing them back into the contract. The reason for this is the +possible non-determinism of error messages. However, as contract errors come +from the contract, they have to be deterministic. With the new separation, wasmd +now passes the full contract error message back into the calling contract, +massively improving the debugging experience. + +## Handing ibc_packet_receive errors + +From wasmd 0.22 to 0.31 (inclusive), contract errors and VM errors were handled +the same. They got the special treatment of reverting state changes, writing an +error acknowledgement but don't let the transaction fail. + +For wasmd >= 0.32, the special treatment only applies to contract errors. VM +errors in `IBCPacketReceive` let the transaction fail just like the `Execute` +case would. This has two major implications: + +1. Application specific errors (especially those which can be triggered by + untrusted users) should create contract errors and no panics. This ensures + that error acknowledgements are written and relayer transactions don't fail. +2. Using panics allows the contract developer to make the transaction fail + without writing an acknowledgement. This can be handy e.g. for allowlisting + relayer addresses. + +The following table shows the new handling logic. + +| Entry point | Contract error | VM error | +| --------------------- | -------------------------------------------------- | --------------------------------------------- | +| `instantiate` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | +| `execute` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | +| `migrate` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | +| `sudo` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | +| `reply` | ⏮️ state reverted
❔ depends on `reply_on` | ⏮️ state reverted
❔ depends on `reply_on` | +| `ibc_channel_open` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | +| `ibc_channel_connect` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | +| `ibc_channel_close` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | +| `ibc_packet_receive` | ⏮️ state reverted
✅ tx succeeds with error ack | ⏮️ state reverted
❌ tx fails | +| `ibc_packet_ack` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | +| `ibc_packet_timeout` | ⏮️ state reverted
❌ tx fails | ⏮️ state reverted
❌ tx fails | + +## Error acknowledgement formatting + +In case of a contract error in `ibc_packet_receive`, wasmd creates an error +acknowledgement. The format used is a JSON object with a single top level +`error` string such as `{"error":"some error text"}`. This format is the JSON +serialization of the ibc-go +[Acknowledgement](https://github.com/cosmos/ibc-go/blob/v7.0.0/proto/ibc/core/channel/v1/channel.proto#L156-L162) +type and compatible with ICS-20. + +If you are using the acknowledgement types shipped with cosmwasm-std +([#1512](https://github.com/CosmWasm/cosmwasm/issues/1512)), your protocol's +acknowledgement is compatible with that. + +If you are using a customized acknowledgement type, you need to convert contract +errors to error acks yourself in `ibc_packet_receive`. The `Never` type provides +type-safety for that. See: + +```rust +// The error type Never ensures you handle all contract errors inside the function body +pub fn ibc_packet_receive( + deps: DepsMut, + _env: Env, + msg: IbcPacketReceiveMsg, +) -> Result { + // put this in a closure so we can convert all error responses into acknowledgements + (|| { + let packet = msg.packet; + let caller = packet.dest.channel_id; + let msg: PacketMsg = from_slice(&packet.data)?; + match msg { + // Some packet receive implementations which return results + PacketMsg::Dispatch { msgs } => receive_dispatch(deps, caller, msgs), + PacketMsg::WhoAmI {} => receive_who_am_i(deps, caller), + PacketMsg::Balances {} => receive_balances(deps, caller), + } + })() + .or_else(|e| { + // Here we encode the error to our own fancy ack type + let acknowledgement: Binary = make_my_ack(e); + Ok(IbcReceiveResponse::new() + .set_ack(acknowledgement)) + }) +} +``` diff --git a/docs/GAS.md b/docs/GAS.md index 73eb260345..040f72f239 100644 --- a/docs/GAS.md +++ b/docs/GAS.md @@ -1,67 +1,4 @@ # Gas -Gas is a way to measure computational expense of a smart contract execution, -including CPU time and storage cost. It's unit is 1, i.e. you can think of it as -countable points. Gas consumption is deterministic, so executing the same thing -costs the same amount of gas across all hardware and operating systems. - -## CosmWasm gas vs. Cosmos SDK gas - -CosmWasm charges gas for Wasm operations, calls to host functions and calls to -the Cosmos SDK. _CosmWasm gas_ is different from _Cosmos SDK gas_ as the numbers -here are much larger. Since we charge gas for arbitrary user defined operations, -we need to charge each Wasm operation individually and cannot group larger tasks -together. As a result, the gas values become much larger than in Cosmos SDK even -for very fast executions. There is a [multiplier][defaultgasmultiplier] to -translate between CosmWasm gas and Cosmos SDK. It was measured and set to 100 a -while ago and can be adjusted when necessary. - -## CosmWasm gas pricing - -For CosmWasm gas, the target gas consumption is 1 Teragas (10^12 gas) per -millisecond. This idea is [inspired by NEAR][neargas] and we encourage you to -read their excellent docs on that topic. - -In order to meet this target, we execute Argon2 in a test contract ([#1120]). -This is a CPU and memory intense job that does not call out into the host. At a -constant gas cost per operation of 1 (pre CosmWasm 1.0), this consumed 96837752 -gas and took 15ms on our CI system. The ideal cost per operation for this system -is `10**12 / (96837752 / 15)`: 154898. This is rounded to 150000 for simplicity. - -Each machine is different, we know that. But the above target helps us in -multiple ways: - -1. Develop an intuition what it means to burn X gas or how much gas can be used - if a block should be executable in e.g. 1 second -2. Have a target for adjustments, e.g. when the Wasm runtime becomes faster or - slower -3. Allow pricing of calls that are not executed in Wasm, such as crypto APIs -4. Find significant over or underpricing - -[defaultgasmultiplier]: - https://github.com/CosmWasm/wasmd/blob/v0.19.0/x/wasm/keeper/gas_register.go#L18 -[neargas]: https://docs.near.org/docs/concepts/gas -[#1120]: https://github.com/CosmWasm/cosmwasm/pull/1120 - -## Gas overflow potential - -CosmWasm gas aims for 1 Teragas/millisecond, i.e. the uint64 range exceeds after -18 million seconds (5 hours)1. Assuming a max supported block -execution time of 30 seconds, the gas price has to be over-priced by a factor of -614 (614 Teragas/millisecond) in order to exceed the uint64 range2. -Since serious over or underpricing is considered a bug, using uint64 for gas -measurements is considered safe. - -Cosmos SDK gas uses values that are smaller by a factor of 150_000, so those -don't overflow as well. Since no Cosmos SDK gas values are processed inside of -this repository, this is not our main concern. However, it's good to know that -we can safely pass them in uint64 fields, as long as the full range is -supported. This is the case for the C API as well as -[JSON numbers](https://www.json.org/) as long as both sides support integers in -their JSON implementation. Go and Rust do that while many other implementations -don't support integers, and convert them to IEEE-754 doubles, which has a safe -integer range up to about 53 bit (e.g. JavaScript and jq). - -1 Python3: `(2**64-1)/1000 / 10**12` - -2 Python3: `((2**64-1)/1000/30) / 10**122` +This page is now maintained in the main CosmWasm docs: + diff --git a/docs/IDL.md b/docs/IDL.md new file mode 100644 index 0000000000..6a0eafb2ed --- /dev/null +++ b/docs/IDL.md @@ -0,0 +1,84 @@ +# CosmWasm IDL v1.0.0 + +The CosmWasm IDL (Interface Description Language) is a format for describing the +interface of a smart contract, meant to be consumed by generic clients. This +allows those clients to interact with CosmWasm contracts without having any +prior information about API endpoints. + +If you have a smart contract generated from the usual +[template](https://github.com/CosmWasm/cw-template), you should be able to get +an IDL file for it by simply running `cargo schema`. + +An example consumer of these files is +[`ts-codegen`](https://github.com/CosmWasm/ts-codegen). + +The IDL's only representation is currently JSON-based. + +Currently, the IDL format uses [JSON schemas](https://json-schema.org/) heavily +for defining messages and their responses, but provides some metadata and +structure to tie them together. + +## An example + +The following is an overview with the JSON schemas removed. The full file can be +found +[here](https://github.com/CosmWasm/cosmwasm/blob/v1.5.3/contracts/hackatom/schema/hackatom.json). + +```json +{ + "contract_name": "hackatom", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": *JSON_SCHEMA_FOR_INSTANTIATE*, + "execute": *JSON_SCHEMA_FOR_EXECUTE*, + "query": *JSON_SCHEMA_FOR_QUERY*, + "migrate": *JSON_SCHEMA_FOR_MIGRATE*, + "sudo": *JSON_SCHEMA_FOR_SUDO*, + "responses": { + "get_int": *JSON_SCHEMA_FOR_RESPONSE_TO_GET_INT_QUERY*, + "other_balance": *JSON_SCHEMA_FOR_RESPONSE_TO_OTHER_BALANCE_QUERY*, + } +} +``` + +## Fields + +### _contract_name_, _contract_version_ + +Contract metadata. The name is not currently guaranteed to be unique. + +### _idl_version_ + +The version of the IDL format itself. This number adheres to +[Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html). + +Using this version number, a client is advised to validate that the IDL files +they're trying to parse are backwards compatible with the IDL version the client +was developed against. + +For example, if you're developing a client against the `1.1.0` version of this +spec, this client could accept IDL files for which +`1.1.0 <= idl_version < 2.0.0` is true. + +Clients are expected to accept (and ignore) unknown fields. If new fields are +added to the IDL format, this might be considered a backwards compatible change. + +### _instantiate_, _execute_, _query_, _migrate_, _sudo_ + +These are standard entrypoints a smart contract might have. Under these fields, +an IDL file will directly embed a JSON schema for messages that could be passed +to that particular entrypoint. + +Out of these, `instantiate` is the only mandatory field every smart contract is +expected to set. The rest of them are optional and might not appear in every IDL +file, meaning the smart contract does not have those entrypoints. + +### _responses_ + +The `responses` field is currently a dictionary mapping of query names to their +response types. The response types are described by embedded JSON schema +objects. + +### JSON Schema version + +TODO diff --git a/docs/MESSAGE_TYPES.md b/docs/MESSAGE_TYPES.md index faaf1e65d1..e9258c8f32 100644 --- a/docs/MESSAGE_TYPES.md +++ b/docs/MESSAGE_TYPES.md @@ -1,7 +1,7 @@ ## CosmWasm message types -CosmWasm uses JSON for sending data from the host to the Wasm contract and -results out of the Wasm contract. Such JSON messages are created in the client, +CosmWasm uses JSON to send data from the host to the Wasm contract and to handle +results from the Wasm contract. Such JSON messages are created in the client, typically some JavaScript-based application. There the usage of JSON feels very natural for developers. However, JSON has significant limitations such as the lack of a native binary type and inconsistent support for integers > 53 bit. For @@ -9,37 +9,48 @@ this reason, the CosmWasm standard library `cosmwasm-std` ships types that ensure good user experience in JSON. The following table shows both standard Rust types as well as `cosmwasm_std` types and how they are encoded in JSON. -| Rust type | JSON type[^1] | Example | Note | -| ------------------- | -------------------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| bool | `true` or `false` | `true` | | -| u32/i32 | number | `123` | | -| u64/i64 | number | `123456` | Supported in Rust and Go. Other implementations (`jq`, `JavaScript`) do not support the full uint64/int64 range. | -| u128/i128 | string | `"340282366920938463463374607431768211455", "-2766523308300312711084346401884294402"` | | -| usize/isize | number | `123456` | 🚫 Don't use this type because it has a different size in unit tests (64 bit) and Wasm (32 bit). Also it tends to issue float instructions such that the contracts cannot be uploaded. | -| String | string | `"foo"` | -| &str | string | `"foo"` | 🚫 Unsuppored since message types must be owned (DeserializeOwned) | -| Option\ | `null` or JSON type of `T` | `null`, `{"foo":12}` | | -| Vec\ | array of JSON type of `T` | `["one", "two", "three"]` (Vec\), `[true, false]` (Vec\) | -| Vec\ | array of numbers from 0 to 255 | `[187, 61, 11, 250]` | ⚠️ Discouraged as this encoding is not as compact as it can be. See `Binary`. | -| struct MyType { … } | object | `{"foo":12}` | | -| [Uint64] | string containing number | `"1234321"` | Used to support full uint64 range in all implementations | -| [Uint128] | string containing number | `"1234321"` | | -| [Uint256] | string containing number | `"1234321"` | | -| [Uint512] | string containing number | `"1234321"` | | -| [Decimal] | string containing decimal number | `"55.6584"` | | -| [Decimal256] | string containing decimal number | `"55.6584"` | | -| [Binary] | string containing base64 data | `"MTIzCg=="` | | -| [HexBinary] | string containing hex data | `"b5d7d24e428c"` | | +| Rust type | JSON type[^1] | Example | Note | +| ------------------- | ----------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| bool | `true` or `false` | `true` | | +| u32/i32 | number | `123` | | +| u64/i64 | number | `123456` | Supported in Rust and Go. Other implementations (`jq`, `JavaScript`) do not support the full uint64/int64 range. | +| u128/i128 | number | `340282366920938463463374607431768211455, -2766523308300312711084346401884294402` | Supported in Rust. Other implementations do not support the full range. This used to be serialized as a string in serde-json-wasm. See [Dev Note #4: u128/i128 serialization][dev-note-4]. If you have any code relying on that serialization, switch to `Uint128` / `Int128`. | +| usize/isize | number | `123456` | 🚫 Don't use this type because it has a different size in unit tests (64 bit) and Wasm (32 bit). Also it tends to issue float instructions such that the contracts cannot be uploaded. | +| String | string | `"foo"` | +| &str | string | `"foo"` | 🚫 Unsupported since message types must be owned (DeserializeOwned) | +| Option\ | `null` or JSON type of `T` | `null`, `{"foo":12}` | | +| Vec\ | array of JSON type of `T` | `["one", "two", "three"]` (Vec\), `[true, false]` (Vec\) | +| Vec\ | array of numbers from 0 to 255 | `[187, 61, 11, 250]` | ⚠️ Discouraged as this encoding is not as compact as it can be. See `Binary`. | +| struct MyType { … } | object | `{"foo":12}` | | +| [Uint64]/[Int64] | string containing number | `"1234321"`, `"-1234321"` | Used to support full uint64/int64 range in all implementations | +| [Uint128]/[Int128] | string containing number | `"1234321"`, `"-1234321"` | | +| [Uint256]/[Int256] | string containing number | `"1234321"`, `"-1234321"` | | +| [Uint512]/[Int512] | string containing number | `"1234321"`, `"-1234321"` | | +| [Decimal] | string containing decimal number | `"55.6584"` | | +| [Decimal256] | string containing decimal number | `"55.6584"` | | +| [Binary] | string containing base64 data | `"MTIzCg=="` | | +| [HexBinary] | string containing hex data | `"b5d7d24e428c"` | | +| [Timestamp] | string containing nanoseconds since epoch | `"1677687687000000000"` | | +| [Order] | string containing order variant | `"ascending"` or `"descending"` | | -[uint64]: https://docs.rs/cosmwasm-std/1.1.1/cosmwasm_std/struct.Uint64.html -[uint128]: https://docs.rs/cosmwasm-std/1.1.1/cosmwasm_std/struct.Uint128.html -[uint256]: https://docs.rs/cosmwasm-std/1.1.1/cosmwasm_std/struct.Uint256.html -[uint512]: https://docs.rs/cosmwasm-std/1.1.1/cosmwasm_std/struct.Uint512.html -[decimal]: https://docs.rs/cosmwasm-std/1.1.1/cosmwasm_std/struct.Decimal.html +[uint64]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Uint64.html +[uint128]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Uint128.html +[uint256]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Uint256.html +[uint512]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Uint512.html +[int64]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Int64.html +[int128]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Int128.html +[int256]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Int256.html +[int512]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Int512.html +[decimal]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Decimal.html [decimal256]: - https://docs.rs/cosmwasm-std/1.1.1/cosmwasm_std/struct.Decimal256.html -[binary]: https://docs.rs/cosmwasm-std/1.1.1/cosmwasm_std/struct.Binary.html + https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Decimal256.html +[binary]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Binary.html [hexbinary]: - https://docs.rs/cosmwasm-std/1.1.1/cosmwasm_std/struct.HexBinary.html + https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.HexBinary.html +[timestamp]: + https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/struct.Timestamp.html +[order]: https://docs.rs/cosmwasm-std/1.3.3/cosmwasm_std/enum.Order.html +[dev-note-4]: + https://medium.com/cosmwasm/dev-note-4-u128-i128-serialization-in-cosmwasm-90cb76784d44 [^1]: https://www.json.org/ diff --git a/docs/MSRV.md b/docs/MSRV.md deleted file mode 100644 index ca8292dd35..0000000000 --- a/docs/MSRV.md +++ /dev/null @@ -1,11 +0,0 @@ -# Minimum Supported Rust Version (MSRV) - -We try to keep the range of supported Rust compiler versions as wide as possible -to avoid unnecessary inconvenience for contract developers. However, we give up -all strong MSRV guarantees as the Rust ecosystem currently makes it impossible -to do so. See e.g. - -- https://github.com/rust-lang/api-guidelines/issues/252 -- https://github.com/CosmWasm/cosmwasm/issues/1244 -- https://github.com/wasmerio/wasmer/issues/2819 -- https://github.com/CosmWasm/cosmwasm/issues/1204 diff --git a/docs/PINNING.md b/docs/PINNING.md new file mode 100644 index 0000000000..a0ce6b6b98 --- /dev/null +++ b/docs/PINNING.md @@ -0,0 +1,4 @@ +# Contract pinning + +This page is now maintained in the main CosmWasm docs: + diff --git a/docs/STORAGE_KEYS.md b/docs/STORAGE_KEYS.md new file mode 100644 index 0000000000..fd23e77004 --- /dev/null +++ b/docs/STORAGE_KEYS.md @@ -0,0 +1,83 @@ +# Storage keys + +CosmWasm provides a generic key value store to contract developers via the +`Storage` trait. This is powerful but the nature of low level byte operations +makes it hard to use for high level storage types. In this document we discuss +the foundations of storage key composition all the way up to cw-storage-plus. + +In a simple world, all you need is a `&[u8]` key which you can get e.g. using +`&17u64.to_be_bytes()`. This is an 8 bytes key with an encoded integer. But if +you have multiple data types in your contract, you want to prefix those keys in +order to avoid collisions. A simple concatenation is not sufficient because you +want to avoid collisions when part of the prefixes and part of the key overlap. +E.g. `b"keya" | b"x"` and `b"key" | b"ax"` (`|` denotes concatenation) must not +have the same binary representation. + +In the early days, multiple approaches of key namespacing were discussed and +were documented here: https://github.com/webmaster128/key-namespacing. The "0x00 +separated ASCIIHEX" approach was never used but "Length-prefixed keys" is used. + +To recap, Length-prefixed keys have the following layout: + +``` +len(namespace_1) | namespace_1 + | len(namespace_2) | namespace_2 + | len(namespace_3) | namespace_3 + | ... + | len(namespace_m) | namespace_m + | key +``` + +In this repo (package `cosmwasm-storage`), the following functions were +implemented: + +```rust +pub fn to_length_prefixed(namespace: &[u8]) -> Vec + +pub fn to_length_prefixed_nested(namespaces: &[&[u8]]) -> Vec + +fn concat(namespace: &[u8], key: &[u8]) -> Vec +``` + +With the emerging cw-storage-plus we see two additions to that approach: + +1. Manually creating the namespace and concatenating it with `concat` makes no + sense anymore. Instead `namespace` and `key` are always provided and a + composed database key is created. +2. Using a multi component namespace becomes the norm. + +This led to the following addition in cw-storage-plus: + +```rust +/// This is equivalent concat(to_length_prefixed_nested(namespaces), key) +/// But more efficient when the intermediate namespaces often must be recalculated +pub(crate) fn namespaces_with_key(namespaces: &[&[u8]], key: &[u8]) -> Vec { +``` + +In contrast to `concat(to_length_prefixed_nested(namespaces), key)` this direct +implementation saves once vector allocation since the final length can be +pre-computed and reserved. Also it's shorter to use. + +Also since `to_length_prefixed` returns the same result as +`to_length_prefixed_nested` when called with one namespace element, there is no +good reason to preserve the single component version. + +## 2023 updates + +With the deprecation of cosmwasm-storage and the adoption of the system in +cw-storage-plus, it is time to do a few changes to the Length-prefixed keys +standard, without breaking existing users. + +1. Remove the single component `to_length_prefixed` implementation and fully + commit to the multi-component version. This shifts focus from the recursive + implementation to the compatible iterative implementation. +2. Rename "namespaces" to just "namespace" and let one namespace have multiple + components. +3. Adopt the combined namespace + key encoder `namespaces_with_key` from + cw-storage-plus. +4. Add a decomposition implementation + +Given the importance of Length-prefixed keys for the entire CosmWasm ecosystem, +those implementations should be maintained in cosmwasm-std. The generic approach +allows building all sorts of storage solutions on top of it and it allows +indexers to parse storage keys for all of them. diff --git a/docs/USING_COSMWASM_STD.md b/docs/USING_COSMWASM_STD.md new file mode 100644 index 0000000000..c4fd9e40fd --- /dev/null +++ b/docs/USING_COSMWASM_STD.md @@ -0,0 +1,90 @@ +# Using cosmwasm-std + +cosmwasm-std is the standard library for building contracts in CosmWasm. It is +compiled as part of the contract to Wasm. When creating a dependency to +cosmwasm-std, the required Wasm imports and exports are created implicitly via C +interfaces, e.g.: + +```rust +// Exports +#[no_mangle] +extern "C" fn interface_version_8() -> () { /* ... */ } +#[no_mangle] +extern "C" fn allocate(size: usize) -> u32 { /* ... */ } +#[no_mangle] +extern "C" fn deallocate(pointer: u32) { /* ... */ } + +// Imports +extern "C" { + fn abort(source_ptr: u32); + + fn db_read(key: u32) -> u32; + fn db_write(key: u32, value: u32); + fn db_remove(key: u32); + + /* ... */ +} +``` + +As those exports are not namespaced, only one version of cosmwasm-std must exist +in the dependency tree. Otherwise conflicting C exports are created. + +## cosmwasm-std features + +The library comes with the following features: + +| Feature | Enabled by default | Description | +| ------------ | ------------------ | -------------------------------------------------------------------------------- | +| exports | x | Adds exports and imports needed for basic communication between contract and VM. | +| iterator | x | Storage iterators | +| stargate | | Cosmos SDK 0.40+ features and IBC | +| staking | | Access to the staking module | +| cosmwasm_1_1 | | Features that require CosmWasm 1.1+ on the chain | +| cosmwasm_1_2 | | Features that require CosmWasm 1.2+ on the chain | +| cosmwasm_1_3 | | Features that require CosmWasm 1.3+ on the chain | +| cosmwasm_1_4 | | Features that require CosmWasm 1.4+ on the chain | + +## The cosmwasm-std dependency for contract developers + +As a contract developer you can simply specify the dependency as follows in +`Cargo.toml`: + +```toml +cosmwasm-std = { version = "1.2.0" } +``` + +Please note that it is recommended to set all 3 version components and use the +minimum version you are willing to accept in the contract. For contracts this +would usually be the latest stable version. + +Most likely you also want to enable the `stargate`, which is pretty basic these +days and maybe you know your chain supports CosmWasm 1.2 or higher. Then you add +those features: + +```toml +cosmwasm-std = { version = "1.2.0", features = ["stargate", "cosmwasm_1_2"] } +``` + +## The cosmwasm-std dependency for library developers + +When you are creating a library that uses cosmwasm-std, you should be incredibly +careful with which features you require. The moment you add e.g. `cosmwasm_1_2` +there it becomes impossible to use the contract in chains with lower CosmWasm +versions. If you add `iterator`, it becomes impossible for the contract +developer to opt out of the iterator feature due to your library. Since this +affects the default feature `iterator`, you should always disable default +features. However, you should make sure to keep the `std` feature enabled, as we +might move certain existing functionality to that feature in the future. + +Also libraries should define a loose version range that allows the contract +developer to control which cosmwasm-std version they want to use in the final +project. E.g. if your library does not work with 3.0.0 due to a bug fixed in +3.0.1, your min version is 3.0.1 and not the latest stable. + +A typical dependency then looks like this: + +```toml +# We really need `stargate` here as this is an IBC related library. `exports` and `iterator` are not needed. +# `std` should always stay enabled. +cosmwasm-std = { version = "3.0.1", default-features = false, features = ["std", "stargate"] } +``` diff --git a/docs/simulate_riffle_shuffle.py b/docs/simulate_riffle_shuffle.py deleted file mode 100644 index c6a33c1355..0000000000 --- a/docs/simulate_riffle_shuffle.py +++ /dev/null @@ -1,57 +0,0 @@ -import functools - -# Create a funtion that executed f recusively n times, i.e. f**n -def power(f, n): - functions = [f for _ in range(n)] - def compose2(f, g): - return lambda x: f(g(x)) - return functools.reduce(compose2, functions, lambda x: x) - -# Rotate input to the left by n positions -def rotate_left(input, n): - return input[n:] + input[0:n] - -def riffle_shuffle(input): - left = input[0:len(input)//2] - right = input[len(input)//2:] - i = 0 - out = "" - while i < len(input)//2: - out += right[i] + left[i] - i += 1 - return out - -values = [ - "alice123----------------", # 0 - "alice485----------------", # 1 - "aliceimwunderland521----", # 2 - "bob1--------------------", # 3 - "bob123------------------", # 4 - "bob485------------------", # 5 - "bob511------------------", # 6 - "creator-----------------", # 7 -] - -def digit_sum(input): - def value(char): - if char == "-": - return 0 - else: - return ord(char) - return sum([value(c) for c in input]) - -shuffle = power(riffle_shuffle, 18) -rotated = [rotate_left(v, digit_sum(v) % 24) for v in values] -rotated_shuffled = [shuffle(r) for r in rotated] -shuffled = [shuffle(v) for v in values] - -print("Original:\n" + "\n".join(sorted(values))) -print() -# digit_sums = [str(digit_sum(v) % 24) for v in values] -# print("Digit sums:\n" + "\n".join(digit_sums)) -# print() -print("Rotated:\n" + "\n".join(sorted(rotated))) -print() -print("Shuffled:\n" + "\n".join(sorted(shuffled))) -print() -print("Rotated+Shuffled:\n" + "\n".join(sorted(rotated_shuffled))) diff --git a/packages/check/Cargo.toml b/packages/check/Cargo.toml index 2d094890a7..a1064e216b 100644 --- a/packages/check/Cargo.toml +++ b/packages/check/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmwasm-check" -version = "1.1.9" +version = { workspace = true } authors = ["Mauro Lacy "] edition = "2021" description = "A CLI tool for verifying CosmWasm smart contracts" @@ -9,7 +9,12 @@ license = "Apache-2.0" [dependencies] anyhow = "1.0.57" -clap = "2" -colored = "2" -cosmwasm-vm = { path = "../vm", version = "1.1.9" } -cosmwasm-std = { path = "../std", version = "1.1.9" } +clap = "4" +colored = "2.1.0" +cosmwasm-vm = { workspace = true } +cosmwasm-std = { workspace = true, default-features = true } + +[dev-dependencies] +assert_cmd = "2.0.12" +predicates = "3" +tempfile = "3.1.0" diff --git a/packages/check/src/main.rs b/packages/check/src/main.rs index 1d4e6eb67d..9f1c2c1469 100644 --- a/packages/check/src/main.rs +++ b/packages/check/src/main.rs @@ -1,59 +1,101 @@ +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! This binary provides a CLI tool for verifying CosmWasm smart contracts before uploading to a blockchain. +//! +//! For more information, see: + use std::collections::HashSet; use std::fs::File; use std::io::Read; use std::path::Path; use std::process::exit; +use std::time::Instant; -use clap::{App, Arg}; +use anyhow::Context; +use clap::{Arg, ArgAction, Command}; use colored::Colorize; -use cosmwasm_vm::capabilities_from_csv; -use cosmwasm_vm::internals::{check_wasm, compile}; +use cosmwasm_std::{from_json, StdResultExt}; +use cosmwasm_vm::internals::{check_wasm, compile, make_compiling_engine, LogOutput, Logger}; +use cosmwasm_vm::{capabilities_from_csv, WasmLimits}; -const DEFAULT_AVAILABLE_CAPABILITIES: &str = "iterator,staking,stargate,cosmwasm_1_1"; +const DEFAULT_AVAILABLE_CAPABILITIES: &str = + "ibc2,iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1,cosmwasm_2_2"; pub fn main() { - let matches = App::new("Contract checking") + let matches = Command::new("Contract checking") .version(env!("CARGO_PKG_VERSION")) .long_about("Checks the given wasm file (memories, exports, imports, available capabilities, and non-determinism).") .author("Mauro Lacy ") .arg( - Arg::with_name("CAPABILITIES") + Arg::new("CAPABILITIES") // `long` setting required to turn the position argument into an option 🤷 .long("available-capabilities") - .aliases(&["FEATURES", "supported-features"]) // Old names + .aliases(["FEATURES", "supported-features"]) // Old names .value_name("CAPABILITIES") .help("Sets the available capabilities that the desired target chain has") - .takes_value(true) + .num_args(1) + .action(ArgAction::Set), + ) + .arg( + Arg::new("VERBOSE") + .long("verbose") + .num_args(0) + .help("Prints additional information on stderr") + .action(ArgAction::SetTrue), ) .arg( - Arg::with_name("WASM") + Arg::new("LIMITS") + .long("wasm-limits") + .help("Provide either a file or string containing the chain's json-encoded wasm limits configuration.") + .long_help("Provide either a file or string containing the chain's json-encoded wasm limits configuration. +You can query this configuration from the chain, using the 'cosmwasm.wasm.v1.Query/WasmLimitsConfig' query. +If this is not provided, the default values are used.") + .num_args(1) + .action(ArgAction::Set) + ) + .arg( + Arg::new("WASM") .help("Wasm file to read and compile") .required(true) .index(1) - .multiple(true), + .num_args(0..) + .action(ArgAction::Append), ) .get_matches(); // Available capabilities let available_capabilities_csv = matches - .value_of("CAPABILITIES") + .get_one::("CAPABILITIES") + .map(|s| s.as_str()) .unwrap_or(DEFAULT_AVAILABLE_CAPABILITIES); let available_capabilities = capabilities_from_csv(available_capabilities_csv); - println!("Available capabilities: {:?}", available_capabilities); + println!("Available capabilities: {available_capabilities:?}"); println!(); + // Wasm limits + let wasm_limits = matches + .get_one::("LIMITS") + .map(|input| read_wasm_limits(input).unwrap()) + .unwrap_or_default(); + // File - let paths = matches.values_of("WASM").expect("Error parsing file names"); + let paths = matches + .get_many::("WASM") + .expect("Error parsing file names"); let (passes, failures): (Vec<_>, _) = paths .map(|p| { - let result = check_contract(p, &available_capabilities); + let result = check_contract( + p, + &available_capabilities, + matches.get_flag("VERBOSE"), + &wasm_limits, + ); match &result { Ok(_) => println!("{}: {}", p, "pass".green()), Err(e) => { println!("{}: {}", p, "failure".red()); - println!("{}", e); + println!("{e}"); } }; result @@ -79,9 +121,29 @@ pub fn main() { } } +fn read_wasm_limits(input: &str) -> anyhow::Result { + // try to parse JSON, if that fails, try to open as File and parse that + from_json::(input) + .unwrap_std_error() + .map_err(anyhow::Error::from_boxed) + .context("error parsing wasm limits") + .or_else(|_| { + std::fs::read_to_string(input) + .context("error reading wasm limits file") + .and_then(|s| { + from_json(s) + .unwrap_std_error() + .map_err(anyhow::Error::from_boxed) + .context("error parsing wasm limits file") + }) + }) +} + fn check_contract( - path: impl AsRef, + path: &str, available_capabilities: &HashSet, + verbose: bool, + wasm_limits: &WasmLimits, ) -> anyhow::Result<()> { let mut file = File::open(path)?; @@ -89,11 +151,33 @@ fn check_contract( let mut wasm = Vec::::new(); file.read_to_end(&mut wasm)?; + // Potentially lossy filename or path as used as a short prefix for the output + let filename_identifier: String = Path::new(path) + .file_name() + .map(|f| f.to_string_lossy().into_owned()) + .unwrap_or(path.to_string()); + let prefix = format!(" {}: ", filename_identifier); + let logs = if verbose { + Logger::On { + prefix: &prefix, + output: LogOutput::StdErr, + } + } else { + Logger::Off + }; // Check wasm - check_wasm(&wasm, available_capabilities)?; + check_wasm(&wasm, available_capabilities, wasm_limits, logs)?; // Compile module - compile(&wasm, None, &[])?; + let start = Instant::now(); + { + let engine = make_compiling_engine(None); + let _module = compile(&engine, &wasm)?; + } + if verbose { + let duration = start.elapsed(); + eprintln!("Compile time: {:?}", duration); + } Ok(()) } diff --git a/packages/check/tests/cosmwasm_check_tests.rs b/packages/check/tests/cosmwasm_check_tests.rs new file mode 100644 index 0000000000..7319a18838 --- /dev/null +++ b/packages/check/tests/cosmwasm_check_tests.rs @@ -0,0 +1,137 @@ +use assert_cmd::prelude::*; +use cosmwasm_std::{to_json_string, to_json_vec, StdResult}; +use cosmwasm_vm::WasmLimits; +use predicates::prelude::*; +use std::{io::Write, process::Command}; +use tempfile::NamedTempFile; + +#[test] +fn valid_contract_check() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + cmd.arg("../vm/testdata/hackatom.wasm"); + cmd.assert() + .success() + .stdout(predicate::str::contains("pass")); + + Ok(()) +} + +#[test] +fn contract_check_verbose() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + cmd.arg("../vm/testdata/empty.wasm").arg("--verbose"); + cmd.assert() + .success() + .stdout(predicate::str::contains("pass")) + .stderr(predicate::str::contains("Max function parameters")); + + Ok(()) +} + +#[test] +fn empty_contract_check() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + cmd.arg("../vm/testdata/empty.wasm"); + cmd.assert() + .success() + .stdout(predicate::str::contains("pass")); + + Ok(()) +} + +#[test] +fn invalid_contract_check() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + cmd.arg("../vm/testdata/corrupted.wasm"); + cmd.assert() + .failure() + .stdout(predicate::str::contains("missing a required marker export")); + + Ok(()) +} + +#[test] +fn valid_contract_check_float_operator() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + cmd.arg("../vm/testdata/floaty.wasm"); + cmd.assert() + .success() + .stdout(predicate::str::contains("pass")); + + Ok(()) +} + +#[test] +fn several_contracts_check() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + cmd.arg("../vm/testdata/hackatom.wasm") + .arg("../vm/testdata/corrupted.wasm"); + cmd.assert() + .failure() + .stdout(predicate::str::contains("failure")) + .stdout(predicate::str::contains("missing a required marker export")) + .stdout(predicate::str::contains("Passes: 1, failures: 1")); + + Ok(()) +} + +#[test] +fn custom_capabilities_check() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + cmd.arg("--available-capabilities") + .arg("iterator,osmosis,friendship,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1,cosmwasm_2_2") + .arg("../vm/testdata/hackatom.wasm"); + cmd.assert() + .success() + .stdout(predicate::str::contains("Available capabilities:")) + .stdout(predicate::str::contains("iterator")) + .stdout(predicate::str::contains("osmosis")) + .stdout(predicate::str::contains("friendship")); + + Ok(()) +} + +#[test] +fn wasm_limits_string_check() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + let mut limits = WasmLimits::default(); + limits.initial_memory_limit_pages = Some(10); + + cmd.arg("--wasm-limits") + .arg(to_json_string(&limits).unwrap()) + .arg("../vm/testdata/hackatom.wasm"); + cmd.assert() + .failure() + .stdout(predicate::str::contains("must not exceed 10 pages")); + + Ok(()) +} + +#[test] +fn wasm_limits_file_check() -> StdResult<()> { + let mut cmd = Command::cargo_bin("cosmwasm-check")?; + + let mut limits = WasmLimits::default(); + limits.max_functions = Some(15); + let limits = to_json_vec(&limits)?; + + let mut tmp_file = NamedTempFile::new()?; + tmp_file.write_all(&limits)?; + + cmd.arg("--wasm-limits") + .arg(tmp_file.path()) + .arg("../vm/testdata/hackatom.wasm"); + cmd.assert() + .failure() + .stdout(predicate::str::contains("more than 15 functions")); + + Ok(()) +} diff --git a/packages/core/.cargo/config.toml b/packages/core/.cargo/config.toml new file mode 100644 index 0000000000..54e2d5481e --- /dev/null +++ b/packages/core/.cargo/config.toml @@ -0,0 +1,5 @@ +[alias] +no-std = "build --release --lib --target thumbv7em-none-eabi" +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml new file mode 100644 index 0000000000..e1e92a405a --- /dev/null +++ b/packages/core/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "cosmwasm-core" +version = { workspace = true } +edition = "2021" +description = "Components of cosmwasm-std that can be used in no_std environments" +repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/core" +license = "Apache-2.0" +readme = "README.md" diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 0000000000..f8a39fd1e4 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,15 @@ +# cosmwasm-core + +[![cosmwasm-core on crates.io](https://img.shields.io/crates/v/cosmwasm-core.svg)](https://crates.io/crates/cosmwasm-core) + +This crate contains components of cosmwasm-std that can be used in a +[no_std environment](https://docs.rust-embedded.org/book/intro/no-std.html). All +symbols are re-exported by cosmwasm-std, such that contract developers don't +need to add this dependency directly. It is recommended to only use cosmwasm-std +whenever possible. + +## License + +This package is part of the cosmwasm repository, licensed under the Apache +License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) +and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). diff --git a/packages/core/src/crypto.rs b/packages/core/src/crypto.rs new file mode 100644 index 0000000000..3030cddbb2 --- /dev/null +++ b/packages/core/src/crypto.rs @@ -0,0 +1,24 @@ +pub const BLS12_381_G1_POINT_LEN: usize = 48; +pub const BLS12_381_G2_POINT_LEN: usize = 96; + +/// A generator in G1 (in compressed serialization). +/// +/// This can be used directly for signature verification +/// (see e.g. https://twitter.com/simon_warta/status/1786342207106019765) +pub const BLS12_381_G1_GENERATOR: [u8; BLS12_381_G1_POINT_LEN] = [ + 151, 241, 211, 167, 49, 151, 215, 148, 38, 149, 99, 140, 79, 169, 172, 15, 195, 104, 140, 79, + 151, 116, 185, 5, 161, 78, 58, 63, 23, 27, 172, 88, 108, 85, 232, 63, 249, 122, 26, 239, 251, + 58, 240, 10, 219, 34, 198, 187, +]; + +/// A generator in G2 (in compressed serialization). +/// +/// This can be used directly for signature verification +/// (see e.g. https://twitter.com/simon_warta/status/1786342207106019765) +pub const BLS12_381_G2_GENERATOR: [u8; BLS12_381_G2_POINT_LEN] = [ + 147, 224, 43, 96, 82, 113, 159, 96, 125, 172, 211, 160, 136, 39, 79, 101, 89, 107, 208, 208, + 153, 32, 182, 26, 181, 218, 97, 187, 220, 127, 80, 73, 51, 76, 241, 18, 19, 148, 93, 87, 229, + 172, 125, 5, 93, 4, 43, 126, 2, 74, 162, 178, 240, 143, 10, 145, 38, 8, 5, 39, 45, 197, 16, 81, + 198, 228, 122, 212, 250, 64, 59, 2, 180, 81, 11, 100, 122, 227, 209, 119, 11, 172, 3, 38, 168, + 5, 187, 239, 212, 128, 86, 200, 193, 33, 189, 184, +]; diff --git a/packages/core/src/lib.rs b/packages/core/src/lib.rs new file mode 100644 index 0000000000..f6621a083d --- /dev/null +++ b/packages/core/src/lib.rs @@ -0,0 +1,13 @@ +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! This crate contains components of cosmwasm-std that can be used in no_std environments. +//! +//! For more information, see: + +#![no_std] + +mod crypto; + +#[doc(hidden)] +pub use self::crypto::{ + BLS12_381_G1_GENERATOR, BLS12_381_G1_POINT_LEN, BLS12_381_G2_GENERATOR, BLS12_381_G2_POINT_LEN, +}; diff --git a/packages/core/tests/test_bls12_381.rs b/packages/core/tests/test_bls12_381.rs new file mode 100644 index 0000000000..0f7b90ea43 --- /dev/null +++ b/packages/core/tests/test_bls12_381.rs @@ -0,0 +1,31 @@ +use cosmwasm_core::{ + BLS12_381_G1_GENERATOR, BLS12_381_G1_POINT_LEN, BLS12_381_G2_GENERATOR, BLS12_381_G2_POINT_LEN, +}; + +#[test] +fn ensure_lengths() { + assert_eq!(BLS12_381_G1_POINT_LEN, 48); + assert_eq!(BLS12_381_G2_POINT_LEN, 96); +} + +#[test] +fn ensure_generators() { + assert_eq!( + BLS12_381_G1_GENERATOR, + [ + 151, 241, 211, 167, 49, 151, 215, 148, 38, 149, 99, 140, 79, 169, 172, 15, 195, 104, + 140, 79, 151, 116, 185, 5, 161, 78, 58, 63, 23, 27, 172, 88, 108, 85, 232, 63, 249, + 122, 26, 239, 251, 58, 240, 10, 219, 34, 198, 187, + ] + ); + assert_eq!( + BLS12_381_G2_GENERATOR, + [ + 147, 224, 43, 96, 82, 113, 159, 96, 125, 172, 211, 160, 136, 39, 79, 101, 89, 107, 208, + 208, 153, 32, 182, 26, 181, 218, 97, 187, 220, 127, 80, 73, 51, 76, 241, 18, 19, 148, + 93, 87, 229, 172, 125, 5, 93, 4, 43, 126, 2, 74, 162, 178, 240, 143, 10, 145, 38, 8, 5, + 39, 45, 197, 16, 81, 198, 228, 122, 212, 250, 64, 59, 2, 180, 81, 11, 100, 122, 227, + 209, 119, 11, 172, 3, 38, 168, 5, 187, 239, 212, 128, 86, 200, 193, 33, 189, 184, + ] + ); +} diff --git a/packages/crypto/Cargo.toml b/packages/crypto/Cargo.toml index c5b07db3ce..819ed14df7 100644 --- a/packages/crypto/Cargo.toml +++ b/packages/crypto/Cargo.toml @@ -1,40 +1,57 @@ [package] name = "cosmwasm-crypto" -version = "1.1.9" +version = { workspace = true } authors = ["Mauro Lacy "] edition = "2021" description = "Crypto bindings for cosmwasm contracts" repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/crypto" license = "Apache-2.0" -[features] -default = [] -# backtraces provides much better context at runtime errors (in non-wasm code) -# at the cost of a bit of code size and performance. -# This feature requires Rust nightly because it depends on the unstable backtrace feature. -backtraces = [] - [lib] # See https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options bench = false [dependencies] -k256 = { version = "0.11.1", features = ["ecdsa"] } -ed25519-zebra = "3" +ark-bls12-381 = "0.5.0" +ark-ec = { version = "0.5.0", features = ["parallel"] } +ark-ff = { version = "0.5.0", features = ["asm", "parallel"] } +ark-serialize = "0.5.0" +cosmwasm-core = { workspace = true } digest = "0.10" -rand_core = { version = "0.6", features = ["getrandom"] } -thiserror = "1.0.13" +ed25519-zebra = { version = "=4.0.3", default-features = false } +k256 = { version = "0.13.3", default-features = false, features = ["ecdsa"] } +num-traits = "0.2.18" +p256 = { version = "0.13.2", default-features = false, features = ["ecdsa"] } +ecdsa = "0.16.8" # Needed for RecoveryId in secp256r1_recover_pubkey, see https://github.com/RustCrypto/elliptic-curves/issues/1215 +rand_core = "0.6" +rayon = "1.9.0" +sha2 = "0.10" +thiserror = "1.0.26" + +# Not directly used but bumps transitive dependency to avoid +curve25519-dalek = "4.1.3" +# Not directly used, but needed to fix a compilation error +num-bigint = { version = "0.4.2", default-features = false } [dev-dependencies] -criterion = "0.3" -serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] } -serde_json = "1.0.40" +base64 = "0.22.0" +base64-serde = "0.7.0" +criterion = "0.5.1" +rand_core = { version = "0.6", features = ["getrandom"] } +serde = { version = "1.0.103", default-features = false, features = ["alloc", "derive"] } +serde_json = "1.0.140" sha2 = "0.10" -base64 = "0.13.0" -hex = "0.4" -hex-literal = "0.3.1" +sha3 = "0.10" +hex = { version = "0.4", features = ["serde"] } +hex-literal = "0.4.1" english-numbers = "0.3" +glob = "0.3.1" + +[features] +default = ["std"] +std = [] [[bench]] name = "main" harness = false +required-features = ["std"] diff --git a/packages/crypto/README.md b/packages/crypto/README.md index b1dc660d0e..043da8d4ae 100644 --- a/packages/crypto/README.md +++ b/packages/crypto/README.md @@ -3,23 +3,25 @@ [![cosmwasm-crypto on crates.io](https://img.shields.io/crates/v/cosmwasm-crypto.svg)](https://crates.io/crates/cosmwasm-crypto) This crate implements cryptography-related functions, so that they can be -available for both, the [cosmwasm-vm](`https://crates.io/crates/cosmwasm-vm`) -and [cosmwasm-std](`https://crates.io/crates/cosmwasm-std`) crates. +available for both, the [cosmwasm-vm](https://crates.io/crates/cosmwasm-vm) and +[cosmwasm-std](https://crates.io/crates/cosmwasm-std) crates. ## Implementations -- `secp256k1_verify()`: Digital signature verification using the ECDSA sepc256k1 +- `secp256k1_verify()`: Digital signature verification using the ECDSA secp256k1 + scheme, for Cosmos signature / public key formats. +- `secp256r1_verify()`: Digital signature verification using the ECDSA secp256r1 scheme, for Cosmos signature / public key formats. - `ed25519_verify()`: Digital signature verification using the EdDSA ed25519 - scheme, for Tendemint signature / public key formats. + scheme, for Tendermint signature / public key formats. - `ed25519_batch_verify()`: Batch digital signature verification using the EdDSA - ed25519 scheme, for Tendemint signature / public key formats. + ed25519 scheme, for Tendermint signature / public key formats. ## Benchmarking ``` cd packages/crypto -cargo bench +cargo bench --features std ``` ## License diff --git a/packages/crypto/benches/main.rs b/packages/crypto/benches/main.rs index 9135759c5f..f434115a9d 100644 --- a/packages/crypto/benches/main.rs +++ b/packages/crypto/benches/main.rs @@ -1,5 +1,10 @@ +use ark_bls12_381::{G1Affine, G2Affine, G2Projective}; +use ark_ec::AffineRepr; +use ark_ff::UniformRand; +use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use criterion::{criterion_group, criterion_main, Criterion, PlottingBackend}; -use std::time::Duration; +use rand_core::OsRng; +use std::{hint::black_box, io, time::Duration}; use english_numbers::convert_no_fmt; use hex_literal::hex; @@ -8,17 +13,24 @@ use serde::Deserialize; // Crypto stuff use digest::Digest; use k256::ecdsa::SigningKey; // type alias -use k256::elliptic_curve::sec1::ToEncodedPoint; use sha2::Sha256; +use cosmwasm_core::{BLS12_381_G1_GENERATOR, BLS12_381_G1_POINT_LEN, BLS12_381_G2_POINT_LEN}; use cosmwasm_crypto::{ - ed25519_batch_verify, ed25519_verify, secp256k1_recover_pubkey, secp256k1_verify, + bls12_381_aggregate_g1, bls12_381_aggregate_g2, bls12_381_hash_to_g1, bls12_381_hash_to_g2, + bls12_381_pairing_equality, ed25519_batch_verify, ed25519_verify, secp256k1_recover_pubkey, + secp256k1_verify, secp256r1_recover_pubkey, secp256r1_verify, HashFunction, }; use std::cmp::min; const COSMOS_SECP256K1_MSG_HEX: &str = "0a93010a90010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412700a2d636f736d6f7331706b707472653766646b6c366766727a6c65736a6a766878686c63337234676d6d6b38727336122d636f736d6f7331717970717870713971637273737a673270767871367273307a716733797963356c7a763778751a100a0575636f736d12073132333435363712650a4e0a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21034f04181eeba35391b858633a765c4a0c189697b40d216354d50890d350c7029012040a02080112130a0d0a0575636f736d12043230303010c09a0c1a0c73696d642d74657374696e672001"; const COSMOS_SECP256K1_SIGNATURE_HEX: &str = "c9dd20e07464d3a688ff4b710b1fbc027e495e797cfa0b4804da2ed117959227772de059808f765aa29b8f92edf30f4c2c5a438e30d3fe6897daa7141e3ce6f9"; -const COSMOS_SECP256K1_PUBKEY_BASE64: &str = "A08EGB7ro1ORuFhjOnZcSgwYlpe0DSFjVNUIkNNQxwKQ"; +const COSMOS_SECP256K1_PUBKEY_HEX: &str = + "034f04181eeba35391b858633a765c4a0c189697b40d216354d50890d350c70290"; + +const COSMOS_SECP256R1_MSG_HEX: &str = "5905238877c77421f73e43ee3da6f2d9e2ccad5fc942dcec0cbd25482935faaf416983fe165b1a045ee2bcd2e6dca3bdf46c4310a7461f9a37960ca672d3feb5473e253605fb1ddfd28065b53cb5858a8ad28175bf9bd386a5e471ea7a65c17cc934a9d791e91491eb3754d03799790fe2d308d16146d5c9b0d0debd97d79ce8"; +const COSMOS_SECP256R1_SIGNATURE_HEX: &str = "f3ac8061b514795b8843e3d6629527ed2afd6b1f6a555a7acabb5e6f79c8c2ac8bf77819ca05a6b2786c76262bf7371cef97b218e96f175a3ccdda2acc058903"; +const COSMOS_SECP256R1_PUBKEY_HEX: &str = "041ccbe91c075fc7f4f033bfa248db8fccd3565de94bbfb12f3c59ff46c271bf83ce4014c68811f9a21a1fdb2c0e6113e06db7ca93b7404e78dc7ccd5ca89a4ca9"; // TEST 3 test vector from https://tools.ietf.org/html/rfc8032#section-7.1 const COSMOS_ED25519_MSG_HEX: &str = "af82"; @@ -29,6 +41,14 @@ const COSMOS_ED25519_PUBLIC_KEY_HEX: &str = // Test data from https://tools.ietf.org/html/rfc8032#section-7.1 const COSMOS_ED25519_TESTS_JSON: &str = "./testdata/ed25519_tests.json"; +// BLS test vector +// Path: "packages/crypto/testdata/bls-tests/verify/verify_valid_case_2ea479adf8c40300.json" +const BLS_PUBKEY: [u8; 48] = hex!("a491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a"); +const BLS_MESSAGE: [u8; 32] = + hex!("5656565656565656565656565656565656565656565656565656565656565656"); +const BLS_DST: &[u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; +const BLS_SIGNATURE: [u8; 96] = hex!("882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb"); + #[derive(Deserialize, Debug)] struct Encoded { #[serde(rename = "privkey")] @@ -73,14 +93,163 @@ fn read_decode_cosmos_sigs() -> (Vec>, Vec>, Vec>) { (messages, signatures, public_keys) } +fn bench_bls(group: &mut criterion::BenchmarkGroup<'_, M>) +where + M: criterion::measurement::Measurement, +{ + let two_pow_max = 8; + let num_random_points = 2_usize.pow(two_pow_max); + + { + let random_points_g1: Vec = (0..num_random_points) + .map(|_| G1Affine::rand(&mut OsRng)) + .collect(); + let mut g1_serialized = io::Cursor::new(Vec::new()); + random_points_g1 + .serialize_compressed(&mut g1_serialized) + .unwrap(); + let g1_serialized = &g1_serialized.into_inner()[8..]; + + let random_points_g2: Vec = (0..num_random_points) + .map(|_| G2Affine::rand(&mut OsRng)) + .collect(); + let mut g2_serialized = io::Cursor::new(Vec::new()); + random_points_g2 + .serialize_compressed(&mut g2_serialized) + .unwrap(); + let g2_serialized = &g2_serialized.into_inner()[8..]; + + for i in 1..=two_pow_max { + let num_points = 2_usize.pow(i); + let points_to_aggregate_g1 = &g1_serialized[..num_points * BLS12_381_G1_POINT_LEN]; + group.bench_function(format!("bls12_381_aggregate_g1_{num_points}"), |b| { + b.iter(|| bls12_381_aggregate_g1(points_to_aggregate_g1).unwrap()); + }); + } + + for i in 1..=two_pow_max { + let num_points = 2_usize.pow(i); + let points_to_aggregate_g2 = &g2_serialized[..num_points * BLS12_381_G2_POINT_LEN]; + group.bench_function(format!("bls12_381_aggregate_g2_{num_points}"), |b| { + b.iter(|| bls12_381_aggregate_g2(points_to_aggregate_g2).unwrap()); + }); + } + } + + { + const MESSAGE: &[u8] = b"message"; + const DST: &[u8] = b"dst"; + let secret_keys: Vec = (0..num_random_points) + .map(|_| ark_bls12_381::Fr::rand(&mut OsRng)) + .collect(); + let public_keys: Vec = secret_keys + .iter() + .map(|secret_key| G1Affine::generator() * secret_key) + .map(Into::into) + .collect(); + let messages: Vec = (0..num_random_points) + .map(|_| bls12_381_hash_to_g2(HashFunction::Sha256, MESSAGE, DST)) + .map(|bytes| G2Affine::deserialize_compressed(&bytes[..]).unwrap()) + .collect(); + let signatures: Vec = secret_keys + .iter() + .zip(messages.iter()) + .map(|(secret_key, message)| *message * secret_key) + .collect(); + + for i in 0..=two_pow_max { + let n = 2_usize.pow(i); // the number of pairings on the left hand side + let k = n + 1; // the number of pairings in total + let messages = &messages[..n]; + let keys = &public_keys[..n]; + let aggregated_signature: G2Affine = + signatures[..n].iter().sum::().into(); + + let serialized_pubkeys: Vec = keys + .iter() + .flat_map(|key| { + let mut serialized = [0_u8; 48]; + key.serialize_compressed(&mut serialized[..]).unwrap(); + serialized + }) + .collect(); + + let serialized_messages: Vec = messages + .iter() + .flat_map(|message| { + let mut serialized = [0_u8; 96]; + message.serialize_compressed(&mut serialized[..]).unwrap(); + serialized + }) + .collect(); + + let mut serialized_signature = [0_u8; 96]; + aggregated_signature + .serialize_compressed(&mut serialized_signature[..]) + .unwrap(); + + group.bench_function(format!("bls12_381_pairing_equality_k={k}"), |b| { + b.iter(|| { + let is_valid = black_box(bls12_381_pairing_equality( + &serialized_pubkeys, + &serialized_messages, + &BLS12_381_G1_GENERATOR, + &serialized_signature, + )) + .unwrap(); + + assert!(is_valid); + }); + }); + } + } + + group.bench_function("bls12_381_hash_to_g1", |b| { + b.iter(|| { + bls12_381_hash_to_g1( + black_box(HashFunction::Sha256), + black_box(&BLS_MESSAGE), + black_box(BLS_DST), + ) + }); + }); + + group.bench_function("bls12_381_hash_to_g2", |b| { + b.iter(|| { + bls12_381_hash_to_g2( + black_box(HashFunction::Sha256), + black_box(&BLS_MESSAGE), + black_box(BLS_DST), + ) + }); + }); + + group.bench_function("bls12_381_verify", |b| { + let generator = BLS12_381_G1_GENERATOR; + let message = bls12_381_hash_to_g2(HashFunction::Sha256, &BLS_MESSAGE, BLS_DST); + + b.iter(|| { + let is_equal = bls12_381_pairing_equality( + black_box(&BLS_PUBKEY), + &message, + &generator, + black_box(&BLS_SIGNATURE), + ) + .unwrap(); + + assert!(is_equal); + }); + }); +} + fn bench_crypto(c: &mut Criterion) { let mut group = c.benchmark_group("Crypto"); group.bench_function("secp256k1_verify", |b| { let message = hex::decode(COSMOS_SECP256K1_MSG_HEX).unwrap(); - let message_hash = Sha256::digest(&message); + let message_hash = Sha256::digest(message); let signature = hex::decode(COSMOS_SECP256K1_SIGNATURE_HEX).unwrap(); - let public_key = base64::decode(COSMOS_SECP256K1_PUBKEY_BASE64).unwrap(); + let public_key = hex::decode(COSMOS_SECP256K1_PUBKEY_HEX).unwrap(); b.iter(|| { assert!(secp256k1_verify(&message_hash, &signature, &public_key).unwrap()); }); @@ -94,7 +263,7 @@ fn bench_crypto(c: &mut Criterion) { let r_s = hex!("99e71a99cb2270b8cac5254f9e99b6210c6c10224a1579cf389ef88b20a1abe9129ff05af364204442bdb53ab6f18a99ab48acc9326fa689f228040429e3ca66"); let recovery_param: u8 = 0; - let expected = SigningKey::from_bytes(&private_key) + let expected = SigningKey::from_bytes(&private_key.into()) .unwrap() .verifying_key() .to_encoded_point(false) @@ -107,6 +276,32 @@ fn bench_crypto(c: &mut Criterion) { }); }); + group.bench_function("secp256r1_verify", |b| { + let message = hex::decode(COSMOS_SECP256R1_MSG_HEX).unwrap(); + let message_hash = Sha256::digest(message); + let signature = hex::decode(COSMOS_SECP256R1_SIGNATURE_HEX).unwrap(); + let public_key = hex::decode(COSMOS_SECP256R1_PUBKEY_HEX).unwrap(); + b.iter(|| { + assert!(secp256r1_verify(&message_hash, &signature, &public_key).unwrap()); + }); + }); + + group.bench_function("secp256r1_recover_pubkey", |b| { + let message_hash = + hex!("aea3e069e03c0ff4d6b3fa2235e0053bbedc4c7e40efbc686d4dfb5efba4cfed"); + let expected = + hex!("04105d22d9c626520faca13e7ced382dcbe93498315f00cc0ac39c4821d0d737376c47f3cbbfa97dfcebe16270b8c7d5d3a5900b888c42520d751e8faf3b401ef4"); + let r_s = hex!("542c40a18140a6266d6f0286e24e9a7bad7650e72ef0e2131e629c076d9626634f7f65305e24a6bbb5cff714ba8f5a2cee5bdc89ba8d75dcbf21966ce38eb66f"); + let recovery_param: u8 = 1; + + b.iter(|| { + let pubkey = secp256r1_recover_pubkey(&message_hash, &r_s, recovery_param).unwrap(); + assert_eq!(pubkey, expected); + }); + }); + + bench_bls(&mut group); + group.bench_function("ed25519_verify", |b| { let message = hex::decode(COSMOS_ED25519_MSG_HEX).unwrap(); let signature = hex::decode(COSMOS_ED25519_SIGNATURE_HEX).unwrap(); @@ -129,6 +324,7 @@ fn bench_crypto(c: &mut Criterion) { |b| { b.iter(|| { assert!(ed25519_batch_verify( + &mut OsRng, &messages[..n], &signatures[..n], &public_keys[..n] @@ -160,6 +356,7 @@ fn bench_crypto(c: &mut Criterion) { |b| { b.iter(|| { assert!(ed25519_batch_verify( + &mut OsRng, &messages.repeat(n), &signatures.repeat(n), &public_keys diff --git a/packages/crypto/src/backtrace.rs b/packages/crypto/src/backtrace.rs new file mode 100644 index 0000000000..56415bd9a1 --- /dev/null +++ b/packages/crypto/src/backtrace.rs @@ -0,0 +1,55 @@ +use alloc::boxed::Box; +use core::fmt::{Debug, Display, Formatter, Result}; + +/// This wraps an actual backtrace to achieve two things: +/// - being able to fill this with a stub implementation in `no_std` environments +/// - being able to use this in conjunction with [`thiserror::Error`] +pub struct BT(Box); + +impl BT { + #[track_caller] + pub fn capture() -> Self { + // in case of no_std, we can fill with a stub here + #[cfg(feature = "std")] + { + #[cfg(target_arch = "wasm32")] + return BT(Box::new(std::backtrace::Backtrace::disabled())); + #[cfg(not(target_arch = "wasm32"))] + return BT(Box::new(std::backtrace::Backtrace::capture())); + } + #[cfg(not(feature = "std"))] + { + BT(Box::new(Stub)) + } + } +} + +trait Printable: Debug + Display {} +impl Printable for T where T: Debug + Display {} + +impl Debug for BT { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + Debug::fmt(&self.0, f) + } +} + +impl Display for BT { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + Display::fmt(&self.0, f) + } +} + +#[allow(unused)] +struct Stub; + +impl Debug for Stub { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + write!(f, "") + } +} + +impl Display for Stub { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + write!(f, "") + } +} diff --git a/packages/crypto/src/bls12_381/aggregate.rs b/packages/crypto/src/bls12_381/aggregate.rs new file mode 100644 index 0000000000..35bc43c00b --- /dev/null +++ b/packages/crypto/src/bls12_381/aggregate.rs @@ -0,0 +1,241 @@ +use crate::{errors::Aggregation, CryptoError}; + +use super::points::{g1_from_fixed, g2_from_fixed, G1, G2}; + +const G1_POINT_SIZE: usize = 48; +const G2_POINT_SIZE: usize = 96; + +/// Takes a list of points in G1 (48 bytes each) and aggregates them. +/// +/// This is like Aggregate from +/// but works for signatures as well as public keys. +pub fn bls12_381_aggregate_g1(points: &[u8]) -> Result<[u8; 48], CryptoError> { + if points.is_empty() { + return Err(Aggregation::Empty.into()); + } else if points.len() % G1_POINT_SIZE != 0 { + return Err(Aggregation::NotMultiple { + expected_multiple: G1_POINT_SIZE, + remainder: points.len() % G1_POINT_SIZE, + } + .into()); + } + + let points_count = points.len() / G1_POINT_SIZE; + + use rayon::prelude::*; + + let points: Vec<[u8; 48]> = points + .chunks_exact(G1_POINT_SIZE) + .map(|data| { + let mut buf = [0u8; 48]; + buf[..].copy_from_slice(data); + buf + }) + .collect(); + + let mut decoded_points = Vec::with_capacity(points_count); + points + .par_iter() + .map(g1_from_fixed) + .collect_into_vec(&mut decoded_points); + + let out: Result, CryptoError> = decoded_points.into_iter().collect(); + let out = out?; + + let out = g1_sum(&out); + + Ok(out.to_compressed()) +} + +/// Takes a list of points in G2 (96 bytes each) and aggregates them. +/// +/// This is like Aggregate from +/// but works for signatures as well as public keys. +pub fn bls12_381_aggregate_g2(points: &[u8]) -> Result<[u8; 96], CryptoError> { + if points.is_empty() { + return Err(Aggregation::Empty.into()); + } else if points.len() % G2_POINT_SIZE != 0 { + return Err(Aggregation::NotMultiple { + expected_multiple: G2_POINT_SIZE, + remainder: points.len() % G2_POINT_SIZE, + } + .into()); + } + + let points_count = points.len() / G2_POINT_SIZE; + + use rayon::prelude::*; + + let points: Vec<[u8; 96]> = points + .chunks_exact(G2_POINT_SIZE) + .map(|data| { + let mut buf = [0u8; 96]; + buf[..].copy_from_slice(data); + buf + }) + .collect(); + + let mut decoded_points = Vec::with_capacity(points_count); + points + .par_iter() + .map(g2_from_fixed) + .collect_into_vec(&mut decoded_points); + + let out: Result, CryptoError> = decoded_points.into_iter().collect(); + let out = out?; + + let out = g2_sum(&out); + + Ok(out.to_compressed()) +} + +/// Creates a sum of points in G1. +/// +/// This is fast since math is done on projective points. Parallelization does not help here +/// for ~500 elements. +#[inline] +fn g1_sum(elements: &[G1]) -> G1 { + elements.iter().sum() +} + +/// Creates a sum of points in G2. +/// +/// This is fast since math is done on projective points. Parallelization does not help here +/// for ~500 elements. +#[inline] +fn g2_sum(elements: &[G2]) -> G2 { + elements.iter().sum() +} + +#[cfg(test)] +mod tests { + use super::super::points::{g1_from_variable, g1s_from_variable}; + use super::*; + use base64::engine::general_purpose::STANDARD; + use base64_serde::base64_serde_type; + use hex_literal::hex; + + base64_serde_type!(Base64Standard, STANDARD); + + #[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)] + struct EthPubkey(#[serde(with = "Base64Standard")] Vec); + + #[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)] + struct EthHeaders { + public_keys: Vec, + #[serde(with = "Base64Standard")] + message: Vec, + #[serde(with = "Base64Standard")] + signature: Vec, + #[serde(with = "Base64Standard")] + aggregate_pubkey: Vec, + } + + const ETH_HEADER_FILE: &str = + include_str!("../../testdata/eth-headers/1699693797.394876721s.json"); + + fn read_eth_header_file() -> EthHeaders { + serde_json::from_str(ETH_HEADER_FILE).unwrap() + } + + /// Arbitrary point in G1 + fn p1() -> G1 { + // Public key of classic League of Entropy Mainnet (curl -sS https://drand.cloudflare.com/info) + g1_from_fixed(&hex!("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31")).unwrap() + } + + /// Arbitrary point in G2 + fn p2() -> G2 { + g2_from_fixed(&hex!("b6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55")).unwrap() + } + + #[test] + fn bls12_381_aggregate_g1_empty_err() { + let res = bls12_381_aggregate_g1(b""); + assert!(res.is_err()); + } + + #[test] + fn bls12_381_aggregate_g2_empty_err() { + let res = bls12_381_aggregate_g2(b""); + assert!(res.is_err()); + } + + #[test] + fn g1_sum_works() { + // no elements + let sum = g1_sum(&[]); + assert_eq!(sum, G1::identity()); + + // one element + let sum = g1_sum(&[G1::identity()]); + assert_eq!(sum, G1::identity()); + let sum = g1_sum(&[p1()]); + assert_eq!(sum, p1()); + + { + let file = read_eth_header_file(); + + let pubkeys: Vec<&[u8]> = file.public_keys.iter().map(|m| m.0.as_slice()).collect(); + let points: Vec = g1s_from_variable(&pubkeys) + .into_iter() + .map(|res| res.unwrap()) + .collect(); + let expected_sum = g1_from_variable(&file.aggregate_pubkey).unwrap(); + let sum = g1_sum(&points); + assert_eq!(sum, expected_sum); + } + } + + #[test] + fn g2_sum_works() { + // no elements + let sum = g2_sum(&[]); + assert_eq!(sum, G2::identity()); + + // single + let sum = g2_sum(&[p2()]); + assert_eq!(sum, p2()); + + // multiple 1 + let a = g2_from_fixed(&hex!("b6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55")).unwrap(); + let b = g2_from_fixed(&hex!("b23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9")).unwrap(); + let c = g2_from_fixed(&hex!("948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115")).unwrap(); + let expected = g2_from_fixed(&hex!("9683b3e6701f9a4b706709577963110043af78a5b41991b998475a3d3fd62abf35ce03b33908418efc95a058494a8ae504354b9f626231f6b3f3c849dfdeaf5017c4780e2aee1850ceaf4b4d9ce70971a3d2cfcd97b7e5ecf6759f8da5f76d31")).unwrap(); + let sum = g2_sum(&[a.clone(), b.clone(), c.clone()]); + assert_eq!(sum, expected); + let sum = g2_sum(&[b.clone(), a.clone(), c.clone()]); + assert_eq!(sum, expected); + let sum = g2_sum(&[c.clone(), b.clone(), a.clone()]); + assert_eq!(sum, expected); + + // multiple 2 + let a = g2_from_fixed(&hex!("882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb")).unwrap(); + let b = g2_from_fixed(&hex!("af1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe")).unwrap(); + let c = g2_from_fixed(&hex!("a4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6")).unwrap(); + let expected = g2_from_fixed(&hex!("ad38fc73846583b08d110d16ab1d026c6ea77ac2071e8ae832f56ac0cbcdeb9f5678ba5ce42bd8dce334cc47b5abcba40a58f7f1f80ab304193eb98836cc14d8183ec14cc77de0f80c4ffd49e168927a968b5cdaa4cf46b9805be84ad7efa77b")).unwrap(); + let sum = g2_sum(&[a.clone(), b.clone(), c.clone()]); + assert_eq!(sum, expected); + let sum = g2_sum(&[b.clone(), a.clone(), c.clone()]); + assert_eq!(sum, expected); + let sum = g2_sum(&[c.clone(), b.clone(), a.clone()]); + assert_eq!(sum, expected); + + // multiple 3 + let a = g2_from_fixed(&hex!("91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121")).unwrap(); + let b = g2_from_fixed(&hex!("9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df")).unwrap(); + let c = g2_from_fixed(&hex!("ae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9")).unwrap(); + let expected = g2_from_fixed(&hex!("9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930")).unwrap(); + let sum = g2_sum(&[a.clone(), b.clone(), c.clone()]); + assert_eq!(sum, expected); + let sum = g2_sum(&[b.clone(), a.clone(), c.clone()]); + assert_eq!(sum, expected); + let sum = g2_sum(&[c.clone(), b.clone(), a.clone()]); + assert_eq!(sum, expected); + + // infinity + let inf = g2_from_fixed(&hex!("c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")).unwrap(); + let sum = g2_sum(&[inf.clone()]); + assert_eq!(sum, inf); + } +} diff --git a/packages/crypto/src/bls12_381/constants.rs b/packages/crypto/src/bls12_381/constants.rs new file mode 100644 index 0000000000..67e58adeb3 --- /dev/null +++ b/packages/crypto/src/bls12_381/constants.rs @@ -0,0 +1,62 @@ +#[cfg(test)] +mod test { + use ark_bls12_381::{G1Affine, G2Affine}; + use ark_ec::AffineRepr; + use ark_serialize::CanonicalSerialize; + use hex_literal::hex; + + use cosmwasm_core::{ + BLS12_381_G1_GENERATOR, BLS12_381_G1_POINT_LEN, BLS12_381_G2_GENERATOR, + BLS12_381_G2_POINT_LEN, + }; + + fn bls12_381_g1_generator() -> [u8; BLS12_381_G1_POINT_LEN] { + let mut point = [0_u8; BLS12_381_G1_POINT_LEN]; + G1Affine::generator() + .serialize_compressed(&mut point[..]) + .unwrap(); + + point + } + + fn bls12_381_g2_generator() -> [u8; BLS12_381_G2_POINT_LEN] { + let mut point = [0_u8; BLS12_381_G2_POINT_LEN]; + G2Affine::generator() + .serialize_compressed(&mut point[..]) + .unwrap(); + + point + } + + // Note about the bitwise OR operation on the X coordinates: + // + // The first bit of the x-coordinate sets the "compression" flag. The most significant three bits of a G1/G2 coordinate are used for storing some information. + // If we didn't do that to the output, the constants wouldn't check out due to the constants being constructed by a standard adhereing BLS library, + // where it set the compression flag since it's the standard way of serializing the points. + // + // Ref: https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization + + #[test] + fn g1_generator_correct() { + // Source: + // + // See the `x` coordinate + let mut generator = hex!("17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb"); + generator[0] |= 0b1000_0000; + assert_eq!(generator, bls12_381_g1_generator()); + assert_eq!(bls12_381_g1_generator(), BLS12_381_G1_GENERATOR); + } + + #[test] + fn g2_generator_correct() { + // Source: + // + // $$ + // G2_{raw} = x'_1 || x'_0 + // $$ + let mut generator = hex!("13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8"); + generator[0] |= 0b1000_0000; + assert_eq!(generator, bls12_381_g2_generator()); + assert_eq!(bls12_381_g2_generator(), BLS12_381_G2_GENERATOR); + } +} diff --git a/packages/crypto/src/bls12_381/hash.rs b/packages/crypto/src/bls12_381/hash.rs new file mode 100644 index 0000000000..917894abf6 --- /dev/null +++ b/packages/crypto/src/bls12_381/hash.rs @@ -0,0 +1,123 @@ +//! +//! Note about the usage of `.unwrap()` here: +//! +//! Since the underlying curve implementation, when implemented sanely, should never request 255 curve elements at the same time, +//! the expansion will always finish without exiting with an error (since that is the only "ABORT" condition). +//! +//! Therefore we can conclude, if the implementation is done as defined in the IETF publication, won't ever error out. +//! +//! IETF doc in question: +//! +//! In addition to that I (@aumetra) skimmed through the tree of traits making up our hash-to-curve configuration, +//! and I have not found a condition where an error is returned. +//! +//! ark crate versions that I looked at: +//! +//! - ark-bls12-381 v0.4.0 +//! - ark-ec v0.4.2 +//! - ark-ff v0.4.2 +//! + +use ark_bls12_381::{g1, g2}; +use ark_ec::{ + hashing::{ + curve_maps::wb::WBMap, map_to_curve_hasher::MapToCurveBasedHasher, HashToCurve as _, + }, + short_weierstrass::Projective, +}; +use ark_ff::field_hashers::DefaultFieldHasher; +use ark_serialize::CanonicalSerialize; +use cosmwasm_core::{BLS12_381_G1_POINT_LEN, BLS12_381_G2_POINT_LEN}; +use sha2::Sha256; + +use crate::CryptoError; + +type HashToCurve = + MapToCurveBasedHasher, DefaultFieldHasher, WBMap>; + +#[derive(Clone, Copy, Debug)] +#[non_exhaustive] +pub enum HashFunction { + Sha256 = 0, +} + +#[doc(hidden)] +impl HashFunction { + pub fn from_u32(idx: u32) -> Result { + let hash = match idx { + 0 => Self::Sha256, + _ => return Err(CryptoError::unknown_hash_function()), + }; + + Ok(hash) + } +} + +pub fn bls12_381_hash_to_g1( + hash: HashFunction, + msg: &[u8], + dst: &[u8], +) -> [u8; BLS12_381_G1_POINT_LEN] { + let point = match hash { + HashFunction::Sha256 => HashToCurve::::new(dst) + .unwrap() + .hash(msg) + .unwrap(), + }; + + let mut serialized = [0; BLS12_381_G1_POINT_LEN]; + point.serialize_compressed(&mut serialized[..]).unwrap(); + serialized +} + +pub fn bls12_381_hash_to_g2( + hash: HashFunction, + msg: &[u8], + dst: &[u8], +) -> [u8; BLS12_381_G2_POINT_LEN] { + let point = match hash { + HashFunction::Sha256 => HashToCurve::::new(dst) + .unwrap() + .hash(msg) + .unwrap(), + }; + + let mut serialized = [0; BLS12_381_G2_POINT_LEN]; + point.serialize_compressed(&mut serialized[..]).unwrap(); + serialized +} + +#[cfg(test)] +mod test { + use hex_literal::hex; + + use crate::{bls12_381_hash_to_g1, bls12_381_hash_to_g2, HashFunction}; + + #[test] + fn hash_to_g1_works() { + // See: ; Section J.9.1 + + let msg = b"abc"; + let dst = b"QUUX-V01-CS02-with-BLS12381G1_XMD:SHA-256_SSWU_RO_"; + + let hashed_point = bls12_381_hash_to_g1(HashFunction::Sha256, msg, dst); + let mut serialized_expected_compressed = hex!("03567bc5ef9c690c2ab2ecdf6a96ef1c139cc0b2f284dca0a9a7943388a49a3aee664ba5379a7655d3c68900be2f6903"); + // Set the compression tag + serialized_expected_compressed[0] |= 0b1000_0000; + + assert_eq!(hashed_point, serialized_expected_compressed); + } + + #[test] + fn hash_to_g2_works() { + let msg = b"abc"; + let dst = b"QUUX-V01-CS02-with-BLS12381G2_XMD:SHA-256_SSWU_RO_"; + + let hashed_point = bls12_381_hash_to_g2(HashFunction::Sha256, msg, dst); + let mut serialized_expected_compressed = hex!("139cddbccdc5e91b9623efd38c49f81a6f83f175e80b06fc374de9eb4b41dfe4ca3a230ed250fbe3a2acf73a41177fd802c2d18e033b960562aae3cab37a27ce00d80ccd5ba4b7fe0e7a210245129dbec7780ccc7954725f4168aff2787776e6"); + // Set the compression tag + serialized_expected_compressed[0] |= 0b1000_0000; + + assert_eq!(hashed_point, serialized_expected_compressed); + } +} diff --git a/packages/crypto/src/bls12_381/mod.rs b/packages/crypto/src/bls12_381/mod.rs new file mode 100644 index 0000000000..fb3b32ad69 --- /dev/null +++ b/packages/crypto/src/bls12_381/mod.rs @@ -0,0 +1,10 @@ +mod aggregate; +mod constants; +mod hash; +mod pairing; +mod points; + +pub use self::aggregate::{bls12_381_aggregate_g1, bls12_381_aggregate_g2}; +pub use self::hash::{bls12_381_hash_to_g1, bls12_381_hash_to_g2, HashFunction}; +pub use self::pairing::bls12_381_pairing_equality; +pub use self::points::{bls12_381_g1_is_identity, bls12_381_g2_is_identity}; diff --git a/packages/crypto/src/bls12_381/pairing.rs b/packages/crypto/src/bls12_381/pairing.rs new file mode 100644 index 0000000000..8fe615aaf6 --- /dev/null +++ b/packages/crypto/src/bls12_381/pairing.rs @@ -0,0 +1,234 @@ +use core::ops::Neg; + +use super::points::{g1_from_variable, g2_from_variable}; +use crate::{errors::PairingEquality, CryptoError}; + +use ark_bls12_381::Bls12_381; +use ark_ec::{ + bls12::{G1Prepared, G2Prepared}, + pairing::Pairing, +}; +use cosmwasm_core::{BLS12_381_G1_POINT_LEN, BLS12_381_G2_POINT_LEN}; +use num_traits::Zero; +use rayon::{ + iter::{IndexedParallelIterator, ParallelIterator}, + slice::ParallelSlice, +}; + +pub fn bls12_381_pairing_equality( + ps: &[u8], + qs: &[u8], + r: &[u8], + s: &[u8], +) -> Result { + if ps.len() % BLS12_381_G1_POINT_LEN != 0 { + return Err(PairingEquality::NotMultipleG1 { + remainder: ps.len() % BLS12_381_G1_POINT_LEN, + } + .into()); + } else if qs.len() % BLS12_381_G2_POINT_LEN != 0 { + return Err(PairingEquality::NotMultipleG2 { + remainder: qs.len() % BLS12_381_G2_POINT_LEN, + } + .into()); + } else if (ps.len() / BLS12_381_G1_POINT_LEN) != (qs.len() / BLS12_381_G2_POINT_LEN) { + return Err(PairingEquality::UnequalPointAmount { + left: ps.len() / BLS12_381_G1_POINT_LEN, + right: qs.len() / BLS12_381_G2_POINT_LEN, + } + .into()); + } + + let p_iter = ps + .par_chunks_exact(BLS12_381_G1_POINT_LEN) + .map(g1_from_variable) + .chain([g1_from_variable(r).map(Neg::neg)]) + .map(|g1_res| g1_res.map(|g1| G1Prepared::from(g1.0))); + + let q_iter = qs + .par_chunks_exact(BLS12_381_G2_POINT_LEN) + .map(g2_from_variable) + .chain([g2_from_variable(s)]) + .map(|g2_res| g2_res.map(|g2| G2Prepared::from(g2.0))); + + let pq_pairs: Vec<_> = p_iter + .zip_eq(q_iter) + .map(|(p_res, q_res)| Ok((p_res?, q_res?))) + .collect::>()?; + + let (ps, qs): (Vec<_>, Vec<_>) = pq_pairs.into_iter().unzip(); + + Ok(Bls12_381::multi_pairing(ps, qs).is_zero()) +} + +#[cfg(test)] +mod test { + use hex_literal::hex; + use sha2::{Digest, Sha256}; + + use crate::{ + bls12_381::points::{g1_from_fixed, g2_from_fixed, g2_from_variable, G1}, + bls12_381_hash_to_g2, bls12_381_pairing_equality, CryptoError, HashFunction, + PairingEqualityError, + }; + + // Let's directly go for something really cool and advanced: + // dRand compatibility of this API + + // See https://github.com/drand/kyber-bls12381/issues/22 and + // https://github.com/drand/drand/pull/1249 + const DOMAIN_HASH_TO_G2: &[u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_"; + + /// Public key League of Entropy Mainnet (curl -sS https://drand.cloudflare.com/info) + const PK_LEO_MAINNET: [u8; 48] = hex!("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31"); + + /// The identity of G1 (the point at infinity). + /// + /// See https://docs.rs/bls12_381/latest/bls12_381/notes/serialization/index.html for encoding info. + const G1_IDENTITY: [u8; 48] = [ + 0b11000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ]; + + /// The identity of G2 (the point at infinity). + /// + /// See https://docs.rs/bls12_381/latest/bls12_381/notes/serialization/index.html for encoding info. + const G2_IDENTITY: [u8; 96] = [ + 0b11000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, + ]; + + fn build_message(round: u64, previous_signature: &[u8]) -> digest::Output { + Sha256::new() + .chain_update(previous_signature) + .chain_update(round.to_be_bytes()) + .finalize() + } + + #[test] + fn pairing_equality_works() { + let previous_signature = hex::decode("a609e19a03c2fcc559e8dae14900aaefe517cb55c840f6e69bc8e4f66c8d18e8a609685d9917efbfb0c37f058c2de88f13d297c7e19e0ab24813079efe57a182554ff054c7638153f9b26a60e7111f71a0ff63d9571704905d3ca6df0b031747").unwrap(); + let signature = hex::decode("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42").unwrap(); + let round: u64 = 72785; + + let key = g1_from_fixed(&PK_LEO_MAINNET).unwrap(); + let sigma = g2_from_variable(&signature).unwrap(); + let g1 = G1::generator(); + let msg = build_message(round, &previous_signature); + let g2_msg = bls12_381_hash_to_g2(HashFunction::Sha256, msg.as_slice(), DOMAIN_HASH_TO_G2); + + assert!(bls12_381_pairing_equality( + &g1.to_compressed(), + &sigma.to_compressed(), + &PK_LEO_MAINNET, + &g2_msg + ) + .unwrap()); + + // Do this in a separate scope to not shadow with wrong values + { + // Wrong round -> Therefore wrong hashed G2 point + #[allow(clippy::unusual_byte_groupings)] + let msg = build_message(0xDEAD_2_BAD, &previous_signature); + let g2_msg = + bls12_381_hash_to_g2(HashFunction::Sha256, msg.as_slice(), DOMAIN_HASH_TO_G2); + + assert!(!bls12_381_pairing_equality( + &g1.to_compressed(), + &sigma.to_compressed(), + &PK_LEO_MAINNET, + &g2_msg + ) + .unwrap()); + } + + // curl -sS https://drand.cloudflare.com/public/1 + let previous_signature = + hex::decode("176f93498eac9ca337150b46d21dd58673ea4e3581185f869672e59fa4cb390a") + .unwrap(); + let signature = hex::decode("8d61d9100567de44682506aea1a7a6fa6e5491cd27a0a0ed349ef6910ac5ac20ff7bc3e09d7c046566c9f7f3c6f3b10104990e7cb424998203d8f7de586fb7fa5f60045417a432684f85093b06ca91c769f0e7ca19268375e659c2a2352b4655").unwrap(); + let round: u64 = 1; + + // Aggregate things down + let aggregated_key = &key + &key; + let aggregated_sigma = &sigma + &g2_from_variable(&signature).unwrap(); + let aggregated_g1 = &g1 + &g1; + let aggregated_msg = &g2_from_fixed(&g2_msg).unwrap() + + &g2_from_fixed(&bls12_381_hash_to_g2( + HashFunction::Sha256, + build_message(round, &previous_signature).as_slice(), + DOMAIN_HASH_TO_G2, + )) + .unwrap(); + + assert!(bls12_381_pairing_equality( + &aggregated_g1.to_compressed(), + &aggregated_sigma.to_compressed(), + &aggregated_key.to_compressed(), + &aggregated_msg.to_compressed() + ) + .unwrap()); + } + + /// This tests 1 == e(a, b) as there is no term on the left-hand side. + /// This is true for `a` or `b` being the point at infinity. See + /// https://eips.ethereum.org/EIPS/eip-2537#test-cases + #[test] + fn pairing_equality_works_for_empty_lhs() { + // a and b not point at infinity (Non-degeneracy) + let a = PK_LEO_MAINNET; + let b = bls12_381_hash_to_g2(HashFunction::Sha256, b"blub", DOMAIN_HASH_TO_G2); + let equal = bls12_381_pairing_equality(&[], &[], &a, &b).unwrap(); + assert!(!equal); + + // a point at infinity + let a = G1_IDENTITY; + let b = bls12_381_hash_to_g2(HashFunction::Sha256, b"blub", DOMAIN_HASH_TO_G2); + let equal = bls12_381_pairing_equality(&[], &[], &a, &b).unwrap(); + assert!(equal); + + // b point at infinity + let a = PK_LEO_MAINNET; + let b = G2_IDENTITY; + let equal = bls12_381_pairing_equality(&[], &[], &a, &b).unwrap(); + assert!(equal); + + // a and b point at infinity + let a = G1_IDENTITY; + let b = G2_IDENTITY; + let equal = bls12_381_pairing_equality(&[], &[], &a, &b).unwrap(); + assert!(equal); + } + + #[test] + fn pairing_equality_error_cases_work() { + let result = bls12_381_pairing_equality(&[12], &[0; 96], &[12], &[12]); + assert!(matches!( + result, + Err(CryptoError::PairingEquality { + source: PairingEqualityError::NotMultipleG1 { remainder: 1 }, + .. + }) + )); + + let result = bls12_381_pairing_equality(&[0; 48], &[12], &[12], &[12]); + assert!(matches!( + result, + Err(CryptoError::PairingEquality { + source: PairingEqualityError::NotMultipleG2 { remainder: 1 }, + .. + }) + )); + + let result = bls12_381_pairing_equality(&[0; 96], &[0; 96], &[12], &[12]); + assert!(matches!( + result, + Err(CryptoError::PairingEquality { + source: PairingEqualityError::UnequalPointAmount { left: 2, right: 1 }, + .. + }) + )); + } +} diff --git a/packages/crypto/src/bls12_381/points.rs b/packages/crypto/src/bls12_381/points.rs new file mode 100644 index 0000000000..9264fc9e9a --- /dev/null +++ b/packages/crypto/src/bls12_381/points.rs @@ -0,0 +1,314 @@ +#![allow(unused)] + +use alloc::vec::Vec; +use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; +use core::ops::Add; +use core::{fmt, ops::Neg}; + +use ark_bls12_381::{G1Affine, G1Projective, G2Affine, G2Projective}; +use ark_ec::AffineRepr; +use cosmwasm_core::{BLS12_381_G1_POINT_LEN, BLS12_381_G2_POINT_LEN}; +use num_traits::Zero; + +use crate::{errors::InvalidPoint, CryptoError}; + +/// Point on G1 +#[derive(Debug, PartialEq, Clone)] +pub struct G1(pub(crate) G1Affine); + +impl G1 { + /// Creates the generator in G1 + #[inline] + pub fn generator() -> Self { + Self(G1Affine::generator()) + } + + /// Creates the identity element in G1 (point at infinity) + #[inline] + pub fn identity() -> Self { + Self(G1Affine::identity()) + } + + /// Check if the point is the identity element + #[inline] + pub fn is_identity(&self) -> bool { + self.0.is_zero() + } + + #[inline] + pub fn to_compressed(&self) -> [u8; BLS12_381_G1_POINT_LEN] { + let mut serialized = [0; BLS12_381_G1_POINT_LEN]; + self.0.serialize_compressed(&mut serialized[..]).unwrap(); + serialized + } +} + +impl Add<&G1> for &G1 { + type Output = G1; + + fn add(self, rhs: &G1) -> G1 { + let sum = self.0 + G1Projective::from(rhs.0); + G1(sum.into()) + } +} + +impl Neg for G1 { + type Output = G1; + + fn neg(self) -> Self::Output { + G1(-self.0) + } +} + +impl<'a> core::iter::Sum<&'a G1> for G1 { + fn sum>(iter: I) -> Self { + let zero = G1Projective::zero(); + let sum = iter.fold(zero, |acc, next| acc + G1Projective::from(next.0)); + G1(sum.into()) + } +} + +/// Point on G2 +#[derive(Debug, PartialEq, Clone)] +pub struct G2(pub(crate) G2Affine); + +impl G2 { + /// Creates the generator in G2 + #[inline] + pub fn generator() -> Self { + Self(G2Affine::generator()) + } + + /// Creates the identity element in G2 (point at infinity) + #[inline] + pub fn identity() -> Self { + Self(G2Affine::identity()) + } + + /// Check if the point is the identity element + #[inline] + pub fn is_identity(&self) -> bool { + self.0.is_zero() + } + + #[inline] + pub fn to_compressed(&self) -> [u8; BLS12_381_G2_POINT_LEN] { + let mut serialized = [0; BLS12_381_G2_POINT_LEN]; + self.0.serialize_compressed(&mut serialized[..]).unwrap(); + serialized + } +} + +impl Add<&G2> for &G2 { + type Output = G2; + + fn add(self, rhs: &G2) -> Self::Output { + [self, rhs].into_iter().sum() + } +} + +impl<'a> core::iter::Sum<&'a G2> for G2 { + fn sum>(iter: I) -> Self { + let zero = G2Projective::zero(); + let sum = iter.fold(zero, |acc, next| acc + G2Projective::from(next.0)); + G2(sum.into()) + } +} + +pub fn g1_from_variable(data: &[u8]) -> Result { + if data.len() != BLS12_381_G1_POINT_LEN { + return Err(InvalidPoint::InvalidLength { + expected: BLS12_381_G1_POINT_LEN, + actual: data.len(), + } + .into()); + } + + let mut buf = [0u8; BLS12_381_G1_POINT_LEN]; + buf[..].copy_from_slice(data); + g1_from_fixed(&buf) +} + +pub fn g1s_from_variable(data_list: &[&[u8]]) -> Vec> { + use rayon::prelude::*; + let mut out = Vec::with_capacity(data_list.len()); + data_list + .par_iter() + .map(|&data| g1_from_variable(data)) + .collect_into_vec(&mut out); + out +} + +pub fn g2_from_variable(data: &[u8]) -> Result { + if data.len() != BLS12_381_G2_POINT_LEN { + return Err(InvalidPoint::InvalidLength { + expected: BLS12_381_G2_POINT_LEN, + actual: data.len(), + } + .into()); + } + + let mut buf = [0u8; BLS12_381_G2_POINT_LEN]; + buf[..].copy_from_slice(data); + g2_from_fixed(&buf) +} + +pub fn g1_from_fixed(data: &[u8; BLS12_381_G1_POINT_LEN]) -> Result { + G1Affine::deserialize_compressed(&data[..]) + .ok() + .map(G1) + .ok_or_else(|| InvalidPoint::DecodingError {}.into()) +} + +/// Like [`g1_from_fixed`] without guaranteeing that the encoding represents a valid element. +/// Only use this when you know for sure the encoding is correct. +pub fn g1_from_fixed_unchecked(data: [u8; BLS12_381_G1_POINT_LEN]) -> Result { + G1Affine::deserialize_compressed_unchecked(&data[..]) + .ok() + .map(G1) + .ok_or_else(|| InvalidPoint::DecodingError {}.into()) +} + +pub fn g2_from_fixed(data: &[u8; BLS12_381_G2_POINT_LEN]) -> Result { + G2Affine::deserialize_compressed(&data[..]) + .ok() + .map(G2) + .ok_or_else(|| InvalidPoint::DecodingError {}.into()) +} + +/// Like [`g2_from_fixed`] without guaranteeing that the encoding represents a valid element. +/// Only use this when you know for sure the encoding is correct. +pub fn g2_from_fixed_unchecked(data: [u8; BLS12_381_G2_POINT_LEN]) -> Result { + G2Affine::deserialize_compressed_unchecked(&data[..]) + .ok() + .map(G2) + .ok_or_else(|| InvalidPoint::DecodingError {}.into()) +} + +pub fn bls12_381_g1_is_identity(g1: &[u8; BLS12_381_G1_POINT_LEN]) -> Result { + g1_from_fixed(g1).map(|point| point.is_identity()) +} + +pub fn bls12_381_g2_is_identity(g2: &[u8; BLS12_381_G2_POINT_LEN]) -> Result { + g2_from_fixed(g2).map(|point| point.is_identity()) +} + +#[cfg(test)] +mod tests { + use super::*; + + use cosmwasm_core::{BLS12_381_G1_GENERATOR, BLS12_381_G2_GENERATOR}; + use hex_literal::hex; + + #[test] + fn g1_generator_works() { + let generator = G1::generator(); + assert_eq!(generator.to_compressed(), BLS12_381_G1_GENERATOR); + } + + #[test] + fn g2_generator_works() { + let generator = G2::generator(); + assert_eq!(generator.to_compressed(), BLS12_381_G2_GENERATOR); + } + + #[test] + fn g1_from_variable_works() { + let result = g1_from_variable(&hex::decode("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31").unwrap()); + assert!(result.is_ok()); + + let result = g1_from_variable(&hex::decode("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af").unwrap()); + match result.unwrap_err() { + CryptoError::InvalidPoint { + source: InvalidPoint::InvalidLength { expected, actual }, + .. + } => { + assert_eq!(expected, 48); + assert_eq!(actual, 47); + } + err => panic!("Unexpected error: {:?}", err), + } + } + + #[test] + fn g2_from_variable_works() { + let result = g2_from_variable(&hex::decode("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42").unwrap()); + assert!(result.is_ok()); + + let result = g2_from_variable(&hex::decode("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e").unwrap()); + match result.unwrap_err() { + CryptoError::InvalidPoint { + source: InvalidPoint::InvalidLength { expected, actual }, + .. + } => { + assert_eq!(expected, 96); + assert_eq!(actual, 95); + } + err => panic!("Unexpected error: {:?}", err), + } + } + + #[test] + fn g1_from_fixed_works() { + let result = g1_from_fixed(&hex_literal::hex!("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31")); + assert!(result.is_ok()); + + let result = g1_from_fixed(&hex_literal::hex!("118f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31")); + match result.unwrap_err() { + CryptoError::InvalidPoint { + source: InvalidPoint::DecodingError {}, + .. + } => {} + err => panic!("Unexpected error: {:?}", err), + } + + let result = g1_from_fixed(&hex_literal::hex!("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af22")); + match result.unwrap_err() { + CryptoError::InvalidPoint { + source: InvalidPoint::DecodingError {}, + .. + } => {} + err => panic!("Unexpected error: {:?}", err), + } + } + + #[test] + fn g1_from_fixed_unchecked_works() { + let data = hex!("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31"); + let a = g1_from_fixed_unchecked(data).unwrap(); + let b = g1_from_fixed(&data).unwrap(); + assert_eq!(a, b); + } + + #[test] + fn g2_from_fixed_works() { + let result = g2_from_fixed(&hex_literal::hex!("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42")); + assert!(result.is_ok()); + + let result = g2_from_fixed(&hex_literal::hex!("11f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42")); + match result.unwrap_err() { + CryptoError::InvalidPoint { + source: InvalidPoint::DecodingError {}, + .. + } => {} + err => panic!("Unexpected error: {:?}", err), + } + + let result = g2_from_fixed(&hex_literal::hex!("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e44")); + match result.unwrap_err() { + CryptoError::InvalidPoint { + source: InvalidPoint::DecodingError {}, + .. + } => {} + err => panic!("Unexpected error: {:?}", err), + } + } + + #[test] + fn g2_from_fixed_unchecked_works() { + let data = hex!("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42"); + let a = g2_from_fixed_unchecked(data).unwrap(); + let b = g2_from_fixed(&data).unwrap(); + assert_eq!(a, b); + } +} diff --git a/packages/crypto/src/ecdsa.rs b/packages/crypto/src/ecdsa.rs new file mode 100644 index 0000000000..53778a6d1d --- /dev/null +++ b/packages/crypto/src/ecdsa.rs @@ -0,0 +1,15 @@ +/// Max length of a message hash for secp256k1 verification in bytes. +/// This is typically a 32 byte output of e.g. SHA-256 or Keccak256. In theory shorter values +/// are possible but currently not supported by the implementation. Let us know when you need them. +pub const MESSAGE_HASH_MAX_LEN: usize = 32; + +/// ECDSA (secp256k1) parameters +/// Length of a serialized signature +pub const ECDSA_SIGNATURE_LEN: usize = 64; + +/// Length of a serialized compressed public key +pub(crate) const ECDSA_COMPRESSED_PUBKEY_LEN: usize = 33; +/// Length of a serialized uncompressed public key +pub(crate) const ECDSA_UNCOMPRESSED_PUBKEY_LEN: usize = 65; +/// Max length of a serialized public key +pub const ECDSA_PUBKEY_MAX_LEN: usize = ECDSA_UNCOMPRESSED_PUBKEY_LEN; diff --git a/packages/crypto/src/ed25519.rs b/packages/crypto/src/ed25519.rs index c53449cd8d..90ac9fe090 100644 --- a/packages/crypto/src/ed25519.rs +++ b/packages/crypto/src/ed25519.rs @@ -1,5 +1,5 @@ use ed25519_zebra::{batch, Signature, VerificationKey}; -use rand_core::OsRng; +use rand_core::CryptoRngCore; use crate::errors::{CryptoError, CryptoResult}; @@ -12,7 +12,7 @@ pub const EDDSA_PUBKEY_LEN: usize = 32; /// using the ed25519 elliptic curve digital signature parametrization / algorithm. /// /// The maximum currently supported message length is 4096 bytes. -/// The signature and public key are in [Tendermint](https://docs.tendermint.com/v0.32/spec/blockchain/encoding.html#public-key-cryptography) +/// The signature and public key are in [Tendermint](https://github.com/tendermint/tendermint/blob/v0.32.x/docs/spec/blockchain/encoding.md#public-key-cryptography) /// format: /// - signature: raw ED25519 signature (64 bytes). /// - public key: raw ED25519 public key (32 bytes). @@ -45,26 +45,28 @@ pub fn ed25519_verify(message: &[u8], signature: &[u8], public_key: &[u8]) -> Cr /// In the limiting case where all signatures in the batch are made with the same verification key, /// coalesced batch verification runs twice as fast as ordinary batch verification. /// -/// Three Variants are suppported in the input for convenience: +/// Three Variants are supported in the input for convenience: /// - Equal number of messages, signatures, and public keys: Standard, generic functionality. /// - One message, and an equal number of signatures and public keys: Multiple digital signature -/// (multisig) verification of a single message. +/// (multisig) verification of a single message. /// - One public key, and an equal number of messages and signatures: Verification of multiple -/// messages, all signed with the same private key. +/// messages, all signed with the same private key. /// /// Any other variants of input vectors result in an error. /// /// Notes: -/// - The "one-message, with zero signatures and zero public keys" case, is considered the empty -/// case. -/// - The "one-public key, with zero messages and zero signatures" case, is considered the empty -/// case. +/// - The "one-message, with zero signatures and zero public keys" case, is considered the empty case. +/// - The "one-public key, with zero messages and zero signatures" case, is considered the empty case. /// - The empty case (no messages, no signatures and no public keys) returns true. -pub fn ed25519_batch_verify( +pub fn ed25519_batch_verify( + rng: &mut R, messages: &[&[u8]], signatures: &[&[u8]], public_keys: &[&[u8]], -) -> CryptoResult { +) -> CryptoResult +where + R: CryptoRngCore, +{ // Structural checks let messages_len = messages.len(); let signatures_len = signatures.len(); @@ -98,12 +100,12 @@ pub fn ed25519_batch_verify( let signature = read_signature(signature)?; let pubkey = read_pubkey(public_key)?; - // Enqueing + // Enqueuing batch.queue((pubkey.into(), signature.into(), message)); } // Batch verification - match batch.verify(OsRng) { + match batch.verify(rng) { Ok(()) => Ok(true), Err(_) => Ok(false), } @@ -138,7 +140,9 @@ fn read_pubkey(data: &[u8]) -> Result<[u8; 32], InvalidEd25519PubkeyFormat> { #[cfg(test)] mod tests { use super::*; + use alloc::{string::String, vec, vec::Vec}; use ed25519_zebra::SigningKey; + use rand_core::OsRng; use serde::Deserialize; // For generic signature verification @@ -253,8 +257,7 @@ mod tests { // ed25519_verify() works assert!( ed25519_verify(&message, &signature, &public_key).unwrap(), - "verify() failed (test case {})", - i + "verify() failed (test case {i})" ); } } @@ -283,7 +286,7 @@ mod tests { let public_keys: Vec<&[u8]> = public_keys.iter().map(|m| m.as_slice()).collect(); // ed25519_batch_verify() works - assert!(ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); } // structural tests @@ -294,7 +297,7 @@ mod tests { let public_keys: Vec<&[u8]> = vec![]; // ed25519_batch_verify() works for empty msgs / sigs / pubkeys - assert!(ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); } #[test] @@ -321,12 +324,12 @@ mod tests { let mut public_keys: Vec<&[u8]> = public_keys.iter().map(|m| m.as_slice()).collect(); // Check the whole set passes - assert!(ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); // Remove one message let msg = messages.pop().unwrap(); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -341,7 +344,7 @@ mod tests { // Remove one signature let sig = signatures.pop().unwrap(); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -356,7 +359,7 @@ mod tests { // Remove one public key let pubkey = public_keys.pop().unwrap(); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -371,7 +374,7 @@ mod tests { // Add one message messages.push(messages[0]); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -385,7 +388,7 @@ mod tests { // Add one signature signatures.push(signatures[0]); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -399,7 +402,7 @@ mod tests { // Add one public keys public_keys.push(public_keys[0]); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -433,18 +436,18 @@ mod tests { let mut public_keys: Vec<&[u8]> = public_keys.iter().map(|m| m.as_slice()).collect(); // Check the whole set passes - assert!(ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); // Just one message messages.truncate(1); // Check (in passing) this fails verification - assert!(!ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(!ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); // Remove one sig let sig = signatures.pop().unwrap(); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -459,7 +462,7 @@ mod tests { // Remove one public key let pubkey = public_keys.pop().unwrap(); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -496,18 +499,18 @@ mod tests { let mut public_keys: Vec<&[u8]> = public_keys.iter().map(|m| m.as_slice()).collect(); // Check the whole set passes - assert!(ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); // Just one public key public_keys.truncate(1); // Check (in passing) this fails verification - assert!(!ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(!ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); // Remove one sig let sig = signatures.pop().unwrap(); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -522,7 +525,7 @@ mod tests { // Remove one msg let msg = messages.pop().unwrap(); - let res = ed25519_batch_verify(&messages, &signatures, &public_keys); + let res = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); match res.unwrap_err() { CryptoError::BatchErr { msg, .. } => assert_eq!( msg, @@ -552,7 +555,7 @@ mod tests { let messages: Vec<&[u8]> = messages.iter().map(|m| m.as_slice()).collect(); // ed25519_batch_verify() works for empty sigs / pubkeys - assert!(ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); } #[test] @@ -572,6 +575,6 @@ mod tests { let public_keys: Vec<&[u8]> = public_keys.iter().map(|m| m.as_slice()).collect(); // ed25519_batch_verify() works for empty msgs / sigs - assert!(ed25519_batch_verify(&messages, &signatures, &public_keys).unwrap()); + assert!(ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys).unwrap()); } } diff --git a/packages/crypto/src/errors.rs b/packages/crypto/src/errors.rs index b48f154ed0..e4b85cc92a 100644 --- a/packages/crypto/src/errors.rs +++ b/packages/crypto/src/errors.rs @@ -1,88 +1,108 @@ -#[cfg(feature = "backtraces")] -use std::backtrace::Backtrace; -use std::fmt::Debug; -use thiserror::Error; +use alloc::string::String; +use core::fmt::Debug; + +use crate::BT; pub type CryptoResult = core::result::Result; -#[derive(Error, Debug)] +#[derive(Debug, thiserror::Error)] +pub enum Aggregation { + #[error("List of points is empty")] + Empty, + #[error("List is not a multiple of {expected_multiple}. Remainder: {remainder}")] + NotMultiple { + expected_multiple: usize, + remainder: usize, + }, +} + +#[derive(Debug, thiserror::Error)] +pub enum PairingEquality { + #[error("List is not a multiple of 48. Remainder: {remainder}")] + NotMultipleG1 { remainder: usize }, + #[error("List is not a multiple of 96. Remainder: {remainder}")] + NotMultipleG2 { remainder: usize }, + #[error("Not the same amount of points passed. Left: {left}, Right: {right}")] + UnequalPointAmount { left: usize, right: usize }, +} + +#[derive(Debug, thiserror::Error)] +pub enum InvalidPoint { + #[error("Invalid input length for point (must be in compressed format): Expected {expected}, actual: {actual}")] + InvalidLength { expected: usize, actual: usize }, + #[error("Invalid point")] + DecodingError {}, +} + +#[derive(Debug, thiserror::Error)] pub enum CryptoError { + #[error("Point aggregation error: {source}")] + Aggregation { source: Aggregation, backtrace: BT }, #[error("Batch verify error: {msg}")] - BatchErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + BatchErr { msg: String, backtrace: BT }, #[error("Crypto error: {msg}")] - GenericErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + GenericErr { msg: String, backtrace: BT }, #[error("Invalid hash format")] - InvalidHashFormat { - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + InvalidHashFormat { backtrace: BT }, #[error("Invalid public key format")] - InvalidPubkeyFormat { - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + InvalidPubkeyFormat { backtrace: BT }, #[error("Invalid signature format")] - InvalidSignatureFormat { - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + InvalidSignatureFormat { backtrace: BT }, #[error("Invalid recovery parameter. Supported values: 0 and 1.")] - InvalidRecoveryParam { - #[cfg(feature = "backtraces")] - backtrace: Backtrace, + InvalidRecoveryParam { backtrace: BT }, + #[error("Invalid point: {source}")] + InvalidPoint { source: InvalidPoint, backtrace: BT }, + #[error("Pairing equality error: {source}")] + PairingEquality { + source: PairingEquality, + backtrace: BT, }, + #[error("Unknown hash function")] + UnknownHashFunction { backtrace: BT }, } impl CryptoError { pub fn batch_err(msg: impl Into) -> Self { CryptoError::BatchErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub fn generic_err(msg: impl Into) -> Self { CryptoError::GenericErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub fn invalid_hash_format() -> Self { CryptoError::InvalidHashFormat { - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub fn invalid_pubkey_format() -> Self { CryptoError::InvalidPubkeyFormat { - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub fn invalid_signature_format() -> Self { CryptoError::InvalidSignatureFormat { - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub fn invalid_recovery_param() -> Self { CryptoError::InvalidRecoveryParam { - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), + } + } + + pub fn unknown_hash_function() -> Self { + CryptoError::UnknownHashFunction { + backtrace: BT::capture(), } } @@ -95,7 +115,59 @@ impl CryptoError { CryptoError::InvalidPubkeyFormat { .. } => 5, CryptoError::InvalidRecoveryParam { .. } => 6, CryptoError::BatchErr { .. } => 7, + CryptoError::InvalidPoint { .. } => 8, + CryptoError::UnknownHashFunction { .. } => 9, CryptoError::GenericErr { .. } => 10, + CryptoError::PairingEquality { + source: PairingEquality::NotMultipleG1 { .. }, + .. + } => 11, + CryptoError::PairingEquality { + source: PairingEquality::NotMultipleG2 { .. }, + .. + } => 12, + CryptoError::PairingEquality { + source: PairingEquality::UnequalPointAmount { .. }, + .. + } => 13, + CryptoError::Aggregation { + source: Aggregation::Empty, + .. + } => 14, + CryptoError::Aggregation { + source: Aggregation::NotMultiple { .. }, + .. + } => 15, + } + } +} + +impl From for CryptoError { + #[track_caller] + fn from(value: Aggregation) -> Self { + Self::Aggregation { + source: value, + backtrace: BT::capture(), + } + } +} + +impl From for CryptoError { + #[track_caller] + fn from(value: PairingEquality) -> Self { + Self::PairingEquality { + source: value, + backtrace: BT::capture(), + } + } +} + +impl From for CryptoError { + #[track_caller] + fn from(value: InvalidPoint) -> Self { + Self::InvalidPoint { + source: value, + backtrace: BT::capture(), } } } diff --git a/packages/crypto/src/lib.rs b/packages/crypto/src/lib.rs index 97bf244c43..db49f56262 100644 --- a/packages/crypto/src/lib.rs +++ b/packages/crypto/src/lib.rs @@ -1,21 +1,42 @@ -//! The crypto crate is intended to be used in internal crates / utils. -//! Please don't use any of these types directly, as -//! they might change frequently, or be removed in the future. -//! This crate does not adhere to semantic versioning. -#![cfg_attr(feature = "backtraces", feature(backtrace))] +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! This crate implements cryptography-related functions for CosmWasm contracts and internal crates. +//! +//! **Note:** This crate is intended to be used in internal crates / utils only. +//! Please don't use any of these types directly, as they might change frequently, +//! or be removed in the future. This crate does not adhere to semantic versioning. +//! +//! For more information, see: +extern crate alloc; + +mod backtrace; +mod bls12_381; +mod ecdsa; mod ed25519; mod errors; mod identity_digest; mod secp256k1; +mod secp256r1; +#[doc(hidden)] +pub use crate::bls12_381::{ + bls12_381_aggregate_g1, bls12_381_aggregate_g2, bls12_381_g1_is_identity, + bls12_381_g2_is_identity, bls12_381_hash_to_g1, bls12_381_hash_to_g2, + bls12_381_pairing_equality, HashFunction, +}; +#[doc(hidden)] +pub use crate::ecdsa::{ECDSA_PUBKEY_MAX_LEN, ECDSA_SIGNATURE_LEN, MESSAGE_HASH_MAX_LEN}; #[doc(hidden)] pub use crate::ed25519::EDDSA_PUBKEY_LEN; #[doc(hidden)] pub use crate::ed25519::{ed25519_batch_verify, ed25519_verify}; #[doc(hidden)] -pub use crate::errors::{CryptoError, CryptoResult}; +pub use crate::errors::{ + Aggregation as AggregationError, CryptoError, CryptoResult, + PairingEquality as PairingEqualityError, +}; #[doc(hidden)] pub use crate::secp256k1::{secp256k1_recover_pubkey, secp256k1_verify}; #[doc(hidden)] -pub use crate::secp256k1::{ECDSA_PUBKEY_MAX_LEN, ECDSA_SIGNATURE_LEN, MESSAGE_HASH_MAX_LEN}; +pub use crate::secp256r1::{secp256r1_recover_pubkey, secp256r1_verify}; +pub(crate) use backtrace::BT; diff --git a/packages/crypto/src/secp256k1.rs b/packages/crypto/src/secp256k1.rs index dda5ce2571..162193d51c 100644 --- a/packages/crypto/src/secp256k1.rs +++ b/packages/crypto/src/secp256k1.rs @@ -1,40 +1,29 @@ +use alloc::{string::ToString, vec::Vec}; use digest::{Digest, Update}; // trait use k256::{ - ecdsa::recoverable, - ecdsa::signature::{DigestVerifier, Signature as _}, // traits - ecdsa::{Signature, VerifyingKey}, // type aliases - elliptic_curve::sec1::ToEncodedPoint, + ecdsa::signature::DigestVerifier, // traits + ecdsa::{RecoveryId, Signature, VerifyingKey}, // type aliases }; +use crate::ecdsa::{ECDSA_COMPRESSED_PUBKEY_LEN, ECDSA_UNCOMPRESSED_PUBKEY_LEN}; use crate::errors::{CryptoError, CryptoResult}; use crate::identity_digest::Identity256; -/// Max length of a message hash for secp256k1 verification in bytes. -/// This is typically a 32 byte output of e.g. SHA-256 or Keccak256. In theory shorter values -/// are possible but currently not supported by the implementation. Let us know when you need them. -pub const MESSAGE_HASH_MAX_LEN: usize = 32; - -/// ECDSA (secp256k1) parameters -/// Length of a serialized signature -pub const ECDSA_SIGNATURE_LEN: usize = 64; - -/// Length of a serialized compressed public key -const ECDSA_COMPRESSED_PUBKEY_LEN: usize = 33; -/// Length of a serialized uncompressed public key -const ECDSA_UNCOMPRESSED_PUBKEY_LEN: usize = 65; -/// Max length of a serialized public key -pub const ECDSA_PUBKEY_MAX_LEN: usize = ECDSA_UNCOMPRESSED_PUBKEY_LEN; - /// ECDSA secp256k1 implementation. /// -/// This function verifies message hashes (typically, hashed unsing SHA-256) against a signature, +/// This function verifies message hashes (typically, hashed using SHA-256) against a signature, /// with the public key of the signer, using the secp256k1 elliptic curve digital signature /// parametrization / algorithm. /// /// The signature and public key are in "Cosmos" format: /// - signature: Serialized "compact" signature (64 bytes). /// - public key: [Serialized according to SEC 2](https://www.oreilly.com/library/view/programming-bitcoin/9781492031482/ch04.html) -/// (33 or 65 bytes). +/// (33 or 65 bytes). +/// +/// This implementation accepts both high-S and low-S signatures. Some applications +/// including Ethereum transactions consider high-S signatures invalid in order to +/// avoid malleability. If that's the case for your protocol, the signature needs +/// to be tested for low-S in addition to this verification. pub fn secp256k1_verify( message_hash: &[u8], signature: &[u8], @@ -47,9 +36,12 @@ pub fn secp256k1_verify( // Already hashed, just build Digest container let message_digest = Identity256::new().chain(message_hash); - let mut signature = - Signature::from_bytes(&signature).map_err(|e| CryptoError::generic_err(e.to_string()))?; - // Non low-S signatures require normalization + let mut signature = Signature::from_bytes(&signature.into()) + .map_err(|e| CryptoError::generic_err(e.to_string()))?; + + // High-S signatures require normalization since our verification implementation + // rejects them by default. If we had a verifier that does not restrict to + // low-S only, this step was not needed. if let Some(normalized) = signature.normalize_s() { signature = normalized; } @@ -74,6 +66,22 @@ pub fn secp256k1_verify( /// /// Returns the recovered pubkey in compressed form, which can be used /// in secp256k1_verify directly. +/// +/// This implementation accepts both high-S and low-S signatures. This is the +/// same behavior as Ethereum's `ecrecover`. The reason is that high-S signatures +/// may be perfectly valid if the application protocol does not disallow them. +/// Or as [EIP-2] put it "The ECDSA recover precompiled contract remains unchanged +/// and will keep accepting high s-values; this is useful e.g. if a contract +/// recovers old Bitcoin signatures.". +/// +/// See also OpenZeppelin's [ECDSA.recover implementation](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.1/contracts/utils/cryptography/ECDSA.sol#L138-L149) +/// which adds further restrictions to avoid potential signature malleability. +/// Please note that restricting signatures to low-S does not make signatures unique +/// in the sense that for each (pubkey, message) there is only one signature. The +/// signer can generate an arbitrary amount of valid signatures. +/// +/// +/// [EIP-2]: https://eips.ethereum.org/EIPS/eip-2 pub fn secp256k1_recover_pubkey( message_hash: &[u8], signature: &[u8], @@ -82,19 +90,26 @@ pub fn secp256k1_recover_pubkey( let message_hash = read_hash(message_hash)?; let signature = read_signature(signature)?; - let id = - recoverable::Id::new(recovery_param).map_err(|_| CryptoError::invalid_recovery_param())?; + // params other than 0 and 1 are explicitly not supported + let mut id = match recovery_param { + 0 => RecoveryId::new(false, false), + 1 => RecoveryId::new(true, false), + _ => return Err(CryptoError::invalid_recovery_param()), + }; // Compose extended signature - let signature = - Signature::from_bytes(&signature).map_err(|e| CryptoError::generic_err(e.to_string()))?; - let extended_signature = recoverable::Signature::new(&signature, id) + let mut signature = Signature::from_bytes(&signature.into()) .map_err(|e| CryptoError::generic_err(e.to_string()))?; // Recover let message_digest = Identity256::new().chain(message_hash); - let pubkey = extended_signature - .recover_verifying_key_from_digest(message_digest) + + if let Some(normalized) = signature.normalize_s() { + signature = normalized; + id = RecoveryId::new(!id.is_y_odd(), id.is_x_reduced()); + } + + let pubkey = VerifyingKey::recover_from_digest(message_digest, &signature, id) .map_err(|e| CryptoError::generic_err(e.to_string()))?; let encoded: Vec = pubkey.to_encoded_point(false).as_bytes().into(); Ok(encoded) @@ -154,21 +169,24 @@ fn check_pubkey(data: &[u8]) -> Result<(), InvalidSecp256k1PubkeyFormat> { mod tests { use super::*; + use alloc::{format, string::String}; use hex_literal::hex; use k256::{ ecdsa::signature::DigestSigner, // trait ecdsa::SigningKey, // type alias elliptic_curve::rand_core::OsRng, - elliptic_curve::sec1::ToEncodedPoint, }; + use serde::Deserialize; use sha2::Sha256; + use std::fs::File; + use std::io::BufReader; // For generic signature verification const MSG: &str = "Hello World!"; - // Cosmos secp256k1 signature verification - // tendermint/PubKeySecp256k1 pubkey - const COSMOS_SECP256K1_PUBKEY_BASE64: &str = "A08EGB7ro1ORuFhjOnZcSgwYlpe0DSFjVNUIkNNQxwKQ"; + // "Cosmos" secp256k1 signature verification. Matches tendermint/PubKeySecp256k1 pubkey. + const COSMOS_SECP256K1_PUBKEY_HEX: &str = + "034f04181eeba35391b858633a765c4a0c189697b40d216354d50890d350c70290"; const COSMOS_SECP256K1_MSG_HEX1: &str = "0a93010a90010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412700a2d636f736d6f7331706b707472653766646b6c366766727a6c65736a6a766878686c63337234676d6d6b38727336122d636f736d6f7331717970717870713971637273737a673270767871367273307a716733797963356c7a763778751a100a0575636f736d12073132333435363712650a4e0a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21034f04181eeba35391b858633a765c4a0c189697b40d216354d50890d350c7029012040a02080112130a0d0a0575636f736d12043230303010c09a0c1a0c73696d642d74657374696e672001"; const COSMOS_SECP256K1_MSG_HEX2: &str = "0a93010a90010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412700a2d636f736d6f7331706b707472653766646b6c366766727a6c65736a6a766878686c63337234676d6d6b38727336122d636f736d6f7331717970717870713971637273737a673270767871367273307a716733797963356c7a763778751a100a0575636f736d12073132333435363712670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21034f04181eeba35391b858633a765c4a0c189697b40d216354d50890d350c7029012040a020801180112130a0d0a0575636f736d12043230303010c09a0c1a0c73696d642d74657374696e672001"; @@ -181,6 +199,15 @@ mod tests { // Test data originally from https://github.com/cosmos/cosmjs/blob/v0.24.0-alpha.22/packages/crypto/src/secp256k1.spec.ts#L195-L394 const COSMOS_SECP256K1_TESTS_JSON: &str = "./testdata/secp256k1_tests.json"; + #[derive(Deserialize, Debug)] + struct TestVector { + message: String, + message_hash: String, + signature: String, + #[serde(rename = "pubkey")] + public_key: String, + } + #[test] fn test_secp256k1_verify() { // Explicit / external hashing @@ -190,7 +217,7 @@ mod tests { // Signing let secret_key = SigningKey::random(&mut OsRng); // Serialize with `::to_bytes()` - // Note: the signature type must be annotated or otherwise inferrable as + // Note: the signature type must be annotated or otherwise inferable as // `Signer` has many impls of the `Signer` trait (for both regular and // recoverable signature types). let signature: Signature = secret_key.sign_digest(message_digest); @@ -200,7 +227,7 @@ mod tests { // Verification (uncompressed public key) assert!(secp256k1_verify( &message_hash, - signature.as_bytes(), + signature.to_bytes().as_slice(), public_key.to_encoded_point(false).as_bytes() ) .unwrap()); @@ -208,7 +235,7 @@ mod tests { // Verification (compressed public key) assert!(secp256k1_verify( &message_hash, - signature.as_bytes(), + signature.to_bytes().as_slice(), public_key.to_encoded_point(true).as_bytes() ) .unwrap()); @@ -217,7 +244,7 @@ mod tests { let bad_message_hash = Sha256::new().chain(MSG).chain("\0").finalize(); assert!(!secp256k1_verify( &bad_message_hash, - signature.as_bytes(), + signature.to_bytes().as_slice(), public_key.to_encoded_point(false).as_bytes() ) .unwrap()); @@ -227,7 +254,7 @@ mod tests { let other_public_key = VerifyingKey::from(&other_secret_key); assert!(!secp256k1_verify( &message_hash, - signature.as_bytes(), + signature.to_bytes().as_slice(), other_public_key.to_encoded_point(false).as_bytes() ) .unwrap()); @@ -235,7 +262,7 @@ mod tests { #[test] fn test_cosmos_secp256k1_verify() { - let public_key = base64::decode(COSMOS_SECP256K1_PUBKEY_BASE64).unwrap(); + let public_key = hex::decode(COSMOS_SECP256K1_PUBKEY_HEX).unwrap(); for ((i, msg), sig) in (1..) .zip(&[ @@ -253,55 +280,36 @@ mod tests { let signature = hex::decode(sig).unwrap(); // Explicit hash - let message_hash = Sha256::digest(&message); + let message_hash = Sha256::digest(message); // secp256k1_verify works - assert!( - secp256k1_verify(&message_hash, &signature, &public_key).unwrap(), - "secp256k1_verify() failed (test case {})", - i - ); + let valid = secp256k1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid, "secp256k1_verify() failed (test case {i})",); } } #[test] fn test_cosmos_extra_secp256k1_verify() { - use std::fs::File; - use std::io::BufReader; - - use serde::Deserialize; - - #[derive(Deserialize, Debug)] - struct Encoded { - message: String, - message_hash: String, - signature: String, - #[serde(rename = "pubkey")] - public_key: String, - } - // Open the file in read-only mode with buffer. let file = File::open(COSMOS_SECP256K1_TESTS_JSON).unwrap(); let reader = BufReader::new(file); - let codes: Vec = serde_json::from_reader(reader).unwrap(); + let codes: Vec = serde_json::from_reader(reader).unwrap(); for (i, encoded) in (1..).zip(codes) { let message = hex::decode(&encoded.message).unwrap(); + let signature = hex::decode(&encoded.signature).unwrap(); + let public_key = hex::decode(&encoded.public_key).unwrap(); let hash = hex::decode(&encoded.message_hash).unwrap(); - let message_hash = Sha256::digest(&message); + let message_hash = Sha256::digest(message); assert_eq!(hash.as_slice(), message_hash.as_slice()); - let signature = hex::decode(&encoded.signature).unwrap(); - - let public_key = hex::decode(&encoded.public_key).unwrap(); - // secp256k1_verify() works + let valid = secp256k1_verify(&message_hash, &signature, &public_key).unwrap(); assert!( - secp256k1_verify(&message_hash, &signature, &public_key).unwrap(), - "verify() failed (test case {})", - i + valid, + "secp256k1_verify failed (test case {i} in {COSMOS_SECP256K1_TESTS_JSON})" ); } } @@ -312,7 +320,7 @@ mod tests { { let private_key = hex!("3c9229289a6125f7fdf1885a77bb12c37a8d3b4962d936f7e3084dece32a3ca1"); - let expected = SigningKey::from_bytes(&private_key) + let expected = SigningKey::from_bytes(&private_key.into()) .unwrap() .verifying_key() .to_encoded_point(false) @@ -327,10 +335,11 @@ mod tests { } // Test data from https://github.com/randombit/botan/blob/2.9.0/src/tests/data/pubkey/ecdsa_key_recovery.vec + // This is a high-s value (`0x81F1A4457589F30D76AB9F89E748A68C8A94C30FE0BAC8FB5C0B54EA70BF6D2F > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0` is true) { let expected_x = "F3F8BB913AA68589A2C8C607A877AB05252ADBD963E1BE846DDEB8456942AEDC"; let expected_y = "A2ED51F08CA3EF3DAC0A7504613D54CD539FC1B3CBC92453CD704B6A2D012B2C"; - let expected = hex::decode(format!("04{}{}", expected_x, expected_y)).unwrap(); + let expected = hex::decode(format!("04{expected_x}{expected_y}")).unwrap(); let r_s = hex!("E30F2E6A0F705F4FB5F8501BA79C7C0D3FAC847F1AD70B873E9797B17B89B39081F1A4457589F30D76AB9F89E748A68C8A94C30FE0BAC8FB5C0B54EA70BF6D2F"); let recovery_param: u8 = 0; let message_hash = @@ -349,6 +358,29 @@ mod tests { let pubkey = secp256k1_recover_pubkey(&message_hash, &r_s, recovery_param).unwrap(); assert_eq!(pubkey, expected); } + + let file = File::open(COSMOS_SECP256K1_TESTS_JSON).unwrap(); + let reader = BufReader::new(file); + let codes: Vec = serde_json::from_reader(reader).unwrap(); + for (i, encoded) in (1..).zip(codes) { + let message = hex::decode(&encoded.message).unwrap(); + let signature = hex::decode(&encoded.signature).unwrap(); + let public_key = hex::decode(&encoded.public_key).unwrap(); + + let hash = hex::decode(&encoded.message_hash).unwrap(); + let message_hash = Sha256::digest(message); + assert_eq!(hash.as_slice(), message_hash.as_slice()); + + // Since the recovery param is missing in the test vectors, we try both 0 and 1 + let recovered0 = secp256k1_recover_pubkey(&message_hash, &signature, 0).unwrap(); + let recovered1 = secp256k1_recover_pubkey(&message_hash, &signature, 1).unwrap(); + // Got two different pubkeys. Without the recovery param, we don't know which one is the right one. + assert_ne!(recovered0, recovered1); + assert!( + recovered0 == public_key || recovered1 == public_key, + "Did not find correct pubkey (test case {i} in {COSMOS_SECP256K1_TESTS_JSON})" + ); + } } #[test] @@ -360,24 +392,24 @@ mod tests { let recovery_param: u8 = 2; match secp256k1_recover_pubkey(&message_hash, &r_s, recovery_param).unwrap_err() { CryptoError::InvalidRecoveryParam { .. } => {} - err => panic!("Unexpected error: {}", err), + err => panic!("Unexpected error: {err}"), } let recovery_param: u8 = 3; match secp256k1_recover_pubkey(&message_hash, &r_s, recovery_param).unwrap_err() { CryptoError::InvalidRecoveryParam { .. } => {} - err => panic!("Unexpected error: {}", err), + err => panic!("Unexpected error: {err}"), } // Other values are garbage let recovery_param: u8 = 4; match secp256k1_recover_pubkey(&message_hash, &r_s, recovery_param).unwrap_err() { CryptoError::InvalidRecoveryParam { .. } => {} - err => panic!("Unexpected error: {}", err), + err => panic!("Unexpected error: {err}"), } let recovery_param: u8 = 255; match secp256k1_recover_pubkey(&message_hash, &r_s, recovery_param).unwrap_err() { CryptoError::InvalidRecoveryParam { .. } => {} - err => panic!("Unexpected error: {}", err), + err => panic!("Unexpected error: {err}"), } } } diff --git a/packages/crypto/src/secp256r1.rs b/packages/crypto/src/secp256r1.rs new file mode 100644 index 0000000000..1abc88959b --- /dev/null +++ b/packages/crypto/src/secp256r1.rs @@ -0,0 +1,343 @@ +use alloc::{string::ToString, vec::Vec}; +use digest::{Digest, Update}; // trait +use ecdsa::RecoveryId; +use p256::{ + ecdsa::signature::DigestVerifier, // traits + ecdsa::{Signature, VerifyingKey}, // type aliases +}; + +use crate::ecdsa::{ECDSA_COMPRESSED_PUBKEY_LEN, ECDSA_UNCOMPRESSED_PUBKEY_LEN}; +use crate::errors::{CryptoError, CryptoResult}; +use crate::identity_digest::Identity256; + +/// ECDSA secp256r1 implementation. +/// +/// This function verifies message hashes (typically, hashed using SHA-256) against a signature, +/// with the public key of the signer, using the secp256r1 elliptic curve digital signature +/// parametrization / algorithm. +/// +/// The signature and public key are in "Cosmos" format: +/// - signature: Serialized "compact" signature (64 bytes). +/// - public key: [Serialized according to SEC 2](https://www.oreilly.com/library/view/programming-bitcoin/9781492031482/ch04.html) +/// (33 or 65 bytes). +pub fn secp256r1_verify( + message_hash: &[u8], + signature: &[u8], + public_key: &[u8], +) -> CryptoResult { + let message_hash = read_hash(message_hash)?; + let signature = read_signature(signature)?; + check_pubkey(public_key)?; + + // Already hashed, just build Digest container + let message_digest = Identity256::new().chain(message_hash); + + let mut signature = Signature::from_bytes(&signature.into()) + .map_err(|e| CryptoError::generic_err(e.to_string()))?; + + // High-S signatures require normalization since our verification implementation + // rejects them by default. If we had a verifier that does not restrict to + // low-S only, this step was not needed. + if let Some(normalized) = signature.normalize_s() { + signature = normalized; + } + + let public_key = VerifyingKey::from_sec1_bytes(public_key) + .map_err(|e| CryptoError::generic_err(e.to_string()))?; + + match public_key.verify_digest(message_digest, &signature) { + Ok(()) => Ok(true), + Err(_) => Ok(false), + } +} + +/// Recovers a public key from a message hash and a signature. +/// +/// This is required when working with an application where public keys +/// are not stored directly. +/// +/// `recovery_param` must be 0, 1, 2 or 3. +/// +/// Returns the recovered pubkey in compressed form, which can be used +/// in secp256r1_verify directly. +/// +/// This implementation accepts both high-S and low-S signatures. This is the +/// same behavior as Ethereum's `ecrecover`. The reason is that high-S signatures +/// may be perfectly valid if the application protocol does not disallow them. +pub fn secp256r1_recover_pubkey( + message_hash: &[u8], + signature: &[u8], + recovery_param: u8, +) -> Result, CryptoError> { + let message_hash = read_hash(message_hash)?; + let signature = read_signature(signature)?; + + // params other than 0, 1, 2 or 3 are explicitly not supported + let Some(id) = RecoveryId::from_byte(recovery_param) else { + return Err(CryptoError::invalid_recovery_param()); + }; + + // Compose extended signature + let signature = p256::ecdsa::Signature::from_bytes(&signature.into()) + .map_err(|e| CryptoError::generic_err(e.to_string()))?; + + // Recover + let message_digest = Identity256::new().chain(message_hash); + let pubkey = p256::ecdsa::VerifyingKey::recover_from_digest(message_digest, &signature, id) + .map_err(|e| CryptoError::generic_err(e.to_string()))?; + let encoded: Vec = pubkey.to_encoded_point(false).as_bytes().into(); + Ok(encoded) +} + +/// Error raised when hash is not 32 bytes long +struct InvalidSecp256r1HashFormat; + +impl From for CryptoError { + fn from(_original: InvalidSecp256r1HashFormat) -> Self { + CryptoError::invalid_hash_format() + } +} + +fn read_hash(data: &[u8]) -> Result<[u8; 32], InvalidSecp256r1HashFormat> { + data.try_into().map_err(|_| InvalidSecp256r1HashFormat) +} + +/// Error raised when signature is not 64 bytes long (32 bytes r, 32 bytes s) +struct InvalidSecp256r1SignatureFormat; + +impl From for CryptoError { + fn from(_original: InvalidSecp256r1SignatureFormat) -> Self { + CryptoError::invalid_signature_format() + } +} + +fn read_signature(data: &[u8]) -> Result<[u8; 64], InvalidSecp256r1SignatureFormat> { + data.try_into().map_err(|_| InvalidSecp256r1SignatureFormat) +} + +/// Error raised when public key is not in one of the two supported formats: +/// 1. Uncompressed: 65 bytes starting with 0x04 +/// 2. Compressed: 33 bytes starting with 0x02 or 0x03 +struct InvalidSecp256r1PubkeyFormat; + +impl From for CryptoError { + fn from(_original: InvalidSecp256r1PubkeyFormat) -> Self { + CryptoError::invalid_pubkey_format() + } +} + +fn check_pubkey(data: &[u8]) -> Result<(), InvalidSecp256r1PubkeyFormat> { + let ok = match data.first() { + Some(0x02) | Some(0x03) => data.len() == ECDSA_COMPRESSED_PUBKEY_LEN, + Some(0x04) => data.len() == ECDSA_UNCOMPRESSED_PUBKEY_LEN, + _ => false, + }; + if ok { + Ok(()) + } else { + Err(InvalidSecp256r1PubkeyFormat) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::fs::File; + use std::io::BufReader; + + use crate::secp256r1_recover_pubkey; + use alloc::string::String; + use ecdsa::RecoveryId; + use p256::{ + ecdsa::signature::DigestSigner, ecdsa::SigningKey, elliptic_curve::rand_core::OsRng, + }; + use serde::Deserialize; + use sha2::Sha256; + + // For generic signature verification + const MSG: &str = "Hello World!"; + + // "Cosmos" secp256r1 signature verification. Matches tendermint/PubKeySecp256r1 pubkey format. + // ECDSA/P-256 test vectors adapted from the FIPS 186-4 ECDSA test vectors (P-256, SHA-256, from + // `SigGen.txt` in `186-4ecdsatestvectors.zip`). + // + const COSMOS_SECP256R1_PUBKEY_HEX1: &str = "041ccbe91c075fc7f4f033bfa248db8fccd3565de94bbfb12f3c59ff46c271bf83ce4014c68811f9a21a1fdb2c0e6113e06db7ca93b7404e78dc7ccd5ca89a4ca9"; + const COSMOS_SECP256R1_PUBKEY_HEX2: &str = "04e266ddfdc12668db30d4ca3e8f7749432c416044f2d2b8c10bf3d4012aeffa8abfa86404a2e9ffe67d47c587ef7a97a7f456b863b4d02cfc6928973ab5b1cb39"; + const COSMOS_SECP256R1_PUBKEY_HEX3: &str = "0474ccd8a62fba0e667c50929a53f78c21b8ff0c3c737b0b40b1750b2302b0bde829074e21f3a0ef88b9efdf10d06aa4c295cc1671f758ca0e4cd108803d0f2614"; + + const COSMOS_SECP256R1_MSG_HEX1: &str = "5905238877c77421f73e43ee3da6f2d9e2ccad5fc942dcec0cbd25482935faaf416983fe165b1a045ee2bcd2e6dca3bdf46c4310a7461f9a37960ca672d3feb5473e253605fb1ddfd28065b53cb5858a8ad28175bf9bd386a5e471ea7a65c17cc934a9d791e91491eb3754d03799790fe2d308d16146d5c9b0d0debd97d79ce8"; + const COSMOS_SECP256R1_MSG_HEX2: &str = "c35e2f092553c55772926bdbe87c9796827d17024dbb9233a545366e2e5987dd344deb72df987144b8c6c43bc41b654b94cc856e16b96d7a821c8ec039b503e3d86728c494a967d83011a0e090b5d54cd47f4e366c0912bc808fbb2ea96efac88fb3ebec9342738e225f7c7c2b011ce375b56621a20642b4d36e060db4524af1"; + const COSMOS_SECP256R1_MSG_HEX3: &str = "3c054e333a94259c36af09ab5b4ff9beb3492f8d5b4282d16801daccb29f70fe61a0b37ffef5c04cd1b70e85b1f549a1c4dc672985e50f43ea037efa9964f096b5f62f7ffdf8d6bfb2cc859558f5a393cb949dbd48f269343b5263dcdb9c556eca074f2e98e6d94c2c29a677afaf806edf79b15a3fcd46e7067b7669f83188ee"; + + const COSMOS_SECP256R1_SIGNATURE_HEX1: &str = "f3ac8061b514795b8843e3d6629527ed2afd6b1f6a555a7acabb5e6f79c8c2ac8bf77819ca05a6b2786c76262bf7371cef97b218e96f175a3ccdda2acc058903"; + const COSMOS_SECP256R1_SIGNATURE_HEX2: &str = "976d3a4e9d23326dc0baa9fa560b7c4e53f42864f508483a6473b6a11079b2db1b766e9ceb71ba6c01dcd46e0af462cd4cfa652ae5017d4555b8eeefe36e1932"; + const COSMOS_SECP256R1_SIGNATURE_HEX3: &str = "35fb60f5ca0f3ca08542fb3cc641c8263a2cab7a90ee6a5e1583fac2bb6f6bd1ee59d81bc9db1055cc0ed97b159d8784af04e98511d0a9a407b99bb292572e96"; + + // Test data extracted from https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/digital-signatures + const COSMOS_SECP256R1_TESTS_JSON: &str = "./testdata/secp256r1_tests.json"; + + #[derive(Deserialize, Debug)] + struct TestVector { + message: String, + signature: String, + #[serde(rename = "pubkey")] + public_key: String, + } + + #[test] + fn test_secp256r1_verify() { + // Explicit / external hashing + let message_digest = Sha256::new().chain(MSG); + let message_hash = message_digest.clone().finalize(); + + // Signing + let secret_key = SigningKey::random(&mut OsRng); // Serialize with `::to_bytes()` + + // Note: the signature type must be annotated or otherwise inferable as + // `Signer` has many impls of the `Signer` trait (for both regular and + // recoverable signature types). + let (signature, _recovery_id): (Signature, RecoveryId) = + secret_key.sign_digest(message_digest); + + let public_key = VerifyingKey::from(&secret_key); // Serialize with `::to_encoded_point()` + + // Verification (uncompressed public key) + assert!(secp256r1_verify( + &message_hash, + signature.to_bytes().as_slice(), + public_key.to_encoded_point(false).as_bytes() + ) + .unwrap()); + + // Verification (compressed public key) + assert!(secp256r1_verify( + &message_hash, + signature.to_bytes().as_slice(), + public_key.to_encoded_point(true).as_bytes() + ) + .unwrap()); + + // Wrong message fails + let bad_message_hash = Sha256::new().chain(MSG).chain("\0").finalize(); + assert!(!secp256r1_verify( + &bad_message_hash, + signature.to_bytes().as_slice(), + public_key.to_encoded_point(false).as_bytes() + ) + .unwrap()); + + // Other pubkey fails + let other_secret_key = SigningKey::random(&mut OsRng); + let other_public_key = VerifyingKey::from(&other_secret_key); + assert!(!secp256r1_verify( + &message_hash, + signature.to_bytes().as_slice(), + other_public_key.to_encoded_point(false).as_bytes() + ) + .unwrap()); + } + + #[test] + fn test_cosmos_secp256r1_verify() { + for (((i, pk), msg), sig) in (1..) + .zip(&[ + COSMOS_SECP256R1_PUBKEY_HEX1, + COSMOS_SECP256R1_PUBKEY_HEX2, + COSMOS_SECP256R1_PUBKEY_HEX3, + ]) + .zip(&[ + COSMOS_SECP256R1_MSG_HEX1, + COSMOS_SECP256R1_MSG_HEX2, + COSMOS_SECP256R1_MSG_HEX3, + ]) + .zip(&[ + COSMOS_SECP256R1_SIGNATURE_HEX1, + COSMOS_SECP256R1_SIGNATURE_HEX2, + COSMOS_SECP256R1_SIGNATURE_HEX3, + ]) + { + let public_key = hex::decode(pk).unwrap(); + let message = hex::decode(msg).unwrap(); + let signature = hex::decode(sig).unwrap(); + + // Explicit hash + let message_hash = Sha256::digest(&message); + + // secp256r1_verify works + let valid = secp256r1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid, "secp256r1_verify() failed (test case {i})",); + } + } + + #[test] + fn test_cosmos_extra_secp256r1_verify() { + use std::fs::File; + use std::io::BufReader; + + // Open the file in read-only mode with buffer. + let file = File::open(COSMOS_SECP256R1_TESTS_JSON).unwrap(); + let reader = BufReader::new(file); + + let codes: Vec = serde_json::from_reader(reader).unwrap(); + + for (i, encoded) in (1..).zip(codes) { + let message = hex::decode(&encoded.message).unwrap(); + let message_hash = Sha256::digest(&message); + + let signature = hex::decode(&encoded.signature).unwrap(); + + let public_key = hex::decode(&encoded.public_key).unwrap(); + + // secp256r1_verify() works + let valid = secp256r1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!( + valid, + "secp256r1_verify failed (test case {i} in {COSMOS_SECP256R1_TESTS_JSON})" + ); + } + } + + #[test] + fn secp256r1_recover_pubkey_works() { + let file = File::open(crate::secp256r1::tests::COSMOS_SECP256R1_TESTS_JSON).unwrap(); + let reader = BufReader::new(file); + let codes: Vec = + serde_json::from_reader(reader).unwrap(); + for (i, encoded) in (1..).zip(codes) { + let message = hex::decode(&encoded.message).unwrap(); + let signature = hex::decode(&encoded.signature).unwrap(); + let public_key = hex::decode(&encoded.public_key).unwrap(); + let message_hash = Sha256::digest(message); + + // Since the recovery param is missing in the test vectors, we try both 0 and 1 + let try0 = secp256r1_recover_pubkey(&message_hash, &signature, 0); + let try1 = secp256r1_recover_pubkey(&message_hash, &signature, 1); + match (try0, try1) { + (Ok(recovered0), Ok(recovered1)) => { + // Got two different pubkeys. Without the recovery param, we don't know which one is the right one. + assert!(recovered0 == public_key || recovered1 == public_key) + }, + (Ok(recovered), Err(_)) => assert_eq!(recovered, public_key), + (Err(_), Ok(recovered)) => assert_eq!(recovered, public_key), + (Err(_), Err(_)) => panic!("secp256r1_recover_pubkey failed (test case {i} in {COSMOS_SECP256R1_TESTS_JSON})"), + } + } + } + + #[test] + fn secp256r1_recover_pubkey_fails_for_invalid_recovery_param() { + let r_s = hex::decode(COSMOS_SECP256R1_SIGNATURE_HEX1).unwrap(); + let message_hash = Sha256::digest(hex::decode(COSMOS_SECP256R1_MSG_HEX1).unwrap()); + + let recovery_param: u8 = 4; + match secp256r1_recover_pubkey(&message_hash, &r_s, recovery_param).unwrap_err() { + CryptoError::InvalidRecoveryParam { .. } => {} + err => panic!("Unexpected error: {err}"), + } + let recovery_param: u8 = 255; + match secp256r1_recover_pubkey(&message_hash, &r_s, recovery_param).unwrap_err() { + CryptoError::InvalidRecoveryParam { .. } => {} + err => panic!("Unexpected error: {err}"), + } + } +} diff --git a/packages/crypto/testdata/186-4ecdsatestvectors/Readme.txt b/packages/crypto/testdata/186-4ecdsatestvectors/Readme.txt new file mode 100644 index 0000000000..2d36c32ae9 --- /dev/null +++ b/packages/crypto/testdata/186-4ecdsatestvectors/Readme.txt @@ -0,0 +1,19 @@ +Example test files for FIPS 186-3 ECDSA +Updated May 5, 2015 to include examples for truncated SHAs and to remove SigGen P-192, K-163, and B-163 curves and to remove SHA1 + + +1. The files with extension '.rsp' are response files in the proper format for +CAVS validation. + + a. SigVer.rsp contains examples of every curve with SHA1, SHA224, SHA256, SHA384, and SHA512. + b. SigVer_TruncatedSHAs.rsp contains examples of every curve with the truncated +SHAs - SHA512/224 and SHA512/256. + +2. The file SigGen.txt contains values for ECDSA signature generation for every curve with SHA224, SHA256, SHA384, and SHA512. The file SigGen_TruncatedSHAs.txt contains values for ECDSA signature generation for every curve with the truncated SHAs - SHA512/224 and SHA512/256. + + a. These txt files contain values for ECDSA signature generation with the +following additional values needed to calculate r and s as in Section 6.4: + 1. 'd' -- The private key. + + 2. 'k' -- The Per-message secret number (PMSN) used to compute (r, s). + See Section 6.3 and Appendix B.5 for more information on the PMSN. \ No newline at end of file diff --git a/packages/crypto/testdata/186-4ecdsatestvectors/SigGen.txt b/packages/crypto/testdata/186-4ecdsatestvectors/SigGen.txt new file mode 100644 index 0000000000..5e3b4ebb0e --- /dev/null +++ b/packages/crypto/testdata/186-4ecdsatestvectors/SigGen.txt @@ -0,0 +1,5878 @@ +# CAVS 11.2 +# "SigVer" information for "ecdsa_values" +# Curves/SHAs selected: P-224,SHA-224 P-224,SHA-256 P-224,SHA-384 P-224,SHA-512 P-256,SHA-224 P-256,SHA-256 P-256,SHA-384 P-256,SHA-512 P-384,SHA-224 P-384,SHA-256 P-384,SHA-384 P-384,SHA-512 P-521,SHA-224 P-521,SHA-256 P-521,SHA-384 P-521,SHA-512 K-233,SHA-224 K-233,SHA-256 K-233,SHA-384 K-233,SHA-512 K-283,SHA-224 K-283,SHA-256 K-283,SHA-384 K-283,SHA-512 K-409,SHA-224 K-409,SHA-256 K-409,SHA-384 K-409,SHA-512 K-571,SHA-224 K-571,SHA-256 K-571,SHA-384 K-571,SHA-512 B-233,SHA-224 B-233,SHA-256 B-233,SHA-384 B-233,SHA-512 B-283,SHA-224 B-283,SHA-256 B-283,SHA-384 B-283,SHA-512 B-409,SHA-224 B-409,SHA-256 B-409,SHA-384 B-409,SHA-512 BB-571,SHA-224 B-571,SHA-256 B-571,SHA-384 B-571,SHA-512 +# Generated on Tue Aug 16 15:27:42 2011 + + + + +[P-224,SHA-224] + +Msg = 699325d6fc8fbbb4981a6ded3c3a54ad2e4e3db8a5669201912064c64e700c139248cdc19495df081c3fc60245b9f25fc9e301b845b3d703a694986e4641ae3c7e5a19e6d6edbf1d61e535f49a8fad5f4ac26397cfec682f161a5fcd32c5e780668b0181a91955157635536a22367308036e2070f544ad4fff3d5122c76fad5d +d = 16797b5c0c7ed5461e2ff1b88e6eafa03c0f46bf072000dfc830d615 +Qx = 605495756e6e88f1d07ae5f98787af9b4da8a641d1a9492a12174eab +Qy = f5cc733b17decc806ef1df861a42505d0af9ef7c3df3959b8dfc6669 +k = d9a5a7328117f48b4b8dd8c17dae722e756b3ff64bd29a527137eec0 +R = 2fc2cff8cdd4866b1d74e45b07d333af46b7af0888049d0fdbc7b0d6 +S = 8d9cc4c8ea93e0fd9d6431b9a1fd99b88f281793396321b11dac41eb + +Msg = 7de42b44db0aa8bfdcdac9add227e8f0cc7ad1d94693beb5e1d325e5f3f85b3bd033fc25e9469a89733a65d1fa641f7e67d668e7c71d736233c4cba20eb83c368c506affe77946b5e2ec693798aecd7ff943cd8fab90affddf5ad5b8d1af332e6c5fe4a2df16837700b2781e08821d4fbdd8373517f5b19f9e63b89cfeeeef6f +d = cf020a1ff36c28511191482ed1e5259c60d383606c581948c3fbe2c5 +Qx = fa21f85b99d3dc18c6d53351fbcb1e2d029c00fa7d1663a3dd94695e +Qy = e9e79578f8988b168edff1a8b34a5ed9598cc20acd1f0aed36715d88 +k = c780d047454824af98677cf310117e5f9e99627d02414f136aed8e83 +R = 45145f06b566ec9fd0fee1b6c6551a4535c7a3bbfc0fede45f4f5038 +S = 7302dff12545b069cf27df49b26e4781270585463656f2834917c3ca + +Msg = af0da3adab82784909e2b3dadcecba21eced3c60d7572023dea171044d9a10e8ba67d31b04904541b87fff32a10ccc6580869055fec6216a00320a28899859a6b61faba58a0bc10c2ba07ea16f214c3ddcc9fc5622ad1253b63fe7e95227ae3c9caa9962cffc8b1c4e8260036469d25ab0c8e3643a820b8b3a4d8d43e4b728f9 +d = dde6f173fa9f307d206ce46b4f02851ebce9638a989330249fd30b73 +Qx = fc21a99b060afb0d9dbf3250ea3c4da10be94ce627a65874d8e4a630 +Qy = e8373ab7190890326aac4aacca3eba89e15d1086a05434dd033fd3f3 +k = 6629366a156840477df4875cfba4f8faa809e394893e1f5525326d07 +R = 41f8e2b1ae5add7c24da8725a067585a3ad6d5a9ed9580beb226f23a +S = a5d71bff02dce997305dd337128046f36714398f4ef6647599712fae + +Msg = cfa56ae89727df6b7266f69d6636bf738f9e4f15f49c42a0123edac4b3743f32ea52389f919ceb90575c4184897773b2f2fc5b3fcb354880f15c93383215d3c2551fcc1b4180a1ac0f69c969bbc306acd115ce3976eff518540f43ad4076dbb5fbad9ce9b3234f1148b8f5e059192ff480fc4bcbd00d25f4d9f5ed4ba5693b6c +d = aeee9071248f077590ac647794b678ad371f8e0f1e14e9fbff49671e +Qx = fad0a34991bbf89982ad9cf89337b4bd2565f84d5bdd004289fc1cc3 +Qy = 5d8b6764f28c8163a12855a5c266efeb9388df4994b85a8b4f1bd3bc +k = 1d35d027cd5a569e25c5768c48ed0c2b127c0f99cb4e52ea094fe689 +R = 2258184ef9f0fa698735379972ce9adf034af76017668bfcdab978de +S = 866fb8e505dea6c909c2c9143ec869d1bac2282cf12366130ff2146c + +Msg = c223c8009018321b987a615c3414d2bb15954933569ca989de32d6bf11107bc47a330ab6d88d9b50d106cf5777d1b736b14bc48deda1bc573a9a7dd42cd061860645306dce7a5ba8c60f135a6a21999421ce8c4670fe7287a7e9ea3aa1e0fa82721f33e6e823957fe86e2283c89ef92b13cd0333c4bb70865ae1919bf538ea34 +d = 29c204b2954e1406a015020f9d6b3d7c00658298feb2d17440b2c1a4 +Qx = 0e0fc15e775a75d45f872e5021b554cc0579da19125e1a49299c7630 +Qy = cb64fe462d025ae2a1394746bdbf8251f7ca5a1d6bb13e0edf6b7b09 +k = 39547c10bb947d69f6c3af701f2528e011a1e80a6d04cc5a37466c02 +R = 86622c376d326cdf679bcabf8eb034bf49f0c188f3fc3afd0006325d +S = 26613d3b33c70e635d7a998f254a5b15d2a3642bf321e8cff08f1e84 + +Msg = 1c27273d95182c74c100d85b5c08f4b26874c2abc87f127f304aedbf52ef6540eba16dd664ae1e9e30ea1e66ff9cc9ab5a80b5bcbd19dde88a29ff10b50a6abd73388e8071306c68d0c9f6caa26b7e68de29312be959b9f4a5481f5a2ad2070a396ed3de21096541cf58c4a13308e08867565bf2df9d649357a83cdcf18d2cd9 +d = 8986a97b24be042a1547642f19678de4e281a68f1e794e343dabb131 +Qx = 2c070e68e8478341938f3d5026a1fe01e778cdffbebbdd7a4cd29209 +Qy = cde21c9c7c6590ba300715a7adac278385a5175b6b4ea749c4b6a681 +k = 509712f9c0f3370f6a09154159975945f0107dd1cee7327c68eaa90b +R = 57afda5139b180de96373c3d649700682e37efd56ae182335f081013 +S = eb6cd58650cfb26dfdf21de32fa17464a6efc46830eedc16977342e6 + +Msg = 069ae374971627f6b8503f3aa63ab52bcf4f3fcae65b98cdbbf917a5b08a10dc760056714db279806a8d43485320e6fee0f1e0562e077ee270ace8d3c478d79bcdff9cf8b92fdea68421d4a276f8e62ae379387ae06b60af9eb3c40bd7a768aeffccdc8a08bc78ca2eca18061058043a0e441209c5c594842838a4d9d778a053 +d = d9aa95e14cb34980cfddadddfa92bde1310acaff249f73ff5b09a974 +Qx = 3a0d4b8e5fad1ea1abb8d3fb742cd45cd0b76d136e5bbb33206ad120 +Qy = c90ac83276b2fa3757b0f226cd7360a313bc96fd8329c76a7306cc7d +k = 1f1739af68a3cee7c5f09e9e09d6485d9cd64cc4085bc2bc89795aaf +R = 09bbdd003532d025d7c3204c00747cd52ecdfbc7ce3dde8ffbea23e1 +S = 1e745e80948779a5cc8dc5cb193beebb550ec9c2647f4948bf58ba7d + +Msg = d0d5ae3e33600aa21c1606caec449eee678c87cb593594be1fbb048cc7cfd076e5cc7132ebe290c4c014e7a517a0d5972759acfa1438d9d2e5d236d19ac92136f6252b7e5bea7588dcba6522b6b18128f003ecab5cb4908832fb5a375cf820f8f0e9ee870653a73dc2282f2d45622a2f0e85cba05c567baf1b9862b79a4b244e +d = 380fb6154ad3d2e755a17df1f047f84712d4ec9e47d34d4054ea29a8 +Qx = 4772c27cca3348b1801ae87b01cb564c8cf9b81c23cc74468a907927 +Qy = de9d253935b09617a1655c42d385bf48504e06fa386f5fa533a21dcb +k = 14dbdffa326ba2f3d64f79ff966d9ee6c1aba0d51e9a8e59f5686dc1 +R = ff6d52a09ca4c3b82da0440864d6717e1be0b50b6dcf5e1d74c0ff56 +S = 09490be77bc834c1efaa23410dcbf800e6fae40d62a737214c5a4418 + +Msg = 79b7375ae7a4f2e4adad8765d14c1540cd9979db38076c157c1837c760ca6febbb18fd42152335929b735e1a08041bd38d315cd4c6b7dd2729de8752f531f07fe4ddc4f1899debc0311eef0019170b58e08895b439ddf09fbf0aeb1e2fd35c2ef7ae402308c3637733802601dd218fb14c22f57870835b10818369d57d318405 +d = 6b98ec50d6b7f7ebc3a2183ff9388f75e924243827ddded8721186e2 +Qx = 1f249911b125348e6e0a473479105cc4b8cfb4fa32d897810fc69ffe +Qy = a17db03b9877d1b6328329061ea67aec5a38a884362e9e5b7d7642dc +k = ab3a41fedc77d1f96f3103cc7dce215bf45054a755cf101735fef503 +R = 70ccc0824542e296d17a79320d422f1edcf9253840dafe4427033f40 +S = e3823699c355b61ab1894be3371765fae2b720405a7ce5e790ca8c00 + +Msg = 8c7de96e6880d5b6efc19646b9d3d56490775cb3faab342e64db2e388c4bd9e94c4e69a63ccdb7e007a19711e69c06f106b71c983a6d97c4589045666c6ab5ea7b5b6d096ddf6fd35b819f1506a3c37ddd40929504f9f079c8d83820fc8493f97b2298aebe48fdb4ff472b29018fc2b1163a22bfbb1de413e8645e871291a9f6 +d = 8dda0ef4170bf73077d685e7709f6f747ced08eb4cde98ef06ab7bd7 +Qx = 7df67b960ee7a2cb62b22932457360ab1e046c1ec84b91ae65642003 +Qy = c764ca9fc1b0cc2233fa57bdcfedaab0131fb7b5f557d6ca57f4afe0 +k = 9ef6ebd178a76402968bc8ec8b257174a04fb5e2d65c1ab34ab039b9 +R = eef9e8428105704133e0f19636c89e570485e577786df2b09f99602a +S = 8c01f0162891e4b9536243cb86a6e5c177323cca09777366caf2693c + +Msg = c89766374c5a5ccef5823e7a9b54af835ac56afbbb517bd77bfecf3fea876bd0cc9ea486e3d685cfe3fb05f25d9c67992cd7863c80a55c7a263249eb3996c4698ad7381131bf3700b7b24d7ca281a100cf2b750e7f0f933e662a08d9f9e47d779fb03754bd20931262ff381a2fe7d1dc94f4a0520de73fa72020494d3133ecf7 +d = 3dbe18cd88fa49febfcb60f0369a67b2379a466d906ac46a8b8d522b +Qx = b10150fd797eb870d377f1dbfa197f7d0f0ad29965af573ec13cc42a +Qy = 17b63ccefbe27fb2a1139e5757b1082aeaa564f478c23a8f631eed5c +k = 385803b262ee2ee875838b3a645a745d2e199ae112ef73a25d68d15f +R = 1d293b697f297af77872582eb7f543dc250ec79ad453300d264a3b70 +S = 517a91b89c4859fcc10834242e710c5f0fed90ac938aa5ccdb7c66de + +Msg = 30f0e3b502eec5646929d48fd46aa73991d82079c7bd50a38b38ec0bd84167c8cf5ba39bec26999e70208af9b445046cd9d20c82b7629ca1e51bdd00daddbc35f9eb036a15ac57898642d9db09479a38cc80a2e41e380c8a766b2d623de2de798e1eabc02234b89b85d60154460c3bf12764f3fbf17fcccc82df516a2fbe4ecf +d = c906b667f38c5135ea96c95722c713dbd125d61156a546f49ddaadc6 +Qx = 3c9b4ef1748a1925578658d3af51995b989ad760790157b25fe09826 +Qy = 55648f4ff4edfb899e9a13bd8d20f5c24b35dc6a6a4e42ed5983b4a0 +k = b04d78d8ac40fefadb99f389a06d93f6b5b72198c1be02dbff6195f0 +R = 4bdd3c84647bad93dcaffd1b54eb87fc61a5704b19d7e6d756d11ad0 +S = fdd81e5dca54158514f44ba2330271eff4c618330328451e2d93b9fb + +Msg = 6bbb4bf987c8e5069e47c1a541b48b8a3e6d14bfd9ac6dfaa7503b64ab5e1a55f63e91cf5c3e703ac27ad88756dd7fb2d73b909fc15302d0592b974d47e72e60ed339a40b34d39a49b69ea4a5d26ce86f3ca00a70f1cd416a6a5722e8f39d1f0e966981803d6f46dac34e4c7640204cd0d9f1e53fc3acf30096cd00fa80b3ae9 +d = 3456745fbd51eac9b8095cd687b112f93d1b58352dbe02c66bb9b0cc +Qx = f0acdfbc75a748a4a0ac55281754b5c4a364b7d61c5390b334daae10 +Qy = 86587a6768f235bf523fbfc6e062c7401ac2b0242cfe4e5fb34f4057 +k = 854b20c61bcdf7a89959dbf0985880bb14b628f01c65ef4f6446f1c1 +R = a2601fbb9fe89f39814735febb349143baa934170ffb91c6448a7823 +S = bf90f9305616020a0e34ef30803fc15fa97dffc0948452bbf6cb5f66 + +Msg = 05b8f8e56214d4217323f2066f974f638f0b83689fc4ed1201848230efdc1fbca8f70359cecc921050141d3b02c2f17aa306fc2ce5fc06e7d0f4be162fcd985a0b687b4ba09b681cb52ffe890bf5bb4a104cb2e770c04df433013605eb8c72a09902f4246d6c22b8c191ef1b0bece10d5ce2744fc7345307dd1b41b6eff0ca89 +d = 2c522af64baaca7b7a08044312f5e265ec6e09b2272f462cc705e4c3 +Qx = 5fad3c047074b5de1960247d0cc216b4e3fb7f3b9cd960575c8479fc +Qy = e4fc9c7f05ff0b040eb171fdd2a1dfe2572c564c2003a08c3179a422 +k = 9267763383f8db55eed5b1ca8f4937dc2e0ca6175066dc3d4a4586af +R = 422e2e9fe535eb62f11f5f8ce87cf2e9ec65e61c06737cf6a0019ae6 +S = 116cfcf0965b7bc63aecade71d189d7e98a0434b124f2afbe3ccf0a9 + +Msg = e5c979f0832242b143077bce6ef146a53bb4c53abfc033473c59f3c4095a68b7a504b609f2ab163b5f88f374f0f3bff8762278b1f1c37323b9ed448e3de33e6443796a9ecaa466aa75175375418186c352018a57ce874e44ae72401d5c0f401b5a51804724c10653fded9066e8994d36a137fdeb9364601daeef09fd174dde4a +d = 3eff7d07edda14e8beba397accfee060dbe2a41587a703bbe0a0b912 +Qx = 6dd84f4d66f362844e41a7913c40b4aad5fa9ba56bb44c2d2ed9efac +Qy = 15f65ebcdf2fd9f8035385a330bdabec0f1cd9cc7bc31d2fadbe7cda +k = 7bb48839d7717bab1fdde89bf4f7b4509d1c2c12510925e13655dead +R = 127051d85326049115f307af2bc426f6c2d08f4774a0b496fb6982b1 +S = 6857e84418c1d1179333b4e5307e92abade0b74f7521ad78044bf597 + +[P-224,SHA-256] + +Msg = 2b49de971bb0f705a3fb5914eb7638d72884a6c3550667dbfdf301adf26bde02f387fd426a31be6c9ff8bfe8690c8113c88576427f1466508458349fc86036afcfb66448b947707e791e71f558b2bf4e7e7507773aaf4e9af51eda95cbce0a0f752b216f8a54a045d47801ff410ee411a1b66a516f278327df2462fb5619470e +d = 888fc992893bdd8aa02c80768832605d020b81ae0b25474154ec89aa +Qx = 4c741e4d20103670b7161ae72271082155838418084335338ac38fa4 +Qy = db7919151ac28587b72bad7ab180ec8e95ab9e2c8d81d9b9d7e2e383 +k = 06f7a56007825433c4c61153df1a135eee2f38ec687b492ed40d9c90 +R = 0909c9b9cae8d2790e29db6afdb45c04f5b072c4c20410c7dc9b6772 +S = 298f4fcae1fe271da1e0345d11d07a1fca43f58af4c113b909eedea0 + +Msg = 1fa7201d96ad4d190415f2656d1387fa886afc38e5cd18b8c60da367acf32c627d2c9ea19ef3f030e559fc2a21695cdbb65ddf6ba36a70af0d3fa292a32de31da6acc6108ab2be8bd37843338f0c37c2d62648d3d49013edeb9e179dadf78bf885f95e712fcdfcc8a172e47c09ab159f3a00ed7b930f628c3c48257e92fc7407 +d = 5b5a3e186e7d5b9b0fbdfc74a05e0a3d85dc4be4c87269190c839972 +Qx = 897089f4ef05b943eeac06589f0e09ccc571a6add3eb1610a2fc830f +Qy = 62ba3f6b3e6f0f062058b93e6f25b6041246c5be13584a41cae7e244 +k = 5b6f7eca2bcc5899fce41b8169d48cd57cf0c4a1b66a30a150072676 +R = f12c9985d454ffbc899ebbbb6cf43e3debcac7f19029f8f2f35cce31 +S = 12fcb848adbd8b1b4c72b2b54a04d936e4a5f480ae2a3ea2e3c1baae + +Msg = 74715fe10748a5b98b138f390f7ca9629c584c5d6ad268fc455c8de2e800b73fa1ea9aaee85de58baa2ce9ce68d822fc31842c6b153baef3a12bf6b4541f74af65430ae931a64c8b4950ad1c76b31aea8c229b3623390e233c112586aa5907bbe419841f54f0a7d6d19c003b91dc84bbb59b14ec477a1e9d194c137e21c75bbb +d = f60b3a4d4e31c7005a3d2d0f91cb096d016a8ddb5ab10ecb2a549170 +Qx = 40a4ab1e6a9f84b4dedb81795e6a7124d1cfdfd7ec64c5d4b9e32666 +Qy = 83aa32a3c2fc068e62626f2dafce5d7f050e826e5c145cd2d13d1b27 +k = c31150420dfb38ba8347e29add189ec3e38c14b0c541497fb90bf395 +R = bf6c6daa89b21211ea2c9f45192d91603378d46b1a5057962dafaf12 +S = cb6b237950e0f0369323055cd1f643528c7a64616f75b11c4ddd63c7 + +Msg = d10131982dd1a1d839aba383cd72855bf41061c0cb04dfa1acad3181f240341d744ca6002b52f25fb3c63f16d050c4a4ef2c0ebf5f16ce987558f4b9d4a5ad3c6b81b617de00e04ba32282d8bf223bfedbb325b741dfdc8f56fa85c65d42f05f6a1330d8cc6664ad32050dd7b9e3993f4d6c91e5e12cbd9e82196e009ad22560 +d = c8fc474d3b1cba5981348de5aef0839e376f9f18e7588f1eed7c8c85 +Qx = 66f49457ed15f67ed4042195856f052fe774077f61cebcb9efddc365 +Qy = 3a6e3f3423eec7308a69eb1b0416d67cc3b84d24f251d7cbdb45c079 +k = 5e5405ae9ab6164bb476c1bb021ec78480e0488736e4f8222920fbd9 +R = 7b7beaf9f696ca1a8051527478c4c075ab45aa4768937886dbf38618 +S = 93d4cf110a37c5a6f15c4e6024822118539e860dee2f60b8c3f462f6 + +Msg = ef9dbd90ded96ad627a0a987ab90537a3e7acc1fdfa991088e9d999fd726e3ce1e1bd89a7df08d8c2bf51085254c89dc67bc21e8a1a93f33a38c18c0ce3880e958ac3e3dbe8aec49f981821c4ac6812dd29fab3a9ebe7fbd799fb50f12021b48d1d9abca8842547b3b99befa612cc8b4ca5f9412e0352e72ab1344a0ac2913db +d = 04ef5d2a45341e2ace9af8a6ebd25f6cde45453f55b7a724eb6c21f6 +Qx = 8d642868e4d0f55ee62a2052e6b806b566d2ac79dbde7939fe725773 +Qy = 79505a57cd56904d2523b3e1281e9021167657d38aeb7d42fc8ec849 +k = ec60ea6f3d6b74d102e5574182566b7e79a69699a307fee70a2d0d22 +R = 2fd7fcbb7832c97ce325301dd338b279a9e28b8933284d49c6eabcf6 +S = 550b2f1efc312805a6ed8f252e692d8ee19eaa5bcd5d0cda63a1a3f0 + +Msg = 4cc91f744ac858d3577e48813219aa3538dd813b186b42d1e6218376f07cc1cc448ddd6b37240e98bf953f49cf54d65c12878b33c0bf6eb1c60254f0b6fa974f847e53abc56773eef6f29885dfc619e6a48fc15a667ca94001a0c945b6357a53221b0f4b266181456b0d2d25e90708777f1a6f85971c00140c631c1991e0fd06 +d = 35d4bbe77d149812339e85c79483cb270bdac56bbf30b5ef3d1f4d39 +Qx = 7924b1d7f5920cce98e25094e40f2eb3eb80d70b17e14b3d36c3671c +Qy = 26c5af35f71e61858582b7cc2b41790597c53ee514ffdf7a289d108c +k = 751869c1d0e79eb30aae8fbfb6d97bfa332123fd6b6c72c9cd3c1796 +R = 26bb1b92b0f01e94eba5fa429271371db527ce857abba13bd1103f64 +S = 836aba9c63e1252c2b2d72a21e6a41b82241ebe32647e7f814652bcb + +Msg = 58f43cc1924de4bc5867664adbc9d26b4f096a43aca47c27c52851b006dc2a658919ef9ce5b5ac48372703be15ac51631c2bd84b88f479f113b0569a9a09e230ec1e8e573474c6075284d3e57d973829af35325d9e7dab4a5f9b065155bbcaff3642a82ef4c9b9e127d3575c050721653da3b087d3fa394192897a5519527d19 +d = 2c291a393281b75264c9b8817af684fa86a1cdc900822f74039dc5d6 +Qx = 18cb5826ad60e6696bf07655032a3749f6577ca36da3ccd6e66a137c +Qy = 194e14820fe02d784fd1363ff7a30399518309765bd3f4412d646da2 +k = e2a860416229dfd3f5a5cc92344ca015093a543943a0d8f73bf2b2fd +R = 00e300c1ef4a8c4ca5da6413856f8981db49de29bdf03f32ffc3ceab +S = f250f18a51ba5f63e1584097841099fa6ae4e98ee458c061d1d5aed7 + +Msg = 113a2806b052fde683ee09453098e402204155afb3776fd1cad3a9103421d327eab8f9ec0dd050ffcc83f93b34ea707705fabeccfe43ab1a71c95298fd3ec769d99ead1066950eee677d225816e0faad19cf69e1b35d16771689e2092cafe16d7c0dd7b0db73fffb8d0f3eaed83004dd21e753530ec939c89ba25578fa5f785b +d = 831ea25dbeda33d272a1382c5def0e83929170ab06a629eed6ee244b +Qx = 076518e393940d42dfd09819409d66966d8c9189c83d554a9cc8a082 +Qy = 44d0ceaf4c0f50e46bea4a52e30423ce3ada19edd363ac5694c65cb8 +k = 6be6dd9f6a083915ccba54626caf12d246d3aece0a7eda7d8d85599c +R = ff1460946e06fb6f5d35e8d2625ca70ffb9b45308e3fabf6ad8351b1 +S = 6029aa3990918e8cb8a388d53b0772e5cdfff49c3405fe0d3a95933a + +Msg = 64cbfc8f2e2149a31b3e8a80c4a552f6c62aaeb7990b6e0ee55500a9d17be04213406578caf315951086dff5c2af3b5ce17d425d185101ef26f86396ba3a129a4f3f8e2dd595f59efb6c0f5c2dcc394569d7268695e9ac7daa84203f1f1895f1f9e4b514a5c9cd23baa63454710144fe735ad9b8f42d8c43267aa434a26d7e5f +d = 70f74c7324ef137318b610ead8ddc5b964e0eed3750b20612fc2e67b +Qx = 279649e2a2918e683520cde3fc98b0ae58a7100e8de35e7c9cc797b6 +Qy = aa4de6be34be61f02880139787b9038f4554a8ef1c994b887c2974b5 +k = 8e984864f86f7a2a73f3edda17dbccd13fac8fa4b872814abf223b1b +R = 3b18736fa11d04e27e2614cda03a63ec11a180f357b0b3192920d09c +S = 2f0f3dbd570727b14fbb29155538e62c930dd51c4035275c1365dc60 + +Msg = a10a11c8e30fff118d371daf824f16c08200b83ea059436466a4611ccac93b2dea2de8c1006f946196aef7fe9b0c251a391b0340f21797798278b412ff2b53842eec6450728e2bca062f8337a2c204b9ea04ff660cd4d4db559f2f11c4d8ef199021339fcc82396f7a93926cf5f247e37d8067fe50692de54f102bd5ab51925c +d = 026be5789886d25039c11d7d58a11a6e1d52cb1d5657561f2165b8a8 +Qx = 3fa617c50b177da1a2bdb98b780ad21ad1195c4bd24465f6187de3c9 +Qy = e3fd8d8876dfd03a4a4e31a1acad3a08d983826d286c250c4e5620c1 +k = 0128b8e3f50731eb5fcc223517fc0cf6b96cd1d2807eb4524bc46f77 +R = 3a6b633f96f3d0b6d54f7fb29ac33709e4f0dd8fa0e51606ed9765ca +S = 63e8c119dfa51784decd864f6911f2210a80f8f02d472d88df10d119 + +Msg = b3f720bf566ffa369259f4361959ae0641d2755ec264a4c4349981df2b02563275b2b9adb5aee47f7a456760a971991ffed6b17809bb9694138d1677fa916123795239353158fc6b22d10f20d26f5d2dcd8c56c44373eea5b93067dba2d7c5318dac2e9e8714873cb1b37f58c011fd14fa1e535554efe05f468bfc8e11cd8b99 +d = e79c18d935c2839644762867aa793201f96a3cde080c5968412ce784 +Qx = b7ae1e992b1c7fde1141f40bd913358538ca0f07f62b729f13cea327 +Qy = 811252d12120e04805fc171a439d382c43b68a21e1a0bdf5e4ec1da4 +k = 7abedab1d36f4f0959a03d968b27dd5708223b66e0fc48594d827361 +R = d35047d74e1e7305bb8c1a94e8ae47cb1591c3437a3e185e00afe710 +S = d9c425c9d5feb776ac8952e6c4eee0ecd68aef2f0e7bff2e49c9185e + +Msg = 0a398a46df7ccc48d1e7833f8bbc67100f1ef77a62dc78bbc115b2a662f9591fbaaa91ad3d788e2fdd1b3164e45293d4f5686c151296901768028ac80ded4bf89c647ad35f0c7c4cb318c0c757c1d83c44d850e5fd4677281b3f13b1ee54de79c8c042813f9d3312dcc6111a68299cb7e829557d7f3d96e702f65aefc6499415 +d = 0d087f9d1f8ae29c9cf791490efc4a5789a9d52038c4b1d22494ad8c +Qx = cd95cf8fb1cd21690f40d647f2353672a1076cc6c46bddaad2d0fc56 +Qy = 934262f74d9ee0f8a2754f64cb7415923d64bf00c94a39b52803f577 +k = 557d0e3995dc6377b3911546dd7aeaeec62a6d8f2af6a274382fc37f +R = 56df0ea6afdcc232ceb41729eec00cf906b69b6e28423a36d3c92cc5 +S = f4f70fd948c9a147f55317fdea7b8a84c33e721014552d5800d63edc + +Msg = 8c33616821a6038b448d8918668977fcf1ef5aa0cf7c341837b39bbcc9bca875a3757f4b392630e9995b9bbe4eb66978b877586adaa02f99d2344dae082a7603351d8ffcfca081ab403cd0acb90d078dd1d0789c2eb3185c62bff2d9f04cd38e509e3b83c12ed0a5c6808fc42f7ba5b06acdc496c8ad9be648ee6a4505f8560f +d = 0830aebb6577d3a3be3ba54a4501c987b0e0bb593267b9bbadb66583 +Qx = b88652020e083ccc1c43dc83d1881884dd4c7e3b4e3460b344b1ea64 +Qy = 22b69b517f86d7c26dc37c0f8feb4bb07fe876149fbcc3334fd2805b +k = e4f4a3280574c704c2fde47ca81ec883d27f2c5a961a294db7cda9d2 +R = b30b8a0079d9a134b5e1618c2ac63e3fbe0e95866b9dbc5f423f2707 +S = 3dc36746610271ef66e0aa52cc2ccadc5c9b08dc769e4dc4f6538c11 + +Msg = 94d56535fd4edfe67a0daa6579f9d53bf6b7b8830ae2aeb62892ff59f18756ddf2811b449c7d20d65d54f8507de4e7c50eaa084830637812aa4b250a4d61ab67845be36e4a41cdc0a70f8d6e3a63d4514f0dc197e6486015046a316153d5f3a3a4a0ae1ed7ea5fa55e12e73d333333685c02e0eb636234ea7e6d4b76b4b76b5a +d = 2acc9b97e625263e8e4cd164302c7d1e078bfcdd706111a13ccda5b2 +Qx = ce1a06f82df874dded37cca03b56c0648e4e8917ecd40ee73ee61588 +Qy = ceb6177b8f1ac7c5c6e6e1f7737cc3026952ee392badd2cd7af32f9d +k = e401fa80f96480d437ed4f61a783888062ec33d530b188fd48016a6d +R = 28674f447c4742e4087bbccfb522fbad4e18b56031d2ce8f532b078a +S = a5a7a13d15b423dd17771f73cea98d89dbffa846cc209b45c0e29b76 + +Msg = 5d8ebdf9eb28b47bdafaa36bf0b66a9eaf99b6c83959da4f2b1151b4f4ecd28fb115a64c0cb9491093a7e9b9c53ec423e4c72e7765bb9c818da0e8c428667e44474a71db4867130c77c40bfd8544b2d7b9d6464d2b8e6a48482153256a32437c3a747231f51134dd14c703407e31146a6fcde23bededcf16950486e90ca69ac0 +d = f4e873d4fb944fb52323406f933815092b7672221de4d1c45917f3fc +Qx = 0dc2cdddb990341adb1de73f02d87fc3822485a659a15145f4251d5f +Qy = cf78b2a83c7352eda1af2c74e1804ea04b35f76c04e89d90281dc2bb +k = 5d1476c682a64162fd2fdc82696fc8cab1469a86f707ea2757416e40 +R = 82982b38ed465138df4018d7cfb835edcb591cb57446ca49d163782b +S = 8ef1d7b326cabee7f7ab95b7b98d3c27a069c0fd95a1599c0ccb422b + +[P-224,SHA-384] + +Msg = 25e4416695f77551fdce276355528ccf1ddc2483821c5d22d751d50111ca2fadc6593b52c74f4b5957494f1df25b0b2f86950d0d19229ec6506fee8581d2dd09d48418b146ff16bd84a17ca0dc83b1888eb407376da6c8a88fa1e60b8c2a2471dfde4b3996ef673d5bde3d70c434dc9f2488e9de16ae657d29e5e59ec922a1ec +d = 62c572ee0d6f81b27e591d788bfc2f42b5105d2663078dfb58069ebd +Qx = bd6ba605639b98fa8113a16a3bb004ddfaec901c98a931206165f4a5 +Qy = a3190b10ef39e88abd60b2293b4707512b45c6c5ed5794cc11454427 +k = 0f0bb1e428bcdebf4dc62a5278068efc0f8ce75f89e89b3630f102b2 +R = aac0ea27e129f544abcc77f110e70bbdd5aa3e425dc39d5e8887025d +S = 10e5dd06aee6b8419a04aa33d9d5678b0039c3acc3c4b61fe106bfdc + +Msg = 9164d633a553deccf3cbd2effccf1387fa3177cd28c95d94a7d1a3e159c5e5c027758cc26493301b2f4d141d8d07a5fe5fead987ce5f30abeafcb48c302afc6c2309f0e93d9b6818cbb6972d222cb7b01302dfe202ae83b89f53150ae4a0e2b8fc0fd1091f19b4ab2e6ab213ab322d04f2c5f57113bfad3c5675227237abf773 +d = e2f86bf73ba9336fa023343060f038e9ad41e5fe868e9f80574619a3 +Qx = f5d5346f17898ea6bbdfff19c216a8757a5dc37b95315f5481628381 +Qy = ae61fd172ac8b7a4f13870a932dece465834cbd4f50bbcfb802c824e +k = 35724ac043e3b44b73b5a7919cf675190306d26aa67c27c28c873534 +R = 535147c265af138eec50c7fb570bcc8d2e6f675597b0fcc034e536bc +S = 743812c188a1dddf9fb34b90738f8b2e58760d6cd20ccceb1bb9c516 + +Msg = 019df05929321ecea7ee1de4f412aba1c8d3c24437db04b194a68a0a59dd871be10bd3a4be6edf551350ea49fc7155a4d887e1221486291abe77a30633a4c4f7868fe2df24311cba0c73804883954460e122387ed414111ff96ff1aebac8b6a6491d8a0d16e48a63bf3d027c0f68ee4a4b234d73b412196706af8ea022b4dcef +d = b0a203438e2586d7575bc417a4a798e47abc22aa3955b58fc2789f17 +Qx = dc5d217862a1e5b00c95affa9d8b925a72b9beaeb7a86dc397e788d8 +Qy = 5f05f8e976ae1eb1036eca6d683a82850795bf9127dee5f8b2859445 +k = 408e9c8b1f33136d6ddb93ff3a498bc09d4eee99bf69cdd5af0aa5a2 +R = 1b5a964c8b1fc634c6e2b82322499df1d7f0c12a4d2a77723c816ab8 +S = cf54599a36ca064fae0aa936de5266f87704409d22a15d28c01b7f2a + +Msg = 5d09d2b1d3fa6e12c10d8b26dc9aabc8dc02bd06e63ff33f8bb91ede4b8694592a69e4ed4cdf6820069e2b9c7803658949e877ffe23bf90bcf5ce1409c06c71d86885a94048b05ac0ec9db193e489a5a2bfa367caf6aa8ecdb032be366174343f6875d2fe1785e8d77334f5f469cec64998e08d3303e5c9a1923b34fdc105d65 +d = efcfa50fad6fb2065f9a55f28c0c42fa24c809ccb19b6fc6d8ffb085 +Qx = 61521a0cfb72be77ba33cb3b8e022743cd9130ff49e97093b71aa178 +Qy = ce0819aedaf6fce639d0e593f8ab0147eeb6058f5f2b448231584ea9 +k = d1eea821f286eae6ebc1f61b08f9ad4323a3787e94af4c32cd31351b +R = b37caaa71103752ac559f9eb4943324409ebfa8b585f684dcaa5c411 +S = 7c28e7619e2944ab4b7be022878c8052ebdf2cae5dff4f976c49686a + +Msg = 50f6dfc81c6cf189e0a310f992907fe93356cee9dea9a41c7671a8daf3f4cfe0c459ce6122c1e731dbf7593419d7114cb73b46956158a982c5d52c72f43f0f822046093c69aeff1f7e4cd8af00ba655c5baa2e7b6a400b4be1f6fd51b3e4cfb35a69c80a28c5cafb771b6c2e52e0aeef0e3fd045e8d40745f3f8b74fd969f816 +d = 61a17816937987764cdc064dc7b5b4f5b16db1023acdfe25902957dd +Qx = a7e975c0a8f87c683bb8e31bc160843a7b69c945f4850bd60e1c08c0 +Qy = 8930a454dcc2aa13bed7ea89368b2c9d689d816b2acf4e52585ee9c4 +k = 44b1fdec2629f9075f89c134ac28ff19bfddaa9db02a5d7f853582b4 +R = b0f5635d8bc9c53a1d54a3ec63de59ed66e6b2358d4ab79755414326 +S = 67c68fe265c7e5aba4232deeafb88545a2aa266fb9f2c2bb3f3ae8d2 + +Msg = e90129ac6672c85bb7b6b18e9dc199c96c81fd65034b53c77818364d512366fb9cd1bc7c82404c451e561fc1ed916c0948f6ac561b33a1ccca093f07684b8c2bafa9e966377bd208556018a5bafb9edcecf70498c7140fe9c8cf3ad8b8c3b0aa489df797944465047465415bb0e24333235fcdd59a98829a3941eaaf62033e82 +d = 79d5367314ec664aa0f6ca36f95549502a05bf8400bf532d669fab8d +Qx = 3191f0237102dac159032ab2dde53cf56c9ec827b5caddfe9e83c02a +Qy = b496b1bdcca4434ac0d0d91ea38ff3bc33f9f54095bfe17796d5a9e2 +k = da529c52f5cc1f435d873109cd991d6cd7e1631d9ff1dd9521dd5db6 +R = 8e0ac63903f4921755430572c3f08bc272790639bdf1009fe2a9a714 +S = 6278c841a2d0a270791fe54b36c49d426d67907aa4e4f59c8638ad97 + +Msg = 3c9a483c9bee33b601549c592a82e95b4319b1e74b777877f0971bcb4273716b268e8f99f876e42f942f4cf08284896bbc1ffbf094ac0956c3cedfc3580cffa8c74fc6db29a371f2da2d05edb9185ece741fe0d3fabfe9d5b4d373755ebed13dc6840cfa3283b9ea46ec8b95c434f253ae86998182e9cc0e95ee64f323fc74b0 +d = 1320eedad4745121793a7eaf732b0b4498f7cb456cac8cf45a1f66f0 +Qx = 9fdd99906ab77fd29e9021bde947d05a7a9eb153612269bfb0899bc9 +Qy = 681b65b9ac8e4c2899bb622dafb253b7bf5a6e38e5f6595f997c291a +k = 66ed8d8934633f4125f593cf1b1d3745c4db1f15dde60cf46ca1c7f2 +R = 80199485a3a96447b39f7679cd47412a78675ba17dcbd10465dc5b48 +S = a251fd9f136a3cb0dd0bc80659ae032e4a761ba7045da0034553fb8c + +Msg = bfc073fdda63c5fccaa0ca8770c293e8154e7aec56128bbac4fdbd541d602216ebf7ca1e02b514d6e396f20683802ba3f334310a9226576926e3bb19ceee27738d13377cbafeb09d091043501702a07aa31d1f29d50ddc55adcf16ffd40578e734a4e6cb6535f26ad48e0c62ad90e79720000e87d419e92dca3e11f943655b03 +d = e18821329447d3f65ba7279e96bd4624ffa1b32b90f6e8331b1e876d +Qx = 46c9ed837232c47022df2f1a1578fbe65ac9f2e81c98a74cc22ea31a +Qy = 6fc5e9568ae62b31412a0b0b367242e9fd7e518c83aa06a069e1d90d +k = a4c1eb402a2fb3af26e0e14a3d2fc8ed3bc1a8b2475270356a79fdd3 +R = d478b68733d8ad44be46766e7b66af782fbdc7ff7ed0b191176da98a +S = 5eae9160ccf71fd1d359d89cecce72ef8afaeee2365f6ba828aa450a + +Msg = 08079955d1a1f33728128c73673ec9f21a6ce138dcab5adc4dc068e6ab57314b9fbd8b013123b2fdafa9524fbdd0288777a233de8055cccfad83046ada6a19f01c47817496667bba8fc8b9456fc0e044a562d931dab1adcb66af8b66325bdf28d83ded3e2937958ccd19da540d70ef2c189f55a506c9c0d63406394c5bd3823b +d = f73e030d5a696b358986d3efaca121cf71f775f8835a21e6135145d7 +Qx = 9ca2c6ea87ac8dd3a23a5b4010841a7c8af309038882ae44634bcf55 +Qy = b0a347dbd5ded3b8702ac5a457e8b32bd4de06fd315095fa1b7d5fe1 +k = e3cc786c1288ea567836c51d6d69dd0cab5c015987d936ccc3a4beb3 +R = f1234da71761b7a0f49e661a419d2a739bdc4544bf87690e3d2f96db +S = 096d16bf8020c3d3c233894ad8eb81206010e62c6e692a215e088fd4 + +Msg = 23900b768f6cd42b8a8df0dcbc9cb5daec8de36b9d5c619adcc1ba2b649103d5af123746cdf19c3fd0665a6fb9338156182aa06181e3c6e37ce56979612af2927440424f89cef43fc754854b8a5c43370808cf5f9929cf47712512ce2f8a2a20d2e9f568c2848b27dfbe09142843c83905ffa5da3b15501761b03dbc2c5398b6 +d = 7a0789323f8741c157a1753ae165ecaf8e8b03a60561f8b80cee467c +Qx = 101271a9addd4bd1f19d00bf116c8524f52cefd598e85dc381597acb +Qy = 2f17d14f4d8ccb28b216553718152ba7c104646d8eca986dd9ddea39 +k = d169f04f05b60c625cda864d187938863964dab7bb3b9dfc04b05519 +R = e4a51be686a764b709da23ab48b1985e153c6ee238d945e743907afc +S = 118a8f1ffe3cd556ce6345bd1a398dd9cc3729b7fd6d8af9bfd82f40 + +Msg = 1eb28c0bcdd18f73e347f957ece15b4cc83a771b0877e1feaac38e24028fb38ccea8b54ee017dc7c3d5a1327bc6f40b294aa65d7dc487f278846cd101ee84202f14b38aa2c275046aa2577f65ebaea41cd383e8def2fd0b4444dcf426fa75c4082cd7fa035cdb1e0d34a3c79d42130f5b0273eae75bc701dda3aebe7358f41b5 +d = 78e795d0edb11fd9e28dc26b21e751aa89bea0d87932ef11c95c0e18 +Qx = 9edd544107977134bf6360d43ccabb3c94d627c03963c0a04b439627 +Qy = ece4c61d319a0e41f3de7863e7c355bac94395aaa74cdb5f74a87a5b +k = 36f7c0f76808b826a0a974a1fd6e155e00a73f1d34674a8f88be405a +R = 3e319444438bc2cc92f323ea842cb402b3c3c2448c89869ef7998edb +S = 3420cc38f058f41c31e71f4b1ad488f801111c73541de69fcee60695 + +Msg = efab51855407438fd5c250670366bca3c026ecec4a59394f00d8a4b51746d0c4564366656d507e3e13e62fe7abeb976b8859895848dbaecf6582f1898ea06f00d4247702ed9721bd375aa83ae4c67c2eaa6e080777ea5ecf2cf787d785389560ac91cf63a52f0373c3185e18a3b8a466e21b61a239f1b77624eb1acacc76c4e1 +d = bee02d8bc5bffb3fd3b4c9d6f686409f02662d10150d1e58d689966a +Qx = 8848f964c847fe9dddc774618d4588c9cd56bbe588d7b1fb369c8bfa +Qy = ebbb699fbd0dc08859fe9132285fe20dff3b9d561c0640b6e0717607 +k = 59f1450d857b40e5552a4b8cd4ab0df2f01716635d172c1106840f21 +R = a206d8398a16a991bc217f77f23c6f648384f254f255a8a876404444 +S = eb1169cb5b1423dc0bfaffe565ae57f986e00de06405e3e7b605862e + +Msg = 31c29ca10279a417f0cc9b1382cf54dbfdfc89f2e6ef08c403c11f580cbf8674b141ed1a417563282d99a55fc616d836421cde9424815c95e7fb7668bf3f137b29937f14882d74e034b732d78d91af7721aac4950734f5fa5d4b4d35534974f8cab6d2e6dca75ddb57e99148c8a59df9fc5bcd723e546e8356f671cf2f65640a +d = dc0ddf6e501418bb8eafc5d7ccc143369e2aa441df8fc57d5f94a738 +Qx = 063a5d632f4144376e14cfb03ad8ccf1489b613acd184d20dff66545 +Qy = e77727f057b043d8a0f7458196b72e92d11f85b0891c6aaa9d915f58 +k = ff0e5cae2671db7a1b90e22c63e7570bdd27352d45bac31e338debe0 +R = 5bc0b4998481ecbd3b6609184a84ca41d69b08c37138097f559259f8 +S = 0df8828eb1ca85e46405b94e1a2972c34c5e620a54e2f640f04aecc5 + +Msg = 8db476f92e332519c1a0ece5d8deded6efbd2d8e8784eea0a6b4c3b4296c35f5f8de4317e5c1627b91fb1973fee86c06e4992aa5a20cb7475c8808ff1da354d07a488dffa7838c6ec1e3f99e3acba831f27bee8434eeda3eb36d0c6df3658883cd40068b1bed841310f6eb38d4a3d07d85848770ff7933c054cd8b34662660b1 +d = 229d89b2fcf8441ffc95ebb2ac2ef156e25825782044b2b8bd6a3e01 +Qx = de616848d8044a44789ef1ba3a6dd66fe9257ddc57f7534e59a701be +Qy = 26cbf74a6d25e5b34b96d30f327abd574cff7f7dbe6686573a7d6c5c +k = 3b18ca6ec8e8e255ac88f64302745ca0b73ff94b2b2d48be95b4aaee +R = fa94fd8b827c06115c1eefd50afc02ce5926ee0e789667783c01c34b +S = edf766a66973cfc33e4159966c07321a7f6549c3c60e8586ef41402b + +Msg = fcb272c828fe8fd3c6f8de9410c7b6e2b36717c1b0e5e359e9109bd7fc378978aa98182a9d99961898ed88999b050d3b64d1457d7a899d6d273b9f4dde2aafa36d76329d62509043c338f265fc4c7d938459b7fa3b230a9f6cb632b61489546bb4181a5ad7f0d7369b8caced48eb374b075b2b325bc86add0f3b680cd9e80acd +d = 97d747068147c0393a0bb5c159e2c9f1bd538f6204823294883abe28 +Qx = 3858a576eef2ce24d01766997fb81b3f3f78b6104cd188610be221d7 +Qy = 95ffc677ac7bfe3e0bb4cffb17355a964c8356a807151b3cba5d1f4e +k = c1a2ec1ef16cfd5107c892790daefbed061be78bd8576696b60f64d5 +R = 18c908541843fcdac99b9ff6bb397f3f8094d16b42670216e4eaa2d7 +S = c107a8a508ff57c5d4f78f86cc37e129c864d1c44ed5e73909613b74 + +[P-224,SHA-512] + +Msg = 7522492bdb916a597b8121f3e5c273b1d2800ef8c1db4f7dcbae633b60d7da5193ba53a63d7a377b351897c3b24903ae1cd1994211b259be3e6ae2cbc8970e4957fdf782c7d1bc7a91c80c8ef65468d4ef35428f26e2940ae8b0bd9b8074236bf6c00d0ebe83f9ddb2ade0f835138d39f33b59f244e0037c171f1ba7045a96f5 +d = ba5374541c13597bded6880849184a593d69d3d4f0b1cb4d0919cbd6 +Qx = ac635fe00e8b7a3c8ef5655bdfb7f83e8532e59c0cc0b6534d810ffa +Qy = 1d067aebeba66e79b28ecfe59ac6fdf5e1970dc3a84499c9d90cd8e2 +k = 187ed1f45c466cbafcd4b9577fb222408c011225dcccfd20f08b8d89 +R = f83d54945997584c923c09662c34cf9ad1e987da8bfd9be600e7a098 +S = 4ff2dba9dba992c98a095b1144a539310e1a570e20c88b7d0aa1955c + +Msg = 61097114ff855c3e34a62d9b853f8982d35f29cfa4a89893badbca7849e5fb437a1a38d6451bf0ca5a0d528e352b8e4b57f2ea359a7fc8841d49dd3e570f9b016f14156b0bbc4be822e260bd147ec081454969e11cb0034b7450ef4deb7ed6edb977e2f4ed60121aa095fb0ab40240dc329ecc917f5c64b4410612af065ee9dd +d = 1e27187134d0a63542adf4665fba22f00cfc7b0a1e02effe913ceedc +Qx = ecaea8ceea55c3bd418fd34a4ff2499e25e66a104eed846bc00c31d2 +Qy = 3933a356ab1f2dabc303ff0a5d076131e77032e6f502336883bf78a7 +k = 34cb597deae9a3b1cada937abcd247161b19b2b336b20e2e42ae01f1 +R = 58177ba46fb291490b39368774accf72736412c1fb5ee0f27b9b1e02 +S = 58337d78b95a080bfcabb5809bee012501b4da84b8ef310a4628f11c + +Msg = dd09ae6c982bb1440ca175a87766fefeacc49393ff797c446200662744f37a6e30c5d33ba70cbd8f12277fd6cc0704c17478bbab2a3047469e9618e3c340a9c8caaff5ce7c8a4d90ecae6a9b84b813419dec14460298e7521c9b7fdb7a2089328005bd51d57f92a1bcbeecd34aa40482b549e006bbf6c4ce66d34a22dda4e0e0 +d = 0905b40e6c29bfcbf55e04266f68f10ca8d3905001d68bb61a27749b +Qx = d656b73b131aa4c6336a57849ce0d3682b6ab2113d013711e8c29762 +Qy = 6328335ffc2029afbfe2a15cc5636978778c3f9dab84840b05f2e705 +k = dc82840d147f893497a82f023d7d2cbf0a3a5b2ac6cc1b9b23e504be +R = 583af080e0ec7c1ba5a491a84889b7b7b11ccfe18927c7c219b11757 +S = b23700035349df25d839f0973bef78a7515287de6c83707907074fa6 + +Msg = 37a73e2774d3b274db426c89b945696daa96035031f72cea01894b24508c7f81961ec254d36ed6a0f448e11cf7950af769dc6cd2c47e52c6caf0ea92c270974f0214b4db436c36a60fb722060a6bb544462a82e1714f5906ec32886f7d59ebf289541c3a00ec1e004892ef2b1286a0194f55d083c6ec92c64b8fd1452e1c68ba +d = afbaede5d75e4f241dd5b53220f3f5b9c1aa1d5d298e2d43236452dc +Qx = fe83e59fc8ea8b939355d3258fe53a64d45f63031a0716b7cc416173 +Qy = f151d23060f1c856eb7f1f58be72a7228c3af89e43b56e9695b558c7 +k = 0fbbe7b40136c81a8fb894498d5502157a1cf5a89d0643de92cd38f6 +R = 24f3f457c7b72b7e759d5a8afbf330e31c5d8d2e36f92c0e79c5d87d +S = 36fd1193def34f12a960740fd79fb38bf2b480726ccad540eb42cdf8 + +Msg = 9dc2046ffdc6804544db964481abe5d2d276a2a9eeec4c7ad40215b1de23561d402db69bd0f6eec2254711eea4487c64d9a6b62c3ebaf5ffa8db6e7e3a6e17154d126967a47a853a6f8339bdca9be306a13c7f992ded7619b0da59909a49b1e0930360e05b47f18628a36d69b2f87f2bfddd6a5d4a72f84dc76dbdd43f3a6a35 +d = 950b07b0c2b7539a21b5135bfede214733f2e009647d38d8b21d760c +Qx = f43d13bbfcee3b724063b3910fea49fd591b81e86fdb813b1a492d0c +Qy = 6b4c8d6fa5dc661889e3cf5ec64997a78222837885f85d2fe9b684fb +k = 83e110d0d1e700d2f36543028737d2a2f1474aa3b4b28998a39e4793 +R = 2685265bc878e85d10ab13293dec190881a57c4a467f8fc2170432ea +S = 80a347bb49036522369339bd6485a967cdda818915d8eb947302fcf9 + +Msg = d9c6847fce688c5e7525a1098b545cb6c15dcd21a02761fc82fc664372a667390680135f91c01a2fa5430c634b1a6d1cd6002d8aa021e7bf5956a7901c2f81bc25d502ba5f55a55f30c0323dc68205cbefec0538e68654e7b327ac1743641896c3e740d8f66f400902b304eafaa4e0d8cffae140536f0922444cc3216a675697 +d = 015bd9f5dfef393b431c3c7fced24385d861ccb563542574a5d2a9bc +Qx = e868690641e2cda13b289a6c5d2fb175940396044d9cf27b4f2240af +Qy = 4c78c9abdf2b7fc67ed4497001d7bcf1daca1739dc14a661f91d7c40 +k = e2374350f47c08f3c1359d4edf87e61d1ba4e7dd1540d8d9062efa79 +R = e12dc088d2bc032bb214c77d0e0fb749fc8e61ebe1ed72996f1084b6 +S = 0ab58aa31e0bba5fbc76855e6549f1036fba0a589aeab978ab01b8fb + +Msg = 69df8a01b66f04930efd2012ff2243874f256ca8758145d2a9e4ecc84d0dbdbd0dc494ae06db0ccbe819918137c90957114558580d6623efbafdd342b38dad9f08708084d32f874fba04782ce26aaab78de2102ad171f8a8f2b30b5bd3d55fdac5fa3acd6f7def7e61c2533938572b331ba6d1c02bd74bfdbf7337ade8f4a190 +d = 0a3c259df933247445acffb6d8265b601d597fb9997dc2a1eb4deef4 +Qx = e67f4385a9da54253cc371ee9bc6739ae6385a4b87669c7baf0c460d +Qy = 2bb00b6ddd7b67d9ac5653ec04ca8529fbf16f815c04da3c2e58e82d +k = 8bf5859665b6a23e6b05a311580f60187ba1c4ae89e44877fb48af66 +R = 653675fb993c3fa9e57b32e33029ec230b966e8077c72c1ec90ddefc +S = 792723bf87e315147cd4303de7f1dfe95cd7658ebb95c38c1a196140 + +Msg = 927524982b8d60777c1105c86fac05f634abf58c73f84fb95d81ba0b86e1e43592c4fcad2e395a40fbe7005697d86088e2fb3bb7287eb3f917d4f2dc281f5cbe65d05b4f9623bca849b10a03beca6aa2056a12ebb91cf257ac448c5e9a78f8349a6a29b17c8978bef43a443cbb8a149eb23f794844fc41693f2dbb97181444be +d = a1c8ef463f9e7e3dd63e677412f87cf9ea4ac9a6a2dae629da5b9916 +Qx = 400e5cd4b315ceb309545cd3277acb70bdae2073fda6ad896ea14b27 +Qy = fbe1d2466cd2e116f38248bd5cabaa6cbe6c4a2694d998abd7b0c991 +k = 82f55a25d3ed6e47c22a6eed0fa52ed0818b87d6ea7950281dfefc09 +R = 16305a46a3f6f9e216ef8f6a6f5f0760d064a885657c864e1c1ea035 +S = 58fd97050bfbca6f87e64e1458c4ad80bae26e280356da344ad3b25d + +Msg = 5f9042283561e7f19a436d01c7ef5a950a6d77ede5629cd7e43c0a5d58e8c5673c37945a453291d12938253c71dbe12c8b022ba7276eda6be034ef5ec1ec77dbd1e08f0d7b8e7725b7ec671c075e008a20f77f4ab266f97079b0aa6337df59a33b881954084057b21f294dd14bcb0869a4a6f1f597955ec7bf9d19bb3537a66a +d = fa511dbf6fef7e5e9c73e4555eb75d435f7884322d9faf5d78cacc0b +Qx = e8dccd706c31f895f2f261ab979cbab51b8ae28196bcc12a42046380 +Qy = ec246be8e71ea3859cb717a59990fe22e4b76858ff49becd70739a01 +k = a37d665fe4314aa4cd03eb8e6a1f366b43e11fdb419c96b48f787b62 +R = 05e4909bcc172ab4140be291aad4660e375032bce2d762b6269ba764 +S = e347a1c9d3670690e1d8d1d4cd9579848f442199c10526488da5cebf + +Msg = c2ae5573d3bf396523bfb703db8502fd0760cd1be528f6ddbfb95aad399e0b19f3bd9e0fabdb05d49e3f893dffec5b627c9c2f7ad5f32e92e4e27a38cb5c28657657377fdfa1b66cd7ac3d15c6d49df92d284db99f69744f37dc7cb4e7d52920fdb200a7942623a7057ba82e467dcccaa5da416b48510d8364446a6a5e2a5aa8 +d = a58bd53646400a646f0e4208320dc679a9664d1c6bfb27fdc8eac7ea +Qx = e22e0dc4ecd96eb0071b72ba4b4988bf784f3fe73cb81bfb93d9ac4f +Qy = b3e213e518bee1367a4fb3703b9008bac9d95a1fc4aa61225fff9f3c +k = 42c5b6f87d3bb1ed74f5ee8398d8f8c61e9e50ffa7a1da12d39893f9 +R = 5c0e5c6f057de1e99ef5d237a60d7a07fa9a42b120a82f573d9fb7b2 +S = 2fffc0bf550bd2f650fed085a84501cacfa6a1bb984df1f9237eaa59 + +Msg = 03c1a1cd30a039d0dcb22fee2450a7fa79495a0d0f4f43d2de4d75bce003c0334a8860f5c164dbd94888a9f751235a3e570d31070e3e1293a7be616af7176600585d36ac013600157d2569d491da4b8a3bf3630c26e0b9925412189f50b0ae6f04c86477932e2ecd8c3546106ae1ebc684cc3adb27ed665eddece886adea4ce3 +d = 64bd4452b572cc95510ac2e572f41136299ff17f6e8448f4ffb571d0 +Qx = 92521fa25c2e034d127e0921efdb167f0b2ff8b20504487ed87fa264 +Qy = e72c770e37375ad7dc2c4e63e5701826f6606f6ffb9461ee61b4e872 +k = eaf76ee4d7e00d13d8a6d03dffd07ad9a8bb6dc8176c9f93059b1b7f +R = cf5058e2a6cf5e61a138b013eb292f38a1b9f07239ae5941dbce8919 +S = d14198621650d985d270bc997da6e78588fd0ef843b874c66a3de3c3 + +Msg = 888f6d9bc7c86c0079fbfd42d8c08d6958f40f6e570fb0b1f03d2f8f8a63df4fcc87b379a222cf835820a999d34996e08961f13b86b075e7fd1c303cd3baa44de42168561589012f7e5300da4f8bdf470c07119a5d9f7ba7293568cd7c6a1b7fc1e41cda40bed7d46e5a28af67ae2aabfefe67a86a1c601e6f5ee543e09bd7b6 +d = 7f3edb710df9d982f486233d0c176aa88f5a0ee81efa9b8145020294 +Qx = e7611e013e7b43ff5b8b57ad83333bffcc9e469ad23070b5791dc594 +Qy = 7784da0a11dbe16208c6e0b6d5029e71fbec4dffc9fa046d3eeb71c9 +k = 94db7ef9a232593091eb9a74f289529c7e0d7fef21f80b3c8556b75e +R = a971f45bab10b1d16d7234ca8e4ec987da20d9e867f28aa063296e23 +S = e38c538d65a7e1a28fd3ec53f015a7e5beb60e9d309f1e3ba4b2c3d2 + +Msg = 48453340f1317769e6ee6e103153714365731163dc18f84e9f2fa4b120f9c5a9645ee2f9b66c84c26d95912b422b009b64af96aa418b2427a4209f2e7513ba8e43ec8cf20b34e7529b22eb1199545afe9a9f7d9bcb320aec9ee0162f91c0d1dd9674c9c284f25199c5e109f6f84d7ed0d269cc6413edb81bc2c83e37d644d8b9 +d = b569f8296ff1d9cc01fffd9919016e5730c1858bdb7b99527153751a +Qx = 242f34959516a4706172f7dede23110efa314bff22eb320ab88feeff +Qy = 45e3227710900a8acfc9bcce728119d042f64ca40876c2b380ee46e0 +k = ae61523866a8f43e6cdd42ba27a34ed06527e8a5842901a64c393f76 +R = c2732a4e0815f9f785500e80147e9486994446beccf8a6a352b97585 +S = 6ecaece6487d7920e398f7f951ab7c7aba5832dabf03704106ad1244 + +Msg = 4bdfd3b91d83108409ad765b256e0c9b9937ecf647f8e6f9fc807e2e72af8246178b3fe046b4ea10170450d71a4eec790ecb05f03d7077341de26c4db7eeae24d55c9a9093e837dfdb38168fe8230cb9605825a1282fecd741989bfcdb34678fe077477927f66bd26d003e5dda22043341a14dd31841ba483ad5ce2701e0f68e +d = 41a4dd8eee39232b728516e2f21e66011e7426a6b25986c3ffa237e4 +Qx = c32988171caab178bf50dc7310bc7f604df5a9d19a8e602519c72d8a +Qy = f8985d112ad9de05969e5364d943c1cc5cd198359f4c62b19da0e117 +k = 827d4999da81fa920c8492ccc1e2d5cdafed9754cf7382a859952071 +R = 89c61da7422ccd676baec07e2185c12e947a2374eede87847304be6c +S = 2685379624717ea28422e8d001c090405a130b4ef9f1ac726c3ca502 + +Msg = e6cdee8558bc1eacc24e82f0624ce8d02cc8d925b4dd3dec3a72f4a4e0fb76076bfa3ef2e2c33bdd7c27b322bdc09bbfee8fe46f75dbd7bbd2af09690b7137943efe21706e0a1b6d3089540fc58d85ddb55ea836616db573e36c521be008893f40a0a7c349602cc178ea43be59d31ec6449e7ff2c5379379f7d7645134df1bc3 +d = 67fa50569257c8cc89ac0325db4902003a62f30b917f53e4035a7e04 +Qx = 6773a0436a9c42635730413b19aa4166f08c69c0e5002953da42253b +Qy = 555138290b093bf2fe79acda9131d920cd1e7ac43fb8775776cd713c +k = 557cb45fd3a30b3bdbf08c56eabbd4478736024aaa52bf8448096453 +R = 8e92cf7a674aa5f7542dd95c695589a05747431692edd04804299b8f +S = af4908b41f8180b71a6ff10fd51f3d143147af6ddddf7534d3284ed9 + + +[P-256,SHA-224] + +Msg = ff624d0ba02c7b6370c1622eec3fa2186ea681d1659e0a845448e777b75a8e77a77bb26e5733179d58ef9bc8a4e8b6971aef2539f77ab0963a3415bbd6258339bd1bf55de65db520c63f5b8eab3d55debd05e9494212170f5d65b3286b8b668705b1e2b2b5568610617abb51d2dd0cb450ef59df4b907da90cfa7b268de8c4c2 +d = 708309a7449e156b0db70e5b52e606c7e094ed676ce8953bf6c14757c826f590 +Qx = 29578c7ab6ce0d11493c95d5ea05d299d536801ca9cbd50e9924e43b733b83ab +Qy = 08c8049879c6278b2273348474158515accaa38344106ef96803c5a05adc4800 +k = 58f741771620bdc428e91a32d86d230873e9140336fcfb1e122892ee1d501bdc +R = 4a19274429e40522234b8785dc25fc524f179dcc95ff09b3c9770fc71f54ca0d +S = 58982b79a65b7320f5b92d13bdaecdd1259e760f0f718ba933fd098f6f75d4b7 + +Msg = 9155e91fd9155eeed15afd83487ea1a3af04c5998b77c0fe8c43dcc479440a8a9a89efe883d9385cb9edfde10b43bce61fb63669935ad39419cf29ef3a936931733bfc2378e253e73b7ae9a3ec7a6a7932ab10f1e5b94d05160c053988f3bdc9167155d069337d42c9a7056619efc031fa5ec7310d29bd28980b1e3559757578 +d = 90c5386100b137a75b0bb495002b28697a451add2f1f22cb65f735e8aaeace98 +Qx = 4a92396ff7930b1da9a873a479a28a9896af6cc3d39345b949b726dc3cd978b5 +Qy = 475abb18eaed948879b9c1453e3ef2755dd90f77519ec7b6a30297aad08e4931 +k = 36f853b5c54b1ec61588c9c6137eb56e7a708f09c57513093e4ecf6d739900e5 +R = 38b29558511061cfabdc8e5bb65ac2976d1aa2ba9a5deab8074097b2172bb9ad +S = 0de2cde610502b6e03c0b23602eafbcd3faf886c81d111d156b7aa550f5bcd51 + +Msg = b242a7586a1383368a33c88264889adfa3be45422fbef4a2df4e3c5325a9c7757017e0d5cf4bbf4de7f99d189f81f1fd2f0dd645574d1eb0d547eead9375677819297c1abe62526ae29fc54cdd11bfe17714f2fbd2d0d0e8d297ff98535980482dd5c1ebdc5a7274aabf1382c9f2315ca61391e3943856e4c5e616c2f1f7be0d +d = a3a43cece9c1abeff81099fb344d01f7d8df66447b95a667ee368f924bccf870 +Qx = 5775174deb0248112e069cb86f1546ac7a78bc2127d0cb953bad46384dd6be5b +Qy = a27020952971cc0b0c3abd06e9ca3e141a4943f560564eba31e5288928bc7ce7 +k = a0d9a7a245bd9b9aa86cecb89341c9de2e4f9b5d095a8150826c7ba7fb3e7df7 +R = b02a440add66a9ff9c3c0e9acf1be678f6bd48a10cbdec2ad6d186ffe05f3f2a +S = a98bea42aec56a1fcecec00a1cc69b01fcbcf5de7ac1b2f2dcc09b6db064f92b + +Msg = b64005da76b24715880af94dba379acc25a047b06066c9bedc8f17b8c74e74f4fc720d9f4ef0e2a659e0756931c080587ebdcd0f85e819aea6dacb327a9d96496da53ea21aef3b2e793a9c0def5196acec99891f46ead78a85bc7ab644765781d3543da9fbf9fec916dca975ef3b4271e50ecc68bf79b2d8935e2b25fc063358 +d = 7bbc8ff13f6f921f21e949b224c16b7176c5984d312b671cf6c2e4841135fc7f +Qx = f888e913ec6f3cd8b31eb89e4f8aaa8887d30ae5348ed7118696949d5b8cc7c1 +Qy = 08895d09620500d244e5035e262dea3f2867cd8967b226324d5c05220d8b410c +k = 21c942f3b487accbf7fadc1c4b7a6c7567ce876c195022459fa1ebf6d04ffbaa +R = 2e6cc883b8acc904ee9691ef4a9f1f5a9e5fbfde847cda3be833f949fb9c7182 +S = 2ac48f7a930912131a8b4e3ab495307817c465d638c2a9ea5ae9e2808806e20a + +Msg = fe6e1ea477640655eaa1f6e3352d4bce53eb3d95424df7f238e93d8531da8f36bc35fa6be4bf5a6a382e06e855139eb617a9cc9376b4dafacbd80876343b12628619d7cbe1bff6757e3706111ed53898c0219823adbc044eaf8c6ad449df8f6aab9d444dadb5c3380eec0d91694df5fc4b30280d4b87d27e67ae58a1df828963 +d = daf5ec7a4eebc20d9485796c355b4a65ad254fe19b998d0507e91ea24135f45d +Qx = 137c465085c1b1b8cccbe9fccbe9d0295a331aaf332f3ed2e285d16e574b943b +Qy = d3e8d5a24cd218c19760b0e85b35a8569945aa857cbf0fd6a3ce127581b217b6 +k = 343251dffa56e6a612fec7b078f9c3819eab402a72686b894a47a08fd97e6c23 +R = 775e25a296bd259510ae9375f548997bec8a744900022945281dc8c4d94f2b5b +S = d87592ceab773ae103daebbb56a04144aaccb1e14efc1024dc36c0e382df1f70 + +Msg = 907c0c00dc080a688548957b5b8b1f33ba378de1368023dcad43242411f554eb7d392d3e5c1668fad3944ff9634105343d83b8c85d2a988da5f5dc60ee0518327caed6dd5cf4e9bc6222deb46d00abde745f9b71d6e7aee6c7fdfc9ed053f2c0b611d4c6863088bd012ea9810ee94f8e58905970ebd07353f1f409a371ed03e3 +d = 8729a8396f262dabd991aa404cc1753581cea405f0d19222a0b3f210de8ee3c5 +Qx = 82b1f1a7af9b48ca8452613d7032beb0e4f28fe710306aeccc959e4d03662a35 +Qy = 5e39f33574097b8d32b471a591972496f5d44db344c037d13f06fafc75f016fd +k = 6de9e21f0b2cacc1762b3558fd44d3cf156b85dbef430dd28d59713bfb9cfa0b +R = a754b42720e71925d51fcef76151405a3696cc8f9fc9ca7b46d0b16edd7fb699 +S = 603924780439cc16ac4cf97c2c3065bc95353aa9179d0ab5f0322ca82f851cf2 + +Msg = 771c4d7bce05610a3e71b272096b57f0d1efcce33a1cb4f714d6ebc0865b2773ec5eedc25fae81dee1d256474dbd9676623614c150916e6ed92ce4430b26037d28fa5252ef6b10c09dc2f7ee5a36a1ea7897b69f389d9f5075e271d92f4eb97b148f3abcb1e5be0b4feb8278613d18abf6da60bfe448238aa04d7f11b71f44c5 +d = f1b62413935fc589ad2280f6892599ad994dae8ca3655ed4f7318cc89b61aa96 +Qx = e0bbfe4016eea93e6f509518cbffc25d492de6ebbf80465a461caa5bdc018159 +Qy = 3231ee7a119d84fa56e3034d50fea85929aec2eb437abc7646821e1bf805fb50 +k = 7a33eeb9f469afd55de2fb786847a1d3e7797929305c0f90d953b6f143bb8fc6 +R = 96d1c9399948254ea381631fc0f43ea808110506db8aacf081df5535ac5eb8ad +S = 73bf3691260dddd9997c97313f2a70783eacf8d15bdfb34bb13025cdfae72f70 + +Msg = a3b2825235718fc679b942e8ac38fb4f54415a213c65875b5453d18ca012320ddfbbc58b991eaebadfc2d1a28d4f0cd82652b12e4d5bfda89eda3be12ac52188e38e8cce32a264a300c0e463631f525ae501348594f980392c76b4a12ddc88e5ca086cb8685d03895919a8627725a3e00c4728e2b7c6f6a14fc342b2937fc3dd +d = 4caaa26f93f009682bbba6db6b265aec17b7ec1542bda458e8550b9e68eed18d +Qx = e3c58c1c254d11c7e781ad133e4c36dd1b5de362120d336a58e7b68813f3fbee +Qy = 59760db66120afe0d962c81a8e5586588fd19de2f40556371611c73af22c8a68 +k = c0d37142dc8b0d614fad20c4d35af6eb819e259e513ddeac1e1c273e7e1dc1bb +R = 25dd8e4086c62a40d2a310e2f90f6af5cb7e677b4dfdb4dc4e99e23ea2f0e6dc +S = 90ad62c179b0c9d61f521dde1cd762bfd224b5525c39c3706f2549313ddb4f39 + +Msg = 3e6e2a9bffd729ee5d4807849cd4250021d8184cda723df6ab0e5c939d39237c8e58af9d869fe62d3c97b3298a99e891e5e11aa68b11a087573a40a3e83c7965e7910d72f81cad0f42accc5c25a4fd3cdd8cee63757bbbfbdae98be2bc867d3bcb1333c4632cb0a55dffeb77d8b119c466cd889ec468454fabe6fbee7102deaf +d = 7af4b150bb7167cb68037f280d0823ce5320c01a92b1b56ee1b88547481b1de9 +Qx = cb3634ec4f0cbb99986be788f889e586026d5a851e80d15382f1bdb1bda2bc75 +Qy = 51e4e43bc16fb114896b18198a1aebe6054ba20ed0c0317c1b8776158c0e6bfb +k = 98edd59fafbcaee5f64e84eb5ed59fff45d14aabada47cee2fa674377173627a +R = 261a1cdb0fd93c0fb06ea6068b6b03c330a12f621a7eba76682a1d152c0e8d08 +S = 7ca049bad54feee101d6db807635ffb8bdb05a38e445c8c3d65d60df143514c5 + +Msg = 52e5c308e70329a17c71eaedb66bbee303c8ec48a6f1a2efb235d308563cd58553d434e12f353227a9ea28608ec9c820ed83c95124e7a886f7e832a2de1032e78dc059208f9ec354170b2b1cab992b52ac01e6c0e4e1b0112686962edc53ab226dafcc9fc7baed2cd9307160e8572edb125935db49289b178f35a8ad23f4f801 +d = 52ad53e849e30bec0e6345c3e9d98ebc808b19496c1ef16d72ab4a00bbb8c634 +Qx = 7cca1334bfc2a78728c50b370399be3f9690d445aa03c701da643eeb0b0f7fa8 +Qy = 3f7522238668e615405e49b2f63faee58286000a30cdb4b564ac0df99bc8950f +k = 8650c30712fc253610884fbba4a332a4574d4b7822f7776cab1df8f5fa05442a +R = a18194c7ac5829afc408d78dde19542837e7be82706c3941b2d9c5e036bb51e0 +S = 188ead1cdf7c1d21114ff56d0421ffd501ab978ef58337462c0fa736d86299af + +Msg = d3e9e82051d4c84d699453c9ff44c7c09f6523bb92232bcf30bf3c380224249de2964e871d56a364d6955c81ef91d06482a6c7c61bc70f66ef22fad128d15416e7174312619134f968f1009f92cbf99248932efb533ff113fb6d949e21d6b80dfbbe69010c8d1ccb0f3808ea309bb0bac1a222168c95b088847e613749b19d04 +d = 80754962a864be1803bc441fa331e126005bfc6d8b09ed38b7e69d9a030a5d27 +Qx = 0aaeed6dd1ae020d6eefc98ec4241ac93cbd3c8afed05bb28007e7da5727571b +Qy = 2dda1d5b7872eb94dfffb456115037ff8d3e72f8ebdd8fcfc42391f96809be69 +k = 738e050aeefe54ecba5be5f93a97bbcb7557d701f9da2d7e88483454b97b55a8 +R = 8cb9f41dfdcb9604e0725ac9b78fc0db916dc071186ee982f6dba3da36f02efa +S = 5c87fe868fd4282fb114f5d70e9590a10a5d35cedf3ff6402ba5c4344738a32e + +Msg = 968951c2c1918436fe19fa2fe2152656a08f9a6b8aa6201920f1b424da98cee71928897ff087620cc5c551320b1e75a1e98d7d98a5bd5361c9393759614a6087cc0f7fb01fcb173783eb4c4c23961a8231ac4a07d72e683b0c1bd4c51ef1b031df875e7b8d5a6e0628949f5b8f157f43dccaea3b2a4fc11181e6b451e06ceb37 +d = cfa8c8bd810eb0d73585f36280ecdd296ee098511be8ad5eac68984eca8eb19d +Qx = c227a2af15dfa8734e11c0c50f77e24e77ed58dd8cccf1b0e9fa06bee1c64766 +Qy = b686592ce3745eb300d2704083db55e1fa8274e4cb7e256889ccc0bb34a60570 +k = 2d6b449bb38b543d6b6d34ff8cb053f5e5b337f949b069b21f421995ebb28823 +R = 5e89d3c9b103c2fa3cb8cebeec23640acda0257d63ffbe2d509bfc49fab1dca6 +S = d70c5b1eeb29e016af9925798d24e166c23d58fedd2f1a3bbdb1ef78cdbfb63a + +Msg = 78048628932e1c1cdd1e70932bd7b76f704ba08d7e7d825d3de763bf1a062315f4af16eccefe0b6ebadccaf403d013f50833ce2c54e24eea8345e25f93b69bb048988d102240225ceacf5003e2abdcc90299f4bf2c101585d36ecdd7a155953c674789d070480d1ef47cc7858e97a6d87c41c6922a00ea12539f251826e141b4 +d = b2021e2665ce543b7feadd0cd5a4bd57ffcc5b32deb860b4d736d9880855da3c +Qx = 722e0abad4504b7832a148746153777694714eca220eced2b2156ca64cfed3dd +Qy = f0351b357b3081e859c46cad5328c5afa10546e92bc6c3fd541796ac30397a75 +k = b15bbce4b382145de7ecd670d947e77555ef7cd1693bd53c694e2b52b04d10e1 +R = 9d086dcd22da165a43091991bede9c1c14515e656633cb759ec2c17f51c35253 +S = 23595ad1cb714559faaecaf946beb9a71e584616030ceaed8a8470f4bf62768f + +Msg = 9b0800c443e693067591737fdbcf0966fdfa50872d41d0c189d87cbc34c2771ee5e1255fd604f09fcf167fda16437c245d299147299c69046895d22482db29aba37ff57f756716cd3d6223077f747c4caffbecc0a7c9dfaaafd9a9817470ded8777e6355838ac54d11b2f0fc3f43668ff949cc31de0c2d15af5ef17884e4d66a +d = 0c9bce6a568ca239395fc3552755575cbcdddb1d89f6f5ab354517a057b17b48 +Qx = 4814d454495df7103e2da383aba55f7842fd84f1750ee5801ad32c10d0be6c7d +Qy = a0bd039d5097c8f0770477f6b18d247876e88e528bf0453eab515ffab8a9eda3 +k = d414f1525cdcc41eba1652de017c034ebcc7946cb2efe4713d09f67c85b83153 +R = 84db02c678f9a21208cec8564d145a35ba8c6f26b4eb7e19522e439720dae44c +S = 537c564da0d2dc5ac4376c5f0ca3b628d01d48df47a83d842c927e4d6db1e16d + +Msg = fc3b8291c172dae635a6859f525beaf01cf683765d7c86f1a4d768df7cae055f639eccc08d7a0272394d949f82d5e12d69c08e2483e11a1d28a4c61f18193106e12e5de4a9d0b4bf341e2acd6b715dc83ae5ff63328f8346f35521ca378b311299947f63ec593a5e32e6bd11ec4edb0e75302a9f54d21226d23314729e061016 +d = 1daa385ec7c7f8a09adfcaea42801a4de4c889fb5c6eb4e92bc611d596d68e3f +Qx = f04e9f2831d9697ae146c7d4552e5f91085cc46778400b75b76f00205252941d +Qy = bd267148174cd0c2b019cd0a5256e2f3f889d1e597160372b5a1339c8d787f10 +k = 7707db348ee6f60365b43a2a994e9b40ed56fe03c2c31c7e781bc4ffadcba760 +R = 5d95c385eeba0f15db0b80ae151912409128c9c80e554246067b8f6a36d85ea5 +S = db5d8a1e345f883e4fcb3871276f170b783c1a1e9da6b6615913368a8526f1c3 + +[P-256,SHA-256] + +Msg = 5905238877c77421f73e43ee3da6f2d9e2ccad5fc942dcec0cbd25482935faaf416983fe165b1a045ee2bcd2e6dca3bdf46c4310a7461f9a37960ca672d3feb5473e253605fb1ddfd28065b53cb5858a8ad28175bf9bd386a5e471ea7a65c17cc934a9d791e91491eb3754d03799790fe2d308d16146d5c9b0d0debd97d79ce8 +d = 519b423d715f8b581f4fa8ee59f4771a5b44c8130b4e3eacca54a56dda72b464 +Qx = 1ccbe91c075fc7f4f033bfa248db8fccd3565de94bbfb12f3c59ff46c271bf83 +Qy = ce4014c68811f9a21a1fdb2c0e6113e06db7ca93b7404e78dc7ccd5ca89a4ca9 +k = 94a1bbb14b906a61a280f245f9e93c7f3b4a6247824f5d33b9670787642a68de +R = f3ac8061b514795b8843e3d6629527ed2afd6b1f6a555a7acabb5e6f79c8c2ac +S = 8bf77819ca05a6b2786c76262bf7371cef97b218e96f175a3ccdda2acc058903 + +Msg = c35e2f092553c55772926bdbe87c9796827d17024dbb9233a545366e2e5987dd344deb72df987144b8c6c43bc41b654b94cc856e16b96d7a821c8ec039b503e3d86728c494a967d83011a0e090b5d54cd47f4e366c0912bc808fbb2ea96efac88fb3ebec9342738e225f7c7c2b011ce375b56621a20642b4d36e060db4524af1 +d = 0f56db78ca460b055c500064824bed999a25aaf48ebb519ac201537b85479813 +Qx = e266ddfdc12668db30d4ca3e8f7749432c416044f2d2b8c10bf3d4012aeffa8a +Qy = bfa86404a2e9ffe67d47c587ef7a97a7f456b863b4d02cfc6928973ab5b1cb39 +k = 6d3e71882c3b83b156bb14e0ab184aa9fb728068d3ae9fac421187ae0b2f34c6 +R = 976d3a4e9d23326dc0baa9fa560b7c4e53f42864f508483a6473b6a11079b2db +S = 1b766e9ceb71ba6c01dcd46e0af462cd4cfa652ae5017d4555b8eeefe36e1932 + +Msg = 3c054e333a94259c36af09ab5b4ff9beb3492f8d5b4282d16801daccb29f70fe61a0b37ffef5c04cd1b70e85b1f549a1c4dc672985e50f43ea037efa9964f096b5f62f7ffdf8d6bfb2cc859558f5a393cb949dbd48f269343b5263dcdb9c556eca074f2e98e6d94c2c29a677afaf806edf79b15a3fcd46e7067b7669f83188ee +d = e283871239837e13b95f789e6e1af63bf61c918c992e62bca040d64cad1fc2ef +Qx = 74ccd8a62fba0e667c50929a53f78c21b8ff0c3c737b0b40b1750b2302b0bde8 +Qy = 29074e21f3a0ef88b9efdf10d06aa4c295cc1671f758ca0e4cd108803d0f2614 +k = ad5e887eb2b380b8d8280ad6e5ff8a60f4d26243e0124c2f31a297b5d0835de2 +R = 35fb60f5ca0f3ca08542fb3cc641c8263a2cab7a90ee6a5e1583fac2bb6f6bd1 +S = ee59d81bc9db1055cc0ed97b159d8784af04e98511d0a9a407b99bb292572e96 + +Msg = 0989122410d522af64ceb07da2c865219046b4c3d9d99b01278c07ff63eaf1039cb787ae9e2dd46436cc0415f280c562bebb83a23e639e476a02ec8cff7ea06cd12c86dcc3adefbf1a9e9a9b6646c7599ec631b0da9a60debeb9b3e19324977f3b4f36892c8a38671c8e1cc8e50fcd50f9e51deaf98272f9266fc702e4e57c30 +d = a3d2d3b7596f6592ce98b4bfe10d41837f10027a90d7bb75349490018cf72d07 +Qx = 322f80371bf6e044bc49391d97c1714ab87f990b949bc178cb7c43b7c22d89e1 +Qy = 3c15d54a5cc6b9f09de8457e873eb3deb1fceb54b0b295da6050294fae7fd999 +k = 24fc90e1da13f17ef9fe84cc96b9471ed1aaac17e3a4bae33a115df4e5834f18 +R = d7c562370af617b581c84a2468cc8bd50bb1cbf322de41b7887ce07c0e5884ca +S = b46d9f2d8c4bf83546ff178f1d78937c008d64e8ecc5cbb825cb21d94d670d89 + +Msg = dc66e39f9bbfd9865318531ffe9207f934fa615a5b285708a5e9c46b7775150e818d7f24d2a123df3672fff2094e3fd3df6fbe259e3989dd5edfcccbe7d45e26a775a5c4329a084f057c42c13f3248e3fd6f0c76678f890f513c32292dd306eaa84a59abe34b16cb5e38d0e885525d10336ca443e1682aa04a7af832b0eee4e7 +d = 53a0e8a8fe93db01e7ae94e1a9882a102ebd079b3a535827d583626c272d280d +Qx = 1bcec4570e1ec2436596b8ded58f60c3b1ebc6a403bc5543040ba82963057244 +Qy = 8af62a4c683f096b28558320737bf83b9959a46ad2521004ef74cf85e67494e1 +k = 5d833e8d24cc7a402d7ee7ec852a3587cddeb48358cea71b0bedb8fabe84e0c4 +R = 18caaf7b663507a8bcd992b836dec9dc5703c080af5e51dfa3a9a7c387182604 +S = 77c68928ac3b88d985fb43fb615fb7ff45c18ba5c81af796c613dfa98352d29c + +Msg = 600974e7d8c5508e2c1aab0783ad0d7c4494ab2b4da265c2fe496421c4df238b0be25f25659157c8a225fb03953607f7df996acfd402f147e37aee2f1693e3bf1c35eab3ae360a2bd91d04622ea47f83d863d2dfecb618e8b8bdc39e17d15d672eee03bb4ce2cc5cf6b217e5faf3f336fdd87d972d3a8b8a593ba85955cc9d71 +d = 4af107e8e2194c830ffb712a65511bc9186a133007855b49ab4b3833aefc4a1d +Qx = a32e50be3dae2c8ba3f5e4bdae14cf7645420d425ead94036c22dd6c4fc59e00 +Qy = d623bf641160c289d6742c6257ae6ba574446dd1d0e74db3aaa80900b78d4ae9 +k = e18f96f84dfa2fd3cdfaec9159d4c338cd54ad314134f0b31e20591fc238d0ab +R = 8524c5024e2d9a73bde8c72d9129f57873bbad0ed05215a372a84fdbc78f2e68 +S = d18c2caf3b1072f87064ec5e8953f51301cada03469c640244760328eb5a05cb + +Msg = dfa6cb9b39adda6c74cc8b2a8b53a12c499ab9dee01b4123642b4f11af336a91a5c9ce0520eb2395a6190ecbf6169c4cba81941de8e76c9c908eb843b98ce95e0da29c5d4388040264e05e07030a577cc5d176387154eabae2af52a83e85c61c7c61da930c9b19e45d7e34c8516dc3c238fddd6e450a77455d534c48a152010b +d = 78dfaa09f1076850b3e206e477494cddcfb822aaa0128475053592c48ebaf4ab +Qx = 8bcfe2a721ca6d753968f564ec4315be4857e28bef1908f61a366b1f03c97479 +Qy = 0f67576a30b8e20d4232d8530b52fb4c89cbc589ede291e499ddd15fe870ab96 +k = 295544dbb2da3da170741c9b2c6551d40af7ed4e891445f11a02b66a5c258a77 +R = c5a186d72df452015480f7f338970bfe825087f05c0088d95305f87aacc9b254 +S = 84a58f9e9d9e735344b316b1aa1ab5185665b85147dc82d92e969d7bee31ca30 + +Msg = 51d2547cbff92431174aa7fc7302139519d98071c755ff1c92e4694b58587ea560f72f32fc6dd4dee7d22bb7387381d0256e2862d0644cdf2c277c5d740fa089830eb52bf79d1e75b8596ecf0ea58a0b9df61e0c9754bfcd62efab6ea1bd216bf181c5593da79f10135a9bc6e164f1854bc8859734341aad237ba29a81a3fc8b +d = 80e692e3eb9fcd8c7d44e7de9f7a5952686407f90025a1d87e52c7096a62618a +Qx = a88bc8430279c8c0400a77d751f26c0abc93e5de4ad9a4166357952fe041e767 +Qy = 2d365a1eef25ead579cc9a069b6abc1b16b81c35f18785ce26a10ba6d1381185 +k = 7c80fd66d62cc076cef2d030c17c0a69c99611549cb32c4ff662475adbe84b22 +R = 9d0c6afb6df3bced455b459cc21387e14929392664bb8741a3693a1795ca6902 +S = d7f9ddd191f1f412869429209ee3814c75c72fa46a9cccf804a2f5cc0b7e739f + +Msg = 558c2ac13026402bad4a0a83ebc9468e50f7ffab06d6f981e5db1d082098065bcff6f21a7a74558b1e8612914b8b5a0aa28ed5b574c36ac4ea5868432a62bb8ef0695d27c1e3ceaf75c7b251c65ddb268696f07c16d2767973d85beb443f211e6445e7fe5d46f0dce70d58a4cd9fe70688c035688ea8c6baec65a5fc7e2c93e8 +d = 5e666c0db0214c3b627a8e48541cc84a8b6fd15f300da4dff5d18aec6c55b881 +Qx = 1bc487570f040dc94196c9befe8ab2b6de77208b1f38bdaae28f9645c4d2bc3a +Qy = ec81602abd8345e71867c8210313737865b8aa186851e1b48eaca140320f5d8f +k = 2e7625a48874d86c9e467f890aaa7cd6ebdf71c0102bfdcfa24565d6af3fdce9 +R = 2f9e2b4e9f747c657f705bffd124ee178bbc5391c86d056717b140c153570fd9 +S = f5413bfd85949da8d83de83ab0d19b2986613e224d1901d76919de23ccd03199 + +Msg = 4d55c99ef6bd54621662c3d110c3cb627c03d6311393b264ab97b90a4b15214a5593ba2510a53d63fb34be251facb697c973e11b665cb7920f1684b0031b4dd370cb927ca7168b0bf8ad285e05e9e31e34bc24024739fdc10b78586f29eff94412034e3b606ed850ec2c1900e8e68151fc4aee5adebb066eb6da4eaa5681378e +d = f73f455271c877c4d5334627e37c278f68d143014b0a05aa62f308b2101c5308 +Qx = b8188bd68701fc396dab53125d4d28ea33a91daf6d21485f4770f6ea8c565dde +Qy = 423f058810f277f8fe076f6db56e9285a1bf2c2a1dae145095edd9c04970bc4a +k = 62f8665fd6e26b3fa069e85281777a9b1f0dfd2c0b9f54a086d0c109ff9fd615 +R = 1cc628533d0004b2b20e7f4baad0b8bb5e0673db159bbccf92491aef61fc9620 +S = 880e0bbf82a8cf818ed46ba03cf0fc6c898e36fca36cc7fdb1d2db7503634430 + +Msg = f8248ad47d97c18c984f1f5c10950dc1404713c56b6ea397e01e6dd925e903b4fadfe2c9e877169e71ce3c7fe5ce70ee4255d9cdc26f6943bf48687874de64f6cf30a012512e787b88059bbf561162bdcc23a3742c835ac144cc14167b1bd6727e940540a9c99f3cbb41fb1dcb00d76dda04995847c657f4c19d303eb09eb48a +d = b20d705d9bd7c2b8dc60393a5357f632990e599a0975573ac67fd89b49187906 +Qx = 51f99d2d52d4a6e734484a018b7ca2f895c2929b6754a3a03224d07ae61166ce +Qy = 4737da963c6ef7247fb88d19f9b0c667cac7fe12837fdab88c66f10d3c14cad1 +k = 72b656f6b35b9ccbc712c9f1f3b1a14cbbebaec41c4bca8da18f492a062d6f6f +R = 9886ae46c1415c3bc959e82b760ad760aab66885a84e620aa339fdf102465c42 +S = 2bf3a80bc04faa35ebecc0f4864ac02d349f6f126e0f988501b8d3075409a26c + +Msg = 3b6ee2425940b3d240d35b97b6dcd61ed3423d8e71a0ada35d47b322d17b35ea0472f35edd1d252f87b8b65ef4b716669fc9ac28b00d34a9d66ad118c9d94e7f46d0b4f6c2b2d339fd6bcd351241a387cc82609057048c12c4ec3d85c661975c45b300cb96930d89370a327c98b67defaa89497aa8ef994c77f1130f752f94a4 +d = d4234bebfbc821050341a37e1240efe5e33763cbbb2ef76a1c79e24724e5a5e7 +Qx = 8fb287f0202ad57ae841aea35f29b2e1d53e196d0ddd9aec24813d64c0922fb7 +Qy = 1f6daff1aa2dd2d6d3741623eecb5e7b612997a1039aab2e5cf2de969cfea573 +k = d926fe10f1bfd9855610f4f5a3d666b1a149344057e35537373372ead8b1a778 +R = 490efd106be11fc365c7467eb89b8d39e15d65175356775deab211163c2504cb +S = 644300fc0da4d40fb8c6ead510d14f0bd4e1321a469e9c0a581464c7186b7aa7 + +Msg = c5204b81ec0a4df5b7e9fda3dc245f98082ae7f4efe81998dcaa286bd4507ca840a53d21b01e904f55e38f78c3757d5a5a4a44b1d5d4e480be3afb5b394a5d2840af42b1b4083d40afbfe22d702f370d32dbfd392e128ea4724d66a3701da41ae2f03bb4d91bb946c7969404cb544f71eb7a49eb4c4ec55799bda1eb545143a7 +d = b58f5211dff440626bb56d0ad483193d606cf21f36d9830543327292f4d25d8c +Qx = 68229b48c2fe19d3db034e4c15077eb7471a66031f28a980821873915298ba76 +Qy = 303e8ee3742a893f78b810991da697083dd8f11128c47651c27a56740a80c24c +k = e158bf4a2d19a99149d9cdb879294ccb7aaeae03d75ddd616ef8ae51a6dc1071 +R = e67a9717ccf96841489d6541f4f6adb12d17b59a6bef847b6183b8fcf16a32eb +S = 9ae6ba6d637706849a6a9fc388cf0232d85c26ea0d1fe7437adb48de58364333 + +Msg = 72e81fe221fb402148d8b7ab03549f1180bcc03d41ca59d7653801f0ba853add1f6d29edd7f9abc621b2d548f8dbf8979bd16608d2d8fc3260b4ebc0dd42482481d548c7075711b5759649c41f439fad69954956c9326841ea6492956829f9e0dc789f73633b40f6ac77bcae6dfc7930cfe89e526d1684365c5b0be2437fdb01 +d = 54c066711cdb061eda07e5275f7e95a9962c6764b84f6f1f3ab5a588e0a2afb1 +Qx = 0a7dbb8bf50cb605eb2268b081f26d6b08e012f952c4b70a5a1e6e7d46af98bb +Qy = f26dd7d799930062480849962ccf5004edcfd307c044f4e8f667c9baa834eeae +k = 646fe933e96c3b8f9f507498e907fdd201f08478d0202c752a7c2cfebf4d061a +R = b53ce4da1aa7c0dc77a1896ab716b921499aed78df725b1504aba1597ba0c64b +S = d7c246dc7ad0e67700c373edcfdd1c0a0495fc954549ad579df6ed1438840851 + +Msg = 21188c3edd5de088dacc1076b9e1bcecd79de1003c2414c3866173054dc82dde85169baa77993adb20c269f60a5226111828578bcc7c29e6e8d2dae81806152c8ba0c6ada1986a1983ebeec1473a73a04795b6319d48662d40881c1723a706f516fe75300f92408aa1dc6ae4288d2046f23c1aa2e54b7fb6448a0da922bd7f34 +d = 34fa4682bf6cb5b16783adcd18f0e6879b92185f76d7c920409f904f522db4b1 +Qx = 105d22d9c626520faca13e7ced382dcbe93498315f00cc0ac39c4821d0d73737 +Qy = 6c47f3cbbfa97dfcebe16270b8c7d5d3a5900b888c42520d751e8faf3b401ef4 +k = a6f463ee72c9492bc792fe98163112837aebd07bab7a84aaed05be64db3086f4 +R = 542c40a18140a6266d6f0286e24e9a7bad7650e72ef0e2131e629c076d962663 +S = 4f7f65305e24a6bbb5cff714ba8f5a2cee5bdc89ba8d75dcbf21966ce38eb66f + +[P-256,SHA-384] + +Msg = e0b8596b375f3306bbc6e77a0b42f7469d7e83635990e74aa6d713594a3a24498feff5006790742d9c2e9b47d714bee932435db747c6e733e3d8de41f2f91311f2e9fd8e025651631ffd84f66732d3473fbd1627e63dc7194048ebec93c95c159b5039ab5e79e42c80b484a943f125de3da1e04e5bf9c16671ad55a1117d3306 +d = b6faf2c8922235c589c27368a3b3e6e2f42eb6073bf9507f19eed0746c79dced +Qx = e0e7b99bc62d8dd67883e39ed9fa0657789c5ff556cc1fd8dd1e2a55e9e3f243 +Qy = 63fbfd0232b95578075c903a4dbf85ad58f8350516e1ec89b0ee1f5e1362da69 +k = 9980b9cdfcef3ab8e219b9827ed6afdd4dbf20bd927e9cd01f15762703487007 +R = f5087878e212b703578f5c66f434883f3ef414dc23e2e8d8ab6a8d159ed5ad83 +S = 306b4c6c20213707982dffbb30fba99b96e792163dd59dbe606e734328dd7c8a + +Msg = 099a0131179fff4c6928e49886d2fdb3a9f239b7dd5fa828a52cbbe3fcfabecfbba3e192159b887b5d13aa1e14e6a07ccbb21f6ad8b7e88fee6bea9b86dea40ffb962f38554056fb7c5bb486418915f7e7e9b9033fe3baaf9a069db98bc02fa8af3d3d1859a11375d6f98aa2ce632606d0800dff7f55b40f971a8586ed6b39e9 +d = 118958fd0ff0f0b0ed11d3cf8fa664bc17cdb5fed1f4a8fc52d0b1ae30412181 +Qx = afda82260c9f42122a3f11c6058839488f6d7977f6f2a263c67d06e27ea2c355 +Qy = 0ae2bbdd2207c590332c5bfeb4c8b5b16622134bd4dc55382ae806435468058b +k = 23129a99eeda3d99a44a5778a46e8e7568b91c31fb7a8628c5d9820d4bed4a6b +R = e446600cab1286ebc3bb332012a2f5cc33b0a5ef7291d5a62a84de5969d77946 +S = cf89b12793ee1792eb26283b48fa0bdcb45ae6f6ad4b02564bf786bb97057d5a + +Msg = 0fbc07ea947c946bea26afa10c51511039b94ddbc4e2e4184ca3559260da24a14522d1497ca5e77a5d1a8e86583aeea1f5d4ff9b04a6aa0de79cd88fdb85e01f171143535f2f7c23b050289d7e05cebccdd131888572534bae0061bdcc3015206b9270b0d5af9f1da2f9de91772d178a632c3261a1e7b3fb255608b3801962f9 +d = 3e647357cd5b754fad0fdb876eaf9b1abd7b60536f383c81ce5745ec80826431 +Qx = 702b2c94d039e590dd5c8f9736e753cf5824aacf33ee3de74fe1f5f7c858d5ed +Qy = 0c28894e907af99fb0d18c9e98f19ac80dd77abfa4bebe45055c0857b82a0f4d +k = 9beab7722f0bcb468e5f234e074170a60225255de494108459abdf603c6e8b35 +R = c4021fb7185a07096547af1fb06932e37cf8bd90cf593dea48d48614fa237e5e +S = 7fb45d09e2172bec8d3e330aa06c43fbb5f625525485234e7714b7f6e92ba8f1 + +Msg = 1e38d750d936d8522e9db1873fb4996bef97f8da3c6674a1223d29263f1234a90b751785316444e9ba698bc8ab6cd010638d182c9adad4e334b2bd7529f0ae8e9a52ad60f59804b2d780ed52bdd33b0bf5400147c28b4304e5e3434505ae7ce30d4b239e7e6f0ecf058badd5b388eddbad64d24d2430dd04b4ddee98f972988f +d = 76c17c2efc99891f3697ba4d71850e5816a1b65562cc39a13da4b6da9051b0fd +Qx = d12512e934c367e4c4384dbd010e93416840288a0ba00b299b4e7c0d91578b57 +Qy = ebf8835661d9b578f18d14ae4acf9c357c0dc8b7112fc32824a685ed72754e23 +k = 77cffa6f9a73904306f9fcd3f6bbb37f52d71e39931bb4aec28f9b076e436ccf +R = 4d5a9d95b0f09ce8704b0f457b39059ee606092310df65d3f8ae7a2a424cf232 +S = 7d3c014ca470a73cef1d1da86f2a541148ad542fbccaf9149d1b0b030441a7eb + +Msg = abcf0e0f046b2e0672d1cc6c0a114905627cbbdefdf9752f0c31660aa95f2d0ede72d17919a9e9b1add3213164e0c9b5ae3c76f1a2f79d3eeb444e6741521019d8bd5ca391b28c1063347f07afcfbb705be4b52261c19ebaf1d6f054a74d86fb5d091fa7f229450996b76f0ada5f977b09b58488eebfb5f5e9539a8fd89662ab +d = 67b9dea6a575b5103999efffce29cca688c781782a41129fdecbce76608174de +Qx = b4238b029fc0b7d9a5286d8c29b6f3d5a569e9108d44d889cd795c4a385905be +Qy = 8cb3fff8f6cca7187c6a9ad0a2b1d9f40ae01b32a7e8f8c4ca75d71a1fffb309 +k = d02617f26ede3584f0afcfc89554cdfb2ae188c192092fdde3436335fafe43f1 +R = 26fd9147d0c86440689ff2d75569795650140506970791c90ace0924b44f1586 +S = 00a34b00c20a8099df4b0a757cbef8fea1cb3ea7ced5fbf7e987f70b25ee6d4f + +Msg = dc3d4884c741a4a687593c79fb4e35c5c13c781dca16db561d7e393577f7b62ca41a6e259fc1fb8d0c4e1e062517a0fdf95558b7799f20c211796167953e6372c11829beec64869d67bf3ee1f1455dd87acfbdbcc597056e7fb347a17688ad32fda7ccc3572da7677d7255c261738f07763cd45973c728c6e9adbeecadc3d961 +d = ecf644ea9b6c3a04fdfe2de4fdcb55fdcdfcf738c0b3176575fa91515194b566 +Qx = c3bdc7c795ec94620a2cfff614c13a3390a5e86c892e53a24d3ed22228bc85bf +Qy = 70480fc5cf4aacd73e24618b61b5c56c1ced8c4f1b869580ea538e68c7a61ca3 +k = 53291d51f68d9a12d1dcdc58892b2f786cc15f631f16997d2a49bace513557d4 +R = a860c8b286edf973ce4ce4cf6e70dc9bbf3818c36c023a845677a9963705df8b +S = 5630f986b1c45e36e127dd7932221c4272a8cc6e255e89f0f0ca4ec3a9f76494 + +Msg = 719bf1911ae5b5e08f1d97b92a5089c0ab9d6f1c175ac7199086aeeaa416a17e6d6f8486c711d386f284f096296689a54d330c8efb0f5fa1c5ba128d3234a3da856c2a94667ef7103616a64c913135f4e1dc50e38daa60610f732ad1bedfcc396f87169392520314a6b6b9af6793dbabad4599525228cc7c9c32c4d8e097ddf6 +d = 4961485cbc978f8456ec5ac7cfc9f7d9298f99415ecae69c8491b258c029bfee +Qx = 8d40bf2299e05d758d421972e81cfb0cce68b949240dc30f315836acc70bef03 +Qy = 5674e6f77f8b46f46cca937d83b128dffbe9bd7e0d3d08aa2cbbfdfb16f72c9a +k = 373a825b5a74b7b9e02f8d4d876b577b4c3984168d704ba9f95b19c05ed590af +R = ef6fb386ad044b63feb7445fa16b10319018e9cea9ef42bca83bdad01992234a +S = ac1f42f652eb1786e57be01d847c81f7efa072ba566d4583af4f1551a3f76c65 + +Msg = 7cf19f4c851e97c5bca11a39f0074c3b7bd3274e7dd75d0447b7b84995dfc9f716bf08c25347f56fcc5e5149cb3f9cfb39d408ace5a5c47e75f7a827fa0bb9921bb5b23a6053dbe1fa2bba341ac874d9b1333fc4dc224854949f5c8d8a5fedd02fb26fdfcd3be351aec0fcbef18972956c6ec0effaf057eb4420b6d28e0c008c +d = 587907e7f215cf0d2cb2c9e6963d45b6e535ed426c828a6ea2fb637cca4c5cbd +Qx = 660da45c413cc9c9526202c16b402af602d30daaa7c342f1e722f15199407f31 +Qy = e6f8cbb06913cc718f2d69ba2fb3137f04a41c27c676d1a80fbf30ea3ca46439 +k = 6b8eb7c0d8af9456b95dd70561a0e902863e6dfa1c28d0fd4a0509f1c2a647b2 +R = 08fabf9b57de81875bfa7a4118e3e44cfb38ec6a9b2014940207ba3b1c583038 +S = a58d199b1deba7350616230d867b2747a3459421811c291836abee715b8f67b4 + +Msg = b892ffabb809e98a99b0a79895445fc734fa1b6159f9cddb6d21e510708bdab6076633ac30aaef43db566c0d21f4381db46711fe3812c5ce0fb4a40e3d5d8ab24e4e82d3560c6dc7c37794ee17d4a144065ef99c8d1c88bc22ad8c4c27d85ad518fa5747ae35276fc104829d3f5c72fc2a9ea55a1c3a87007cd133263f79e405 +d = 24b1e5676d1a9d6b645a984141a157c124531feeb92d915110aef474b1e27666 +Qx = b4909a5bdf25f7659f4ef35e4b811429fb2c59126e3dad09100b46aea6ebe7a6 +Qy = 760ae015fa6af5c9749c4030fdb5de6e58c6b5b1944829105cf7edf7d3a22cfb +k = 88794923d8943b5dbcc7a7a76503880ff7da632b0883aaa60a9fcc71bf880fd6 +R = 6ec9a340b77fae3c7827fa96d997e92722ff2a928217b6dd3c628f3d49ae4ce6 +S = 637b54bbcfb7e7d8a41ea317fcfca8ad74eb3bb6b778bc7ef9dec009281976f7 + +Msg = 8144e37014c95e13231cbd6fa64772771f93b44e37f7b02f592099cc146343edd4f4ec9fa1bc68d7f2e9ee78fc370443aa2803ff4ca52ee49a2f4daf2c8181ea7b8475b3a0f608fc3279d09e2d057fbe3f2ffbe5133796124781299c6da60cfe7ecea3abc30706ded2cdf18f9d788e59f2c31662df3abe01a9b12304fb8d5c8c +d = bce49c7b03dcdc72393b0a67cf5aa5df870f5aaa6137ada1edc7862e0981ec67 +Qx = c786d9421d67b72b922cf3def2a25eeb5e73f34543eb50b152e738a98afb0ca5 +Qy = 6796271e79e2496f9e74b126b1123a3d067de56b5605d6f51c8f6e1d5bb93aba +k = 89e690d78a5e0d2b8ce9f7fcbf34e2605fd9584760fa7729043397612dd21f94 +R = 07e5054c384839584624e8d730454dc27e673c4a90cbf129d88b91250341854d +S = f7e665b88614d0c5cbb3007cafe713763d81831525971f1747d92e4d1ca263a7 + +Msg = a3683d120807f0a030feed679785326698c3702f1983eaba1b70ddfa7f0b3188060b845e2b67ed57ee68087746710450f7427cb34655d719c0acbc09ac696adb4b22aba1b9322b7111076e67053a55f62b501a4bca0ad9d50a868f51aeeb4ef27823236f5267e8da83e143047422ce140d66e05e44dc84fb3a4506b2a5d7caa8 +d = 73188a923bc0b289e81c3db48d826917910f1b957700f8925425c1fb27cabab9 +Qx = 86662c014ab666ee770723be8da38c5cd299efc6480fc6f8c3603438fa8397b9 +Qy = f26b3307a650c3863faaa5f642f3ba1384c3d3a02edd3d48c657c269609cc3fc +k = ec90584ab3b383b590626f36ed4f5110e49888aec7ae7a9c5ea62dd2dc378666 +R = 13e9ad59112fde3af4163eb5c2400b5e9a602576d5869ac1c569075f08c90ff6 +S = 708ac65ff2b0baaccc6dd954e2a93df46016bd04457636de06798fcc17f02be5 + +Msg = b1df8051b213fc5f636537e37e212eb20b2423e6467a9c7081336a870e6373fc835899d59e546c0ac668cc81ce4921e88f42e6da2a109a03b4f4e819a17c955b8d099ec6b282fb495258dca13ec779c459da909475519a3477223c06b99afbd77f9922e7cbef844b93f3ce5f50db816b2e0d8b1575d2e17a6b8db9111d6da578 +d = f637d55763fe819541588e0c603f288a693cc66823c6bb7b8e003bd38580ebce +Qx = 74a4620c578601475fc169a9b84be613b4a16cb6acab8fd98848a6ec9fbd133d +Qy = 42b9e35d347c107e63bd55f525f915bcf1e3d2b81d002d3c39acf10fc30645a1 +k = 4d578f5099636234d9c1d566f1215d5d887ae5d47022be17dbf32a11a03f053b +R = 113a933ebc4d94ce1cef781e4829df0c493b0685d39fb2048ce01b21c398dbba +S = 3005bd4ec63dbd04ce9ff0c6246ad65d27fcf62edb2b7e461589f9f0e7446ffd + +Msg = 0b918ede985b5c491797d0a81446b2933be312f419b212e3aae9ba5914c00af431747a9d287a7c7761e9bcbc8a12aaf9d4a76d13dad59fc742f8f218ef66eb67035220a07acc1a357c5b562ecb6b895cf725c4230412fefac72097f2c2b829ed58742d7c327cad0f1058df1bddd4ae9c6d2aba25480424308684cecd6517cdd8 +d = 2e357d51517ff93b821f895932fddded8347f32596b812308e6f1baf7dd8a47f +Qx = 7e4078a1d50c669fb2996dd9bacb0c3ac7ede4f58fa0fa1222e78dbf5d1f4186 +Qy = 0014e46e90cc171fbb83ea34c6b78202ea8137a7d926f0169147ed5ae3d6596f +k = be522b0940b9a40d84bf790fe6abdc252877e671f2efa63a33a65a512fc2aa5c +R = a26b9ad775ac37ff4c7f042cdc4872c5e4e5e800485f488ddfaaed379f468090 +S = f88eae2019bebbba62b453b8ee3472ca5c67c267964cffe0cf2d2933c1723dff + +Msg = 0fab26fde1a4467ca930dbe513ccc3452b70313cccde2994eead2fde85c8da1db84d7d06a024c9e88629d5344224a4eae01b21a2665d5f7f36d5524bf5367d7f8b6a71ea05d413d4afde33777f0a3be49c9e6aa29ea447746a9e77ce27232a550b31dd4e7c9bc8913485f2dc83a56298051c92461fd46b14cc895c300a4fb874 +d = 77d60cacbbac86ab89009403c97289b5900466856887d3e6112af427f7f0f50b +Qx = a62032dfdb87e25ed0c70cad20d927c7effeb2638e6c88ddd670f74df16090e5 +Qy = 44c5ee2cf740ded468f5d2efe13daa7c5234645a37c073af35330d03a4fed976 +k = 06c1e692b045f425a21347ecf72833d0242906c7c1094f805566cdcb1256e394 +R = eb173b51fb0aec318950d097e7fda5c34e529519631c3e2c9b4550b903da417d +S = ca2c13574bf1b7d56e9dc18315036a31b8bceddf3e2c2902dcb40f0cc9e31b45 + +Msg = 7843f157ef8566722a7d69da67de7599ee65cb3975508f70c612b3289190e364141781e0b832f2d9627122742f4b5871ceeafcd09ba5ec90cae6bcc01ae32b50f13f63918dfb5177df9797c6273b92d103c3f7a3fc2050d2b196cc872c57b77f9bdb1782d4195445fcc6236dd8bd14c8bcbc8223a6739f6a17c9a861e8c821a6 +d = 486854e77962117f49e09378de6c9e3b3522fa752b10b2c810bf48db584d7388 +Qx = 760b5624bd64d19c866e54ccd74ad7f98851afdbc3ddeae3ec2c52a135be9cfa +Qy = feca15ce9350877102eee0f5af18b2fed89dc86b7df0bf7bc2963c1638e36fe8 +k = e4f77c6442eca239b01b0254e11a4182782d96f48ab521cc3d1d68df12b5a41a +R = bdff14e4600309c2c77f79a25963a955b5b500a7b2d34cb172cd6acd52905c7b +S = b0479cdb3df79923ec36a104a129534c5d59f622be7d613aa04530ad2507d3a2 + +[P-256,SHA-512] + +Msg = 6c8572b6a3a4a9e8e03dbeed99334d41661b8a8417074f335ab1845f6cc852adb8c01d9820fcf8e10699cc827a8fbdca2cbd46cc66e4e6b7ba41ec3efa733587e4a30ec552cd8ddab8163e148e50f4d090782897f3ddac84a41e1fcfe8c56b6152c0097b0d634b41011471ffd004f43eb4aafc038197ec6bae2b4470e869bded +d = 9dd0d3a3d514c2a8adb162b81e3adfba3299309f7d2018f607bdb15b1a25f499 +Qx = 6b738de3398b6ac57b9591f9d7985dd4f32137ad3460dcf8970c1390cb9eaf8d +Qy = 83bc61e26d2bbbd3cf2d2ab445a2bc4ab5dde41f4a13078fd1d3cc36ab596d57 +k = 9106192170ccb3c64684d48287bb81bbed51b40d503462c900e5c7aae43e380a +R = 275fa760878b4dc05e9d157fedfd8e9b1c9c861222a712748cb4b7754c043fb1 +S = 699d906bb8435a05345af3b37e3b357786939e94caae257852f0503adb1e0f7e + +Msg = 7e3c8fe162d48cc8c5b11b5e5ebc05ebc45c439bdbc0b0902145921b8383037cb0812222031598cd1a56fa71694fbd304cc62938233465ec39c6e49f57dfe823983b6923c4e865633949183e6b90e9e06d8275f3907d97967d47b6239fe2847b7d49cf16ba69d2862083cf1bccf7afe34fdc90e21998964107b64abe6b89d126 +d = f9bf909b7973bf0e3dad0e43dcb2d7fa8bda49dbe6e5357f8f0e2bd119be30e6 +Qx = f2a6674d4e86152a527199bed293fa63acde1b4d8a92b62e552210ba45c38792 +Qy = c72565c24f0eee6a094af341ddd8579747b865f91c8ed5b44cda8a19cc93776f +k = e547791f7185850f03d0c58419648f65b9d29cdc22ed1de2a64280220cfcafba +R = 4782903d2aaf8b190dab5cae2223388d2d8bd845b3875d37485c54e1ded1d3d8 +S = dfb40e406bfa074f0bf832771b2b9f186e2211f0bca279644a0ca8559acf39da + +Msg = d5aa8ac9218ca661cd177756af6fbb5a40a3fecfd4eea6d5872fbb9a2884784aa9b5f0c023a6e0da5cf6364754ee6465b4ee2d0ddc745b02994c98427a213c849537da5a4477b3abfe02648be67f26e80b56a33150490d062aaac137aa47f11cfeddba855bab9e4e028532a563326d927f9e6e3292b1fb248ee90b6f429798db +d = 724567d21ef682dfc6dc4d46853880cfa86fe6fea0efd51fac456f03c3d36ead +Qx = 70b877b5e365fcf08140b1eca119baba662879f38e059d074a2cb60b03ea5d39 +Qy = 5f56f94d591df40b9f3b8763ac4b3dbe622c956d5bd0c55658b6f46fa3deb201 +k = 79d6c967ed23c763ece9ca4b026218004c84dc2d4ccc86cf05c5d0f791f6279b +R = 2ba2ea2d316f8937f184ad3028e364574d20a202e4e7513d7af57ac2456804d1 +S = 64fe94968d18c5967c799e0349041b9e40e6c6c92ebb475e80dd82f51cf07320 + +Msg = 790b06054afc9c3fc4dfe72df19dd5d68d108cfcfca6212804f6d534fd2fbe489bd8f64bf205ce04bcb50124a12ce5238fc3fe7dd76e6fa640206af52549f133d593a1bfd423ab737f3326fa79433cde293236f90d4238f0dd38ed69492ddbd9c3eae583b6325a95dec3166fe52b21658293d8c137830ef45297d67813b7a508 +d = 29c5d54d7d1f099d50f949bfce8d6073dae059c5a19cc70834722f18a7199edd +Qx = 3088d4f45d274cc5f418c8ecc4cbcf96be87491f420250f8cbc01cdf2503ec47 +Qy = 634db48198129237ed068c88ff5809f6211921a6258f548f4b64dd125921b78b +k = 0508ad7774908b5705895fda5c3b7a3032bf85dab7232bf981177019f3d76460 +R = acd9f3b63626c5f32103e90e1dd1695907b1904aa9b14f2132caef331321971b +S = 15c04a8bd6c13ed5e9961814b2f406f064670153e4d5465dcef63c1d9dd52a87 + +Msg = 6d549aa87afdb8bfa60d22a68e2783b27e8db46041e4df04be0c261c4734b608a96f198d1cdb8d082ae48579ec9defcf21fbc72803764a58c31e5323d5452b9fb57c8991d31749140da7ef067b18bf0d7dfbae6eefd0d8064f334bf7e9ec1e028daed4e86e17635ec2e409a3ed1238048a45882c5c57501b314e636b9bc81cbe +d = 0d8095da1abba06b0d349c226511f642dabbf1043ad41baa4e14297afe8a3117 +Qx = 75a45758ced45ecf55f755cb56ca2601d794ebeaeb2e6107fe2fc443f580e23c +Qy = 5303d47d5a75ec821d51a2ee7548448208c699eca0cd89810ffc1aa4faf81ead +k = 5165c54def4026ab648f7768c4f1488bcb183f6db7ffe02c7022a529a116482a +R = ebc85fc4176b446b3384ccc62fc2526b45665561a0e7e9404ac376c90e450b59 +S = 8b2c09428e62c5109d17ed0cf8f9fd7c370d018a2a73f701effc9b17d04852c6 + +Msg = 1906e48b7f889ee3ff7ab0807a7aa88f53f4018808870bfed6372a77330c737647961324c2b4d46f6ee8b01190474951a701b048ae86579ff8e3fc889fecf926b17f98958ac7534e6e781ca2db2baa380dec766cfb2a3eca2a9d5818967d64dfab84f768d24ec122eebacaab0a4dc3a75f37331bb1c43dd8966cc09ec4945bbd +d = 52fe57da3427b1a75cb816f61c4e8e0e0551b94c01382b1a80837940ed579e61 +Qx = 2177e20a2092a46667debdcc21e7e45d6da72f124adecbc5ada6a7bcc7b401d5 +Qy = 550e468f2626070a080afeeb98edd75a721eb773c8e62149f3e903cf9c4d7b61 +k = 0464fe9674b01ff5bd8be21af3399fad66f90ad30f4e8ee6e2eb9bcccfd5185c +R = f8250f073f34034c1cde58f69a85e2f5a030703ebdd4dbfb98d3b3690db7d114 +S = a9e83e05f1d6e0fef782f186bedf43684c825ac480174d48b0e4d31505e27498 + +Msg = 7b59fef13daf01afec35dea3276541be681c4916767f34d4e874464d20979863ee77ad0fd1635bcdf93e9f62ed69ae52ec90aab5bbf87f8951213747ccec9f38c775c1df1e9d7f735c2ce39b42edb3b0c5086247556cfea539995c5d9689765288ec600848ecf085c01ca738bbef11f5d12d4457db988b4add90be00781024ad +d = 003d91611445919f59bfe3ca71fe0bfdeb0e39a7195e83ac03a37c7eceef0df2 +Qx = 7b9c592f61aae0555855d0b9ebb6fd00fb6746e8842e2523565c858630b9ba00 +Qy = d35b2e168b1875bbc563bea5e8d63c4e38957c774a65e762959a349eaf263ba0 +k = ef9df291ea27a4b45708f7608723c27d7d56b7df0599a54bc2c2fabbff373b40 +R = 66d057fd39958b0e4932bacd70a1769bbadcb62e4470937b45497a3d4500fabb +S = 6c853b889e18b5a49ee54b54dd1aaedfdd642e30eba171c5cab677f0df9e7318 + +Msg = 041a6767a935dc3d8985eb4e608b0cbfebe7f93789d4200bcfe595277ac2b0f402889b580b72def5da778a680fd380c955421f626d52dd9a83ea180187b850e1b72a4ec6dd63235e598fd15a9b19f8ce9aec1d23f0bd6ea4d92360d50f951152bc9a01354732ba0cf90aaed33c307c1de8fa3d14f9489151b8377b57c7215f0b +d = 48f13d393899cd835c4193670ec62f28e4c4903e0bbe5817bf0996831a720bb7 +Qx = 82a1a96f4648393c5e42633ecdeb1d8245c78c5ea236b5bab460dedcc8924bc0 +Qy = e8cbf03c34b5154f876de19f3bb6fd43cd2eabf6e7c95467bcfa8c8fc42d76fd +k = efed736e627899fea944007eea39a4a63c0c2e26491cd12adb546be3e5c68f7d +R = cf7fc24bdaa09ac0cca8497e13298b961380668613c7493954048c06385a7044 +S = f38b1c8306cf82ab76ee3a772b14416b49993fe11f986e9b0f0593c52ec91525 + +Msg = 7905a9036e022c78b2c9efd40b77b0a194fbc1d45462779b0b76ad30dc52c564e48a493d8249a061e62f26f453ba566538a4d43c64fb9fdbd1f36409316433c6f074e1b47b544a847de25fc67d81ac801ed9f7371a43da39001c90766f943e629d74d0436ba1240c3d7fab990d586a6d6ef1771786722df56448815f2feda48f +d = 95c99cf9ec26480275f23de419e41bb779590f0eab5cf9095d37dd70cb75e870 +Qx = 42c292b0fbcc9f457ae361d940a9d45ad9427431a105a6e5cd90a345fe3507f7 +Qy = 313b08fd2fa351908b3178051ee782cc62b9954ad95d4119aa564900f8ade70c +k = 4c08dd0f8b72ae9c674e1e448d4e2afe3a1ee69927fa23bbff3716f0b99553b7 +R = f2bc35eb1b8488b9e8d4a1dbb200e1abcb855458e1557dc1bf988278a174eb3b +S = ed9a2ec043a1d578e8eba6f57217976310e8674385ad2da08d6146c629de1cd9 + +Msg = cf25e4642d4f39d15afb7aec79469d82fc9aedb8f89964e79b749a852d931d37436502804e39555f5a3c75dd958fd5291ada647c1a5e38fe7b1048f16f2b711fdd5d39acc0812ca65bd50d7f8119f2fd195ab16633503a78ee9102c1f9c4c22568e0b54bd4fa3f5ff7b49160bf23e7e2231b1ebebbdaf0e4a7d4484158a87e07 +d = e15e835d0e2217bc7c6f05a498f20af1cd56f2f165c23d225eb3360aa2c5cbcf +Qx = 89dd22052ec3ab4840206a62f2270c21e7836d1a9109a3407dd0974c7802b9ae +Qy = e91609ba35c7008b080c77a9068d97a14ca77b97299e74945217672b2fd5faf0 +k = c9f621441c235fc47ec34eef4c08625df1ec74918e1f86075b753f2589f4c60b +R = a70d1a2d555d599bfb8c9b1f0d43725341151d17a8d0845fa56f3563703528a7 +S = 4e05c45adf41783e394a5312f86e66871c4be4896948c85966879d5c66d54b37 + +Msg = 7562c445b35883cc937be6349b4cefc3556a80255d70f09e28c3f393daac19442a7eecedcdfbe8f7628e30cd8939537ec56d5c9645d43340eb4e78fc5dd4322de8a07966b262770d7ff13a071ff3dce560718e60ed3086b7e0003a6abafe91af90af86733ce8689440bf73d2aa0acfe9776036e877599acbabfcb03bb3b50faa +d = 808c08c0d77423a6feaaffc8f98a2948f17726e67c15eeae4e672edbe388f98c +Qx = b0c0ad5e1f6001d8e9018ec611b2e3b91923e69fa6c98690ab644d650f640c42 +Qy = 610539c0b9ed21ac0a2f27527c1a61d9b47cbf033187b1a6ada006eb5b2662ed +k = 1f6d4a905c761a53d54c362976717d0d7fc94d222bb5489e4830080a1a67535d +R = 83404dcf8320baf206381800071e6a75160342d19743b4f176960d669dd03d07 +S = 3f75dcf102008b2989f81683ae45e9f1d4b67a6ef6fd5c8af44828af80e1cfb5 + +Msg = 051c2db8e71e44653ea1cb0afc9e0abdf12658e9e761bfb767c20c7ab4adfcb18ed9b5c372a3ac11d8a43c55f7f99b33355437891686d42362abd71db8b6d84dd694d6982f0612178a937aa934b9ac3c0794c39027bdd767841c4370666c80dbc0f8132ca27474f553d266deefd7c9dbad6d734f9006bb557567701bb7e6a7c9 +d = f7c6315f0081acd8f09c7a2c3ec1b7ece20180b0a6365a27dcd8f71b729558f9 +Qx = 250f7112d381c1751860045d9bcaf20dbeb25a001431f96ac6f19109362ffebb +Qy = 49fba9efe73546135a5a31ab3753e247034741ce839d3d94bd73936c4a17e4aa +k = 68c299be2c0c6d52d208d5d1a9e0ffa2af19b4833271404e5876e0aa93987866 +R = 7b195e92d2ba95911cda7570607e112d02a1c847ddaa33924734b51f5d81adab +S = 10d9f206755cef70ab5143ac43f3f8d38aea2644f31d52eaf3b472ee816e11e5 + +Msg = 4dcb7b62ba31b866fce7c1feedf0be1f67bf611dbc2e2e86f004422f67b3bc1839c6958eb1dc3ead137c3d7f88aa97244577a775c8021b1642a8647bba82871e3c15d0749ed343ea6cad38f123835d8ef66b0719273105e924e8685b65fd5dc430efbc35b05a6097f17ebc5943cdcd9abcba752b7f8f37027409bd6e11cd158f +d = f547735a9409386dbff719ce2dae03c50cb437d6b30cc7fa3ea20d9aec17e5a5 +Qx = 4ca87c5845fb04c2f76ae3273073b0523e356a445e4e95737260eba9e2d021db +Qy = 0f86475d07f82655320fdf2cd8db23b21905b1b1f2f9c48e2df87e24119c4880 +k = 91bd7d97f7ed3253cedefc144771bb8acbbda6eb24f9d752bbe1dd018e1384c7 +R = 008c1755d3df81e64e25270dbaa9396641556df7ffc7ac9add6739c382705397 +S = 77df443c729b039aded5b516b1077fecdd9986402d2c4b01734ba91e055e87fc + +Msg = efe55737771070d5ac79236b04e3fbaf4f2e9bed187d1930680fcf1aba769674bf426310f21245006f528779347d28b8aeacd2b1d5e3456dcbf188b2be8c07f19219e4067c1e7c9714784285d8bac79a76b56f2e2676ea93994f11eb573af1d03fc8ed1118eafc7f07a82f3263c33eb85e497e18f435d4076a774f42d276c323 +d = 26a1aa4b927a516b661986895aff58f40b78cc5d0c767eda7eaa3dbb835b5628 +Qx = 28afa3b0f81a0e95ad302f487a9b679fcdef8d3f40236ec4d4dbf4bb0cbba8b2 +Qy = bb4ac1be8405cbae8a553fbc28e29e2e689fabe7def26d653a1dafc023f3cecf +k = f98e1933c7fad4acbe94d95c1b013e1d6931fa8f67e6dbb677b564ef7c3e56ce +R = 15a9a5412d6a03edd71b84c121ce9a94cdd166e40da9ce4d79f1afff6a395a53 +S = 86bbc2b6c63bad706ec0b093578e3f064736ec69c0dba59b9e3e7f73762a4dc3 + +Msg = ea95859cc13cccb37198d919803be89c2ee10befdcaf5d5afa09dcc529d333ae1e4ffd3bd8ba8642203badd7a80a3f77eeee9402eed365d53f05c1a995c536f8236ba6b6ff8897393506660cc8ea82b2163aa6a1855251c87d935e23857fe35b889427b449de7274d7754bdeace960b4303c5dd5f745a5cfd580293d6548c832 +d = 6a5ca39aae2d45aa331f18a8598a3f2db32781f7c92efd4f64ee3bbe0c4c4e49 +Qx = c62cc4a39ace01006ad48cf49a3e71466955bbeeca5d318d672695df926b3aa4 +Qy = c85ccf517bf2ebd9ad6a9e99254def0d74d1d2fd611e328b4a3988d4f045fe6f +k = dac00c462bc85bf39c31b5e01df33e2ec1569e6efcb334bf18f0951992ac6160 +R = 6e7ff8ec7a5c48e0877224a9fa8481283de45fcbee23b4c252b0c622442c26ad +S = 3dfac320b9c873318117da6bd856000a392b815659e5aa2a6a1852ccb2501df3 + + + +[P-384,SHA-224] + +Msg = 39f0b25d4c15b09a0692b22fbacbb5f8aee184cb75887e2ebe0cd3be5d3815d29f9b587e10b3168c939054a89df11068e5c3fac21af742bf4c3e9512f5569674e7ad8b39042bcd73e4b7ce3e64fbea1c434ed01ad4ad8b5b569f6a0b9a1144f94097925672e59ba97bc4d33be2fa21b46c3dadbfb3a1f89afa199d4b44189938 +d = 0af857beff08046f23b03c4299eda86490393bde88e4f74348886b200555276b93b37d4f6fdec17c0ea581a30c59c727 +Qx = 00ea9d109dbaa3900461a9236453952b1f1c2a5aa12f6d500ac774acdff84ab7cb71a0f91bcd55aaa57cb8b4fbb3087d +Qy = 0fc0e3116c9e94be583b02b21b1eb168d8facf3955279360cbcd86e04ee50751054cfaebcf542538ac113d56ccc38b3e +k = e2f0ce83c5bbef3a6eccd1744f893bb52952475d2531a2854a88ff0aa9b12c65961e2e517fb334ef40e0c0d7a31ed5f5 +R = c36e5f0d3de71411e6e519f63e0f56cff432330a04fefef2993fdb56343e49f2f7db5fcab7728acc1e33d4692553c02e +S = 0d4064399d58cd771ab9420d438757f5936c3808e97081e457bc862a0c905295dca60ee94f4537591c6c7d217453909b + +Msg = 5a3c80e608ed3ac75a6e45f6e94d374271a6d42b67a481860d5d309cc8b37c79cb61f1716dc8aa84cb309ef9d68eb7fc6cf4b42333f316a5c30e74198c8b340926e340c5de47674a707293c4aa2a1a2274a602f01c26b156e895499c60b38ef53fc2032e7485c168d73700d6fa14232596a0e4997854a0b05d02e351b9d3de96 +d = 047dd5baab23f439ec23b58b7e6ff4cc37813cccb4ea73bb2308e6b82b3170edfe0e131eca50841bf1b686e651c57246 +Qx = de92ff09af2950854a70f2178d2ed50cc7042a7188301a1ea81d9629ad3c29795cb7f0d56630a401e4d6e5bed0068d1e +Qy = 6135adbd8624130735e64e65ecbd43770dcc12b28e737b5ed033666f34c918eb5589508e4a13b9243374a118a628dd0b +k = f3922351d14f1e5af84faab12fe57ded30f185afe5547aeb3061104740ecc42a8df0c27f3877b4d855642b78938c4e05 +R = 38e181870cb797c1f4e6598cfd032add1cb60447d33473038d06df73919f844eddd16f40f911075f8a4bacc0d924e684 +S = a58dd1ca18aa31277de66c30c3bb7a14b53705ce6c547ed2cb0e336f63c42809422efffcc722d1155f2254330a02b278 + +Msg = e7d974c5dbd3bfb8a2fb92fdd782f997d04be79e9713944ce13c5eb6f75dfdec811b7ee4b3859114b07f263846ae13f795eec8f3cb5b7565baff68e0fdd5e09ba8b176d5a71cb03fbc5546e6937fba560acb4db24bd42de1851432b96e8ca4078313cb849bce29c9d805258601d67cd0259e255f3048682e8fdbdda3398c3e31 +d = 54ba9c740535574cebc41ca5dc950629674ee94730353ac521aafd1c342d3f8ac52046ed804264e1440d7fe409c45c83 +Qx = 3db95ded500b2506b627270bac75688dd7d44f47029adeff99397ab4b6329a38dbb278a0fc58fe4914e6ae31721a6875 +Qy = 049288341553a9ac3dc2d9e18e7a92c43dd3c25ca866f0cb4c68127bef6b0e4ba85713d27d45c7d0dc57e5782a6bf733 +k = 04324bd078807f6b18507a93ee60da02031717217ee5ce569750737be912be72da087ac00f50e13fdf7249a6ae33f73e +R = b2752aa7abc1e5a29421c9c76620bcc3049ecc97e6bc39fcca126f505a9a1bfae3bde89fb751a1aa7b66fa8db3891ef0 +S = f1c69e6d818ca7ae3a477049b46420cebd910c0a9a477fd1a67a38d628d6edaac123aebfca67c53a5c80fe454dba7a9d + +Msg = a670fda4d1d56c70de1d8680328043b2b7029633caf0ee59ffe1421c914bb937133d5a0f9214846b2e0b350455a74c4ab434c56de65a17139bb8212bf1c76071a37536fa29348f871dbb26baa92eb93d97e923a6d2ffd9be25cbc33075e494e6db657bd8dc053fe4e17148d8cf6e2058164f2b5766750eb01bbe7b361cdb848c +d = dabe87bbe95499bac23bc83c8b7307fe04be198f00059e2bf67c9611feaffb2c8f274f6aa50eb99c3074186d8067d659 +Qx = c2aa0a695125279705917e02a4f258cade4c3ff9140a071414babf87764f426f7f36ffda9d5f3394375d24864235476f +Qy = 8f9808da0ce0227cf453f9e456f557db9752e23b45cce4baad5fee3844ddd7e1112bcec01ea9d67c7a76f3535bd0cb58 +k = 65a0305854033cbc6fe3ca139c40ca354d45801ecb59f4a923c251dc6b25d12d452d99b5d6711fdb5efac812aa464cc4 +R = c7fc32997d17ac79baf5789e4503f5f1a8863872bc350a91f12dd3ef8cf78c254e829217809e8e00b6b8d4d85be3f1fd +S = 1422e1838a22496df93486bce1142961dbd8478ae844b8dda54e210afdae0d9e930d587c91bb600b0bde7237186d94e6 + +Msg = 7843f918fe2588bcfe756e1f05b491d913523255aa006818be20b676c957f4edb8df863c6f5f8c15b3b80c7a2aa277b70d53f210bdfb856337980c406ea140e439dd321471407f374f69877b2d82367eed51e3c82c13948616dcb301d0c31f8f0352f2846abd9e72071f446a2f1bd3339a09ae41b84e150fd18f4ba5d3c6bfa0 +d = df43107a1deb24d02e31d479087bd669e2bc3e50f1f44b7db9484a7143cdca6a3391bddfea72dc940dbce8ec5efbd718 +Qx = 76bd4be5d520471162cb5c36f80038301b325f845d9642204a84d78b3e721098932827bf872bde0a9f86383953667d29 +Qy = 415116b8b878f896a5aa4dbbdc21076f27135d8bbcaaca02489ef639d742bd63f377da0c8e8ab36ff19b4a7cc5d4ceb4 +k = 798abad5a30d1805794540057388ee05e2422901c6335f985b9d4447b3ef75524751abfeab6409ad6bf77d4ae3014558 +R = 98744e5c6742fa5118a74a70db4957647a3cc12add4e876b45974a6a8707809f871daadbfc0b865e01624f706b65f10c +S = 9e256e8da8eff5a0c83baaa1ef4f7be798eba9543bf97adb0fff8719f5406ea1207a0cf703d99aa8f02169724b492273 + +Msg = caa83d5ab07febbd2e0fe2d63738b9b7b8752594bea7aaf50345b3d2f316653a8c9222f2b7877b64679e9573e81461a426029e45b8873a575094a1d572e0d32a9f0a9c6bcb9a2868543b7d8bbe4a69a09e7321f05f8366cced1b72df526f895b60aed2c39c249653c7839538770d4e5f47d3926ec0d168ab6a1af15bf1dca1f7 +d = ea7a563ba2a7f5ab69973dca1f1a0d1572f0c59817cd3b62ad356c2099e2cdca1c553323563f9dfbb333b126d84abc7f +Qx = cf4717c5f5de668b785f06bdc9845df5a09e4edd83f4669756407cbb60807305c632bc49f818f4a84b194369aa07736f +Qy = 7391e4982af8a2218f704f627d01f0508bfc8304992a2d598a420bf2eb519f33bd7caf79380793733b3dba0cc5e2b9d8 +k = 7b9606b3df7b2a340dbc68d9754de0734e1faeb5a0135578a97628d948702235c60b20c8002c8fcf906783e1b389e754 +R = 0d680010bed373287f9767955b5d2850e150b6713b49e453eb280148e45230c853d99ea2d2f8fcbd3ddcba19aeec0af1 +S = 64329763a930ab5452afdb0557fef16ff71810d6343dfc9c6ae18905c3d274db6554cdc69d6078a1ca03284474a94f30 + +Msg = 594603458d6534974aeeafba919c4d0f4cb6843a3af41204bbb88aeb2fca2772d305163dba863da050aabedbaf89db521955d1715de95bbcef979ecdc0c976181ece00355385f8a8f8cce127c9eac15ce3e958a3ed686184674ec9a50eb63271606ee7fdcb1323da3c3db8e89cad1fb42139a32d08abcfbf0d4ccfca18c89a86 +d = 4cc70cb35b3ddeb0df53a6bd7bd05f8ff4392a2db7344f2d443761484b3a468a4ee3d1a8b27113d57283fd18b05f7829 +Qx = 40e1fe21df34bb85a642a0abe819ebd128f7e39b84d8dcc4a9a599b372fb9588da1484600ec28b1297bb685f9ae77831 +Qy = f3aa69ada57879fdcbe8df19cefabc308add7d03b17b1fac2f7783fece6a8dfe20bc36f518692677d96e3f730a67a671 +k = 8eda401d98f5688c34d8dbebcd3991c87c0442b0379154eaa2e5287dabe9a9e34cfc1305d11ff68781df25d5611b331d +R = ff2d772786e159448bba26afd8c3281941a4cb0c56fec6f5cccb4c292c4ee0f7af9bd39bbe2d88148732585e104fdb30 +S = 07a1d890770daa949a17797dca7af3e8163da981ec330c03d63d1a8312c152be6a718163205ffa08da7dcc163ba261f4 + +Msg = 733252d2bd35547838be22656cc7aa67eff0af0b13b428f77267a513c6824c3dbae533068b6817e82665f009560affcfe4b2ddb5b667a644fc1a42d24f24e0947e0dc50fb62c919bc1fe4e7ded5e28f2e6d80fcf66a081fb2763526f8def5a81a4ddd38be0b59ee839da1643eeeaee7b1927cec12cf3da67c02bc5465151e346 +d = 366d15e4cd7605c71560a418bd0f382fd7cd7ad3090ff1b2dfbed74336166a905e1b760cf0bccee7a0e66c5ebfb831f1 +Qx = a143f277ab36a10b645ff6c58241ea67ffdc8acf12d60973068390f06b4d8f4d773b10c1ebf6889b1cfa73ebb90f6ca1 +Qy = 7a17cad29bb507b309021f6f92cb5c10ba535f4a3e317fcc68cfd02d3ccd269f465169c73d30ff308f5350d881b08aec +k = dbe545f920bc3d704c43d834bab21e40df12ec9e16a619a3e6b3f08760c26aae6e4fd91fad00f745194794b74bb1baee +R = cdc39b12bba30da66fe9554713c05880ddc27afa4d2d151440f124c351fb9496dc95046516b0921083347d64369846ac +S = 797d0344e49f9ba87a187c50f664e5015d449e346b1a7bd9427c5be559fc58173651880d5aadf053f81899d3368d6181 + +Msg = 5a182bd174feb038dfae3346267156bf663167f713dea1ce936b0edb815cd9b8c8e4d411c786ba2494a81442617255db7158b142e720d86c9b56680fb9efd4298cdd69079a28153494c42a24251c7ad42ecf7e97eabc1b3997529b2a297cbad2474269b87a0b1e385f2d7f8b6eb8d1cd75eaf7e91d1acbecd45d7b2bfbbe3216 +d = e357d869857a52a06e1ece5593d16407022354780eb9a7cb8575cef327f877d22322c006b3c8c11e3d7d296a708bdb6d +Qx = ce9a2185a68d6094aa5849a6efe78b349946f7380f0c79aa9664246cfcc71a879e90ad78a0474f58644c6a208168150e +Qy = 8354fa47673cb3e07d446521345706c5515584b2602f921c3b9c44dded9e2c3f90ce47adb36d7e5f9f95a8c5ad8af397 +k = 1e77367ac4e10924854d135ad2f2507f39e2bafdbce33ff256bcbe9a7329b8d27185218bcc3550aafbe3390e84c77292 +R = df3182d49ad70959fb0c95bc7312750ce70fc87f1a328d39d9b29ac05d31305ce7209d6c24d13225d9567b489f7a187b +S = d812b05abab0e96de13291e1f0da6479444ed5cd9d959b76f6cb43d394769035364f7c831a104dc7b5bd9b4a8e64df64 + +Msg = aaa99fb1c71340d785a18f6f668e898c25cf7a0ac31d13c5b388b7233408493a5a109af6d07065376b96f4903df7aba2b2af671a18772bb0472490d1240cde28967680727dd4acd47e0308920a75da857a6eeedee5b6586d45dff3d8a680599665aa895c89dd7770b824b7dee477ac5e7602d409d3cc553090c970b50811dbab +d = 745a18db47324a3710b993d115b2834339315e84e7006eafd889fb49bd3cc5a8b50c90526e65e6c53bddd2916d14bead +Qx = f692578c6f77531210aef55c9e004ce3b66cf268c6900dde31a8bbb76e7562e3fb76242de34ca330d2501030aa119466 +Qy = 40965833b28de926c46de060aa25beaeda98f8415a6b1e3564aa77870cf4c89bd4fde92c8f5d9bf0eb41721586859d8e +k = 11b9b36720abcac084efdb44c9f5b7d039e3250cb1e9c47850189ba3cfc1489d858b2a44df357772b61d919c7e729c0f +R = 02b252c99820cf50e6ce060ab55bd4f682276e29b4ae4197417432e6a7bfb8cf0bac89dfe105456af805d822cee77696 +S = 8e248bbf7d7028d63177e565c9d1666ee5be4d1ffbfffc9c7814b0cd38f74b98f3f2cd59be42b9f132bfe5ee789cd96c + +Msg = 1fadfa8254d3a0b82d137cfdd82043d5dc1fef195d5297b09cc5cfb061f59c933451c0dc2a11b4037f34f88dacb803251f8880c4b72585c3c196e6fb23484ca43a191f8e41b9b9a37e2e6fcaab6738c3c62d1c98e1c620bb788b7b51a04f998a510efdba0d3418622fe8ce203b3fcd553b9b4206365a39031797ad11e49745ec +d = 93f20963ea5011ff4f26481e359309e634195f6289134087bd2e83eee008c962780a679784ee7ac6acda03d663ed27e0 +Qx = 0edcde3533ea019e18f1a3cd97b7962e8823dda36c389f8f9287549f796d11376392b8a01c7a80f127a8f75795e04f54 +Qy = 63d7c458dccfc02f5148d755d59f9bbc8e3c3ea34908777928440747795955741296abcdd5386676419ed8049fedb489 +k = 3ad308faf04c42ee5ac69d36bc0aa9a96aacf55ea0f27dac4f52e088f023d206340a6324874ffad169ff80624de24c96 +R = 209b72f9aae72c4339813573c3a8408a9e0be641ca863d81d9d14c48d0bf4cd44a1a7985cff07b5d68f3f9478475645b +S = f6292e599b22a76eda95393cf59f4745fa6c472effd1f781879ad9a4437a98080b0b07dadad0c249631c682d2836a977 + +Msg = 9ecb6f5ed3ba666a8536a81ef65012c2cb8b433508798d84708abb06dfb75503886f78384fb8c7a4d2d49ef539d9b8a0b60938c7f07471dda91f258b0d99691b38a8403a2bb3f956bdfd09baba16d9b6877097a9b6213481b47a06e139d23ec7abad5668d21f912fdb70d31bb9adf9b3ce80e308252fa81a51674f88d02db72b +d = f175e6ac42fd48ec9d652c10707c039c67c4cc61d8c45a373dcda6e4ca6c53e947e49c24e01b48e7cdf92edfe6d316a1 +Qx = a40c64f595491ce15790a5a87fbe64c1800247b42acd08fe5257700719f46afc8acce0e4ede0517a312092d5e3d089cd +Qy = d565df9dc2f381cc0c5d84f382a43a98018524c0b4708a44b3e2817f9719f29fbf9c15803591ed9b4790c5adaba9f433 +k = 812dcaa6d4f9a43ccc553288065d13761581485aa903a500a690ccafbd330ba4818c977b98c4bb57f8a182a1afacfae9 +R = d000f18d3e4c162ff0d16f662e6703e7a6f5bff7a333ed266fa4f44c752415946c34945c342c20f739677186b1d80ab3 +S = ae7f1271c89e0aaa238710d039ea73a69110cc28fcf426f2fe6754b63a59e417fa84f903cf7dccb5468b43ff083bbfd5 + +Msg = e55bfca78d98e68d1b63688db12485578f36c489766f4d0bfaa0088433ff12133aaca455805095f2e655940860958b3ead111d9070778ee3bbf3e47e43d9eba8b8d9b1fdf72f793fcde2bcaa334f3e35fa2cca531ea7cf27fe9ccba741e38ac26129b2d612bf54a34e0ae6c166c0fef07fcd2b9ac253d7e041a500f7be7b8369 +d = 46c4f0b228b28aaa0ec8cfdf1d0ed3408b7ae049312fb9eaf5f3892720e68684cc8ad29844a3dc9d110edf6916dfb8bb +Qx = 13ddec844731b7e30c467451df08ca11d6c581cb64abd8a257671cffd26f5ccad4df7b9ee8924047a88a5d2d7567609c +Qy = d74ca94f590fd1d13e190cc1e03c3da6c3faab15c7dda034af3deefee8aeec3628fa8b1978c54cfcd071baa319a46ec0 +k = 2a9dd520207c40a379cd4036adef9ee60fa8bc8c0d39b3ad91850ac93fd543f218b1688581f23481a090b0e4c73792ac +R = 94e08cca20fe3866f643f53ec65faf3f2b4d80cd9bcc8ff8f88bb28da9eada324fc2d048908dd3d08a9e0ebb547731bc +S = 8e6f82c4d3069b14f4c844b4ca133a9503493265c9f77a7d4775eda67de76798a23dd7ea48e0ac3c337dd62bf058319d + +Msg = 02c6b3c83bd34b288d96409162aa4ff114e9d134bf948046eb5ebcc0c7fe9dfceadda83ed69da2fac00c8840f6c702a3fc5e6959d70f7e8af923e99e4937232ae3b841ffefd2e62fab3671a7c94a0281b8ea5bc176add57c5c9b6893fe7f5d48ce7256b96510810c4e046168a3c5be9843b84d5268a50349b3444341aa5490dd +d = 1d7b71ef01d0d33a8513a3aed3cabb83829589c8021087a740ca65b570777089be721a61172b874a22a1f81aef3f8bb6 +Qx = 8d2721370df8f097d5a69396249a315f6037dc7045b3da11eacae6d43036f779d5de7053d101768b42cc2b1283a3aaea +Qy = a046039ae662141f9954d278183eaa2e03917fe58583e32d344074d59d60caa5b0949c53066525d5cca923e2f201502e +k = d1b25ad25581cad17e96f1d302251681fee5b2efbb71c3c15ff035b2145d015d18e0e52dc3187ab5a560277b3a3929b0 +R = d836f52b14c7391744868daa2d5cf27eb9380b9b6176195573d5b04842e9f2fc3794d6cf877feafee63d11b05f6a6bee +S = 8b89042fef2c04d4bd6c9d66a06a010514321d623a5f8d57ba5ac3686872eaabca9e0ba2d058ae7028e870acf03ca32d + +Msg = 94f8bfbb9dd6c9b6193e84c2023a27dea00fd48356909faec2161972439686c146184f80686bc09e1a698af7df9dea3d24d9e9fd6d7348a146339c839282cf8984345dc6a51096d74ad238c35233012ad729f262481ec7cd6488f13a6ebac3f3d23438c7ccb5a66e2bf820e92b71c730bb12fd64ea1770d1f892e5b1e14a9e5c +d = cf53bdd4c91fe5aa4d82f116bd68153c907963fa3c9d478c9462bb03c79039493a8eaeb855773f2df37e4e551d509dcd +Qx = 3a65b26c08102b44838f8c2327ea080daf1e4fc45bb279ce03af13a2f9575f0fff9e2e4423a58594ce95d1e710b590ce +Qy = fe9dcbcb2ec6e8bd8ed3af3ff0aa619e900cc8bab3f50f6e5f79fac09164fb6a2077cc4f1fed3e9ec6899e91db329bf3 +k = df31908c9289d1fe25e055df199591b23e266433ab8657cc82cb3bca96b88720e229f8dfd42d8b78af7db69342430bca +R = 6770eea9369d6718e60dd0b91aee845ff7ed7e0fcc91675f56d32e5227fd3a4612bbcb1556fe94a989b9e3bcc25bb20e +S = c43072f706c98126d06a82b04251e3ecb0ba66c4bb6cd7c025919b9cc6019cdc635256d2a7fa017b806b1e88649d2c0d + +[P-384,SHA-256] + +Msg = 663b12ebf44b7ed3872b385477381f4b11adeb0aec9e0e2478776313d536376dc8fd5f3c715bb6ddf32c01ee1d6f8b731785732c0d8441df636d8145577e7b3138e43c32a61bc1242e0e73d62d624cdc924856076bdbbf1ec04ad4420732ef0c53d42479a08235fcfc4db4d869c4eb2828c73928cdc3e3758362d1b770809997 +d = c602bc74a34592c311a6569661e0832c84f7207274676cc42a89f058162630184b52f0d99b855a7783c987476d7f9e6b +Qx = 0400193b21f07cd059826e9453d3e96dd145041c97d49ff6b7047f86bb0b0439e909274cb9c282bfab88674c0765bc75 +Qy = f70d89c52acbc70468d2c5ae75c76d7f69b76af62dcf95e99eba5dd11adf8f42ec9a425b0c5ec98e2f234a926b82a147 +k = c10b5c25c4683d0b7827d0d88697cdc0932496b5299b798c0dd1e7af6cc757ccb30fcd3d36ead4a804877e24f3a32443 +R = b11db00cdaf53286d4483f38cd02785948477ed7ebc2ad609054551da0ab0359978c61851788aa2ec3267946d440e878 +S = 16007873c5b0604ce68112a8fee973e8e2b6e3319c683a762ff5065a076512d7c98b27e74b7887671048ac027df8cbf2 + +Msg = 784d7f4686c01bea32cb6cab8c089fb25c341080d9832e04feac6ea63a341079cbd562a75365c63cf7e63e7e1dddc9e99db75ccee59c5295340c2bba36f457690a8f05c62ab001e3d6b333780117d1456a9c8b27d6c2504db9c1428dad8ba797a4419914fcc636f0f14ede3fba49b023b12a77a2176b0b8ff55a895dcaf8dbce +d = 0287f62a5aa8432ff5e95618ec8f9ccaa870dde99c30b51b7673378efe4ccac598f4bbebbfd8993f9abb747b6ad638b9 +Qx = b36418a3014074ec9bbcc6a4b2367a4fb464cca7ec0a324cb68670d5c5e03e7a7eb07da117c5ea50b665ab62bd02a491 +Qy = 4ea299c30e7d76e2c5905babada2d3bb4ee5eb35a5a23605cdb0d5133471a53eb9e6758e49105a4eaf29d2267ba84ef2 +k = 935eeab3edeb281fbd4eead0d9c0babd4b10ff18a31663ee9de3bfa9ae8f9d266441158ea31c889ded9b3c592da77fd7 +R = 738f9cb28f3b991335ef17b62559255faf75cad370a222464a492e27bb173c7f16b22100ada6b695875c7e4b1a28f158 +S = bc998c30e1491cd5d60dc7d1c38333165efe036b2a78db9b8f0e85ee68619cfba654e11ae5ca5ee5a87099c27cf22442 + +Msg = 45e47fccc5bd6801f237cdbeac8f66ebc75f8b71a6da556d2e002352bd85bf269b6bc7c928d7bb1b0422601e4dd80b29d5906f8fcac212fe0eaaf52eda552303259cbcbe532e60abd3d38d786a45e39a2875bce675800a3eaeb9e42983d9fd9031180abd9adccc9ba30c6c198b4202c4dd70f241e969a3c412724b9b595bc28a +d = d44d3108873977036c9b97e03f914cba2f5775b68c425d550995574081191da764acc50196f6d2508082a150af5cd41f +Qx = c703835d723c85c643260379d8445b0c816fe9534351921e14a8e147fe140ec7b0c4d704f8dc66a232b2333b28f03dee +Qy = c5d0bb054053fd86c26f147c4966757aa04b00513a02d427b8d06c16055c607955efdc518d338abfe7927c195dc28588 +k = c80f63e080650c8a21e4f63a62ec909adfb7d877f365d11ee1cb260baf112eb4730c161c1d99dba98fc0d5bbd00dc97d +R = 81de2810cde421997013513951a3d537c51a013110d6dbb29251410bcb5ba001a9686b8490f1e581e282fd2ed0974b22 +S = 9cab0bbaffe91c7677ec3dd1f17060211a3cc0be574cbca064aa8c4b66ba6e64f3d80e83da895042ca32d311c388d950 + +Msg = c33ff63b4e6891e00b2349b3f2907c417ca355560544a91e24a7a0ee260d6850aeded29fc0176b6039ca6187e8333391047cceaf14b1077df8f147dad84d36b2dac5666dc2f69dc9b58b88cc73956efdb3b47f91831d5875051c76b0c4e9fc087012a1f03eeee85d6745b46aa50bd9cb0110c2c94508765cec162ee1aa841d73 +d = d5b72cbb6ec68aca46b9c27ad992afd8ffa02cb3067b234fcfa6e272e3b31be760695ff7df988b57663057ab19dd65e3 +Qx = 135a6542612f1468d8a4d01ff1914e532b1dd64d3627db9d403dc325651d3f82b0f6f0fd1dbdeca2be967c4fb3793b5f +Qy = cbbd40f6d3a38d0dfb64582ff4789d7b268241bc0c36de2884bccfaeeff3b7b2b46a30bb35719804e0d11124b4e7f480 +k = 9da6de7c87c101b68db64fea40d97f8ad974ceb88224c6796c690cbf61b8bd8eede8470b3caf6e6106b66cf3f0eebd55 +R = 17840911ecdf6ae0428b2634f442163c2c11b8dbf0cc7a5596fbe4d33e3e52f9d99e99ad169867b1f39e89c9180cedc2 +S = dd7ed67e480866d0474379ea4afff72870746f4feef2153be42f13bf472b1613d7faa5c0abb7f7464070f94d7cf3f234 + +Msg = f562f2b9d84b0e96a52532c3b43c39c8018c738bd8dc3797a7de7353971b2729d522d6961b1f2e4df3f6a4bd3653e6d72b74fc0dba92ab939c4b542e994e5db6dd8ed4f56f651e699052e791237ae1f552f990ad156226ae8f7bf17fcbfa564f749604f97e9df0879d50985747d981422a23040fe52f5ec74caf1d4aaad8a710 +d = 218ee54a71ef2ccf012aca231fee28a2c665fc395ff5cd20bde9b8df598c282664abf9159c5b3923132983f945056d93 +Qx = 01989ff07a7a452d8084937448be946bfedac4049cea34b3db6f7c91d07d69e926cce0af3d6e88855a28120cf3dba8df +Qy = eb064e029d7539d4b301aabafe8de8870162deffe6383bc63cc005add6ee1d5ced4a5761219c60cd58ad5b2a7c74aaa9 +k = c5d39b436d851d94691f5f4aa9ef447f7989d984f279ae8b091aef5449ac062bcc0567740f914624ad5b99fc32f9af0b +R = 07d5b1b12877e8cb5e0aa5e71eeeb17bf0aa203064c7e98b3a1798a74dc9717252dc47c7f06aaf1d5fe15b868323bbb9 +S = 69428cf101a7af5d08161a9fd7af212e02e33b6062aebdce4c96bf3a0684b5394cb902ca7c2dec6e2f01f40c4576009d + +Msg = ace953ae851f571d71779aa120915f27450b236da23e9106f8d0756abdd25861937941228d225d5fb1aa1b1ebf759b1e326aeb3b6cd0cd87edd2ab9f6a7ad67b63d2c501d6a550edb2e7c9d216cc8af78dd33546af64d00abed4d0d2cfc5c9a7b5a055dbe8f7547902d185cf46937314832bc5c602419a82ab83dbd9d3bd5aff +d = e6ab171f6937c000e144950801ad91023ae8e8476856c2592d9f7d5bb7180fd729211803d39a412ead6c0be761cfa5d1 +Qx = 38bc42b8c9d8866d09b214398d584b1b24a488dfacc3420d1e9506aa825b19fdf1ba74e7b8f547f47b571467fe8c4d1f +Qy = 5179d62668d3f6a7ab5c8e3761a685e12008fb87d0529a97645f65cfb5364376c1b6682e0ffcddd0bcd995c41d013ad3 +k = 05e9718aea9669c9e434f73866da5f252dec6d24c47a1c4ee3233450b6ec626de9746ebe095b285558dfc89fc1b622fe +R = df9bab9dd1f22ec6f27116f38831cb2089aa78aa8c073024a0faddd9a48e810a5e8e2cadd80fbf8dbd6088c71fe30b5b +S = 1e0e8718567d12d18558c57f9e87a755c309e4ffb497335a3adfc8d7475ce8fd882d5dc33a8f5a16274b7ad74bb7862a + +Msg = 9635ab832240be95301bedb94c5aec169eedc198cbbdfedcf41e9b586143d829b4597a6b2a81902828332825fd84a785f187a3894e21bd99d22c4f94dcf34453fc052f15ec64d1447c932cb38fcdd30b7be851963409c11881438cbaad7e96f9efbde317f2235d66af804477a5dfe9f0c51448383830050ecf228889f83631e1 +d = 14acd516c7198798fd42ab0684d18df1cd1c99e304312752b3035bed6535a8975dff8acfc2ba1675787c817b5bff6960 +Qx = 29909d143cf7ee9c74b11d52f1a8f3ebd4a720c135612ca5618d3f432f03a95602ee75a2057e1d7aab51d0648ac0b334 +Qy = 404b6c5adffbadfa1b0380ae89fed96ec1ca16cc28661e623d0f1c8b130fbaa96dd7257eae2bf03c2d3dcbc3dbc82c58 +k = 7f623c103eaa9099a0462e55f80519c565adaeffcb57a29993f3a8a92e63a560be8f0fb9d23dc80bff1064bb41abad79 +R = 932ab291950c16b2b19a8036cd2e905714c6229cb190a73b3ea49c48dd8e76063a453c7c3267a57597d2973678216296 +S = d17d4c5ddbb9c27beebf526f113b416c8abfad53d11c4224813c7f351ba41a77dd4e77d6e4a65bef2c9f62cc37a469a5 + +Msg = d98b9a7d4fe9d0fd95de5056af164a8b7882cd34ab5bde83a2abb32dc361eb56a479a3a6119db3b91dcad26a42d2206749567f0d97c34a981a91fc734921821a429f6a53401743a5c406ba9d560f956203abc9d1f32f1a13e7d7b290f75c95fdbf857ea597021461c06a3aacfa554ede3d69e4ff03bbbee5b7463ec77de2b3b2 +d = 2e780550984f3a00cb1e412429b33493c6eb6cd86d12f9d80588c247dcf567bd04296d2d4b24b889d9c54954b7f38f57 +Qx = 37dac42ef04663238443ef33e8addee2e78c40d50a1751913a7f5c37d1f23a26c7f86e16055c788b8ca9554f06b2f2ef +Qy = bbed1549652904e3d00c39b01cc0460dbaf3185e6190c2705677a9701de1fe56dff4f4d8418ee15059ff8fc36800982d +k = b788ca82811b0d4e4841765c71eafaa1e575378beedcd3860d8b92db3d070ac5aef7c425067860fbee6c50cf0c642bbb +R = 7292b3851870daeb2555a8a2fb198ead78739fcfb75327e5c32a82c6b77d58983e5ad548ccb75dcf9411039c9576d9b9 +S = a378c61802d9f1dd062b6e18f16416a954018f77df4df95ad1b983570377d5cfce4cc7861759e802c52f81abc4f49aac + +Msg = 1b4c754ac1c28dc415a71eac816bde68de7e8db66409af835838c5bb2c605111108a3bf13606ed5d8ade5ed72e50503e0de664416393d178ea4eec834d8d6f15039847b410080fd5529b426e5aadd8451c20ebd92d787921f33e147bcbeb327b104d4aab1157fc1df33e4d768404b5ccb7110055c2508c600f429fd0c21b5784 +d = a24d0fe90808aecc5d90626d7e6da7c9be5dfd4e1233c7f0f71f1b7c1c6fd318fafe18559c94718f044cf02ed5107cb1 +Qx = ec8ae1fb9bb88589d27d6f27d790392853396f37bc0c381631d85800fc668eea0886bf1c6cff801147df19778d5b1604 +Qy = 1e1a8336c1e2506f8ee388b55cc648ae73b9295ea78467979d2affb364536fad28120f51ec62a67cbb6ce7784780389f +k = 755d025509b73cf1ea8817beb772ad150b4c17a52378be187daffe3db0158921e5e552d1ca3c85df28519939f3cb794d +R = 23ff2ffa62bbd427d49995d9c9950116e0d5a06ef076a4553448bc109e6482c5e87d4c833bc88de0bc722bc98cae2e61 +S = 9aea13d487c3ea6917e16374caafcf0321c12a80d28902dd8cd81909bb04b8c439e2491e504756742d0d0bfb15a9c34c + +Msg = 3cd8c053741dd9f974c6c5dbf8a1e5728e9b5eafb1cbcfc3452f5fbbda32a8c7564dee157e8d902c52514361da6d972934a56b3276e2a9379e328e24282e0db697c5bc29090fc489ec46b7b188325dd4e96494c250de0f4a89fe2ccf919eaefcfb50c288113e6df92714feb7f46e0822478c796d0f4ff3447a32997e892693ce +d = 1c172e25732555afee7ded67a496f3f11babc0875898619f4519c29321e201e8ba1149f2c20b48e5efba235d58fea7c3 +Qx = 13e9e2c8bbcfe26e8f5f43c86268c5980ee693236a6b8777f3a7323718baa21005b482d08aafc6fa6e3667d91353544c +Qy = 9ba181b3ee505be030f87ecd249b00670a791489b42af04976013483ff95b630c91c01e95757e906129f2f9b4ce719a8 +k = 08aec9a9e58bdc028805eb5dc86073d05fff1f5fb3fd17f510fc08f9272d84ba7aa66b6f77d84fe6360bd538192bf01a +R = 2b4337c3dfbc886ffad7858ae2480cb62227e12205a70361c42f1a5ca9e658ee30fc3cf4030d85bd065edad83b99821f +S = 2550cef8574bf17fb3d6b0c9d04ab266962bac3621bac233ff2e4989712d2a4a07171c0aebd3040cd6a32c3bd3efb8b5 + +Msg = ed955dda6d9650124804d3deb6aeef900e520faf98b1ef6f14efcada7ca2433f09329b70897305e59c89024d76e466b28fe02cb2a9b12e2478c66470259d7c282137a19e5a04ffadea55245c0f34a681593fedc42931d8b3321b3d82e9cc102cd00540ad311ec7bd8c9d06db21bea4ca3dc74d98931ae0d40494aefc2345132c +d = 5b96555dbd602e71d4d5d3aee19fd1ea084ee23d4f55c10937056762bc2015cbded2e898a487f5482ab7e1e971245907 +Qx = 6e14c17bb831b0112d7f3543c5fd17c78379a516c9e0539b03b8b4bfdead2820343fc84b0382807573ded6c4d97b7003 +Qy = 7f60021d2de77546db666721c9aec84c3e2ba8de0ba77443600dc77e6839bbf9316271adb22d4cb47d08f745ecb1dafd +k = 7ad6f4ffd2b429ba10c6f112f800cacf1ad508cf8eba880893bb9659c1ddaaec57dcdc093a114500460d457bdde324f2 +R = faea950ca513806bc59028c638d6302ffc86978c3ff1f06db015dd7c4777050186cb8dd871f5e926e1416539c1939c2f +S = 2c592240eabb8a1f9878e1b5c9d5d3ced7b3a7ae571f5a86494ed2ca567a36eb72e7bea8934bded29594bccf67ca84bd + +Msg = ce395b001da2a58e49691605d44af4206306f62f561bf2394060d2a5591a350277166bed043819035f1e60b5b3fb5ae113ddd0473f8ef6b2b050c472c2a264e1d8b3ca82a4f158c40f2d78d9ce5e5ea6de243f2e1f13f47f6c6f403b270912c81c636be35b396ca58468b3fb60aa83911d61441a0528d973bc31f965d4059080 +d = 8df9c3c710a25192f3dea970910bb3784e3509874cccf4334823eb9f7a8d05b067f2d812d61e878e24b093089a0b8245 +Qx = 92c9e32b20cbe6d4ed0727c6c942cf804a72031d6dfd69078b5e78ebce2d192268f1f5e2abce5aaf1f8d6a35f136837f +Qy = d5167905fa7689e03b9fb1487c566f62b36f2bc1c4a2bfb6a836113b5c8d46f7c1ca51b628b14397fbc06ec9a07f4849 +k = 258dd05919735cd48627c9fe9fac5c252604aa7c2ae0460d7c1149cd96b7bd2ba195ad393bf392a2499f06aead5ba050 +R = 413793bcce52eda0f5b675a8d687cce86d5c9e1659b38a89e96246b5e05f8b0934d17dbba3b2ea44c838aa5fd87125d1 +S = ce7309fc2d6e3438818a1a29a997410b025b0403de20795b97c86c46034a6b02afeed279aeb06522d4de941bfdf50469 + +Msg = ffefe316455ae4ffdb890bb804bf7d31424ea060ecacff419d0f7134ff76ad434063c0ec0f8bb7059584d3a03f3625bb9e9f66ace1a47ac4b8f3e76fc7c420c55edb1427d1fa15b387ad73d02b0595c4e74321be8822752230a0dcfb85d60bfa186da7623a8ec3eb1633f0a294b23ae87216b14ccee9ef56418dcfab9427371e +d = 6002cb01ad2ce6e7101665d47729c863b6435c3875de57a93f99da834f73e3e6e2b3880e06de3e6bd1d51ea1807ab0d7 +Qx = e4216e1a20af8e8e3e74653ac016545001066e53e64af679ad1c85841bb475aed3e00ead052ae9955f48d675ff4ace56 +Qy = 8804c17641be21d4c6386902c9c5c888af25d97ca383703ea4a85cf93bbab360c0bbd2993374da499a303778650270b9 +k = 6b9507fd2844df0949f8b67b6fde986e50173713ac03df2edf65cb339859321cd3a2b9aab8356f95dec62460ab19c822 +R = 018891f6381ed358b422f79a299cf0789cee783ba388af4d82cbbe17f3709751b7fd9400e9702820c28b9afc62fdf489 +S = aef73bd590802b2fd2a65c4f7fec89f9b24ecc199a69254785925f334cd1977c5e1f858bd9830d7d7d243ea707b1af0b + +Msg = 304bccb718b3a9e12669913490cc5bcc1979287b56c628fad706c354241e88d10e81445a2853e3fc32ece094ba1abc3fdcab61da27f9a0fca739371049fed462ee6b08fa31cde12720f8144a6f00ce9b1a7a6eadd231f126717074b4efb5c72ce673ca5859000a436f67a338d698759f12c461247c45a361fb6cb661fdbe6714 +d = d8559c3543afc6f7b3dc037a687bad2630283757ba7862fd23ed14e2151a4cf5fed3d249268f780e0b96b6b46274a2d5 +Qx = 5f94223918f2ec9f0a08342cb99e724881c92453957c59672860f69daac01b660331a0f5845e50f1f27766b219c89e7e +Qy = d76d83396130d10d1168d76c7fc83742ffffbe66d9f4da4ca3f95f5ad6dac8cc7bb65d16d317d37aa99fdbf30ec7439c +k = 4ad5a92b5b8e170b71c8a7ed419dc624c7680004562b8d16a37b6e639f581ce81d5f0d98cce44d54c4e7136229148340 +R = f7baa6a5488ab462ea59aa31a36402b15880c68110b6069f51ede0c3b52a7b1e5bf926fdbe95768931b7d5f87058835c +S = 28b1c4ef448a432f7c91b98b0c6471691e888211b6af907369a8930859b8cdb2e94f466a44f4e52f46df9b0d65e35de6 + +Msg = 64f9f05c2805acf59c047b5f5d2e20c39277b6d6380f70f87b72327a76170b872bfe4b25c451602acfb6a631bb885e2655aee8abe44f69c90fb21ffde03cef2a452c468c6369867dfd8aa26ac24e16aa53b292375a8d8fbf988e302bf00088e4c061aa12c421d8fe3cbd7273b0e8993701df1c59431f436a08b8e15bd123d133 +d = b9208cbfd186ddfa3efd5b71342ae1efb01a13ebc4c2a992a2cbee7254b7846a4252ece1104b89d13d835911f8511224 +Qx = 166e6d96cb60d916fd19888a2dd945a3306ff0d7b0a5e30729f47d3dac3de2be3fd5cd7437e9a80d6c48cf960d2d36f8 +Qy = e6b2b70f131092ae210f29cc6bad701318bddb31bddf921695855c6208941100d0cee5d10799f8b835afe3ea510e8229 +k = da706ab5f61531f2378b3c0a2b342108cd119eadaa88b859df64923bccfb0ec2393fd312826f65c15a6587d1d460015b +R = d9124c42858080c62400e4d4d8136304e03d910cbe9b9b3487f4d27c7e0540a314d34bef8c850045c8746ca631c11c42 +S = bbf6424a3b70166fa799f49e918439d515327039258ef9bd88435a59c9c19659f8ec3c8660720b0c08354ff60e0f5a76 + +[P-384,SHA-384] + +Msg = 6b45d88037392e1371d9fd1cd174e9c1838d11c3d6133dc17e65fa0c485dcca9f52d41b60161246039e42ec784d49400bffdb51459f5de654091301a09378f93464d52118b48d44b30d781eb1dbed09da11fb4c818dbd442d161aba4b9edc79f05e4b7e401651395b53bd8b5bd3f2aaa6a00877fa9b45cadb8e648550b4c6cbe +d = 201b432d8df14324182d6261db3e4b3f46a8284482d52e370da41e6cbdf45ec2952f5db7ccbce3bc29449f4fb080ac97 +Qx = c2b47944fb5de342d03285880177ca5f7d0f2fcad7678cce4229d6e1932fcac11bfc3c3e97d942a3c56bf34123013dbf +Qy = 37257906a8223866eda0743c519616a76a758ae58aee81c5fd35fbf3a855b7754a36d4a0672df95d6c44a81cf7620c2d +k = dcedabf85978e090f733c6e16646fa34df9ded6e5ce28c6676a00f58a25283db8885e16ce5bf97f917c81e1f25c9c771 +R = 50835a9251bad008106177ef004b091a1e4235cd0da84fff54542b0ed755c1d6f251609d14ecf18f9e1ddfe69b946e32 +S = 0475f3d30c6463b646e8d3bf2455830314611cbde404be518b14464fdb195fdcc92eb222e61f426a4a592c00a6a89721 + +Msg = d768f41e6e8ec2125d6cf5786d1ba96668ac6566c5cdbbe407f7f2051f3ad6b1acdbfe13edf0d0a86fa110f405406b69085219b5a234ebdb93153241f785d45811b3540d1c37424cc7194424787a51b79679266484c787fb1ded6d1a26b9567d5ea68f04be416caf3be9bd2cafa208fe2a9e234d3ae557c65d3fe6da4cb48da4 +d = 23d9f4ea6d87b7d6163d64256e3449255db14786401a51daa7847161bf56d494325ad2ac8ba928394e01061d882c3528 +Qx = 5d42d6301c54a438f65970bae2a098cbc567e98840006e356221966c86d82e8eca515bca850eaa3cd41f175f03a0cbfd +Qy = 4aef5a0ceece95d382bd70ab5ce1cb77408bae42b51a08816d5e5e1d3da8c18fcc95564a752730b0aabea983ccea4e2e +k = 67ba379366049008593eac124f59ab017358892ee0c063d38f3758bb849fd25d867c3561563cac1532a323b228dc0890 +R = fb318f4cb1276282bb43f733a7fb7c567ce94f4d02924fc758635ab2d1107108bf159b85db080cdc3b30fbb5400016f3 +S = 588e3d7af5da03eae255ecb1813100d95edc243476b724b22db8e85377660d7645ddc1c2c2ee4eaea8b683dbe22f86ca + +Msg = 6af6652e92a17b7898e40b6776fabaf0d74cf88d8f0ebfa6088309cbe09fac472eeac2aa8ea96b8c12e993d14c93f8ef4e8b547afe7ae5e4f3973170b35deb3239898918c70c1056332c3f894cd643d2d9b93c2561aac069577bbab45803250a31cd62226cab94d8cba7261dce9fe88c210c212b54329d76a273522c8ba91ddf +d = b5f670e98d8befc46f6f51fb2997069550c2a52ebfb4e5e25dd905352d9ef89eed5c2ecd16521853aadb1b52b8c42ae6 +Qx = 44ffb2a3a95e12d87c72b5ea0a8a7cb89f56b3bd46342b2303608d7216301c21b5d2921d80b6628dc512ccb84e2fc278 +Qy = e4c1002f1828abaec768cadcb7cf42fbf93b1709ccae6df5b134c41fae2b9a188bfbe1eccff0bd348517d7227f2071a6 +k = 229e67638f712f57bea4c2b02279d5ccad1e7c9e201c77f6f01aeb81ea90e62b44b2d2107fd66d35e56608fff65e28e4 +R = b11db592e4ebc75b6472b879b1d8ce57452c615aef20f67a280f8bca9b11a30ad4ac9d69541258c7dd5d0b4ab8dd7d49 +S = 4eb51db8004e46d438359abf060a9444616cb46b4f99c9a05b53ba6df02e914c9c0b6cc3a9791d804d2e4c0984dab1cc + +Msg = b96d74b2265dd895d94e25092fb9262dc4f2f7a328a3c0c3da134b2d0a4e2058ca994e3445c5ff4f812738e1b0c0f7a126486942a12e674a21f22d0886d68df2375f41685d694d487a718024933a7c4306f33f1a4267d469c530b0fed4e7dea520a19dd68bf0203cc87cad652260ed43b7b23f6ed140d3085875190191a0381a +d = de5975d8932533f092e76295ed6b23f10fc5fba48bfb82c6cc714826baf0126813247f8bd51d5738503654ab22459976 +Qx = f1fabafc01fec7e96d982528d9ef3a2a18b7fe8ae0fa0673977341c7ae4ae8d8d3d67420343d013a984f5f61da29ae38 +Qy = 1a31cf902c46343d01b2ebb614bc789c313b5f91f9302ad9418e9c797563e2fa3d44500f47b4e26ad8fdec1a816d1dcf +k = fc5940e661542436f9265c34bce407eff6364bd471aa79b90c906d923e15c9ed96eea4e86f3238ea86161d13b7d9359d +R = c2fbdd6a56789024082173725d797ef9fd6accb6ae664b7260f9e83cb8ab2490428c8b9c52e153612295432fec4d59cd +S = 8056c5bb57f41f73082888b234fcda320a33250b5da012ba1fdb4924355ae679012d81d2c08fc0f8634c708a4833232f + +Msg = 7cec7480a037ff40c232c1d2d6e8cd4c080bbeecdaf3886fccc9f129bb6d202c316eca76c8ad4e76079afe622f833a16f4907e817260c1fa68b10c7a151a37eb8c036b057ed4652c353db4b4a34b37c9a2b300fb5f5fcfb8aa8adae13db359160f70a9241546140e550af0073468683377e6771b6508327408c245d78911c2cc +d = 11e0d470dc31fab0f5722f87b74a6c8d7414115e58ceb38bfcdced367beac3adbf1fe9ba5a04f72e978b1eb54597eabc +Qx = 1950166989164cbfd97968c7e8adb6fbca1873ebef811ea259eb48b7d584627f0e6d6c64defe23cbc95236505a252aa1 +Qy = 41ef424b5cb076d4e32accd9250ea75fcf4ffd81814040c050d58c0a29b06be11edf67c911b403e418b7277417e52906 +k = e56904028226eb04f8d071e3f9cefec91075a81ca0fa87b44cae148fe1ce9827b5d1910db2336d0eb9813ddba3e4d7b5 +R = c38ef30f55624e8935680c29f8c24824877cf48ffc0ef015e62de1068893353030d1193bf9d34237d7ce6ba92c98b0fe +S = 651b8c3d5c9d5b936d300802a06d82ad54f7b1ba4327b2f031c0c5b0cb215ad4354edc7f932d934e877dfa1cf51b13fe + +Msg = 00ce978603229710345c9ad7c1c2dba3596b196528eea25bd822d43ca8f76a024e29217703dd0652c8a615284fc3edcc1c5ad1c8d5a8521c8e104c016a24e50c2e25066dcb56596f913b872767e3627aa3e55ec812e9fdac7c2f1beade83aef093e24c9c953982adf431a776880ae4583be158e11cdab1cbca3ad3a66900213d +d = 5c6bbf9fbcbb7b97c9535f57b431ed1ccae1945b7e8a4f1b032016b07810bd24a9e20055c0e9306650df59ef7e2cd8c2 +Qx = 2e01c5b59e619e00b79060a1e8ef695472e23bf9a511fc3d5ed77a334a242557098e40972713732c5291c97adf9cf2cf +Qy = 563e3fe4ad807e803b9e961b08da4dde4cea8925649da0d93221ce4cdceabc6a1db7612180a8c6bef3579c65539b97e9 +k = 03d23f1277b949cb6380211ad9d338e6f76c3eedac95989b91d0243cfb734a54b19bca45a5d13d6a4b9f815d919eea77 +R = abab65308f0b79c4f3a9ff28dd490acb0c320434094cef93e75adfe17e5820dc1f77544cfaaacdc8cf9ac8b38e174bef +S = 11b783d879a6de054b316af7d56e526c3dce96c85289122e3ad927cfa77bfc50b4a96c97f85b1b8221be2df083ff58fb + +Msg = 54a255c18692c6162a46add176a0ae8361dcb8948f092d8d7bac83e160431794d3b9812849bf1994bcdcfba56e8540c8a9ee5b93414548f2a653191b6bb28bda8dc70d45cc1b92a489f58a2d54f85766cb3c90de7dd88e690d8ebc9a79987eee1989df35af5e35522f83d85c48dda89863171c8b0bf4853ae28c2ac45c764416 +d = ffc7dedeff8343721f72046bc3c126626c177b0e48e247f44fd61f8469d4d5f0a74147fabaa334495cc1f986ebc5f0b1 +Qx = 51c78c979452edd53b563f63eb3e854a5b23e87f1b2103942b65f77d024471f75c8ce1cc0dfef83292b368112aa5126e +Qy = 313e6aaf09caa3ba30f13072b2134878f14a4a01ee86326cccbff3d079b4df097dc57985e8c8c834a10cb9d766169366 +k = c3de91dbe4f777698773da70dd610ef1a7efe4dc00d734399c7dd100728006a502822a5a7ff9129ffd8adf6c1fc1211a +R = f4f477855819ad8b1763f53691b76afbc4a31a638b1e08c293f9bcd55decf797f9913ca128d4b45b2e2ea3e82c6cf565 +S = 7c26be29569ef95480a6d0c1af49dc10a51a0a8931345e48c0c39498bfb94d62962980b56143a7b41a2fddc8794c1b7f + +Msg = 692a78f90d4f9d5aee5da536314a78d68c1feabbfe5d1ccea7f6059a66c4b310f8051c411c409ccf6e19a0cbd8b8e100c48317fe8c6d4f8a638b9551ce7ee178020f04f7da3001a0e6855225fb3c9b375e4ed964588a1a41a095f3f476c42d52ffd23ce1702c93b56d4425d3befcf75d0951b6fd5c05b05455bdaf205fe70ca2 +d = adca364ef144a21df64b163615e8349cf74ee9dbf728104215c532073a7f74e2f67385779f7f74ab344cc3c7da061cf6 +Qx = ef948daae68242330a7358ef73f23b56c07e37126266db3fa6eea233a04a9b3e4915233dd6754427cd4b71b75854077d +Qy = 009453ef1828eaff9e17c856d4fc1895ab60051312c3e1db1e3766566438b2990cbf9945c2545619e3e0145bc6a79004 +k = a2da3fae2e6da3cf11b49861afb34fba357fea89f54b35ce5ed7434ae09103fe53e2be75b93fc579fedf919f6d5e407e +R = dda994b9c428b57e9f8bbaebba0d682e3aac6ed828e3a1e99a7fc4c804bff8df151137f539c7389d80e23d9f3ee497bf +S = a0d6b10ceffd0e1b29cf784476f9173ba6ecd2cfc7929725f2d6e24e0db5a4721683640eaa2bbe151fb57560f9ce594b + +Msg = 3b309bb912ab2a51681451ed18ad79e95d968abc35423a67036a02af92f575a0c89f1b668afe22c7037ad1199e757a8f06b281c33e9a40bab69c9874e0bb680b905d909b9dc24a9fe89bb3d7f7d47082b25093c59754f8c19d1f81f30334a8cdd50a3cb72f96d4b3c305e60a439a7e93aeb640dd3c8de37d63c60fb469c2d3ed +d = 39bea008ec8a217866dcbdb1b93da34d1d3e851d011df9ef44b7828b3453a54aa70f1df9932170804eacd207e4f7e91d +Qx = 5709ec4305a9c3271c304face6c148142490b827a73a4c17affcfd01fffd7eaa65d2fdedfa2419fc64ed910823513faf +Qy = b083cda1cf3be6371b6c06e729ea6299213428db57119347247ec1fcd44204386cc0bca3f452d9d864b39efbfc89d6b2 +k = 3c90cc7b6984056f570542a51cbe497ce4c11aeae8fc35e8fd6a0d9adeb650e8644f9d1d5e4341b5adc81e27f284c08f +R = d13646895afb1bfd1953551bb922809c95ad65d6abe94eb3719c899aa1f6dba6b01222c7f283900fe98628b7597b6ea6 +S = 4a9a38afda04c0a6b0058943b679bd02205b14d0f3d49b8f31aac289129780cdb1c555def8c3f9106b478729e0c7efaa + +Msg = f072b72b8783289463da118613c43824d11441dba364c289de03ff5fab3a6f60e85957d8ff211f1cb62fa90216fb727106f692e5ae0844b11b710e5a12c69df3ed895b94e8769ecd15ff433762d6e8e94d8e6a72645b213b0231344e2c968056766c5dd6b5a5df41971858b85e99afbf859400f839b42cd129068efabeea4a26 +d = e849cf948b241362e3e20c458b52df044f2a72deb0f41c1bb0673e7c04cdd70811215059032b5ca3cc69c345dcce4cf7 +Qx = 06c037a0cbf43fdf335dff33de06d34348405353f9fdf2ce1361efba30fb204aea9dbd2e30da0a10fd2d876188371be6 +Qy = 360d38f3940e34679204b98fbf70b8a4d97f25443e46d0807ab634ed5891ad864dd7703557aa933cd380e26eea662a43 +k = 32386b2593c85e877b70e5e5495936f65dc49553caef1aa6cc14d9cd370c442a0ccfab4c0da9ec311b67913b1b575a9d +R = 5886078d3495767e330c7507b7ca0fa07a50e59912a416d89f0ab1aa4e88153d6eaf00882d1b4aa64153153352d853b5 +S = 2cc10023bf1bf8ccfd14b06b82cc2114449a352389c8ff9f6f78cdc4e32bde69f3869da0e17f691b329682ae7a36e1aa + +Msg = cf4945350be8133b575c4ad6c9585e0b83ff1ed17989b6cd6c71b41b5264e828b4e115995b1ae77528e7e9002ac1b5669064442645929f9d7dd70927cb93f95edeb73e8624f4bc897ec4c2c7581cb626916f29b2d6e6c2fba8c59a71e30754b459d81b912a12798182bcff4019c7bdfe929cc769bcc2414befe7d2906add4271 +d = d89607475d509ef23dc9f476eae4280c986de741b63560670fa2bd605f5049f1972792c0413a5b3b4b34e7a38b70b7ca +Qx = 49a1c631f31cf5c45b2676b1f130cbf9be683d0a50dffae0d147c1e9913ab1090c6529a84f47ddc7cf025921b771355a +Qy = 1e207eece62f2bcc6bdabc1113158145170be97469a2904eaaa93aad85b86a19719207f3e423051f5b9cbbe2754eefcb +k = 78613c570c8d33b7dd1bd1561d87e36282e8cf4843e7c344a2b2bb6a0da94756d670eeaffe434f7ae7c780f7cf05ca08 +R = 66f92b39aa3f4aeb9e2dc03ac3855406fa3ebbab0a6c88a78d7a03482f0c9868d7b78bc081ede0947c7f37bf193074ba +S = e5c64ed98d7f3701193f25dd237d59c91c0da6e26215e0889d82e6d3e416693f8d58843cf30ab10ab8d0edd9170b53ad + +Msg = d9b5cf0b50416573ff3c63133275a18394dd4326be2041e8d97e6e4e3855a4a177e9d26dfd223fe8aa74564edb49bd72de19916fb6f001f44530d5c18e2c332bce1b7415df5927ece5f3824f34d174b963136b53aef1fb78fb0c06a201a40b2db38e4d8216fc1e392a798c8ab4b3a314496b7f1087804ebfa89bf96e9cdb80c0 +d = 083e7152734adf342520ae377087a223688de2899b10cfcb34a0b36bca500a4dfa530e2343e6a39da7ae1eb0862b4a0d +Qx = 70a0f16b6c61172659b027ed19b18fd8f57bd28dc0501f207bd6b0bb065b5671cf3dd1ed13d388dcf6ccc766597aa604 +Qy = 4f845bf01c3c3f6126a7368c3454f51425801ee0b72e63fb6799b4420bfdebe3e37c7246db627cc82c09654979c700bb +k = 28096ababe29a075fbdf894709a20d0fdedb01ed3eeacb642a33a0da6aed726e13caf6cf206792ec359f0c9f9b567552 +R = ee2923f9b9999ea05b5e57f505bed5c6ba0420def42c6fa90eef7a6ef770786525546de27cdeb2f8586f8f29fb4ee67c +S = 50ef923fb217c4cf65a48b94412fda430fac685f0da7bd574557c6c50f5b22e0c8354d99f2c2f2c2691f252f93c7d84a + +Msg = 9e4042d8438a405475b7dab1cd783eb6ce1d1bffa46ac9dfda622b23ac31057b922eced8e2ed7b3241efeafd7c9ab372bf16230f7134647f2956fb793989d3c885a5ae064e85ed971b64f5f561e7ddb79d49aa6ebe727c671c67879b794554c04de0e05d68264855745ef3c9567bd646d5c5f8728b797c181b6b6a876e167663 +d = 63578d416215aff2cc78f9b926d4c7740a77c142944e104aa7422b19a616898262d46a8a942d5e8d5db135ee8b09a368 +Qx = cadbacef4406099316db2ce3206adc636c2bb0a835847ed7941efb02862472f3150338f13f4860d47f39b7e098f0a390 +Qy = 752ad0f22c9c264336cde11bbc95d1816ed4d1b1500db6b8dce259a42832e613c31178c2c7995206a62e201ba108f570 +k = 7b69c5d5b4d05c9950dc94c27d58403b4c52c004b80a80418ad3a89aabc5d34f21926729e76afd280cc8ee88c9805a2a +R = db054addb6161ee49c6ce2e4d646d7670754747b6737ca8516e9d1e87859937c3ef9b1d2663e10d7e4bd00ec85b7a97a +S = fcc504e0f00ef29587e4bc22faada4db30e2cb1ac552680a65785ae87beb666c792513f2be7a3180fc544296841a0e27 + +Msg = 0b14a7484a40b68a3ce1273b8a48b8fdb65ba900d98541c4bbd07b97e31bcc4c85545a03e9deab3c563f47a036ff60d0361684ba241b5aa68bb46f440da22181ee328a011de98eff34ba235ec10612b07bdfa6b3dc4ccc5e82d3a8d057e1862fef3def5a1804696f84699fda2ec4175a54a4d08bcb4f0406fdac4eddadf5e29b +d = ed4df19971658b74868800b3b81bc877807743b25c65740f1d6377542afe2c6427612c840ada31a8eb794718f37c7283 +Qx = 33093a0568757e8b58df5b72ea5fe5bf26e6f7aeb541b4c6a8c189c93721749bcaceccf2982a2f0702586a9f812fc66f +Qy = ebe320d09e1f0662189d50b85a20403b821ac0d000afdbf66a0a33f304726c69e354d81c50b94ba3a5250efc31319cd1 +k = d9b4cd1bdfa83e608289634dbfcee643f07315baf743fc91922880b55a2feda3b38ddf6040d3ba10985cd1285fc690d5 +R = 009c74063e206a4259b53decff5445683a03f44fa67252b76bd3581081c714f882f882df915e97dbeab061fa8b3cc4e7 +S = d40e09d3468b46699948007e8f59845766dbf694b9c62066890dd055c0cb9a0caf0aa611fb9f466ad0bbb00dbe29d7eb + +Msg = 0e646c6c3cc0f9fdedef934b7195fe3837836a9f6f263968af95ef84cd035750f3cdb649de745c874a6ef66b3dd83b66068b4335bc0a97184182e3965c722b3b1aee488c3620adb835a8140e199f4fc83a88b02881816b366a09316e25685217f9221157fc05b2d8d2bc855372183da7af3f0a14148a09def37a332f8eb40dc9 +d = e9c7e9a79618d6ff3274da1abd0ff3ed0ec1ae3b54c3a4fd8d68d98fb04326b7633fc637e0b195228d0edba6bb1468fb +Qx = a39ac353ca787982c577aff1e8601ce192aa90fd0de4c0ed627f66a8b6f02ae51315543f72ffc1c48a7269b25e7c289a +Qy = 9064a507b66b340b6e0e0d5ffaa67dd20e6dafc0ea6a6faee1635177af256f9108a22e9edf736ab4ae8e96dc207b1fa9 +k = b094cb3a5c1440cfab9dc56d0ec2eff00f2110dea203654c70757254aa5912a7e73972e607459b1f4861e0b08a5cc763 +R = ee82c0f90501136eb0dc0e459ad17bf3be1b1c8b8d05c60068a9306a346326ff7344776a95f1f7e2e2cf9477130e735c +S = af10b90f203af23b7500e070536e64629ba19245d6ef39aab57fcdb1b73c4c6bf7070c6263544633d3d358c12a178138 + +[P-384,SHA-512] + +Msg = 67d9eb88f289454d61def4764d1573db49b875cfb11e139d7eacc4b7a79d3db3bf7208191b2b2078cbbcc974ec0da1ed5e0c10ec37f6181bf81c0f32972a125df64e3b3e1d838ec7da8dfe0b7fcc911e43159a79c73df5fa252b98790be511d8a732fcbf011aacc7d45d8027d50a347703d613ceda09f650c6104c9459537c8f +d = 217afba406d8ab32ee07b0f27eef789fc201d121ffab76c8fbe3c2d352c594909abe591c6f86233992362c9d631baf7c +Qx = fb937e4a303617b71b6c1a25f2ac786087328a3e26bdef55e52d46ab5e69e5411bf9fc55f5df9994d2bf82e8f39a153e +Qy = a97d9075e92fa5bfe67e6ec18e21cc4d11fde59a68aef72c0e46a28f31a9d60385f41f39da468f4e6c3d3fbac9046765 +k = 90338a7f6ffce541366ca2987c3b3ca527992d1efcf1dd2723fbd241a24cff19990f2af5fd6419ed2104b4a59b5ae631 +R = c269d9c4619aafdf5f4b3100211dddb14693abe25551e04f9499c91152a296d7449c08b36f87d1e16e8e15fee4a7f5c8 +S = 77ffed5c61665152d52161dc13ac3fbae5786928a3d736f42d34a9e4d6d4a70a02d5af90fa37a23a318902ae2656c071 + +Msg = 45db86829c363c80160659e3c5c7d7971abb1f6f0d495709bba908d7aa99c9df64b3408a51bd69aba8870e2aaff488ef138f3123cf94391d081f357e21906a4e2f311defe527c55e0231579957c51def507f835cceb466eb2593a509dcbee2f09e0dde6693b2bfe17697c9e86dd672f5797339cbe9ea8a7c6309b061eca7aef5 +d = 0a3f45a28a355381a919372f60320d6610cfb69c3e318eb1607db3cadfc42b728b77a6a9e9e333de9183c58933daf60f +Qx = 832cbb7061a719a316e73dbad348fa67cd17c33f40b9000a3d3b691a2a2cd821052566717c3ead01089b56086af1366f +Qy = 1e15a048d1dce642d9ebcbfac7f92b1bcee90fd0240cc79abd29e32e0e655c4ee1fd34fb88178bba92aca100e7794ed0 +k = 2a78e651623ba604c42cf094fc7d046629306f508853427ba091448800d1092c041bb2323035fc9d19a8d44950f7dcc3 +R = 0db0cc9a2bda8dd7e565ad36f91b1c5756d78164dc8a72a5bee4b6bc45ea38c7a16b01d05b1893d4e06b62db24c30385 +S = abd383edaeda7d0b8de1b54fcd3c28874fed62ab266f1f84c8ba796a7b54e5e0695fdb43ce7fe90ed00fa468d87bca64 + +Msg = 4672fce0721d37c5be166bffa4b30d753bcf104b9b414db994b3ed33f36af4935ea59a0bb92db66448b3f57dad4fc67cef10ce141bf82c536be604b89a0bc0e8bca605b867880049d97142d30538fc543bd9d4fab7fdbe2f703815cdb6361beb66acff764bc275f910d1662445b07b92830db69a5994857f53657ed5ca282648 +d = 2e408c57921939f0e0fe2e80ce74a4fa4a1b4fa7ab070206298fe894d655be50e2583af9e45544b5d69c73dce8a2c8e7 +Qx = a2b24a5ad4a2e91f12199ed7699e3f297e27bf8b8ea8fbe7ed28366f3544cd8e680c238450f8a6422b40829d6647b25c +Qy = 2732be0075536e6519f6a099b975a40f8e0de337fa4d48bd0762b43f41cab8deafdef9cfbb9973e457801e3bf9c93304 +k = b10b6258afdde81f9c971cc1526d942e20cafac02f59fee10f98e99b8674636bff1d84a6eaa49c0de8d8cfdc90d8ce84 +R = be428a8de89a364a134719141ee8d776a3a8338f1132b07e01b28573d8eaf3b9008b63304c48821e53638b6141f9660b +S = 866181dbef5c147d391bed6adcee408c339982c307adc718c2b9ab9e5642d8dedc36dd6402559a3ab614c99c1e56b529 + +Msg = 9ae48fdd9bfc5cb0f4d4761e28b2073bda05a3e3fe82c212e66701dc4573cc67a829b0f82d7520b1bf11db0c6d1743822bbe41bb0adbd7222aa5fae70fbd1a31f2d4453a01c81e064d775388468be96f6063f8673b7b8d4455fe1bd4c801ad5e625a015eaa4a1a18da490d2af8642201eaba3c611cbd65f861d8e19ca82a1ee6 +d = 1c285da72a8eb1c3c38faab8d3bb4e68dc95c797082b9a3991a21c1de54759071ecf2265fb1eff504ab24174bc6710cf +Qx = 11acb1b5cc59a4f1df1913a8d6e91cbdafb8206dc44aff7d9da45906b664fc33194d9935a82aa4d62f39618897c86025 +Qy = 832ed0b9575fff52a3603bfe89f312751b4c396da98324117a61b3f525d27b2266f6cfb22be07e50b6874435e380ed62 +k = 2513075e02cc7fb3cff7b7adde46da31c5493749b5cf02758bd5b098a838bfd4d5e4c7fb8268bdc37e219c30efebe878 +R = b3d638b3be45f14f170da5bdc22d2114deac93ab340a25b3af2b5c18584bb9147e00dc6c67a2274f79aa4838793eb63f +S = 876112bdca2c725eb2f6dbd76d07710a31f0c16d38430cb0817f320a25a9ecfec8a66137d0304612ae29a6a484fd3319 + +Msg = 817d6a110a8fd0ca7b4d565558f68b59a156744d4c5aac5c6610c95451793de2a756f774558c61d21818d3ebeeeb71d132da1c23a02f4b305eccc5cd46bd21dfc173a8a91098354f10ffbb21bf63d9f4c3feb231c736504549a78fd76d39f3ad35c36178f5c233742d2917d5611d2073124845f1e3615b2ef25199a7a547e882 +d = 9da37e104938019fbdcf247e3df879a282c45f8fb57e6655e36b47723af42bec3b820f660436deb3de123a21de0ca37b +Qx = 722d0ea6891d509b18b85ca56f74deb5c3030d2a30433824123d430d03c99279572c3b28ecf01e747b9db8acc55d0ba3 +Qy = 7e2605ea7092214f366f3639037bffd89fe103c646e990839d3a1ced8d78edb5b9bc60d834fd8e2a3c17e920bdae023a +k = c8c18e53a9aa5915288c33132bd09323638f7995cd89162073984ed84e72e07a37e18c4c023933eace92c35d10e6b1b6 +R = 6512a8a2be731e301dcf4803764297862bbfa0ac8daed64d8e98b34618ecb20520fc5d3cf890b7783edf86e7ea407541 +S = 4ff10301f7b4168fae066361376007c1d7aa89a75c87719d0b54711ffef5ef3726f3eef84f7ebc025c110bde511b17f6 + +Msg = 464f10ec6fb229a51db5fd0e122f2cb8a9a022117e2987f4007bf5565b2c16aba0714e2e3cdd0c100d55ac3017e36fc7501ad8309ab9572aa65424c9eb2e580a119c55777676ec498df53ef6ae78fd8a988130ee0e6082bf1ef71cd4c946021018a8ca7154d13b174c638912613b0bdb9001c302bf7e443ad2124ab2c1cce212 +d = 0661ab3bf9f7bef51bec7dff758de289154557beb9ce18cc4b8cc09a871e8322af259cf188b593dc62f03a19e75f7f69 +Qx = b4f100558043858efa728082d9b99ad5192b59b0947434f5ba7ff2514508a6d71ba54e7221c31cb0712103272b3f6fa4 +Qy = 34f6df4eeb2da11498044635067c2715ed15ae251c78ffb9030d87909ea8539b66394e93109ca54c0406cf99960c3e93 +k = 84a87137edb6894f96c5a8e94a3765162034feb84dfea94e1c71411170c285a80321ec7999e25861844143209804882c +R = 4dc9d1b949b36e3c3847ac1c7ed114e1bc9cbe76119cf6fcd3f1b69ee6ee54e3255f1bb288fe2f8bd6d4049a21793c27 +S = 56a561d647b62ccae1e6df818b1a6fbde66c82ef0ff69ee415f183e7daf76be22630c7e02cd3fd729dfa490f26824584 + +Msg = 4e3e0fb96320ddccde8b463c273654c4f7164920b1d63430921d2e808dee403e6420eedda0a557b911d00736a4f8798dd4ef26673efd6d190988ad4929ec64f8685cfb76070a36cd6a3a4bf2f54fb08a349d44642b6f614043fef9b2813b63457c76537d23da7b37310334f7ba76edf1999dad86f72aa3446445a65952ac4e50 +d = 66e7cfdeb7f264cf786e35210f458c32223c3a12a3bc4b63d53a5776bc9b069928452484f6241caa3781fd1a4109d4db +Qx = 3c7682de540ab231daf21bf9fc80bda6abf7e17dcc79d476c7b7c3bd4d42d386877fd8ba495c1b0333e04fb5fd2a1505 +Qy = 0a1582e4f4d72abea9d3476aff8369c41261f0c5dddf2ca82e10f7a163f73df09473d9e5e2552187104e4cc7c6d83611 +k = 2fa266f5cce190eb77614933ca6a55121ad8bae168ff7a9043d96d13b5ca2fe70101ff9fe1e2b2cd7413e6aa8f49abde +R = e7ecda9da0c52d0474a9f70094dc8f061d7d6a22210d3b69a7be8f389aa666f256322099b87d16ad35357ea856574dba +S = ba348eb40a2830ec5a1130264ac0a8675420b1ae243e808a778135809ece21f42c0c881166321102b4f02df4c5c7ed9d + +Msg = c466b6b6baf7e6ffa876ec06105e2d43534e0517c07b1c4c9fb67ba81ce09525a7721ec3c290f2b1f65b6463d41598e7a25b2238501629953a5ca955b644354fb6856733a2e5bb8f5bc21a0c803493f5539f9fb83aab3dba2c982989c2270c61ab244b68bfe1b948d00c2ed975e09c29b5f8a7effcad8652a148cc880d503217 +d = 92c2f7ee64af86d003ab484e12b82fcf245fc330761057fec5b7af8f7e0a2d85b468c21d171460fcb829cae7b986316d +Qx = ca43a306479bf8fb537d4b9ff9d635bbb2a0d60d9e854d5b7e269d09d91f78c6b90b616e4c931629453645a2bb371e14 +Qy = 356c4d7f10e690614eaf7f82ba0f9dc1aad98130c0ad9fe353deec565cc04bef789a0a4242322e0058b46cd02f2de77d +k = 6ec81fb74f8725ba225f317264460ee300cfd2f02092000989acbdad4799cf55c244a65c557113328fe20282e6badb55 +R = cd7a4309bcebc25a8e10899fe2eda5f8b2dbcf329cd2f3d65befd67393e83fba2f8a67a15c01a6ac8314f9f5e87a9dca +S = 6dcfc0426bc148e67e91d4784e3d7e9bc3b7ce3676be62daa7f3f55dfdff6d9dc735b5e3e0bbd0785db1f76f7ac065f3 + +Msg = feac892b7720af80b3c9eede51e923f18d3d0c5de4c31f4aa75e36df7c7c2fd8f41778851a24b69e67dccb65e159dd5c383243bad7cfedcc5e85c8a01c34b0b94ba8e07e4c024c09d279b3731e8b62f9562d3c4f5042567efe42a9d0eaaabab28bc6f11232fc8ceaaf4518d9f3b2bebf020294496b7f6b879e69503f75fecd3d +d = 15347caaad1067f1848a676bd0a8c52021ae604b79d02775a0459226e0391a3acd26653c916fcfe86149fb0ee0904476 +Qx = e5a0463163964d984f5bad0072d45bc2059939e60a826ccca36c151460ae360f5d6679f60fe43e999b6da5841c96e48a +Qy = 30f2dd425a3fa2c95d34124217250b39e3b4a14f3e6e415ae8e5b0409eb72f43f78b64d0ce6f2d49980d6f04cd1391db +k = 1a2d224db4bb9c241ca5cab18920fad615fa25c1db0de0f024cb3ace0d11ef72b056885446659f67650fdff692517b1c +R = 87b4de0fb21df38dfc9a4b1e350da67547e307f55b5b9dd6615e408afe7c3553a6e02722847367439e636074faa2182b +S = 375d965753b9ed6c6c08576726f8308c2f8dbd2737824464e71265d47907e26f615bbeb8203ec617520d4ecd1851dc44 + +Msg = cf2982e3bf174ce547741b969403cd11e9553067e6af8177d89511a0eb040db924530bdba65d8b1ff714228db0737c1756f509e1506014a10736e65be2f91980a73891496e90ff2714a3601c7565cdcef5a395e2e0e1652f138d90d61eaa9cba993b823245647f6e07cec9b8b4449cd68a29741cd1579c66e548ca0d0acf33aa +d = ac1cb5e59bda2eff3413a3bab80308f9fb32c595283c795de4c17fdae8d4647b5f108fd0801aee22adb7db129283b5aa +Qx = bc6b1a718284803553c173089c397870aaaecca579bb8e81a8cfa12473cd2057567fa8726a19ed427cc035baeec2c551 +Qy = 14f82997d1129b669f0015350e47ad561b1b13441af4fb44656f15ed0c5706984d66655accc52f2e943eef39cb1cdc21 +k = 8053a46e875f446056b06d4318fa3e8977622de7207cbf0996bf35b0e9b19aaa507f642bcf0be9f048f1af09806f6946 +R = a994eb15b64114ce8a9342d18b5edda96a6d76314a5ac03da723699177d352a4a9f3b7121b11a91e43a6af4025da51d6 +S = 8183ae33a888e99aa76882da0a6705ad102f2bbd9572fad0d2e4d6d70151970469e00c5220e59c14724d771c1384b302 + +Msg = bf9fdd4107ef5a6070108771ac9eee4f0c8043bf0d04db772a47294f4137e2439d94b337114b074e57e0cb78d0ccf352a2833e9788ee2a1a9ffeacd34f38fcefb86653d70c7dadd4cf6548d608e70acdef6c7530974b92c813798add659752a8c72b05e1ad9c65c21834ce6fbe49d8a1426b5a54270794436d284364fac6ec1a +d = 205f1eb3dfacff2bdd8590e43e613b92512d6a415c5951bda7a6c37db3aae39b9b7ec6edd256609e75373419087fa71f +Qx = c9f1f63a18c761b077a1ec35fbb2de635db9b8592c36194a01769b57728c7755d4c79b3d5b97a1a4631e30c86d03f13c +Qy = f8c4a38770054d5cc9bb9182e6d4638242c4fd16e869ac22e44c4b9402d594e0c6f5df6a9a7de32a4893d9f6588f1950 +k = ecd395c5d8b7d6e6b2b19644e0d2e6086c912c6a0f5b8ed4b94b7290b65852c9741ce8eeb08d8751ead8a183e17d76c6 +R = e81331d78b438b0b8d98c1be03385ba5d614af182f1677f259126cc3de7eaac6c19b02be955d936b6bf9c27c6796e6f0 +S = 17c2b7a8e0fc93909762aa9f86f9561e759ecb88f02337b2018363be6095d9e4324a6d3296046686624b5efad6b52878 + +Msg = 5d634fb39a2239256107dc68db19751540b4badac9ecf2fce644724401d6d632b3ae3b2e6d05746b77ddc0c899878032248c263eda08d3d004d35952ad7a9cfe19343d14b37f9f632245e7b7b5fae3cb31c5231f82b9f1884f2de7578fbf156c430257031ba97bc6579843bc7f59fcb9a6449a4cd942dffa6adb929cf219f0ad +d = e21e3a739e7ded418df5d3e7bc2c4ae8da76266a1fc4c89e5b09923db80a72217f1e96158031be42914cf3ee725748c1 +Qx = 0f753171922b5334f3dd2778a64ce2da8295121939beae71ad85e5344e893be0fd03cf14e1f031adec098e0c4409449c +Qy = 45c10a0ffc0eb2f1cec5c89b698061108313ee7d449ad580efad344f0e7cf35be8a18fca620f112e57bdc746abdace55 +k = d06bea06b25e6c30e866b1eb0657b45673e37b709013fb28fd7373afc8277cbc861354f821d0bd1927e52ec083a0f41f +R = e8d4a31dd0e7d2522be62a32608e744c3775ceb606dc897899f0c73f1a40ce9a8be854cd506e65cd81fd7fa2c616cb7b +S = 8151b681b6b6046d3c36f332d06d9ba7751e740631cdb759f88c50a25a8e950d5023df8a15c77243743733c4feaf21d5 + +Msg = c9b4ff721b3e886f0dc05856ffff0aabb64a8504b1746a47fdd73e6b7ebc068f06ac7ffa44c757e4de207fc3cbfaf0469d3ac6795d40630bcafe8c658627e4bc6b86fd6a2135afbc18ccc8e6d0e1e86016930ca92edc5aa3fbe2c57de136d0ea5f41642b6a5d0ddeb380f2454d76a16639d663687f2a2e29fb9304243900d26d +d = 93434d3c03ec1da8510b74902c3b3e0cb9e8d7dccad37594d28b93e065b468d9af4892a03763a63eae060c769119c23c +Qx = a52c25f2af70e5bc6a992ecef4ea54e831ed5b9453747d28aec5cffb2fcfee05be80c5cbab21606b5507aa23878adee1 +Qy = 2cf2a9afeff83f3041dc8a05f016ccae58aa1a0e0dc6be9d928e97f2598c9ba5e9718d5eb74c9cfb516fd8c09f55f5b9 +k = 13d047708ae5228d6e3bbada0e385afdb3b735b31123454fdf40afe3c36efed563fd2cce84dcc45c553b0993d9ca9ec3 +R = a0203f6f2c456baac03538ed506a182e57a25151802cf4b2557613b2fb615ebd4c50ddc505f87c048a45bad3b2fc371c +S = 0eab56457c4080400fa3af124761d5a01fef35f9649edba8b97d22116386f3b8b363e97ef3f82616d5d825df1cf865ef + +Msg = db2ad659cf21bc9c1f7e6469c5f262b73261d49f7b1755fc137636e8ce0202f929dca4466c422284c10be8f351f36333ebc04b1888cba217c0fec872b2dfc3aa0d544e5e06a9518a8cfe3df5b20fbcb14a9bf218e3bf6a8e024530a17bab50906be34d9f9bba69af0b11d8ed426b9ec75c3bd1f2e5b8756e4a72ff846bc9e498 +d = e36339ddbe8787062a9bc4e1540690915dd2a2f11b3fe9ee946e281a0a2cbed426df405ed9cb0eca42f85443efd09e0c +Qx = a1ffb4b790d1593e907369b69de10b93cddbb02c6131f787422364d9d692768ef8097970306cce16c97f2b10c538efa7 +Qy = d0692028601ea794d2563ffe9facc7273938fab47dd00b8960be15549a9c2b3f8552583eb4c6cd212fe486c159c79153 +k = 2226f7329378cecd697f36ae151546643d67760856854661e31d424fae662da910e2157da9bb6dfbe3622296e0b5710c +R = 20dcc25b67dd997621f437f65d78347fb57f8295b1b14453b1128203cda892bcfe726a2f107d30975d63172e56f11d76 +S = 51cff592cbef75ef8321c8fa1e4229c4298b8180e427bee4e91d1e24fc28a729cf296beb728960d2a58cf26773d8e2e2 + +Msg = dbd8ddc02771a5ff7359d5216536b2e524a2d0b6ff180fa29a41a8847b6f45f1b1d52344d32aea62a23ea3d8584deaaea38ee92d1314fdb4fbbecdad27ac810f02de0452332939f644aa9fe526d313cea81b9c3f6a8dbbeafc899d0cdaeb1dca05160a8a039662c4c845a3dbb07be2bc8c9150e344103e404411668c48aa7792 +d = 5da87be7af63fdaf40662bd2ba87597f54d7d52fae4b298308956cddbe5664f1e3c48cc6fd3c99291b0ce7a62a99a855 +Qx = 54c79da7f8faeeee6f3a1fdc664e405d5c0fb3b904715f3a9d89d6fda7eabe6cee86ef82c19fca0d1a29e09c1acfcf18 +Qy = 926c17d68778eb066c2078cdb688b17399e54bde5a79ef1852352a58967dff02c17a792d39f95c76d146fdc086fe26b0 +k = 1b686b45a31b31f6de9ed5362e18a3f8c8feded3d3b251b134835843b7ae8ede57c61dc61a30993123ac7699de4b6eac +R = 9dbfa147375767dde81b014f1e3bf579c44dd22486998a9b6f9e0920e53faa11eed29a4e2356e393afd1f5c1b060a958 +S = e4d318391f7cbfe70da78908d42db85225c85f4f2ff413ecad50aad5833abe91bdd5f6d64b0cd281398eab19452087dd + + +[P-521,SHA-224] + +Msg = 58ec2b2ceb80207ff51b17688bd5850f9388ce0b4a4f7316f5af6f52cfc4dde4192b6dbd97b56f93d1e4073517ac6c6140429b5484e266d07127e28b8e613ddf65888cbd5242b2f0eee4d5754eb11f25dfa5c3f87c790de371856c882731a157083a00d8eae29a57884dbbfcd98922c12cf5d73066daabe3bf3f42cfbdb9d853 +d = 1d7bb864c5b5ecae019296cf9b5c63a166f5f1113942819b1933d889a96d12245777a99428f93de4fc9a18d709bf91889d7f8dddd522b4c364aeae13c983e9fae46 +Qx = 1a7596d38aac7868327ddc1ef5e8178cf052b7ebc512828e8a45955d85bef49494d15278198bbcc5454358c12a2af9a3874e7002e1a2f02fcb36ff3e3b4bc0c69e7 +Qy = 184902e515982bb225b8c84f245e61b327c08e94d41c07d0b4101a963e02fe52f6a9f33e8b1de2394e0cb74c40790b4e489b5500e6804cabed0fe8c192443d4027b +k = 141f679033b27ec29219afd8aa123d5e535c227badbe2c86ff6eafa5116e9778000f538579a80ca4739b1675b8ff8b6245347852aa524fe9aad781f9b672e0bb3ff +R = 06b973a638bde22d8c1c0d804d94e40538526093705f92c0c4dac2c72e7db013a9c89ffc5b12a396886305ddf0cbaa7f10cdd4cd8866334c8abfc800e5cca365391 +S = 0b0a01eca07a3964dd27d9ba6f3750615ea36434979dc73e153cd8ed1dbcde2885ead5757ebcabba117a64fcff9b5085d848f107f0c9ecc83dfa2fa09ada3503028 + +Msg = 2449a53e0581f1b56d1e463b1c1686d33b3491efe1f3cc0443ba05d65694597cc7a2595bda9cae939166eb03cec624a788c9bbab69a39fb6554649131a56b26295683d8ac1aea969040413df405325425146c1e3a138d2f4f772ae2ed917cc36465acd66150058622440d7e77b3ad621e1c43a3f277da88d850d608079d9b911 +d = 17e49b8ea8f9d1b7c0378e378a7a42e68e12cf78779ed41dcd29a090ae7e0f883b0d0f2cbc8f0473c0ad6732bea40d371a7f363bc6537d075bd1a4c23e558b0bc73 +Qx = 0156cd2c485012ea5d5aadad724fb87558637de37b34485c4cf7c8cbc3e4f106cb1efd3e64f0adf99ddb51e3ac991bdd90785172386cdaf2c582cc46d6c99b0fed1 +Qy = 1edeeda717554252b9f1e13553d4af028ec9e158dbe12332684fc1676dc731f39138a5d301376505a9ab04d562cc1659b0be9cb2b5e03bad8b412f2699c245b0ba2 +k = 1dc3e60a788caa5f62cb079f332d7e5c918974643dca3ab3566a599642cd84964fbef43ce94290041fe3d2c8c26104d9c73a57a7d4724613242531083b49e255f33 +R = 12592c0be6cce18efb2b972cd193d036dcb850f2390fa8b9b86b2f876548bc424fb3bc13c1e5c415fa09d0ecfcae5bf76fb23e8322d7eecb264a2ae6d20ef50d405 +S = 11bc9713be88e3b9912a3e5f5d7b56f20573e979b1a75d04ce339f724bddffa4665d25995fe24d32507d8a07c5e10169f5338ef2827737f7b0291752b21237217e3 + +Msg = 7ba05797b5b67e1adfafb7fae20c0c0abe1543c94cee92d5021e1abc57720a6107999c70eacf3d4a79702cd4e6885fa1b7155398ac729d1ed6b45e51fe114c46caf444b20b406ad9cde6b9b2687aa645b46b51ab790b67047219e7290df1a797f35949aaf912a0a8556bb21018e7f70427c0fc018e461755378b981d0d9df3a9 +d = 135ea346852f837d10c1b2dfb8012ae8215801a7e85d4446dadd993c68d1e9206e1d8651b7ed763b95f707a52410eeef4f21ae9429828289eaea1fd9caadf826ace +Qx = 18d40cc4573892b3e467d314c39c95615ee0510e3e4dbc9fa28f6cd1f73e7acde15ad7c8c5339df9a7774f8155130e7d1f8de9139ddd6dfe1841c1e64c38ea98243 +Qy = 17021782d33dc513716c83afe7ba5e7abef9cb25b31f483661115b8d6b5ae469aaf6f3d54baa3b658a9af9b6249fd4d5ea7a07cb8b600f1df72b81dac614cfc384a +k = 0c24acc1edb3777212e5b0bac744eadf4eda11fa150753b355bf96b189e6f57fc02284bb22d8b3cd8bba7a09aae9f4ea955b382063425a6f8da2f99b9647b147172 +R = 183da7b8a9f9d5f08903359c1a2435b085fcf26a2ed09ab71357bb7634054acc569535e6fe81d28233e4703005fc4bf83ce794d9463d575795aa0f03398e854cefd +S = 0b3621145b9866ab7809139795cc30cd0404127a7f0fafa793660491009f6c53724fdb0b1ffbf0fd51c131180b8a957fe66e76d2970247c024261c768dee9abbfb9 + +Msg = 716dabdb22a1c854ec60420249905a1d7ca68dd573efaff7542e76f0eae54a1828db69a39a1206cd05e10e681f24881b131e042ed9e19f5995c253840e937b809dfb8027fed71d541860f318691c13a2eb514daa5889410f256305f3b5b47cc16f7a7dad6359589b5f4568de4c4aae2357a8ea5e0ebaa5b89063eb3aa44eb952 +d = 1393cb1ee9bfd7f7b9c057ecc66b43e807e12515f66ed7e9c9210ba1514693965988e567fbad7c3f17231aacee0e9b9a4b1940504b1cd4fd5edfaa62ba4e3e476fc +Qx = 1e855c935139c8092092cfa733db1292530506eeb2bbb1687f9602c36d97a6714e998892d5d3b842d1896a6ece9d549e9792881a256256137b3dff180c96cc5d07b +Qy = 18d83b6e93cd287311f7bf7c1d7f9eeabcf0b69c12f2d8f40e333e81e956d968532a37a4c04d761874df293b484cd7053b03fdbc2fdcd3b4c412d6f272fb7c93fe6 +k = 1d98619bdc04735d30c222fc67da82c069aea5f449af5e8c4db10c1786c0cb9e6f2cc0bb66fa6be18c485570d648dafcd0a973c43d5c94e9a9dacbd3170e53fa2a0 +R = 0bf47fabe107ce0ec03e2ad60a79b058e1bebb18568b6a8cdbe86032e71aa30c15766105b2ea952cfa79bcab046df601159f96e179bbcf252dc68ac73d31481fdae +S = 1f918fec69cd07d90f9d892b7117e7519c3224947f4262f1fd97077dd5386a6c78aeddff3ee97e59ea353f06029f1336f0d6ef5c0f4b17ca59343a55319b7bfc3db + +Msg = 9cc9c2f131fe3ac7ea91ae6d832c7788cbbf34f68e839269c336ceef7bef6f20c0a62ea8cc340a333a3002145d07eba4cf4026a0c4b26b0217a0046701de92d573d7c87a386a1ea68dc80525b7dcc9be41b451ad9f3d16819e2a0a0b5a0c56736da3709e64761f97cae2399de2a4022dc4c3d73c7a1735c36dbde86c4bc5b6f7 +d = 179fa164e051c5851e8a37d82c181e809a05fea9a3f083299b22684f59aa27e40dc5a33b3f7949338764d46bfe1f355134750518b856d98d9167ef07aac3092c549 +Qx = 1857cc7bbed20e87b3fd9a104956aa20c6502192910e0e7598410526ebfe1c99397b85189612a60c51fb8f4dd5cb08a8cd2e702563062dcb043410715c5323a0046 +Qy = 1fce8d135284310d2f38c216030634b32cd223222f0d9d8d2b7c55477c4b8b74fc6c96a6092f34b05ca44d3633a5037c2166c479a032bb4f949f89fc1ba5236d07d +k = 16d9704c0cee791f2938bb2a8a595752a3635c2f557efeecefd719414b5f2aaf846080f582c76eae7a8fddf81859b49d0131c212524d55defa67dca1a9a28ca400f +R = 1c9a4e51774384e8362876a87c572e6463a54413c7c6252c552ebb182f83e45ace436ade4ca373d8a7216e83efb62c8b41c4d5132a0afa65078f16d189baca39187 +S = 1e92a7dd5fea29a666398e1df5775cbb5664fe6943fe4c1d2bba516b7543c84df584458e53919c4ffab579a26fb3c892a5d1a77b0a07428c89350f8b559e627b014 + +Msg = 14c69f8d660f7a6b37b13a6d9788eff16311b67598ab8368039ea1d9146e54f55a83b3d13d7ac9652135933c68fafd993a582253be0deea282d86046c2fb6fd3a7b2c80874ced28d8bed791bd4134c796bb7baf195bdd0dc6fa03fdb7f98755ca063fb1349e56fd0375cf94774df4203b34495404ebb86f1c7875b85174c574c +d = 13dabca37130ba278eae2b3d106b5407711b0d3b437fbf1c952f0773571570764d2c7cb8896a8815f3f1975b21adc6697898e5c0a4242092fc1b80db819a4702df4 +Qx = 0bc2aebf40cd435bc37d73c09d05f2fd71321111a767c2b0d446f90dd4a186839c694ceb734e027e7ee948f0f63e4d3f1656d3d543df23c342a599306909b347109 +Qy = 1f4c98ac03f0718e58d5d1762c920445b11dbdd60ec7f60095809204e14965a4ecb0be6fea06adbac8ba431d6f144c75c199225df2a619a34be99897125b3a10af8 +k = 0401187c8b89945a1e48cda9ee52167789f4121e67482a7ac797899f5d3d2e623aed31e4adae08a8d43e69028fa074d2650317cbc765f6ed191cf0317b4bae57881 +R = 1e572afed754016fba43fc33e352932c4db65efcb84e2bd159b40fc5925893b161effc40240be28d8c07154d2615f605c6f0451b976522d95afd37f46602df7a12a +S = 030370c1c5352c2b663ac1858b42f69545b2f58ed5b2c007f303726977d3c756b5d644ec6788f94c886f78269aa190a3d8d1ae10e4fd24d937c4556fb9e1953fd6d + +Msg = 8d8e75df200c177dbfe61be61567b82177ea5ec58e2781168d2277d2fd42668f01248ca3eb29ffa2689b12ae40f9c429532b6d2e1f15891322b825a0a072a1c68fa09e78cfdef3e95ed6fdf7233a43cb68236560d49a3278f0b3f47cb08f475bd9ab2f60755ea4a1767de9313b71a1b9ea87ef33f34682efbda263b0f8cc2f52 +d = 198681adbde7840d7ccd9cf1fb82056433fb4dd26bddf909af7b3b99da1ca2c05c8d4560ecd80ba68f376f8b487897e374e99a9288ed7e3645cc0d00a478aae8d16 +Qx = 057ce3777af7032f1f82308682e71fe09f88bf29dacd5018a725e1caa4b1e2bfdd894fe618f9266f31ba089856dc9c1b70e4a2faa08b4b744d1aafcd5ae99e2c736 +Qy = 199bcfef2021bc5890d7d39ec5dc0c26956801e84cae742cf6c50386eb289b6e97754dd25a94abf81f1cb1b36935b5eb29f4b32a6516d2ff6a7d23064a0daec94b3 +k = 19d2d74ad8ee2d85048f386998a71899ef6c960b4ab324e5fd1c0a076c5a632fd0009500076522e052c5c9806eef7056da48df6b16eb71cdf0f1838b0e21715fce0 +R = 18ecacbcffd5414bbb96728e5f2d4c90178e27733d13617e134ec788022db124374bbaa11e2c77fe3f38d1af6e998e1b0266b77380984c423e80ffa6ff2bcafd57a +S = 1c727f34b6a378f3087721a54e9796499b597ecf6666b8f18312d67e1190a8a66e878efc2367b551267494e0245979ef4deed6d2cbf2c3711af6d82ccfeb101a377 + +Msg = 10631c3d438870f311c905e569a58e56d20a2a560e857f0f9bac2bb7233ec40c79de145294da0937e6b5e5c34fff4e6270823e5c8553c07d4adf25f614845b2eac731c5773ebbd716ab45698d156d043859945de57473389954d223522fbafecf560b07ef9ba861bcc1df9a7a89cdd6debf4cd9bf2cf28c193393569ccbd0398 +d = 08c4c0fd9696d86e99a6c1c32349a89a0b0c8384f2829d1281730d4e9af1df1ad5a0bcfccc6a03a703b210defd5d49a6fb82536f88b885776f0f7861c6fc010ef37 +Qx = 164ac88ed9afe137f648dd89cdd9956682830cac5f7c1a06d19a1b19f82bb1d22dfeefea30d35c11202fed93fd5ce64835d27c6564d6e181287fa04a2d20994986b +Qy = 05cb83669265f5380ccefe6b4f85fdf0049e6703f6f378a0b2e52ed0fbbcf300afebb722f4ed48e3819cb976c1d60e2ba05646b478f6dfecfbae730e9644c297f00 +k = 189801432cba9bf8c0763d43b6ec3b8636e62324587a4e27905b09a58e4aa66d07d096dbce87824e837be1c243dd741f983c535a5dd2f077aac8beee9918258d3cb +R = 0917723f7241e8dc7cd746b699ab621d068dd3a90e906aaf0a4862744b96fd4e5ccdb9c7796c27f7196e693d06ec209464c3ea60ad6313e9b77cceaa14767e6651c +S = 0957b0ecdc3668f6efa5d0957615bcfffd6419c5e57579b74f960f65ae3fb9e8284322ff710b066f7e0959ac926d3cf9a594bdb70bbec756c96910b26a2486dee9e + +Msg = 80aad6d696cbe654faa0d0a24d2f50d46e4f00a1b488ea1a98ed06c44d1d0c568beb4ab3674fc2b1d2d3da1053f28940e89ba1244899e8515cabdd66e99a77df31e90d93e37a8a240e803a998209988fc829e239150da058a300489e33bf3dcdaf7d06069e74569fee77f4e3875d0a713ccd2b7e9d7be62b34b6e375e84209ef +d = 1466d14f8fbe25544b209c5e6a000b771ef107867e28ed489a42015119d1aa64bff51d6b7a0ac88673bbc3618c917561cff4a41cdb7c2833dab5ebb9d0ddf2ca256 +Qx = 1dc8b71d55700573a26af6698b92b66180cf43e153edadb720780321dbb4e71d28e0a488e4201d207fc4848fe9dd10dcabec44492656a3ff7a665fe932445c82d0b +Qy = 1920b16331b7abeb3db883a31288ef66f80b7728b008b3cc33e03a68f68d9e653a86e3177bbc00014fa5ea4c1608c0d455c2e2ac7bd8ab8519ebf19955edf1baf8d +k = 160d04420e0d31b0df476f83393b1f9aff68389cc3299e42ef348d97646f7531a722b66ddfb9501bbb5c4a41d84c78be7233b11489bceb817d23060e6017433fab8 +R = 08077aabd0a342f03f912007c586cfedfc63f93d1118f720d5b62b3ce141a60f86f111dfd8fc2e31a6778981f1a5e28f29a7369bd7897bb41240c8d3a9c170e0ee0 +S = 00abc75fc154b93840579457820957e89d1260fee0a4b9bb1946f61ca1e71afd76bb5e1077b3e38ceb39d1fac5ef8b217c4110617b3ad118e02b3fcc2a39ef38613 + +Msg = 8a7792a2870d2dd341cd9c4a2a9ec2da753dcb0f692b70b64cef2e22071389c70b3b188dea5f409fb435cbd09082f59de6bc2ff9e65f91b7acc51e6e7f8e513148cb3c7c4664f227d5c704626b0fda447aa87b9d47cd99789b88628eb642ed250312de5ba6b25f3d5342a3cbb7ebd69b0044ee2b4c9ba5e3f5195afb6bea823d +d = 01a99fcf54c9b85010f20dc4e48199266c70767e18b2c618044542cd0e23733817776a1a45dbd74a8e8244a313d96c779f723013cd88886cb7a08ef7ee8fdd862e7 +Qx = 1912d33b01d51e2f777bdbd1ada23f2b1a9faf2be2f2a3b152547db9b149b697dd71824ca96547462e347bc4ef9530e7466318c25338c7e04323b1ba5fd25ea7162 +Qy = 0bbe9b1e3a84accd69b76b253f556c63e3f374e3de0d1f5e3600fc19215533b2e40d6b32c3af33314d223ea2366a51d1a337af858f69326389276f91be5c466e649 +k = 14fafd60cb026f50c23481867772411bb426ec6b97054e025b35db74fe8ea8f74faa2d36e7d40b4652d1f61794878510b49b7b4fe4349afccd24fc45fec2fd9e9e7 +R = 18b1df1b6d7030a23a154cacce4a2e3761cc6251ff8bf6c9f6c89d0a15123baef9b338ada59728349ce685c03109fcde512ed01a40afd2ca34e1bc02ecf2871d45c +S = 0a399f9b9e21aeddf450429fec2dc5749e4a4c7e4f94cee736004dcc089c47635da22845992cd076a4f0a01d2cc1b0af6e17b81a802361699b862157ad6cad8bd1d + +Msg = f971bcd396efb8392207b5ca72ac62649b47732fba8feaa8e84f7fb36b3edb5d7b5333fbfa39a4f882cb42fe57cd1ace43d06aaad33d0603741a18bc261caa14f29ead389f7c20536d406e9d39c34079812ba26b39baedf5feb1ef1f79990496dd019c87e38c38c486ec1c251da2a8a9a57854b80fcd513285e8dee8c43a9890 +d = 1b6015d898611fbaf0b66a344fa18d1d488564352bf1c2da40f52cd997952f8ccb436b693851f9ccb69c519d8a033cf27035c27233324f10e9969a3b384e1c1dc73 +Qx = 110c6177ceb44b0aec814063f297c0c890671220413dbd900e4f037a67d87583eaf4b6a9a1d2092472c17641362313c6a96f19829bb982e76e3a993932b848c7a97 +Qy = 0f6e566c4e49b2ee70a900dc53295640f3a4a66732df80b29f497f4ae2fa61d0949f7f4b12556967bb92201a4f5d1384d741120c95b617b99c47a61e11c93a482d6 +k = 1a88667b9bdfe72fb87a6999a59b8b139e18ef9273261549bc394d884db5aa64a0bc7c7d38a8ef17333478d2119d826e2540560d65f52b9a6dc91be1340cfd8f8f8 +R = 015f73def52ea47ddb03e0a5d154999642202e06e6734ac930c1dc84756c67bbb1cca9f21f92d61bfdb2052c5dd2833349610f68139393d77250a7662ef7bd17cbe +S = 155c744a729f83b27d1f325a91e63a0d564fe96ff91eaa1bad3bff17d2abffa065d14a1d20a04dd993f6ed3260b60bcc6401e31f6bc75aaafe03e8c1a9cd14d2708 + +Msg = ec0d468447222506b4ead04ea1a17e2aa96eeb3e5f066367975dbaea426104f2111c45e206752896e5fa7594d74ed184493598783cb8079e0e915b638d5c317fa978d9011b44a76b28d752462adf305bde321431f7f34b017c9a35bae8786755a62e746480fa3524d398a6ff5fdc6cec54c07221cce61e46fd0a1af932fa8a33 +d = 05e0d47bf37f83bcc9cd834245c42420b68751ac552f8a4aae8c24b6064ae3d33508ecd2c17ec391558ec79c8440117ad80e5e22770dac7f2017b755255000c853c +Qx = 1a6effc96a7f23a44bf9988f64e5cfafdae23fa14e4bee530af35d7a4ddf6b80dcd0d937be9dd2db3adcda2f5216fecbce867ee67e7e3773082f255156e31358c2f +Qy = 1e7760190dfbe07ec2df87067597087de262c1e0a12355456faba91b2e7277050d73b924e14c0e93b8457a8b3e1f4207ce6e754274f88ad75c000d1b2977edc9c1a +k = 18afea9a6a408db1e7a7bb1437a3d276f231eacfc57678bfa229d78681cbe4e800e6065332a3128db65d3aa446bb35b517dca26b02e106e1311881a95b0302d15e8 +R = 01c49b3c1d21f1678bdbe1ac12167e95e06617190bdee1a729c1c649210da19e2e210f6689e1310513bfe2ac6c0f4ee5f324f344b31b18df341eaadb826d07adc9b +S = 129d4931ba457443012f6ffecd002f2abc3a4b65a58fee8457917ebcf24b29a1d3055b7fc62939a74ebb0c3582172ee7c3c75e0b2fa2367c6e04df63a7a91d593ad + +Msg = d891da97d2b612fa6483ee7870e0f10fc12a89f9e33d636f587f72e0049f5888782ccde3ea737e2abca41492bac291e20de5b84157a43c5ea900aef761006a4471072ab6ae6d515ffe227695d3ff2341355b8398f72a723ae947f9618237c4b6642a36974860b452c0c6202688bc0814710cbbff4b8e0d1395e8671ae67ada01 +d = 1804ab8f90ff518b58019a0b30c9ed8e00326d42671b71b067e6f815ac6752fa35016bd33455ab51ad4550424034419db8314a91362c28e29a80fbd193670f56ace +Qx = 0a79529d23a832412825c3c2ad5f121c436af0f29990347ecfa586ce2e57fd3c7e0624d8db1f099c53473dbc2578f85416ad2ac958a162051014fb96bf07f9e1d17 +Qy = 17c0750f26df0c621d2d243c6c99f195f0086947b1bf0f43731555f5d677e2d4a082fb5fe8da87e1592a5fa31777da3299cede5a6f756edf81c85b77853388bb3ab +k = 042d7c36fec0415bc875deb0fab0c64548554062e618aee3aa6670ffd68ab579fe620d3a9316357267fd3111c0ed567dca663acd94b646d2ba0771953cd9690ef42 +R = 0d01dfbef126febbdfa03ef43603fd73bc7d2296dce052216e965fed7bb8cbbc24142bfcddb60c2e0bef185833a225daa0c91a2d9665176d4ad9986da785f4bfcf0 +S = 16627e2614dbcd371693c10bbf579c90c31a46c8d88adf59912c0c529047b053a7c7715142f64dcf5945dbc69ff5b706c4b0f5448d04dd1f0b5a4c3765148bf253d + +Msg = 924e4afc979d1fd1ec8ab17e02b69964a1f025882611d9ba57c772175926944e42c68422d15f9326285538a348f9301e593e02c35a9817b160c05e21003d202473db69df695191be22db05615561951867f8425f88c29ba8997a41a2f96b5cee791307369671543373ea91d5ed9d6a34794d33305db8975b061864e6b0fe775f +d = 0159bff3a4e42b133e20148950452d99681de6649a56b904ee3358d6dd01fb6c76ea05345cb9ea216e5f5db9ecec201880bdff0ed02ac28a6891c164036c538b8a8 +Qx = 12d7f260e570cf548743d0557077139d65245c7b854ca58c85920ac2b290f2abfeccd3bb4217ee4a29b92513ddce3b5cbf7488fb65180bb74aeb7575f8682337ef5 +Qy = 17560186230c7e8bff0bffce1272afcd37534f317b453b40716436a44e4731a3ec90a8f17c53357bc54e6ff22fc5b4ca892321aa7891252d140ece88e25258b63d5 +k = 14b8a30f988cefdc0edec59537264edb0b697d8c4f9e8507cf72bc01c761304bd2019da1d67e577b84c1c43dd034b7569f16635a771542b0399737025b8d817e1c3 +R = 0fc50939ebca4f4daa83e7eaf6907cb08f330c01d6ea497b86becda43dfcad47cb5c48f5eb2cc924228628070bcd144088c449a7873242ba86badf796097dbecd6d +S = 0ccb6463c4301ba5c043e47ed508d57dd908fd0d533af89fd3b11e76343a1cf2954ce90b0eb18cbc36acd6d76b3906612d8a0feec6ebed13d88650ed9c708b28a11 + +Msg = c64319c8aa1c1ae676630045ae488aedebca19d753704182c4bf3b306b75db98e9be438234233c2f14e3b97c2f55236950629885ac1e0bd015db0f912913ffb6f1361c4cc25c3cd434583b0f7a5a9e1a549aa523614268037973b65eb59c0c16a19a49bfaa13d507b29d5c7a146cd8da2917665100ac9de2d75fa48cb708ac79 +d = 17418dfc0fc3d38f02aa06b7df6afa9e0d08540fc40da2b459c727cff052eb0827bdb3d53f61eb3033eb083c224086e48e3eea7e85e31428ffe517328e253f166ad +Qx = 00188366b9419a900ab0ed9633426d51e25e8dc03f4f0e7549904243981ec469c8d6d938f6714ee620e63bb0ec536376a73d24d40e58ad9eb44d1e6063f2eb4c51d +Qy = 09889b9203d52b9243fd515294a674afd6b81df4637ffdddc43a7414741eda78d8aa862c9cbbb618acec55bb9a29aac59616fc804a52a97a9fc4d03254f4469effe +k = 1211c8824dcbfa0e1e15a04779c9068aed2431daeac298260795e6a80401f11f6d52d36bcee3cfa36627989c49d11475163aa201d2cd4c5394144a6bb500bbaf02b +R = 1d59401b8ac438855d545a699991142685077a409de2418c7ccfe01a4771b3870e76287a9654c209b58a12b0f51e8dc568e33140a6b630324f7ef17caa64bf4c139 +S = 143af360b7971095b3b50679a13cd49217189eaee4713f4201720175216573c68f7ac6f688bfe6eb940a2d971809bf36c0a77decc553b025ed41935a3898685183b + +[P-521,SHA-256] + +Msg = 8ab8176b16278db54f84328ae0b75ef8f0cd18afdf40c04ad0927ed0f6d9e47470396c8e87cde7a9be2ffbfe6c9658c88b7de4d582111119c433b2e4a504493f0a1166e3a3ea0d7b93358f4a297d63f65a5e752f94e2ee7f49ebcc742fa3eb03a617d00c574245b77a20033854d82964b2949e2247637239ab00baf4d170d97c +d = 1e8c05996b85e6f3f875712a09c1b40672b5e7a78d5852de01585c5fb990bf3812c3245534a714389ae9014d677a449efd658254e610da8e6cad33414b9d33e0d7a +Qx = 07d042ca19408524e68b981f1419351e3b84736c77fe58fee7d11317df2e850d960c7dd10d10ba714c8a609d163502b79d682e8bbecd4f52591d2748533e45a867a +Qy = 197ac6416111ccf987d290459ebc8ad9ec56e49059c992155539a36a626631f4a2d89164b985154f2dddc0281ee5b5178271f3a76a0914c3fcd1f97be8e8376efb3 +k = 0dc8daaacddb8fd2ff5c34a5ce183a42261ad3c64dbfc095e58924364dc47ea1c05e2599aae917c2c95f47d6bb37da008af9f55730ddbe4d8ded24f9e8daa46db6a +R = 09dd1f2a716843eedec7a6645ac834d4336e7b18e35701f06cae9d6b290d41491424735f3b57e829ad5de055eaeef1778f051c1ee152bf2131a081e53df2a567a8a +S = 02148e8428d70a72bc9fa986c38c2c97deda0420f222f9dc99d32c0acba699dc7ba0a2b79ce5999ff61bd0b233c744a893bc105bca5c235423e531612da65d72e62 + +Msg = c4bc2cec829036469e55acdd277745034e4e3cc4fcd2f50ec8bd89055c19795a1e051ccf9aa178e12f9beab6a016a7257e391faa536eaa5c969396d4e1ade36795a82ebc709d9422de8497e5b68e7292538d4ccdc6dd66d27a3ece6a2844962b77db073df9489c9710585ba03d53fa430dbc6626dc03b61d53fc180b9af5dea6 +d = 0b65bf33b2f27d52cbfabcadce741e691bf4762089afd37964de1a0deda98331bf8c74020a14b52d44d26e2f6fa7bcddbe83be7db17a0c8a1b376469cf92c6da27c +Qx = 10038bb9a7aea626de68c14c64243150e72c69e2f8a1ab922bfbdaa6f33d24fb4542c0324357b0dd640bbcd07632ecd253f64ca2bfbfbf3de9b24fffd0568ab82da +Qy = 0faf867d95308cc36d6f46844a0f535dc70f9768eed011a2464d2f308fa1d8e72c3616aec7e70516908183ffce7fdd36984a15f73efaa3858c2edf16a784d40e6c2 +k = 14aeb96c57d99677a1f5e4588064215e7e9af4027bfb8f31ff6126dbf341b8e6f719465e4273e91ba32670feca802549808322b7ee108bb20653cf20f93284d365f +R = 075ead62edf7d86c5d1bc2443d1aeb5dc034fd999e6ea012cef7499d9d050cd97d262095884e9fc89a42e15bd3dee80fe3c1ba10f4caabc4aabb86347023028b663 +S = 129a992a6ff66d41948d11fa680f732b1a74315b804c982805190ed9d2fae223f2b149980b9241998cdea0c5672595a8a49d5186a0ef7a46c0a376f925bdda81726 + +Msg = 1c1b641d0511a0625a4b33e7639d7a057e27f3a7f818e67f593286c8a4c827bb1f3e4f399027e57f18a45403a310c785b50e5a03517c72b45ef8c242a57b162debf2e80c1cf6c7b90237aede5f4ab1fcaf8187be3beb524c223cc0ceff24429eb181a5eea364a748c713214880d976c2cd497fd65ab3854ad0d6c2c1913d3a06 +d = 02c4e660609e99becd61c14d043e8b419a663010cc1d8f9469897d7d0a4f076a619a7214a2a9d07957b028f7d8539ba7430d0b9a7de08beeeae8452d7bb0eac669d +Qx = 0fb3868238ca840dbb36ecc6cf04f5f773ea0ab8e8b0fdcf779dc4039a8d7146a417504e953c0cb5e7f4e599cc2c168deda8b7f16084b5582f89f2ece4cae5167f7 +Qy = 1f90b5c15eeda48e747cf3ee8183166a49dbfac6161cbd09d29d40a6854f4c495e88a435892a920cdaad20d41985890b648badd4f0a858ffcbd9afdfc23134ede18 +k = 1f875bbf882cd6dd034a87916c7b3ba54b41b2ea2ce84ebaf4e393fcf7291fee09dec2b5bb8b6490997c9e62f077c34f0947fe14cec99b906dd6bf0b5d301e75ca1 +R = 07aa70425697736b298233249f5d0cf25c99e640c9ff88035ef1804820e1bfe7d043755f02d7a079494f7fa6dc26740c4e6b7b430c63f29c67bbd3a5c88d2f0e8d1 +S = 0e0d42e4ff11cf5be37a9fda348514d5097a662f214687cbfb28ff42d635b13029871ca4f464bb1fbce02d5da4d5fb61b2a071844259fc863d136197bec3a61e7c7 + +Msg = adb5f069b2b501a3ebb83d4f1808eb07710ac4a7b12532996855a20bcc54b2f76812915f632163c3654ff13d187d007152617cf859200194b59c5e81fc6cc9eb1ceb75d654050f260caa79c265254089270ccd02607fdcf3246119738c496dc3a4bd5d3be15789fc3d29a08d6d921febe2f40aef286d5d4330b07198c7f4588e +d = 17c3522007a90357ff0bda7d3a36e66df88ca9721fb80e8f63f50255d47ee819068d018f14c6dd7c6ad176f69a4500e6f63caf5cf780531004f85009c69b9c1230c +Qx = 13a4bea0eed80c66ea973a9d3d4a90b6abbb5dee57d8affaf93390a8783a20982eba644d2e2809f66530adeeee7f9a1da7515447e9ba118999f76f170c375f621f7 +Qy = 12f9dfaee40a75d8442b39b37a5c19ea124b464236e9b9a31bae6780cfd50f7ea4a700154b5ea0feeb64e9b35a1b0e33e46900cca1f34d13bb17e5017769841af27 +k = 18388a49caeda35859ef02702c1fd45ff26991998bd9d5e189c12c36cdae3f642ddd4a79561bd1d3e1cd9359de8f5c9e1604a312d207a27b08a6033f2741794ced5 +R = 15c6264795837dfea19f91876455f564f073c5c84a3c9d76e67872ae0447ba0d4850d8721302b25bec7ebfedd2721de140b2f3dead547042b24b0876117e7093cc1 +S = 060eb74236c189a28ed20bd0822eb22d75f7d97c9043a3c8e3f6d4c90bc8ca02ac4d37c1171c799a1c7dfd2fcbf83406b5e48c051e0fbf0fd937bfe6c3db4e18154 + +Msg = f253484d121d1ce8a88def6a3e9e78c47f4025ead6f73285bf90647102645b0c32d4d86742a50b8b7a42d5f6156a6faf588212b7dc72c3ffd13973bdba732b554d8bffc57d04f8167aef21ee941ee6ffb6cce0f49445bd707da8deb35dca650aaf761c3aa66a5ebccddd15aee21293f63061a7f4bfc3787c2cd62c806a1a9985 +d = 0c4dad55871d3bd65b016d143ddd7a195cc868b3048c8bbcb1435622036bdb5e0dec7178ca0138c610238e0365968f6ddd191bbfacc91948088044d9966f652ff25 +Qx = 014858a3b9bd426b678fdcf93fc53d17e7a9e8fe022442aaaba65399d12fd3a6a381958fb0f07ac6088f4e490506ec0f1ab4d0dbd461126f7eb46ff69cfa8bd88af +Qy = 18c18ce29ecc6d79d26a2de0cd31c4b32e84b5e90f6ba748f86c5afbd89618aceb9079460cbd1a8261ed5476973e61bf1d17ea78b022387443800c9247d21dde550 +k = 05577108f4187a173e5c29e927a8fc8f5ffd37e184254a6e381ff1018955aec91a35f30085e8cee6a7555c10f9efdce26d62f2b4b52dfdbaeafc3a30983e2d50d5b +R = 0344375ae7c804cbe32ced7a20976efae5d9c19eb88b6e24514d1d0cfb728b0f4601098b18b2e98f42b5222dd5237d4d87767007bf5acb185c5526d72047e2cb1a1 +S = 02de4cfa908c73c1102d6fb7062baf54a056a9517701e036c9c51e09899d60051612d59348945f845dffebec5aa395b2fac7229929033615788777306ccad96d0a3 + +Msg = 33bab1c369c495db1610965bc0b0546a216e8dd00cd0e602a605d40bc8812bbf1ffa67143f896c436b8f7cf0bed308054f1e1ff77f4d0a13c1e831efbd0e2fcfb3eadab9f755f070ba9aeaceb0a5110f2f8b0c1f7b1aa96a7f2d038a1b72e26400819b1f73d925ea4e34d6acaf59d0a461a34ce5d65c9c937a80e844e323a16d +d = 03d4749fadcc2008f098de70545a669133c548ce0e32eec1276ff531bcff53533144555728ad8906d17f091cc0514571691107350b6561858e90dbe19633aaf31bf +Qx = 10fe5986b65f6e65d13c88c4d2aed781a91026904f82129d46779bdadaf6b733c845a934e941ab4a285efdea9c96ecc9dc784d87e4d937b42c337b3a9cb111a9600 +Qy = 077853768a2a4d6f596f57414e57ec60b76d3cd5ece8351cd1f335ebcb8801a3d91fb82c65caaeb5c31eea9918367bb5906863ff3ccaf7a6cee415e0d75c15ac2e0 +k = 1fbb4de337b09e935a6dc6215ffcfcb85d236cc490585e73251a8b8bac37cfa36c5d1df5f4536d33659be1e7a442529a783452f7efda74a4f661b6a127f9248aaf7 +R = 09d8f10eeff6178594c89d6e8184f9502117384813243ddf9ccf3c8eac5dc6502c472dfc1487a5caffc569f7dedd14a8ebcb310e9bacdb79fb6655aba026cdf87f2 +S = 0f74236c7915d638708d17c9f10e39dda358faf9bbb821d8dcda0d151aac143bfb165ad0a23a65cd3de532e32cad928728f5ae1c16f58fc16577f3ca8e36f9e708b + +Msg = 08c8b7faaac8e1154042d162dca1df0f66e0001b3c5ecf49b6a4334ce4e8a754a1a8e4daf8ec09cf1e521c96547aed5172ef852e82c03cddd851a9f992183ac5199594f288dbcc53a9bb6128561ff3236a7b4b0dce8eaf7d45e64e782955ee1b690ce6a73ece47dc4409b690de6b7928cbe60c42fc6a5ddf1d729faf1cc3885e +d = 096a77b591bba65023ba92f8a51029725b555caf6eff129879d28f6400e760439d6e69ce662f6f1aecf3869f7b6057b530a3c6ff8ed9e86d5944f583ee0b3fbb570 +Qx = 0fdf6aed933dba73913142ef8bdcd4b760db8500831cd11d7707ab852a6372c05d112a1e7fbc7b514c42142c7370d9f4129493cd75cc6f2daf83747078f15229db6 +Qy = 0ef91dffb3c43080a59534b95ca585ee87f6145f6a0199b2b82c89f456d8bd8e6ac71c78039c08177184484eb2ebd372f189db3a58fab961a75a18afec1ee32764a +k = 13aa7b0471317a2a139c2f90df1c40d75e5a8a830fbaf87030fffdb2ef6f2c93d1310c9ed7fe9d7bcd4fe46537ff2495bc9c4f0aaff11461f5e4bebbfbce9a8740a +R = 1c7a21800962c91d4651553633b18612d931bb88bff8b743ed595b4e869437e50f8e84fbf334c99061db123a1c40b73b07e203790561a37df65a660355ba2017d78 +S = 1301e1782559a38f1ca0eebe9bed0f5c7c33103d506a24f8a688f500ee1fe37f97b6685319279e82e6fe43cfd823ccbc123309974cffa76c4f8d41ec02a3cbc45f1 + +Msg = ba74eed74282811631bd2069e862381e4e2a1e4e9a357b1c159a9ce69786f864b60fe90eeb32d8b72b099986fc594965a33285f7185b415df58fead7b8b50fc60d073680881d7435609ad1d22fd21e789b6730e232b0d2e888889fb82d6ad0337ab909308676164d4f47df44b21190eca8ba0f94995e60ad9bb02938461eee61 +d = 015152382bfd4f7932a8668026e705e9e73daa8bade21e80ea62cf91bd2448ebc4487b508ca2bdaaf072e3706ba87252d64761c6885a65dcafa64c5573c224ae9e6 +Qx = 00b8c7c0186a77dc6e9addd2018188a6a40c3e2ba396f30bbd9293dba2841d57d60866b37f587432719b544d8bf7eb06d90a8c0dc9c93b0c53d53b2f667077228ca +Qy = 1dd2e5c73ab908ae34f701689f1cd3cf5186d3a2bc941e208bf3ef970e5e429ee9b154d73286b2e5da423e75b7c7b78c7bdf915da92279db43265a0cdefca51f86a +k = 0d03506999f5cc9ec3304072984a20a9c64a22ad9b418495ca904f4bbddc96e76d34672cb52763339d3f3bc5b1701c00a675b972797e3a086314da1a8d338436566 +R = 085406c0ff5ec91f598bb579ad8714ad718c3e133d5dcc2e67c5d2339c146b69919cac07f3bc2bda218f4c7c8be04855e2ca6fff7fbdc4fc0fda87c8c3081cad4f5 +S = 1b45f2066e583636215ae135afc202b8bf3f301eccff2e1c0198b9aeddf695fa8179488e7b622fc307f601e2f6551815117cc836bb09ef888f8e64a45d9c84ad30c + +Msg = dc71f171a28bdc30968c39f08f999b88dc04c550e261ecf1124d67f05edeae7e87fe9b8135a96fe2bc3996a4f47213d9d191184a76bd6310e1ee5cb67ea7fc3ef6f641a0ba165198040fa668192b75a4754fc02c224bd4a74aade5a8c814adf151c2bfeda65165a04ef359e39847c84e312afb66d4cd1db50d41ef3fe5f31296 +d = 1750ff0ca0c166560b2034bc5760fe0b3915340bc43216e9de0c1d4a76550e8b2036e8b874230f8d29354aed43e183610f24fd4abd4b0be2f111dae942bd7a121f7 +Qx = 1b4b8947192a7c0166c0e0b2791e217370836283e805f3ee11cfb78445aba3c5bc39fe594e01916617ad59e7c8e740d8f2d07d88905d3f33bd5e51aafd4943c5dc6 +Qy = 1175d117232836c28e717ce2a55e59f4ec550effde30d18e3d99e42c6aa2283c7b3e7f2f6ff1fca605dde78c3a5bffa689347b4c93f51ba59a1787bb7d5e43861dc +k = 023645023d6bdf20652cdce1185c4ef225c66d54f18632d99ccf743bf554d04c214c88ce52a4f71ec75c899ad1b3c07c34112ca20b55c217ff1d72c9528e2774ce8 +R = 1e933f68ce0f8403cb16822b8e0564b1d39a35f27b53e4ae0bcdff3e051759464afbc34998ba7c8a7ee34ef6c1aaa722cffe48356fd0b738058358d4c768b3186c1 +S = 0a67368a305508ce6d25d29c84f552a4a513998990fef4936244f891a2909c30d5fdc9e8a267ecbf3c597138f4a08f7e92bee57d5420eadd700fee864bf78b2614b + +Msg = b895788d7828aaeace4f6b61a072ffa344d8ea324962ba6dab5efda93f65bf64a0f2ac6d5721d03ee70e2aef21cdba69fd29040199160e3a293b772ffb961ed694a8dc82800dab79367a4809a864e4aff6bc837aaa868e952b771b76591c0bb82249034e3208e593d85973d3fea753a95b16e221b2561644535c0131fe834ae7 +d = 023048bc16e00e58c4a4c7cc62ee80ea57f745bda35715510ed0fc29f62359ff60b0cf85b673383b87a6e1a792d93ab8549281515850fa24d6a2d93a20a2fff3d6e +Qx = 0ba3dc98326a15999351a2ec6c59e221d7d9e7ee7152a6f71686c9797f3f330d3150123620d547813ba9d7cc6c6d35cc9a087d07dff780e4821e74ad05f3762efd6 +Qy = 18b051af9824b5f614d23ecadd591e38edbfe910ad6cbebc3e8a6bec11ea90691c17deb3bc5f34a4a3acd90b7b10f521f6ee7b3cfbfdc03b72d5a8783a4a77c3e4c +k = 06099d2667f06c58798757632d07d8b3efbe9c1323efb0c244be6b12b3b163ba1b7cf5246c98dcc0771665a66696d687af5f28ed664fd87d5093df6427523d4db84 +R = 10dc80ea853064a2ba5a781f108aca3785c5ec0aa45aa05ba31d4de671170797589e863d54a3a986aadf6f670277f50355713dfb27d4ec7e348f787910b3cd668cd +S = 018572bfad4f62e3694d1f2e6ffd432faed2e2b9d7e3611a07138212f1e79e6c394839f7cfae96bc368422630016fb9346681eadc5f9699e7331c3b5fde6d65e4c6 + +Msg = 2c5bd848c476e34b427cfe5676692e588e1957957db7b5704492bd02104a38216535607f5d092dc40020130c04a3aaf0f1c52409834926d69a05d3f3188187a71d402a10ba34eac8629b4c6359b1095f30f710219298bf06b9f19bfc299981d7e251ca232a0a85338a7e02464731d1b25d4a1f68baf97064516590644820c998 +d = 02b8b866ce4503bb40ffc2c3c990465c72473f901d6ebe6a119ca49fcec8221b3b4fa7ec4e8e9a10dbd90c739065ad6a3a0dd98d1d6f6dcb0720f25a99357a40938 +Qx = 1b8c7a169d5455f16bfe5df1ba5d6ec9c76e4bad9968d4f5f96be5878a7b6f71d74bfac0076dd278bc4630629f3294646f17d6b6c712b0087e2c4d576039cfdc8b9 +Qy = 18faffd5422dfd1b61432fa77b9a288b2b7d546656c0dcca3032179e6f45ee3cf61d6a447fc51731cb54457343a41569fcf78cef42895f4da5efcb14ea1fc065f8d +k = 0ac89e813f94042292aa1e77c73773c85cf881a9343b3f50711f13fa17b50f4e5cb04ac5f6fc3106a6ef4c9732016c4e08e301eefac19199459129a41a7589e0628 +R = 05bc7a253a028ee8b7253979b8d689d41d8df6fae7736341f22e28b6faf0cbbdebbd2ef4d73e56d2021af2c646dc15539a7c1e1c4dc9c7674808bd7968d8a66f947 +S = 0fd71575837a43a4cf1c47d0485cfd503c2cf36ebcea0fdef946ad29acb7fb2e7c6daf6b4eb741eb211081aed6207d02569f1518988f275ad94c7fd4735cb18a92e + +Msg = 65a0b97048067a0c9040acbb5d7f6e2e6ac462e1e0064a8ce5b5bbf8e57059e25a3ef8c80fc9037ae08f63e63f5bdb9378c322ad9b2daf839fad7a75b1027abb6f70f110247da7e971c7c52914e5a4f7761854432fa16b2a521e7bcaee2c735a87cad20c535bf6d04a87340c229bf9af8647eedca9e2dc0b5aa90f7fea3cdc0a +d = 0a43b32ad7327ec92c0a67279f417c8ada6f40d6282fe79d6dc23b8702147a31162e646291e8df460d39d7cdbdd7b2e7c6c89509b7ed3071b68d4a518ba48e63662 +Qx = 172fb25a3e22c2a88975d7a814f3e02d5bb74cfb0aaa082c5af580019b429fddd8c7f9e09b6938f62e8c31019b25571aaceef3c0d479079db9a9b533ee8e1670abd +Qy = 0ff5516223b6cc7c711705f15b91db559014e96d3839249c5c849f2aced228a8998177a1e91177abbb24b57a8ea84d944e0c95da860ae0925f1b40c0e1b7c9e0a46 +k = 0383eda042e06c0297fbd279a2ad40559c5c12ad458f73458eebcc92b308d3c4fcec20a5b59f698e16fa6ea02dba8661b6955f67c052f67b0a56460869f24cfdf7d +R = 1b9c35356b9d068f33aa22a61370dae44a6cb030497a34fb52af23c6b684677370268f06bb4433be6795a71de570088aec17ce0c9933d2f76c7edce7f406f62fedd +S = 06f07ea453cfa20ad604ba855332f62834657b0b795684d50c1562a675456e37f4dae45f0df47d8e27e47bc9ce9c9cbba1554c5b94b0b17401b73c8d0c0902c6cc4 + +Msg = d6e366a87808eea5d39fe77cac4b8c754e865a796062e2ec89f72165cd41fe04c48148068c570e0d29afe9011e7e7a2461f4d9897d8c1fa14b4ff88cab40059d17ab724f4039244e97fcecb07f9ffeec2fb9d6b1896700fe374104a8c44af01a10e93b268d25367bf2bef488b8abcc1ef0e14c3e6e1621b2d58753f21e28b86f +d = 03c08fdccb089faee91dac3f56f556654a153cebb32f238488d925afd4c7027707118a372f2a2db132516e12ec25f1664953f123ac2ac8f12e0dcbbb61ff40fb721 +Qx = 193301fc0791996ca29e2350723bd9aa0991ddbb4a78348ee72bdcd9ed63ce110ba3496f2ce0331b5c00d4d674c1b70114e17ce44a73c3e16bab14ed1ee924202e4 +Qy = 0aea9b288cfb2933ec0a40efa8e2108774e09b3863b3193d0dac6cc16ccaa5bd5f9ce133aec5cd3b62cbaeec04703e4b61b19572705db38cfaa1907c3d7c785b0cd +k = 0d0e90d5ee7b5036655ad5c8f6a112c4b21c9449ca91c5c78421e364a2160bbac4428303657bc11ea69f59fb0fe85a41b8f155a362343094456fd2a39f2a79e4804 +R = 1a8c23a2965d365a4c2ffd0802ae8b3a69c6b84a1ba77fd8a5f2f61e8ec3a1dcb336f136e2a997252eaa94caf9b5ad6c9ecff5bf33abf547ca84985bb89908a11d7 +S = 1cc42a2dd97aa42b9df5ea430e0d4cb13106dd6da6e8c9315c96ed7b052db365bbde6960c9a965954a4398c18ea7db9593bbfc3c3b6b3466ff806fccac3de6424ab + +Msg = f99e1d272d0f5fb9c4f986e873d070ec638422bc04b47c715595e2cf1a701cdf88bc6c4b20085b357bad12ccba67cac8a5ca07f31ba432f9154ff1fadefd487a83a9c37e49fb70a2f170e58889cab0552e0a3806ccfa2a60d96e346851d84b7de6d1a4b8cf37567dc161a84f13421e3412457d4bc27f6213453c8519a2d7daa2 +d = 0969b515f356f8bb605ee131e80e8831e340902f3c6257270f7dedb2ba9d876a2ae55b4a17f5d9acd46c1b26366c7e4e4e90a0ee5cff69ed9b278e5b1156a435f7e +Qx = 0fc7ae62b05ed6c34077cbcbb869629528a1656e2e6d403884e79a21f5f612e91fc83c3a8ac1478d58852f0e8ba120d5855983afd1a719949afa8a21aec407516c3 +Qy = 0aa705da6459a90eaa2c057f2e6614fb72fc730d6fdebe70e968c93dbc9858534768ea2666553cd01db132331441823950a17e8d2345a3cab039c22b21bfe7bd3b9 +k = 19029260f88e19360b70c11107a92f06faa64524cfbd9f70fecf02bd5a94f390582a7f4c92c5313bb91dc881596768d86f75a0d6f452094adbe11d6643d1a0b2135 +R = 07f2158e9b9fa995199608263969498923cf918fdc736427c72ce27ce4a3540dce2e8e5e63a8fc7ba46f7fa42480efbf79c6ed39521f6e6ec056079e453e80a89d9 +S = 08e349eed6f1e28b0dbf0a8aeb1d67e59a95b54a699f083db885f50d702f3c6a4069591afaa5b80b3c75efb1674ebd32c7ead0040d115945f9a52ee3a51806cad45 + +Msg = 91f1ca8ce6681f4e1f117b918ae787a888798a9df3afc9d0e922f51cdd6e7f7e55da996f7e3615f1d41e4292479859a44fa18a5a006662610f1aaa2884f843c2e73d441753e0ead51dffc366250616c706f07128940dd6312ff3eda6f0e2b4e441b3d74c592b97d9cd910f979d7f39767b379e7f36a7519f2a4a251ef5e8aae1 +d = 013be0bf0cb060dbba02e90e43c6ba6022f201de35160192d33574a67f3f79df969d3ae87850071aac346b5f386fc645ed1977bea2e8446e0c5890784e369124418 +Qx = 167d8b8308259c730931db828a5f69697ec0773a79bdedbaaf15114a4937011c5ae36ab0503957373fee6b1c4650f91a3b0c92c2d604a3559dd2e856a9a84f551d9 +Qy = 19d2c1346aadaa3090b5981f5353243300a4ff0ab961c4ee530f4133fe85e6aab5bad42e747eee0298c2b8051c8be7049109ad3e1b572dda1cac4a03010f99f206e +k = 1a363a344996aac9a3ac040066a65856edfb36f10bb687d4821a2e0299b329c6b60e3547dde03bdbd1afa98b0b75d79cf5aac0ef7a3116266cadf3dfbd46f8a4bfc +R = 1ff097485faf32ce9e0c557ee064587c12c4834e7f0988cf181d07ba9ee15ae85a8208b61850080fc4bbedbd82536181d43973459f0d696ac5e6b8f2330b179d180 +S = 0306dc3c382af13c99d44db7a84ed813c8719c6ed3bbe751ead0d487b5a4aa018129862b7d282cce0bc2059a56d7722f4b226f9deb85da12d5b40648bf6ec568128 + +[P-521,SHA-384] + +Msg = dbc094402c5b559d53168c6f0c550d827499c6fb2186ae2db15b89b4e6f46220386d6f01bebde91b6ceb3ec7b4696e2cbfd14894dd0b7d656d23396ce920044f9ca514bf115cf98ecaa55b950a9e49365c2f3a05be5020e93db92c37437513044973e792af814d0ffad2c8ecc89ae4b35ccb19318f0b988a7d33ec5a4fe85dfe +d = 095976d387d814e68aeb09abecdbf4228db7232cd3229569ade537f33e07ed0da0abdee84ab057c9a00049f45250e2719d1ecaccf91c0e6fcdd4016b75bdd98a950 +Qx = 13b4ab7bc1ddf7fd74ca6f75ac560c94169f435361e74eba1f8e759ac70ab3af138d8807aca3d8e73b5c2eb787f6dcca2718122bd94f08943a686b115d869d3f406 +Qy = 0f293c1d627b44e7954d0546270665888144a94d437679d074787959d0d944d8223b9d4b5d068b4fbbd1176a004b476810475cd2a200b83eccd226d08b444a71e71 +k = 0a8d90686bd1104627836afe698effe22c51aa3b651737a940f2b0f9cd72c594575e550adb142e467a3f631f4429514df8296d8f5144df86faa9e3a8f13939ad5b3 +R = 02128f77df66d16a604ffcd1a515e039d49bf6b91a215b814b2a1c88d32039521fbd142f717817b838450229025670d99c1fd5ab18bd965f093cae7accff0675aae +S = 008dc65a243700a84619dce14e44ea8557e36631db1a55de15865497dbfd66e76a7471f78e510c04e613ced332aa563432a1017da8b81c146059ccc7930153103a6 + +Msg = 114187efd1f6d6c46473fed0c1922987c79be2144439c6f61183caf2045bfb419f8cddc82267d14540624975f27232117729ccfeacccc7ecd5b71473c69d128152931865a60e6a104b67afe5ed443bdbcdc45372f1a85012bbc4614d4c0c534aacd9ab78664dda9b1f1e255878e8ac59e23c56a686f567e4b15c66f0e7c0931e +d = 04ceb9896da32f2df630580de979515d698fbf1dd96bea889b98fc0efd0751ed35e6bcf75bc5d99172b0960ffd3d8b683fbffd4174b379fbdecd7b138bb9025574b +Qx = 0e7a3d30d5bd443549d50e9b297aaa87bc80b5c9e94169602d9d43d6d0c490c0bed8cc2170288b106bdbf4c9f1ce53fd699af0b4c64b494b08520e57dc01ab9a8b0 +Qy = 1d81056d37aec8a75d588f6d05977416e6f24ad0117a7f4450036d695612e7bc2771caed80e580314eebc88c8fc51c453f066e752481f212b57165d67f8a44f375a +k = 046639c5a3ec15afae5e4a7a418ac760846512d880c359bc2c751b199ce43b10887e861b14127809754dbea47f6cc0140d2817e3f5b9a80ce01abd81f81b748433a +R = 0f913de91e19bd8f943d542ae357bacc942a0967abc9be6c06239a379db8cc733fa50013e0b0f088bce9d630262feaa33b30d84f91bcf5ce9976e4e740fcb112f84 +S = 08a73a5c9c24235e0d9cecaac653f68ce5a6fb186ce67fa058d6ddbbd4d0a8c4d194e571148e8ad6c8882b4e33d2f60fb23dd7d07a1ae60864e8277918f592b3dc6 + +Msg = 6744b69fc2420fe00f2352399bd58719e4ecdd6d602e2c80f194d607e58b27a0854745bfd6d504de2eb30b04cee0f44af710dd77e2f816ac3ac5692fad2d1d417893bb0edba2707a4c146a486f8728ca696d35cc52e9c7187c82d4bdb92eb954794e5ad15133f6bfea1f025da32ada710a3014cf11095b3ff69a94d087f17753 +d = 00a8db566bd771a9689ea5188c63d586b9c8b576dbe74c06d618576f61365e90b843d00347fdd084fec4ba229fe671ccdd5d9a3afee821a84af9560cd455ed72e8f +Qx = 04f5b790cbe2984b71d41af5efed6c6893d15e13f31816d55a9c2926a104eee66f1ada83115d1388551218773b8b9d1138e3e3f027bb4392c90c14fd232580b4a11 +Qy = 0660eb160e9bfc8c5619e70e948e238c6fd37739bc1bb657b8e8436e63628f91992be7e63d9a7359623a1340642777b22026feb51116a6c50c54c3589b9bd39b6cb +k = 1e7b5e53571a24bd102dd7ad44a4b8d8a4e60e5957bc3c4e5d3c73109f55233f072e572c7892f425ba5e64d3cb7966096bb34a47e26cd5b3e3b44108b310d9f681b +R = 1a88bcd7e2bdff6e497d943dde432fb3f855a7177c466319cb53b701230c299db030276269685857d1e3f28110e690f2f529c8d18115eb381f313bc891d92ad278e +S = 146f1984ea879274dfd5e86ad92e564a4de081523ddbb1c397b8f9595911ef2e6501bc081584d5340f7aa47e1af036234ac6f27a5ac31f78dd3b0ff1a62693c630d + +Msg = 16001f4dcf9e76aa134b12b867f252735144e523e40fba9b4811b07448a24ef4ccf3e81fe9d7f8097ae1d216a51b6eefc83880885e5b14a5eeee025c4232319c4b8bce26807d1b386ad6a964deb3bdca30ee196cfdd717facfad5c77d9b1d05fdd96875e9675e85029ecbf4f94c524624746b7c42870c14a9a1454acf3354474 +d = 1a300b8bf028449344d0e736145d9dd7c4075a783cb749e1ec7988d60440a07021a25a3de74ea5e3d7bd4ab774d8ad6163adae31877ef0b2bd50e26e9e4be8a7b66 +Qx = 05055b9ad726ba8a48219b0ecbfffb89f8428de895b231f676705b7de9f2022d9ff4e0114ebb52dea342f9bf76b2fb060c020e29d92074ebb1fbfe5290a58c8bc10 +Qy = 0415af7f20a6e945315adbf757316bb486c80780a0a3a15b4b9609f126d7341053a2b726ab63cb46feee527b0bf532b32b477e5671aea23d9b3c3e604b9029954b5 +k = 05a2e92717bb4dab3ee76724d4d9c2d58a32b873e491e36127985f0c9960c610962ca1c4510dba75c98d83beebdc58b1d8678e054640951d11db1bd2d8a4ab8476b +R = 104a78ce94f878822daaf00ee527fbdbf6cceb3cbb23a2caa485e4109466de8910252f92379ab292cac8d1eda164f880c0067696e733fc8588a27703a3e1f5b8f1f +S = 1ffe23e8ab5a31668a81161a234ea14879771fe9866f8872eb6edb672e0fe91d2bb75c9767a2dfbac7c15c802211236b22ea41ecd055a0b8b311ffc4255f86d5c67 + +Msg = a9824a7b810aa16690083a00d422842971baf400c3563baa789c5653fc13416111c0236c67c68e95a13cec0df50324dcc9ae780ce4232607cb57dd9b2c61b382f0fa51fd4e283e2c55ffe272597651659fbd88cd03bfa9652cd54b01a7034c83a602709879e1325c77969bebfd93932ce09a23eae607374602201614ff84b141 +d = 06a253acd79912a74270fc0703ed6507ab20a970f2bc2277f782062092cf0e60ae1ca1bb44dec003169bc25ef6e7123dd04692f77b181a6d7e692e66b09d35a540c +Qx = 1f15c6b1df156fdd8381cd7446e039435e445f8f36f0247475058da0e371bf72753f6e39f98066bc79370b038c39687ba18e16cb118fe6538b7568c5403c251f6b7 +Qy = 12d2b4f46b854eeae75f1c63f55b76bf0c604d47f870c28a50ecdeb52bba1dd9a0ff12e680804ff864111207652da7dd10b49edf66bb86be00bc06672de91982457 +k = 165faf3727e42fd61345cfa7b93e55fb4bf583b24bdc14ce635b6c99dbd788012f14da9a210b677c44acdd851e672f1a48188d6b8946c0efeebfe8a597ba0090a2c +R = 1ad9463d2759abd568626548578deefdcd8b2d050ce6d9c7ed05feca20167484b86e89bdcc936fd647e0f8aedd7b6add2b8cf13ff6ff013c2b5540c6c56fda97a0c +S = 1645a7d0e11015256cfb034adca198695eea6aedd44d9fbf496850ccfed950f43fffd8dbf41e113f2d3837d8a5dd62b2ed580112ff05800b1f73196e5576810e15b + +Msg = 90d8bbf714fd2120d2144022bf29520842d9fbd2dc8bb734b3e892ba0285c6a342d6e1e37cc11a62083566e45b039cc65506d20a7d8b51d763d25f0d9eaf3d38601af612c5798a8a2c712d968592b6ed689b88bbab95259ad34da26af9dda80f2f8a02960370bdb7e7595c0a4fffb465d7ad0c4665b5ec0e7d50c6a8238c7f53 +d = 0d5a5d3ddfd2170f9d2653b91967efc8a5157f8720d740dd974e272aab000cc1a4e6c630348754ab923cafb5056fc584b3706628051c557fce67744ee58ba7a56d0 +Qx = 128a4da5fc995678e457ceb3929adee93c280f851abe900fa21f4f809dafad4e33b381e0cd49ce8dd50e2e281cea162bfd60a1d6a1c0ee2228e6a011e171b559ab8 +Qy = 06eb0917cd72256992c49ea527f6bb0315f13d8047794a0f1da1e93737703b1c2a74a00441ef3b47b6a2ff789c49ae32d91cabe7b29247aeec44f6c40a76597a2ca +k = 03269983a5c2bcc98e9476f5abf82424566b1f08b17204d29e310ece88f99eb677a537f86fe2529e409cfef2c12929644100099e0de2f27c0f0ac11105a4dca935b +R = 1a5257ae1e8187ba954f535b86ff9b8d6a181a3b95c250d090cb4e9c3bfbd03aa64696a76c569728ef67780d6338d70ce46da40b87a3e49bfe154b93930890dfa93 +S = 05b6ccdfd5c63c7db76d3a0478064a2a376e0e050cb093be795a72a549247c2e4adba9183145c63d46479dbbdcf09986a6f64c09c7e16abc4853f6376c9558b014a + +Msg = 09952b1e09995e95bf0022e911c6ab1a463b0a1fdd0eec69117b34af1103c720b57600217de7cd178fef92de5391e550af72a8dcf7badf25b06dd039417f9a7d0f5be88fcd4e9655931d5b605452a667c9d1bae91d3476e7d51cff4108f116a49966fb3a7cff8df1c09734ce5620faf2dccb3dc5d94e7e9ac812da31f6d07a38 +d = 1bcedf920fa148361671b43c64e3186e1937eb1bd4b28cbd84c421472394552889bc05509aa732ef69d732b21b750523fdfd811f36467690fe94e01e64c9d5cbbe9 +Qx = 0d33c151d202a5d4d831348e940b027ee32e4b0b9b48d823a05c67ff3bdaee0189fc6680565f352c062e99968afc643208b4f9c7af185b861658a88c4ad0fcc8ba2 +Qy = 0e4441ddb546468ad8ffa6074f137edfbb81e82e0e7d8f05c4c54598aa996a9cde54cb371f642bfdd4ae7eca5b769696030027129a4183da93567ad142a2dff5183 +k = 046e619b83aac868b26d0b3cbfab55e630e0b55c461985b5d00f94ff3a5ce90ff412cebf46bbd84550d2031d573ca27d924624428360708c8d8491c29eb01d30f2e +R = 08427c0f0ac0263472cd423c0fb554bf3c851b9c775c566ab0f6878717bd57665830767b05b7789c5c0b078195bd943dc737325552d32877ecb04a7c41bd07cd80c +S = 10bb6652d6a624c40a7dd06828f15774130d02369ceb1a7d03b553e16e17b7fa5b5401f15885d5e4fc2e55c0c7a1b97871ab02f76386b93a16aa6e7eb65debac6dd + +Msg = 0bb0f80cff309c65ff7729c59c517d50fc0ed5be405ef70cb910c3f62c328c90853d4473530b654dda6156e149bc2222a8a7f9be665240e2fbe9d03f78a2356af0bacd1edb84c4801adc8293a8a0bd6123d1cf6ba216aca807a7eb4dca76b493eb6e3dbb69d36f0f00f856222f24d9b93ec34c3b261be2fca0451c00571928e5 +d = 03789e04b3a2a0254ade3380172c150d2fad033885e02ea8bea5b92db3f4adbab190ae423080a1154dfedec694c25eab46ce638be3db4e4cba67bc39f62d6e7db2d +Qx = 1dbc2cf19627bdccf02432b1761f296275230c150cdde823ce3141ec315d7d05e16b2c29e2a67491078d5316883e933d85b4b10d4f64c477d3c4e0442dc928983a2 +Qy = 07562e720807dd118d3d8b265b3abc61a71fce43e3dce0e7b5ae18b7a4cb01ecc00d39c1f22e150a9a8728997e502144f5b3f6fa9b4cb8a4136212b082ca394e3f6 +k = 0fbccd8d7804bdd1d1d721b5ec74d4ba37603bc306f9fce2ec241853d8e07334e6b4b12c4ecca0c54bd71193dd7146507933a20737c5f3e15085830fab9b30ca57b +R = 181915a3998d8fa214f9715f4ca928d09c36de168dc15c6970a8a062b5cea2dc969b2437ca17b684f78a1fd583aad8e6c762c8f4ab0c91b86a497145e3ca440d307 +S = 15a6c18c5c77f5470b27d061eafdc26b78561941a3b2ab0f5c81d40899fc053c3d9ed12d7d61e298abbae470009c7b2157731c58d7b16a66fa5abaf5e8a1b8ed394 + +Msg = 7efacf213382ce30804e78b7256854d759147dba9729c51b2759465715bf2c421034c23dc651c13d6cce95f71fe6a84dfbee5768163ac5789ac0474c5ddf4115684683c5f7c204b33b8bcc0c03ac58f66cef2f53b721fe2fac91ad841126101a88f512a7c2ded38549d9f050d4b7961dda48a1489f026c5d111701762418cfe3 +d = 124700aa9186353e298edefc57bec0c7d0201cca10c1d80dd408d5d71040592b0ac59facdadfa8712445f5977ef8d4854022720c3f02d60e0732dbb2f171fcf1490 +Qx = 0c80fc4cecae5d53348524ddba6a160b735c75b22fdb39af17e2a613d09246e3bb0fd3f2978577f6db5d2118e05c7898024808f8eb8e021d7969cdcf7fc981200bb +Qy = 1a880c93943fd446d4b3923b574d2221c1bb7b645fb5534dda60e827b497666ff586b77921f7e7f605147947194cffd2fef0678880b89cc0bc7fb74fa96d4b112d7 +k = 01a05238d595ded5c61d3bf6fde257dbf13095af8a5cb3a2e579e8e4c550fe31d12b71cc2dbcb295e6c4fd0fb8c22d1b741c097cc59d826ced1a8771f09983143c4 +R = 132762bc81e9922a8d642e3a9d0218affa21fa2331cfcb9e452545c5981c64a8f7e4cc8e68056023b2aa78bead59061d19c7f646c931163a91e544b106b3be8de9e +S = 0c3a1b0b000c3169984132add51d611e2cb7069a262a6983d2ae72b459c36e6469509bdb0f473600b8686700b08910779dee9ba83f82e755d4a4ef5f124eb09397f + +Msg = 28edff8b9d85f5f58499cc11f492abdfab25e8945975bbaeee910afa2b8fc1295ec61406309ce4e09f4ab4f462959fc2a2786802466eb26d3b01be6919893ae75d0fdc2dc8a82e662550f9fce9627dd364188aaba5c6faa1b2d8a2235adfa5ad0dc140f88a2b2f103f5690e877d07fe8fd30d02d2b2729bd3d8eb5b23a21f54c +d = 1f532d01af885cb4ad5c329ca5d421c5c021883bd5404c798d617679bb8b094cbb7e15c832fb436325c5302313ce5e496f9513455e7021ffad75777a19b226acfa1 +Qx = 0c0bd76b0027b85bdd879052220da1494d503f6a4bb972105a48ae98e7dda8c2d9fd9336f5646385b961ef68e8464e3a95b00f96614b1a408ceaa2c87b077b6a8fb +Qy = 17eb7eb5c78db7819af92e8537d110d9f05a5e24f954f4dde21c224d4040f059ec99e051702f390413d2708d18f84d82998c61847475250fb844b20082cbe651a6b +k = 14e66853e0f7cd3300ebcae06048532e19cbb95bee140edc1c867ce7310637651445b6dfeb1d99d2e32f2ffb787ebe3fe35032277f185d3dad84f95806924550abe +R = 0c5b3a57161098e2e8e16e0a5ae8ecf4a14df14927eea18ed4925d11dc429dda145159323ba970174b194b9b4608a8fa2373b7a825c5e8bd80574e49698285c2c82 +S = 1a0c038a51796158b42eb5b0dac37aff9ab93b903a47e06ebbdd15946e4bcc9a3b3875b18cf6294c33fc6c3693cef04ed1a43d08951e664c760e2cf3fb4e47490d2 + +Msg = bae2a8897c742fd99fbf813351cd009d3f2e18d825ca22e115276484bce8f82f8c7c0c21dd2af208404d8ef45bb5a6c41693912b630897d5246801bf0775aa9bbac8be98cb861d172c3563dc59e78a58ed13c66dea496471b3ad0eeae8995293e4ab97373edc1837ffc95ff1cc0c1e90e64ea8680b2ca5f1e09bf86b99b343b6 +d = 11abf508bca68a85a54bc0659e77efad3c86112c9db04db2883e76144aa446918bb4bb0784b0b6a0e9aa47399fe3de5aaecfd8894a0d130bb0c366c40d9d5050745 +Qx = 05c0ea363a3a12633ea39d564587ebdd3a22a175ef32b9ebfc7311304b19cb3a62b5adc36f6afb6a6f7fabbf810ee89fdb72854fefd613e7798e9b9ff5938ea54c6 +Qy = 0bd06a85e47b885c08124b55a3fcc07ca61647cda6efbfdbd21b24d1ea7a4c7300d46cd798e76063aa979adef6f0698b15e5b7ae8a2ab39ab4f50b2d20614db6317 +k = 19cadb8c7eb10565aa4567e0709873918720f0e4b42b4817afb0b0547c70cd1100229deae97a276b9c98ea58b01d4839fee86336d749d123b03e8b1a31166acc110 +R = 0667448a8bbef1c810d40646977dc22f3dfb52a4d80928ded5e976e199cbed02fbd5a08546756ece14548d721a6eb380d0e1a71ad0660dbcac6163c776eedd3e249 +S = 0ae7f0a238daaddb7fb4a1707fe5132daf653f8e19f732347134c96f1dd798f867c479a4a4609a568a15b61afed70790adbde13ac5f68c468d0230852c1a2c22581 + +Msg = d57a26a9593e72bfc87322524639bcaae5f2252d18b99cdaa03b14445b0b8a4dd53928f66a2e4f202fb25b19cad0eb2f1bfda2ab9b0eb668cdcd0fe72f5d9ef2e45e0218590f7ab9d2c9342202610c698bc786cce108a7d4a6730a13e9ea1b470e781f1237d3f84f44abde808516975546bd89075ef9a9732bfd7ee33b6f4399 +d = 18dbf520d58177e4b7a0627674d220137983f486dd2fd3639f19751804e80df0655db6afd829cdf75238de525e1a7a9f048049b593dd64b4b96cc013f970c05ea1f +Qx = 18b872690c37995be324ddb5c2bd5462841bb062f8e63da248a853de79c3d6bb9a2eb1e6933afda0998ca43491cc807b08ace2d5336a43d0ab50563a2d3d98755f0 +Qy = 002ff31221aa32aa6546f35e8fe5b9361f938362a5e89e77ae130ba8bce3729e912dfac35a2fd21efe84b45b8be2a340850e4b574e1885b35c2afbe196b57c6cf4c +k = 098faeb73054639cb2e4442cd68e7b3a13f4b3f397a7b26f303afa40789f8ddd3d918f1ce4f0be53c8cb69c380744e2297d7fc01e2b3daef4ce64dd3a2644234753 +R = 09c0e7649f814f70a8416cb78bc4601472a363fe97f5c587305778169677860dd97f87b5ab07c3a953bc4615fc34634509d6a25621bdded33ed42446d059509c190 +S = 120b90e1cfb8a1b5e530df7b17d1128bc051ca4f1a65dd9c9d9d3c59d2f00c7c1e994c52b8671d40294b4d574d2c04475d5bebeacd3a0d3870a54dc7a4805614f40 + +Msg = 8fdcf5084b12cfc043dd3416b46274e021bbed95d341d3c500c102a5609d3a34de29f8fa9f0adb611a1f47a97ad981f8129d718fc0d6c709eab1a3490db8d550f34eb905b9e00663543afc5bc155e368e0bc919a8b8c9fa42093603537a5614927efa6be819ed42ececbf1a80a61e6e0a7f9b5bc43b9238e62d5df0571fea152 +d = 002764f5696aa813cd55d30948585f86288ae05aeb264ca157cd09e1d09a10515a849b0791b755ccc656a34707be9e52f5762d290a7d2bcd6de52c600ff862eaf4e +Qx = 127279c88719dc614db387f102e55104ea1c704ac7f57f3bca936f728439b76556730dd7cde2ac1ad0a4c2c2f036ab6f00cf34cb87ea36113571f300713044106d2 +Qy = 134a0786c31f5f2291b83c50fb579ae4c620b95e5a8bdc0c7e1ee6b996c89d764f1b20403e7faa203f397425ada297045dd8ba0e4b155d4900da249e934faab7991 +k = 08bffb0778cbb06466cecc114b9e89ca243a2b2b5e2597db920bc73a8bbcbe3f57144ad33409ef7faaab430e13f4c42d304d11347360c84972ca20b1539cce3a288 +R = 1f8f504e64a502e51e7c129517931c3b71f0d8a63b19cfe01ff7c951c6525249608b3ef5d00061d77eb6b3d69581adeaa3732c773bbb9b919c3e7c71fdc09f44d06 +S = 058044fc64b340604ffd02a5b2918d76fd6fb59ea895feab7aa218e6f1e8c8f226eb9ee345ef8140183a69272582005077b008006aab11597e808d7ff1e8382c924 + +Msg = 00669f433934992257bed55861df679804107d7fa491672574a7624949c60049b0533383c88d6896c8de860704c3e6a6aefce83efa57c4d57e9ab253da5d15e1f53ab6dce218b592772ab0bc01fee8e63368e85c0639301456fe2d44cd5396a7f2b22761cd03b80eba7883eede8249a2f5db2183bf00550c5c002f45a5e4fb31 +d = 1b0c9acd3eeb618b4b0de4db402206f0f29adc69d7ad324b6db6601b351f723ac8fe949eeacd34228649bf0126276e5aceb0137d00c30dd858aef2d6b6449de2e89 +Qx = 1811c8884486aaa083ddee1c51cb6e861cb830bd5eaa929f72efadbbd1286566ae7e7ba7fde7e02529900d35ee64591652d28798bfc1bed0d192602a9cf5a7d22e3 +Qy = 06d7fc9dd494816cfd29613d4689af67f7d0a2e6fbad5d4d6e0130189172a1ab601c5ca71deaa8bfcb5a190d49da191672ff6fc048e146cb902acec5eae6d87e60a +k = 1fdc4f108070af3c66c9ba7b6c1f2603a19ceb4760399df81228cfc7eafde1082b5a0716a3ff82fbe84726f14dd0db3376ca184a78c3c60679bab6cd45f77f9b9ce +R = 1ec310339ff056faeb341c4499c43782078b04be1725ae9a6cdcb6011c46d1a4eb3d75c358225e4ec142fd1cd344186f5eb597f7ba559ddfa954824365d5b6edaec +S = 005b679a33fdb7e04834f071cd0ac514c04add9f2614ab9bbd9b407b1420fed3f3e02a108e7e279899e43dcf64ae4083c289a87cd7d2103bdc036a95d36800ac7c6 + +Msg = 4be81dcfab39a64d6f00c0d7fff94dabdf3473dc49f0e12900df328d6584b854fbaebaf3194c433e9e21743342e2dd056b445c8aa7d30a38504b366a8fa889dc8ecec35b3130070787e7bf0f22fab5bea54a07d3a75368605397ba74dbf2923ef20c37a0d9c64caebcc93157456b57b98d4becb13fecb7cc7f3740a6057af287 +d = 181e1037bbec7ca2f271343e5f6e9125162c8a8a46ae8baa7ca7296602ae9d56c994b3b94d359f2b3b3a01deb7a123f07d9e0c2e729d37cc5abdec0f5281931308a +Qx = 0cfa5a8a3f15eb8c419095673f1d0bd63b396ff9813c18dfe5aa31f40b50b82481f9ed2edd47ae5ea6a48ea01f7e0ad0000edf7b66f8909ee94f141d5a07efe315c +Qy = 18af728f7318b96d57f19c1104415c8d5989565465e429bc30cf65ced12a1c5856ac86fca02388bc151cf89959a4f048597a9e728f3034aa39259b59870946187bf +k = 09078beaba465ba7a8b3624e644ac1e97c654533a58ac755e90bd606e2214f11a48cb51f9007865a0f569d967ea0370801421846a89f3d09eb0a481289270919f14 +R = 19cf91a38cc20b9269e7467857b1fc7eabb8cea915a3135f727d471e5bfcfb66d321fabe283a2cf38d4c5a6ecb6e8cbee1030474373bb87fcdfcc95cf857a8d25d0 +S = 1cf9acd9449c57589c950f287842f9e2487c5610955b2b5035f6aacfd2402f511998a1a942b39c307fc2bcab2c8d0dae94b5547ddccfb1012ca985b3edf42bbba8b + +[P-521,SHA-512] + +Msg = 9ecd500c60e701404922e58ab20cc002651fdee7cbc9336adda33e4c1088fab1964ecb7904dc6856865d6c8e15041ccf2d5ac302e99d346ff2f686531d25521678d4fd3f76bbf2c893d246cb4d7693792fe18172108146853103a51f824acc621cb7311d2463c3361ea707254f2b052bc22cb8012873dcbb95bf1a5cc53ab89f +d = 0f749d32704bc533ca82cef0acf103d8f4fba67f08d2678e515ed7db886267ffaf02fab0080dca2359b72f574ccc29a0f218c8655c0cccf9fee6c5e567aa14cb926 +Qx = 061387fd6b95914e885f912edfbb5fb274655027f216c4091ca83e19336740fd81aedfe047f51b42bdf68161121013e0d55b117a14e4303f926c8debb77a7fdaad1 +Qy = 0e7d0c75c38626e895ca21526b9f9fdf84dcecb93f2b233390550d2b1463b7ee3f58df7346435ff0434199583c97c665a97f12f706f2357da4b40288def888e59e6 +k = 03af5ab6caa29a6de86a5bab9aa83c3b16a17ffcd52b5c60c769be3053cdddeac60812d12fecf46cfe1f3db9ac9dcf881fcec3f0aa733d4ecbb83c7593e864c6df1 +R = 04de826ea704ad10bc0f7538af8a3843f284f55c8b946af9235af5af74f2b76e099e4bc72fd79d28a380f8d4b4c919ac290d248c37983ba05aea42e2dd79fdd33e8 +S = 087488c859a96fea266ea13bf6d114c429b163be97a57559086edb64aed4a18594b46fb9efc7fd25d8b2de8f09ca0587f54bd287299f47b2ff124aac566e8ee3b43 + +Msg = b3c63e5f5a21c4bfe3dbc644354d9a949186d6a9e1dd873828782aa6a0f1df2f64114a430b1c13fe8a2e09099e1ed05ef70de698161039ded73bcb50b312673bb073f8a792ac140a78a8b7f3586dffb1fc8be4f54516d57418ccc9945025ce3acf1eb84f69ceee5e9bd10c18c251dbc481562cd3aae54b54ab618cb1eeda33cf +d = 1a4d2623a7d59c55f408331ba8d1523b94d6bf8ac83375ceb57a2b395a5bcf977cfc16234d4a97d6f6ee25a99aa5bff15ff535891bcb7ae849a583e01ac49e0e9b6 +Qx = 04d5c8afee038984d2ea96681ec0dccb6b52dfa4ee2e2a77a23c8cf43ef19905a34d6f5d8c5cf0981ed804d89d175b17d1a63522ceb1e785c0f5a1d2f3d15e51352 +Qy = 014368b8e746807b2b68f3615cd78d761a464ddd7918fc8df51d225962fdf1e3dc243e265100ff0ec133359e332e44dd49afd8e5f38fe86133573432d33c02fa0a3 +k = 0bc2c0f37155859303de6fa539a39714e195c37c6ea826e224c8218584ae09cd0d1cc14d94d93f2d83c96e4ef68517fdb3f383da5404e5a426bfc5d424e253c181b +R = 1a3c4a6386c4fb614fba2cb9e74201e1aaa0001aa931a2a939c92e04b8344535a20f53c6e3c69c75c2e5d2fe3549ed27e6713cb0f4a9a94f6189eb33bff7d453fce +S = 16a997f81aa0bea2e1469c8c1dab7df02a8b2086ba482c43af04f2174831f2b1761658795adfbdd44190a9b06fe10e578987369f3a2eced147cff89d8c2818f7471 + +Msg = 6e0f96d56505ffd2d005d5677dbf926345f0ff0a5da456bbcbcfdc2d33c8d878b0bc8511401c73168d161c23a88b04d7a9629a7a6fbcff241071b0d212248fcc2c94fa5c086909adb8f4b9772b4293b4acf5215ea2fc72f8cec57b5a13792d7859b6d40348fc3ba3f5e7062a19075a9edb713ddcd391aefc90f46bbd81e2557b +d = 14787f95fb1057a2f3867b8407e54abb91740c097dac5024be92d5d65666bb16e4879f3d3904d6eab269cf5e7b632ab3c5f342108d1d4230c30165fba3a1bf1c66f +Qx = 0c2d540a7557f4530de35bbd94da8a6defbff783f54a65292f8f76341c996cea38795805a1b97174a9147a8644282e0d7040a6f83423ef2a0453248156393a1782e +Qy = 119f746c5df8cec24e4849ac1870d0d8594c799d2ceb6c3bdf891dfbd2242e7ea24d6aec3166214734acc4cbf4da8f71e2429c5c187b2b3a048527c861f58a9b97f +k = 186cd803e6e0c9925022e41cb68671adba3ead5548c2b1cd09348ab19612b7af3820fd14da5fe1d7b550ed1a3c8d2f30592cd7745a3c09ee7b5dcfa9ed31bdd0f1f +R = 10ed3ab6d07a15dc3376494501c27ce5f78c8a2b30cc809d3f9c3bf1aef437e590ef66abae4e49065ead1af5f752ec145acfa98329f17bca9991a199579c41f9229 +S = 08c3457fe1f93d635bb52df9218bf3b49a7a345b8a8a988ac0a254340546752cddf02e6ce47eee58ea398fdc9130e55a4c09f5ae548c715f5bcd539f07a34034d78 + +Msg = 3f12ab17af3c3680aad22196337cedb0a9dba22387a7c555b46e84176a6f8418004552386ada4deec59fdabb0d25e1c6668a96f100b352f8dabd24b2262bd2a3d0f825602d54150bdc4bcbd5b8e0ca52bc8d2c70ff2af9b03e20730d6bd9ec1d091a3e5c877259bcff4fd2c17a12bfc4b08117ec39fe4762be128d0883a37e9d +d = 15807c101099c8d1d3f24b212af2c0ce525432d7779262eed0709275de9a1d8a8eeeadf2f909cf08b4720815bc1205a23ad1f825618cb78bde747acad8049ca9742 +Qx = 160d7ea2e128ab3fabd1a3ad5455cb45e2f977c2354a1345d4ae0c7ce4e492fb9ff958eddc2aa61735e5c1971fa6c99beda0f424a20c3ce969380aaa52ef5f5daa8 +Qy = 14e4c83f90d196945fb4fe1e41913488aa53e24c1d2142d35a1eed69fed784c0ef44d71bc21afe0a0065b3b87069217a5abab4355cf8f4ceae5657cd4b9c8008f1f +k = 096731f8c52e72ffcc095dd2ee4eec3da13c628f570dba169b4a7460ab471149abdede0b63e4f96faf57eab809c7d2f203fd5ab406c7bd79869b7fae9c62f97c794 +R = 1e2bf98d1186d7bd3509f517c220de51c9200981e9b344b9fb0d36f34d969026c80311e7e73bb13789a99e0d59e82ebe0e9595d9747204c5f5550c30d934aa30c05 +S = 12fed45cc874dc3ed3a11dd70f7d5c61451fbea497dd63e226e10364e0718d3722c27c7b4e5027051d54b8f2a57fc58bc070a55b1a5877b0f388d768837ef2e9cec + +Msg = a1eed24b3b7c33296c2491d6ee092ec6124f85cf566bb5bc35bffb5c734e34547242e57593e962fb76aee9e800eed2d702cc301499060b76406b347f3d1c86456978950737703c8159001e6778f69c734a56e5ce5938bd0e0de0877d55adeee48b0d8dfa4ac65fd2d3ce3e12878bac5c7014f9284d161b2a3e7d5c88569a45f6 +d = 18692def0b516edcdd362f42669999cf27a65482f9358fcab312c6869e22ac469b82ca9036fe123935b8b9ed064acb347227a6e377fb156ec833dab9f170c2ac697 +Qx = 1ceee0be3293d8c0fc3e38a78df55e85e6b4bbce0b9995251f0ac55234140f82ae0a434b2bb41dc0aa5ecf950d4628f82c7f4f67651b804d55d844a02c1da6606f7 +Qy = 1f775eb6b3c5e43fc754052d1f7fc5b99137afc15d231a0199a702fc065c917e628a54e038cbfebe05c90988b65183b368a2061e5b5c1b025bbf2b748fae00ba297 +k = 161cf5d37953e09e12dc0091dc35d5fb3754c5c874e474d2b4a4f1a90b870dff6d99fb156498516e25b9a6a0763170702bb8507fdba4a6131c7258f6ffc3add81fd +R = 14dfa43046302b81fd9a34a454dea25ccb594ace8df4f9d98556ca5076bcd44b2a9775dfaca50282b2c8988868e5a31d9eb08e794016996942088d43ad3379eb9a1 +S = 120be63bd97691f6258b5e78817f2dd6bf5a7bf79d01b8b1c3382860c4b00f89894c72f93a69f3119cb74c90b03e9ede27bd298b357b9616a7282d176f3899aaa24 + +Msg = 9aace26837695e6596007a54e4bccdd5ffb16dc6844140e2eeeb584b15acb2bbffd203c74440b6ee8db676fd200b4186a8c3e957c19e74d4d865ada83f80655323dfa3570907ed3ce853b6e8cc375ed2d758a2f5ad265dd3b47650517a49b3d02df9e0c60c21576378c2b3a08481eec129b2a75608e13e6420127a3a63c8a3f1 +d = 0a63f9cdefbccdd0d5c9630b309027fa139c31e39ca26686d76c22d4093a2a5e5ec4e2308ce43eb8e563187b5bd811cc6b626eace4063047ac0420c3fdcff5bdc04 +Qx = 14cab9759d4487987b8a00afd16d7199585b730fb0bfe63796272dde9135e7cb9e27cec51207c876d9214214b8c76f82e7363f5086902a577e1c50b4fbf35ce9966 +Qy = 1a83f0caa01ca2166e1206292342f47f358009e8b891d3cb817aec290e0cf2f47e7fc637e39dca03949391839684f76b94d34e5abc7bb750cb44486cce525eb0093 +k = 01e51fd877dbbcd2ab138fd215d508879298d10c7fcbdcc918802407088eb6ca0f18976a13f2c0a57867b0298512fc85515b209c4435e9ef30ab01ba649838bc7a0 +R = 11a1323f6132d85482d9b0f73be838d8f9e78647934f2570fededca7c234cc46aa1b97da5ac1b27b714f7a171dc4209cbb0d90e4f793c4c192dc039c31310d6d99b +S = 0386a5a0fc55d36ca7231a9537fee6b9e51c2255363d9c9e7cb7185669b302660e23133eb21eb56d305d36e69a79f5b6fa25b46ec61b7f699e1e9e927fb0bceca06 + +Msg = ac2175940545d4fbab6e2e651c6830aba562e0c11c919e797c43eff9f187a68a9e5a128e3e2a330b955a3f4577d3f826529ad1b03d7b60f7ad678f005053b41dc0f8d267f3685c6abe1a0e9a733c44b2f3ca48b90806f935141c842e3a6c06a58f5343d75e3585971a734f4ae1074ce5b54f74bd9342f4bbca738d260393f43e +d = 024f7d67dfc0d43a26cc7c19cb511d30a097a1e27e5efe29e9e76e43849af170fd9ad57d5b22b1c8840b59ebf562371871e12d2c1baefc1abaedc872ed5d2666ad6 +Qx = 09da1536154b46e3169265ccba2b4da9b4b06a7462a067c6909f6c0dd8e19a7bc2ac1a47763ec4be06c1bec57d28c55ee936cb19588cc1398fe4ea3bd07e6676b7f +Qy = 14150cdf25da0925926422e1fd4dcfcffb05bdf8682c54d67a9bd438d21de5af43a15d979b320a847683b6d12ac1383a7183095e9da491c3b4a7c28874625e70f87 +k = 1c1308f31716d85294b3b5f1dc87d616093b7654907f55289499b419f38ceeb906d2c9fe4cc3d80c5a38c53f9739311b0b198111fede72ebde3b0d2bc4c2ef090d2 +R = 00dbf787ce07c453c6c6a67b0bf6850c8d6ca693a3e9818d7453487844c9048a7a2e48ff982b64eb9712461b26b5127c4dc57f9a6ad1e15d8cd56d4fd6da7186429 +S = 0c6f1c7774caf198fc189beb7e21ca92ceccc3f9875f0e2d07dc1d15bcc8f210b6dd376bf65bb6a454bf563d7f563c1041d62d6078828a57538b25ba54723170665 + +Msg = 6266f09710e2434cb3da3b15396556765db2ddcd221dce257eab7399c7c490135925112932716af1434053b8b9fe340563e57a0b9776f9ac92cbb5fba18b05c0a2fafbed7240b3f93cd1780c980ff5fe92610e36c0177cabe82367c84cee9020cf26c1d74ae3eb9b9b512cb8b3cb3d81b17cf20dc76591b2b394ef1c62ac12ee +d = 0349471460c205d836aa37dcd6c7322809e4e8ef81501e5da87284b267d843897746b33016f50a7b702964910361ed51d0afd9d8559a47f0b7c25b2bc952ce8ed9e +Qx = 00bbd4e8a016b0c254e754f68f0f4ed081320d529ecdc7899cfb5a67dd04bc85b3aa6891a3ed2c9861ae76c3847d81780c23ad84153ea2042d7fd5d517a26ff3ce4 +Qy = 0645953afc3c1b3b74fdf503e7d3f982d7ee17611d60f8eb42a4bddbec2b67db1f09b54440c30b44e8071d404658285cb571462001218fc8c5e5b98b9fae28272e6 +k = 00eb2bd8bb56b9d2e97c51247baf734cc655c39e0bfda35375f0ac2fe82fad699bf1989577e24afb33c3868f91111e24fefe7dec802f3323ac013bec6c048fe5568 +R = 14bf63bdbc014aa352544bd1e83ede484807ed760619fa6bc38c4f8640840195e1f2f149b29903ca4b6934404fb1f7de5e39b1ea04dba42819c75dbef6a93ebe269 +S = 05d1bcf2295240ce4415042306abd494b4bda7cf36f2ee2931518d2454faa01c606be120b057062f2f3a174cb09c14f57ab6ef41cb3802140da22074d0e46f908d4 + +Msg = 3de9e617a6868dca1a1432d503f923535da3f9b34426b2a4822174399c73b1c1ee67311410a58c17202ac767844b2024d8aa21a205707d93865693ac25a24fc87034fa3a7a7e27c3344cb03b87602c15180a5fe6a9dd90cd11af4a0f150207bf2d83f55b12c088adae99aa8cfa659311b3a25beb99056643760d6a282126b9b2 +d = 07788d34758b20efc330c67483be3999d1d1a16fd0da81ed28895ebb35ee21093d37ea1ac808946c275c44454a216195eb3eb3aea1b53a329eca4eb82dd48c784f5 +Qx = 0157d80bd426f6c3cee903c24b73faa02e758607c3e102d6e643b7269c299684fdaba1acddb83ee686a60acca53cddb2fe976149205c8b8ab6ad1458bc00993cc43 +Qy = 16e33cbed05721b284dacc8c8fbe2d118c347fc2e2670e691d5d53daf6ef2dfec464a5fbf46f8efce81ac226915e11d43c11c8229fca2327815e1f8da5fe95021fc +k = 0a73477264a9cc69d359464abb1ac098a18c0fb3ea35e4f2e6e1b060dab05bef1255d9f9c9b9fbb89712e5afe13745ae6fd5917a9aedb0f2860d03a0d8f113ea10c +R = 07e315d8d958b8ce27eaf4f3782294341d2a46fb1457a60eb9fe93a9ae86f3764716c4f5f124bd6b114781ed59c3f24e18aa35c903211b2f2039d85862932987d68 +S = 1bcc1d211ebc120a97d465b603a1bb1e470109e0a55d2f1b5c597803931bd6d7718f010d7d289b31533e9fcef3d141974e5955bc7f0ee342b9cad05e29a3dded30e + +Msg = aa48851af7ef17abe233163b7185130f4646203c205e22bcc2a5a3697bcab998c73a9ffe1d3ea0b7978ce7df937a72586eb5ca60b0d939a7d1c115c820171c89c8116b7e2c7b98cf0f14e4c4df3cb2f319ad3ab0ea25ff14526ddc037469f000bf82100acd4cdf94feb4eba4ea1726f0569336604a473aee67d71afebb569209 +d = 1f98696772221e6cccd5569ed8aed3c435ee86a04689c7a64d20c30f6fe1c59cc10c6d2910261d30c3b96117a669e19cfe5b696b68feeacf61f6a3dea55e6e5837a +Qx = 07002872c200e16d57e8e53f7bce6e9a7832c387f6f9c29c6b75526262c57bc2b56d63e9558c5761c1d62708357f586d3aab41c6a7ca3bf6c32d9c3ca40f9a2796a +Qy = 1fe3e52472ef224fb38d5a0a14875b52c2f50b82b99eea98d826c77e6a9ccf798de5ffa92a0d65965f740c702a3027be66b9c844f1b2e96c134eb3fdf3edddcf11c +k = 1a277cf0414c6adb621d1cc0311ec908401ce040c6687ed45a0cdf2910c42c9f1954a4572d8e659733d5e26cbd35e3260be40017b2f5d38ec42315f5c0b056c596d +R = 0d732ba8b3e9c9e0a495249e152e5bee69d94e9ff012d001b140d4b5d082aa9df77e10b65f115a594a50114722db42fa5fbe457c5bd05e7ac7ee510aa68fe7b1e7f +S = 134ac5e1ee339727df80c35ff5b2891596dd14d6cfd137bafd50ab98e2c1ab4008a0bd03552618d217912a9ec502a902f2353e757c3b5776309f7f2cfebf913e9cd + +Msg = b0d5d52259af364eb2d1a5027e5f7d0afe4b999cc5dd2268cfe76f51d2f17b541bdd7867e23a1bb897705153d9432a24012108979c6a2c9e2567c9531d012f9e4be764419491a52eae2e127430b0ab58cb8e216515a821b3db206447c235bf44ee304201b483b2a88844abaa18bca0147dfff7e502397dd62e15524f67eb2df2 +d = 13c3852a6bc8825b45fd7da1754078913d77f4e586216a6eb08b6f03adce7464f5dbc2bea0eb7b12d103870ef045f53d67e3600d7eba07aac5db03f71b64db1cceb +Qx = 0c97a4ebcbbe701c9f7be127e87079edf479b76d3c14bfbee693e1638e5bff8d4705ac0c14597529dbe13356ca85eb03a418edfe144ce6cbf3533016d4efc29dbd4 +Qy = 11c75b7a8894ef64109ac2dea972e7fd5f79b75dab1bf9441a5b8b86f1dc1324426fa6cf4e7b973b44e3d0576c52e5c9edf8ce2fc18cb3c28742d44419f044667f8 +k = 1e25b86db041f21c2503d547e2b1b655f0b99d5b6c0e1cf2bdbd8a8c6a053f5d79d78c55b4ef75bff764a74edc920b35536e3c470b6f6b8fd53898f3bbc467539ef +R = 1dce45ea592b34d016497882c48dc0c7afb1c8e0f81a051800d7ab8da9d237efd892207bc9401f1d30650f66af8d5349fc5b19727756270722d5a8adb0a49b72d0a +S = 0b79ffcdc33e028b1ab894cb751ec792a69e3011b201a76f3b878655bc31efd1c0bf3b98aea2b14f262c19d142e008b98e890ebbf464d3b025764dd2f73c4251b1a + +Msg = 9599788344976779383a7a0812a096943a1f771ee484d586af1a06207478e4c0be9c200d42460fe837e24b266c8852d80d3c53cc52ffb1913fc3261145fc6da575611efd16c026059a2e64f802517ffd1b6b34de10ad2909c65c2155e8d939b8115400c1d793d23955b15f5d1c13c962ff92b4a815cee0e10f8e14e1f6e6cd38 +d = 1654eaa1f6eec7159ee2d36fb24d15d6d33a128f36c52e2437f7d1b5a44ea4fa965c0a26d0066f92c8b82bd136491e929686c8bde61b7c704daab54ed1e1bdf6b77 +Qx = 1f269692c47a55242bb08731ff920f4915bfcecf4d4431a8b487c90d08565272c52ca90c47397f7604bc643982e34d05178e979c2cff7ea1b9eaec18d69ca7382de +Qy = 0750bdd866fba3e92c29599c002ac6f9e2bf39af8521b7b133f70510e9918a94d3c279edec97ab75ecda95e3dd7861af84c543371c055dc74eeeff7061726818327 +k = 1b7519becd00d750459d63a72f13318b6ac61b8c8e7077cf9415c9b4b924f35514c9c28a0fae43d06e31c670a873716156aa7bc744577d62476e038b116576a9e53 +R = 183bddb46c249e868ef231a1ebd85d0773bf8105a092ab7d884d677a1e9b7d6014d6358c09538a99d9dca8f36f163ac1827df420c3f9360cc66900a9737a7f756f3 +S = 0d05ee3e64bac4e56d9d8bd511c8a43941e953cba4e5d83c0553acb87091ff54f3aad4d69d9f15e520a2551cc14f2c86bb45513fef0295e381a7635486bd3917b50 + +Msg = fdde51acfd04eb0ad892ce9d6c0f90eb91ce765cbe3ce9d3f2defe8f691324d26b968b8b90e77706b068585f2a3ee7bf3e910528f7403c5af745a6f9d7ba6c53abd885c3b1be583415b128f4d3f224daf8563476bd9aa61e9c8518c144335f8f879c03696bddbe3ac37a8fbede29861611feaa87e325e2f60278b4893ed57fb0 +d = 1cba5d561bf18656991eba9a1dde8bde547885ea1f0abe7f2837e569ca52f53df5e64e4a547c4f26458b5d9626ed6d702e5ab1dd585cf36a0c84f768fac946cfd4c +Qx = 12857c2244fa04db3b73db4847927db63cce2fa6cb22724466d3e20bc950a9250a15eafd99f236a801e5271e8f90d9e8a97f37c12f7da65bce8a2c93bcd25526205 +Qy = 0f394e37c17d5b8e35b488fa05a607dbc74264965043a1fb60e92edc212296ae72d7d6fe2e3457e67be853664e1da64f57e44bd259076b3bb2b06a2c604fea1be9d +k = 0e790238796fee7b5885dc0784c7041a4cc7ca4ba757d9f7906ad1fcbab5667e3734bc2309a48047442535ff89144b518f730ff55c0c67eeb4c880c2dfd2fb60d69 +R = 1d7ce382295a2a109064ea03f0ad8761dd60eefb9c207a20e3c5551e82ac6d2ee5922b3e9655a65ba6c359dcbf8fa843fbe87239a5c3e3eaecec0407d2fcdb687c2 +S = 161963a6237b8955a8a756d8df5dbd303140bb90143b1da5f07b32f9cb64733dc6316080924733f1e2c81ade9d0be71b5b95b55666026a035a93ab3004d0bc0b19f + +Msg = beb34c997f905c77451ac392f7957a0ab8b23325bd5c63ca31c109ac8f655a1e3094240cb8a99284f8091de2ab9a7db2504d16251980b86be89ec3a3f41162698bab51848880633e0b71a38f8896335853d8e836a2454ecab2acdcc052c8f659be1d703b13ae1b090334ac50ab0137ddb5e8b924c0e3d2e5789daaef2fdd4a1e +d = 0972e7ff25adf8a032535e5b19463cfe306b90803bf27fabc6046ae0807d2312fbab85d1da61b80b2d5d48f4e5886f27fca050b84563aee1926ae6b2564cd756d63 +Qx = 1d7f1e9e610619daa9d2efa563610a371677fe8b58048fdc55a98a49970f6afa6649c516f9c72085ca3722aa595f45f2803402b01c832d28aac63d9941f1a25dfea +Qy = 1571facce3fcfe733a8eef4e8305dfe99103a370f82b3f8d75085414f2592ad44969a2ef8196c8b9809f0eca2f7ddc71c47879e3f37a40b9fecf97992b97af29721 +k = 0517f6e4002479dc89e8cbb55b7c426d128776ca82cf81be8c1da9557178783f40e3d047db7e77867f1af030a51de470ee3128c22e9c2d642d71e4904ab5a76edfa +R = 1c3262a3a3fb74fa5124b71a6c7f7b7e6d56738eabaf7666b372b299b0c99ee8a16be3df88dd955de093fc8c049f76ee83a4138cee41e5fe94755d27a52ee44032f +S = 072fd88bb1684c4ca9531748dfce4c161037fcd6ae5c2803b7117fb60d3db5df7df380591aaf3073a3031306b76f062dcc547ded23f6690293c34a710e7e9a226c3 + +Msg = 543c374af90c34f50ee195006d5f9d8dd986d09ad182fcbefa085567275eee1e742bfe0af3d058675adeb5b9f87f248b00a9fbd2aa779129123a5b983f2f26fc3caf2ea34277550c22fe8c814c739b46972d50232993cddd63a3c99e20f5c5067d9b57e2d5db94317a5a16b5c12b5c4cafbc79cbc2f9940f074bbc7d0dc71e90 +d = 1f0ec8da29295394f2f072672db014861be33bfd9f91349dad5566ff396bea055e53b1d61c8c4e5c9f6e129ed75a49f91cce1d5530ad4e78c2b793a63195eb9f0da +Qx = 09ec1a3761fe3958073b9647f34202c5e8ca2428d056facc4f3fedc7077fa87f1d1eb30cc74f6e3ff3d3f82df2641cea1eb3ff1529e8a3866ae2055aacec0bf68c4 +Qy = 0bed0261b91f664c3ff53e337d8321cb988c3edc03b46754680097e5a8585245d80d0b7045c75a9c5be7f599d3b5eea08d828acb6294ae515a3df57a37f903ef62e +k = 0ac3b6d61ebda99e23301fa198d686a13c0832af594b289c9a55669ce6d62011384769013748b68465527a597ed6858a06a99d50493562b3a7dbcee975ad34657d8 +R = 0cef3f4babe6f9875e5db28c27d6a197d607c3641a90f10c2cc2cb302ba658aa151dc76c507488b99f4b3c8bb404fb5c852f959273f412cbdd5e713c5e3f0e67f94 +S = 0097ed9e005416fc944e26bcc3661a09b35c128fcccdc2742739c8a301a338dd77d9d13571612a3b9524a6164b09fe73643bbc31447ee31ef44a490843e4e7db23f + + +[K-233,SHA-224] + +Msg = f23f784fe136c9fc0d169503d361e9c6148b0f1fbdcae0a97fae1af7033ddef25cb7489c9963cfcb009a8cbfe44a8510a64a073eb1deae4c324ceb9302008c92c69b2dafcc9077fd3cc3c7c119edc3ced36d176ceaa55ac036bf7f07f6fa215e8bb8196e59a5e1c9af4f98b90ab4970885bd7015fa26a09e03c7cf6b4b23d929 +d = 04c1d414696cc3657dd9df73ace56eda2636769ce7082e064c260be45a5 +Qx = 1f228c0a75b057eb07fe7ce8223ed4163148c1fdab61e0f787271f836a9 +Qy = 0cdfa5655d96ffd5ffb6027bfaa04da7b5d8fbdbb6202c8bb79f056ce43 +k = 058f8511089fcd59324469f6736b92693afe26bd4719e198f1f2287dc5f +R = 016bafefb4933ffd00bd1db6d6c4fac8a06375603adc0aa2a5664083ff4 +S = 03bcb84b8f1990cfc7b88f2b8cc817105cd8e150808e7c87b310cdc47e3 + +Msg = 400bcb297552bb37f2f8135a9314a35f5126788bb6fa4dc74152731ff64c5dab4b902103d85443dec20e16b1d6629930cdc2bd183d4099f0e96295a63c2fe266f5e9d050c401a8681b4a438efe53cbd8f2f43e2a31e9f88926a9c82917d873f6e8cd5ff5eb8c1ca36126b0bfc8c2b0e85a7c9e7a45f1875ca9c82019ebedb729 +d = 027cb1d84865a16992476c9e353283d5d6a40c349a8e9179d1b1f403531 +Qx = 1191227d064176f4ab020faea61330df5eb59163ecb4ea59c23e6f1f6c8 +Qy = 12dbfbf85b3624b9f56446f840602f9b839bab1368295b3ae919cb07c07 +k = 01a41af270269be052a62a9879638e3432a1479b05776ce61f45c0c361b +R = 041a5f1d28b70bfa2925b9428ab8bac9fa174d88ae27d754824c7d16ead +S = 044d359065672b3d3dfe8389fbc6fc751ca6a46820626c466174fb9b922 + +Msg = 5f74d4b35c49fa454c97c05fdb6b9f6822cf1a2295f15bd766dbcb413d77c910bd8f4147e8f317fac2300fa21cb80134d1b6f8ae8e50518c1f648a28506e419f5a6e8f05abffdb3dd2587606c7e9c223ecff4f46b121216730ea13202b59128a7616bb2fd23a7e4a5aa08641cc07b669641313febfc88d64d99447353dae3f06 +d = 031b443f46c4b5224237fac1022ee1570173f664aba0c84dbaa4246bdc1 +Qx = 05f57b0e5f2e175006f4058cbb4ca9a0cac912c551ef1b94e97498fcc5a +Qy = 0f3a554d077b751478f8a2b7c2a9cf15effed958e0ac1a9e3db1e023c5f +k = 07ff6ef3026c5a960e632beeb7313b3bca0baec76cea1fd9b82cedc3245 +R = 0099741698549c32a4e86aab6194527cea703ff869849c538a938585a83 +S = 02ad706c6f5dcff512498d84f1877eb997dfbe9b3d13b339917632d3cb1 + +Msg = 8f92096876d9f81bcd992369d42d0b5877ac969004d17c8627c58d8b8b7bbf7a37e8cb6afa962b9b043bbbaa5bef4a5ee38d8bd31cb5866b828265a2f4102a616f87009cd346fcb8af5519fb577c60d8792472232f33dc615655e53d2b715b15a2697b492f108b7906e1e3597c6911f8cc30c7121ae338a6b747ec368f8e4a36 +d = 048f6ca29f35f253a4962734357c995920967b9eeff1ba5fd2080bfede5 +Qx = 12b7ca7c21292f8795b2fbfd63a28c5a4ec8c850d6240f973c903bc8170 +Qy = 1be9855e5c5a5064c27d1862010b2fd0d7be5a0180c861a288ceac89d6d +k = 07dcb9725323fd7668991ce9a907b7129d53fae9016e253c53d057d195d +R = 0498c4fca6ed7c2998347b464d3e562a74b0e4f3a6c1dc453aaa61bb710 +S = 03a77a13f011404d5c5341dcd2ca44dc2b08f21f09f524045c281fb221e + +Msg = 3d275dbde44494c45fc15fe89e2ae32aa26426a17e923e895c7941a5582fb95df4d49873ab1bde358017f336b911b886b626b744806ab8113418473c441f1964159ded1b12122d53ac56573167588e4b55f36b8bca8c67823883a51fb6e7f204d1c6b07ea49b577bfab9ca6b8d51f72268b022e3a4db6f9d265ee8382f9b7b66 +d = 019b940eabbe682f961d9f3d90432e347fef3910e641656825d775705b1 +Qx = 1efcc9f4576047c43eab1c13e0547b1c5ec1cd2afd2345fda72b5e1b50f +Qy = 0c7b5968af47e58f4ec15c0cd82ccd0b9f5bfde06c7f86fe5cd0105d693 +k = 03f783a94d1de73e4593f5d6d02238cfa0486e3ddf2bc0b95a528038e3c +R = 013c467531f3f6508534ad072edb210e4182ce5a798d8a46674e92a0b4d +S = 0685982aa8e2f3e46ecc03e00e7323f3b891da437235cfe9800139ee8d7 + +Msg = d2fa68e1f7dad02916b12fa38f1849d6d409dbad0344438520b4dd9b77d62d39ac9ae3cdeab03ccbcfd4de703c6e798873671731c108f322b9f2a68145e3e210c9b15b879798e5c53c5022742e9819b99edabb2f44d89ae221f7a99dc84421a6905695ff91928db608f861745f17584d56e34b75c47281435b1b0b34e490692d +d = 07a884b22e29fa9fe945e9ba13c0df8d786dc87cef0f77f069e182dd56c +Qx = 11e831647d0ffd53d75e44abceda753ab470b3cc93b457590617d925a19 +Qy = 03db5bd0aecd6504d904bcf9dcce131abd239aeadb9a64a9811eac823cc +k = 00241b763c6245b83afe61762b161c41467ef35b7f27a9c1066f02babd3 +R = 0514adca3481ac5f99287e6e966a5c223296b07a9456eb582ec5568688c +S = 07ff6a2f7cb1d2594a11d8d0adb6fe50b4e740f025e7b4333ee26163d92 + +Msg = 3830f75cf9df4eb2998c7c1b5fe11c1476bcf849c3a8fa7d3d0b5bc2292e5d07465ab8cc9381c575d909e509c5dac49c78817c04e4bef18bd51bb09aa5897f21634633a5ce6d20bb4638cb6c3927351eaec7b62cf4a33956916045c392f325adafb10a88a5f86d7e41dd77908fa7284210071c22aa40ef40da6339c02da05392 +d = 05da61f881d5a0dc085bb93764f584352882923cd237d878220ec624c1a +Qx = 18d740441eff1f785a14d04da4ba69540cbb469780ffd36e1dfae4f1de2 +Qy = 18072ab30e999ae26b872ef46a9a0604296d02c08fba9477d9e03f0f75d +k = 000f95c5678fd08dda790cc60bfa578118f8687228a2ef5f31e71a6884b +R = 074a6599b8cab75e0cf752e3f41288fbc673d52074950edb14f76524949 +S = 03523804351e3224e816cd4fb7191f332585f68053ddb32a85cc0fadc03 + +Msg = 65b9fe15e6c35d453caa6bad39ee78a720a04b60d8a0a0f049186d2f777e48ae2d657e174df53edb7beb9f7d8f21904ed674add0cda5b62a7308de76c324a144021e8c6d387daaba4ce48bf7dfe9c8aeee2c64e434ece1fa5ddcafcf3e5d0013a1eeec1742a00d384cc2ec0d7eda83bb4dccfb0e57045ebfc27a4f404d03da37 +d = 03fe9f04647f6d82b13ec1ae5a8c2e49bc66b05649ad778eb16149ad83a +Qx = 158eecc6b8918e7813ef990217c603b28ed1774c740382a8af5c9af6133 +Qy = 1bbffeccd41107c7e6f83e24c822d634a7ec064fae125dc8a3ecc4fc9b3 +k = 07731edfb3ef523a165a1b5817ab2805a5cf88043c98ea2393898e19551 +R = 01fa44fa18ebafee6f419fdb9de0e8365520617558b57e9ee89f2c8fc88 +S = 053f1b2da4cabad04fea1111d525f341417587823fce71e5bfd2353c2f1 + +Msg = d26521fd41eb5d46ece6836e188bf9cb1b461d011c41e002a935d256654d01725378e845920ec4a7fd3f379df54772493df50d312c7c6aa4e909e7b83f2442c3a5e85c37d68aa015098ecfb0a5e077370f4576f4bc63bf37e1dee06d780a3b6949af5e21c2a0960fcd20821ef5f17bebf5fd5b3bdda260842cbbfad45667287a +d = 05ebce648ace4cd555413de6a456fc487d14bf4b0b9a72311ef480d2f26 +Qx = 020b46ecbdc36b4dc01111932090ba185eab2cdc4fa89775f2a6177c592 +Qy = 104cac1c800103c79642321a216bcfae497b037b29888cf9f70c507114e +k = 027733120626e564b06ba71c4946c9c8bfae43f88511ec6352d2a52f407 +R = 0592de5184510e6ecb7be8a011f862470b918354a1ad82458cf716137fe +S = 010a9c5fb6e4b70571a35c56744b57baf0108728bea2bf639af1960d1dc + +Msg = b778c021b1a92c41dbd09963da07018075d73e54d62df5c2b7bf8abe137151650d1c1c6abce7eebd8f32e8c3e6d1433773f257bb3ba4a4fb6a02c0db1e47d03c27d3a90898ebd1927c21df24c4c5443ca5b81f8ef2cc0f5e8b3d08f472bf07085df737adaedec63d99acd77b87ba98225f198b791124ac2d9b191cb9251b4b00 +d = 056653c2f85593f789a926ba49fa3da9d7f946d8f1020508c5a527ce813 +Qx = 10d65f6f5415dd86a83bb10118abfc1b1670a1664eb6dae99fb68b85019 +Qy = 12c1e673e575086ec1e76b90d59c2cbd2727f726f88298552b678ba7e60 +k = 021e26c098c9f9da9c782857fe640ff6abb21caf20a093f2277845bd10d +R = 01d67cbc8209494dca1a74cee5d9894f98f03728214f7bbdac29b0c0e78 +S = 02215f758fcf0d8dd603e79658a8061ab45bfe6d854e52ea7074fd5654e + +Msg = ec14e07f615960015a489ef999e308b42a4c571473b9bd64b433dabd9a1b1ad02e33eee9100064405175928a94543a80f440040afa2965b4e5f95f768e7fab6d3c0a5f5e1bf1df7822f78384e80f2955ea85f044ac60537d895747979f935bb0cd3673193c4a32dd7803e48d7daf70a71bc2aa97236615b6411e28fc9a652145 +d = 049a91d320783cc70a5952c32036cfc75d41f1aa84127db2dc759fb291c +Qx = 190528df8fc3ae4db6e12930f176ec9c833d1668ac5808f1046366445a4 +Qy = 1f647d55ce80b18a9add47fd1a8e4aa725297d9da03246f5c1ce503dd56 +k = 01eb80e2596d6c01431e7a4fd9e22903ea85547a31d675ff157a789a137 +R = 04523776d88199ebac2f96f9faa434bd81bde770ad4458ef126fde9198a +S = 054665f31f92f8897482d34fcb63141a7539577037c84496167e9d3389f + +Msg = 89c645339ad0eb850e4e2fe583cee175b35feb02ed7541d7e9aace24cdd3939584f73ad39526de6399c86b36de77a018e2c70b532bd0f032f9137d10480acc30c49f9baaa86f9df0033b77e98b485bf7a69cb5c281e527d3ccd1fce2415f0dda4a268ce68a0a34b16afda54ed922cd6810ac8dc766df2a3a6c5e55972e9786fc +d = 016a20016602fc7088a60469843e1d29ad67e3c3cb9500b1e2a00d4050a +Qx = 04f157541dc3a8bc8a2ad4dfb3933039b67e331b7353a2fa9ede322f4ad +Qy = 1348a7b8c9495bcbecd556870715faf3d543cb8f2368805473bca17b82e +k = 01df1ee39217d7f0d838e8b2d30a1159d8003b06e50a00d637edf08d6d1 +R = 045d16826bbc425637e7a05b826bc907f7453c70141d1bbd2cda63dd490 +S = 01ae1703cf179dfd1d5407ba2b7324cc7cac15235ee9c3756177444e122 + +Msg = ace14c4b101d2d8453c2bc22b756af016b5de537df9c3e639d208ad04ae0bf6232dc90b90c33228dc85de956db771ffde05fb4d0b15e4f218ed2771d703ae5bf981252a5bcd60c16f14483131a481cbe04dc0adb1fb8aa32cb48bb5008e8a8e5c7b7465be2fd7afbc811cf5ea6293b1a464669b49f55f57b93a8707e6042fda6 +d = 00ba922149bada2551b7be1c3df076f3f97ce93c13c50c285fef3f42363 +Qx = 12daff2cfab994b9d1d1ba73bd2f8e7883b2d92f760b0d16351ec125fd4 +Qy = 115666f7c65b95ec2d713c5ab1a3eeaaf0f931b1859733416c3c778aa2a +k = 07fc7c9503fabba0972e0e8892ec6331e0812c6452d211c5561fde79048 +R = 06477ec9d8d8d45418b9efe7ae47c0863ff94c43d8f392c079b870a7cf4 +S = 06b5a5d020b3d980b9d7880130802435ddb4e7362e36a70d193f18a7fe6 + +Msg = cec2ba0d1772c87e87d5bbbd67220692bea4301aa1a66e8dbdd7e651d45c26dc2a0d45cfc32c34d76ae3e1c61db7b0fe1863457b93937d929e6ece7462ebd16adfd708353d6f7c27aafe06593c76da7149b0cc574a4290b0d8fe219f3eada7082aca38dba3f78ed0d5942d095fa5556fc8bcef331ff0a6d5d1f4e6c51d4ff5af +d = 02d635e12a58cc6dea44e71e87c37f91e8d08659f0b7955d24f65ab55ba +Qx = 1dd33d8224ffe63a32f2de5d4fcb0e5f1fca7ca2ade5b35ffbe75cdc658 +Qy = 0bfbe9dfe13f99258c787af82631ce2133dc73207c579b29869c7463943 +k = 04ef333049c575d6688aa04f87a6162185e4a57bb752a7f903e3aff86ff +R = 01ade04af08ea1c1877779fbf6335156b1a1437f3e449f07458d700c67e +S = 010fa82467d39e5ad51cda8fcedc72ee6a78dccd0c90544814e53ba9cb4 + +Msg = ffa13cd0f51ae2643d5d4edecb493ddd653e9faddcffc370e7e958abf726a5d67a2ab36cef42ea8ebe22a6f01b9c31f6ffad01e6894487d979acb5e618f765ac0ec3550ac5dbbcede8f9fdbe52fbaba5c087ff382b6d7a09b2b5084227d324d98ff98793040884799b96d2ca593201f4414f18c43b51c53c5e5059e0641aca02 +d = 0073883e5064e06814fc4de32e15f7a6cf825d2daf6eb1df8c83e25d80a +Qx = 00d3c79d627ee0d2d88f2de2dd082112c20dbc5ed66089454f7b8fd9f81 +Qy = 1a2580e779753bcb023acba1b0852492b989c767f664c7047de8e6689fb +k = 020231e05166271f47a91dd883c580ee313e9a07195ae511f0ee62173ec +R = 0303eb4a0df97577c4cff531b3f54aa282e76669c0c5ebf4c9779c9bb82 +S = 0692432a7dfde09db7743f08130b3d3327dd98cbdc323627603518f70d7 + +[K-233,SHA-256] + +Msg = c73e3dbac9513d0361dabe94071faf03a11cba18c06d131a172d5f0125b01a5eeb6055bf72c7106fe3f4be3bd2b1771cbe7f85366dccfbc3bac20538510c3f51179cc540ddafb2f3b05a0d276899674ab1d7d8fb4f6838f04e4f9e26b8c6af31540f63f4953c85840af4c57dfa78c704f637dfc8dd750fe45e2c1e149986d127 +d = 01532271bfae8d4dfe60f69b88d3006d58e28aacfa701861cde8d624db6 +Qx = 041c1ca965338976b4c45c28b1cb64836b3b4d3e7ba2b1323ea26fbcca2 +Qy = 1a177d042fba7903007db122eabc459e37c2c7fe82e42752b267fafe4b0 +k = 06a54894825644901baf2ec3681ce5aaf93a18757d93ec9cbce7ccd9d65 +R = 03edb77fc7686b520493604db18fc69edb4cad8195a958e27ef289c4bac +S = 004337ecfac57abb9271909aa43ff4e32851df7818dcd87216d051189c0 + +Msg = d00dcd0f3212a3167403abed91c20e76f5e7a7678a4fd970f944d11e6a8cd149d0aa6fd3164c5a74c0f55193a4fa3d8ba6f99cabed10544625a7bd92b3e0b46edbd4a269bbc10518c5268c3910a2aea567ccd32d4c7a0cbef09ea42c20b636d1f711d220e23dacdb9d1146e0494401349749e5ed88e38295232a7effbae3aed6 +d = 0550406c0db882c6aee6cf3b6baf377375208c3e90cc44a067cee43efcf +Qx = 073348eaa8f2885fca3baf31830a2b28bfe983e3046418561f62ac5d247 +Qy = 0033de5aee6d0bd4de286f1de1e80bf72e5e17083032bd4dc24577b6d2d +k = 05c0e7ad0f9bbd522c862326a5734a766423fff7efbe57c51c315fa574c +R = 02103f1a0200883850b6476c7d7e7d2b3e2f60923d028ee6f8227b1ec48 +S = 007cbbc3c6295ceafb3d9cf8411f85a045b11ef8472c5ed45346d26192a + +Msg = 3d36221f87157ca4db84884b8666660c4e2b6af330480c516cded9f3bfe132543626a39bb6aed1964eb5c33ea0b95b9841665417679fceb95d199d55accfce35dd3f2283c1a7ced57d0c4b9ebe3da6e1ff2f979b6440db27caf9f6a4bbfa47e20d29ae304f4d0551fce9cc4097eb2fbedb9b24680bb17d207bdccdbe799d5b0d +d = 0257dc63752920b6854d6c2d1cca68589a38418c3d036e73760a12214ab +Qx = 11a42e9f66ecf030d0446cfb751136347d4df0ee4e031058ebdcc04df80 +Qy = 0fb7161fac8cc5ad7bc4477a39350e419776f76f184e28abce886ae9cc5 +k = 00391d36c4044896ddcd68604d5f677d1df298f46abc00eb12f1165e8a1 +R = 04e19bdc6755a603085b66355256bce98d5fdd49b4f06b628e3e185574a +S = 07697b29ce5546de969c9c4bbb5ea65f712d6cda3410f3dbfa0cd5b1a8c + +Msg = 033d82a42d0eddf58fbe3e91ddff7190e3f9fc2b1e2eede977d2c0473b358b5fce1f981ca6f88fd61ce2f79e453e3a2b77d1baab2b970ed28d5dcff58873a620e195085e61c4b8480d829525a1a944e8a4b63352f0291f0311f1f98ceb262804beec1c74947618f8e3b067866255878c2502966cefcdda4f5fa2b13d92ce7840 +d = 029025352297a7be850f8852411c09259b83219135e0e8949c1bd5b94c1 +Qx = 184345e37f07077cc8df5947c1b1fcd8404b3c31586d6ebd91b240cf42b +Qy = 19dbc9091a5d282fd6e62c34676a06a425e098567b990c47e61ef14d77e +k = 02b2663a449ead3f8cce2459e04cf84333376624d994fd9312401ae57f1 +R = 03af223fd3a6b6b240e59dca83ce2477a577494438ddee3fd09632ea67f +S = 0606576d89f2094572f0bbcb58a15d9a4bf10ae3667d4e35cdd8da32102 + +Msg = 671a7c81b64b2919722d7b258bdbd90165bb757b53106e0af03d0eef27452942f40cf52bc95cc7f6567df2613cce795f8bcfc723b2735efc35375c001d37c58480d89343697146b524835df3dbd333f7c06c98e36d3c4592ecd1f34ab57c341bb0f4c785f5b8372775f74b4bce60763fad1788e77ea158d735a64861320b36c6 +d = 02dc82d0e69e498528925c0e62a13fda9af8cefd047c10c3ffc2e41da3e +Qx = 0e5463926235ce53a85b489c3c278320ed986003962a5fc7ad4cbab0d9f +Qy = 1453e6edde95670a4653186ebd8246c28a94dd84f5a669bd3293176f1f0 +k = 034a8dfbbdc98bb1d9b175600bffd866306dffadcc4bbb6f24e7f918da5 +R = 03cf1407445cf1a619a280e139242056c23c58979f0b3f0aa7e1fc074e2 +S = 02e55f27593f2c76fafccb71493f14daf50073b35cc85f002528cc6d691 + +Msg = 0ef677f4799298f4aab73b7393598041f56e902ced1726af49657b6601a06186212e3ee8cd4bd33b760dfa2ea3c38884f94358d51dd479f2ccc8b0b352fa4e44fcfdcfbb24919d04e6ee1108527b8e8d60e8d1b467c30c18c5455e5835d483161d3fc26b4a67d6df9e3ddd9331247cb18450188752a1ca219f3396a872cb13d8 +d = 041535fff5d279bcd744b04e643458ce20b81df8a9e01b1181d52bb14e4 +Qx = 021e1227457be78e49db22335139a136ba290d34871f90ab5e6a8db6ac1 +Qy = 0df43b381a4d757864c39ce8d0b64d6a32e9e8be30f92a10a252d46a2e2 +k = 03019bd459b34133dc7331caa8976bee67f76db3a45b1793cb545e26c68 +R = 0025611bd4e3473aaea85228b2bf37eb1b4458d8166012aa098d9c1cab8 +S = 07acd38506e984fb7f1607b50837018f9b4246623dcfc9d7aceb486e76d + +Msg = 9290df0cc50c3cab6655f3a6de1f4cf613d9bc06ea7c99f38038369ff2fadefa57a3c7ae7940c1b98bb1d03503cc271f7a891bf38eec93c31dcec7892dfd2e1ab337bedde3e5325ed8d9cb7fa3096f6fafc3beb3a66cba66ba826d1032debfb4908cc9dded8c0099c85072daac4373fbc428fcaa9a6da02181ebc33f0cf926fb +d = 000ecfe580a624df66c25e87e7689fc3b471d205970ff9ab51a64aa12ed +Qx = 02ca7b9c98bb8106ae14a87d5f9f7ae1f99a5524992116e68af89da6daa +Qy = 0a2fbee769eec313cf3c8519d3f96167477f0f06dcc470408e3f637b6c2 +k = 044f065c49bb7ff0772d628104bc2e222f1fde42aaa8b9345d324d7f936 +R = 046301f3f07922d338d5b7d82104597fc50941e4bc0a15ab5e0408f9fa1 +S = 03495e335905b4842b97f00b344313ca7d6a4ff60cfeaa5d589e0a31782 + +Msg = 855c7be75fda372f062709827f333630acf28954a62a5193ff675f0dfeb63f32bca418f7cbdb346bf388d62315b19a592267ca407120db93d4e3d7125b867c4c4670b7a57a76f61734cead2caf2425eb9ff0a63293e8cd6defc9648257b401463f4533a2425e0024f1ea93365eeee3c6da20d25928602ec8b426f9b39f97f3fe +d = 013c72c73358ffa168423149ecdd897f0a5f75a641de008649f00134944 +Qx = 1c70e1b6c01477f95e718f193e13c093b101e9f16024082ac699ed6ebb6 +Qy = 1f8013a88264266cb5cc5bd38e477fe0a1aa49ae4a5ff94cb58439a7c1b +k = 07ad8a117f34bf2fcf7d689b8124e08118e28ebd172f8c220d57d3f0b88 +R = 012bc7d380192f2efe55625e39927ef799993af9451c662b562a239dfe7 +S = 035961b27e88d6731220f70e96d555f63853d14149df7bf6d24fc29441d + +Msg = 9c896f800281812ed57d31623d563377a5c725cec84313472b90e73f77d400f5d4fb236255741b73d46f7e5254d04099bec274db8a9af5fc7cc220d42cc172cbd3c3595c49ff74bfaab7b5e46c90855b611f74753ccdbbabf92e011d52e9ba753b83ed2a251a632e1bd5c6d346e38e743950c8ce0f394a837028575fa44bcc26 +d = 00ac60e2e70b7c4cda64071c7738f68773c94df9456a8ec3bbb468fa7f8 +Qx = 00109614a2ca27b7a749e53777e0f3ee2f57013ee83ea539ada6d98d8a9 +Qy = 05668f4b27213a8a024455b398de2cd7635cb620d7401f5deb4fa9ab2f4 +k = 00098489f0966e27555268a94378b7b8685ac610fb0964694aae9aa716d +R = 06d151437a0aac232a472af038b0fac095d224ce0e5487510e30c31d605 +S = 0563dbfd021c1b77f980530d0120e93c9ee4f1f092a268bd8aba7d3110e + +Msg = 139a14ead998d1a962fa47c47ef2953aa136bd912fe940709b8c560bc2a0c4bf8f3aab30a8e21b7d5f487d30b0097e3da723f11b5cb4e8c5724f5a2fe0d68ee4bacbb85e5eacf18094d2a8ec4506cf8497836a4a905059a998ea750adc54c27c69cbd0b0c1f9743a62f3d988f3fa0a9865a73fc071f526623085a2ef12838888 +d = 060bf720052e8b9508a801340c213cf53bbecf4975faee63d4b44fc647a +Qx = 196e37671def44b35c9e8c719130389b40c7ebc0ed5ae354dc73e0c40c7 +Qy = 0d3fa0a45a3cc5dfb61085290f6d18d710ad5d0d3ab31ce65b0e6915a72 +k = 0729c7e1de10e92634857a65a2ed75103df6bd4bf63b1ad6383c37a0435 +R = 06808491ffebf088476de7daf541bca3fd943d4c2089b848a130abdc0d3 +S = 02c0dcfff06a07e928c15a1fc2aceaa4b4dd6fe8eb67ccd4d01240f249f + +Msg = cf4a8e754b23d0fffc1c5c80b0cb11deeaba3064b315bc2cee96db5b9881baf90d30af4b69066f757b3020706def77a5fc1632d96bafba22a9c8cd3b52d535d941b3c7cc02b7fe6b51639d5e2084478ab3a29d2f5e0e16639fc2833a47b58e2c3fb5b2ea1830fe2ff68e571a8f281617a23d9a28db1c64ddfb1083d055030e5a +d = 07cf3c216592febd8630a478b5b3e3a605084020322adb13ac0a626bc7b +Qx = 08eee2ea13a08d4e4d71ecd2547f6d80b8f88879c9edfab5a675831fef2 +Qy = 05117c0d8a0442ad7b95cac1a984dfb9efbb7eb3c3866955da60e6cea8a +k = 038de0be25c23cbde9ed9fb259cd9a06b69bf15dafed723970dfcb91307 +R = 051c9c5fe50eb81a11c8e7b2db145c6b5dbff2c51def56f4981774c357c +S = 053887c6cc2f21bff461c9182c17f634ee2b301c3cc4af0bb1d3075f74e + +Msg = ae64030d4af9b36c8d3a6af0aff34e5ab201df04274691fb420b7d5c40c401ed7f3ade96065d34f2490d17943e27156e7bed83cd7222d0d5a73d167855fbe7ff6c3ed87f20986ad8bbbd80fed5f9705c6c783b423f641d40ff1f367f9648af5a79ea3cea0236997558bd9dcb011ea4dc64d61ea1e1f85b4f696ed586bc7705be +d = 061eda5999e5a9ed4485d2a0ac5510549b76ca37df858ea5d95aeed571b +Qx = 1642d56359cc0a5f261fdc405030d45b0d6f9c08a182d354bf2687dd9d5 +Qy = 11bf0dcbf62749a99e4b02b284aa7a6479b59b363d25319a5315423a589 +k = 03094fac5381a1b31e53f43a537d9e22ebe6bd2c149f2f69d792bd56f53 +R = 053c8c4f9a30e0500e01100bb97c00ce98f5cc6578686daa1bdbd679373 +S = 047086a88ea014f06d6345608bd0a6010e650b9f6f984b6efea9a4fb277 + +Msg = 94a9d9cd9efa3e4ccf2a37f904dd9cab5624ec9393cf8816ea591c5e70cccd2f105388ae133708fb974998ae61d218c71785f9eb808d1c28d953cc7eed00dd9854b6b4568c5ed5ee3df3b58a1e04c64f1c87fee4365ec9aa41b08a6bae234dc43a0bf2f61420acdb891a40f17f246972afee75a4c0b249dee0fc8f9b9c8a243d +d = 07e7e73171e4d2f2989dc024757c186485435b82544a448f5cfca05f281 +Qx = 181c8cf579d9259020461184979757b097d5a94245a2b9a1f8a6931ee0a +Qy = 14baf1b761a0af3dd9c0521c6489f9a778da824283c94087698daa7cf78 +k = 02b57fabe6b866fd25ad8802c6b02b680c137ea9b623457b35a24d5a5f3 +R = 07421dbfa83859354345b9c3f1ce6242605094d924a4d38c7bd952e3910 +S = 05ee48a3a5119bb3433b53a625101492216421ce67fc04dacf947ec600e + +Msg = 4db998df7b90678b8aa4ec6233c9b4629800ad1f3e2cf8f7afcac62fc6982dcb290e44587015eca8dfe77dbb4a80f9bffe75b11e961e70deed14555db6dae47d49e73004f000eb8677c18f7e8234bf0a5a104266167a05ef07152e7acc2f0368b37efe69c0c2feb51eedf7338cf9ed398f066cf1f66bacd89ab9376d41da35a2 +d = 05f7270764a0444c7159d2db867930fdb0fb9fa6b8fc80ca02e11753095 +Qx = 06806c7164a09e11629e16608b7312d9d988acefa626fe8e34e03203d11 +Qy = 19c4200c9522618dab8a16e217beb3011599ed6cc09291fe9d451f0cf02 +k = 04a8958c80481a18c6e0893da9ab2d48fa6ae30a0f1d0512196e658eba0 +R = 01d301da51eccd15e09ce0bc2d0bdcb215a43ed13792084e2969260d46f +S = 031f96a2f322d27d0bef23ba7c457fdc45a6e612f7d13e9277d36c8def3 + +Msg = dbf9b8a4ae316bd2df0c80db1cb5d7038364a2634925ff957d7c03511b57d486274b2ecf191746827c325a14dc94daacd66ad86d369e3f598f176c4f0eadec7e9edd13e34043efbe0a801b75b8186b4a6d89ceae4fb250ab570d65b6dd7c04382738fe3f6f6c867a7d84b35b20720cb0036a5d81a87126f236833831d9ff00b1 +d = 0179b924afa4acf30ecbe2b3c12de533a1f9675687876a7e5e5ddc8e03b +Qx = 175bf95ac8e768727d3b4a74c2b8a04b221247a3b8386ddf35fc39976ad +Qy = 122f32f941066150c151b9db92b86f86a10cab0828a77e4f0d5c4026540 +k = 0210c75a63699b424585f65497c6e46988c28eff3e0977e3ade599581dc +R = 06087e46c0677e3ca64a0cf030236583935d0dc03c896685dc6e446d9e2 +S = 0252e42b8f03b085f38c6849bd420837d985c9fe14750a654b584c4cc5d + +[K-233,SHA-384] + +Msg = 986d9e5d636526f4deb7545c037fe81b09c74496ddb8e42e61650c74b6fe348593f0cf8f8eca5e839baf62f17bf6ad96ec0c71dc44fdf11259dbfe7499157e402f6bd5076972354150723afb632799a990c44cd0a4fa9609ec4db133e3b4700be3ea4a338e8ba1873d345e80163ed60d0de274d7617a8382980bc2138b0a2a01 +d = 02c9eb4d392d7f2eef606e1861183acb1fc753d666225f0f154d9eda147 +Qx = 0d58fd7b5aa570b1c4b2190ec413fbcc9ef44d33ef191b6e23abcb38690 +Qy = 173e85377bdd8dac58222cd1d0f7ed98d73d6fb6c2eaf34819b08ececa9 +k = 064f9fb13784c99185f334700ccfcc4ff60b7f4d613c3de6dc5d1b8dd5a +R = 03bff54e3610ade656bbe002867168db1b521c49225eb9662950b01955c +S = 01da3fd8c08d8e17692059c669da3c7c4c146df6d3cbeaf34598d28eaae + +Msg = 68d0be2883598bfb1433886aff118349157708690380c42b8919859d96db069c7fde6e117a3669f2cff94a0f1b66b27b09e3f1b24d26299e11552a084be428446f3174da2e0414655bdceb38e58fcb065b6661190862db39c6545dead34a03584632e988d0459659dc7c7c78d4d00fc2aa10465cf24b2410f14e2a62173c9962 +d = 024661c89b77b2c743cc175a6130904461138ddc4ef771ffb9fc2c8679a +Qx = 090383de7ca48f1e71a43845565a9f0c53d2c9f8c2e0f6c4ec7eb6437fc +Qy = 1676582272e7ebc9fd56e1010a570d744ae4fa70eed3e6eeaeb0e0eda7c +k = 05cc5b36c7300a1cc3f624e9e663861b4e296f7e7a27e8f8f0a2d54eecd +R = 039c6f5b484411c434ee161ebeda7aa21b7bb26bde0301d9ff92921337e +S = 02aaae737aedecfd5d53af56ef154ac6430a45ff03a3495a34a5fe0e97e + +Msg = f0ba0407485fecd7337f4b22236533a926cc744a5f06dd08276750196f1bf7ea7984278f789f92dd07e36895a8bfe297ea43d4a1177c0368900e3b969d3083cbe626f0e27e7ab38e185c923dff46d9ba187b2acb9cf4b23ec8eedbb8044b96b5263d956e50cd6240c66d5d96517130c743752404ed09473f05d0004dc5971ff5 +d = 0065e20e5ce534576d7c17616cd4ede3bf4f500894850723bcc9f895f4b +Qx = 01413f6dd5349e94311f1d25e400b69c0f0ea446294eba4bbeb10278b85 +Qy = 066a05055d856621161d4f0e33dac82e5c0cd91ed8aa56e9abba9ec80cb +k = 07377147b59dba008ed0e6b366e511f94c7f7c9088615c6d46f46736b97 +R = 05515a6bdfde3b4b78489194d39f4bb439f58a6b3c3f9e16c8a71590b14 +S = 00778f79083d11efc8ff959f607c4cee7cc8f38b855028ea248fe291adc + +Msg = 3827276694e413c886129c452c9a66e7d09dee84f5f09bf34e4baa308b4627e096c7d45cf6ef45ba1d9a4019a60399feec10fa80e333e2aff1251c85ca48574d9b9e1affb9666828dff5afcef3edaf5e8cae823505a0c73afe76c1bf130399fb06b092ba34ab0ae15ac6c682f9ee8479b065ce75b57213b8aae0f55e4e386de5 +d = 014c85f66fbbd653f1e4e590cffe62c343ba6062df4b271fbd02e5d42f7 +Qx = 18930b4a59a1c0e92febe650347c49e29a4e83cb8c507e30ad835dbc94b +Qy = 0a237bcd130235e34b4439293f15e7a3913d659089e38e5619fa52e3c0c +k = 03c1f8d076fb4fbea91a97800607b2db3fb5a45149c0d30dce79f07e963 +R = 04b9d2c66d8cc55b64f3f62dc629ce8e50ae0bad8a4d14e8b6567fc87e4 +S = 00b9dfdbeecb061a455dd052258f3828d4b7174af972c65bd0043a9776f + +Msg = d1afb8965b48d66b9acb1ece674d9548f83395275f2d8135554cfcc7ceb96450d850dd874529433883709483d0743798db5e0dee955a4f30ba328c7934b8dd9207f3c336cf89141a175ebe23d2faed629eb4236a8aea8300604c3eb7704512f240fda66acedf1494a85058dc6a31bf9531958c332b93cfe5545046876c6b99e0 +d = 030ac7a78593b570b29f6d3d267abb6ba7e5870ee1c8ee4f1ab2f141051 +Qx = 0a409e90eb4314f95967607ea3de9817a0fdb439cf406135262624e7fac +Qy = 04b1dd719434e8dfa5861887736f32ecd635878ed4b9e290c423da09059 +k = 027c4987ff872fe499039b4432dc889960ea8e3f07be42e36a5827b3964 +R = 06829b5e02b5849689d152ceacdddbfa8f68d782b3ae8da23ea48b1acbd +S = 03dba0d2b4400495ee098325ae4450b32b83689349e82a69b799dac2cbc + +Msg = 4f95b71669fdfe5dc46d4b951b085e099de349fc740535175337127910acf24e9a0e4b2f23196ad23880da47b740d77d74fe9bcfdcc44dd7d8d1a181ac290de5cf4da22d5034cda3d8020bcc776dde8cef1786c9ce4d2c2cfb035da61406af745efb7ef1a55f2eccc5000319cf1d6380963025dcea641cfd15a3106751fec286 +d = 06d7516aa040f7d559cae248e485834e8d9bb608279ed4d4f7e1dbcd2b3 +Qx = 127a92888fdac8d4ba9c0243c9aca516bcb431911254bc2cf51883623a1 +Qy = 0606c30fbb9958fb1140643f32c5dd582c2319f71bff197d58ba3e598bb +k = 01104b6ad82327b0445e75cff0efa1281d266a9dfe4019ba2ed22dd6976 +R = 01f247b2850463e362ff8879054d3459b2cbae84b9d4bc005a2ccf4736b +S = 05b3dbdf04758d546e54c43ca5973bd8ceba646a4dd5d17ae5d2f8ec516 + +Msg = 2ad9e17780c824c4f2d1e1cbf19ab85638f2f71cb4fa3518f08085b8b358f54d4f08394a5ac29cbb3cab828c5f07f41eec51e6cd61a5f2cf44dbfa46834370cebdeb328fd3bf681e61011b5c2ebc8945ac7a2a8467606051008b15c89390e111999255bfe28634ce9bc2850a2b55a4af1c4c2f94403c78aba1ebc87386ab7b32 +d = 0137050d7b455f43a8dc2516cfff5a91062c1a2727b27df41488f3dcf18 +Qx = 15ccc90a5f3906469e3ecf7a70c429f5b50fd0ce74065d41f1bd6dccc1f +Qy = 0fe5611b8b1b35a907bc188ad2b1fb7507d1043d148283911af3ad782e9 +k = 04881e879d7c76eb2ee61fe1844567316d7efaef047b96979e6dceb7858 +R = 03799e90bc64cfd7d0246a7fc89a4d8ed0399277cab2af40fa2ec8196d8 +S = 067e8728f4d8398e4e1c25775620865bcc2d4cfe635a1f4c6b7306f6d9f + +Msg = 958773c37d3eba003aa5c489f72118b3022c52b93399e9d8001695664918b86893f4922c7b6e55b1855ed0fd1d8de5dc61af403ad660fec60d7c44bd0102c069957ed804d0d416facdc1a95355ef58554606579ef89b1842f1055cfa2ae118abbc485356824cc09dddb77d0671cb3011b33bc86cac526e3f6bb3293c7bdca1ff +d = 001fd447b33a2ee3595b9f885c290d241422afdd74c3dc4981955a7e9ad +Qx = 0e706408803188263cb149428c60de57ac757f0776e5b27a2d5a859f58c +Qy = 153b5e13f17f0178cd90427f7d608a5659b9e03effebc89da65d59698d5 +k = 0339300c00cf7e8c6195ffb71e509613018e6a417782e4f52704026a510 +R = 0227c80e36e3571e1c783358c9ffed237b251332e8ed05a8d3b454c53b5 +S = 0679a32cee8ae001a18d9a9d0ed7e99e5ae67ffcd54de7b48c62e76ac8c + +Msg = 9cb2c496b1bc7f040228571e005e7e936e48e8f469e295edf914f5648701249a20bff6b98b5e862603dd9f12bb71c160aafe9df02e2e383e9b8a9a9d700f4425ce408feabbf754be543f52204c849fed6c9d3e36e03dfbd9e35c18d7bb2295f1c484a66e73440a0a5aece5fe80b9ade9321ef18cde3eb2db15e4b18e788b0441 +d = 06a061e10b4a6e7001d95411cb31bdea9c84670a59ed61b14fbbb05c8e7 +Qx = 00ad2b726b805919cabc90d058c78896d2dd8a78484c1fec5bd5fb0e07b +Qy = 07e048ddb487f667633d6d030338ded21a2ac5f65373ddcfe1e4a3424ae +k = 013b4a86b70f0e4de6efdafd7ecc993f0d6f231b3d743ee5adf82db1515 +R = 0541c2d3b2c6f0655dd415e327f0ef07b03356f8047117c41e704169698 +S = 00300f45026200b8cc84fd564778281bd1d7e03727c242a249d9ad33338 + +Msg = 9a4bc0a029e97742ed3bca207d5912cb568e4403cda106b00247520ea02008b14c041b8c9b976294252da835f4ff27456039d79d90315abcb0b9b6958a22352672e229665457ec79571ca80447c8ff2a86e6af3dabe7427c8bdcae65e3c6746a56079ce2cf8d22235180f46646a21cd9e86032cfad874cb9c67f882fb037a13f +d = 027ec31ca31acb4d2fbacb49fc085f1261b0042cc755cc97f9b199e7a37 +Qx = 1d521f7abc2fd3b0a10732ed641cc1b7fdd7b49cf61909b215220c5253e +Qy = 019e9095c67af1b89ae6c486c4f9889c3f2994743eafe55bd9eafe438d9 +k = 0151aa44fd97be14578d68f87dbb884c960ab59d950c392e607ecae6bac +R = 07be427f46958538004186d52aa50a0f83d184a9d2f4da2974163854eec +S = 029d4ea73ab5b336ed44556f6944e734e531a5c71dc6c929e7253323906 + +Msg = 8d89e22cf802dc68ff22d43c436c79311e705ff6fd845e77c880f399f403e6d5e9e2b35511553c978171189e288cb2200fd95f84ec5ee9865c0eb9190aff6dacf783ef200e82027fa992741876456472bdf27f2bd8ee55db15408c957a120eb64cd24d299818726a73fbb0697eba726a326719765735b37a2dcff0c853c906bd +d = 04c6f4d88e5a4f4f83196f2dda9dcf2a66eaf94d50c851f59bfcea1d876 +Qx = 1e2677c1305f545472e373615d195d1f7a315f592e26fbbf44c42558050 +Qy = 1638140f48bad525625a87d0e537db5500f034e71e60e8a8c48eea04108 +k = 02185d8ec6f35d5c3f965cd00597d93caf45bbe186d4128bf877ec304eb +R = 075199f4d8af090e4666754a7dac0c1599c207735c0f54c9f11e305727c +S = 008cadf59a224f812d64c2f492e7ad4a923f3463b878dffc75eca5f8fb2 + +Msg = aa1bf5a79e5339fb9ef6c2817bd95725551d064bc5064d6586c5a879901adf808dc2ef7c78ec3b434b84569988db58b5e8e9782b1cbc2cc7c9b68e66f32d4ac4ebe7e75b345f654c7b8a5e650acc9f170f75b7aaa3957cce248cc69cf93faf8d72abc6fc1cfa9ae2d18a7b31ce720147e88e84f6563b2197882fe302449ac5ce +d = 01aa169ea84365c22981bb766bfdad27e373440850569957544b0f9332a +Qx = 1f97d91302c70798e2278348e36bbe01587e0031ac3c422141e3d4c1504 +Qy = 0a95108f6b7ff41546c98f4ea4d1b587a3280e49c6cd0d33abdebf9a1e7 +k = 03c9efc0f72d88168c2b1f7fa1c6e275839303c2bddca136dd19ef446c9 +R = 0639d1a1066465b4b2f443cd9677cfe3bf5bb33e3e9b14cab2d37f4a859 +S = 04582792ba78f782f112711ceaf36f5f0774b92a6fcaee327d687658835 + +Msg = 475664d5e22cbe0da0d0289ca9a666a37270dc71c81cffac91f6229fa39315c1d55f7e0a89b6a7a07df7d391dbdf8fb7af63d2da46ecc3b60110dbcd842da97f98d2b67f562b0364ef8e1c589519024177c8ea079794f271f6d35554c0e9d0a39062383c95721b72f4e74eaafb6fbfbda02cb670a7c4c94f67b8ebc6442e84e3 +d = 04a665b92c0c33a3f8b9eb4b0ec061d40b603de36c87096455102ffe57b +Qx = 0f0ac5238553f0cd74e6f34f7f82563cb01138e5c9bac6d5e7b8b7ad4fe +Qy = 1903e9fd8a5a2aa32913b18bddef20667061f919f8d61a5b3c814ba4aab +k = 070ef25950a795b5e22fe4cf5402f49029c5d97cf9f57f0806c0bbb5855 +R = 01248dcf1993ac2eeacd062f853ebb4b2072357e728f0589258399ea95a +S = 069800eb2e2b3a9162196dbaaf67cab4ae123ea817f223acb6e889f6d7b + +Msg = 9e5397d94465390a82a3c07e3ebf21b515776d18b4463aa5810e6b2f96ca61e92d13e034fa853c3fa45411f51f79df6f799a2c6906e6a5b7896a4576a4464f9e0be2b529a43e1f503fb640d79db6b68f3a3a7deac1b5832fbe86673784ff6db1f8438f7dd332cdd1e7ad9df8b6731aad1b6a72bde52e6bc62d80b8da57822c48 +d = 00531540d94823e19ab2b95cbc6e7492e1effcbabce875de6ba96f53aa9 +Qx = 031ba225249916a5380235220b9657162eef43d59ccab507639e19bcd6c +Qy = 062e85d61366a73b62255c741a065708701c8fa024a15401a4cd58640b0 +k = 05375df0a23646e8033ec9e3ad269e7167a663b97b4f52cf18fbb5f50f4 +R = 05bdf7d643ffde5ea191553a9c99eb42fba9a8b6e2013dcc520298d224d +S = 06cdd9e0d58bd4c5cfe66589ed7c7d15331f3e164dff562b6971af1a41d + +Msg = 3cc4c4192f317e52df6f8cefba6d4cd823c942aaee11b9a0ef5de5c2d181073b7085a55805e9554def8dc13eb978e7396044d4f4a14be2c7605998c062095c929b9c23b2b1b2fa73dd19a0c0af44ca4789f9841fa62dee8a5f91b3cc4b3264f5f67334c3f0772b30bd7431c3fbbf1f34318ce1889b6e8a76ce6d42079a451e56 +d = 022a89addd8b85809e87e0aa2c038593ec277054842854de1197833a51c +Qx = 08e760b282d0ae4eeb2fcbbfdec851468fd8e04c4dec71fc2d5d3a98a13 +Qy = 0849a56b9b0b0a1ede6b9f9522685e7ace3baa57f72709aba705814d138 +k = 05515b025d6196ffdc8bf275479d72b29a752eb3e70ebf07d4c4e7bf74d +R = 041902f9b7bc81d3a88066b03e4111ad8ff4d99dd868d5608d1f43eead4 +S = 059adb96af9f404d2f04d89fb39cf38ba5689f47bda749ae9aa1ecb097a + +[K-233,SHA-512] + +Msg = 72cdef5bdf710978e0aa334b86b8ff4a58630da314eabe98b4d611aab56f55c526983d54d19bbbf9ddba30a84b18aa0bae9f9503e9b222f842f084db83aa39625403213ca321cc0d9c8a136c826e6ea4ec108b913dd0a9ce9d5b8c7e3af53c3876e56a2037ebd6d99f037a097111c837647bedfe4c494e4288ed6427c15969e3 +d = 01df252a11ff97b4421b3a2361db94e908e8243cd50d9179f9e03e331f1 +Qx = 129f011fd5fedf3526f0437ae800a110435db907af60e16912d58523202 +Qy = 08026ed86afa7ec80277f322dfc8cf693089968ed9ceb8c95c930415a23 +k = 04fce14bc83be6f862f06680a32e9a51d1a569fdf1d9b10a89eb9fef4bf +R = 04d7b8d19dd9cabc3c2245a9d2c8431c3151eeb6f49676a865e78c26c2f +S = 0373e69da1fe35ce41ff344447fa7ffe6fc71e28dc68244372745739fc2 + +Msg = 8e4eb88c0b2d525b2c58b8e00f32def90e6dd382301de49e0ac053dbc6b61afe926d85193e2c4948f7402a3d7c614cb2c58e060362b0516a1ba4a7425f1b3d09aa20d4c3c8993a387a3248aeec51e6efa8f558dbdcfcaa13ee08413227c8351e3107e9a3e3ac124224aaea91bfe50c11c1c8ae582e718f50bc5d5c06076517d6 +d = 01d7125c299ebd0dbcc050f07de931c7ad0450af590d0a2d0228a66ac5d +Qx = 13ebde8790a113bdde87c11ccdcbc39e354b193d772921b86657f53f74a +Qy = 0aae910b0e22f1a2505f55fef2eae47ab6d47db6e49190a5469b4b6dce5 +k = 0113d1737bee59f9f477f71f77a0ac1aea86aa67002c34a1b31c421cd7c +R = 066f9871da9a22f07c9b2a44fb6c01ac74ba17649cecc33b729afcb488b +S = 037fad90c288510d0cd8e99e5d930f4fe197df779dfd6088da48986c601 + +Msg = 370fdd80f330311dbb3959666001bba61cdacf20f72f78953d946fa6cba02d24b5003f5452d535609e489b9434f192011f99f918defe877d51349870e7e75502f61145f7c261dbd2a0840926d824ebe9be3c5a77a3a84340aea930378367ed3615a47e3f792c7773f83f91ebea718a05fc62e9ed1d78629b2c27ae44fe8f8d4e +d = 021238e66119844b146d40e48341f522f6ac2f9c8a0b33aaf95a3099a41 +Qx = 1dc3ac1ecb670f867337b752cdbf48bed9f32589366f7c6ba7424af1d66 +Qy = 1e3a38ded8148bf45484ab6b77e0beff759812493347e32d2d54a322a2a +k = 03626adf8e70506e74ea27ce740f7eed1c8b37d50415be6a2681c67ad2b +R = 07a9c9056b51f1fe3e7733c6f54ed96662aa7f5a08a961f91fd6d0276df +S = 05e7600e9fda45bb966fbbb5a9404af961058a128824b6d84d9d47ebdbf + +Msg = f86c4433787c3ec3cb1663389ccf53d62f9425274ccef05fd14b1b8fef676208867764eb98d16d006ee6ebdc27b8d9a8ddd303d941fdd82b630694cdc698bbe6bd524411907834286c94b24ee199fe6d646064277f244b7df3ea2d9d52a9dc6a33d7c8d6dbc919da0fa987a67621ef0829e48310e0ea2bb86fedcf4effc0b94b +d = 015e1bdfdacd87c42ed439f3e243abf27fd42e54f3ebdfb47f60dbae5fe +Qx = 0fb7fa51c1a96baab65fc85c3b769ac84ca7b63a1fe9f507a2ee0c49395 +Qy = 05d450aed449f8f1aeaa9df0131f696c2bcd4528808d2f52b6a73f72811 +k = 070ca3f5dc30c70e576e2d2b30935b05b6e68598eeaafa1bfcb9e156e05 +R = 07e3cdc4207456773aa52b44156801b316a7ac850b3a9e717a9ae7fcdb0 +S = 07ad6de3ba8730ac887f045cae80fe2fb5237a8594e7125c4792d478594 + +Msg = 4117d593aa92e3eae1124ec7482737cd3573fe5f0f2a5051a7ce86946a2abb9e47a0c6ea75b262689b0b486476d2ab09a20efc2fb921419b1811b51a2e15891ae9e45a17ab4b96c665c6c423fc00e2d66df5804a164f0f3c958df6f25d7da6829b1fe162a0a8cf130858c83f3555d6ad627db70cb41303cc6380f7b3fed2563e +d = 00e09410548c17bbbf28a68c3963a52d39743a4f1ac28e6dfe7a6ede281 +Qx = 1f5f36a21a3b7fc5ea37528566da695922d7d9b7e6800af9c1a00f68242 +Qy = 03df4e2ba0c8648cb1fa19663f31786b850e6b80068b8c007f41de08608 +k = 03c0a2a4bea270eaf66adfb297c0e3213254cd87b11edcd90cfcd6f3104 +R = 07b684e337d6778f84bdb7a6835e91877b41d6af4b76311258fbb8339d8 +S = 064a0c22057a858b153ecdf4d275cf5523dacafdfcb46423b5613c85691 + +Msg = 882ecaff3ec8f4023df5397167f238869f78a5c499be19aea85c7486e73f66f0e08e71cf85f3f1b6f6a70796bf46a18e6b555a0a87c2088640ca73051b3dd59ebfef922be0372208fce602d8001681297b285701dbbe24ccb42541b5db4aac1a1c7f407e11c83db15b38cdbc25e930fdc6558f64d9503e214571a435d890169b +d = 049f5bea6e72d98579b78cb07d89f64503f8759dd7a73cd73713c120428 +Qx = 0974dcd68cd85117f363812a0473e972c89551e31c74c8d99f1073eaafc +Qy = 0f306c9051cf3b84803307beb3dc0d34a9758a4f535100e846462a49053 +k = 022a5564b468e706762e3ff934aa22d9aea0bf2b116b61182c9f7be19fe +R = 02e050afb84e1b0591fb64d46dd7d4a939552d68bdb4213f16c5d7ec5ec +S = 063225df0057d5368b2e103eb2181ff5760e6b2a9c13c83da042722c3e4 + +Msg = 99b3b8f876f8359bd6369ce84f9261581c52d744b90261a1427ab9e447e6d833b6b3e89af8dc770f1dd55692d01c8bbc4277a729fddfa7cbdb2ec99133201dde44ac691a77904ca816feb0a1aaacbb9fba85048bc63d73506eb908ecd697caf582747051a3a38ac8930c9a4365f407ed94ca7f2d26913c53f4c010c7ed9d7ca4 +d = 005eaa818690d1ca4838f0bc667be5721d178c3869884260fb230277c3b +Qx = 1f7b3b50167cb2ff7482240bade95f2850a02805742e6e29eabf7f9ad34 +Qy = 0f8038a8cffa0f798a01e333251996662bc3c0ee56d94c392269b63edb7 +k = 064d518f7b8c87325d8edfd42a52793d87ef8db283606dd676be8584562 +R = 07128123004a515e277dd5b571e31bbc877cc966e27ed5b2ab2c16e881b +S = 051d70485148996ec30f92097e4a12b5edf804e03e312072336bd912268 + +Msg = 8c1a83023930a85c5b2f9930521b8b8963d5523a3323d87f862a17d3505ccee01246ee1029b8b8c2b608772c4096d1e914cb398f027d91184a8e94e4feeae121eabb504a2a35c8bc9294edd15ddd979946c14c792ad787dc2d4deffa284830fc90b3f8c0ced6a99fc6de7c41b9ed261402a6b3d702ff86a9392731ecc37430c0 +d = 0603d89cd2f741d734587e77554fe6bbb1e5739d5ff73084d4de8ed69c4 +Qx = 122f2b7802917e4164ac2f54033621c78cbc7040217e5ded6b9217f95bb +Qy = 1f867df743e73806957066c2ab45c04bf1af158e146a9d1eda9e974e0d4 +k = 076850b8ca9e454bdb320da624c0dc63e14ad279185e4f8c9e49905666c +R = 04bc63bafd5bad022fe5db246680a0a0ccd0b50ff50482d3849c92eec7e +S = 07b6d8a8446ddfc64392af0aa1763d45877023c0be9ec78db47efd3c366 + +Msg = f3c9dedd7115339dd3ede7d8d06a44de66bf80b4888ab7bc386cd40a92789042440a13d2cc90dbcacca5feeec1e0e3c51724146e2c4904ed6b05c7b4e9b49d7f458ada695c5d2fc36f1193329b87c1268aa38eda9151430aa0bc004e5d2a61b9390accfc699f2efabfec785eb34f52b1beff1e4c5492e922acc348667d2a3986 +d = 07977b3aba53616dac27b4d74930da23966a88ad98f1769674789c0be3d +Qx = 0aa61b4bd2fa9c61914ae306d69d3ade7d6cf621399e5791dda8a054dcd +Qy = 12e8d9274d5593f5074c49ca34a7e2d64f9d9ccdf42df6087134b811762 +k = 03b8ee56bebb59207e107bb0c16938cab707e425f38b70f0bc918fc1b8a +R = 068502a3e5e51f5481aad31eb6614152f4957eef1becfe3a297b023a94c +S = 07b6b43be63aa79c10876179703b69caf9b03c5401b999a3c5be4737999 + +Msg = d878c4ee0bd6c84652d7f9e68df7b90cc78776d8d1b60f3e4d7465032bf401f1527ca7bfd4a3dd916e13e93fadaa5e5f20c9f47d12f8fc922a9a3aaeeeef294c221ca1adf7df85b888faec8002f17ff202da1be837827619904121167bee2d2cd694a263d9a99062cada3399dcbfcb283597a96ebec129c65e0850ec4cb4e2d7 +d = 050cd20e7eabd29008cc977d0a17e1195d79587b8f15ac2447e15daafc0 +Qx = 01ff23ff4ea1f30663b17d8f1c67ea37b8c5df7009d0c0301db483803a4 +Qy = 0ec6bde92921b83d4d84be8a67a23e1718e575101b93d9a800550a20e7d +k = 041ba36d2e810e47c3de583772e9b5908c257b2aec232d855669d4dae2e +R = 079e96ed1dfc4e31774159ef311805b5f8001203cf37a72921efaf5cbe5 +S = 00b8abcd623b17357f65ac365301a8823365ab948ae3f7fc6a4a0b8ab5d + +Msg = ac3c118cc9cbc8eb3b74d8ccc9ecbd81d1996fb25ca43c8a43bffeb244f722b93c9e969241d45d5b81fda0b399f1e3623687190e428dae077e54cad1eff75ec2f7fbb9434bf716833421bc2634885677579c237340f76787b2eb19b446d56c0f2206099b81493349f4db0ecad0e2dbe85dbff7d7070abb3d3b12ef0cec828af4 +d = 02dbb24fcaf9f3cd5d50d209937f0e2d134fa20ee3c9c2f1fff3dfbf302 +Qx = 0a07240c52e385ecf75525201f9810859123bfd8ce04a5e8f4dc4ec88b2 +Qy = 09bd811196ca9ac45b28031b9f65f9a5c4ec497d995f7dec6eb06dd2874 +k = 05785beb1ff70c7bea89b1fa14be09332ef94b09eebcc9fb1150bfe0d55 +R = 05279bb1b1ad8174e88bec4c723d65eda768c1d08d1c64c332a240a284f +S = 015a90383c2c40ddcf721067b3435915a843f9c4708cc133fd1ee53f442 + +Msg = 700313698cdfdcf0044ca07bf9e5f0702ece7cc66e35decb28d5f8cb7e7e5367a95cc1728a90cc9a53a2b5fcd4702028b742538e9b386f5d8b4a2411579ed9553021a95bd00a73f03c4184a6145aaa367e3af76659d677fe7a2e98f9ddf4aa20eb8d1a1db72c3f5590598801be7ebf44255fd7376d89d998b7068bd1296fdc38 +d = 0047142197d3d43fa46545b547968680ec81688589d1ec8d7c7e90eb969 +Qx = 179450d83cd6dd1609830ec78011143eb64d2d1509ed1adfa085a58d786 +Qy = 03ee40673ac564c6b5732868d0f8a57727150a23c484228890d768dae54 +k = 064f8892245a198c9c819152edc168e69dc7b562ef1f54dcc1960cc7db1 +R = 0293f2f989fb6b6e7cf304faf3f63eef61ab89a626cf8152e15f38bf93b +S = 04948643075cea6413b1c88a9bf11aa176611f56d027f2b165d00d46e87 + +Msg = 0374673e1a685bdee55504ce3cd333f70084dd4ae685464a16924eccea34531663fda60229166478b30193459a3113253cd6494dc26154156252dc6e822552c7c04d790eb9f8fcef2ea8dd79e72f881f7f20fff93cd73ad303c0918ec27c6486c4da61f82bcd55422d16650cc68bfd4b0132c1e7075bbf17dad919095860d445 +d = 031352b49ecde5434aac05f898e6ce4337304845d748f114c14319fe97f +Qx = 187ae6bc9167d9c69ce5544ad650055cb9a4e69c1772322d5722e68e7e0 +Qy = 0042187e9d11a921adafc694b5cc8da9226ddad1b65f764274954b17333 +k = 0761189e63fc0c3b5db92b281e5a4bc0d6fdb30bd14f8e69ca85a211bc7 +R = 0453560e6e725a2bfe0383884ba3b3dd0816d8522d9e0762f781f6b6340 +S = 01aaec4bd98c765e4830de6593280779d1222918d4acf08c8fc3d0aa351 + +Msg = 8b237085f135d6e94592f8d855ca397c8c1028236a3b412adefdac888245874f586d06950ee18118f751bfe26f4c31465ec34b578caa44cf1b7109ac4f6eab7f97ff9699b34271df035d3bf58a2ed4bcbf7577cf8e5792b1945ebb9389b680baeb8518c8fdc5540e192aa4fde0eed0d7c82be2e362b286f582d65752c8db7038 +d = 0176f124c24e4420f6e726a6ca25f09dfa0c5a37e5bf879e7bdd36c3b65 +Qx = 098c37cbd44aac5d5c749524b840fd849652349fb3e02cc8f8fd0a23790 +Qy = 151a9a88da407ae41e52b3dad1ea6031c7a36bd834007c0cb1e2c2f2f0f +k = 022e299985cf289f2fbe2b1b270fbf12ba818cd2b506f642e659cd541bf +R = 0686ac0c09f90a077cb446c910e07fdf23e845487d0333efc65b9b84147 +S = 01688b18cb42082bea69f18511b0fd9fa35da83d738763cf13ef92a119b + +Msg = e3a086ec15574f7017b3cd5f5a47ab7a73980f11074333490dfe9f8ad8926f9ea7c82271aaa74e77133b1025b0b22a6900fbb71251bb6549341a23d194e79d03462cdad52ee0d1b6f5d0d14e1136026961fa3467ccf0864bf7ae3fcc3b68cb35df7324bd9bbe58fc8aa9f63c19feedf19d935b71bf5981c74fb2a487f84e453c +d = 0755c48c3dbaf71042c58cb137f3632e3cf9d90b7b9a58fd378feef3d19 +Qx = 0bd9a720553afbfc5349e4a65a21fed0444c30304f7018ec1ff6fc8d1f9 +Qy = 109a1d6b9cc4fbd0e888d0a2b6883fd06a5da347c0d4f7882fd29eabcf0 +k = 04fedf8785c6648798748504b1c9b6a066ab6606bc9a69534f93e908f4f +R = 001e71744a1b683858444da0d270f43b0d5644424f2b38ef48a639685b3 +S = 07ff8199ffe723abacf1947a828e8596dc49ce655319087e4aca6ca34ee + + +[K-283,SHA-224] + +Msg = ef90f85fbda05e693006e4c64e1dac56223becaf0890f73b5274e6e289a5a1de2c141b825c24d595b3fd18ca855b5c1aa60dac6b5356275b11be670692cdbe5f282f93ac7b2e410a96cb9e9f80defcde98f3449f99e192bfd62040421a0ab8f99acb85369f25e5efbf81439efa8a5e1d9cf781355a0f47b037b09fe4086389a0 +d = 1e846c830a8ec04e8572d1a9d2df044ab47352fb346f67403a3bf87243871b164511c53 +Qx = 12e43e20941f2641154bb66a56f2e0428a7ad22d607fb8af658df0b382bedc7d5ae22cc +Qy = 22f226cd65052071066963b112aa302973fe2b5fdd7bb827d13da7634dd2fb9e3852ddb +k = 03a76f87ede2b5d40a0f10e15e90e29198fc3a03943efea39ddf7afc37ed4e18832af8b +R = 1be2c776c707098438fbd0561de578e4b9449f955a25626f2fbea257fc578ffa1bbbb70 +S = 1aeef69983da1a535b10a47e66d890c4413c7a8cd6a2511a1a670a4c573d4808f46e23a + +Msg = a3ebc17c867cc9c7c28797f6364f6574b80c7ec5b2d8e1542a6f5db8568c15032f92cfbceefa3fe4ee654f690b0455ee5d38dd84bb8665ffc1ff8c849bdbc4aa0ddfdbbca4eb37972fcbcee8cecc1aae21ec736ef61781716b60247b7551ec4e552d0b59a53cec5964c67cf7988787cedf769eabcc9cd5243f58034d96f0e43d +d = 101c5ed48231a56ca0ea85eb45de0e395e6df2efd4987a226ae36489dd8b2dfbf7c465c +Qx = 7011260f504d809baefb54af48c890f94fa5984c8bf228baa4b6ea14d46372390d1a8ac +Qy = 2bbfabb680659aa2611435c4058ed773467a41cdda8250f3490e4f491f1bbae452c5c36 +k = 12a3c7f0b3d64614ff97133873d75c7c1406e316e8cf60d22139dba462055baffe6c8f5 +R = 0a9933496d60716a39e1c3f3bf22a7da546eafebef80dc6f25d0c109ecbc430fdb3e80a +S = 0be56197a0098b022a7914c10f40207da58403d6c7d04edaf7efc96de740cd71f67e0de + +Msg = 60269efa4d0ffafbbc655f6f00578eadce7fc0a7eb7db923dca49b6f2bf3e13f7f829cc6133e022c3c92143c075ab9ced0531a91e6e79848194ab98bb852f40c84e7aebe71fb8bc0fd1f97ed5bb6bad6783d8dc048df42738e841d978456e055e1b8a781dfecfce2218701c7af77e7894ccac5bfff360aab0b6136b978bc39c4 +d = 019679dc589440b11f82b3716e5b2a2bd42c3b1c83e88a28e304cf5148877faf760b4de +Qx = 743ae04e4b07d154ca0749a011c97a31ac68d8e1da3491f331136873598896e5320ddcf +Qy = 776c05891c27fd912267ac166bc9acbaecbf80ccdd887aded2d7b8c2a4a5d139833aad3 +k = 099ad7fba5284e406f6cf200a39e398aa0426448c09b95e691f653d6096a63adbd39965 +R = 0285a82340d9a6d96ed9ad0fd0916216fd20edf979df41a55835ef8fafa00d242ef6f11 +S = 0a8548b405c171d2a428507f7adda4944bade7cda6dc580b1d3f94e15d7e10f0a08e008 + +Msg = 59d704d5b1f3a0605f1497f22f71b8f45b26138bc86371f00a4517554e7f6e7fa5d35189fc656ce68bd2cb8510fa3e3c3df815dfdd749b2b6ac997d443f3954c7a927e138b579801ffd035cea90840733e7884ccfe43d8d3a4a26b430673274aae312abe4ac1e1d7c67b73580fedf2d8de46572493c9205ebf0e8b4d75ccc88c +d = 1703c21fb1e09f8947e12fddf166fda6f685221fbd803d75a0ae377a54a1e494e6c5e7b +Qx = 767564e13ae544dab22c3763c5d330a5571e07ff8f2f5ba3fd729379709b1fb184f990c +Qy = 27f9e5efbd1ff6ac53a6174670eb463b12f70a603354e25c577ea292b13b8e5f022ac9c +k = 10d875acb4d0dc211a82e78c0249e74de16768003b53830bf5648cf911fef6a57f8f048 +R = 02af92243b9dadcf21561ce32ca0744810478f8d5be8e0f83d9632ecd8e86ff467268b6 +S = 1f6c50fb3bdea228a6b623be9e2ea2c371dcfeb0e604ef1029b6766c43b193d86c02f27 + +Msg = 12c8fdba3bc5f68e13f7ff8e7bee876fa68a970afc6924314dae0c2482763ced8d4752cec29ea288d350acd8a06c69289ae41ad345a1b88bcccaac903f2bff39015c289a8ad608606bfd65270a7bcdb5fb10c89bbc2d16dcb91fc9735d66103f6b1f3575622cf4d8209290315b033ee1f79968939410f465a2d37add46af2d59 +d = 071de8eb14cbfb88e61b908990ce08b81e624ef4f2cd9cdf3dd7ca9097d5ffed9ae9a71 +Qx = 136d50e1aa8203a0cd2c2d545b81d00b95c6b43b74b1fba3a6402abf756d38087affd49 +Qy = 46bec77240de7bde85ca4345f27c6df341c72a4eccd2cd495e86376c183ccb34f271cd6 +k = 1d80734927505d8d4818b3bdf1aa2e5c557e5f717a5b3fb856ca9a2161bfd74a130ee38 +R = 07894bf10885a698899b118f57e7da22222e3d187a0aabfb99fac0ce0e134b6b44a5f90 +S = 07b4a87592004d6ef8345415064b4b4672db2943c7e6098a9e6d59ee3324847e753703e + +Msg = 26013a3ddf687bb2f37d9700923906f118d5cba5d8ed5113a0e3e84cff00918125108f74f4b243e351aa5d07fa7c6ece29f5700f23e50286447883d2a058c3258a12e4ed8770cabe627ebea7ef6e8c77811ed7d9a19c53287093e39226236587ddbc63b7ad5e7ad9895c64d1d03ee432d45a067afe27d4cca920ae88a7a68db1 +d = 1d156eb15762ed00c4021884adbfc2426e910b18a5bc474268196f4b74e593a8f38702b +Qx = 0a99b45860615d7caab2f4e9bc01196a61f52f95c6c7fef615a4746d48553692d5fcf13 +Qy = 56f81a0088dec1382f8a3a863901d3443c8792cd13ce13a8f63b02d107b66d9d23bc492 +k = 1999524ce9525d85b562fd13634fd9ac50fb76d83b9d72d6976d6fbc47af7e1f354eee7 +R = 067748d49389c9b87a85b518f84f41b18f52569ba531985b8fe5e1f0cf9cffa958da3f0 +S = 00c44a583c704f69160c6258332f3121b022759b163c74c7c96058fa8e3a9928afee948 + +Msg = c4dbf70b9a2165e7279122460d05ceb8e43e03fbe2ae7c314007fe2b1d8567cac727a10fba5cbead0ddb167d387da8e8f3d6bc0ad851cc32885809d07a776fd4a95a979fe3833610af89df0f454d9edfabe12495a118fe83add5eabb2acf54ba7ba7c4be20fc77478c0a0f0726c4e60317422a612a234a7567648603b63f1c12 +d = 17d6eb1219cab8577168be86b61f372b27ca70fb1f1a767947895c185344e966db17aea +Qx = 65d8e43a290a6957230501509b95a208a6c37ddcacd1e882d97c73c38b2a256caef5e8b +Qy = 02169cefa6ce170ce20a0b5463f5bd146224e0813acff304307da88830b0777b86cd3d2 +k = 1519e37a66b4e665b2e3e59b8e836869a886c879aa1ed47901a6c8a8f365efbc67fb410 +R = 1734a8bc9a13f51d921a297bc6b2d38610c20b32b0adfd5efdd01a4db5084f3b0697904 +S = 0f9f00b25a33b166f09e2a819dfda80d87f6a2419a7b4162e435ee02c0fc10a669df6d4 + +Msg = b1d53b6af1face9b59af11c726b0099111d1adb3666209ba46b1744a528ed0f72be5a1b82423153b896384faebef0362343e2a4599803c08b8513708938aa8a498145fca1c63ba41aff06d1a18aa2a045fce7fcd7e5552a2b98d0df97b6876f06a9cf52a7a40fb737996adda97c3cedf7fe421235ac6951060eba9c0377e72a2 +d = 10ede9be6615b3b2a294d67da78127ffbf3a15bdba6f4fd78be7a60415b5d1a097c0cff +Qx = 6418eac385ce94c1982c216ffeb0b26f9c061ccdfd785ded75efc6a329385898331fda3 +Qy = 7d41f9cf1248a37fb8baea7f3545bbca707a903966019ad56e4dc810b6863e243968b48 +k = 134ac4de6ed71106d11fa736960eef2873223aa87b1c5bf5c823de6c78092cba4726ec8 +R = 12a37587ddf224faaf8dab61210310792d4ccef650c98155a227bf468b7f323575115cd +S = 10982c965331cf8529ef6adfe17dc3fde63dc2a557cab451d7c9408a089229e22b73d43 + +Msg = e78f538b1ac21602b00a09e3db243ef4803b447329c94a1476cd91a88ff790da71421b60092c8a6e55327c7982e7655eb1fd6e40fa9b9fd2f10107dfc585994dfc5bc2143d18794a39f7f69ae679b27dd11ed22040d5e93aa83f71783525a4db0c3fd7b43e57dafd0033d5317680df19c2ecaadcb37ef896c61a758a5e455206 +d = 14f237cface123b64e8578ff33f86bfd2a8181b9c81f36b9ca31e2a446f0d91dbbe2249 +Qx = 7aa347c03d8845f1566bbc3fa1d66ecb41ed1dab0a402405d8300591a1f3078f9fa532c +Qy = 63bd10274437c2690ed6df60ea632f3d4faefcc07a72ae8d85c2f999bafd373053265dd +k = 0570bf3b42aa44c11603d94e14b524b8cb1363306196924082ae71021707c3138503031 +R = 10f7f4af1c1e3f9e8e0c95f991c348bce6725f60aa12ee7b398be64728242088a469a58 +S = 17145a39fa4dd237e31a98daf3974138638b9462a31b87ada3eade6bf7f597195eb28b6 + +Msg = 8a6ca8ec436d2c706fcbec6486b5665b21c174edee7ebe108211c388b1219a8224179f7438e0bb7d6e41ac4a67337b52d4cd9a069fe6c88960ae20be29c8060efd7c62cb7a9a37136a250e68f253e7f27755df53ce7c570135641ad49b43507e5483e17b919cedffdc0d4913b1d5e0ca0629876c0a551841a0fc2090d2857cce +d = 08dbecb26587cb2ed7df2404e680fcfa5bf8cf6a58e87a350a1600211b3c844ca86daa5 +Qx = 66610ce348821a77e8a6eb74a675ad9312b2622ad2e1e6d8dcd0be8b27d8384844a7234 +Qy = 014c15776bbd144c0c24bf419237db9401fb7f97a7c4c0ef50a9afd27c3964088f79643 +k = 0204586a9314bc14bef8ccce8b9ca3874572b375d01c6b4a41c743c16502a27e91a9fb4 +R = 0fabfeb17bb8c1a57af7af81d99cfb7b0ecbf4e5e4a6ed483aee4be8ee4c70c2ef23941 +S = 08071e162dfeb068e3cad256c3603e07ae48b35f1bafdb726cf4ce32844e1a2181f23f9 + +Msg = 95bee02b423d2c6e60252da4632f693a2d8f6597b4f9c6e356f670c3a9e4e80063e92facb6421d0325b99dc150464ed2ec1d0bac72a042b35d56d33d2fda686a75d582d4756522218b4ddd25ed45503d90d3d185cba6cf0ac211b22aa4e1318a8316c369186f7130446dafad64f7966f5414f43af37a87127534060a23c6165f +d = 191badec2d28cbbe62c072c6b57eb5d4644d0c0b3283951bb66096cd15edd43a1bbde53 +Qx = 020224b00428031056ed370147c51e68ffc02e7fe269ca15b22310a2974d383c6c83fcc +Qy = 1686568fc4768158e75b4ef0427d8e262cd0638801ab158311749e0f432d5b69a667f0d +k = 03b1b6ca5e627f00176b599b68fe54e1b5a272c323a06b55e4871875c0e729c4c79326a +R = 1ade251b9360a6ca1b48c2fce0768a01193a415bd23956fee1e5c4c5076b3571abae082 +S = 0adff25020af4e2b4908a33ce1d75c793934921267b6c4a0542924300fce40fc0031021 + +Msg = ccd7f7c0e04d1ef9a3c5617d77480bc624beed6582bc28e9e3a369b12144fcd96b735ee41713f4173b64b28c6102d82dcfc7876e06e76fc497d1d238bf6d85bb5feca630bbd0c0f0fa7c0c72e28e9259087698973ac66244bc6e69c04deb22eaeaee7b20da239ab6333576f01349c76f594498620933b8969450ac2bae66db8b +d = 0ff5e3d66eb57fd35ba4472effd6e7a016ca461e39000a7125e99080f6ab6ef4380dd7a +Qx = 19d8c1d9aca39de0e627981d21e35a628c35fd4096aaa86f61625fcd078f0400f615cd5 +Qy = 52ba2854ccd64407f6779c5e259917b251c9e34ec0d95c05488f30802b82cf4b25b5389 +k = 16c9cabed653c57676ee46c8912cbc507b246078834f1667d0708e4c666346299c1fc03 +R = 12ac0ec9501ac91a2b57220e9c00ec6e815399ede94a658c36f9e89bbf1674316d65dc4 +S = 0c9480160c4e9db4e82b4ad26cb79e083e9e2056e68a2ea554aca45802bbb188389bc4f + +Msg = 65e9124a2606c8784c9489add2999f4cbe6186395df20838d653b263a207ec46995d2685b55d1874e7ef05a6a3bb5b60a7be6751ad568cef1bcea2debfc494d1e2ece0dc8028c88f1b2c6e4ee26b639c5e81f6448bd25b73ec4608a8e8cf4e0155c29b6f0a62781493b03bb7384c9808529d5f87da6564ae196a365bd282f46f +d = 1f3591eec4a8a3fe6ae6debe230d238a6b73cf3791cb735add1abee64239bb100f15166 +Qx = 483e7e2b8f7ff95b86008c3042ab83a4b6a48f15ce1cedbaf3b586b56ab606e6f23a4ef +Qy = 287cbc8c609426f1665976e8120afb8de96b43978762ed44bea5aa1418b9af6922c6066 +k = 08165da5f5427b38c447382c8dd0940c3bddf8f048185e6cad260031f7c0a2ffb83027e +R = 09034633dbd735cec6208bb6f4455b295b7d730c9301bbd1c0e9f101399f2b3425a13fd +S = 0204ec149b416ca3467e92194449cf2ca0f41ca1fde79145f3af856085b298149a3253b + +Msg = e793c60fc725fd537d5fd38e9b4fb52e268722ae6bde5a058de8d20db301f5e8d8e1ad85532198835a04b76f27ca3c972be5617a55677cffa8219eb64fe53ced242efe1b889990979227dbaaa15ed39d3b6be8c5a3237ebe12bd96f333d947f80048463d3859e34f865d83faf03894c2243a06cc96788ed952e606c2d8948271 +d = 05af03cdb45961e7ff35fb0146904ddd6c2bfd3cce814073d3aa56eaa9f13b4f7423926 +Qx = 70bf676b9b0db558eeb8bb94a1248bcb599d1e8975ee13cd37dcb78af19307d1b7e57d5 +Qy = 6ed9bf30c627062b99ff9d05ca03441b6194c34364cbe7b73b46ec9716ad8a9970cbc99 +k = 192c7b1fa8f221edecbeaa51447818474dd9fc89e962e8e87400938ef0dff432a6c4b86 +R = 1df1a4f9578e9cae8102aab5eac70eddbabe4ced99b5bab1b1dee59c41b81e392968c14 +S = 0f2b1319335ee497fe3ebf1891a71cded59704365774e1ed9950f79100e70950783bc7c + +Msg = a57682d21cebb48190199e9f57493696eae3a59acd22f64d5ef4729decf6c2615b326817a6bc118bb7234bebfc7276dd998838c009a7348e46431574638dadc48538d6048d572e50d9c5974d2049ebe1837dd857bcd1447b1514b62808a4e7a88162ae1bb08a0f6d3db6f25874c6cd0cd4ca6333f1bd57bd192ef67e4616d182 +d = 1ec9710ada06e6270720692a06d488ae2ba863b905dd2fc323e7ce68dedacb35fc8c7d8 +Qx = 5cda72b5b068f70b3c431def41b8ca1d4381e8c2fdf0821cfc17eceadf5e3eabf7987b7 +Qy = 79ae508354fe31899cda71e01cbc80e5192d24f1f13c954208d2ab8412802407ae3763f +k = 04f7b9372a8fed536396f0b87d4b20494786bdb8db77200c1aac1896486a05d3c940cb5 +R = 072ecde2a8f506f0fef273c8915a9edc29e440d48fc6cefb50e7117492fb4a13e123bed +S = 0010dbd6229d770c468f5d8bd20edd6928bd8824b7fc2b10dc45fbd3242191e7557b984 + +[K-283,SHA-256] + +Msg = f646e7334e191c2bf0056d3bfd23f03ef7f0777b923f962519a8399d311b8f68414c689ca34b96871fae99eb7ea534fcd83e788e56eeef817cbfe33677283c736b99bf6a626f9515291e842bf99f694e4e8aa7c9911c591a87d5f112b3d96b064594e2b368e6d1bf1a1cd343d54916a66da22c26355266aa2884120fffb8b94d +d = 0668de088c6913640fbefbe6d2c44ab26e481802dbf957044a4957c3c5d0a0fde331501 +Qx = 0d3a50cb9d347cfe45d2a313813fec8b928a9b1defca6ff4b89c4787717f275c6b7337f +Qy = 762e47b0669f625c39c74d50e2b46875ef366b7c3b005c16ede69a2fba161faf6b3d0db +k = 0b24bf54795fa02eb9527f21ead5497a6db2bcc7849a16d206239f830df313dfb7a2716 +R = 0852d8b6fe93b0b36af5d99530eed08669eb9a25972fbea59f32dafe88b722bada98ab5 +S = 0e5b08d410f2252f724dfcecaedb37b92a6c09cde646ff6237007f4199068f945ebebe2 + +Msg = a2d7e69ea381d3edfde4664c56c4cb140d01cc4425df757975cedc995b89640dc016ab419b137ff25a6a6d64a309b23890439d2ba157262393cf93d15ca1b1ffd19373ef12367f8898aaf56d5544c2f019a4854f69b3d8d320e03135bb7b675e588a5c3fe4b703938fa0f964916501297cee2fd04af767155c7739419f9dbb7b +d = 0e6af57cf47de1e6f07041eb5e1a413fb7ddd82f8c7f7ce957eb28a118004930bec4dbd +Qx = 21e31c4e4d412a261e40483b9106bbc1b0d7e7414e53d7b9fd84175229c8cefbbf6defc +Qy = 46ff2dc601dd407883af7dc71a6ef4286cd3b1b6ccee4fd861865bff8fb38ad51b63d49 +k = 08f9e2113d0b223c04e678e8ebdd3aab4816681a9ef08b18a38afecc57d79c971421469 +R = 0d2c9113a18bd51008fd327a55c214c9584b6f1b816cf3b95e7346080da2cb07dcef8aa +S = 19167051872759c36ba9eeb5d620cafd3289e8b7660fc847ff385b5143b3aca38780639 + +Msg = 7088f60e9375ec6a42f705f851fc76cc833c4dcbb3352adcce9f59197c1b7121e7aa661c4f8ad9f4ef280af3a2981e90c01291f7d1cf7d3ae2d96b37fe6975e11b7c6c02b8ef044d1470b1a26b9c72e8c4e7b1dd83c8acc9542e2fc7d211b87841dcceea2ab8128d0ff7bb622b60faa4a89ea7008f7d55f8f9de675bc4596fd8 +d = 19f9b63fde8c6aa6177f2a38981505d04f8ac62bcc21007b05615d028cfe851ab9cbbc6 +Qx = 5a3e567b227869f948180547c2713703c90698dc04864140d22b24bdf81b3996829aca5 +Qy = 5b2ba535040afed0bf6f9d850713e54013729bc6dcbaa336ebbfb9c461f7ac61af48001 +k = 051e20545a0a98dc3fec59e4ebdf101c6aa2768f344c1e19424c1eaae4aaf7ffeb5205f +R = 05fb3329f63587e8febcdec49f92de88366a9f75d0b9a0f374dadc6e7a62b833753e990 +S = 12edfabf1ce434c850b58804f1f31f8afb20fbb36ee69b68668e231e4c04fa75e658478 + +Msg = ffd6044ab991849939e8a29184b4d0ac3e07acb63c7e6b886df9e8254073fa800d5910b9fe34fceb547565a2344eed4de394ce2251ed51ec882ee9207eb7340464c742d9d140fa0964f6bcb1efcc2d13919af4f727953de41b20728ab975c1ae0ce784865f23ed1325c68daa95ed5c932893610179be94f13b9a4149f09833b3 +d = 17704c1f436beb52f7ec97192e23e206ec09f9e8986e06bef71467c192bad6f0066b3c2 +Qx = 329294a36ceae2b2c56bb6e21e52ec32af11aca9ab7785be9c2d79652e7960c0cf7a8ae +Qy = 658a89a48fb95cb7028252fa9792d91b989d7cef3fda8ba9c8e4ffaf19269f2a69f0a24 +k = 0aa8d2e210ae40ba1f9f051ad85d37f7cdea43aad890ef802519cc5773e9a0984fe5d6b +R = 1908e3a2740fa04ec0b23c964c4c3cca51c4603e7553461dd02f8319a7ca2ca09d0aef5 +S = 12d7860d7b438df4653fe40fb9e986cb035b1384464e061bc4ee3bb29aec74d16b0a694 + +Msg = c9f81c9ff7d80011fd41f2de97a6c1e6a22cc2da7b2b9e4c50e1354c3e139b44529ac786ce795fc501dcbf11a935d4728a7bba44b4e86b5e5990fed4d3e24fa5ab6f303e1842918f156e00dccebed6897c852207ae5941c630014a41696882066c2b296d39cd8658cb5830eee78e29a00335a99a0ba90722ceca5a2e9a99a2c6 +d = 0c7d1ac8faa689698f5c6325a3b3f35e7730bdbddabd0693f2bfdc5c838bd62f84508d4 +Qx = 095a930071ce56f28a79a66b751283c756c4f2566ebc2a10770ca60cced6914bc9a0d77 +Qy = 46f70021e7a949c7f55b059d4c8e81ee23b13809a35932d83b8398fc8684c5a90f3ec71 +k = 038ae832c25dcd30c1ee3f5fbe84bd8779c876c0641907695aa598132b0e581ea528332 +R = 0eb27c86d3ca86ef53aef0465d257e6b681f891a6357cfbf51260dc6e35a82799de0e97 +S = 0e8207959e8be94e7407543df80d38d9e662106ed68e1456dd1826602c5b73f27ddc901 + +Msg = a60de761eb32490184dc1d29e21fa33889295ca587b994746874c7289eb9c83e9c7bacbb4066c761a06b65ecd78d701bd41f305cd7eb258c630f3febfbb0a367ad16737b146fd793dab23562e8001cd113135b1c981d1ca23eb3be0fe3e24fe3fe1089caf9fd8f4f0d1f90dcc7dbea4a9e2357793b65daf342b8e6d109c6dd10 +d = 1a173d158866db0ec665ee632b5fc397893f6a44ee17c348e7452800aadd8ce676e7fdc +Qx = 6a9369a93e0b5165ac6e692db035495c5cdd6df243d9756098385ad616374ac1e1efee2 +Qy = 32f72a02c36954cd8221126e4eaec02668f454214e4508cf72b6d945e14d9b7c5d404c8 +k = 0200713a78f58c755db4897f9b7e52057a087816a07fc388d66d34ea9e0bcf2f47e182a +R = 11a26ee24610e705a42329f86aaa80d78934b4bbf19314f06eec46067d85c8377e04d91 +S = 077e35add124574e98e0056bbb106cd28ba8c3bc0c47063ceebbbf2684983a2a0061950 + +Msg = 2cd0320cc73120ef13e83c8144b270c9a1f2049a9250ef7ee83ccc7584025140a51e2227a5ebb824deff55b3affcda63ecb1fd3f337c67c08054dc82fdace0c4bb9cef1bea9dd792635f655363d05903cd6b5ed50ee669bcd8157509366cd85aa40d19593265da26e5641590ccf04672a6df52badd4b99964a8643d9687b499d +d = 05523cfacf4ed3b74ebc30f608292e45173001d80cc801f729c5f71fc213b243f041ad5 +Qx = 410751ae7d8bb2295f584ba3d55eda41a80b8520b02bb4e5ca669a1003d6f2829e0a01e +Qy = 5fe16244f76f0c8b24bd3ca3b53c697097e3ab0e2b44962ea534a655d6c7d80b857c21e +k = 0a634f4cef0ba37c9ab211c57fe6574c67933280c91c8b175fa4164755bcde867fe1772 +R = 0b9f6946a578ee38433e98478a4c31b67e838939cbf128f023090c4848471482fd1dec7 +S = 157159e15a2d16da2e913c5ef00833a8e5513ee4e7d6cdc849fd822c59886d0ca3695ec + +Msg = a743d8337bdefc4753f937e869a36439da1f8c75e1278c3f6a4a969d93787dac93293818b1cbef5b8636e1a6cb3acaac1e15dbe0841c8001512b689292f3f4805997ae26ff52f7fe1842512a020c448ed01af2a061f3638689446ed5f6bed9fc70726ce4104bc11142de63873fa7039830223e8f152996388417c48e0c1fa81b +d = 09f6bd008c04b8823ccc3ee7d5aca535c211f35e9d9e7cfaec518b98647fbe6d28283de +Qx = 70019957dac0e9be0fce6abdfc00ca737096ba2d2bea9ba570acab6d73eae2132d7eb06 +Qy = 559545f82741ddd1cbb9dab0cd06454fda8abbd9d1eca752e57ec05498b14e4189f1b9e +k = 0fe407c226fb15bc63d37cc9840a1a1fb0ac4fc2939fbbcb6e1236831379d367669ffd9 +R = 0e96e301bf1193dfdd2815597e016e0a282d6e8f9d1d67a7f7e7d05288594f1ea92584e +S = 07488687f13c3a2b9ae90536db7868f2bde1529ccdc0c84eb85c53ea979228d1fda7c94 + +Msg = 6a7a3ad614a3a09d2dc5a80204815d0c6471057acc0fa73f3cbbf1801902c3e1cba3c1134a79a8ce61994a94a5afa85ae1a44b2cdcf5153f8625713c872da36aba0afcc5c2f26636dc3f60e04c256a5b023e20e2e7a3f7305bd5b3033fcf05368589f19021f8c9096a88679904b657bbe5b9bee67d6e53d176fce1de9e54c64b +d = 150d2812505c82584201e93f6e0cb875d29dc7bd99d9c0f98e0ed20128886e67e1f1071 +Qx = 12c7750172bea15487a05580891aed51bf81548f4b65c51c6c54b990bae8857a20115b0 +Qy = 3db9e7a17dc8b24ff080d80842f0488f17f7d43a40ce6ffad52c65f5a875b4b33efe3fd +k = 0c5c52dfb50b210ae13c2f664d958b2491bfa91ced638f925941234bcc4d66de1eeeb73 +R = 03887a270eeb515a59a7387d8acbb4e72dcdf13f317a6a93ace5cc98d69a79c64a9e7ea +S = 0e922b2d021cd71e213bdb36ce3ebf56a34617d4dcca30fc05f238a1c097e38d7cbcf91 + +Msg = 65bcd77a3ab345cc99b9c1300755288102a6ccf140bc7d1ad25df246ef01fd57a8614b352033b88cc6ffffe5b38b99ecf03baa365ab5529d6751a3c020d0198561969aade09091434d84ffe13b46df043d0a61e20a08e9c32b646771fea1b29e202d40aae1c7079873c3af494ecf6ef5eda855736c9338b4a5c29a086a8266fa +d = 1b3fb9e1ff70f94bc9d7742ea535ca982215af3df381b5ebdf1db40c7c849a7978ceb98 +Qx = 769a897a443c41ae7a8c1e45290ef39c40887ab8f4aa3f9ee8f3096921222ed7de45739 +Qy = 72621bfa30973da61fb6d363d66db25daf818ce79dd3268ac0520fc99ca7917fa3a2360 +k = 03fa84ee38587f9c848b65b07c47551e27f15e7a87ed0ab705c99c8b7a4ee9e86a8e4ea +R = 11b214ebe67eda2bd6e84c33be05c4373d2536e2cccf152e56b1569cc96d261e50910cd +S = 0e100646cbffa016664bb57c1a67108645238573867c0b595c46e6053f844e5482a993a + +Msg = ed1acc360d02ee6c36bbc223d91bc1d2009a3e8f8dfc4c3796cd8555b0d2b46716f4c8058bf34c2d4954e098274ab9c2cbacff46a0578a14e77fe104196cbc6d2753e3bb5422b8b79fd004ac0aa920eea94925c016ece16ed4dea916fd92563ec65692a61b28ee84bef0007120bb1e31bb75b8ecf68406a71af9a18b4edf5320 +d = 147fa46fccf0805d14c1b84ea59bb8b8283d54ca0ceefb29b5585e7141340c55b7232f7 +Qx = 4ace4c65ce07fe5ec22c560bc553bd791434a691c2d865c52b5e38d541ef191ef419067 +Qy = 76250c829de137b6549d22a12f196629d9d34cdd83758e5daf45fae41872c9b15190ce5 +k = 18c4f89cc022236a0da6105f19c6661a8325d36fa285e3ca71c1a4af3dccb016cac186a +R = 0271b421fd572de8a71d1b18ad2325bc0fb58cabaabacc1f015ee6b14bec49762f1f8ce +S = 12e679010ccb143b7de0c3f6c82cf99a961a4f154be6c87abb111cde2d721d864d7a1bf + +Msg = 2debdb95a21d72b69c545988727366a42b819ca6398a82129c5e3772aea93fac0aae9a27b11969ff0ffb9dc0301132ca2452cd863316cf24ae7696422d4dc68e37316161abc146e86f04b72d9a27a350d8545cca245b2be43c33bb822dd813d13e08a718f784845df8a4ef49b02529871ec76bb3fc1ba31089359f2ede73e767 +d = 0fae097ea56b35a517be5480802f450eb832b244558d0cc922cd4a5b40b84d02ef11216 +Qx = 4f6bda2dcb9560174ffa54f13fa5edf17bebd41399a1dce1fe13e82a2b487eddfe25a19 +Qy = 76dd375f2c5f24c342a8e2491271cebf5b97ac666aacecc8d693a85ebd2a93eaccd4059 +k = 05e3a67091b9e10c7fd20fd70d51162e5d78555059802d0c3b133f49b89f37be6a119ad +R = 0ddf93ef8797571af3cc9a66660c569445a2b5384f95a12d680c570694bce49bf2264cf +S = 02f50d68bda006b88798d87c232f5ed1796c841074f063da03a471e0c00f08b10f410b3 + +Msg = e4e0c6c8fc01244abf81e139c961b6a6e2d95de5dff1083e8a48b40e3e5b9ed909152c92b1cf2263179629cdf76ae553b58bb2e9223ce4f9ffb5f170f5f0c5ec97294c34a7529a897e9397f71198cbcd68bb4055cb8cd6b690290761b3b73303f82788379df145358afe28f2997d191d968929b7a4b9a0f6228797dfaa17c613 +d = 026cd72e6ae19b3f4c53493fba1e8082a8df1fb7da6dc111b47a41f713f49b33f618d0c +Qx = 1c411f5e298c9b61023fb26765cf4132cc78ed77c07c3e815fd43032cdf0ae8b8920f96 +Qy = 35647b4c0807b287014043560d70c9b14651cddff4bdf6d44ead5e87720294ff8954406 +k = 10e9bc449e8480474afffd20b8acd6dd08344981c4a6cc789c5338ad7e486c526d6c4fa +R = 0e81594f1064e018aa3504bac75946d77f9e745673043417a47c0c82488e224cc4104d7 +S = 111bf8635b1bc3f6cb7f9b685077b38d67160d143ede2bd8b6ae93327d7f55c5317f00f + +Msg = 04710947b7c90855ba4e59107b919d4a1df22b503c5c4c33b286b6b08e451e6fbef8ba40852f9f0ee62c9217abe6156bed46ad6f0e25f70f528f3a73d099338c578bebd6879d810e6e173c2b0af1f7caacb3531ff0e6a7856e4c84db355d110febdb21c683223eb5990ef2038d462ddb7962bc0feea5f850954943d53041f66a +d = 198e13c7d95bbbb6e226688719639bda988867764ffa9b029018b5547850daecf58fe1f +Qx = 30b511d719217c485866273ffe2996a19e0a670b7a3fb077944a21f63ca2f22fe5a524a +Qy = 3a4d9a808e8d77c9dfcec6d033139fc33e67d7c8dfd7329c895bfb77f565391c37c8d8f +k = 1721f1ad4adf3c32614feb7f8df3374e24f76a32e27854a57dcafcbaaa3082b13e461ce +R = 14b2622432adcfed7c2ecd2b52e43be7f611680ceb4bedbfa9dd9af54532911a07440de +S = 0ece991128b10399188b18933c0d185e85d111ad401baee5ac376b84c523f130f70fee2 + +Msg = c62d07bb1ef756b6b2fad355c66b5be086b6dc387b37cbc4a63c841dba3fce65b09d3de8f239e3649382d172f065b78f8a53e0283cf345de06b4ee0b4b7d8611bfce92a7d993b1938419afe817611bc6df3ef74191e7e39ca2339fcb5b5cfee3166d09cd52a1a7d3779722aec328d326a11bbafb6aa417920225ac453146b9b7 +d = 19098a39956747de24ded56435fa1e6c30cc2b8088fe9a75f5d07b2f5939c7a60db64ad +Qx = 68cf5a2023753717d89d12d6861c8411e6081c3158339573dc5598b1700148d00b39dc5 +Qy = 76a22dcd4ff4f062eeff83a58d2ce6a1808af8733ae254f5157efa8ea35a85cc744692b +k = 142e4907ce239cdaba562d1fa7305bacff05a75e2927800c7b7ea322b47c9ea47846e12 +R = 104620d752b73379e1e5d35e5b24a793d7a309685c00f8bdb97bba9876999ed9c763d0b +S = 059cab3abb0738d8af4ea6dcbfca6d0ef11b6e591ca109b040347d7d4736724953cd9fa + +[K-283,SHA-384] + +Msg = e4d8d49c9bc566261d9134d5e237d9cbd6b67d2619a9bd06b7c9c139e091aa10682cbede114e1d4777d9cd67a16b7d64278e99eed62bbf25ec5a5a8fabcb0a3468b0e73fd02ac6533e04b1110d29da3e34f33eaa228b78341b357a5d892a61beb2168c3bd5e66bffe3f2080a1e246f55a41ebf9d579e188d16991aa060460d6a +d = 1636bd2be121e07ee83ac5e880cfdfca6a56f2b9d0badff003e872348368c7c2cd96b6c +Qx = 007acf46ab68744a9baaa33ebf6be20c1c093242b0056bb9885d93a4a9bb4640f17b2ef +Qy = 15415c1b671e98f00c1fa364bd69cf998c0ae140485159b0a341994a4e27000e108f4fb +k = 0d0d4886c3500bff68455c41f5840d0313f33ac0155a693d27c66fbdb12791c2b5f8552 +R = 0256b8ff7d37fff7dcc8cc4461984a9bd9661643fd3a68d07fd30d426d10b8c7f4dfa34 +S = 1f516f8ed4372780380a798d2da04d691aec379483bc0d10560ca79edaab453d3e77585 + +Msg = 2d1358fdffc14630fbc421b443d3c22ba10ef34f15c6c5bb3c73a9b8714e4c411de69b9cd6628fe2eba5efc4862af66ff916505023e0514f564164b389ea422d0f1beb92adcd65baf43556614eba25e43852ba65af78f62d64b36696519ef8284ef7316ea52c365b99f63a39e6701f81ad520d7445cfc0113c38ecdad4bf5b7a +d = 15e5f555119c19b055b15b0c0d2813068bfc184f864e250b202384f5728bbbda1cb0f5a +Qx = 13cae2f0c3ba04d039c42cae27de4cf5842a3e24be35d7a3cc7f05083f02951cbeaa63b +Qy = 5d69ad5b7d64d6b19772a1794562b1fa5c2fea03909bc509e7d47b0e8144acb3c26fddd +k = 1b881d95b7de9aed9fb5ff0085ca4da2fbd413b9b947066c98aa0257142c9000bbb30e2 +R = 176f9e3c9e9f98b2f5f352ca74310badf9f598f4d42cd2b26e5ea0999ae31e3c678fad2 +S = 1f2dba4e17470cdf7e1815d30771f352807b38080d44465f86044f5969b017c9059daf3 + +Msg = d6336faa5c3e838f4fa58626eb353d4cff9ba8f0aa0e6c3d0d850e8b22f5b0f047afc97767f1afe2040b85d4e401ba688a4da7a0caca7fac450899092c4fea789231ba9b07782010720f45d16d353798867dd7fef4a324520014ad5cb32684ec50cab742b750e05db040ff51140e8d740f6774a059feeb493b10d8ac722f23fa +d = 190c8f17bdd38669e345440d2c7631d67cee9c6548c4e7b9452377adb9303430efeda0e +Qx = 3235a8b7981b3ff376b6b0959a42cb56631fbb9f82f1694b9e273e6b7131e758fa0d370 +Qy = 444e5747420d7f5ffd6119ef43b998d4ea4a58da13ff6fe7f241ccdfd4b6fd33aa93e3d +k = 0b2a690793107257d7bdc37c492eca48c4c9650ba0d657e6eb62042b16169fbe27f8984 +R = 168a83fcc67e0c155f1fa2329363729872e254f2e0c3ef85f3b3c84fa3406de4191b6e8 +S = 18c0f8e6b486e6d7d16b4103506d74bb2021232c0b1638858295a63ca35e0d6d26a6266 + +Msg = 07384a3f650bd270b14ca388a441af201b7767a2d47e9033f50cefd3af8257ecb38f5267e141cbbb2ab7327d8fc78cf27198ca3543d39553e178390bf1b921618432ad895e4f8153783a7ac22f4ca3cad4560e64f1ee4a7bcad05df98ea49a3847dc2143b27c243e48be59c869a547988e2205358e8db98b635ca21b745df4d2 +d = 0dbbc2a0409ca58a9e39e33b95fdd15080443c1dbdb5874bee991bd1b127047f08ec9f3 +Qx = 5a687605e54e49e3c40fc5ee8fc014a62d72e8595280a66ce7d367aac2df4d16b98deb3 +Qy = 30abd03dfc224f459dccd1606287cc30016be317c6207532a0725c957ca5fde692a9c43 +k = 16bc5aa29cea64ce3297172f36fe4ce820c943908c21c9967697db0cd93bb8a12e42348 +R = 1b1fdf26a6eb2d736b8c1ab165af2ac31a4c206c5410f61ac7805a68992dbd62b457708 +S = 14e9a22ce703d942a4fe2e84a4c1c1b44538a33fbfe904bfbb17af6490d372acae4668e + +Msg = 824f26dcb4ce0ca020982814d5c727e629cbeeaa818c49668f8f6d743f0d0ad362b24cbac48027898f386889ca5411d7d1f9afc69493b1d9ae4d7b695c9fa0a30bb59e6be2cbff79231767e96cd8bba349fa2f97955d56f05430ab4ebd007064e3d5add94dfe255b6deff19650883ce9966e1a2affaf84d9540f65c87ab1f936 +d = 05495e6c59ca1873f36b756579632fd47f9fb95b64f52589d70f2739aa6a3bf8cf8c198 +Qx = 6df40d8259be64c8ac64a28359290bd52e843f330a68c2b605ba4f777d7bd7a798e9344 +Qy = 458667cd7021b291c3415d64f9b054db71d3fe20f232f2a2286aede89ddaf1ee8c68aa0 +k = 138f05303ea63bad47c4c9a9d43c52c264725a668db5b631d9892daa1b71f62656cbf73 +R = 05e35c1f3b30b43cc9d60bf8779f3b31e053de0a390da50ea676dc9722a17ef00d68aec +S = 1691ecfb826fef1ea0895242129cc3e9a14e1f84fac49d62ffc0a3455ad9c97becd5980 + +Msg = 07de1e4bb9be15a710a74806d4447b093bc08ed04392d1bd5abb414f5f4b4d9d43520d0e46fc81c2a97e71086b28e53242449ed37fd7ed1c5772dbabc430fcf82ad20437b38eac15820421e51912325c872894452c3f8a10ddb040b35308e583c155c3707b52df467c4945f4e1071126ed46611a3253c297f5cbca9e27f58448 +d = 1724987c9b698519b6c225cf1261b77d0300045e5fd774dcbf13f285e6bd74512cb7edf +Qx = 46adc9bd5f0cc0d8bc64f4ba491eae3b7f6fb4229bf94b804807c6137787adc0fed4b2f +Qy = 41375e2c89da41af84529811ce7aef26b983ea8add6e37c32f2b00bd47f23f25e5fe194 +k = 02ea4ed0e87687a50dc3acc7f4c089040ddd367d1a3f470a711501ccaad63c201b87ea6 +R = 1be198a1b6e91453018513902f0a8a085c76a2798a2a0538ede30dab65afb6b9b0496d7 +S = 16342f87a813780aec006ee218a615c4e1c78c0c759d48d4094639b5b4c32a9658c4d9a + +Msg = 1edbbbe71057bf7d0bfda922be21a3a4dff57b017ebf6fa99651246cd173bdc9b11eefd048ea599c1f98e907932aa04f64ed0a007831f30daf186c88807400970904d6090b2cf181e0f65f03b4234aceeb420867812562e47f452152bb1ddaaa48487170d06e47c5e9a7c0faa4fe494663d2fec22f7665ceffffc214b21c6b8f +d = 1a5489091cfd51a0970508ee3e8449081ed175928ff8386592c83043a7911bbc2f8778b +Qx = 0aa1562c94bd16a3f8a1d6c465908ce3b83ba6711e7d8b0b9353d3c55d13dee213aba70 +Qy = 103a789854f63a139e31348f1b2608f1e71c88b5d42809f2460642ff46a470ad8573543 +k = 18435a6d3bc02b3019e1b156ddd6f3e1bb9c5af70d1a2cd2089e677cbacc21624ec8947 +R = 031f561b668aeeb4df43a3a34716c4e67232f56959104b7237b26e3c95dd40e15eb076b +S = 0f2ddb6e6d18a7393425c16b3e5a5aa232cc48198d63e46a601cd3ed221a8427178a0bb + +Msg = db5cf1de38a5187af11c1f0f19a36db52f8417de997229e83072fb51a3b7152a3b383e9919c1b8427582e53d4e7e25433d46cdf01492021c237ea0a87d38c71634743115a6b2aba66d3faa8003158340a5078171e0bd55a6e5d8c7fb2631a31c1204e1479bbfe79ac70d5e5823af502922a900576f0088a33e42ec3e26c0089e +d = 1a45ecda0788fbd7cb7a716dcf4c6e83d4148bf63ed58078690ebd238c00329c462590a +Qx = 7a1e2fb4e8e79e3946086fa65042362418db0dce51541121c73972a435aecb99f634023 +Qy = 06bb02df9899ac3f207732fa7cdbc36a60c17592af7ce06b8df4255110e26a02b231800 +k = 1c986f88ba3d5109c0afa2c213dda8df462282f024cc8efc758a5342a0de91c40452443 +R = 1efbd9e0d912e170c9c55bfbdfa6106fea4a4e013e7dc26628a1aea4f6b806a51866003 +S = 0b1347f4f85adef612f5c3a436cfa59eaced5c7cfdbb69444936d71812a2ab2461bbb5b + +Msg = 4adaa850eec8272d25d76600aacf2cf66e754f6c5efa65c55a2a31b7bc69437d9a7e47c6f51c5da93895a45221f5f92c2e20ee6a95eed3cc7249688261a35d82872284900eb54dd1df6024ec48963ce43e8ed8b8cca8ed22beee8f0aadeae53726cca05443316537840ab824cd1b595f36064e9a19333748d4f4972178e7f5ae +d = 11461776c33f20b176dc8f2b0cb2446a9b69e55b6c7bc7457a7fb4639116b452b79661a +Qx = 043ba7157559659954ac58b44f19262bef9e3a00829c70af66d07cef08ad899d7f8ec23 +Qy = 1e8dd9c947b5a6decd1a26fc5d0eecc9605d22abda747fca038571bb37036d9034e8061 +k = 18b231de7fc499b461afed9b80f4405bc005011865cdfeb25570b7c0ff79b6ae94b6ce9 +R = 0fb203f47a4e2e9365ce070ee7fd4540f3f7e9ecf69b4400eeded0f5a7bf6e5a5c6d004 +S = 0e635dc65233f27b8350db22b90a3b8611e6fd1b3e0f515e42fe8788b1376079816308e + +Msg = 11d212a99c39fb5e4ca0096bbe6c81ae1490e1b8e07374b4e773bee4fdd24a3c13d653919db663d2c32aa4db140c4ae2d472d4f878946e527ad33b3dc93012d97458f96cb622ddb56f1ce7c2474ad0d5291dc35545de47b7053d137a8e79dabe06757ab53e26eaf751111bd27690e57ffdab5337eb6f81889e9d1b1ac729012f +d = 025a65f627db2b4d6cf83c5b0c00265b9b63f7656c5e3382139e4992bcdf3cab502844a +Qx = 5a35e7e0b914a3e01ce3a885192d2ecd27418e09898631de122db0c48e8b58658720fcc +Qy = 009eab47197d5f56927848855b6ff96db7c36f810ee7c89b305ef780ba8c993d65537ab +k = 18516ceafb61cf2c7e7c511a8918bfe394c7fb2fbc40fb3052e156cd4020fc674684f84 +R = 1892ac13b86ad00e38ce2427c8c78c93b08605a75ca22b3658132dcf9d9df7c4b5540a0 +S = 0437b33615c16a85ccb8c4769ee7c5f94122d31e2b5fe66291b401fd90257ebefe33818 + +Msg = 9e4ec74c09528fdf3153a0f6955f20c70915ff524b2e19c991ec4c5b41ea9185e3e876a02ed6f27c9b3479dba951bee8680c4c99be1a626808114408856994be7444ccbd5ef9859fa479b1050bb836034e20c531b4d618f5843fe1d4b613a731895b489a2363f3f5397d5ff964cf037e9b11e3ff5e1c3d403e5a46b8387c1241 +d = 173b28fc29f10245221a907778708b3ee62e0480aa9051d4c3eb4e8d552e6aad5509943 +Qx = 24bb9bdef975af892ddc1bbd31314926a9c81f8f1864829edafdfe2744e793c100c0483 +Qy = 28ddde61b4361ced9c391c86c28ece9b902c48d14c61684962007dfd69d0468dfd65e7f +k = 199af64f79ebbc5b789d4676a07c224e4f6fd33285e5a555ac90cf65d0b669bc58ced4f +R = 137d746d515b90890a413685bd9b26a1c05efee4c11a4b40bb621c9fa2580c46c20a687 +S = 1647f70ab7c68a0f522420893a466940ccf79067b323d940369f8b8694ccc3fc0daccad + +Msg = 5fe8253d2134c434cb0866796013722e82184638b024a5a30938039929ccd8415c71f71f239c5c5a81f7a9cb493dde209f189bcf766c17c6d9589cd0c7de7f07ff9f24d2320669b589d084f8a8ea71127b9760b7355b162616afb34bcdcd416f1a062035102e29b70069b2b4dbf70179b8d60bc2ee5a455efd40194533bf560a +d = 0624616adcd45e1fdc6cfeab2b17230d73d91fe0b39f4664f3c6891554f9b8e238257f7 +Qx = 10917ef84bd5c0b36c97cb5586d3057a34f2827f239cab2af2e6081c5bdffd48dccb0b2 +Qy = 78ab47fe1bd3e28055c688c78e617ddcf6c5060123e9d65c562df2e94cac973ab3b1807 +k = 0795e229185bc1b3d6d69b08189fdd7a822cd18ac55971e4b35e51838bf12eacbc50e2e +R = 185483378a162b8edd6a12f44e3aa4ff829630fe3a1c9ccc66e34775f69bb6a94282489 +S = 01662cde6cd497be7966a0a77b0626ba3c4b82e20bb3f2e839178a31aaf440aa0e059cd + +Msg = db49891838fe23f0530abd4a4fbba5ea970afa5747f6a0a10d2cf4d841581ea2178705c1203f00cafec91d0a72d25448072c9cf7d7ca5580b39f8589ec63128faa95cb0689574a6bebd515049a1eb9699922cde0366b5cd58aa8f3d3e847706896f7e1cac667fbfe94b2eca9e7be79a810806ca4bf53f219bb30532ca2254c11 +d = 199757ffaa2c59e198d66824eaad37cc42d49b2e241b6a60382d05e425e800eaaf32470 +Qx = 6ad18bdb3e51cc053f56b9f9c35e2d6eaecbc9749f41a9ffbf54634838d7745ca064890 +Qy = 5dd77c42b31aebbbb46277176df08d81919ee0d9ddf14c3e4c0cccb207bf649c48fc8b9 +k = 109d6332ceec5ea211f642a746a6ce055986b4a2feeed7e847904f7f411bf8361318d92 +R = 1a49fe690a34151056d290790a6bfa7b70958e69e9baeb30c55efc61dc5dc4934f2fc95 +S = 1710a4ba5b404d65f66a8fca2751a920224db0cc0266f7b0bc054069ea4cc51b1f017bb + +Msg = 29d385d09c1142a7c181fe4b6e6132e414c15aa8605b44208c0399464613b966edcc2d46cf203a3f85d943d8eae658695dac74366224a0d0348083bec0106f5eb8809ae8d07f792fdd7c48fb1a25d5ef3bb9acd40b20c61c821024a9acb2ede321bd2d0dda849c22d76f421cbd8d51565d3c4266f666455ca1c0c3777aa44107 +d = 06e51381dcf21050aef2e9b97e35303cf3bd91956854ecf9b6b9827871d2efbe8201c5e +Qx = 52fee805d7938b8b97459b9fcb4b80cbe29f20a9aaebc07ac019539a4a966c5ee41751d +Qy = 78aaae02974de6530f285b4bbe87fd5d0c9a2ecfde5fdc9a3303e4b988f673c778004bc +k = 0b426ebda6628125d73efd84e6bbab6c4c8fcf7fa29ffb3c8d6b0a861dbf81cd18d088f +R = 1270045e963b59e4a4f1237c2240a5b26a7ba8e28ea01326fbec00e5d95d40e859d88b3 +S = 1d721477ee1df1388e1b7f92c048e5759c060ce1291098a2fa647974a62a258a189b4cd + +Msg = 774c1cb8fb4f69ecfb5c7857d46415568d88f1f9f05a4bf64a1e1ff6d64aec16e1d09292010d1f067c68dddbcde06ea49be2ad3838053f0b9c0c2383edc451ef0188565118e7b3c66a4fa372b96633dc8a753106283b02d0322df273d58cc9bd061ec219f1e1a9c8ca1400e5e39c1b2c254273377dc98a1a2c44e5c2a5b89167 +d = 018adcc22cb9a2db64bad3d60f1608c353e091637b948914115ebd43679904f955c8732 +Qx = 0630bdd8937e961d5396f9ea5310123a340ba316fbb7d79bf8573f27a0065c6fd6f8890 +Qy = 737a0ac1116e0e2979f973cd705588a71cec5e2a9f22e7e81fc61a4375624f55a6182bc +k = 10a0c04762d02f9d3014bbff287864743426cee14daa43b22149ce73d1ba609c0ba6be6 +R = 0ac29b041a6b95f9ab685470f50445d416df5f7ee06313185794f2b542fcc00606bed69 +S = 00a4241b97b6ccf0dcd533a15867f5889349ec353395d47e31c9eb6b8785736b3e285cf + +[K-283,SHA-512] + +Msg = c406aa4295f85c854b4db2de5a7a2defae53a319866921a3673af5b48c85ef22f6eb4cef892c790d8e64530fc20c729b2821b5f5e515560b1ac764106560c3a6a05657e34cd6deadfe2884bd288cef4ca92e1f25adde7d68a30fb0a1b3678156ced62e466718e68e9d67099ad82613b8d06bdda1a7b867c2455422818ae9eeac +d = 1898276f159c10d92d8d4b6ae214d68c72792a4b5f1f79936ca3c063dc8d9a88be439e2 +Qx = 394cf9bb273923c88be7a1c49412ab8599e0cc5509926102c122326bc0b34243f7d1cf3 +Qy = 72330906f47e8fe95f63d0f0aca1115e77fc702a923c32a16505bcd9021da05fd9cf63b +k = 058772fbb30227a136de616ace4a0334be0996d60e9772ae9bf672b7c38fe3ee1b24f98 +R = 10e0cd3fccd1728e99e2294efd6dd4797b6492ad95a789aab7fbd177475a047f1e5d38f +S = 0c5e0b2d1991718355be14bc57e2d6ff9fa63e0812b9adae69f64da610cc6cbe36fe4c5 + +Msg = cb2809152f8258660933472c06ddcdb65f6d5221fa29d5b0efec9c2a7914dbbf9ce0a468ce146fb333d26f510a87a6bb01bf8816756a1b5df81c5f65360957cae84ba038e37e88777580e91c34e2f5aef4fb55af7b81ad28aeba05e0b1c64a15381a6719fd2c16e38a441516e1b394952d984baf9e051b1dc1bda2e12f8ba5b8 +d = 12ff37c808c3cc029a9cfbb67a5ed21f3bf362b49270d4ed0f1e38fad25ebd79f112a50 +Qx = 0cc00fb36bf62e777a9f6048761e53633b92866158200c43900db95aa1342b576029090 +Qy = 55d7e57221ad939f5639282cbfc203114ee69baab4fdf194f4d2a937d8a57b70b54a907 +k = 163d8eec726d01a1bbb19995777919f68689f7c2920f3549fef966593c4fb012a5c3a1e +R = 0cbf5c3bf1ee58869e1d3c15a05c23217f1c252da97f79334bc79efe3f5c62164669ac9 +S = 1fd51644f471ea497b0560b65fdfa2fd0a6cef469021303f97753d22ce1993d1ae5b96f + +Msg = e060af96d4a7fe512bbf26be9a27bb6a8ff37547d4a7bbbfa710db24cffcfc760dac120f89f642880db2df6307f9ea5441d5932d49762d182b29d8e7fb067a61ab0df622f75cecc917e27d0326085d34581e052c85f50a37713e27518aed7c4434f86970e00a0a4b8503989e72614131b7164c1bdc82d2b6aeac0787f9838476 +d = 02b8c1fef9c6def32b5f4127273ce384b6add4aecec957c1662f52334f5ee97f49852d4 +Qx = 36a4fe1d77bc431012d25ff49fb5468f975353be70e7507d71966a0ef433df51dc32324 +Qy = 58d705cc883a690641f0ab85af4959ef4258a7ba9cde36dab77c125a1de1d395366584b +k = 0865f59502382b324e1dbd75db150f342336fb19145fb43a733971da555ac5828a3457f +R = 1ccb2e56c02cbe8038bf78dea256704ee6e51054668ba8c2ba11aef4ac6f9320d46ee8d +S = 030e662c0e7d47cb3b835c63599d0c9c2e77ca47dbecd7ac834c2babeb039eb630cd0ef + +Msg = d235c31f0a82957a087c7597673970aa39321d4c2640685a03df8388b5eae4825d1fee29926f416d5e62a2e9ca1ea7cefffd31607e750fa9675983608e0f8dc895371b190574d065c5c0c23ffdaf49e65362914363a3fffbc2c1bb487cbd4f69ec22dda5c7dc3bbab805c81faa85787cc176bc0e5703924f395d8c9e7e7701e2 +d = 0afb1c45e9a9f02942b8e04da4b815498454dde6643de186625a98b3c1c6993abc8bba4 +Qx = 02fed49c59e9d5c09202a5dc29d8dd527a870a180feded66ea6fc94ee094122ae97656b +Qy = 3620820bdd5910037f5877649be38db3571a9c6ac632602d2013d0d5abe1f00133f6cde +k = 1fe749d9916f11100af525ee343b3b74a493f92339e432a482dc8e86ffb5affc4630037 +R = 120f6f13331cd4d1a5b9707483c74dc0722452062cd4534e94cf40840d22ae263244a51 +S = 0bc2e37a481478f879de612cf4a833f7e12b8df33f5b0d6ac5f5aa431678ff053e2bc1a + +Msg = 1a2559777a5fd8f269048feda82c4d9fceca95803f84a813789d6ed070422240e443789c5231d63d5268ddebc060dfb99c4eff2ff115d2984d8bbc5c05314562ea6864fd543e7e0a3b8572c017d8ae3563027d79bbe164d40a5bab354720e45094b9b26391ceb55339592fc2f10b97dc9c2649f7227648f5cd2fc46d78d31c0e +d = 0ff537d73a4da0ae3a4894016b71dccef3bc886f3d24a5abb7dd96cf8fdcbdf0fdc5e51 +Qx = 01bd0537dfb29f727f91fb469c31164e1bb0ee192a5b89b880f3fa40e3e5437f0d2f9e1 +Qy = 6df9bab2f9198494094a63f2ea091f60108449f0741806400694a93702f61fb0351a81e +k = 0bbc511c6e1772ca6cd1cd308126c18c5db498055a4b3f1cb0dba3285f6d38b083e647f +R = 1ba756f3c89b732398b90bfa2f92b2a77159c530a8020b75cdb9697c6d75c18d36040b4 +S = 18207cf326bfe97d657ac4197ee5c20c75431ee552681a92a5815db0d984fe597700bbf + +Msg = 658c0d3f764bbc952fa55a258bac16a5bb5184bfa76cee06baf9ee6b9ac3f116e08bb2406b1dd4be487b057f3b29c2043ebc33019b2017c4deccb86f50ff15fc9248ea5fb64261120b1960525aec3cc18827c23291722c5add8a3761ff8516c61956c62b8cbb13f3d92bf3eb45a70704c01bb3625d21c38ffa83a6db086ee968 +d = 16000d2e879906d1040b32eb6ba3caff700e5565871ac75f10c5c15b509964bbe5e14c7 +Qx = 2ba89255d1c89e42518662611e2efe3b5e3b8043926ae9c43974ee2986185269246a433 +Qy = 2b87762b9ada81bde958d1f9b81246f49098695391ba3b4b3b9ac5727f19fe42fd07946 +k = 14e837476e628007b2df21b5035a39c24cd4869bb52dbbe13c9666ddd8a7e3eeae29f65 +R = 1b5091fc755c0f908ee13ef9bee40dd16a5710befd1e265a312e595842d52cc135fd722 +S = 0fa25f43c3c074d702e45d216e3704d942e9d67b3c0728645ac6c53b9be7300061e5fe5 + +Msg = 4f10001e3517c2c1f973b555f4827681e096d860c4db08f1f4aef8000c9c24bebe59f8bf3d7d3cac959a1a5477bb0ea43f2e746b5d14ed48a58ef35484b0ac786d2fec669f945e846ad73e6b77a9e47012a951b398941566330d89125eb3c1fbb2f06adb951ff5f047d102fdf28b5cadb4a3e1a10412eb3474d2ed5c3fce78f5 +d = 019528d505bf0584628d0214bc857150a929d3f59619bf8f3acab545fff0977c9bcdc97 +Qx = 0cc8863e1443e61fedc61abaff87d80450345489728d78c333b36fa28d8754a29cf3ba1 +Qy = 0205ae70c35396c07f9f96aa7c59cf8a28aa2a365b4a1b68e7414d8c4ae5220c8bae9ae +k = 13d555426101fa3c239b7830fe0b6cf08a1c01f9a991f806c84baae20daddf5dec8f868 +R = 0af8bd9856dfd783217cf81b09b464614aa824b0298f35308e6427c679607853eb66c7d +S = 0e6c1933d6ce25d0a00effbaf1db2cb2542cbe7521330c34286cf3bdffc20c001cd7722 + +Msg = c43ec3c3232cae59bdea7cfaf18a4672035dbd2b8b6b1b44ede376b36cc2d8baeb921e416aa177f5977da8bf1d713509e5251278b6622790056271715cd5feac58bee5baf50b216e8eb886279c5a384cdb696470275b7487fe9ac4c506706f6b0f9809d1ccb102546a4297d2017c2a8df9f02f30d3d1bd9aebf6a92a02e0d202 +d = 067795ce117bc0a389397fc22a01cfd9422cfbfb5aa44131938a8c45e48e1d5a718539c +Qx = 07924de08acfae6260009cc2f02daa2fc2a809e6ab4cd8858a9e9c2c15b17e29f1bc5ee +Qy = 04f36cc2d36df63474a579b96f6e59b890782ad8fa865efd80abd798ca2938bacbf8212 +k = 1bf3242e75f8331fe70113ec8e14ad0814850bb8cb262c7d0a44ca69de52d32dfcabd0c +R = 145148d59c5be2b6d39dfa33e904c161456822ec0ad64b9dc52befbd6496c9303fc062f +S = 0b75c3c404d694e086c0f5aafd534e7d8596601f675b2fac9384fca6084711e35149f9c + +Msg = 9b7d675a3d2cdeb280ea28289b5fc2a3ef6b535ebee8ad242fb031e2e1f364e8ee806568b2f8627c5a5b4f51f4f65c71acdc1152c08b9211b81907b551e0ff47f5a6aca45dcfa06f09bf195d19d7b165b52111b601fbd97b192f62465f8ba20773b1599c8041e91448eac7a5763ca0628f40768324c5304e1119ca6a1fdb0778 +d = 19269dbfe4184249952a651a507584746c5b62c64cb3b17e0158aaf4d086a4afb0330c1 +Qx = 6c60a475f2a3635fa523e1b138edc36f51e94a34e75989c2cacdf8949115d96f11ae752 +Qy = 494d5e23ba9071b3e52c58b1d0740cf90cee7b084b9ef7a4a7be8aa47ce7b3d97c8c51d +k = 111f4dc771b6ce5cc2f42172d3d70fe77c73683bdd2ea331ff711b7e9d8c3e4f2d7d6cb +R = 027f224c01847c52ebc180ae81009923ae3453be1e0d94b5c2934603577f36653ecfccb +S = 1e7b771631e5e72b7ddfb9c73f684b93270269ba4216cf3926e43b2ceb49756e7e7e0e6 + +Msg = f4a08daf8f66ce57a986f14b918099bcadcc4308bcde7c169ce8536a40d94a928cfc0968180a2c2a242c59df73ff79a03687998c421cf9a0e661630378779a4744ae2a6cd24ff61d7fcd6c11a4c8bcaf358075e96f864df0998ee98ee393b37bb38747b70bb7a208740959b45174a60153ee566e0f62528e9a5e4466186fa650 +d = 03835814de0d6441cd80a44e40350cc8bd62ffcc81e939a4410bb9c9259e30463c453b5 +Qx = 5ce9f6c979bc1d6bc41f41095b7677cc184da8918265a7f0e5b9dbece2ca9e0667cfbad +Qy = 39a395aeaa04f5168de809164285974d306e474a610d89fd401c375c9b73f0d23dbbcf0 +k = 0b714d734d063aa81a389be69c56dcc23bcced3517e330572f79c769645e7dd2fd55c20 +R = 0e4d4494f91e79f2b1d1c0e22ebf744ef448f57c951f1b5f4da3592fe60008ab00f5f7e +S = 02edaa4d8731b598c24b993dc5bb4888ea3c2dfe2807daf88170982667e69b76a8ecfe0 + +Msg = 864647405c70939fdb4c026bcad53218ba1d438d82c9138f0f0ecac815dbfb242307cca52c84826cf6556c51082a23f14252dfaea43ba229f7493db2bf8ae9cdb0228dab9e25cf385b504b92cca94f813acceaa1f18de851b8936c4dfe9e4e17002f02dded6b4c231ea5e614ab46fcdd637b8c6193e8d0c2df1b3d883b97e1e8 +d = 0aee83dbed3b703cb6e60d51e373eb20e298ac005fa6a572d02fa1e6da0345558ad2a46 +Qx = 0dc25760af992a8ecc108373281bd0d246f95933ec943f6346c1b2b941a03b33951f622 +Qy = 6e35f02d225ba11d2ed7ea392898f78ca0deb2a47871eba6cd2be7440a410d910097de2 +k = 1df142187f8b27f4888075a3784aebe0fb7d80b0b6d3497a7adbb88cb6bd26cb82109c4 +R = 05a530bf1135ea6d599928cb0383f5d391d19be333b1577ee4eb6f2a78b54e4aac0e09b +S = 06f3033cf392f698d1a1141cabf138c411f4e20687920f2915e17e805e8657a887c7953 + +Msg = c87c8f3ad5c28a027b28ae5021dbe8d425f74181d519451f1fead7a1f9dd102fa6785b147b610610cb59bfa91fa363bb79ea602a7d7e1439f874c5dce748e5c320560c2d9676f3a948754c72b6db249478b7e19c9829ab4de2e344535d3e0b7c20c272f82556a280ef491524b255c4fafb9c8ecb87b0149ddd9d7bf6159e3337 +d = 17b65c66514019ff935e9d571a4e68e9ee4463b7b9a754b93f4f7741693f4399879fa8a +Qx = 5bfb704629596ed05096783e49864a11874f319b4020917f1ba700ddb0606e6e72c1793 +Qy = 69194592be64c33c2f63771af0e4100d060e9750031048002680541815b311ba8f7ffa9 +k = 171b5c698175300b95dfd5ed8d3fd7cf4e19105ed7193b6013103555808743501ee8c46 +R = 13f001f287dd5c7ad9af8d0105b47caed66ede41dc1e121a602610ce20e41af91cbe586 +S = 1433d5263d5233c40c0ca526b3657fcce8cb88ee65105b5f5ec82b26e12bfff11c8812a + +Msg = ac7da7611e2ade20aad64b418a16e02e79ab4894d758550210eb10013a9b5533132be701f8843c840807c4167c38d21dff168d3baa65d5bcf285b73dcbb75819f8d7a20a849de335e19bae2aab2ca560b93d340731f291599a5b28afd7737460d291105cbba6d0290e836f6f6c1113d1b2faf90ac5de7c64e25206d79380a4ed +d = 17d2071f39ba35515a8ec977ddd36ca15983e15bcda626f15af61d87d58114f4c80a8be +Qx = 6f09c255fdaf78d7d341fde4586526fcdec34a28448c7fe65685a67b6c33564ce9249a3 +Qy = 24ae4483fcbe3f823a7ce53db96ef2f6c68670e107e68cee4f358dfa844112d6b2144e1 +k = 1403078da10f55724fe7b56dfc55990507307386ba82ca8f6340d33769ab1f6ca894bdd +R = 0a54a35767a1cc77b2332b04694404fe5a31ed8851ccc2abfa5542b0f5acd9be9b1f02e +S = 0577e0a1937172a6d45177c2b328d72f75a08a8a774a31151b89fd451d531348695d870 + +Msg = 5757c472fa2f81430dd920f39b61066a28c870b80e6c96f822f8f19b398c3574d159cc22120454dcd7e97be8211916e4bc8db365b2dbb99a6e597d06e6645046a0abdccbd06741e9c0eedf33cb78d78a540c2a390719acc498331e694e6b0118cf4f787b51c7b7237458a6149d6dbd0a08bae8097e919f970fde920485e9a0ac +d = 11504659e12235855fe55220287a101e511d39a627f8a0d414446385d4a88f31507fe74 +Qx = 192fb9bcd157c7ef385d48470c3173ccf1ef9650da7d680d8473d45ab2064a073232ac3 +Qy = 14ddf872b711157d121b0a61b88a7eeb7cd260f1f82ec5f62fa2681e28c7f2640e305e7 +k = 17e10962721f041946bb5ffcce724c9f284b1c8970f974a069c36dd4391adb8cecb8bde +R = 1546450d25e2536aa14b8751e3b3e7eeec8a6c1cd967ba0f03e6bfe64c0a59072280636 +S = 0159c8d6499fcfe8ac7b2e84990a714d7888d883c16c016c4b165f36d62c3493afa67f1 + +Msg = e350383d04af0f4081bf09b95d1d53040e7acc64e56b13b653df31dd119617b800e0cdfeb935dfa5d94f1d7814688d8ce41021810958759cec76560e1e5c0581456acd1a020165849b2203f1c11d318d816697f36a86b59f160faeac7dba71682d3c031d0d547725ef69cbaa28345512e38b75ab011911d8924b2d17a857a96b +d = 16e4cbabb03215767249ba2a608708b78d7387be9e77f5efd2462467fa05e8dcde2c036 +Qx = 112b7ea5d21df8ce52772a1b76a52ef6f0da62cb7718a467a034618b7ce701a05cd2467 +Qy = 649e0ad181437b4eeec87e202d8fab1c240f9dd9b31311284c24d89160b1895be541319 +k = 120e4bce412311d3e7adb36dc11d4cc1da8a4b9d6cd5219e772b3dc2b2b8ce08833748f +R = 1ff2d53a8e6c1c23807eee681156a146e8f2cc1a8c262850dc69dece31860bf094e7f73 +S = 1e8906c0bf2a5f922ca271def90d704a1425e5cacc64bc5761b000c7df0f8f9fab51f2c + + +[K-409,SHA-224] + +Msg = f153cc61981a46d8a47d17d29ec157fa93fcf644beb84558db7c99c57fb131dcbc5b65581ced5ff0b29bfdc66ff703ecdd4290f7c353c02a3e6d6867f33f3dccd1a0b6752b8a35fa143f8921a5078af9c85b212564c5b795da9858c7955095938fcd10c21e35e1abe905e84c8b4bc05f2a06091ce876d9519b96951d08c7ac9e +d = 011c6528939672bed3e8c905b7ba594c3ce95f37fb28044f210cccd01dfdb42c10e8e1a0b5d6fc757834ca7f08e98cbc52b0edd +Qx = 00b570ec1fd09d7b4d102f83cf37129d94c9cf2f982b702c5d1172bae2df558008518493c08dac6f76a6646156f123c4f33e798 +Qy = 0e3cfe1aafbf25a5a4536d6c0cfe13a540b4a3c97d4e7bc6c0346addb4b0c32dce089a7a5385e8a3e67606b45e2062c642bbbad +k = 027cecbe83853037cf46aa98e1e1e552a96af0bb24e57756d8239fea5d769b51b83f195b7801b562259ee644ab4047764d130a0 +R = 06a1601e07dfdff9d3b4ffdbff124b717403490853099fb4a00ea98f84ddd64e908f99b40a2ba6ab88b2491a8d948fcc2f207db +S = 0741d27c0dddca3641b56ba1e9bacb0da1fcee46b9e33ecc6990b98cf0db74668ef1009a50e5d55f80e6642ea48689a529c8a08 + +Msg = 258c91524423b5c876432b1930c7b07b56eb5e3945f1e2296a4e5bfb9b9123f800ad195d6104641b1f1970bca553c2032f83d17252e52403a9381c1fc18eaffdf026f7537aa27d84c5e3d6e39e651a92a41139cec5181fe794457f556b390943093be719acd23fa1ddf7ff0aaf0479484a381a309b4f681af74bf97caef08c22 +d = 07e3b714496dd118d8f3f597961eec5c43d0265bf85723b0b9b0616977e0acc2cf686cb6afa6cdc19114e27ab000e762dfe467b +Qx = 07dea0ceb73b9bfaff7147a36436cfa7955eab02ce7fe9b60dcff3e088c5c9281be5907de3e06ebb2e21dce8bf3ff85feeed500 +Qy = 1cfa9b30af20612666e5df798f91eb4647d8f5e1747c1b18adc6b73a848d987434c56d13ad78b775c4096e9f20d4878bbd9572c +k = 028a8353c05129dcaa7caf0343130bf2e2186b9cb5ed0a27a565e1c24eb882617cc299d486be76fe0f8f3c52678b6992288d7c8 +R = 034299ca2aaaad51f12c90e8205da305523713516ba6e7d245eed8ef94a1b2409b98ae93476aed6c9b9aef50406860b4e490db6 +S = 01a1adc76c65d77ea686d769dcd007c0101b4cdd0934402fa47dac22f8ecac28fc05c2f6763a6781655ed5e7d84c41157255a4c + +Msg = a16a0d6fd57240fe88c7c36b9f7f9040cfcaa9afc4beeb8300818c5f90cce73b819a12c31d42af33146399cdfa4ed4954d068dbb0f1f342269dd29f1fe357e7224304b67b0f924b794780fe7e6aa9dfa3380252fe7177b43e7b1789718949b9ec1b943c83ed4399491482f0f59d2cb8050ab6f8b5854d76c50651428cd29c40a +d = 0182d1e937b037bf7f84144f7d4c94c935269c9aae7d500aa459a7a0ec113b232dcf282908eee4c84b8106cd38cdc41db3f89e1 +Qx = 0bd4f1ee6a967123d70d488dbf0fb43aa5e93dee5794b4492277fe559776f740754850477e275cee9f1c375403a4933dc986920 +Qy = 191a544b98ba954cc6e060ba26a52fecbd1f0dc7c15381004cccb799a9f7960a3cedd02d36fcaeb0ceb844bb4683998d776dc5b +k = 07904af733742716366f8ba07086f924697ac8a01bb4895bdb5715081ee89eaeafbff4cec44eb0ce14e774dba71bb9b091d2594 +R = 0723b2068957c4f2ac1df69378fc013797a3b071de30b514c3e610002dc8bfced32bd2f9e8f692b653e736696cf818b0ecc1e10 +S = 058455b8f9abd5fcc28a4ef839ac0245c3feda1fdcbc3c171b6928c6abc931e8b0ec34382d63e414657e9319d2965fdc9eb74cc + +Msg = d02ff569828fd1add21f6bd1c50cbdcd09222e458ee79fd5dfdba3cbb84e9d926fcf196cccedece77d5aa17f8c8cbf3a9facf0f02c71d5c1c8aeda9d75f6fd7b6f2c5c70dff992ef6e02c438fb3c66da5a503b3c39acbe2a069da457595b542190d818015d462670b0807c401e36b1bfe05baff3a8ccf8d1f5f8de7840e87993 +d = 07ed09428f460724c8a5225a31151e031d9949493fff5703369c401762345d002c4ce424294baab22d9e71edc4f854510cf0e6a +Qx = 07fcd003a8cde5503f5582a42738738ac7efc6cdb3813a00c072fc114006be9881c0a881ca35988dcfb8088f3d07a03943cf230 +Qy = 0e7041e666c1bed3b80a691ecff60ad4afe3a544ce58030bbbcc130045e2c611d65f322ec78aff6757cb5df8ad54ee8a09616ea +k = 02828c8c4bb1722b0f03262de32ca8a605c4046badb20d8eb9f19aecc5c69f199aa48d09b61f285254425cb4bb5e0763dd471bb +R = 06c99d796c5d4fa21c5cb7cee0b7570edc9d7e9d7c3604f5ca3766b17e44bc71d8a74ac268b8713cc2ea0adc3dc1971c062b4a1 +S = 075962e0ccbda2280e502559f48c8d37704964f67f8cd3b443b89be740976f1bd929c175560fc8cfb282661c0fa792a5b200401 + +Msg = 57befce973b225cfce7f996fa5a1a43acd160681b88a87b7de04544eb7b6a719718f1ca7f559b6531bfc18fca3836d2be7f7a6e48387b7579a6845796d30e46f0dda9d82680f8c96c5f0989741adef9762c3db763cae2699cb6c112543635e20ed5cfb4b55ca2ccb32d2d13936085a8ff95ed658a54be73f80c912ccfe5f0ca0 +d = 0390f05b9619c27b800e99aeaf61ef7f6249367d5cfaeae3c7b523a8b29153eb8a77132f6c4412545a842d6deb7b7aea7e2bda5 +Qx = 1cbcfc492a2a6bb8a7341df67ef2bcdcd706afabad5e7ed1d63387ad9b0dbc47ed17b82de6de936752632e43c393a93fc5cec0e +Qy = 111768994b2dfe9677d9dbc45d4b55fbbafdaaa2b2638ba1605c35301fa557d628a87d0a7febcad9f8eb4b51fc9c807652579f6 +k = 00b8d236a9f8edba7b5207b4c7848807b933b214fa25cfc5a0e73f750d30051264bb9f6702837b0f65a451d4ef24f047ec4e9dd +R = 076bd4755427fda22a0f177624477c59de12a12621aac274b980b5e1ce5dc700591eec13dc5bb48c5c8643de287a07a48a6a7fd +S = 065a5b0a00548bcd7f59518f122d79c7552ca6097f3867604b462201add5f326807f0e8779f2177f277e5ed25253885ca81220b + +Msg = 4277ba40cb462860ca722cb4ee71c61836d2ceba18bc91f3fad7dea478972c6da0ebc02815eaaada1d1a5e93d7ab353855ccfdfc94a5742fe18daee2328871e06c1ab0a9a989d1239df2d2d27f96c415e7ef9a941f06c6790675361173cc229aac7045f49eaca207f59c497619ba32e932b5c1c6576812ee5b146e2cc7de5e62 +d = 007d18652732596add3db31f7a0ce6020d03f3df58131b0c7c633faf619b8210cd309d6c0c4083aef1a1b6d2a756adad0bfe344 +Qx = 15ad0682962b4dfc8901a0dc77d548ed616286733cd9b3ede937cdf4401ab8b3e3516d466ba43b6ab5356c4e72845767d55d27c +Qy = 17e4de3288ed44b48e7c47b16e2afb513c9763d5bf4cbf9a357c128c94a758e3ff946957df461531def2b8d8411b81f45f0c2dd +k = 01a896c30fcfdbe583d6b0119f467f47758ee01d4d601eb698f444ed0f76515c2b8053b11ae7abd0eef7aa61145a53d12d560d7 +R = 053b1cd57dfdd8d1802f3e295e450a155c366bdc2bd222d18a4d08369c25e53f1f633958b22d80755ecaf8362d548b28dff1ba8 +S = 069339fc6058762a99576a96e76f75275f848102bcbc281e59fda26c98fc48a3f1061755e80740a233e03287f510f4549bb1874 + +Msg = 57ff6792ed4b12220d179bc0ea57ff217f322c85bd3676a681d32d7e4a3e0c8e891fd267df17caba5992f68c35ff670b60b4bbdfff82404f6ed996c30539bc395120f97d4d7a652eaee82bd8f9360bf8bb73748b8bbda9f9480eb54f7eaf2609d4259329e8a5ea020521e7dbd3ec56f23c849932cbdf2875f5d5c774a9d6b0c9 +d = 02a91244ea4623b63403dba807d60b914ca3b901a2523244c322f2f11251446d3f15e869d086ebecfa1a39ce304e8b5c8de23e2 +Qx = 0b7ad8f0a52ec21e54e28ef603d76652dbfecc7dd2427cfaaff3d280f0d1f62187d77effcb433b5bd44c3d0c0d26c38d3f5930e +Qy = 080641bb0163130be4444f79c500ceb8d6a9b2cac42d21d31b2fb29da075bd41c6613f278944adfe92d3c99d494be9d4714e9b6 +k = 070125c89a1262a88f22e874c55ed149de6d961d6abaab2d13db9174e3cecb8f497529957058a0afe5361ddf9d3a5a3b923c7ef +R = 01a28cfad13969c6449e5a0f879e01ef7dc1cdcd0bc77d20f3989c588a9cad12a4b52743c12f4f6e2154ad963bf234ec96263f5 +S = 066d7f0b364a640c6c620e3d030448d155cffc9ffd46a6adfa1c13e1b01892463a4724465aba3eb07009fa604f3af18109cb72b + +Msg = f85113eda64478f460b60f8084220134933de049200a5f37884da7901471542e26690a5fabc3cbf9e679ade71b6e54d869bc136c3d34cc4a9efcafb777abf046b5ae5429136112a9a36a475121eb1f33f1f43481286fc1ada98a41064a1fa38c89e99a93065bb2a119348a9e452497fd5a0d2b83a66b09da9f47a0583732adf4 +d = 0068c56c6b5d50d1d4e13d3837d8c5e8ba2f825e121b63e97603fdfe78bb6899600ff0dc87b6b3b6868ad0d2f62b7b7a31603ff +Qx = 0d9a4f5992308013573f97864c23b98d276975d80cd6455e9f0d8a62d6674f3aee3d27dec15903da4e9d5908cebeb765ee02c80 +Qy = 01f61189caacb05dfb982bcccd603a769d0e1be8f9223288b5426e7f88854356fe825f11a88918085692f33b0f4c61ab09a861f +k = 02ea7f0d81fbe3d4c865ff5315d1cc38f9e9a8653fc91dbdf445b62fe09b30ccddf508783ad87c8a48a6ccd5c9e817fe2977f90 +R = 02d7847479c16c4cba834ce5962724f185be06cc04a9a8d710cc72e6063a7b64fbf2694f5b62de65d3d347d34c0dbfd5a4d93b7 +S = 069e32bb19d20e873d0e62b306db4d5663576e4b2fe75e8ec79b7a63f38c8f1007a817ce30612e8578d48c63b04b1d34904010f + +Msg = 42811e9ee6dc509572e1cddbe5baf00afeb0c5c13e3755b922eee9e210001676082bc9edc3d78db2b5bebea7a2c0cd2b369226c2b8f83b28f33fb513407ab9d287d14b112d6c3be2493805ace5cf6fd366d03cfb28f4ce3f0f060880db64d6962e997463ba7c05b6fcd1e66babe4b94afc5c2d38c7050c69571d27b66ef0090b +d = 03c88084f8b78446db431bd6e240a0c050813d2a763675b0ea869cbe183df697146cf29c03479af3d34587a95cd257027fbeed8 +Qx = 15a09436de00d8d129e297ea60e04b704c0a8183d64a77d1c527189e25e21d6bb62be8ef5eb2dbd833e5f9c7d5c3e69c9c01882 +Qy = 001c32ba376d2e9de28fca644b0d567ce1f4ef0aaddb2adec6213d03bc8cc99f9140005bed3cb6c3c0f5533275734aaec47404c +k = 0132f4763959863a32919eb591799ffb8613797bd0b617c73654ec9eb32e2fb86631b66e28e1b4cc4aeba65ba8c75aa1cfacd73 +R = 05fe0ccbd430d9459e0093cfe2c1d1d3edff8c1ae7111299d2e04f414c46ed2cc88ce9cc9e23e187e87ef551de993f52214d609 +S = 0557acfe6347baafe031dc16032c45559693e2793d9b6d372670b09757c6f4a3e5ae5e55264137d1859c8d9f8f03c25de409bf9 + +Msg = b38f76ede7441ae0887e689d556f43155b38dab7cde487ce9ef9a46f2957c830d4d28006873fe2368197a6931f6fcaad755102686a457a7edccc8d344e2d2a9162e3d71d41c09a022539ae6d404955a6ad748231aee1f974d4f159940532fb3b1fa0254bfc5805d2fc68696856fadea386c542d3cefd1be3af04ca595e54be25 +d = 051af7b63bf3297ae20517faaa1552f4fde65819dbbff6a52721611e5b7dc1242ed6e69768cdc37ea8cdfd1a5971f06b84b5803 +Qx = 09cd1280a2a79b182ddbd1712dbfd12cee3345a89636d7673a5fc3e1e51400603176e27d538e90005625aacf5cadcc8a8c25532 +Qy = 08b5aabedce498476b4c65ab3cdc81f819c2db670a7236c0357a86f9087b83e7568cc6e5139fb92f81975756d7dc4f48be87df2 +k = 00bba308a3eee9e3ab6d2482bb728bf44cde9eedde15af7300c57c2c1e6fed2ee4e404aeee3923e7871a2ff4ba6df64f9d01a87 +R = 07a9e69664b7b81edc5d47c014696d194b2ca4705b2e79af692b285ec476169d041dd9eef20f7d496fc49b8597574d2602757ca +S = 01521d7cf6aeaf1c8dd54a7776cfac02967983083770346d9768a2629d606be90d58ea82377413a0fcc3e4e66f05a0d05d933ef + +Msg = 356dc86cef7979148e995fc5abe2b14a7d5e4e42c9b3509b4363bb80c581a66f4e7e4aa53a4bfd37f9a7eccf75fdd726f348f6a3f779e6599f61bd1d668517f40453b39bcf35db0852a6a6218198f52b7ceda2ec55fca5abe8e5d93af9a42b9ae4de9530c5870211bacc27c39aa094013db703de2fd3121f08d7e97dbd4e8946 +d = 03d65bdec48972d03811b78150a06956eb22d337dbec5416bbd8185a6322cd8c0ff8000210dbd1326422289071cab65175f5d10 +Qx = 00c9c1bb0a80c4b4863d78003e21ee60fc553ff72968c165f6eb6940250a6cb7d545c6aed3760e42370df79b0d37c2d1433c486 +Qy = 01a9d994828ac09a86c18b9758b3f6b91a5775931a7a6e4d8b052204c972b993a3b420eb8ff7e91df77253a9f5847c5968b5636 +k = 0156d12708324cd30037753c78225d183723d3f15930f23bae854f121094bfffb5d7dece1fca93bbe7457a2237760aef3db8e3f +R = 071466e80e2a7cd8e6cb6dfde259a08619f880a71899c58bd4cd33c29f7b321d269533720101f2ef70f5b8e8f05c9cbe1ebc303 +S = 077330e08712ad709f855d92355cfb7d565efd806c6a853712916f7c943bfc79e496366deba79ef7491abad23086db341f339e5 + +Msg = 06fd39a50bf25e89f1071ff81fec5d1e35b6dd68990414ee403dfdebb792627b6a4ae3d2236c159e4441ff90b61ec87b1592c538515f0486b19e58583394a05e6411e69b4285d6d6589982ac0eeb2c912c4948789cad741183663fc070943389d4e9a1150b8f6088fc50605915e9e24b2d98a1f539024770e4820e14ae42ea8e +d = 01f1a8b5f35dbbf82c102df550c72216a243f986f0325920f6186a16d1da74228cc02be6024c7411160c183c923c743354f9438 +Qx = 157ae8d90fe2416f70a7ce0669acdc0b5064ba650cb5416e59e6672e45b591774ebb2f793c3a58e953da1ac08272d0b949e7b50 +Qy = 06d49b9784f8423812967b857e25dc3af1312a6ff29579f6acb6e155b6848ffac6fbce51bd2d41a22ef955f690e2487a4bbff00 +k = 04cc45e00847818397c6abb3d176cb8bd77814abfc253e3b0d799dff2c3e09a5195ed5e6232873f2783c8e670b52a839e06bc30 +R = 067b418a5395216b83ab00d5568eeb62ae0693af2b0e4d052c6feb70562dcc06ef852002687099dda114477871b924775e8460a +S = 061d1e4d713689b2036272ad41571759b52a78e0f8a84d1f3a277aaa33ad558f0b71f3c5a99d403e49df1afab66059db20f9f32 + +Msg = 6daaa41150ea252a3e966a338377307d909b95080e006f13027f2be5059d9208930c5a329994c0b794ef50eb059bc6c215f68cf42260bd410f9bd86d2ad5ab7179c7c92de4a93a5f6aa17de5aefea815e7c0b78a8cc53c21dc4dee037b29c9df4e12343109283ffd5d8a3b81fba1b5e95506c7e01ac056c86dd0ee23bc21af0a +d = 031dc621200cd174193d95e9092ffb86189c52cdbb9ed937593f2cde7c4a0264b9100e1b8407336c8dfb5520d28a18dc4e39a89 +Qx = 0904bb904d50bff09bae5dd21f425c808b41001ac917b022f7e1cda6e46504781a69baab4a6f0f100c4fff9ced26f871159cd30 +Qy = 15cc300b0efbac707635c72bf855de4290f1b8b70c16f9bd0cb771ed5c760ada04d0ff648f118d64e0aff6a6de16def15cf7437 +k = 07e32b1fc1cebeec3d84f56a67c8ea2b78723e7010a725ca4745e849e573e8e4a4ce11d1af4ee508b80fb5336de3cb53161bf44 +R = 071cd81dfbacbb67be5903cbcbe402c0420adfa9d14148bea600b178fd06278572d34eb46d857085a2a4f48cd4ee9109d607dae +S = 0347b1029e67a6ea2a45af1f7410dc951db813eabfd3c7f3e2c294b81e1c54fa8c98569efc580b68007bfa316424ac6eb353ac2 + +Msg = 6378dd1c12c5197b57d47dc46a67949bdd1e0809004e94d49b0234126a08ad5bf8723ebfd132145813136d8b7dd096f56c34248f09a65c34f60c2f80f9a51b3795f3d2518b11aaeaf6dd45a323794080b78f85d629e5fa719b6ab0b14c78cd908befeaef0dbfaa08cec9318bbcb376d48b11b68735c9554a45293db5e9239ae1 +d = 016e6750245a88340b0f0665b890459f8038e9b1366f2fc1326245a88d4c523ec94429f21869ce3dbf75126e58f77241c99efaa +Qx = 10184fd47e8e1e4d534ca1cf67f15bc8a80921b07e251c22eb88f25395e08d7a9283774aed204fb5c14aa13c63a94ee691b4ff4 +Qy = 1252ad972bb8c0b286c222f42f7d42ca6561bac5e517921bda53e51043f13e711da8a813bb6880678e4d6a16820bab819d62e59 +k = 07f18539d00152f5b9a75d4f114812b87024e8a8f9c9a8d12139d0a74d87986f4305bde60375918ff2dfdb88b6deda640e17364 +R = 0735a15e7bd1f69f4e90739d42ae239a8e9238ad28b63ce291b57cb5b99922fbd5dbb7f74fcc23117243efbd036eded6ee0f28b +S = 07bb3dc77cdd4138a02e2d5fd4f6ff8516b4c95b8255c629132ea8705c399fc60f8fb660ed3aae52db283aabc3626a5559dfe85 + +Msg = b898d0f9bd80e083fa541f457d14d853bba55b120424a95e1d9511c8833f48444329e0349d68204c4b4581ef1c4dee23ed0a4445727a72e1e6cde422f7c10ae132a3fe681f9d741fda263e73f7cdf10759467c9d76164086abf6780ad474772771eee22d195339bb8f6235e0d992bbe282b13ce4fe01417f507a2c4fa155e108 +d = 0788fabdafeebb72f6385301e30024b56639e629a400f9c50d402cfc9b5817844f06a451fbda29c7ece41dc9ffcfc625fe0ff0a +Qx = 09b2c36d221d18189e1617cb2f2ddcd64cdf8a42ba6acc55f04e9722b11588f7fa861a3940820d9dabbab631d7fd4106c60f37e +Qy = 0da099cdb10dfe2d7c0a16ed332b459e7be31f44b0b2d595dc948f0b073ac4e439f24f215fba5ed50aef3702731d6561eee1986 +k = 00581369aca680beb705f52b6bef075de83ad29034c3d6b2949b551a0bbd100897a079b49d41d5030e1a6950fdb14d70dbbdb41 +R = 04f62415c99c8e6750f9c41c31cf050eb58f61f62eb0b0023d61dfc30e7879d4f5a87e88faf55522631a29fb69d16e15c354323 +S = 06df238f34b5ae664860b43ea11defe3120591cfa371367096006c03e83d372bfb70da6f789665136b7dd1c59894a2fc5038c4b + +[K-409,SHA-256] + +Msg = dbe04561ea8579672a2b3afa94426a3cbc274b55263989d41a778bcb082da797d84d930ca847a481789524940701cd5f1d11b460bdac0bffb0b3a3abe1ab689c519700de85a0a571494ba0cfc3c865450eba7a9e916b7fa9df55e8a1c246c992e6a0b44b78274e008472bed8d8411633e6520e1a906c5d0c8aafd572fe6f1f64 +d = 01b8dfd64563dc219d6eeb53f2e3ad1d771140d0960b211dc1f757af5e297dc7548d6133ddb574711d466688f80dbd65a7bbcdc +Qx = 1ec530638ea0663cd3a9b237dd66402adf50d3094391f2343d7d6c52c1d14145c245464a3b771e4b1894462fbfaf440e53eef7e +Qy = 18349e244b24c8353811c29a60d8e02caf195a424aeafdfd0361846d5ce5eb83da1901700f00fcb85a0c2543b49a8a3ccbac157 +k = 026a26cd09c9329cd45ceb4c798846dd81af67759794f5cadab84de19a835f8a0ae49b12853b1e92822477a73891f85acce4216 +R = 04d83a5f9dad246717135bec6e386ec6b73be9ea6d1a17334ea2003a723d510914167d136254d6cb64b16ef7eec5044b8f2ba28 +S = 03e81601d0c66b507a491c530075edc5b09d770633a4c2355b3b1c7df9b200ebc7dcb706be1696aab70d4c6e1c4a7e532284670 + +Msg = 48a8300820fea2ad83c83f7d6b24192715329c3f159d56644e11ed25efcbd3d31600a813b909812987b97d1087e74a63b4494cc031c63492b6615e9d6e5b36f62cb2ef88b9f736595800de465789f43811165a5fc093ee6d776008739de8de2a84e878748641be8bd52e5b891c4145f52bbd46644852a43108e93d86352b2a3c +d = 0422131829608ff730c24ddf7e8b4a2600eaa9681eaf45432daa7d41fe2fb488fd0199d431a1ed823801ce21f4f01a4dd4248ca +Qx = 06ff24eb0ab812303bdc9a23719caa789eb75775e686b9511bf6e07d60447d1601a48ae7f3041cef5aaf3ed2adb6feb422fbc54 +Qy = 09a351fdc9422a81ebef5407d0d74b52a348caf3cf6e1c6c2af722c408941de154619a1d54bc23a9dfc0c4964f3936d62daa6a4 +k = 0313ec63c34ed325d770664aed3bfd1a16eb636516eb686e806b0acf6f0d117998b30fd52068a36f03d0db3ec13e6989c6f196a +R = 0088167f96d807bdd61e65fadaf0c56b623db42b831909d12641e4d00e7bca6077b36cfa759fcbbf087c31f294f20a09e0bdc96 +S = 01cbd06232b4c73cdd13208dd254ebf9351745ee6196e3a94b9213e931f141e4cc71f3d318a67e7b8060e11e88783fca0be41cb + +Msg = 276e3a986ce33256014aaa3e55cc1f4c75fe831746b342eadb017676b0cba7c353b3a2b554522c12e6aeaf1364cd2eb765a404b3d0aa61258194a30219d76d2bfa98ad20e7e91756cf65e50d7914157f283f2ba3930c0ad3a97532cc747b1cb9c806fff497f0322025a3d02ff407fc7b5808585b91d95523c9d5864efdf7d983 +d = 0095ae8e4c7e55eb5da01acc05ecfe72a4dcd8ec152f1c8dc165014f70eb4e4a7861aeb2b96c418b2d4db58659e76184e013a49 +Qx = 0a3987d7262dc30e8ec11458ff7091ca993bc61f142ee535d544a2c88a47f9601107619617a5e65cdd6d5e1a034aaa223044342 +Qy = 1fc8af29d5134ca9baf92041b6d6aefabccaca4013c55c1581ac05db6141290235ea09650a289907785d282cef1b9efb381ae66 +k = 066015a77c99015ed6983bb379772bd90e03b9c010e695853ebf8e461a20fc12b20bdda47eef856f162dfbd9fd4fc1ec49105d3 +R = 067c49b96e5bfb6a6d625346c3ecff13b8c8b7e59c764b73b256ac970aa4056460000e599a8195f2d235a75cee8e5634acfa7ed +S = 03ce25ef1af0784645f0579da381542f5b8aef377e5b79193314f84853e2a07a4f1aaa4d8210f3a3c249a879cfa3ea8af43a929 + +Msg = 6a4fc1827c3a7256faa8ec6a0f3d23559d6949f8cc20e7f76111dc4ebd59213951cbf0eadacaeb8862d6baa0cb298645e4314b1c303bd0d5e9893304d4b7fbd36ab05fb6a5edc3fef763e3a4124d61539eb616b359c5cb55b5e2bec50c91dd95fc39ddf521aa854216eb5a707819fa6f067b316a17a3b146e7cc2dd517f7d63f +d = 006f2075bd730f34df111ebda919167b1d3358ada32cd6747cb3353bcfb814a77ac70cd51b31a0e538539453bf9eaf9d8b384c9 +Qx = 0bbc153deaec0bcc36c03d24afd20dacd9e78d104d94c279278d04b597ccccae43cd3e64c9e1e58fb5408f376dd7827ede9dc3a +Qy = 15ae0d803acf12d9d3fd41f74357b1c93cec0480f2e586d0e18f15e569d27d3d106e192ee0c1c570351eff1f463dc07d3bea933 +k = 0314330098250e38145d11a48f5043190c6b44f8572ae57cf83b1f3c4c03ce38b90ed5e157464c2613c82943d78c938fcde89d7 +R = 0160b20c370ef4b9cca3f7dd3c23f70efe6bd80751ca021731bdfb0f45ae07e5f2144c77795aafdb0c3a92ebbef75fb2d334dee +S = 045188dd2402ad36ae4278a9910648ed5e71d64737651c133aa89850e3bef2207d58ba4169e471a4737962f5fafd50a37a28e1b + +Msg = 4b088199bd8c94775d8ee508377d672dbf50f6d2c7370e99821ec8f9387492fb2eebdbea473ea18465565f79e2af418555f10c4a527e05a9e20c9c00b807dc8b350cd4ccc2d87e91f66addf02ce4f43597aa258ac6fbe9365cc2c8e8bbe5c884abc929710e8423cd6722a8f473bb55804159a92a3d8b6661a536b4fb9293bb0a +d = 03887d284e9ad17d38bc6da9d83c192a434c509340a7f233cebb032b09ab7c4c6e8730b4a80844898616c9abcd16b753c6bb4c5 +Qx = 12a6d5c5690ebf14ecfa54ac97b73e88e16e757c34c6bbfdc9a3a119f298860d330af295756dec41eedeadc5257b202451faa06 +Qy = 19f40ff28bb72af659d5319286fe21f01819952d471ce2433ade745042a47c2dae798199c364ceb99029c2dd5cf57ef5daa2b00 +k = 035945b45221300f83c5fafbaf0645a7386e209d025b3e1dc367819728f630663fb732b251a019e08dde0f64dd3f60a10065c50 +R = 00c323c86e8cc548123d1337936d4be948bd4bce4631a2194c2bf04e1fd714df2c90e3681e41a21d58d9567a5df9fc478dca8e8 +S = 0493d3f4d22cf8517c301f15bde52cef17c05fed2482f3ef15cdbe32c5f0975e054d45b13faf906896201942f29e5693bfbb229 + +Msg = 848a13465ddcfb2dc14f7bc0db0756832c22dde1e31e4d8b3ae0dd1aafbdf15e954889e95d3bdfd6e5ebb6171fad62592c23277a89e8ba53978c9b1afedfef7e1c3f6d9f31077530460b47834b30bbd84a4da601be988738aa815d3d7e72043243a5288751ee08b4815a017fb5d9bd55833698a0d526b1ed79da35ef0fac93da +d = 02ea5430610864257c9dc393c3addcd0d8d5bc8aab1067643b08857210464428aa85cf1ae6c743fd2682255d4c8eaa46ca21e73 +Qx = 1e502d3f47823ac7207861855fe6f6aad1fa4f2149bff2643b079da23fb270599f744669b3c8ceb4cb0989aabd43d26d93c8146 +Qy = 0cdcfc138451bb59f34dc82b8128088b5ae0cb8a77dce1895d5ffdfc8b4be24a206b9856954508b82b80d0163b276683489074a +k = 0426b90275d720d19c6ef5c8c74c568a636257740530e3ad10de0d518c4eaad8bc58cf4506cf5cdf7f2b03edd1caadb28fa3787 +R = 0123ad87c094c4ccfe4346dadad54a6b1ee1bffaa1b7b9094fe2e6ae785a2b77ce3f5e568e43e8b7fa997206262645f56078657 +S = 00d56cd5cc64736ff7ea0d9840916b1e1c94e11611f93b1b11c2ee98c79d92a8af1a560c9938dc4bdd0b84252e259ae5669d1c3 + +Msg = d1850545c04ea65528849973c220205c35eae98826d169348970d1420b4d872ce233af1daa9e62f6a562544ae3a0633a954a493e9766dd5d87e47486559fdf86229a7c9e1726de21895abdcf2422d438f4ad98d88b45c56742694ad5e11894253270997c049f0f419842482f21c792fbe5613e2defecd485585f1835b6f4c578 +d = 062c757c92eaef41f5d81169ec4968145b5aa2bc1d2a3a5fd000634777748ecb93677b3da12e3be33272a8f0a52300f4a5a37c4 +Qx = 139660fb8bbba59e8f4e95e5ee5b97227220f0e1b293901fedcc6dab86e7c5a9d20c1a097ee2e926a934cce679fb8dcd8d2ed6c +Qy = 08ac510ddf735184e8fa9693da264194fb78da5d1cdc0bf5faadb33950ca191fe233eb8dac8adcbfe15b4f7c09d5ddeef6bcd1a +k = 026868bf1764993d650aaebf117521cd146ea20067cc14a5843f726a3d68e41c3fba82a83d406b2275b3459748b3bd1a8d32f1a +R = 05b17d13ae4d9535d062a2653bae4d15b9b859a87c33e175adc3ef04781bced888f3e93e9804b2251a40b9344c0f8c6bd5be0ba +S = 01ec3322c5beba4423b13a0528c71739a6b39f7b0e0e58a8274a8386167cadef51e5560a3e9d97447e3d3c06288459fe6569345 + +Msg = 421c9784d6fd507c82904e1054edf9bdd1efb58a0b211340086069ad38b7b0dd15c2345fa8767ef71254ed1bd5c35f742b1d3f4765ff9007a5477ba9e5d3d5a5cb5fab4efc1cad73701d4776c6c4343f42b5d94a9eb78ae428dfe5fbdd8e6ece09d5b75cf4346cf27db856352225ab04e6ea56661554fbc39916accebecb3935 +d = 048a313c0c11489939fc0cffc6ccb9f179093c4e13141b92dbbaac441b7ae878c9d412066e95615174a24692555cbbe904a14cf +Qx = 0677c2d364fa86b8b0c79af754e675ea3e806d5583e62087e01590b824d2730e31326591167f02bdd29f8178787c4e1ba9d2496 +Qy = 0e7f78c423baeebf6defe9feb8ada8874cecab083ca2e71d9d8a3fbe846eda69262a1f5b4a3baccaaa4f2cc87220edb1fa6b6bf +k = 012b8df87dd935775b80c62ed6c76974fa5772939a9e7372cb74e033fbae4f78d75b8bfbb82240cf91009b5bef4d63ded04cbc9 +R = 000590a9e8de60b5cb181a1c11c2f6115c66b05e71e0c558ae203ee18e54de68016f4c7ed2f01cb0cbaf1bdc45218c0fe2b1552 +S = 0521844eee9168a501e235de5fd19c84f052445fb0e68bba687ace45d8630070ddd3b73034d1d65788a51acf91273fd187a24ed + +Msg = 7910bab15b6429947655e33a67f41b76f1d7b71534f8904d6a0472c2faded038565272d0b5f51aa915e0d624e9ff48d50ebfa2f09324864f26c29ab73eb39b436c5c459c7cff4d2b62992e3489cb4ddfc05d7366b161a463aa1b782641d93507de43c8cd0a0a0a9d1c644f4554e3edaf7fd794248110ca9387e73ae5d00d299e +d = 046e2adfe5d3549e1e6fa1fe69a7cbb4ac9b111c8903d544268f8318b0b47d4b78fe3e56eb5e639ad5382e7cd5bd4b2c3e70ef6 +Qx = 12902439be50c97aae7b40328984934d6c843415f76f3821c8e8323aba96ee41359e2ce5ad3179063ea5e2c7deeda4d728d5852 +Qy = 1eb59fe96b269cc973b1fe1f3720aa9aa6ec4cf303c5cccbaaebe6ef7c9f5356ec5e76b26b09479d9831d9f5aa41ae1d61f4c47 +k = 031893aef1baee0e21b50cff7002435b058d73dc4d8301ffdcf1e0c315d18c2b16f282e5b294dc88369b25e2a1a19abffb578ab +R = 039281ef10b9a2664b755a2db67b3c410276a424edf7681a5c97244eaac5826368a8095f1b9b76f8e490e2783694d5bcf3565ea +S = 039edd50721dd35d1704167e8cb609f309b9ed73d3c1eece181f9582aabc647c5ec8bd258e5802fb0647372e4c3929cf59ae2d5 + +Msg = e6fc96e060b956c25d50ad25443f3c30a12d199a47451a49ce88307201dfb15ed816982e8888a28daa92eaf3c5584ca6ab2ca9e14577f84396de2e0ac214b24a2279f5e7b344fb7387e9afc8f0a2b77a4d024a20ce6183499b17096947444bbb753d9b39e5c694239d28f9c454bb05468d17ab564ee6cea3741747ccb7f108af +d = 0480103fd6180a431c837643566706e2b9597de0a1346a224d176a5b2c54aa4d064418ed654a5d39f4773fb509f86473ebb373f +Qx = 1d39e2772ff3d26c5936ab347bd5a2940ece42b1964f030c59ab453acd7f44716ba9d88f0828de1a4e730ab27fe1859915818c6 +Qy = 140b1b66b0a87de29ba2cfa799d944b3b898fe7ac43de68b01fb41464506e2f014e0d11bbc0c24996428c93bc1a5ecee5956bb2 +k = 06e9bd0290548d35168f7db7fc292bc161a7710b78ac49ec6a42c9423afea1310597e5978b22b4dfa192489323b2317e4714d37 +R = 055dbf88b6221dff098345226d59d396b6773611ca6e747d26d5d758760d830693df0f5c602859f9caffd0dc3790dfa08c527c2 +S = 03e679447b622c4b06871f2337f5a24150e76efcef9698c6fd463867508e9d7b803667c32989a881c98a90998944c070aa58b17 + +Msg = c8a8a0d41f35537e6fd523ee099eb45e1ad6ab54bed4d3e315e20227db03292e39dc1a91bab439c0d20e36e7fea6ef08983f390a6b5551ac3b4f1895220b2867fab95552cef9bd8702962839bd9b2c72772640e7d3be3c5889d226acbefdcb448432bc503e5a5fe7ae9ae7696c720a799f9882c64ae0385f656074dd8a6821f5 +d = 013c489e8311c6bef02c8f58903b2ba2a98a27cb935d75a30d320af9a14fa3cbc6adcce09235a9eaf333dd05f4b2f1694985dc4 +Qx = 046a1c0e7753cb499d19b2805df770ba54f1c6e03611c302c73c72902867c51c1cf9ed154b8f30f72002421029de7ba2d8fad22 +Qy = 02aef9c34c7c8216a805a58dd88185f40493086213cb4c85e4d226bb5e892aa37be353d9123e9900f8b0790a43d55a19d78c48a +k = 0491dcc881731112ad5e9e1df459c27381a7bf8270f97743466e178bf5ca903971b362b73fdbef8a75d4292e63e225396c7b32f +R = 048425b76147427b8b1969bba3809dd70f0fda24cfb0e92509a7824f027b61cd38441a691efe213f3c331da8c82f94bbde511d9 +S = 00df36683f22e9e86c88097d75409ea297d391550440e4327f67b7af1b09141a0e7a1db40c4b0bf4d60376a6636dbeeff0b6b91 + +Msg = 3407cd6d2845197cd7414a30fc3df7184da204222ffd65c4d16a12cadabf603de8043ea14f5e6ddcc22d3572dc06dec1a23cd924e1847ae285ecf01754e2d1247876431eb98e897e47412a2330bb32990f9714122109e94b38f82cfdbbf2eeb4c6f88f5dbf9f0ccb47939df8be321dcd9bfd9bb99cac9f94885fee7d443fbd87 +d = 02419bd2200f8e1d87db848b0379741685e680d9affe693eed49d82931030b6cb05d21a4965f4e1df2045c8513a8f574ca9f2e7 +Qx = 0641a6ac72455ceb142e00d6854acc5f8b86db7bb239a5054c1ed48dffb6d050458ffea8adb68613ad3cf5977ea7330268abaa2 +Qy = 1a954ab7d62796e5aed370285d3bf91ddd34eff3b995d04967db41c2171cb2157d85032c998795ed476c891702d63ff0108f45a +k = 02e9928f427a86c4491a47b31454ea7d497435af81c07bc96fa61f4507494fbe4ffc1fffa8faadc2a44c7e69c4f976661750f8b +R = 01e8ff4cb8c58fa48aaf61488cc4118df90e8c06cbd88234cc920e5795597ffdc0ab967fa7461082a49de56f02f84cd9d564316 +S = 06e77ac43fc7af3c126f997fe15011fa87a27479fbd5af48e28ccc2c1bedb6c0695291dd67beeec3f17cbfecefbea46b6325fdd + +Msg = ad43f8440071285d01fd79244907803601aff4bc5d14c77483a87cd742144d41c68269d76c9a83c09d2178bbcbdf99f927b378497ffdc907a75a3b0ad019e69758dfffa480871eb6e1e17c8539373de611a557fad120d0bd147f8debe5f09a02e56fb607e9c1253ed592071f042e42fee39775b407225a2b86a950d81bb7d7ef +d = 0722951879a65bfcb414e11712ee9431eeb32319e0ff28601112f89276ffc2b96eb65c7fd77d023f09914a53e2aae2c84652bad +Qx = 0a0304caec1b68b34c822a2a031145677fe515dda977f6932ea2a3291c6bb4fe8f297b7d3c632f9b3806a8cd26e32403c27fc7a +Qy = 0012d4c3231898a4202f3f251802c690353ae9cc28ae5089e259149bce444d31a38927dcb42ed613d4818e235884749057ebd02 +k = 0331611e81d3e6e3a24cc829c1cb9087a8c6f64c286e5f1acfb1ba764eea5ca55be544d3cb95fb98407fb6c8f9eb1b3f7ae7386 +R = 056901f11ec69f91b31f7f41f7856752568b7d34ff3af1a2259fe15ae0b01391eeaffb629976525fce5d182663b7b23a8001bb3 +S = 04e89c3155afda2e64c749536392554cc299b70020362e6701e3a649f0a63ae5a5da4efed5c73b5e8098c0cf47d6f4c45c6fab9 + +Msg = d61a3765229dcd0b4fa6c57280f851ec2bd54d3ee2436935cd6d94e0120d0844adda163995fbc4cd9d7275da859ad8ebf30af9efbdcfc31c7c9ef42bce9011d37cf9d15fb018e117bbc102f7d05750e5072f73d02c2f45509a55627a78cbd9082cbf36807759d1fe2ecbb92ab30cf28434941712d38bdd100955d611987b5968 +d = 03f5b5a772d24bd5454bf26759dbd433fcc7bae4f5c593664c4d75da0cdf9430d7d9162bce3d7f6e13a344259da5a7d6a1635bb +Qx = 1ca1441b1f6e13138880196e69743206ce09c439a507a11c0fed069d4ed23676b27a3a337c976c276809ae725229c9001708742 +Qy = 13c47b14e3069af070869c12f0f39e35a6f334d98210d33c9da01ac80057911f5a392fb5c8cafeea01c1953e97d47e744160243 +k = 01484461d02c0337e8113e51aa7d46330f57d423b79b580a544d372524a853db9dac0c0d16f733b273bf888271135a5162e70f2 +R = 0256d7ab133904a792987f8cea69e8e3cc674cd3c577f40ef6f12b31f52ac6366a2a3ea2b2272c7bab8be00ca0d17989b6801a5 +S = 020d82cb9b3b1f25d993fc18b7303db4cfab91c03a97b249176f9bb2aa5ae7f589c74060d25058c7acb6de1e888ff44481185b1 + +Msg = 1f3c23636414ced48fab6763eed5b22537968e6bf08c178b3d31fb1f6ea773c6979759701d94bc1bee7c354272811edec58eff50c93331b22723d460e56dbee90466b894354777b23b13a37d15a84c762caca70c01518bf34d0c2f072145d274b3b6c932b48bd815fe81161d8507ffbc2f783bd212c29b2887af6d2ffa9d2b4d +d = 046bb4a141c9099d531dd23ac440eff1f5b10f7cf34920b6b702311d490d25344c665ed5211d401def24986c8094165d10f8934 +Qx = 13db47ac0e33af0cc7d74f6ce647fd80cdc1849b15c349bf501c95893be5a440f85b9b029713339fb888d7a93632ea4e0bd8136 +Qy = 1f26f7009cede02e054d6499c9280794184e212e3e1091032fe0e3c189de26d04aa8a5909569017cf06ac2a20acf579ca81f3fd +k = 046e55a908f13441bab63e5327ac346781399d5a9035a72aa21df708b814b67e420b455e1410014cb53e6ab00f526ceb396bcf6 +R = 06db7a7b03d6a85069a943fcc332cb8c54ac978810374b12eaed4a5fa5342c8eabaec238bfc6107fd03d75dc2c6d258c218a186 +S = 010a4115161765dd0c22a0915a0d8cc01905de91d3f08c6d2d85a6a92e1dc00904f3be67fef000ce19f57157deb9afba7582b59 + +[K-409,SHA-384] + +Msg = ec69f2937ec793aaa3486d59d0c960ee50f640a9ce98a3becffc12d6a6c1c6c2f255d37d29f9b4d068373a96beadac98fd5203a9f229bfc70bcd449640165ae5128e3f8d057769e28356e73e35d8e9af7876f608390090892c67391ddfcc1c332aa61efbf72d54bc615998b3be8ab0a9d372784bea48c9fab244482c75cb2de3 +d = 06f2c6e9ea8109223d9a349fce14927618fc4fa95e05ecf9aba1546619eaeaca7b5815cc07e97ae8cd1e9973ac603f84d838393 +Qx = 1f5a9824584cbb0d5ed57f677caf62df77933ce19495d2df86855fb16456a50f157d18f35ff79b8a841a44ee821b36ea93b4f40 +Qy = 1a88299000c07a9ad0e57c22fa8f15218cd90ea1de5b8c56d69506ad0fd12b513ffbd224cb6ad590b79c7677a8eda47a8bdc484 +k = 042325aded3f71fc3ff0c84106f80a10af08d76d5e710a35d462e880e015a36d063599573ce2044537b9f62b51ed4fd2ed8b860 +R = 0667c74ee2d632aed13cad47e0b46a5176940652d7da613e4965876e7e22d89994bdeadd6b5d9361c516fd51a4fb6b60b537e9c +S = 026a01220a1166a4d0172428753e98caf0aaac5b0a09c5a3f11b2645d243991d141f59d6cc502ac44b70e7c48d6b0d7b6ec4869 + +Msg = 70e11efc78d7f079ae41ac3c31c96d3220f4abfe23814a2a4a78d9b1a25e838c3408bd416062e4b0a5cdadf0c6e16a11e00f59711b417751f5e4b43ecad99efbdb2a81c91a034e89edc94eb552c3eba62808563cdf64453a1db07daff8742aea4a9fa738e1322da316b26dbca2954b2bc0de6da7518d28e6677dec6ba8af4285 +d = 004212b7fd913d794fc6bb33e0276e349c052c969ecbf6afc89b28f75a599a9242acf74dec9f374361ba296ba42a38407f9b7d6 +Qx = 19220ebacedc60762877881262c0c3dc0c8a709fe2ea16cdaad3b680d7cc8aae8617f0acc9b5c9861ede651481f39927a24ecb2 +Qy = 18afd77bc7fe54266275fcadc0fe8d4c0dba7a1264c79bc31479f4bcd02245cde991791a7b7e65fbfa907457fb6d450c0985ae4 +k = 04c01ff477786304b24cb9c95ed70ba376ed6e4f6b3ab2f99ac575c92d3801e7f43bab072268705d61d3e2fd881f754b9c84235 +R = 00987cf8ef2b382fb25a6a542e688aa96c098f5d16be0c7d46e961b4a4152c372cc0683993843bf5a04f81e6068843582fca48c +S = 036fba32f80cd2e66bf31baf87616027c5b107f72f11fc766b42e2774e29e10e860577c0d3a27a3b49754e6a189680b7a638408 + +Msg = d922fa515e3bed60b517a2d37cafe4c041e5ab4b5c8d8d4011bf9fc4013dd8abf7add71fcfde5e71d6abe76bd0f749e960cbed55711c87b5629a2c39cff48ed7d0feaf5cc4765e576a4959521f9a45fcba0dc65ae618826447e02ce6e1cab5ce8d6c96c3211adbb0660de7df7453f3aa726016941d00d8ee536cc106a603d126 +d = 06baeebb5ffc89c94c3e8b37b9b0904e7c4b251d204894655bf3b1235710215c29820b9d401c9ca7df1404d2d62d708aafe208a +Qx = 0a0b2a185ad7ddcaa0d8d21b643a14948d3552e25875506d64e236a90d274ad1ca678e628acc208bfe6b56c02df9f5a36aa94ec +Qy = 0fef210c7137237da8ecfc2f069cb9390c132d1c6ce961f2bb3ca925ee727c967f8a46727c8811c94ef66f20836c661a5cd1c59 +k = 02185be104ad16abfe4fb83de5db067d37ca58510b786b109514debef56cceb4dd6ebe53b25127b85faf9c28b56d6586c26d60e +R = 0404831192b4bd453c0a7e850815ac3fad88c7a2da27d29e83ca6f22213635a366018ac0038b1fb1e4c512cac15b614fb69b3e2 +S = 06f677c361547c91428d0e200dd00777262a138afcd828238d132c56b2c232e2b446cc693fdc4013f05ce7021aea5b5b2f1b34f + +Msg = 4f64d0f6bfc542a0d4347576935bd68ca88524ead03b8d2c494061d0658e6c3e14576b5bcea5f2f992f54cfb52b5c7cf1dfc517205e0454510eef1b7054a8cd06ab53ed2468193f98ff0dd62faf076549ab2a270f259276d5729996c120792c6f466a74ab65035bf38ff2c055b43e2a8b8e2449a2375ddbfc18242157bd905f8 +d = 008e5f66ba53e7caad1feda122a80c32c82d2c32a7237b8ee8ead44ea8f2f01d77c7056b9dd60b92d051f060da8532c1fd0e8f4 +Qx = 1a3d020a0c7e3f3fe5b3d9fa6b6148cd0c481b4f9e14dc85aeffff35e62545654fc313f930ca2e33dced28ec28d0fce6ceaeaa2 +Qy = 13c1ac166c3c088e8a4a9d44556e3344e52e8741ed1a8b526a45268086e2fe54c24d398553d509439ad4957454eb68af594e683 +k = 0095caaf063abba5073aa7123b2c0e1666d29bfdfdfb0c484e18931d756ed0845ea15dee1e9abcbbe4576113a8806aab9476b16 +R = 04d6e33001933221e9eaa78da5874f639749c7396dae90f2da4ccfca15b50ee9e50521cd84d78a098e0c383fab0186b3dfe1b3e +S = 001e17cc7baa3e9ff4d882da970caf7d55b4e0fb7f0cdaaaa8290fe2fc9cc31d51b34b5dcc825bf6799ce22fc95382d46f3f98c + +Msg = 7047d478ec5282d55db8c19c97af10951982d908c759ff590f27d57e2664f08d526cbb2bfde39bdbb1aa3dca5a8d3feb50b868be6651f197abccc9d8040b623de367e2ea1d20ecd302afb9e273f4be9f3f64f2c2eb3f92d5e0e375db6549da2a589f0604bc7146562ccefd15995a7c4208f640e7a17afbca69cda4e173380523 +d = 04ecb22b44e809f89b16abb10be062c89b41ee34e110403e42a20ce59a99afdc22f6f6dda56e1d9d1b8ce1d057f390db111def3 +Qx = 0dbb4a6ed11f36eb78417269c1b1e9725eba1666591afaffb5582c8b4d5bee1d73922b0164a05bf21a12052171abbdd31305552 +Qy = 1eb385afe8588ceaac9f39a5cb4455e02bca48f3d2242730e0f9e06ff1db24344379f96356531676cd5af234a120f4b61f7e041 +k = 01cc97a718ebeffed4ca7a9a4389d6b0fafb73ab000463b68b5580267aec203b6231cfb5afbf7ad8192f0947c7f40d9e060ab32 +R = 021a29f56c31227daf0dc5dc919434978943b80f4b18748bb5f7d6702153b966a0a4af6f209ecfa3aae0e4f32a1b7c6ae58a55f +S = 06921b2e2ab81517a0785c4ac3be3d7d4b4c917d7a1e4313b123ae96056a2a4a66d9e00819d8c1cca5bc0d75e4e05477c1fcbff + +Msg = 1a8384b4771a410663e56eb36c5d9ede8d161a8fb0e31d3f74bcb017b9e31232bb2e2f4c65a2d85bcd1cedd93ef08d4bb4af0095731574ab3f2762788a1ba3bf0ee46684da8d9dd384432fee99ed3c69213d790a5d81b351063eaf2bda71ca4868ac36be1b571024a8bf09039b347fa996d5d161078314e24b7d073e05cb3d48 +d = 051f9500c15ae73d6d479b9f3d2caccc2039d8d03820befc2aae3bbaf65d59bd9cb3c4e3aa8bed5b3acb70a5566047ffad80729 +Qx = 0ee8ca7f55225760c515bae053ebbf4ab23567f95c7091fee2acfff079eda297ec6a7e9d526e12e5976431f9d7e52a2318ddcd8 +Qy = 185e2c17705a2555fbb8afbe8e41ced8ace95c83e198be3c7dcdeac8c2c5bdd988800f1194e553bd0348ebe6c29c16f35d50895 +k = 073f96451cab2d3ca9810e265b3461e0fbe7f32fd6702f06891b97969b133eafd68e53b526b5e32b0d06ab61ecd75e1bbb21b7c +R = 067d55e709f6966cb2082d8021a313850c53305a3bcc926b6f9a122181665328fdc8e05a88de812357be85d22c61c919876fec3 +S = 063d5ee4a63b1fae39f266a9f826754f5bca4d7bd414dedd16858b5c6ac2d4162e28ab57215c6713320d3d6960f6b55e3f1897b + +Msg = 43513d6dd8bb0af7a6f5a2b35f99957d335a48d54f2c4019ce9518b35441d4935518976ab1df37110b5b53532cd9e2c66d9f87ae7f683d7efdbe1775a6c15eecee84c6f879999d0706f6779dc158c111fe8d7201983883bc8334f51dec60004eb1087347bfdab20f8f2f260556681e05fdbb8a6139857fd3bb2df5bc1f2dc143 +d = 00cf01dc4462cca764f4f8cbef48c51980737b9b98d1384b8de9f4c733829db7718a9b5eaa46a8475c2144fe4454cb8eeb0a443 +Qx = 0806457fbb7fc577497c937600c5a9c4df2c20cf7dad4510e5ad617fb2849bfe6956c3efeab6b805cb7b63bf5d1c94e5ddb456e +Qy = 0915071cee2094efdcc155f893da8d83d9a5c234d0f04f738b7af5b8fddaf1d3aa152fc11894a13caee0009bc106a64323e9dda +k = 024968902b50febf13be11821d0d316f2daaa07737af45ce2e855aea6ed58f226d2279ebe4295c5d7674104bff75b899609561a +R = 0549f18f1d654f26ca134df4707694e5d9b3693bb34ab5123ce4d9e4c2b2d9756ddad957a4169fc9bcea29944903080f6f5d01b +S = 021887355c6360bc4ee59f1badb5325763e9428e60b31a7abed06ef03bff0b1265662d604dd2e0140c355c70fce1b56ab143201 + +Msg = 752300bc5066d0efaf807183a41725e349907b7339d77c79921ead3c685b616b0eb97e708f3880fce0136c510c8cb53b22cb424af6f1c34633600939a0647c02d8f9601f9416f1d24a51657241fb559c25dfba91402cea43bca1a13718b3945b048725f3df560e6717cfc6ebd894e29bff1e0c7763f15b8ea93e67385f059598 +d = 063a9a565497974c6dd459bea0d1196d74f263f333c31b7e8591499960e1cd79e2ef4cc8709f6d54713f873b16e7b0be42f71c8 +Qx = 18872e9d9410dbde671fc050ab88101f01d146a72d62b630b29790b20fc02cb62cd0ebb5b453a46c60ec2d2c66de8715c320578 +Qy = 1b6af51db1c42b743b89be0900d23f7da80b15f2e7a2a965c7bc13800bf58589560af4697f873b6155194badf5a19a653e63da3 +k = 01d3278e6e78386146fc15006258d7a62a1345db3c2e44fb8d3bf8101727bef254a9fbff157072326a85b5ef4e17c5b0212bedd +R = 07bd5b54d9c6d6f9c87f4a66472be2c4bb7f521ae56c1dd71781d95440b0a151d206ddf627e5ed3f9c7df2fc914a78454e97616 +S = 075e39ff66ab0e0d1b46f9679b95d10b692874d45fd6898c569aac28a53569646bb29f8556e529ef83a15c574ad5e1c82878154 + +Msg = f620603489944769c02e2f902c2299dd5f32b5fb463c841b7e1fc0249a85d2c31684bd3daacd97de8291c5d39e84d6e59d3dde1b30c181bfe8d31b8d8e080bd191690a67fa00024ac8c1b10981b40d4f88789ecc58fc69b15417fff34834e23453bb9933a43d08afab74d056f366b40ad167b51ee5f008db151a12b467d3eaa2 +d = 041074dc186193d30aac7cc6d269b938ab40b257d095e54ba79967a377a91b8f73671470cd07f0a3d1db7cf0a31ba9070625e43 +Qx = 18fe9848dc599a759d90530480a6f11d052d2ce21a7275769ba02a61658c3b69ecc546aa6599e6699353ee1d65ce533c69fb218 +Qy = 192b9c41bfeb2af4f29dcd1c43d3fe72a070b5d085d070acdb8c02f0dba00c9471df1dcca1006709676bc08b8ddad97310e25bc +k = 036447681292dc781f7f4ed60126945354ad1df5987266038c5049d698b2ae12965b6fc58f3e944c4751406087859973d8afcd2 +R = 0541c22a6cb984cafddb3269ba3ee56af64cb36d03b7cd1693b112a7df20f0422219f85c6820130ad53ef69fb66f3326bb863a9 +S = 00fa66b163ec3582760b048ba9a0fba9443d7e908b67d749d732ac9b6e89c1fcbc6d3ff4e02a43ee41414b15ead0cb83749e0a9 + +Msg = 5575f610762b42ce4e98d7bcf45a7a6a0d66ec7f27d6b8b17f1961249d905bc7e58e2ce0806d467f106b16285dce4544c72666d08b5e2276cd0c4e13187cbda8aecf57b1855afedf8fad39ee4fe009f204e60bdbec79b123456ec2d85631d382b8a2f2c7634af3992e4707f7b4215e2c9d3b0aa8fb08267953883a4213669d33 +d = 010820db54ccf0226161aeaee79cfd2797f87702b4ee91adf8543b3c9e79579d0df8a889e366ec1e0718e039b87a37c24d620e9 +Qx = 02eb4e313f158ba7497130e2d64804ac45a7db207c55d41f39979e0303dd2641c81050fb7f24f2fd2485b90f60985cbb15d56be +Qy = 0a190fb6c81c104164578da6bd4f2b193cd11935e1f87f14e824c2bf8c82c39f0be1a6de3dfc6dd68af8cb14f6a78f38773a7ca +k = 0118e911f676f004fe581d1855e5795e5f4ddb33fb8d409d557aeea87895b7c23a513ca0010f98b3a63f2c65da5e3b6c37cf5f0 +R = 060c7f7c47c16b294867cee3e65eac8fc828229a5d3adf8e68e14dee620e9d4e7b78c8b902b5042b5f19c94e621c52836c95ba8 +S = 008d036087b23319553faf835b793c73204cdbe2c1c2463e74de8f404e66ff15ce9384d26149e7300ed1a109afd1f915edef912 + +Msg = 81cf067411dde2d0ab04fe5fa1e28e6975cdcc571588de60a35bd956a535fbbda4affd0803d244f3f7e6902a2c9a7ef2488691b6bef7f8ffb33be09ccae4c5285265e4957f7928ea5cbabd6823297f59a7cfc9939a49f26bde74c4c69e2d38c1efbacbcfdef011213843158072be84ed3c1781f67a0e2d4e9ba76a585c17fc0a +d = 059d2a06e8bfd5e14a9bc8777958b85be5e97af892d2cdeb0ecbd2d5017952b5042349db5fedba2e26e7b85bbb31ad313d99434 +Qx = 0af276952a1216ac88ca7a194f5b27b7c98c78c42f852dfc1a2cd4c1a477ed16eebfdc90f613b6e264576a35c45f49aef8a564c +Qy = 0639625074b69346dc6c617d624d63ce415a36154a817f4e18c59a3b09e01589407077b19bbbdd57b04ef8fc2cc23c673d52910 +k = 002728f7e9b4772ab790af0be9ed5b3eab697c4710249169d2a5782ab3797b8fa21bf8c1de659e3060af5a286353402ab982320 +R = 02a7027c6f94cc236dc8cbae35f9c38102a663b84f66143e2fbf9a152b1a6478bd803bf3171f933f63509d539a54dd348002ef5 +S = 0549ecf85ca1bae6d9f0038dcef90c93121a654552780f5583a7d44a73a9360c6799e76a632bc8907ce4626c0439f1518e3a250 + +Msg = 8ea18387940035cff2f37278d321b344231075db43c7fa7fee9bd3fdefe5e8f03e7af9deafa1022eb108e19ec11fae34536a4fbac2e8c8139a081a997c080cbe8f3e2d2a72ff26edcc5338b21372fa1498e439e4d9bb12d51cc539f859047957b1b1f1fc30b90231eb06b365a4d404a1fd5a0e5cef171fc95b04d0b557d78ebf +d = 0405590893cbbe18f4ad99df28b5f9d17f8f1882269aff0b7eee9392859d68927a99c942a3075269ddec6d69c0df2d76ab9d801 +Qx = 06ce67ace45a9cfa0cb45e8e1d0eeb44e94bd7527fed6b563f1069140a3f36e010f85e1ae5ef14d626c78465cae43230090baa6 +Qy = 1a66a58d87621b63ca662130ea342db029acc2d99bf76cf6ec4e53ba71bde4b00e508d332081055a65fc6f44a96f4e947d729dd +k = 0035f09e0c15b41c958596ad3f5c4bd4a3685ac94f19fb97503fb5fa29115cb18fdff4bd104535847ff36650b7461550dacf2a3 +R = 051775fe1503ce80b3d581ea3e5ba761665568ce0eb7d6a7163d8d025d76002ca7bcf6d688b6477ae85d09c0d4017aba5ea8019 +S = 035cbe69edfb6fb99c9e45240b7a587c3805ab2ed6b0399c7dd8dd76187363b2ba1def66b2c3dae4bc2e40d164bf0f4837798d8 + +Msg = 6a253c1aa17b2b1e6624afc8e7456d366ef5b1bd78e740538260f395481148a64da0b6a58cd53d7e06c691beae1a616547cd95c4d259a371e51c2c0e334c8a5311ae31e4c7af325686ff9f7a36f731010ee1a9b8a29169ceac36a060dd23611dc9713c615424888bb574ad5f5755d7311bd169336ae986c977a394bf16487c4e +d = 062bbb4f565aa0f23b88ab9029d33b995729d10fcfc33ba7c4051e2fbc72f15636a834e3ebfe604b927cdfc89f53c57f36890db +Qx = 125242acf14c7e08e9f2f0194f734841758b1eea1e37ba80b9855a14100a5f0b57bc52a0200cb640121d96769e9cabc45362f56 +Qy = 0dcf52cb899470943a37d260aa85fe83c3869c862001021660ad09b4d73f7739ad331b3566bffad590534207c6db9acf98399b5 +k = 06095b4ed8d51e37f6c723648af4cd4585d9d250d7519139f58a93c75f197c4bbd1142da59769a5fe178415c677caed1c3da667 +R = 041b212a54d4396ddea2898dadc363ac3ec5385c9b3b8ef1ea17c3d2f751d4f79137238548ad759b5e1700d7d78072df3bf84e3 +S = 0149242afc524b0c3583037da153f539aad85aa0c19c6c70852e3c3923df8c3abd0189a2abba872932eee2e6f45e02f98e810bf + +Msg = 0f91d0f0139faf3b90a3d4bebd7e96ff6bb6f90f6c68321fb392637d8ab2a60d649a7b7364ee6e4e274e1a8d342caee36cc11c56c54247fb0a8e8ef81ac4322b454dc9a195dc54567bf47ec8d4fa4cd32e76d78ea2d08bcbce3edbb68fd8597e56d5a9f2df4e47b2701046df89615961db601bd8204584a6a6cfbb627e2a1190 +d = 03fad7031cf8810544a3e4bd1382c0a2e22c5a9fe4804ce67b27591fc516ee81dbac841d399327168aa6abd79e2b5ef85df1528 +Qx = 1ef0f918c683be57eeab95d5d1850bd492ace7f4b37785863647774a028e963ee2c0eea801838aa8217fad75c5780f1c36e8d4c +Qy = 1d5dfc69bcad46bde5539c58ebc89e1db2a3f65069ed963280cc2cf228b2568bd53c6e0e164d6b63a5d3c2b8e3be9d5139a62ef +k = 00eb16d784e2aed724cf1e4b72fe76b00dc80948c07f9c7524eb0e83bc59c12a8ed16fa7ff21dffb8bbaa82925848a19c93884b +R = 04a07e79b4f771363ad4c46cde0aadf3df4a233740a89168c97b54559029c51dc2c79b7cc94a0e4e3d2f94e376fe47993da28bb +S = 0360f559d37a777119b2aeebf00cc17e2edf04a2cbdf74366f5d34368d2eb2c92958e4dc2b7453d5a509407a4d4643cc0235f57 + +Msg = 50c17c1fe4dc84648e5c3c3ab8f7c971d4c58d8d56d2b5ddd92e35e6792111ed8dac7644ac8a07ca8bb4e38e071aa47b22ffe495e9083f9bf781ac1b5fba571862c909c7aaa7b8d05ddfb7ef61c99700de734d5658f44ae9fc908c85a2dac8e7f854d6d24be805fcd7f873a91252985c5c73129c60177ba8fd99daa87b25a073 +d = 03db41b4f637fe7977c90e4f1a21799baaddd1826c667102414877138436cfae1b9959842b8097b5276f15f2b982ee59df263c8 +Qx = 18eb25bbdeb41c5d14edc675fcac8a523acbfadd6456632bd593ab5f694a7734b163aceb6e6b3d8ed83fa1cf7b5adb9871a6626 +Qy = 14975abca1cb769a243936e65123167e535279197a37d8c92c7b138f31cad4e95c5f62b06f438f94c1a61634b34be7b96f09fbb +k = 055fce73c9c385f007256253281c6b9d0930d127939026495d0a30f25f77fdb6b334043c39fad4223852f7101fce72746ea205c +R = 01d7c26e0236afeac032fc5f3dbffc8c03b04417b514adc26d6a4f697b4e87a008d5ae97544a274c25ff66b98111d7c651c9381 +S = 07954191fad321e7f2de95a87d5a9c4527e658ef85faa6622d5f34f8bc2b84c881ededbe0281456e9b70eaf7a207e253d216533 + +[K-409,SHA-512] + +Msg = 3583a3226e2dc463a462fefa97024e6e969c1b13bdc1d228e2d7823d9f7c09012390c2535baf086588000e908309090daac6e6d2b06d2ede6fae838ed47f30b5b481185f607a3586f6dea47c8f84e9d3b96d5b0ebae2462fde1e49d84d36658e87dccf5e30c0937feefd8862dcdb1a1ca373f6ae41641502ac54df6633a8cec1 +d = 065b76c6093d9c49591293471286df1a4444e60d9d06cfa114e175afb5f119d2abeb273b0596019a0ec5db5b5869f2cc827b364 +Qx = 0266321fd15bf6b1af862496f467069819e3860f74a07825e68f3d023985bfbb838a49b6a41b6515cacf404ebf12ce0bd3d6d70 +Qy = 01593c7a8e629599e63d3282cbea78023518277e6731fe8d88cbe525ded554b51a7f8803ab9e330f210619dd07df8f67e1066a4 +k = 035682af873829e16b72bb86f3ee99b5d9f052e4a631b07f87d3b361c8d8260a877231dbcb3f4d461b4a1d4467824a26a5a6414 +R = 00a483dc2dc6408c256fdf63b04d71d3c58a08db7167da217f466cbbfb2d68444c10e87a9a1bb04efd71135c00226e58414d407 +S = 078acfad2f2492f74b0281d53e4224c7544588ca9ceaeb16bf759b20c2f3d3ed69c64615c247213d51800569dc8b00078de68ef + +Msg = 60ca58462d53d074b370127132f4e59f5eb8d15594dc721a94286afd082a8934e52462c9c1c3910f8b50d7aa3671dafa5972958d876d7992467b2fee3795a6f9d8a7bd3003a8582ea8c003aa1e02c08ab6804d85bcfa13a815d75c938671f0af0706c68bc70a6155708ca755cac2fbb68b2952208d63e0e2e3d816f04c61bc03 +d = 07e9993f3fc1fdc4c376ef77ecded96006ac1159740bd1b2dc6ae3d97e15a67383f1fc931e460b9af3fe14a54e47919667ed06c +Qx = 189b82003b546f94c066963239c7a590e064b88bb4548678853545920e413f2be32125e40efb82d2c9582d2d8269c1d408a7ff0 +Qy = 11583b267727ba6c1e17a244ba7acdcd836986089860ee312b6dc2d88a984b1fa232eb0419730db8fb94a5e077009c1d55979bf +k = 07574dbe04e1ac2bb34e40f32d6f6db364a95cc5770b79888d72b74bd4dbce9fd91136e9e1152424d76688dc995bbf2bea34175 +R = 009e42a63b41877e200829356a2191fbb6f2a9a234be58c76b0852e4f348ca61e7492f90a37feb8b95a6dd6df9d1a2e61c63b4b +S = 01499fdcc804fee8193de080b085b7513eb8022503de5f64dc12c04c0ba24af30e30f63f0e3eac2c82eb20c6672336f8732ec5a + +Msg = c749f9bb92ca9957ca6d0124206ebf65e860ff38a225e241950bf4526cef3f4fa9184ec83f71f813fe852dc08eca6b45b14fc7f2c6a19296529bfda007efe9d0d26492de2a902b45ed39603e22f0a763dfa5deadd97ef6feb859d860baa2cfd1d066c0be0f9f4e0e2fafa69cc51b12e814ad2e33b0acc0bcbe1df8cf018dcd4f +d = 00c11e2979498695c660a2bdfd105b115bc4ff8664ea15cfb40c725406c6fc9a13027bd1d72ffff6258f29e4e19b845243444a7 +Qx = 0904a9bfebc23607c7c89b7aa89315343852cb894f54fe42ba4225285e58c6bc318b55691aa6a6ef22eb11f44cbda89f157d7a8 +Qy = 19cc1826280e54832b455f0ce0cf89bdb62e973a8e819fb776b1a202b4f207b8baf9072929c9e3f6a8ff996d6d529de899b024e +k = 070fe023c9341df9348f08882bef47bd8dd7f13db7215d1cd52cdbe7919031a62455ca969a8cc6db0a05a0b4befb47c142c4f34 +R = 035e7130d59d92ff8c4f264fb2c346e052bc305c7f57549a0fe43cc7cdac6aadf2ce1939222decef4e1f900e3c2fb2c52bf53f5 +S = 0008d5ec1ed2091309ac11eb88157ba5122bb9b5c858a46769a130f7a941818445664ac78325e0b6d2a11bc89d08fe0e87a5bcf + +Msg = 4de8414780ea20f7943b1f1adae5e3962d96e828fee43bdbf2831bd71bd25df2976a3be37a7a667c7fbe1200de578920090d131a750c9bc09bd95b261234ea8cc25423c4ddfff5656d6b32da6e2f6f530e6673a8660aeca31273bb9a3a21bbd7031a2fa71ba37c004d3d1c64b2c0798783e47b2efe1a208959ac16e35d444245 +d = 068dfc23c6635bd1fa1076dcbd456ad6e8df7ce7c1370fe275803befc4ffad007fd062a61cf1d50b93aeb9afe1aab47a65af82a +Qx = 05591f8cb59ccea17bfbcb74e69f05218d16175f0547ab95f507ef8d7426c077b52b82dcd06baf6eae7a66bc72422236e589e42 +Qy = 126a01d5c2331a2d00949e07ea9242ebb50d830b0aaa74bce841d4e43bbaa9e9aaa01ba25db7a8a2f4d72977c0f016f625cdebb +k = 070682c9659089a703dd9fcdf2f3fa0c1d1ef5fae3f8f1b3dda55d9b611770244f8926898c904f6952c1847d287bca21db4dd59 +R = 02734111e3b736ae795929f835701bf290dd50c0fd625738ab2769242c1403197a3f4dc29ca618c2e292c6bec6dccff71adb698 +S = 0755292cc5363fa74e0193a806879d3a275b4beebc97250fb230efbb8364b2a30098c0488bcc6e20449622d6a5fd2ae24d7abe0 + +Msg = a081d54232f84bb19dbd52ec3812748e2e6486f6cf1b177b27929504ca878036547eb43531bb5b3edc81bfe105370427e92831d2239cca0106d031d9fa8da9cf89c6fb6401377d5936b6329ccad854e5567181b8f16a37c35f333eaa0ffe91d727d183fbab935fdac2d5670dafb3fba59e4fa2df1746c58dd8360fa08af7f4e6 +d = 040807fb888e1d9fd33604546656a493629d94d4a0a9de2608962225ed158167f9e2438abe2d12a11e2adb6c2b66ed78215b0b1 +Qx = 1787c0e6c55acd69bde9b0a84d6022796d5b5c60fe5357bc0fa4386c16f61b38bfeadb6cfebee7e7701bde24418b8b5642afefa +Qy = 0d9579d271ba3d5e2327eb863cfdca397070055b97714e385ffc2fc23528f696dac1a4d0e535641f6c876f1819f2672a8c31cdb +k = 010b8f5356d8a029659492c444876f1d274b82681d4f600cdb5fb2afde13598ddb71676d9ed86e83351c70678886e8237a865d1 +R = 0304f43f9705d189f47ee09a079494030b0756993a93e4c6ee6b5e664f63431f99e505747c24377e5930f13492483e6cd06ebdc +S = 0580d4707c97f0330f908042a6cb2a2b313f07bab34774ee03bbee63a4ff881b68def47cd300fb49deb49829bf486d1efad39b8 + +Msg = ea60266f1538565b3ff42fa4bbfe319be070329059c52c8bc04a7da2824f209c1145a05e551ea59ded8ca8439c328f6907da4e81d658937df614be98c7b8648818ea80ef40e49aaa4431f4a211d62acf2611f5d60c446b2b25745078c643859be1b12b3141a09ab765dd63ea1f2a2df015eca0840087a5db378c4c4cce76cba7 +d = 033bda0a02badae08fe40c239b9d59e5bfe1c4d4b9b7a5acda6790bfd77ad08dde5e93a2da80ec54a7f88146d72218bbb88aa10 +Qx = 02dec536832c8acf007daa66a47e4eeecfb6991a359f8c412299ef56c6ca2faaf18c4db708493e84786a7837ab74c5fe0644cee +Qy = 0906c8f603b579cc2384e0803d31d577f7c91c55406db3b2db91bbca323fdf3cb6d010617ad1aae7bf414c4d974f22e6f05af53 +k = 051e8d027e62db2397e4a807d98a24455a76eff6dc259ada89e794dec1484b44724894eeba842f60b73287642570460896dbe77 +R = 031769e6777444095d934d05dcdf82405c43ae91ad5fa9201568ae2aba25712717f1af2b8f49f6eef373237bd70c34889d0d271 +S = 0023498aa50ee095f33a4081bfd70a9484089c85fc7a4569f560ed67243745c823cc0217d29e2938f06ba9c8790650d10fa5b1e + +Msg = 82f38c9405ef0d26bcdd5b3fce4fb0060c3095f61403418e17c337933f0563c03691fabd32ab5e896c593439e7492a9970ae325c67196d9e83fe0f9780409a930326f7e6efae035ef8c321cb9ad12461edd5cde66c04739fe079db65406b3c2d22f2d04b1a4335285513d4ceb901d2ca2ad10c508302266c2cd6079ff14eff4b +d = 04ff431769d26b8837d3e1295f5464fe82be29edefba76323e92078a6483ea0daa96221549102509a1bdcfd46a5a2e5de10c39f +Qx = 1beb74d427d849705cf26e26312446f27a7c5ff26ea9dc1aadca763254fe53a622de29cba4fa81ee2f9e0319e752f72be46cc7e +Qy = 08dfcda35a00ab77c3c47dbc05b0678cf561f575369507097833e86e523dec879e0ae9583b4261f7a73c9dbd417accd4ae6688f +k = 005aff3ad332af23e0dc38c16853252825076d602ed4c6d947be751af5dff3f59611e6166c31740b5e5a167260adf2a5466289f +R = 035c4e8e1858b9694cfef3e864ed959638ba309ba2066a28fb9d0e02a66cd4c187dc6fd8ca5fabe68acbc2074168157b685aa6c +S = 04ec2db89645018f9845b7ae31b8418a767e3570d401f41db18e424fe861bf09114d78606a056617613447d125a283be5bdb6ae + +Msg = d8506fab4f681ba4ae86066aed447571eba4fe04e6585fe3be6af2ab1000a3da68c5b0c711a85ddf3a40cb7c8944eef81f2094650459e14f5b848e6add7e580b0198070f873eb3ed5d0728eabd92bc1398764b94cbb4cdd7cc2027b9762dd10782658cd9e8a5022ac062fec535d892198c8a387b3d2b6f7c92b1af6ab7dd9e4a +d = 03f85ca1169ca7e9df44cbc6bc7d2868c9d94e8f8b699a42ca492dca0914eb5789a9032218dcef7f95f959c9554a1cd83360439 +Qx = 0aa3c77dd4324258bebe7da5338c772d3496e3fd0e57f455459542f1a1c5b47692f51c3815c9549d0c23fdc1ff610fff6847ea8 +Qy = 05e626d6aeb86dc51f3b359b10862cd33ac9927e38127f7f17426f2369d62132a2a62fb6b8354c5ca0b3e5c7c87117b4f777a0e +k = 0495099cc73c9930333ae3f9d0b7057d7c70e2bc7c805c0c6a44404739b3fb68f9fafa53033b54b7ad7bfaf4bbf7baba0dd5a0f +R = 005612fe87c6a3a164d269da902aa43c5a4e0333770ea6334f05750be3f31ee758d169291e15b1540d40b60d1bda279599f254e +S = 011a633bbc058550a597585bbc9f33099eb517795600b019255f649493d4a6dd533be8b0965d9f9d9698677491bf929198ff34a + +Msg = b3f30d34f252a4c26f396079e773142bf61c0981d912333ade3de4e27cbc72cd8a16b31807f0c46116f87accb854487d83ec8c6a61565e6fca145eab70048245db08616779d7047db63aabd90dd15acbb05eaa510072c151c0518f1b34582b95f43ec7b9484b2993c176de79e84566764467f72392ef31619426d159c91816d4 +d = 03a97deb36d68f81f50c8829d412ee5de7f9d775633cb69c09dac558182039e275fc258240517a7c4aa592e364765321f27cb12 +Qx = 13f0f4c16a47ec3a46e7a088c1b6a63ef61eaea46aa9b2c532d8df84dbf64991bdc2c81ced3635e562d1403dbcf6aab2f8aa9da +Qy = 03aaded3b99a454b820fed989dbf6430ddcda67db58e356397d06aa137fbdb365ec43994abd9c0a9fadd2887da9539bb4ab3c44 +k = 06620ad14a5835b9e9e104607c317cc599416683a60ed8865acf78ae1e861246567cf9d91f759c2d4c82cec835a4784d3c231f4 +R = 068faabcb7c716fd73f129ebc6625f5b4660a88e47dc7dbcebab321051a61e46b74409e2b0af420e1671ef4efe04973c43471ff +S = 06851e5da033da0f28a89dbbdabe93ef11331c55cc03d5b096c0522370be681241fbe71d1349f219ce57761c85fbe208ac36a36 + +Msg = 0fb13b7c09467ad203852738eda5ddd25b17d330e82c279630b0e1f0c86681f67f6e537fb00da9419114973c8559306de58b0387d86e52d821d982a60769d2f15fd5ac2ee6dc55d8ac04ee247282cb2866b8cb8b4d7b4b6cfb33bfefdff09a73d727193e5fb939ff66ac5fcb644a44f9083a790888cc538c5eb435243c6a34a8 +d = 03b1da0ffed24e1a3b5ba22bd684337f6b08053591620541bdad50c761d66201a2cf21a4cc636426456525b598e96baf97d9851 +Qx = 0116a1790e621272b56cb4579ffe6ab629a2d077b779b73e039d74f58c476283c110bb18b9c9ed63de7288dd678064de68b7df6 +Qy = 122b43afccb88982f2e07ff35468178572bd72b644322d9e1ee68f78880169a83a5bb88c6c994762a7e8d80e09333487ac30fa4 +k = 06d7a24f0fcad549e9c36dbc70ce264a75eb37b74db98b1f6a824ad1e5635be9818f45c7544927807dc0fb3bb5fd38556e8656e +R = 0232339b50bdb772d15f2cb8973f6dd9397af45cebb69adfc089bb802e9c4029dfb2078a8a26d7197de10638ce512e5904ccc5d +S = 056add03244174966d53105c570e8fa660ae8c5d53316a24cd26f24e29e4b7459f4c9daef07442247b63665f97a3c07d91a8706 + +Msg = f9b8124281628cf4e1da0cb4f021c8d19d815644cd80c7c8de4cc62722904ec4cddd26cc4891f30b15098a25ba6923c6abf4774deb6e1883fbb409862f94467e75a725e7154be860fd58347577c83adbf18535c54b102220197afa062cc1c84f6094490ce488af4a08d2c5b808a2572e18a59de96c87162f88413795351cedc1 +d = 040bac7e0d3b54c7753c79d43469e310d876015d948fac4e3a9765444754476af72330e88d79ee6119697aafac8435ab5690754 +Qx = 0bd4fe8daffe47bfdfc43deca20b15da7c999084bee8983c62e3dd33740143c38d8f432cbacea51e6f53994265b2d8f4c393f6e +Qy = 06d88c33c31f4e143b13bedd5738bc1191fe6815a099fb7b44617fdeb08daa0cb74edab7f9a8c67ac1e9c0f0fb21a9f02ef4b6b +k = 020f2f6fcb3e471d47f21fb15301784f7cf3632dad3627a9ebfce587c0097871eca580bda051b100f991aa6de5edd3a7684e839 +R = 014f8884b5107e9ee5cf6f5d137ec9d59a85a6fa0431053d58a1400fbf0d518e8910179da1160de2c6cc8ea8ba8f3af8e0e1f6a +S = 019aa8d55c8d876989f9b9559db0576f91c4610dc9187c74aae2d4f212cd94d90dd81ee4483d88d866aec1ed469c5e3eed7d90c + +Msg = 4e3cd6100520db050af0daa69fe3cfe6603a223d4f2a6318fc5836db8640d4c7fb80bb781302036d2d6fb8e552b4eaef3133b98ba2d36b9ef0b86243b0391413c73d48ecbf1d19170f1b3b781b35ffd316afb1d55d1dda8e91eed5553780cb2714a93e7ece698b832e853e2589c5ba2b8a997bbbbf625071ded66762af8cad42 +d = 025b7eb3bdefba3c5134438caf968f615b315204f348006f82e8d61057a8a8a853230cf0500f9d0b8c1551a59b9184862dd2ed9 +Qx = 17d2029cb711e52df416c54b63a95a66602a1d15c3761d91071964e0128c91ea766b3d409f72d9fbb5161a459c3fd7990f87d88 +Qy = 1e71a9c66a4d4dcf199aa329e44b99f80640fc760fa7326f29c273aa13b153df5277feb3c049e407630173fdc9f735d7aee4e10 +k = 0575aade2692534b5a1a17d36c36973d24dc501c75c3b0b497a3d2fec80c67be7107988e47199d4863044fe9176762497b5aff3 +R = 024c6004fa92cad446b8339917f517f04d22db47b3f9bdb83d863dadb5431866ce21b13e780495bd66152ab33eeff8830cf8538 +S = 034aa568aca7be851d276d2235e42b6624df1cce2b97f6413dd3fc506f0f18483f95f911feb0eb220415ac593f2c93dca0808fb + +Msg = 5411708381a65bef4381c9e13a04cdd5ba0c15829f7f25ccadf695f635384d8e4704cb562741747831b33852567f42fedbd190d2980f1bc921ce01c17d659d4bdd7eb787b3927fcee659dd3b65132496c687f2249272a473d46326e66b3cb78dafbb522390162c168f73bdec88adb145e6afecd561979846ea4c8cee38dc1686 +d = 0673b3a2985c95904732632e5d988d8d437a60db13215bb6aa880b348f011c609a1e860461427a8cf0d622abc47f910f5c97ffa +Qx = 0c4f1c0cdc44d867ed38d093eb967bfe285df897868c83ffcc0c53463e3852a1b2039506d9508bf01d0d79ae537e42fa2070a5e +Qy = 0c2bd9343041c2c4100c5d795ef355c796a6ea7954cd729e11063b14a27fc2c3a9ffdb3647613b44238eee17d9cc49e8c5dfbe0 +k = 019a9509f5f6d947532638a3c80782b556c553edaee9ade91e457f7b5d2c9055572fb116f52cf4d3a2a0eca72fcb32b2f58e952 +R = 02def440e968d17d9904c5640619af2f447f74b7c067537db4a15be87df4fe68f44897047fa8af146462ceed4beae36d54e1aaa +S = 013d5b00fef639c556d66420090c2cab1edc57b7257dc35addd62a5337300e94ea7ee116e06b744da1b575d90da81e8ae2cd424 + +Msg = 23757fa60fcabf543e603d8b31ef0cc99b3ed16b4816a84e01dbfc858872fcb79fd03d2f8a1d4f28c25dc42a39e20c34f81ebccda1682ee9bd22fe323e7f8ea90cf4a2a6ebb634cd1153cdc35f7306f28a2efd822bf23131baa1543d0ed5ab4c8168d3199983fbee117085f90550ec3ffa2b06070d3add1d707fc2593285ff58 +d = 00db7dcac414010b816236cad584dabeaec1da76c97182d1b62f87bb7fe2946a64d10430571b2b29ccf2ef72c969a9f045f1f3b +Qx = 1f2a6cbb9c1fabc8db2848c74d918312267888d822b7dfd1634a543dcca4be7c997239f6281d1d8b5da9adc694706b7b19cfb0c +Qy = 1bde57a2ac15f4e6b26a373a624588a3379c8eec758f3c68695e2eb1856075d90085f43283d982526c5e57913cca5e2b4169f8f +k = 05a3d856ad1d6164993cc59e70f8551e2408da92c7e6cd52df51b37dc22e9ebc42fbe6b83c332eedffd4086a382056175ad7009 +R = 0489b0344ae4278a0376dcc64ef9ba8595bc2fd62ad22d42fb431d2863d8ca353cd9e59de4ac10108fc247d6ee9ef643f6bdb3f +S = 06aa27335e15dc910515385764387798cd4a9b4cd6d99d7c42e07fc04e2bfedf8dfaa7bda396f88253357d3e2545e895d9aa3b8 + +Msg = b976314d2f066f8893307a726f450dcf2cf865c170e90e6908ce9787eec48e1e2119a731b2bec3c12fd4e6282a393774251bcaef91af6ce57c63a8b45bedd72ab862cd169b7c84b8f6a72084ff823a96f2f8eff3483a7ebfabdabf0998377c5a6836d88135cf61c65a0ca7ca57727da68047dc635c17ad13731035fe9a6402af +d = 04717efef16e1ae267e155aa1daabafc68515aa391dfeb73c13d01f3132bd22c984228dddc4dff4c39979e7585acd3f730cfcfa +Qx = 1526c58a3de46c95cb0527869f7d637f9441cb5504e6a01f339907c6df3d079361a41571cf0a0f11996028a41682dab5decf786 +Qy = 1581903be8a19bf8bde1d89bee0d436f061ca1a3ddded4b7793fbc32ff852671103f34e16d469eacdbfa457643d1b18dd1c4107 +k = 05c846bf61c068b421efc472469ab1ff8d9f34847ae0065ba6f4a000be53727b3fcf97a780362566e13ebab84b9ed5f0cbbc225 +R = 00aa138e742ae81eafa820632f31e87bdcfce6b909d85805e46d87d1cdb8b968907470c7ef5806accbf6245628c70d264fdd95d +S = 04df507115384327f7b8311dfd1227c19a6124cb9bb5901bed45d8d5ca45db0903f53e7bbf136350e66bf2b4f3d978f8bc546a5 + + +[K-571,SHA-224] + +Msg = 964ad0b5acc1c4db6674e86035139f179a9d5ec711b5bae57d2988456bb136d3aade7ac9ef10813e651ae4b9602308b071d75a934a6c012eb90c5eb9b2947b50fc97b1d36c5bf9eb13a7b06c94212c3dcdab402a563262298defff62b836ead1f78f9d20713710fb48115cc5045ba15140fbb4bdf516e4150d830d02cf30963d +d = 19cf4f4d06825499949f9e0b442586fe1bfe3459813a2b92cd8de0f775a4735e02655702ead8e60824180761808d9e816d60bdb0238e1e8039ca7bb63c92e1cf8433ef447e64ead +Qx = 07b9cb1728cba80367b62872a986e4fc7f90f269453634d9946f79b1fedf42ca67af93e97ee0601bb3166e85357e8b044e39dcc19e608eaaa8a0066ffc48aa480c0e1e8d5569cbf +Qy = 580858ab9223c2b2ea58df506d703d64b387a78ef43846894e7a2e47c02252bd2c1e3d21ada7c21d50a08cef0f9a189c4e850c058cc57c37918251b5aaaff2321d7355b6b555644 +k = 0726d5e317f888dddc94c73acb14b320ff509908052868f8c6b14e531ca467c1f7c8287476674efd0d636ca94c24a69d15210bb43a368a11d3453d69ca80430cbfb8b6e45d8f21a +R = 04ec6205bdd8f7eab414110ed620dd3fbbda4cb3ad9e5559a114ca9344782847621961a3577cbbe43d94eff6ffc8dd7dd09c049239f026a928301ffcddcc910bf196853edc86d31 +S = 16535b1af98a75b9bc0f122ca3ce23a01800fa33b43584a94fd8a8d6f40077eb739f07c9f0e179a157a28023735fc8da2e2ebbee5f7308925900e657fae7c3b321f14fc45346f89 + +Msg = baddec4794effa668cde267016dda67bc70b847919a9aa595f93ba9dc27354399ef7a607fbead31e57a8ce698beabb10f313d393980425e67cf95be45d512f00e950c0c5409573ddc3d556f23daf056259ee8914e860562a674311452fed780b3e0317a7fe93baa81fb98df3ae4328b28ad0ac8f8ea33efe24faee658ad026f6 +d = 098521a732e72ed945a549afc92318fef7156ed1d1ed9bab93b581478cb2339eb32bcef705c9bf61cf2873ddbadff8ff3806740a2e30ce67d1807a8179dfd5d952e6f8a583baf81 +Qx = 1e09410bf4f84d53a2abf8d106fc64e643edefaea263dc98c308aea16ec75f083b3e6b442ab261226c59ca5fa622db68f5cb5f2d1d465b01d0048554b0ccbf67c0aaf934d2365f6 +Qy = 361e5b43d313a62c7b3897c7db8a42116127138a1009f0bf9892981fb4fd6ae231b8940e7509f96e2a49285143010dfb4516ff810a91a4d9d2974c522ff343e93e8aad00aaa78b9 +k = 128056de96666acd09b93c5db7ba1b8fabf57251ec480d42b702940b5847d2a59b04eb5101bb3990c3ae2a41181f19a2afcf08424f8b922a95df6b292b1856dc4a9dbb1c717ba5d +R = 163483a7e0d1012695ce0c113ec8fae3694bccd40fc038d4038f81bd39e71c969cc7f0af8313a9fdd3d028ab24a43279569dcba73fd78ad74897964ae715928b1cf7fcb779b12af +S = 10aac6929432a6bc7e12ffa86e4d2421e0535fc44a1160fcfbee477c29a987e783a7f753eb2278ce08954c7e90284d2ce7c42de103a9c59d8e4c459b457688ad515cf156cfc56f8 + +Msg = 7ef7138fc657492d229054f8a50dcafcfcd1dc06f1c16640af3f658907e2969248b54416066eb119adbfa23b8dc578aef18bba79610b9cc109394b900a25e55a779230bb858b2ddd9499a7775d392328db9177aa9571c2f61dd52010b48502154e914a0c55a54edcc04a6713cf7bda8744a893926118b09df877d1a4f3d95e8c +d = 0336fb21549e397a190beac38a1ee10f0551952da15f71e11dfda415e5ee08da2356f114d450c661f52b2b32cfc7b9be61732672691a079f0927989b7e9f4efe6095a242155b641 +Qx = 316800fa2d8f8f3f9aa87ffb628dd7b2f63d4d8389ee86ed41bd4c3eecd3f3836ba92e2ff7ee5626213f9ddb41b43561c5dc0bcc3df0a872e4b8026c09c7b52b89b4975a43f60b0 +Qy = 207f956df58f75286232967dc1d3e6507634f45c0014c48b42868fecce5b9434463abfcd2b3722a7f5ed25607270148466f6ffad6a8c86e538640ece80e84f7368d33c68807fed6 +k = 1517b3524b6d43dcf3964f7c35c89bf14dd1542c37606452e2035ff0bd0cd1edd6d7b801ecb1f573e957131c0b3f30d5006f6e4748a11b9db10fad41961f4ae53e848c6dc6e1a52 +R = 1ffd4865dae7387ed797c5ffe58a929cffeab521e48284bd7d4427d5856e9d2582b91363f1d353a0ab1aabfc132a778a516d4033c64cbc991d724115d72ff8e94ab4f95a9514843 +S = 10f010aaf1bb714042fb8cf06a9501dfd1ffa598d6b3e68e7addefe00e18f3a5db8414d625e374d9ae70bea43b57c6be4a590c28e50a548cdb2e30dd9d6e3ed1d9cdada9f8b0049 + +Msg = d58e1ff1d49a471d0567ecf8f29173dab5fe5f6184ab4cdd095c231fa7b82551f99a482994a46c3d8ebc07297fc9e952a5dee7d5f199b119f6f8b250f8fba45701ac252db725e75c4da27ad77d59a4eac448e54a277986740dfee6596811e59afc9755e53d24b826c09e497e29e69a22bbc85be11763064e9ecad7ae66458ca0 +d = 0e287ebfd9ba294128cbd484fc5121d271cd33e685bb1804f09b40aaacf64b5a9f2cde9b30a4a02d3a9bda97d92f46bb8787b3c61f280b1e1a0680f1f0679d3bb34d53725d62e52 +Qx = 52903a7afc17cce078b4b658766a67f2f75ac04e296757fd762fc05d6a7b4e4151598a872eb4618efcd06c43cdc3e54f437c0ef1b091ab5e4927d3ab4227fb24d4413e0327abb84 +Qy = 385e808bee8dad1a1b84d644aa29fec324dac2242709421479fa7a712d18b54db59778724ccaf4e51a27da090c6dd0b7967024db0a8684944b77295c9624ce3aba24ff48c86ac85 +k = 15e8cb22e371965801d99407d96200015ba58fd7eaea52c03269d8a374fc7aef17fbfd4480d29b781292e179936a68ed175802f34043018ed1d6b5a4df667d859cd2ae53ed3cfcf +R = 0d3a57af73b7504ef18c03ed2c52aefe1d1a3f0e27f78c11d45e9825647d5ff6e97af51a5e366e52e01e5e832e4264a1d5b6967cd9debda59c955568e4c8bf804d843a49a0c5401 +S = 064fd7ecf4470f07b4df3b3046041e49f310a463210571606f00a1915c5220a27bb7a28cd0bcdbe374651aac06d4d9e017e31879b7819301eabfe3a7afe4b53f75ccc465815b4cb + +Msg = 4949ba765c14c31f68ee0ca26bb42ba2edee63537de4a6f5c42bbd862c21288d6ff48145260365193c6fd2b56dfb014da26b8a483776b717c6874f627c9a622154b824565b23e178240f53ee9748c45759ba5c035b584df0f09504e95eb9bce0301653aadb860bb25e6ea6b9606e0ec3bdb8089e6aa0d5763d331757490715f9 +d = 149de496fa8f88b2741864d0c35b3df666b87179b7bd06cd426a45f13bc87ea9f50dea85e1fd02a532630e0e3a231cc3e7fbb7c7ba85b40cff1124e72c677c6a3ea6aa40ffc64b7 +Qx = 0bb610e4308e229e4b4ddddff5c4633ef2ab40bf74514433bd068c7d59a6260ac79366dcdc039d5585e660a4cbee990a2cb55a99ea3d26dd9df856b0f3ee5b968bcc349240a9a2d +Qy = 3e3ef4be63fde6ca09f12f8220e1d9b5016f267ca5aa09a2dca8a0e0feda9647fe0e1f7ecae7147a10ff893f69a4f74172c6e9a62f0c5bd96d49b47379c9c84f5ef8e59dea104bb +k = 1cffdb963c2c8b8609809e998075299776b44d2808df509773f310124b5f318d7431f1ef8b38fac5cd5580348abc41e6e6396767f4780656361dc9a71dcc8e7c9239d6eec5cdb94 +R = 0982b9989c92e1a5d25dce832bd8a3f602f0eaea69abcfda285cb3841fe3f019503e6faf8a693712380a48a6af8844b6bd718f0edf3b57662a4fe82ee28d036ecc4cfc7310871c0 +S = 1678bec58d69def3fe35a64810b27fd06bc29d165593990f6f42c4c7676fd5d4a965fc92cf20ab8616c7ac7b4b308ce6290c5e8b4edf6859fd6f6f01878f2601e22acaeb5ce1f36 + +Msg = 5bc63e5c50b1650f0ed4a599960f1e4e11f6c151b2123fd71d9e3c44662312a74b6854290628e20b30eaba81555acb2fb49b640bdab2528619c7fcad0f2a2880c7ea232d427d7c935fba2313370fda8863a7e7e203d63ea15d0cfa083e716ce6068c63fa616ddc225c9e413e694cdf6b355cb1293af5d6cdea51168f5634e878 +d = 17605d7c5873d870462375d741b4bc6375f3d47f7f5e9d998917adf2137a81e63b66917b3dda8968930c4b850f2270eb3187fc756e2beeaa67fe0d73053e6cc0ff0004a21250551 +Qx = 0d8ac3e76c25cdf4902426569763f4ae0638ebb1fbcee6e12a4e0b89d6d451cf420d10441a0a9984710dcac13bfd7ba70370afdfb58e2d982ac367e178f6834b4cd2d232e7f246e +Qy = 12b5fd5b686e58df08b695fc333937eafad6006be5a7bfb1426206102a79bc32fd9ef46e19869448fed0e917fe059b76c8b5a9c403c3921ad07e6c19ca7bbfeff5491b22f8bb961 +k = 09179b3ea906137dcdbb97b27f3690bbe3bc4f1f57c46ed60b8503cae97602717a0724e055a5c52199ae3f08f1586b87fbbe514667d2eef2fe44092f3c916976c7b71eed67e8fb5 +R = 05b28342703c83ec2df898458fea6f71030e4e9c567d140ab09cc95df29ccfe199837cd58ed00d07241988bf3c863504d065ebbeb8ed11cdcb02da0a945ff38ca58d629f76832f1 +S = 01442a5606791569749b5a9f20ba8eaaedd1a2ceaab2ef55d5d41271ba23f6a5b6a33c76763fc99b291b07283122596a3331fcc9ac038447f3e0cb54872c140300fea65d7809191 + +Msg = 610f6633718e49d232b3798654095e2efa0de11f41258b27aa01956480c870d901efa77e109d5f95f1f5101d3c90fc51312d9b3019d2e42e0067eed7b457dc7fbe5466923b62c83d7347e4dada571b57813bb9c21d5e308519b8eedb7a7706508ad04aa69698e03636eb30fd9fb363ef3a185756494ee01175b16847f5b68076 +d = 09214dc2da0967912c31995cb8f5bcf4bfa832c5a2d3610f3a9857e5eee7c77100d599d9ed003b4106013155dffd6c48859b846e45e0ddbc5fe24f4891c9b2df51407e9cddbd974 +Qx = 64376a92c1227c1c479260c7497147760c103bfa5be95ca1593f29a851daf2e5c3a5c73c1fe3e6e2506fcea710254ab5eb2daf8aaefc19cbce7b1c4afbaa2fcda1ef85750fc0a3e +Qy = 70638482e5c7c17a82980b863cde11294c0df717bfa4b9f884cbbbbf80a64dd2cc7c7d89ed21e10561260d372da2fb726de71863f0f60e8ad0fa5e74fb5d29bae0cbe8ad6b32f6b +k = 0621176102c6ebc2c810eabab9f60feb71083c07751c66f719370713ec2de9ee3957bba8d768b076885db1f226a9d37588abf1b141d81b70f0af711c52edd30e92e34a1d3ed214f +R = 1a21d460ae85d0703b4b10a2f77547e45135048ffea590ce86e0a1c049f8a4aa7b395f723b7480cc84e33f4772df8f181f3919f3c0b0b4f276b0f855174103a2f7bd757584425cf +S = 0b56bbdf6e2be1b9e754f9b48b3ba9a13403c17c5cfcc4910112704aceea9a34209df406ee40e0a10cbc26d03839f95e775e80ec5e29b156fa277a5ac68abd99c7005ea6ba2695b + +Msg = c548f0546cee0c0400401cd540a0aa9377f27ac64492e6baaf38e794db4df83e64ca3d83b67bbb46a6c269c04c2725287cce0dee984a0d468c9ce495a7e554a6835d72c7493bfe88dbd5a044a148c89001b8087fb03e57c2b7212d0b175d616333a9affd8a1802dd49ba9be3ab6c6d9f99a5578d26cc4707a5860c6c804d69ce +d = 042f2682e9ac8b76f3c0880e12c292524601dce9ea6982dcf68bfdb0d3fbfb50dc9229e54149ef09b95bbf624eb04ce1427077f30d8536be9f69970ddb449ca22ab8368d2689ed4 +Qx = 116135b273ef876453b9c4c39e4be5a815874857f4a72602f0d03b4ecd9a4ad73b90600c71111e317df0782fc92e6ce2b194c204340bc11e68cc22ced38e99f90dbaf0f917e970d +Qy = 36dfa65a6e9d0ba521ade7daa2f6b01e1d14fbe7b5abd29ae71c4eff66c390914bf46f09f4ab8a06dc0fad6fa257a85f993d6829b5e0add5086b8fe2ecb8027d08eec1bea981cc4 +k = 0bf116711b31ca347d41a6cee5aa13a74e042ffbf79d2ae9448598e6950d721b3773ae6f25d7b49ca9dbcd62feb011d5d556bb9f8a55a7acc9a3a166a4169351bc31a293db68eed +R = 11dcb7f4103e814439df22764f776a74aa86ce9717585712b224803f0ff193d5f541d94142812c726b75e8c2c37f2a4c33db6af118af73d3ec4fda49cfc911fef1eda9a470ff200 +S = 15fa4ada3a6e95164aa8972f14ab7572a3b898feb6cde160b8f25094f67343d35e6efdfab18793f77e09e5a42f56bae747b2b66fa9fe1e4a97e5e05ca743c058b1024cc848393b8 + +Msg = 9431c6c5237f6b4b35682a0c32f68752035c8b295a1763c5dbdfd73466cea64a00ecc11356d02d2a9211dc54548f5db1651e4471898402c887fbf45005a3bda271df0158c98319d4d6751b8ca6b07100182957d5fe0d97c4e2294406f83e9afcae4850bb089f2252490417b5afd8f07f4c795fa84c9c7cdcce26bd97273c0072 +d = 17ed9a9c75cf66528428e85b0f019e3488af8b893b12023ff1b4ca9c3691b74e594539afa0f4d7c3863d15399b862f15e27bb077392d6bbd546ddfd46728c75177338466eb2f4ff +Qx = 760779389124c702686d8d7c25dccfa74fb333317bdb414965d2c271ca5e687c4cca57e6f6149e1714551761abd4d651e7b04451d8be8e58c0c9e361fe0c6771e3d547d6ac3e8cd +Qy = 52d5725d14b9aef93b83d638377f5a19e3cd6e3584121fdfc2c3ba1a588491d7e9892be081c9e7585a15b37a9cd4c204054dadf06a9f4ebe98f95f6554941982faf109c2af98c65 +k = 104ba3049a642d9b49c4302e9173a9efaf215b67e060c5e9673521641c9c2a5b14bad25a448e46faf73810979a3a50104ec8c5230a909ae588213161fbc10381d7c75b35c84046e +R = 1bf3e89fb0beb1ab854a5513278dbd8b9c6b05c94ab67145ceb1ffcd93d1a2aa374db46ef327043518a7f272b957dbbf9d6cbd6708f4c89f05865932b7e816b12a59647d972f6e5 +S = 13a8c121c9c170b244ae3a55aa2d53f4ae5af91b1f72c066207e3f52e44723bd4ae419d24821b83648cd64fa70536605912a5a9319dc446a6b2b639cb99ed2485271acafc2bc988 + +Msg = 417cd5f60416f17081d2c70e9a510114e08be83573bf9deae75fbc3095dffc8a7f7325f61f9d6565381710eda871388cb17619e4448836076338ee309a2bba5f737319002e259b4a875cce1bb97996101c9a7abe0278dcac203a712f0809eb3c4b85a9c380550ab0bbc5067a8edfa78abf03c09b5c08f21714e1022ebfcada4a +d = 1bcc09b3f2f1d26ab9955bff7e8c0f85c8a61293511a196b53d7963f4a4503849c96fb4daa68c9852ad9185e01a35f0bf298e34a09ec352cb6da34f89a1f23e8ea27712a8f43aa7 +Qx = 1326341764a4aea222e7413a4a6f7bdc0c35ba246e3c68728ce06bdb19f2e1b9102add88a8511130ff48c0cbe4012ab52de93329670a319f6b1e7e7dbf177667d4a98d3891ec147 +Qy = 7a4aaa73713bf8fb3907d49e5653cf82a9587518c2f8269cd1e556a3be3589dad4c238e4c80681e141be93c318f0efddee3e378cd46512d778b9033dc8706bb843a3c3546e76e4a +k = 13412a98a2c14a9672ecd42db9c079a689b147ad91869c3d45a7046aa9dfd3f31edb43ce6b84e9edcd7e3ac6b96d89f13878cf5befb052a6f8a4e5577bdf916adb10d908d5e99b0 +R = 11c8a92044a30be397007a71d9af3e4222556a10f3a07a1521c1bcef73b4ddb94fefdebba5944d5bd91313560718a8f520bb5cd5666539756a5e9b66a1b2d18fde5ae72e61d584c +S = 1ea510e23ccc7596db529dfbea78c99fc78ae53da32ad7c7bdb1df01039310988ea601828fdfc59a0cd237110cfee9de8711c073be44dd4d04bca4b1cbec278b1a9ef175d93f70e + +Msg = eced8c412a153a643ccd69596389f83b6a36880286f8aeede503452bef8305942d95734fb5733f37ffeceb1c2dae7b1396c3323de11089082745c28a1756f784423fa7ad68bbfbf0d93ff8b7ad62220500df6d6895788402c1f5c69c06dd9ef55e2401cf297184e411be87c1bba657f847208c0e750f94a3df92f253b377b4da +d = 0ec52fc3d9c272ca80623e06b15c35f349b13548ef7ee400bbfa04196850b3b8cc7b239238c827f9b0a3160cd97969ce21d66752791f5896e0385b0527d4d77e4b9fc70f04d73b2 +Qx = 5cd2e63dcd48fc793c18776d030398dfe3f8b6978eec6d23f49240581fe1e141f667498421f4c40a9430587fa282441a78bb641894cb79d929c299f1aede218a0078c247f740252 +Qy = 0cd2843ca87d98f6336c0adb97bbb9c5293a03e5b86d5534e2849ebbd73dff837ffa488fad7d134908234d0d7fdac8c7fafb4729ecf0516c42995fc9337f60db2f36eeac69a4e42 +k = 1c40a15fca0c959852afcb4ca6cbcc99fb680950c64ba18ae5388bf783052b6ef3730b1fb1487189ad983b6a68bcfbb707466092da52ea8893d8bc4898eb133fd771e78379b9c13 +R = 14485cb1caf1527350587d6695ee3df2b21c13084df0c093ca5109d7c192e7e5df2232ede11dbe5ff2f46b13dc2dedb709a0fc1641c1f32857040147599d8f179fea6b2f2417646 +S = 1a16ebf12c11d2d0a64b7ea124623ffdfe2650fc9603ded571e76dbd7e3b27cd32fcb709e2ba04aee0e8e1b942a4e829cd0c9683aee67eec27d4244a2cefc36f84f7de209e22a62 + +Msg = 30e83ea39a92036e22b7bed7639eab5e5be1d00c20b4a9b9afa9a0d1653369cbef363c119cc6f921c8f84663949c8b8dc9b743ac2b1861a480476e9b64c8f333f34b6fa0e1ddf09d49618ee4f3c1f46751b5595f0aea413d4ca46f3c26b974b112cbe99c813a96a4423764c069454946f213c5f066ec38108f947abeeeb02fb8 +d = 06403de7627de22d1dcf6b8da5af62f9ec59ec065cc1ca1311bb98aa439a6d5985619b17c17a70f59e17cf180ea6828ef57f5f1f8ef05680a9fc12ab7faad5af61e4e11fb45d341 +Qx = 5575c329d73f261ab6897153d7261f87e9730eb5dad49c05d782cb02e483fac4a9ddff31d2fb695a62cdc44edef6398be8f4f84aea1d63d0b3a771fe91889dfac4780063d258325 +Qy = 183e63ee783abbd00547567bb99e9b578ad8ce63d229db41c6877534487568c423d4c389154af9627708d8d8f863597bc668e88f9412b21a6696d07bba06fe7aef93b26950c69ed +k = 0e751a4918643ba3e68bd9406a4386e876d0d66342aefb4ef75bc4dcb8cb2e2d9f8378bd02c388c776535ba85d24b206f5bef4b2f23a1c99fe2f2e8ea201009ca468e5b2e21dcda +R = 0ad6792fdff4c621219549834cf03808645171d944088f5a6d3cf1bd826b5588544a32f231e8428a03ec02d6c1c1243fb6b79b1cc6d732be5be8f2cedf03c1e5588822eec559b7c +S = 178b64bc5f9fcedab17822e831fa52d49ed10afef1c5912893df4bd8dc960b474ed25883ddc343341b696fdebd06e177f234ea45553cc83920a8c799ada2deccf1ddf1dd9aed863 + +Msg = 3ed244dc16a5cb292db4b1433b0ca3226913f07377faa20c6c1402cb4d026de808ca74a6d4ecdd7c4e662105bff6edb9fae0117c50aa053aef677c0750c7a446edbb879110030758912e8fa666489d702d8fceb719963b24a256429bbcc869a1f4ab9de9db89263e3684d4daa1df2ed94bb59dde2abba63793e5f82aa2e4db83 +d = 01fb980aef64254aeb9bb613ff2fc6967503db4bc1f337882f1566cbeb57489cf32e34f310549f41cba1b951f487453c29753a184e33330e90d4b973d2e406c99a239a5c3f96233 +Qx = 36ea761ccc71ba55aeab229aaf874a7c2d1ec15d821401e2988dccf02798c4e7bea80d9fb8d30be213fc80475a17f45d60c53249b66858d29c73e73117162934dd71096d746742e +Qy = 49bc28f4d45d29c3560915698d03271028f56c29f0ead0608cb72dd0b62490f95bbd67145a6c0adff0d6ef396b4deea6a5e2a33f242bf17e907b136c039c127d6012c88b76aab3d +k = 0ed404ee6b59ffc445b16f11b9b1471249443f8a7309ad8a662b7cb44c94866828c906fd64784c699cd29d3d972e5db3d42157452630f14536eca23cbbdd1d37e199e5a586fc352 +R = 1056938496df511d745f2cb88acad279ec2d58bb36498fcd8139d426d596de6d145b765a5b3e8366845fceae91d14075356a32515134e577937ce2af7e732b4e89a9164d083adaa +S = 0d5156c776f2184babd69c1f200b8bd94289d45a2f8b7cd8e8afb1455e8901d8c3ed14b7a23b0976b85a22b86f3ccff4ae91e286f696f39646188b675895684f33f0368098fa7ca + +Msg = 40343935d9423ad30f3fb1832bb08a5d20ddb3a55b59057cd275320db4a5835471c96cfb7d67f41ef860cf5879897b8dcf307bd1a52a6226847b768ea38ff1858f59e64cd635b51e6863773cc6c64b363ec47ca39266422406264668415c189e2f92447ac4c63ee5d74e95d1e6af05016917ad237f482ea0b02aecadd370a8bb +d = 1d96dc09dfaf602789c1dffa5c9ba130832badcf180429660daadf4cf1be5cca92fe9713173861670eebfe3a0ba25bcc76aecac60a756f07b69687e05c7e25984a39556469f62b4 +Qx = 452b1cd70e3c88bec1fd0e4b8f8e9bd5f844ffc12f3d6769eeb1c9ea90e599619908682eb5e43b1d6eea63ba9353fb64b59d6549d19cd95f2f54156c81fba53aa0dc91244e7ab8b +Qy = 20926ca366dc657d133f0ff9149738738ce68f3cc2f61dad590e2502e8fea714b89543f43d97b46b7075c58375efa379cde208ce769a16be9a377a111a8ac51459840a223f34695 +k = 1dfd064dbe64c25a832faea1819cd836d22583fc40b2ecbc19b1f5173c25f33ca8cb7f30bcd619ef73a4c14c46e610c8996059612728f508bf7db7ab3191ad61955e8b1ba409692 +R = 03cbb0ae5f7c0978ad8c10c4ff099767465ed6fefb7358f3eb58a79366707107cc88b305661526f2972bd16923375dd898ae72e81f290b86cf9a4dec086d7ef04d7a7bba5087f8e +S = 09f77a86f0da4e35c395978603cbb9c4dcccf126b7cc924cf62732593bb1aff0dabb6d58321debad4410dbfa1fb8fe249bfc336db7669e4ee13485ccf8dbde01ca4cdb9acfe5e74 + +Msg = 274567f8841183e68c4f6c6b36c5a52fb0e88492e4076b9cd768bf571facf39dad6affeb68941ee326ee461ce1f33c26e4bfb3c9e0cae8241fbcc14cc69c1af68701fd0be3def1e87b7d52b682ebbe1cc225c1bd177b0886e3698a06d0e410a1f92c9bdf7239189f6acde0d0653815a72987671b415d1e8a70e685d6e5b14c33 +d = 09d98b32c8eacd135ffb8e13223690ef02c0c1f29ea8b4da193502c8cb3f39f9eed608c02fd457f2fb685ec4595e8fc8f388d26778d225d2b18c9bc8b199d8b65c0d1a6af33854a +Qx = 775560724ab7d98407e20af12b03634a757037f8b3854957e11900d58460ca20d93ef06436921f8d4481ff9123a9eff3973e17d441511df3cd88d0d6dfc8016d2cbfb8963378463 +Qy = 3082aa4a81d4e6f0ffc94511327202f2baed72c08026e05a288eaaeaa36a1a4961f400b4712ce68778ff38be43adc2222a986ef0fecde62f861575842429816c8fc77797af018c6 +k = 1f4acd3430931ecba5e9d986c6712467526ed94a0bfff36135da3ba7dd9870ceb38fa0b658dd391ce658774c6725360dc20e5ef41daa9cf52fa863840ca91053e7287ed29ac69f5 +R = 0502abe544fc3262663524cf88a5bc256b20829b7bed3e2779f559506adce3c4f3a89e18bfd31819f78ae3809d9d0710c6591b2fc90039328678aed9df2fae38a74b66f69295d82 +S = 0b2f055248d9633cafa4db3b3cef0b76ee02f6bda3d508e19c68870e76a02c69dd1013a03fd741e854cb34f815432bf48138203177141be7209e957f4db1a958fcd45421a213c98 + +[K-571,SHA-256] + +Msg = d9c99b8da92d3c2e40dea3c4025dc37770e867c4d2746c4d726b6de24250591a586c166c88acb8ed340e161d4c81b9d14c919a1b06f1feb22c5ce5fca2693bdaf4994ac72c8983c87f331473fd094eccb3d5f3528e69d487562fb5a65c150a8217192f8aabfa7adcfd0b6916d5000248fbbddf1ca2f38e3d9ed2b388998b7cfc +d = 04d873ac744c4f68bb044783ad69e1a733cb8b8f483f2695bbd90c4211282036ad7914a53b25c3e890c6824643cffbdc4138d7ff457e3fbb99387494eb5cf2bdf1ad243a3a1e644 +Qx = 4644456a4e5c543af7a086640fa9ff6627c2d9f17066d255c3e805db31fb1ba895682e94f6ab96d6ca449b0c3f76bfd6593d182f422689b31d9dc3bc0b70df210a96d19af9ec2ac +Qy = 1d38f8572a06ce22c1586a8329f9421414b334352f1e8b961f7e0732ee01e838eb975bfb2f62132bbfd9acc6ef8899b4fd388c2b59e564fc3670da7a008ca016de678d6dded137c +k = 0b050aa7266201a42dbee063ae2a21398ee1d2a190de9fbbce2468836e416b3ec18d7340c81fd2a5283713f9aba33e8cbb105eaa2abbf0b687fe2713921bcbc02a4b77df21f762f +R = 08351115714bc8f29b84a6e3f0a23bdc219d4271a9ee18bdab54c3acc9cb3468beb1f89b0f981da5aa7d7ec7ad451bc5e91bc98440fe20f5877a4e73614820b9ab6f2bad3e2e609 +S = 0c64baaeed68178f5a1d8f095b0932fb73f9a02462df5e8378746ecf17d05971a0a287d5a8e0317db055b02d4f4b5864597d0f9a9cb1ae68577dcaf7db09c55bf3d3575197295c9 + +Msg = d2b88a01fa17703c99e5b867c645e98feec0d6d1afaa20a97b5fce9c23f0594460142af4e36a5739b8d26d3ba35a0263caa5429b4abba157f359fce701c43372500fd2ae1bc2ed80bfcaf8cab7016ff93d4a27f565b7e67fe7dde22bf02c48be12114fbff2421517c825019c0ccc72d927bef156140d7f0e9b6ee37af78c3efa +d = 18d2eb947297a054f8a789771dd875b12b26ef057fb91235dff3b062916f85aab3365609bd2a38a861439c8514e33f174c198139354e63766942f605107cb1b9709b782622b295a +Qx = 3f6454f1dd032a925c6bc3e1c62892c1dfaa700d3badf83f07c1185c31ea817641865a129572f3351340fec331f5ed466db7bea3ffa9723c951b518ce6f3c9263a7bd6866c8b0b4 +Qy = 188877b68c10cd6ee543cc5638bf0f82db25b9327b2d81269dc61250eecb976d6568a9df29277836b97973e3615e0a4345e610b33909c2340a23c61dcc6e2baf2bc363a33381802 +k = 0ec6af799d92ab52c51cebda61ab642d4876f374edb17253a1de3e880048355e58367096d3bc0402e4b93fa6a6c8d55c529b9fd68a27962c19274393ebe1bd0b1197a28125275bf +R = 095c42b3ef01c0f9ab96693526e903ef3ccf0d843776089d15e77093fa9d010872d65cee1801f821bcce747ddc5875eaa462b00424e6cdf0995b87c6cf33c37d4463848a6ad7fee +S = 0c4f0edd4b2dff4f9fd1fea5addef6d483bb51c27bf5c7aa13f9482243e5ed5571bbe0a658543c69b731de56b6b34de27795095b3676375cb4686b45d48010fe8c941208cffded3 + +Msg = a704a1428cc894f958774368979fe075353b56790555386e3b043dc6a2919b94a11c7f85883f46b4d47b324d349c28c667bf9a000daaca1d7191f2a0fd97a4867aa9f72422134a690625408a9ea4b723704690b69152655f9e9dd5fa3dd94814d97dd4f13e85c3f9bca769491c2461fbd17e28afac00bfa81371d5039013da8c +d = 0594fc0b7a5cc0216d2e78eeeb6394c8225de795f4b73bec48b2f4ede185ba622b59a16dd3eedf8cf2c94f2ccd6dcd205f64c97cf1b7f1e34129e94b5129502909f43940dba0746 +Qx = 271cbd3e0d73ac19b975559450d686ed67eeaab4175435b2801e8989966d7c5ba81ee7d749e43dffa12efba820462bdb274a57d04cd7e92c180cdf555686c78aad58444d5f17129 +Qy = 7c407b46e93d4c2b12c967cd3e41320ea8535a2ff24372a5791fac9e95865e14d545dd3627dcb4aad2350db248ef49469ff4d59a879a84a19d1c0e5d7ad3db432af927c88aa5d48 +k = 1e730d50a9747c7c1ce2918fda7575bb81a74757cf9625d0f0619aab7f1eb6954dbaab749e573290406e599eddd7d3376dcb3fb98c116ed7b65729dd04ece3eab1d7b4bed52326c +R = 00d59ebcfb30d7b27c87d56ec2fc9286b04b39e68dc49b395f374e19647bcc58f2fdce1c0dc815cb2aad55cf863a4786efd6c3a0ce56c1d92aa20a19245e74550c17fdaf7a08340 +S = 134e80d63c9b328e02ebafb75eabf0fafba886f48b25206cca9086e03658ce2047c94a5222a206c6c5a57ddb8f59c5ba1408fc56668066fef4557124c430cbd1267455e0b31a8bb + +Msg = f8a87c4acadee27a908718461e3b45060ae4ebb009b10a15926460bf219cb7e75dc3a993fb9a741b94e2fd71615c50f6df958568f452b2cc284f0516816bc0d2e2d45f663155660a26326f63f4aa42a6e1cc8462a2ec620a365257ec042f55e4047b62af689592a1a072553ff174dd629a4f51837780ca232cf479a68c1ebdda +d = 0f000631106c5851e8ae0802b01e7a8a8540b427a8a3956a1d36f0600be89318032320cc420931d825cc964e823745c60aad3437ebc1c91d32004472e9677605fb708e5a71a0d83 +Qx = 34136cc7b8e2dcade5cbb9b3d0e0857c485ee791f862273749b5d3757d072bbeccdd8eb81c67fa6927c1aa54d823193c370fc596d0d903214d7967b905292f4b96549b3dbc9b47d +Qy = 56f69b42b29ea82b9f2fc377e874b58ee785010bb7f5814907fb5531789606810b71613a36035cd257864e414fe0e6ea353f398745df87ccf25b3a25cce1c78f61f5039d66241e6 +k = 009781f5d960870a289cc20f6b1af56602e5e12d9a7353e81b89a90b0a9675686f15511157d9fb70b82e8b2e25534f8ad22e14ed518e62a88f1ae21c56d4ab7763808851762d3ec +R = 0f3eba5ddbb8c127419fe5e8cc1aae2239bfbcd2ab43a006020b96c9e7db832fb09e0bc887aaf24848491d4de935b78141f426875f7dcf2937748afb303ec5eebd01b6a82a8c4df +S = 17acc35bd81cf24f983072585ee1e096459b408da909fd82b5ea86b77154ecfbffa7fe97271f50b67ca3c29ce704b28186b831300db0aa0dd6147d2d160e4aff14348ba76e6f711 + +Msg = 10b5438294a77c7e517ecfe8f8cd58d75297b14116aa93e574996ec4acb21837e6297cc0e7e7b5861e862062f192f2206a01b1caf42c6d7181d02c7d62b76c2881f8479449b02d32c6f792714d8f70f0c75e81c7d9abb996be87f5ad9a01fe42b75855558d5f00df392b62ae0d258f3f67dbeaf07208952e679a2c573aca941b +d = 1023997206341c6147c536d034a9c38b4012035dc2c9b7ef0bb9cfe65e7d788296f055d508a1fd957b2dc7f9eb10c27790f15f30d81670945e54a508c57b70b46b4a09f4c769289 +Qx = 66bd3f503cf42a20cea4a55cab75940907f38fac7fb024c55245f02d72d80336574a72fb248b1b61e3205b31489ed789ee78d88e487db3f5a1cd48efa1487916b8707e72e4be7e6 +Qy = 10b6e4330af0270abeccf0901dad2f8f64f4993ca93a7c5281dfd71c6ec405f9a9bd78008fd22fef76fb79e20a571df16c4d97244c7356e3ad16cc489d3a9b2e3fdcd5f23b48e26 +k = 09137bd8436dd126924943e8599c87f64564297117766580e6344aa3c02056c811fb996f264ac4f8f0cb33eaed5ef8f120d43a1d2b3e5e34697765ff9db4b4683ce5c1596d74723 +R = 03b684a66e92d352847f63196181160db3de7a304b6e43679340eaa9fc828322b5b9c16a1772c981ff0febb474488daf998d4acd867e78019b61804bb675a98cef24fdad088afcb +S = 02649a94d2bc243e997bdf27be7d6364459c38845c3bc8d1c8b549ad4689c8a4b4fd55193ac769b1da607dc96458e2f6abc602bb4048cf6b0933da6785795d04d10f22e439748a8 + +Msg = d83a52d43216fdb16b1b40469863ca8eff4df9fa358deccb5ffd18b3e22a9d654aedc98f3dbdc4f5b4e56b4299e25d8a5a38d01b34eb93de382df1ae4d1c7f966e84b84c393d167aecc6f1192c4b42cae83748b1ee3d9147ce7de74cebd122695b455e8082f86e3e488fb0f51b3b7edcd579940d1cb9d045296e5e38f201b7ef +d = 11ebf320ecf6a908ea5b868afb8e22246ce84e743e1076d6185ec65dd79043380708bf8da4ba802c3b93b8d15509bb7d7de9dc29f1e9fb0f0f2cb97a26698f955b1f7ef668122be +Qx = 38b2760315b0999f9629922bcdff65cfdee4938d4aab8cc3d200aa9c1db843fcbfeb9da10afbf10280110c49f0c18f15c2aac4f39af35a79557c68eb6cf6afaab973538b98b0a6c +Qy = 7da55796396e919f9b5967608af06bd01e8870354317e76bcb8597a379129e35bcb69bbf6b38911a03c3076f7fbbe9b179e078b442c604519e330282f6f6c21aba515d6d73c0257 +k = 1c219274e54a4c5e1e1aee3bf805a7002bbfe1c030cd4c8a1617dcea2a14b1d537a64cb07c5a1385edd76f3e4ea9a38e38b458d2c7bf8eb56a57fd33166bf59a8af2e9639106929 +R = 08677167a7ea1aec4de76d1c5effdb5a1655965850bd6498aaa4fb3fa50f213fa4d99caf4145b4ba87e34797babfe614dce6ac21d9c13dd0fcd9802b1414aa92dfa18318c7e57eb +S = 048d6161a3739fbb3ee1c223bc82a46255d10a86a605f6c8e1934b13f1a8662f30f8e95f53848119c61f08037ee5a2440c8faa11a6b1800078ed476b2a3f4cfdb25367c8dc2989f + +Msg = eddf5553ed4db6e8ce72cbcb59fb1eb80671c884ebd68e24bd7abe98bb1f40806de646f4d509be50a3fabfa85c5630905ce81abfad8a55f4cd80208afffb9056bc67d9dd7f4660a5f924af2a3745eec2daec39a3fe36131fe9eea444b92d31f6a125f12125159ba095f89968a7028549466f41ad45668a861f671050d2a6f343 +d = 0746d5c824d78f42a1fd63d8fcca61f154ba3e75788b7a0b87f53e5420e23a935b02eaf67bace8dd8a8e7c1caee30154c2428e0a437cf12e235f41c416f92fb54528865fd4766d1 +Qx = 63645fd3810e2458d15b43287f329c354b07324c0707f19847c544f129e4de1799996f805fab7dd356567970e10eb21d875e8ee7bbce56c666511f9b4a4cca986683e937d6f0b3e +Qy = 595485c9a7f2a97fa7f8453df13b75682931fae10f3441042199fedba91a58c105df57b83d2a3911a2d34a2d41e451d0d2549b0a0a65b42aca40aaa618c252baec171da7937d812 +k = 0674788e75eb9d5ceaadad9fae036f129178fde1a584d73cf284acae3b4cbcc208ae7a5d35aa473f4e1201c19ee5bbe685ff9218a8e2188f3428ab45bf09b6b600fcf81fadd8d69 +R = 060d6dc42329687012a93ffc5b846b4dce3df46ad12eb61437832f81f4fcdea7392582fd75e701e106e5b83521759da6a22a21addb63b73783592d3f29347f3d484e05c19db148e +S = 197f3b2d4f3e10425f4cb60dd1ae84fd8c87f62a2cc822342d5f0be4f0841623227c5cb0f8bf83fef483a061e30ecac86cea0210036083a99fa1247b49e19a7f401a815cb68ab3b + +Msg = 3db94335f6d1a125309622c0a9d71bde1da09371f0285a93bd0aac255fa8f10a56074e0f6057f1b1aecf2d86a2319590ead96a2ad1336fe844e09339b456be32374ba2e659fbe9d0f2cdd83444d117d2ce3204ce4b4294dd05405634b84747ffb4227160c4e5c2c9da9815b0c6d20f55705f16cdbaa13d107ae666d707ccbe6c +d = 00670e72ac2de50dd2cdd975a6cdab10ac45e37ef7a28c685d77447051496b5e161f8b1b93f6c7f32fce8ea05e94ed35fd7cb28c44bf51ea29cbaf5aaa31d6abca30a89430323dc +Qx = 54db4acd0815aa7ebec4f7661d80465c64f1fd4147507549352bc07dfcc6041ad309bfb1434b60f73b3d61ebde91f849004d55257e98b6ebbbeeabe960f9429a55a36ff75c1124e +Qy = 5b6f36f76b3b3c780b6a70bb8ea150e9cd6895ff6a6765a3516acbb4f5efa91434def52dd0ab81f618ff28db10fcf39264be8e7ea76e06516335ac5ae33ba5393080f114189110c +k = 0f74a0ec1a7496043d78891e308c82b4660606642ea669e4406683d44b79dd6e6a1b810292bcd6a9f59bcc2e590518bdf2e9224755654026d85cf2a3d9768d909278448f0d63fe3 +R = 047d808febc1065646e6a5608d62d1445d922084487a64e9ced5fafff2977eb3a7e29984230946e3fc77a766820747122fdbbb9100c591ad7c9dd29d07efa2e8a43357e3c47762d +S = 04dd6c8ce75bf2792ef227cd5a3102d30a9a31690ff5c21354f8dac9f826c86ebfaa04653f0ead103b1c8ea59f0a78f5d4e8eab597ec6c028ebcc57f4ce4103ac14579bd6e15166 + +Msg = 69166ba40768d0a3930325405edfd85f3272f7b8e600b0b319f070274c91f9f03d0e6ec4bfc7b4445e91b87cecabfecf5e77c7301ee3c6b0affca2fa02c92216698705eb75443eecc25438db2d2fb4b24f4195d6b9c05c53e0868d3e58477100607ffdc31b18c40b4ad7202bb034e58653daec0f6b33c024d42a3fc84bd8f86b +d = 0369a3bb96f884983c23281bcd04e24a3e5f6359f81e3c8e46f3f6b865eb6bdf98a630e90646275c587e41b546d3ca7688cc207afda15cf9b25cf83bd6ad27908647f3f9de59de7 +Qx = 0eb02f6e741b3f83a9dc50853828b8a6e0861ffc644162515a264730c662ba388ac0d705f8b36f5388894df5c1bbc3582c85de141abb7712caadd2d616da589bdffdd9258808a41 +Qy = 5dbf831f450da6f8e503c19a7788c1317ebe556a458e2bfbf3137f986c9c966a14ca90344be1b76457159c9d70f13af7fe0013cf605010a8a3b84bc0fe187c7d93e4cfb2639de57 +k = 0ce22f7f2f01355280ba2d2cda06a55771e66f598bf79c65171e08a98f1d954e4beb3ec77ab06ee60c5fd156a7098023558e3d630641579cc179739bda6d860f8ba1d5ef717ebb2 +R = 0ae86b40d10ca45c20bdb3db55a6dc12e9b75754679eccb44c40fa57351c23c062282e1da9e1703176e4b8f7f224982f2474494772a20269c43a18a7a03fd12d8ebb975b83ade0f +S = 15ff7b34c3316d9e7ee3d7b48ebf97d98453ca32f3fc67fd08761d93cf34cfa5a2314fd0752d263c3eb7cf842aeac395d41ad3c04c1a9d3808b4fb7489e880d130c35a26b702952 + +Msg = f64cb668b72f1e6dd026a478505c0eb33446ae9a2993bc7648aaed02e172fa9a0e05eeec61e756ba246c1dad7e85d3f01baf734b1905c5bbd1b08d833c2cf1e079eca75b866d705c407eea8618d23ebbaf269c7185984b3bd4117ecfb295ee6b47eecc8d3a78bb96552f6be314656f91caff793838226662c75cd7804b6bef79 +d = 026717b039df834855511815d5665ff9b654facab469390ae257b7f0eb4dfe66ea0dc037242ed0c13bf229b8f7ff26da9b55fe4750d3451c62804aad493c179ae45d08ece5af085 +Qx = 191a6d1ab9cdda2d593d5598a966efff829c04c421804c2297e658adc5c9a6092e146b25c730ff7ee65cb9812ac9ea0c18dc6b60deda948b4b7568e8b8e14411a6969d7764652ae +Qy = 3744af98387421d958b26971d21928b73bbf5b0f0ef183e9f606d0348fa715f153a60b6c7991dcefead2ebb875d0c1dbd3665dc42a241c565ea0fb0e6349b4319c3de633883a516 +k = 0dcd28cdfe9028a4a6df1d41019bc58e4a1540ca94b717d258f2afe8bec560f3028e15ec1e8bfd422415961516659fa2b006256745e85e488c359e8cbc94cd2592bbb892a19c45e +R = 07ba5911415a3d21a3d98b400f61eb63ddda689bfff0c8c3ab83668b1e4bf8a703c853d3585b8bdc29aa2fdc41d5e7534850f4656ec949f0a13fd18295b662c9829723e5a7fe3a1 +S = 1b027e38283d74c962fe0e7b58dfbf5e21ce1d9c91651bc98284008f44fddfe4cec9441994e690d72a8ff3ba2b538718aa678e7de046b653403f3b7c064ee07c9c3c6d23e1b068f + +Msg = 51ee0b98eb6a3e3c1afcb35a33697c048dbf61374629ac5702a57801fafbea4d6fa5a26c9d1b79d1c58257ac0106387fab2d4a1b7f8c0dadcbe7c830613531b3c209bc17f792bdba1c1fae1b7528aac53dc86c2094b40194577325c05d2258303a2d17c854e7449489c43991b6877a50692a6340a528a6b188440ac0cddd4c4b +d = 1d642f2d393ed4abea37173e4a79534af87adf534ead4a0a1c46fb047619221e3577e6b8bcc776114d01159c736ab78af3e53feac339d7afe58be8e7a8ed290f1dad960f1b5de94 +Qx = 23d1ea50229b70b46578df6904fd528e9930985426eb2f1ce10eecbc0c1658395948380c4047d67bc4072be2a2624d62a301da41a5265f040642d1937fbbb7cbd205e1db85b8685 +Qy = 625c82ccff6047b1ef4b08f1913f7366c4f6c0312c21e5ab01b598d1a9618cf5c22cddc64a4732b477dd5c06e332b846c8015a2e5a195326bca46c29cedcc2f24d37ebdb7c2eaee +k = 0c9066831d61a4192ad9de23efcaf578a5d5774960a2b3e3e292e0decaef62d1701b86ec6183d8e17a699d418ef9d084b982c97a55bd76c8b038ac5c639451096ca4d331f070ad8 +R = 005778acb38b1961195d38463abd9c19d9e07dcd997f19676633fa3c44caa44ad1a9bd63435f3138ad8f22a731e749a81161c5448eb462fcbcd69ec2255cc2923ac697ed319316c +S = 1a1aa90113952608dd17dbf391ed56231ecfa7d649f3274774ed2b6034a2207c05c6d8b6cec480ae27b58495a50b1e5b74a17ce6cf2e43aa273c2b813c0e6c79976882b7e4b1c93 + +Msg = feee50aeacaccb6b1c3d95c6524044edb78322ee836d8159c4a4c2cc6982480567c4c6cc4806a564876622266e1ebd45f2f4be851b79da025bd57d0e6acce1ec1c8c255eb89713a1e4897d4ee0f7a248b9d4bd3ad5dc0e57f60ebfb65691e164bc908956a019083e923cfd33dcf37c735af3462768a1e14a8051d7aee74d5228 +d = 08cb70be29e83f697a3e2f67d86f1c1ec9a163b5335cb4a06004b6634948bf60b8ad9df9b27d2bedc4975265ce44a7884e57082d521320ca4372d38fc77b18d3fa05ad8aa5c43d6 +Qx = 4c042bde9e90b38b48e60551d832a7c80377a81e8c5b010d0e491cf765c432b5edb0771aaa5f672edf3ba108dc71459d245ad60f3884b8cf33f8cf797f36b20e4be39c8389e66b4 +Qy = 75f2454c41c0323ee1a640755077d36a65be7c2a014db36719ec217e21a9c004bae5befb499bf6be67e82d3da70475abf9dfb751c84c409fe838cf1c6ae109d27f24d75c02cc5b3 +k = 186f16dfdd7a71f20a5e634ffc465356914bb52286d3d5ac00f3ebc02497112fcd592e1ecb2ebbc819e07ea092e465e66f3e58da7a2ddd41c8787f57c135ba4c168539b4743c3a5 +R = 1c2140d294fafe3d9effb33ce73bb7e5485c93c7aa9d33b7535c7053831a1dbe79075713794c87e52bc887ded969d2dfa6a1e2630cff96760310e04cd2a75be6fa020a12fc84d3b +S = 110aa165707b7de1b3a8e05e4502701abb5ade0a27deb04fd93c6eb24ed2b67ade6c49d78e874d25247e948f704d3c5b925f84c5b07c9b289c4f8507e75d0f8927c6dad6dbce885 + +Msg = b115f7370d6a93a90fd9dfdfb292956be34b61992ce1fa5627c5e928d74bcdeea66d4040c473306a0070fa8363c4303bea32f73ea3639b5c6676fa5a1d68a2cc1f91f00580d7453a23ae70af4cb1f1657aa82c5b305374effe5d67d559e46a6cee6360503d21070506f1af30bb000d2f2f85caa6465810f89968f33abae81cb3 +d = 1eef463771f9c6285f3257691dea0844687606d4dd00b6020517f190891cc1be97cfad21d147ed8881b5a6e19b22ceeae30e1132476325f2de0e9af2e14c80b8c780a9d2d6c96de +Qx = 24de3ebe03d2d91b88794a77635aae6743e597410ae10c356a51e3af88fa7f9c4d648c7d1fdb887c8313914ed554eede282b24a2e66aeafcc0cc96907bb2f3877eeb97df491bef3 +Qy = 1ce1f9fd4d7d3870997f34f54f2ba8f08ac94ea94f74a766f2dbc02e4d5149802e3135a2d762e3b8abb01461968f1e88cfc8c7fda49c099e392e80d57f0c14de9c4fa1eea25732b +k = 026b545702baa340fb6d1bc2bb96f7fb1a77a2428cc122ea380a258c747d4e0625bbf4e3dbc2ca2f15bcfea92f2417cd5d22f2bb5f38a9ba313b3bded506d3e570dcbcb86c2debd +R = 091c162d040a12f08a416296a43501d92e2ecd6be302b5e1754b9ec119fb8a572626c509855c7c868a07b263f66070ac986f95e4c83150a5a492d5ea8a7f8ebf556c17ad2bcc996 +S = 00c217fee7bb202d6399f6b1ae4e5811d9361573ed4fe1b3fe5d474cf06d0236d59dd3580145dc0bc7632c721b6463c69490a67d1be1fae99e34318af6df939f9f7f36a9bb8d5e9 + +Msg = 726782eb0d9720daa64e4a77b5d8dd67a1a193f15eb6b5162e3d89c925ba63b7c7e1c4bfc8d6f11915b0e14d16ab53ab015317bd5958b0beb6074199e05181915496575768d026c23e92e06016598de008c3718aaabcda8b68bebca0a73ecfc7327e8d3646106b7d114dabc46cfe56265c326ee56fd2ca87abb5bed8f997c735 +d = 13bd452b0880b101df1aa65724fb60d5d85b37ed5419027481661a3617e0fb37bda1151b9b5b41f908ba832011f7850b75a07b678e5b8cb35c5fc8b94a625e4398cd5ada2b04cc9 +Qx = 31d88b62d2edd5f6ed29258c143bbcb3d29413afd8f86873698a9efb8d2021186415d301599232989a0df5ea91ca222c5781314f200c708de30751feadc277d50e64842dd355ba5 +Qy = 1c76f19ceb1be48f5540265b8b018da62fc225cc0d2d1675bf7df71456cc8e35b002a220e2e80691600a2c1ae31e980d0cd22b4741c25bfbd413f10b375a4d8adf70a65c48ff006 +k = 1b9235221a6df49e39b4cde6650e994f624fcb5084daaa62aef54bc154949f4da9074636c44f50ea40da1a3f01bf67e9b62a725ac0537a4e37ba33fdea8ba8b2286bf82901a933b +R = 01dffcb5b5eb23694da4978419110ed2bc7961c571a2e68daebe21e598c8b483b34f3178978708db6d78455cc1fb4f73c5ab7607cbb4f05d4d008c7bbeac88562fdaf7a370ba394 +S = 057018fc97d7b16d69af2b7dd4a859f09dc178a6025e1bd6839ec7c75c0383c59eee7079fe61aa6bfb3e2c780d4ac0ee074e6b13223c239aa60ea1187ca4937864f89e2c65056b9 + +Msg = 1c2418243fcd89c6382b7c3b2a8c341f26d08174a9e9296c4a5c98c5793a0fa48dce51e30811a96b515aa22bf9af89a43de06d696be1e531c5dece1f69fa6ecb7f20be063c602a16454ddafb14385ae3f8246c3f989d0566e06e7ed1864502896ea19df8393259c4dab3b3380a4a80b4103cbef4f38cb69198b7cf74ce94883b +d = 1288141ec2244e4bb3f62daf4ee588aed09ce22be55e3d42e9085a947c1f8cd16533635d170bd64ae0b417346fa4670c25d41387acb2a8e14407a1931d9f7c5358a14eca40974bb +Qx = 7ccb7b12a7d6997ed2a11eead3278a3f45ea284dfda8e17f6d926ddd6881a44d02a0f7504dadbbcb0cbd6b85c113aa0d3b4efef1ca151cc38cab1aa8360a6d22e3d6fbc0ed980d3 +Qy = 31b85dc2d2096bbba6c465629ea09ae3421cacc5581770ce3479070f23b3aa938333c7c691d9cb93a4533b2ce389ae34dbebe8f333cef530abe17cd21448f701608febd42d9bdc0 +k = 1e411ab53c48cfc1ef9eda97002dc9181a78352de13fbee3bed86cb00c10e7406033fa0ea97b50764b0eb2dc6eb8ea83e47bb3150ecb9437179c124f15fac6ac19b0c8bc324f171 +R = 14420d78f2f9f1010018848b0442ff6e6203c1dc06a4d523802190f462ed3c11c7aa7678bd03ba27df01cacf4121309551877d3a2bbcfee116c59926daafce55a4e0a7d69c5c938 +S = 16de0b369c28ffa0bd6ed8802a503929cebb5c0a4bf0c0e99b14659b48aabfd08bcb64bc2e39855d7d514d7525b3c4dfd2244f37019b5f86254cdda599bb144c8fdbaad5525cfad + +[K-571,SHA-384] + +Msg = 1de4b642ec7220c64b91561caed7832044d6e811ac909f3b199cceb0d8a7db91bcdc801412044f5c34b355b95a2c6170fe497f6d5259bc20715a38cb0341c88e93029137e94d895bab464bca6568b852340a5c5d6a225475f6eefe2fc71ffa42f857d9bab768ccaf4793c80c4751a5583269ddcfccf8283c46a1b34d84463e61 +d = 01fe06b94a27d551d409b0eb9db0b163fadcf0486e2a6074bafe167f9a3b4ce8ac11f42cf72f9a1833a126b9473163d29bca2ad139dd1a5e7fedf54798bf56507326fae73a3e9a2 +Qx = 38d4dce42bf8fffc39a5b6583a1a1864de288ef8479449d599115bfa35b37954ab288ffbe81e69d58693e2c8c81639df12e4b36f62b2ab042e92a0715b518c63d0ec630051d4be1 +Qy = 59c72c0bfb0ea1ac5e2fdd4fc380d08037a3d0eeed4990ff02e6cf5a16817ea598085e28f8269da86c547e7b34e16a06724ee73776529c5b5dea4ce3321fb168827ca1cbdf8856d +k = 0a3b18c8c9f17badd123c674869ff428d533d2ecb8c74f9784220be7a90dda591003df5259c5dfb612ac7398aa04cc9e82863eb0cbe66b6e7f45dd15dad252f74a538d5f4354c96 +R = 09c368c80f697c1718c55482b2c6c5c0edd7257a3a53f7193515629aa40a9716cc889d41c120516b54f3a106a171082364886e5d3a1e9482a103f072988f61de68f034d658bd976 +S = 0e782ef47b250f40c56e3ac4de112347174bd59fd4cc991a2b538ca90cdb222d048fec62e2773492a1d327152d1d6591740706fe2f8e1d65de888d47fdf173b2645813ac0fc3078 + +Msg = 70279be7d7ac72a32606642ecd81b5d4d0f95fbc3c0b07d85c16adf2788601e44dedb8e55e0f9e0b4ca3ca35f5be7511b0e69224a05204af67aae11ce154af6d594d47f6e3142ad183969544aa95cae1edf42bc699137f60178c12b10a67698e37ab9f3edbfb3acdf1b3513d62fe3db33b16cbb4e1f9dfe732c107f9d0c953f6 +d = 09cdc7e4945c485a41728f83d5188f539e372ff4fe38fffcaacbcb4522428e4f93ef4972556f4398fe17bdd885768f0fb5590df495badc794d4d274e22f2f4a2535555922fa43f9 +Qx = 3c6f046aa3007ba7f883bc1e0bb43a9a0a1daecdea3e2b6c10b2481d11a834af241d60cad7cab27b677c9ac11f2e5b5226c0a3de13029229af00e5a092340af9b230e0ed992acf4 +Qy = 6326ffcd62e1a68b63ac680a743130b1440bbcd3966207dbc8a8f4336eb6a7986aa53cfa4fd7bf363b30706b4fae01568020b41caa70ee3d51db982de66b0ee39777da3fecf5b01 +k = 0c717523a308418eeb2aeb816346b74149d56b9620774cab582f01681bec73adb779bcc7462fff35685a4e1e114c8fba474c68fe2650344fc9cf610908966a9dd1779f76bce0cdd +R = 0061067f377bff6a9be30c9c79d8abb7f54cc8f09eaacdc190beb27b1e6d297cd32b043b31feb49958745b78e42ac074b8722e1a7653bf03611d87c44fd3891ae410b23a2140b83 +S = 00edbe756a5dc78c8a29baac9e2059154294e3adac9a5adeb7b27ac6e4d4086821cbd55467266946ed8f6f03abff35b59434afe84067c1daa1e0bb62ee7c56b85e7f831eea99047 + +Msg = 4d7e0ad520445b6a5cb46b7c77fbd367614044ae6004494c2b3a89089287e2836c73b799cd8c90139eac427ebe335804c3788f3728ffb8edd7f49a4bcc76a9e24ce3c2299cea88c04645b82033115380f81b0c1d823e470631008d350cf0c0dba1915519985b8a389ccd8c809dbd5bb5051a79e631916e0d052d9b6cca18e0ef +d = 02bc753d007c4491cfb8ce0a6c96455acd16d37e02c982db216b8cc1afd6d10c6be4e15a3988b8b8b86b2b5b59a5c1939889024849317f27ee08a06bd8e7524d4ad83a1de208564 +Qx = 0ea922b09e902ce3847f14d3b3afc5562dddf15811cb2e7b9e06e1b919d795f8451a3dffcb92b418d30bbbd1a7ccf827ea0f1f6554387fa2fc51755799040133d7a655c7800b713 +Qy = 1f12439a0c0df9f6ef08e89eb1a62e2cedafc0460030810b2483ad9427c48dc061e4640ebbd9b4a398841c863a6e3d510e5c66934d66b317b1640bd05018a35677c6ac2c7839706 +k = 0385f9caee4731627276875dd8d725fe79626c18841562e8a13fa7531c7be9adca565c22459d519d643ea22478d7c51b4c286920b050bfa54ab7d42966e389c485b52cdb4fa1a0e +R = 02ac84262fd121bbec43e81021c0f0610fd2fc0b26d66581ddaa78714ce58be46965283851241d792ad6bc79af39f09d2d4bda83996ab41f1fd206b8293cdb6c4eb9d96f39efa25 +S = 1d9c9bc330adeee8f58ebfe8c1ba401d4433efa04a44185b0e8e20b634691bfe058770d074289e636af3e96c118edf31d72b5766c30f6fe84ade42f284fc7f2707bf27b3a309638 + +Msg = d49903f38b5c9b17542310425e59377f61f5b4f4740cd97371ee2116083f7758e69e7e2c1b0950ec6b76f96e3c91c721d6f2843afde8c7505a559c8a64bca2e665aa1131b75bdf86fb5b90581c7d3b61c2cff88f3fccf356ddf5ed282e27727be061b6925c51ea7f1a495f471dc8a5ca1a88bbe29e92338d3c9361460398965a +d = 02082c6e61d0d72f040905d8c1c20d47b029f41ec68d6cbf43ce97c3b2a0a770557a33cb803c432cfbd3958fda30ec1bba77a6613c318597a85ad02b26c44bb77ca96d9cc1194ea +Qx = 59ff339d505b307e05adb45aa314d47f2450e1b1aad840b5550a67c11940d0e78654755a8e28fb651e12e48c66cc1ce0338114bc1ffb00965b342ef3a3caf495f1d73a69c3f3d17 +Qy = 724e9474e6de57b9f8cbf6f6bb4f73f5769e6cb0e006a34c2510b379995c9e054cc4981c709ca85a3aebdf29090ca07dce5bd3c313c6153b551012d72a8f84600350e8754bc4abd +k = 18d65ca6c2ef1fb32dddfb9ad4603e03c7cb1791a9ec7b41266cb68b6048aa111f5971f3cbef3f0dbb9ce409b59c31cc59bd6f100ee5247f8c36f26ca77cb252331fc3be7346b5b +R = 12853f9d695b8ac4431c1ccc8498f3fc4916eb6a5e66b3795a3693f3f5a29ad13e58dcdaca5774f1f295e2d2d3c63c69abbcd9f388a3383371028fdcc8bd77f7554d6aa3f0431e8 +S = 0d1c324afdf01ea19e9453d2b7397584d773716d6a08b6e38f9a9fb104122ecfcc9de7bf1e5a6cfd52a08b7cecb002ebc21798d474f035fe7d4554bf632f237bce14aad88b47d4d + +Msg = 0e3f4afc3e7b25c1bf2d98098a5a87db1224d9bb45adc6e434732b8722a708ab80a1f3f6ef3c5aa70d2e1dad3e4416b12cc59171f05736c4b58bd084602c344f2f0bf3cfdcfe04c64e87597a99de23ded64b33607f7c273ec321f6462518715b11e91361e89ce5415bfc2ef520bfec378244a3bd2a4b9b6b3d68815f2f75baf6 +d = 0e298c93351323e2c5304015a4878997ae4e79d1c32f1dc64262e534d4f2c4b3e222356ffce746763373fdfb936fd330d3214a18c07f1205b20c9a941331cd676040ba1fe3dbce7 +Qx = 6ee4952a83477d89ea05ae63d5169cb0f7c7ff22f15728c6d69dfb30d1f28158e2667f9342cfd9b32f2fd537dad47c190d82f72c03043f2a9c5d97cd09d07ed4c35b96104042554 +Qy = 26d5935dcebc0ed5a07b7ffa50de3c8aac309dddb61b8c560230379696d81d72bda3c819c46387e7f026b384bb0f7b2ca90c402bb67b5e37d343cc21a8d1a0f822dbb2766030d73 +k = 12d23969d230e0e2712f96b11e196202dd3e6ac755c824f92b9c765e3fc808d4e7236c8a3c06ca2c8272c7ac953fdb936db30d892246cbdcb7f98c43177e1c30afcc162af511364 +R = 022f6dff5bc1eac1ef568588e2e512103cf56ebcb610e124a125fb004064a28291c19e83ea08171bd1b14ac729392c7c46354e795d63e3bb087fd100642465efd817b79924408a1 +S = 1785e1fd773446e3b90b8704cc2723b8da2f99d1d699e817c3c4622015d178b0cebc19b3a6dd972f75eb3828a386973c0a5e67ca192d69f1a84c825d1253f1062a990c3f1a947c7 + +Msg = 8fe32671f6927272fd3cd8dd4e34d44d27fac8c88b41bf9a48039e914990bf06d1633b38b9200ce1c2a275b9c55498e5da2d0707322c3ea0a0fd7aff598fb801628264e13047c8008153e8595a0dc95d54e70b882ac2ac9314d2b78e7b93922da818d7075215e354708994af66958954c92c074d132dbb2488e5a531c755a8e2 +d = 104f4ad56594c5cec2a988c5596d73adaa5a81802b40110dbae698ddb1f0b271fd1479c38abcdb9b234e69cd0da8a0328d2135c287d5b130a09fa0b899058e7800eb2dfcee95c1a +Qx = 4e8151aaf2aa6a6159622baad134be41c404982bb0101e820eac8f0a52166546c53927d9b419604e9b025757eaffac526d4fbebde5fba0841c6812dff2e9bab5054d4074a125ffa +Qy = 4413639ad72d6eba870e1760c71966544f3f881f88880fdef1edeff47cf6c235e8dfef1eb1d8df51f9c48b985912f1f70b61fd3d4b859e052887560872fe6e95db0f435778d5c4c +k = 0cccd1bf3424d8bb0513fda3db93e81bd34175d84aefafd26b37eda9e767618247bdc94ed2b1882bcae4c83eafc30a7a4a80806fda10a5e70b8827287eed8eac2721939a63c2175 +R = 05b1460e856548287683dfbb93efc869e80333a9ddcf292e2fa3b3c8d430563a01340685c6db1059aaa8b298c8db9e8281f36e3a9664faa17f413cb439ef24cbdc1a4d58872ff6b +S = 0c6faac191c95738f7c6ad0eceb035e5d22ae85e4bd0e27f2e65ab293717c0491be3d1b5ace80f4cb4bac7e33258706010c2aa48d84c9e39c95e30805fa7669c42bad84386f7754 + +Msg = a8fa01136a0a78313a5d160c32fe5d1805eeb3730c18ca0c47818e82c48eb4c9e5b2dfe3ee5facef9ec59b68f4e6f3213f77fba9f8ba06dcde546ae348d343233883894f4423331b536f62373a495852977a51cb192cfbec04b5582b4ece69f345979e234de32da7a120138a057a7119735c4cb19099bf48bb202e7ffac04def +d = 0c4989bf33b3136bcb4ba67906eaff2bcbc6567635aa4b057acb7353ee87ba3cb4cb9838f8f679729d5c6ed98e6c4199cf58605f009c6873a1b8321f83cd3c0973b7a3cfd9dbaa5 +Qx = 3871c7781f2b4f653f0d49a224576bd1e5363d5171bd21da89f590f49fc212d8a57ac8a140d923c2949ca287bea803afd763f15f909c099a07297e8ba1b37c70e1e8f0fd1fe9d1c +Qy = 5806bd5b4858ba0814da2167d232d55bb5c41ea0a36fb28a0a151c1b79b22cb16613ccd9dbf92174e42578ef88f4da6eb44918acf427fb7e4022da3376243e75410ba6ae012ddfe +k = 0a9eb767077886c48bc54503a0d2d62f0192d3581bd9ec253107092c22f68a15293d7c3e7aff56282f0cd35e86a2b3c55c9eec079201d99b5f49946780ce6aa18b225c2dfd72cf8 +R = 03eec6ffb390ecb2af4f5ca17fa8a7fd6938667b319f0f61e5c7523efb77afccddddb5114ca8c461b1c28dfe7eb85ab156e24e891cc6f9511d703e8b3c8443d04fd8de80f5d65f9 +S = 10cf3156cf71dafea6a0d6abbd503d72b13e6a684076ac900f390059cf3fc325966b3548b58e14a82bf291d9689783b899db7d4baba524b0b63d31f9900a84fbabc2ccad95742f3 + +Msg = ba2d83b21c783d6ef2f3b7b10e910a418a9b9f49ae0fd37990335b3a3d15627846c9a12a1f31a3d0e062ad1bec5650606ed4dd06c30e50c1e8761a29f4ea1a20f74635d5dac22e5b787ac10f4ee82b338a641484f91771c128c84d31cdab0a6b9616078c898665655ee9dd4ae73d33b94bf091b064928b959623aa71ff73b4db +d = 1a96f2ad56e31397e236cafc108087479c9823589a5fbc3dc7488d0e5d1199cf245d7f21f524cc0e8b47feca14c93fb760e631434a91188b32965053942f3bd39b3714f9d6f1a11 +Qx = 0195bfb66e20ae295cd22d59b27b3880a890fc44ef5c720b568bf7f72266293841dcf0572063a96c62736d9d4a9cce31b10c03016305a409858a79070477d3e989481ec555c8146 +Qy = 491122a199176e2492e07fae4ddbf02d2a40a21bbd99b8f742b546db2018cac27fb4b1c03cff55f61b7caf13b0f3b097ffc8e1549eacab89225e0cf1e96b268eab7f9a1a69258f1 +k = 097e28225aee5bc9a970a150502dd14bee900d3b040b0da9cb52f5824e66af46a991bbf6423fe1e089cba47593af555b07b45e47b0f4141b0412ddf6e91153213c5b8645ae7bab2 +R = 1439928b55917e93d59341532cd1f9d09de1f6e0d9a04514bd4b692603f2cfb75a579301b39b8cd92fbfc8832839691c23e0ad3efd3b4c7c3e9a366c1554c6dd13c50dd087b3055 +S = 1fb432e72be6fc524a7106b21d03fa71852c18c67edcb8b265db3b144214e7e6d10caad91f81616e03ae7913fea1e8d11e90d54b17705e8d04c8c20f0f4f46f117cc423ca178ff5 + +Msg = ea2d5f4e9797bfc2f33f0fccaf530db2bdf8abcec00f09a0338eefdba318221ec0e050cad1a85c3f76b784c6e8c18da2b062f333eeff18b7b781e67d6d0a4368b8231a892e0f4103012348e5df53ac745e4d34e2cd1ee9369f97d4801ff485fc144b2007008036bbc07cb1c302a00054b54f3713919191e1d5052978c9c2895e +d = 0c08ed8e0e0f8b0d0714b46a2164b933f8147692f18da97e5a108c44d5a5cf221cb50536e41832b83bff4026c6df156386235cf5e3e9a67b7cf9b2fa7707c5e0ff33a91601b8e34 +Qx = 2d516bdd1914c83aec1cb242710ed79efa61cbb31dcf8d238d8f5e089158b2ee2bab407e01996a1621b1a869a98227c12296cc2a71c1ef2d0f26bd6614f2ac77008048abeedafcf +Qy = 151474bef5965c455eb95ca2ffe1d589107dc251d22635f4a9fc7270358b64e4d2b81666b60c4a5c49902b0fa9963197b22f90a09cab97007842816f64fc49e351710db84980032 +k = 01125bde6086753b3bcf29b7d5a4fb0a8abffa6503b4f0b39960eba226062bdade57e4d73e8c1621792626203e83fd5c231a53b0ce10890881460802788d481f233466060f73359 +R = 199a1e40229786b966592ae6e275874ace23d5605d0c3371a4f9eca7ce4858927958bc1c2780e9f2f79767c1c72117c79c408f972006841cb621837ac002cc6510e0432d99a1f64 +S = 17f4e5e23e494ef149e4abce2d8a1ab10e3e6c2cc93998fc63baed6565ed350b220b282855e2824f398ae76b8679201b43450f62237f6fec643ea659e6c86abc24a63d82d9bf219 + +Msg = b2293b0a09f41decd9d8e637b1b08c2efe612f33c9c0beebb6e05033c6103b958f8aacd125d7c810b4c287349f5f922d2c6ed554be597fb8b3ba0e5a8c385ed8ae70d5ae19685298f20e8d844fb5ad98db12ba7e5f45baed9045c3e86b3cac9bd55b614b82fd075954fc59bfc6124cbd68edae988596575f379d8921b594c75d +d = 144090a0ee38cfa21fabcc24d35139a99656911ad4f6dbffb77dbe74e7993edfa9fd63d2c4f6bbdbc8ec21ba13c9f4a3576b5d6e3abeab5af5ac81b1f2bb6d4c42dde645d854d9c +Qx = 208729b3c7abadfc221cfad8be642588d5d1c20989fea731cfccef25886905e4b1e61cf9548d89c24f5706f5243dc8aa7d5b2675c2c6d2755ce6a12e5b12c28a2cd9c597b7dacb3 +Qy = 3db73ee445ffc0f6c77467f3add3b1e97061117e221687f5589a030f5248bb959bc2ed98c9fb66da8679dea3949b77652dcf83ab9c50a00f6a9c22bd8d16e093b2deca4b0c7596a +k = 0adcadb26626eb9f8db9ae98c6808840b65d6f886a3f0c45f0b993a8bc62bb5c08dcd87940dfef4f220f5e50234fba3a55e7127fcbb967ff78ce4fd6938a9bb653747116541cb85 +R = 18f7fb6ee028c3dd754d6e7b687560fa269b5a5fabb1d98529e0a27dc66bdb1ed79b7b5c64fb71e767d9497b9255f26b8150b9903caedb25f51594f5b7ec2870515f701bd68faf5 +S = 09ca9519388402d5d96dd9ef2d4ebfd0ebcfa58bf8c1970d04851b2409671c9d5e4aa833555df374469a4d277aab93b8df8d553399908c930f81c2d9769f1b30a13f61c02b16852 + +Msg = acce54270252e7d9e983c08c993cd6b7e3caf482a9149036afe4665bd3d0662a6818047187872862d5718b8ac063477f693caf1a9baa8bdf2f36d411a796f2b46ab56f66bc94924229f8264016d6769c85d9bbb7d6bb042fefdb8fde1be026b86af2017aacfe38c97309b4689b23fff94f1de880064f1d3ad9d74dc804c41f41 +d = 1df26b672b2e3617b6b6c631d3c6be0cb49c0a690de49643e0f416215bcdaefc03fa9c708471f1d87476d58c8f147517ec8a14aa945ef001fa01984d5c3d81f7083ea500558fef4 +Qx = 767ca8fe8f3a7addf01b230b99499b33c83db95db05e1956fb1891fed60406865291d79b0daca0c307a3ec8b1bf2ac2cbab728c6ec65c013e01775ee21a29305e9403f72883a138 +Qy = 0acfb786b09e5185dbd8abf831d12967107dc57a040d7c800d904b530eed1e19a8e52e653fe8bb824cc424d7254532d0fee62e8ee7ce8e871cbf6e4ca3bc040444585b9a4e397cc +k = 13e5e47048122c8301258c638bc0f00f8f9646cba927335535f68f4f4f51f23ac5398ecc21eb0bfe8fa6a2084e11fe67587bfa791cfbe2527797a4d98046f9df37662cb7e86a5a7 +R = 164b3500ad14063101b6c5ebabba53dc5acb4d6771d3b05a505e6a67727ca8ff73d996e1329c0f6d8f738237ee0f0be415003e2db515ef93931e09bdd853b9497826929eac9e9a8 +S = 06b65511990c061a6d2a97fe2a5053c775ce2bc5471865abb7261d0436a04b79baf41a0a852a57600cd4c6a114b3a8466f721a684aac2592640bc149980545daa271fa9b146f2fd + +Msg = e25274ded4840df0d71d3369007118f002b83e2d375c78f7e29ade067db15cce21842611f3f015db2efec57da77cb9d16eb1e00a8c1444d48dfda569e29fca1ebf40a22fc646a9fd44460f0e473bde487634bfbdac2c312f66a1c2982c6fe76c54ac72b6c8cc9345e47cb319a974b3cc4bb40634df74b4ad7e18adfa9a71ddd5 +d = 189918b832e9fa30161fdd927bfc267f6405335df3d66d225e17173af52a671138883bcb94c4403ca3e001fcf09ef4c6488934d6775af2b1da30a8f331579af2d0fbb530298d8f9 +Qx = 53e6b43c0551f32b7b34467d188985600c5c0ed12448f2e763609f40039f92002bc8e70d8dd3e337c3507fc996a1557d5f2fb3132507e49ce653482cdc86f6ca5903b77fa1619d9 +Qy = 4a9ac78a2c23be0841b96cdb1d55862e4854b530f1fa3f469ba9f7185e3f91c28d03c27d9666345bdbc7a44764595b303f49cc43bc2d0e944862913d280273cfd00e15b6b55f85b +k = 0b47a185140b583c330c64a10d50748e019134bacf153cb4a23753f140a4d607d5771a8f0f535f9c35baae5ab6c37a55f38acd12f15be18d5bd9662383b30e4d0ce487e8cb553e9 +R = 1a2ae62cc9560590177aa544945377ff6ab1b34e7e32a25140f99996c130e170015636647756a5e8522c936eb1389c206ac74c012941269165f3772373047521f69510c7f3e6acf +S = 1d86f4a6ab2bba7f6305c2df754652bad40d7c273ba2aadfbbe65c07ede4ac0e65fc0a37a0139a6ecab296f58c6c2532701bb008bd9e1ecac2771d9384aca094537fcab47f3ef06 + +Msg = d8a4aed87c316012482819b03a1d91691f2ad11a2f46082497ea8f64880d686891f7da550b2ac17199c657d4eb9d04d5cb8eaa180f743b87d23b1c86103f9e9bb60f4e19f0ff9d160f180aed7735130c03adb62502e69be5c624ed7bda2301f30580ae0921b02e103a638f5623c02c186e3bfe6ff134c762a2bcac1f879a9353 +d = 0bdcc175eca3a399b944eb0334ff33c4fd130999c8ac0e7b52ac5b774fbad53ccc3a31024f5262b2eecfeb2104b14bb244307effe3dbe8ed25686dbf46a42c4b6f8e34010ad826a +Qx = 7ab1a9279a8408828c2bd21ae6c643ad82633d636d36fd91498cfee49c8a635313f56993d02cc46da3f5b78fd243516cd23c14a4c8d79cf27dfcb05f52f0cee59cad5646a9389b8 +Qy = 799beb1ada93a48819ab70b74c36d2dcc3c5cca1f7a57ec58e643924c3ceb7a90c9cd9bf7ec762a2c428d16ef431a45cd5d069cd828601f903cb0a28182af2392b5ad12ac3a24c6 +k = 04ad8d2759df82dd70ebe9f3402d3d533a1b4635dfd0024deeee52b32373550f550b9fd4126aaa6c3a9b1f352c40c86e13f78e259abb17f85f0041e0cca9e2ae59f4ee3ba2fbc83 +R = 1cf9ce41dd5dbc3bee9f46f82e4bef10cefe79a87e8e00d002097045b9acd46364560e0fd27b0be6655e73b5cff272c8764b4c80ce0e1c91a94b8d05209a28b553f589ee2fa1b11 +S = 149fe587b144c37df2c48c2b7749c509421cfebab734003e51383cfb773c3ef5a24fbac0255cb807f5b95607121c5848d3f9656227b61d5a14042351de084d9b88745be242b6158 + +Msg = acbaa5ffc4eee0850075c0e502a70cc7a897a919f5e7bca4e798385601a26f411fdae5466ba9f6b6d8d7f819a749b799fbf4a3bda9105063e74914e8583ed8b31ea4d22164bee6f14bf53afca269b901c80cb3265be32ffd4ca4bc4ddb83e11eff82ead6d75dc4aec8e5c67f35d58a8a156cd1c0351abdccc0c5396c8fbe6920 +d = 007ab5a55a1d8ecb7f5dca2afdf9ef465569a4b0374716f604ad42a6e0271e934b09655e8e2529784b69b2894bb399b02aeeae30e9e7ae70a2a8e56b9e775bd978a04c728e3951e +Qx = 2df88e368c8162c1dcea5ceee3a4c52cfc8d6121eb81c31236ba26dfd1874c61586d2daacd96cb5ebc7053be57641bf53bf2651cfacf370cf470db86e1470bf285c7166c197e094 +Qy = 30067763f9fa6a9082ea16dcbf53c2b6f11c9ba1817198e5a4e189dd98141ab682ba4de0b3f873ae54efc080a2a03f755efeba3c0ade8ea67228b1a5a11d730302f1eb7c6bc3737 +k = 0d3dd75ec61e0f87737812fe1ac86ba336b1512bb9f7ceac2c7d1a5b4d5dbafca57a5209028cef9468ebdacb2a35988531baa094a1c901d9650f2c5d8e03a1621fb33ea85e2b506 +R = 184a98dec91b9afe52d4dd6b2d9f2d7e3c42e8e614332080aafd2621136ac7965beb4e8f97b222c1b2e5448b79534db4e710331a2f877f8fc2a9259129f0b24d24289495da22542 +S = 0fa384a04c4b0b0745abea373aabc09404a6037f302e234e7a2840ff39c2b86ae37c814e8bf3f3f7cf743748f2b88d02d66a3adef2028de94013c07075fb73f00555aa900337149 + +Msg = 9a57b63a4f418404e8f5dcf3052b9bc04a4f6d2c33bde8651506d9cbc5542ffb9023292dea463111fb78913ccdcd182faabbff9164219b8900c7f9fb394f7d9678f77b18f8d58526ec64d7c1328953b983a7c416583e05a069cd76aefe26e5f5687b70abfbf9f58f052dc0863b4fc3bef805cc3bb05bf76a83235af9d6adfe66 +d = 1e7d4da72b1d82e17a066fe387f2a0a7fa4c60ab993ee09710531789186077f2f32b42ddda497d5fb57356383e1f96973df043307f0b6519430c3f0d40d62954032872fceb7dce9 +Qx = 37c59e95132f0027f661511d1bedc3018bffa62aad7f44d7370f5b169d683882fca3dd0c4260fa8f72a47a44fb0fdcf0d7776ff0632378022bdd223753c66f98dc04904344ac741 +Qy = 2d7f19468b8e4f32eeeaabd6e402a35f38dbb9f2476cf07881d8bcff170b0a6e1ff8cb1bfdcaff734a32ae9bf34a909ae7fee689e3f1ae777812a45dd46ce13fe648016353c6bb7 +k = 18ad70fb9c5673e5a39b3a1655ff76eb84519555a6cd88e86a26f9448a54f04516c2449bab3f75e74a8d15c69926ac43fe01ebbe7e1c97e73870e3cc4c0ca431cf614f35659e3eb +R = 12abdbfb2eb08e326289fdf5615057d912749db4f17848c1ac73bf6a51fbe3e1b2732d4eb656715a6c459c6c3065b67b577f21b8eaca7d657c3b3171e8a4849f55024c69487e50d +S = 09609da5049092e0aa8ebcf10c204de54c968b09b9bfb3eff90b80bc675d557967b35f52e459f37fd198a83a858e5d7f9f5aff8b2ef7272b236dba5857e88515ed471a60bf6da49 + +[K-571,SHA-512] + +Msg = 97b79c76d9c637f51294369e0bb52c4189f2fd3bd0607f91834aa71b3555605a89ff68e84fb5bda603f502f620e14e8b0c7affefafa2f0b303009ee99653ae4550a05315e551dd12a4d8328279b8150d030b03c5650ed4f8d3ba7c3a5361f472f436b200b321e7863c771e20ddd7bdf739c51de3676f953a5501e4477aed1bd8 +d = 15b7271d4319db5743119c8103a7d4c6d57e9c62f3eb93762156d2ebd159980aa57cea948e416717d715a2e458851f1b2e9ad4172bbcc53861db29c3ee0ba8e82617a5866170847 +Qx = 03a5b9559b2058299161770166766aa65e151ac6a22a90205afd27de5eb99c5b1db369ad52f09141d3bf08884b96414c283b2669ec2a2a60c960a2f03d425dc4c229c0bb369d90f +Qy = 024f3a9cf3dd257043dceefe6617a98e222e1cc820f3e19e63c64fdcf7ce8d9c7af7323c9aaaef4df02e498597581082fa3767c8a38f508f4ca2c1eed6f298dc8142668a0027490 +k = 0c585e425ae4a34f9b7b9205f095ea07599716f1eab1a8bbd934219ad760c4606ebbeb06cbfd3952e045a040b8ce20603aea4f965d1b6e87eac7a61672823fb2de7767e3466c730 +R = 129162cce6fb05e1fc8630ec6c3a16d108bcd251719d89631497177e6fe6d1373f114ad9dde6e04a4ee0b4747f91c78703012e5a058c132d54f2ccccfc0f9326b27d60322b497e4 +S = 140163edb5f3c4b49228e4614bfc6da9f73674eab82678ad9947b2a635f733dbce99ce3209f613e2a75e62ed84db4d7d13de6d789b7cfedc0cb6a028d8316db8831db66c91791c5 + +Msg = 564ad0e37c9c37a60872a4780a723d08d1159ddc77bd834d74c1025cdf3cbd5338c3fc07a904fcad9b979b2a2ceb1a0139af35e5112305fd662a57af6312624b9bdd3a64849f95f59a46ca8feb2ed56f87f258518947474c1729275c4d89b7dd286ed65f286cbac76002cc63b92a73ab6bd13c4adef282f32297e441bdd8fd36 +d = 07219ea7917d174a5386df985d0dca798ac9f8e215ab2f0003aee929a2dbd91e37fedead0ed95b1e8aabcf516bdf54337b4aff7ace4c6b3179f2e919a49db50a41c9d4d58d4f636 +Qx = 2fd7f6ea770e0a6f1eeb3318b6b609c0e76ffeaa34e75f56910e8f658b70940cd7a5918328473b279f882816955b2e3702c22e0b3e03863f8d99c64f3a2c9d1c68f59a28eaf25ad +Qy = 6c2cca84218aa019326cadae9639069dd27df4d1e95a4c8e7d7cb426e70e2d38650b382e325dc3835afa719145d16a29e4ff67de37ac8949641f0d140072f59718450a669973206 +k = 03413376b32f18385cced4549e231e514eadfe05fffa0b252732f5c88d13d9c6e0c35be3dbf72029be5e4573b8f8829f6efbf58a12b5c161bb7055d1944eecc93f82c12c5c56d9e +R = 1c45c25f3e8eef9b92142f12e4119842122ed7672fdd82c14b3c34ade3243a4c50495c06b5984d0260376c4fa44c60b2e34b0084066d693943071bb663a44884927352668efcc62 +S = 08cdac0f4498173bf4e59de98ac9a26fc2c752cfea7a5b75141d4e1d019e25d70a717ac3ebb82884436ebe1007b0488c4ff29fa31fdf02f77fd99535c99b69c9d4e5f432516da77 + +Msg = 072ed5b14754fddaf54e20da42432df49bef38f4a3b1841b2db457ff86c44880727aca945770adb41269df41fc17f6a687bcaffaa45a3e59070526ed53b8dc3b78cf9a80a85461eaf4b477e44d5ec4c2bab9c05aa747a5a520b35fd09e8b44539d060ba1c3470267e0dda111b15dbb587614a46e1e477127f963a16cf3a43ee5 +d = 0bc623152253da24bf8d752bd78aedf7d5f6a2f889453ccdec14e10753335ea8bea83fd181a1f3680ed50f2324fbeaadae160cc85831750e021f3e44121ea1b1efc29a7d0069479 +Qx = 003f3a6cc6964ab2f6da95c0a2a7b75afe4f77faff16fa28aa67809afd9495cde1f5dce079ec4e15ec8c1a2095a12e8adc409fe8729d865f50ff31ee75d7d807afd2c15cb142be9 +Qy = 76b15c1ce931ba06dd56dd8e4f544425fba4f37f951a188c8e7eb13a2850c93b8ce60f10b3783647a2d053e2764a957656a184a385e95c2013685d4954a2b2aa20e4a15dbc43b78 +k = 1e091f4febd694879f78e83842572280daa48db65c463e66d9a7ea57b82fda531f116800530a03cef2cf7e5be5eeb6e420213ff757c27b8e8a94513e417f4acc62adc02a76a4fdd +R = 0264c499f7daa6ccaaf191d3502e86458ef088c9bf2ad989851c221364b24a1a3f4404fbd0eb44a41938ac6ab67002faba0bdde7f44ffe6bc10def8317c4e2807c3ca711cb6cd33 +S = 1b91c18fc55635c5e3cff70503e7a49572ba52b11bac193230c88d6eb65eff6b2d9a01f53ab0eb34f5e208538136811157f872a8255b4d249b6ffe021b0c0763cde4d7a7e72b0b3 + +Msg = e660dbdf3e61af39b83b95d3f1970f66d616f03273f7dddb98f768452b21cd39604a31cf80590d4a5e4b0d4917519e10fd325dd4ab7a52d70d154506329baefe0d5816f514ae109483122b4fa8fa1ebd7fdf1fc4e21e8d278a50c05d81c8f489596633d949c6c8fea96fe91430c01522a5afbd5042be8aa47da04581b2bd21cc +d = 0645947d981d258f2954558c31022a3b6ba5fa7b675312f794cb61bfff1d9ce87267e4a1dacb7c8fc58624d31c85ebe22f80d26a620fed5df5bf38515e0903f0b69a606048197d8 +Qx = 2d03e05c4b555943fd69a299249e7148e99633b286da69bbcda64e7b06ce9321d62bead7b8d095a68d9a3ab9e9cf1aeb1d8c4904a073c21806830451a79fe7a907b32df15ea4567 +Qy = 23cba4f6f1815cbe1934734a901206596c6f482011f6cb6d452329f9412d2ef4566429e7d35f2d247eaa7849ee141bb16914b64920fffe6b7923cfb19759fed6e1f80d6c40a0ae5 +k = 18955bb752f0af7d7aaccd0628dcf1f52d836fb91dc78b0fecf21ff5992d9c1f891f0eb3c139803b88736ce10ba4733a523854c4ae9ac35421beff9b20e0c8daf90bece46737579 +R = 110a428aa96277c9a13d4529f58ecc57cd7209a7340b4a78694dd9ec800f36c9c306221fa110e0b3fd65b9dcb67307b7d7678997a3143c04ba96d72be83a1cd6b01ef22acd0f82c +S = 0b7ae2da5cd36006a92a5b2e6369afc2728a93edc845ccb1500e551be361f8658819f7d3eb82ad41d7f2beea1a1cab6f103238a6025acbf03a2b08339841694022c17db8c6c6886 + +Msg = 8c9acbdc431565feae60e08bc7da113e12372ed373f1e1fdd581f98c8a7b0c79ac4aa42c7ffbc963fb4970fe26c5b5dd314b7051fe971c1186ebcb5650f7f7011a924de893f06961b8c75da7bff331847feead4abd2e8b9d6ecbedac18f4eac207b948e6e4215e4d5cb483e5c66ce7ad788cb89604d3a3e051539094079e7bdb +d = 14cf93ca69d94ee8fbea0c8da9d76aea092b73073d8f5385b65c6dd4d567fe86bc2cfb8e8be890c3c6cd9abf7dc3a17eaecee3d7a9455887863e496c48dc3e47821bd3d825b6bed +Qx = 3dfd1fac02ac4bd3e3017a3d94f29575238937824f80ba0b2eec185ce8c641e9fc72194323c779dde8c4fd6e748e09d66e82c82add75106a0e1739f2b977d40ecd3cb15a1eca420 +Qy = 6a73dd31226adba7ed8d08476b5af10a806fe8de72251400a83f6c9f6edf5e0cd6bd1fa8f3595c3ab32b4c4548729c455e4eaf83230e1335cf181cfea6b6bfa6cd4ad75ac3278cf +k = 176972d9402d5d6c9753532e5ea907f256a872c100f87bd390c4d610bc00c408a97bd55dff2de1ef2fa8b9716e33a5a39bb6ed2ab541848685040656ad0468b360f42c3742c1fd0 +R = 00be28427524a3b0979cd82fea407463647a77ac45c489744a9998b545a13516abb9213ab0d89a2f5f872d927ad48dfa502de95524f94f34b174933f3faa7b554a1c2c3a688a0ed +S = 1d49594454516c1876f23f2ba0b1fa4dd8bee028bed5524b7635a2df5b8459f4832b3db5f6074cf07c169cbfd9099a85ec2f5c42043c5b851c81a71c87affba34b11eda67e0ab69 + +Msg = 53ef87d6ac7b9698f40b3ea9f3442e7b64207b140b7f66f73fb7d5f8f98452d30a4e493b6c0e3268371e88e612b818d4d847f032ed4983817d020411a52d81fd2a17b58ebdec199d817c2a8ba77042bbd747a6fd4bcc7e844ea829fd8461b389aa0b5957d92962b6d4e86385a8fbca90b8fac40944607117e9a4ef6dccb8fc1e +d = 033feeaaaa28f16bfaf5ea9c7319cf4561ba4fc55327a8477b6cd58ef6ccad3962ee1f3edb243f3a04e7e49c8e23509fa2d63252adb186b8bc7e9255cd61fa9bc45242d42da3a68 +Qx = 6fc62c39bdd41ef7083ae10dad59e38dad217c55864a55a6a80bffe2f5e7da977d79db9ed8c9ac22d6f096129a0c680ac93fd77da4ad96e292a19b48454f91c93a3132559fecf07 +Qy = 66f1f737ad3af3df674637aa5efbb844bbc441966bae73973481628e5c2c67cb74553a7c8f2c5fc478edd8265bd6c99d6ce122a245e46fbfc21992b950f04cbda5eb220261316c5 +k = 0a5b86b76f98310a25111cc3d1b0b70fd0c20208cd0bfd8007cb569a187c3a97edd8e716aac938900c3ad8ed3a0d091a18555ab532b50f25184454d84af2beafadf754862b8ec74 +R = 0de2eade32f537727eeb82dce610b48106b277d15d8fbdb77cd312ab9983ab21bed05f05186a5cb2b530ba72c8c68b768c26d942f9224c6e6b9e7827c48e129833cb679c70aeb29 +S = 15e4fb92190bbf8dcf7548057d1bd5e5ec54a6edf54f6b88f50e96ac87ed7a7b7c0fe1e1174ba3e822fb7e7c083948296cdcdcfbdc4bde036a07f84d210001ded91c554ace71efe + +Msg = dca1b7a9a313ead11c2d54739d9017ae27f9d08b3544e418aee862bb57e427636cb6aedda28e10f12aa15d2355f4f8ef112a86fec5dc46e6acef693cb8fc37c3e4885f3be3d3ab31ea4d73a0de904e95c7135a149f77b621d642f9bd8ba192d39cfc58b6f19a797c4f3b4f3a87054298e3ce5eda0ff7f44f8134c9a108285dfa +d = 05613dfb53149bf5fdc4e08ccc1c752b0b66ab43aef2d008ed40f3df40fcbb2938d2c41e3ea2dd4428aeba9059a97efe5593119673866a19d27a2ee37dd357e22b6bc849e7e22cc +Qx = 7ef12ccf6b64c7ca64b5da45937281ec770ede572b9a8eb685f3614bc358ce550195e74666af9bb54379c1fe1304b76430d1e51a9976bba02e5781154c9bc187a31201ad99cb48e +Qy = 43d4ca20f06b26d75be1454e96f0568bd740165a2bc6e5b8429d557a79666bb7b9cfa597d392cc5b8ecd180c37f9fe2088d7908e59ff644ab05568d974ab42ec9e01676e1b24169 +k = 10b4b67007af35942216e9aab1d6561bf7684f334a80c7d909a6154cfde8ef06a148af104d534d7dda59b5cec7949de4086ae669edcc4d68b88347d2445edd3037525c97564ce78 +R = 15bfb47a27c6970fbb3256410d5c2f6c04eb308569a966790636899fdb3122f9e3015455c4b50a6bd8cf519afc22ea845794f51e6994214feacf48322af48590d02cc9812960917 +S = 090c61f6c64381845491dac81d5273d58c59d9cfeed214527a52c8f23b0146431692a25cbfd77abba22d4bc61ef24093c593c827ef645853bc8deef7c3b07bae919152b90c17f4d + +Msg = aff61d62c8f5c31bbb7d0a64a6ac589e918bbf2f13e7ad13abb9ac26405e267249a7c9922139bc28140833e10976b87e91cf28285274b2b48b63d24ac94c85c70fafa78f8ad05955c0ce6c02b841ee196dab12306e3e3d6138371217e2b474f7e67a80bbb78a47e374ffe2c9f86292e471c551da50d46e7b5c8331029f369767 +d = 11b92c8b72b86c51903387a65aa206988d443d1988253329ad3a89c902ff1ef8cf73b7f2e4aaa352443bcb833712d94c3e637ec12cbe4c2d4606878576b17fae1512fc77785b737 +Qx = 22440b63bb4557996b63faf19d9f391c5085cdc2cda3755622a6cedc676222ceb5a56ec36e220e507973c0f07e4b2e2d565a69967804ad311f0658a9854b1eddfb5270f4a86b769 +Qy = 50199c9e443555123f153249cf7256dc3e82c5d8cb611adca0cd4fbb0a9a90296bfa770c1b0c0b43e4363b0227273a9ec9f00ecf83afc605b0dd2e5e24f739dd0b4ef6bb11950a0 +k = 0e5ebd85f5fd9a9a81067fdf51b1906023e68672d160ddcedeb35787688dcdc314359ff5347907b685a718ce38a69be17de292eaef189fb9ee8c63271bd6818904cd246503dd227 +R = 051387b0d057985dce86cb962bbca7d9a047f70d96c20539ae7d6b7cb8bffff606f03b8315f15a53049c6c1c227f86d395c2217d32aec32bbd406c790a6cd2706775ed8a0ba1ebe +S = 0c7f3b7e4a8b65a58c1280110f6c2486cd2d2df7d48b49074e98accdfca4a72fa7d43bc25c6576279f4a70f22c98135ba79158bcc3452940963b556304da8e1ae88973d827bee32 + +Msg = 721017294f17ef351e41256b57a64a79f3636628c4bcbe676ac9a2d96076b913dc4b246c9945183ec9bd2d251441b5101eac44e2fa1bef59dec03ccd7fa5accf3b7d094d68dcf78c8de4e2f19f56bf0dcb3b66b9421ec3f8b353b9fd74feb2e9affe0bf9aa421b6f03eeba3ffd58fba56b3ebd094880e50de01ee62a108a24cf +d = 0c3c90d5ce4375a08b85575faa78ee6bbd9e5571ce5a90582042617b807339c282cdc3b003d82006264b1c08c20af4ad4549fbde53d262facb98d923d81b8eb6093374b6a1e84cb +Qx = 1d900b4f64c07cb959049f2bfa18012f9bc2dccec5a73e9a48a9d5d65499e31ec4a1615c4c50177c032d388263eba1a90e07ea68f081e10272e88a41389bd2626961b646c76ed8e +Qy = 5c094fedfb5b118accd64d5d46ca2ed92b3123a62042a556ffee9e3bf709092fff88231a26917d368db51d1959ad3285c7faac16ca57677651b070aa0abad96f07d35c5fb8a0ee0 +k = 14d4070307cd269cc1a3c048ec0847edbff46f64c1ba5b734d8a800e50a0a02af57cf24750d292e2c247ef1b860a9d7b5069a32f5b0546fe9e019e04af62316eb79507281fbef6d +R = 1cda7f743c47ae93a9fa533145feab4c46252afabe3d54990663b5891b4979c645ccaa05c744420ed6fa235952f370f5aa187250d7b069aea1123f19f0f18da18fde98100ff6ff0 +S = 180b4163f2eba6e3769d8345dd8cb003ea120164442efa885eda5bacd75f8d705b7f1bae2976f67cdfe984430e36f93455ee7528fa6febfe92e42a002da165c63dba8fc589e7851 + +Msg = e2d1f33681759adb7954bb5248b0db3c3885fea0d4c1c0c226eb1e6d2d3ef1b9ac281a0f1c2fe5175b67114b6a501e2426d1454bd5790dcbc4c232cf06b017de8a9bb39e6033f1edb5003e8de3b44cc3d6150c3c952afb442952483cc688908337b7c1a8b5c9da70937ccfa98b2b0098c530ff848010b8e8ee0a8d65283481a8 +d = 10f184c16228d9034271332178ed485d10b6aa76003efc160d63fea26fbbdf5552205ac7df0d8c852a1210cf0ba512f20b798827b36ad56b12a826fa7dc1db45aed264ca6822659 +Qx = 2637543ed8a11271bbbabb2cf72999f65df0104758c2fd6fbf3e1c5132ff1c1111fa5504ee86bed8f219d5025f8ae07055a7849314d2d439408ea2b2ddc40320c57f5d41255d0a6 +Qy = 14e360137ae33ce6930b844d42bcda4050b25f349e9e19fc4fe82f5e4f73cf9bb50212ea875a5735faaa1d5494f1685d6c8177448dbf356b408ffc2ba0726c9befb9de9f0cebe32 +k = 1146574a96394c82972eed1ab7ec98bd08f27653c565f0626fecb431ee4fc6f830554df35fa62b5f82eaad49524d3d4b0598cc7a2181ce9860e271812373d21be9536fc181c3f12 +R = 0dbf465de2c5242fb527f6e4a4188adb96a2030ed8417cd9431365173f569bfdd3e420f86947da10a703370d7f38dc43e2249a2476690829545992645c9c83d82af8adae893780d +S = 1499782e0163f80de68e3a580ed08fdec8d6552ec69f186a74be89480be28a0df6acdf7c65a72f115f8a59fbc28bb94af64cb3bb3cab20bd25265237a010370d9a5c781c1e26f3c + +Msg = 414fc5d2bd56b30040e105cb891788792da595583b11b8fcc7320f40dbf64d9263532dc57344dd17573c95eedf851668b5d552e8796af205f3a0043af1a829fabc2e93d9af9091fdd9e0fcbcc9d6d9ec960aa60e4e2964c29a2f375400366480e513f63d124db7745847310e69a38c8455e4e602056a6a4a14a8694155e0a9bf +d = 181baf9d497159f837cba58a11ca435c442e5ca792ea559bff9f6a1f562c05bf6bb5914afbd1bcaea75b35f88bdd832314b249a5298622c89462344d3f28a44ba3d059df432fc71 +Qx = 6f3915f884e250034db97327470197d13f0716d1d810e43055757460dc252f5281717b3ef3fdd51085e65a0e073e78b697a21bc33137213981fc05d9b34caf7dca7a4f99be78596 +Qy = 47a96ab5ebec6201b7c65ce7a6e70effeaeea1c095a0172e9e2c7bfc88f7b05ea575076caeab189f810258373cff2484f4fb9c8167989f61aa61ae27113b5140c95f7faa505d2d0 +k = 10e9e6047651362accc816389b26ea6befb0e34fe7363126f8c4ff9333266f46d63c4d45075480da9ebdd0f8da7224b470d914ea1d68cd821f563b574bdeffdd0b3ed73ecb9133a +R = 00e36644cf0861f45b333092d44fdd99f56e89bf3607f75a06920dfab0ccb1831208296aa2431bdb75c5d50f15bbea2e13d185db6d7175c221858fd2b22afbeca7431c290b15d3f +S = 023ee3b9ce817eb0a6733c85062cc3bc5f1ae62bdf3a74e3ec704baab05784dbb5ed01a6a2a73c80a3e754c013ba886108d9eed2bc210f29a4774bfe5508ecd876ab47a8527c530 + +Msg = 3b592cc8972a4782870e079b82a50f84b4c2d8ca90bd500d1ce5678982e266c391c556d8162ac3aab967154d072dbc0ba1dab5545cf2651753dee2881eca5abd412fe624bf3f9d17d33692d21ce23ad15ccffdfd250cb1949e73c9e40a64ebebb03852e92692dad1d7baef97fe109f35b7a492b343d4b643a4a7b1723eaecb64 +d = 083fae86ab96bce99a53e50b7eecff38e4e25b21c4b0f6a4986915de245eae24f16b6a00a4db159ebc27f5a6a072da94ab6be5bf75f5eb3f75c4452bf4ea7014392eb1e02706fb4 +Qx = 78003779e0287bee54df31f64c58951df7999b48b647a6bac416f844485a4cd7a53a64170f9d2d31fdef0194a0c262b90e5bd33a1782d2ad56c210cf80abb5fb118cffd71ad79c1 +Qy = 73f89ebdf0e255205a7525cc12b7e1c58303ac3b3417183179c216ab8e47f33d0af3238e3ae64d418ee89ef3a2cb4bc67a1d2fb1923947b9dbf3f4fa39ff82327d0ce3db24d2324 +k = 13d126fc4033f537b00a81372031026f6a7a2062863a68e36c6909c548833d1a8f5fb5fe25c7d9f2c65b1dfa974630204f71e96d657095b93cb54b00cb88f32adc08eeff4036654 +R = 09be9f4bcd7b8ef111337fb665379509b8b17a2212a80d5fecc685f1f362c45f930acaef9df47c33c6028cf7aae424264575b4635a11edd6b005ad26cf2021051501fdd1b77d2dd +S = 0dd196343ef76bec527c5929e02fbd5d02d5b0a4b5f2c8561978e600856de56d42943f1d74cb81b67010bae98de0efddfcddea5d354c60c1fa76138801f6cdc5bc932c136309b6c + +Msg = 0079a02cbab3dc02601fcb5c8607d555beef7cd71a66911ab6514a4ae21c5a9c0e166f8cf5fb198ec5a49a96e17cf041f35f00406b79270ebfe56dc6b8417d2529fd625686ffbc8f69685aefa2fd30a937c02f25b48be4679e6fde821de928b33b12470867def874bb8c7c8038ab6594346a2c44b39210d3610994ba60a05e06 +d = 1a663efa7bf4d8479bc535fad71e9b5e4f4281aec55967baa008ba17ac2f89cc3398d30573edef29d590fddce8cb157f655e92779f59e7a18d0327d02e7daf4c1216143b3688fed +Qx = 6b4bb31856dc516be60a0d2d9f42508738edd4f925eca9c72a13cf136720867babb38622fe97df70a1edb35735365f34c74baef9aca539aa1dfdead3324f41a16ca69bdf86b43f7 +Qy = 6c4a91d3fac9e7647a6aec6e4369158bdcca2275866bcdc5a09b2f0f1eba10551da9613eeb1e8d3233316b62a5f4641d6aaf669b975dfc511f2437d43c9eebe53c5115fb4741b80 +k = 0a843d0cf776878fa9ceb163d7aaebd29ba3aea0808c3459036b258b99ccae4e2444bc3211b5898c0769b7d7e036c07803497e13803132b3c6301412af3be8eb4a853e939a247a7 +R = 00356e282c096fe1690fdac4c0c66eda155ec42356dfc4783cff0160e1d76b33a99442d4ee0e3f6e1c5bde4a16c8e18bd18f98a178c3fa4a560d8fb8b4b1d72663576f8baf8672f +S = 0c5018c1383fc3847819726e1e940028892e1abd164b413293fe50f219f2059105218e4e3b952b912a3258c4ae52dcc03ac5f027fdfa448a8d58e3aa5c21e790b3b47bdfbf21175 + +Msg = 88573bd94ef50459814806efa868ebf92b066fbc2f7a4be9d2fa06b9dc1a72f72d783a6bcbc107b18a6314511bff217037a2252e7a5cd34cf9d5b2fe9c7846931f0133b2e95876cb800dc4ed7c4a4e4cc4f1195acf99fb0ec224b1f8fa8af71f72d390eca9d6be3879032a318734a63fec336c79035a43f70271def10c4955d3 +d = 0088d1a2c0219696a94337cd56516252b74139ea0733b17fdcbf7692c3e5f6c3989e5da2aaed7468e65a5d578571928ca273ec3b6aa72cd196f560f05095cdc8346e5d31c4c2e0c +Qx = 357801cec0888461ffde22d83afa9ca008ac88518f4b09074d29a846f5900e024a8e5947bc25ed0e5c980a58fd5e9aadfbfab31db8bec575fe886deda80134d91b3de9625465302 +Qy = 710806c7ed33f6879374c59ea144326f5948980c8013144345c5070122c0ddb7e18e9f752eadf2a9b0854dfb7d9b2f0d80ff0ba46197ce6017885939e9f59b642a8fa41639ea75e +k = 16940f69013026bafb6f400c037272176b04e35e9f1563d382dc9982968a186e3e1525775d27150b34b8ce5e70b537f0149ce1a521d056b52e75da7e39ee8a529ed987c70b8234d +R = 199058e36449ee1a3388d7357c9c1020b2e4c02144aea14b041bc584a752c94fb6e474959b24bd2c0c104f5ecfe223ebdede672298c29195033aaad5db1852ce4dc3185ba2409a6 +S = 11f3defd9b442378c461e2c68b239d2e4afaed691238c5ac4e0be46ebd461639a60176f9884133900f988e2d730d34df5e2bd8a14681014c0a213f8d233b3c50ae3064fc38d1a19 + +Msg = d0e02045ece6e338cc8ab41d4a064c982ccb1748c48fc2fe0a6f10bdc876094358a6a90a45facec798a83cc95c6795cf0f0d7c66b77e22cb114c1432bfdaa1485ff35b6a58107cac3b7e58cb4f6c87c68db60b751e78f1fdfa54b8923b98caad0a4f31226956d065c083ace5f1e9e91944dcca51879d782e40358d58ca758750 +d = 16cc8a0fd59455ed8d4de561fd518df2e008f7dfaa5f7f29ac2489a411e233917b43eb3ebe2596fc824be58871949545e667dbcf240dfb5e0c615ade0179d9ea2a1b1ebb8ab9384 +Qx = 2477e678793593e2abe837961895c7ecef71af1feb882ff27cfbabfa0ba3ed771b79223e7b2d2388efd371d5c325854cd60e48484f818e1a8146fbb780cd6ce06ba63c0db67df8a +Qy = 01b696114838bb972ec6d536abd809d3a436650191c43b2bfeefab2b400d5921a7eb78e307266acc190e05f3869017f0a66f886bd6556c58aafb1042478cc768a4f86758e9f4c32 +k = 1e1b851bb95d2913d6d35b756d49fba6f4c127dbed80fe4068260cab89c1d42f7a6843f731e83b379ccd8a4915d2e29550f3f6ccde607cd0b066dd5fa41ac2bf37bdcfc26cd4d04 +R = 10d4291346685fe070b267edad91154df83664dc115f058ea036c712929634d53662586bb50cb6473c2170db5d4ee43be0c50532015937202e193d15d5189870691ba65aead7f3e +S = 0b2a15f1ef00204bcfb5108d8f1da96ac3297aa041074b68989ff5b6b276380de7887753fe3d416ba691ba0b2ad7fc065ace02815b2323fe17f6445b0fa66dba5d99d8e7d557cd5 + + + +[B-233,SHA-224] + +Msg = f1b67fde01e60e4bb7904d906e9436a330c5cb5721fd4e0a3c75b83dade868736bb1d21cfb1b5c6407c373e386ee68ec2239b700e763728eb675a153b8ac44cf2a87be85fe8ed6683430cf4b7d718891cbf8d583d0a37cc952cc25fe803a7aa4fda80f05541a2f1f2601cdd0c095f7110f2a84f7d641b8531572269b21cbe77b +d = 056673197bfeea9bd7a8b820b4ae51a50411bf118a692bb9ed3d304da53 +Qx = 03489be62e53910c20cb508de019c3e326f65051f26749944b4454f156a +Qy = 0f775ac38baf19499675725e8190aeea16f52346b1c890d9583b38c7521 +k = 0a6c9914a55ef763913273b062475fd0188eb2d5af9c8c1dd97cb3cefc3 +R = 08601a42d7f7eb047e8ed9820ddce665c7277f8ef38c880b57109b7160d +S = 026d6f50f0508953657df5d753c595ffb8e1c19f8d092f8ce8db54f76d0 + +Msg = 1d496d96b533c632ed6a91f6e3653cdffaa5b8cc0008b35e49b2dd52fe261105c2ec7ee71a4ad5d51fdc3d36d688a3b7ccb3b3b0c3a65be17b8d8aa172e3005cfbf37a2d1b1a6e268c090c6f318e7e96f9ec9b9f5a8fbcc7558d89e840f7e76e44bed91c26ca48e6f5cbc253ca2fe8cb81c484cabd24070e488f9c00cd96ad4f +d = 0468f01d483144e514ec257f2e5fdee28a927f2adb19714c1f3524dd0d3 +Qx = 16b3cad89cc42b80bb730431963526e26ae3b415b421575dfb6ed973e17 +Qy = 1acaf7de06e20262efae01fc80969cdc1a281f68e8c8bc0d2d4fbba3a3d +k = 04d261304678301985f5bb3f6ae465f11c9fe0e5031b31f194969252703 +R = 0878a87b2867c03f55726ea2a6db822788f4aa4e9ef609997940ee8c8b6 +S = 03545153f0554a8f55301d4b948043de3057cace62c8032c8ef8a11dbf8 + +Msg = 723400655027f474446843645757f7e2cd466bf97275067b4bc4c9d79bb3b19b2421835d69db916f24b77c381fa771fc1e7a19d2b4d09411ae55acccc615b16fd24705762b441ab67083a921fd4ae569ce0de69449aa96f5b977ac7dc022fdc8335656853796f54b3fbd118577f98920624eb0a00204f1ef83827245c06646cc +d = 074052d027f05465a8083a59cdbf32600224e1f563f653b34314651517f +Qx = 06999290db440eb5b3291bd4bb4a1af6386654fc4d275ef136c0e03dbca +Qy = 1fed0b1f9284e488c7fa2a010766c340bc25dc132c7679c2598e423c3c6 +k = 06e38460379ac3fb13f64d4de654d4fa30bd8178da0bfc29fab2a1e2e39 +R = 01b18bafe55e5c24fa2df4c09112b44d24e78dd09557349ceb1b916d280 +S = 0ad7cfa003267a6b7a99894f75720cedc9cbf820d355a6b840709f42f62 + +Msg = 155860cb31a142082bcc0bad828d747e916392d21f1873b3a3c1d28ca3ff9d45ddb66a712e3856b6afd07c8d2b2a7badab296a9775b03f6fec0befa2d8d6d00fe3938df244ab46e836a3e686c8b4f918da49f0bb3940bba34a9aa22c7caf02df7758b0de01d9f47af6146344b9be3842d9c055eaf0fb399cd8db95c544a62d8a +d = 01856e7544223f55f80de72a6ef3822fa8fbd68eb397d06e2d76ddd35e0 +Qx = 1a117e52f09080625f85fbaad8ebe0d3ad410f034242bf48365e88ff735 +Qy = 008b8bb7958d191265901a3f15b2919142505efeea13df6e42da8b0dc1d +k = 0aa106ad1461353865706bee9aa092b00fcf1b0108ecc1266ad5d8b6579 +R = 0bd6fcf49029df32fe0fa47f39cb9428d95d00a84a5afb392d7b4b365e0 +S = 0b17734befefebf03d1c79e59c12ed3c57e7d120dfd993bf276de559588 + +Msg = cbd6e305cc9f0dc90caee6e65a74582e9357bd25c78e33a7b14e1ac7e9397ff4466f192fb432143e6df6d61a0ab808ec0a361a6d95a357a38cd3e241fe03ed883ccc364b248ee2a08702110745c2688bdcefa33c1a45b9c8b200e45cddf3e3f66b8d37eff07fbb3366ea1558ef304085613c56707095724b3e134c7a7d3f8dbf +d = 0860aa2b589f2defc617be73e191502e5d9952bf60547fef19eeccbca26 +Qx = 06abc5619422b7d548c612e54df0385c293632d4d97c21e2e15ad98d0c5 +Qy = 06c36c072603681c1b03f6a023c8e987f39d931bc2a200eff82239ee38f +k = 084fb252dae9a96a44212d18e15cc52d179cd5e3392ab9da57d04cd5a9d +R = 037cd554e7815699f033ca9187ddb116777ef847b92353f613152c4216b +S = 05f806dd062043420dd056998bdb9822b3177406a536d766c4aacdeee81 + +Msg = 812a218ff1ee1472c189f63386e5b8ab341671c3a4dad27a8c6249d1c0f9a29338b471b6179f17a078b6504e804ac55ca3b13e68a623041bc1a092ea2adf3fa1124bbfeb161e6d7c483433f1548763b84da00352a6386e1339f674d45dab13898147ede468e0e01d2c4e0ed66b395a16cc3ded3e952ac739205f35a83376cbce +d = 0d0dec052a00ccebd0c0c5d9a08272f75744a2582cec7ddd924a2b022b2 +Qx = 16bb8c3d319b93731f1055756e57bd56d50b6b9ffbe42735925cf6f7675 +Qy = 09dad7b87a749df130b45d9cac8011101c15abb7e64bd4fbdd94107fa31 +k = 04098547601430c723ebcb04b23e0f1ce8b1f79ff7ed3d05ba130922b01 +R = 070ea6221c0d62930b019faaa856ad2c84c3989ec54040bffc42d8dadb8 +S = 0aa20fc58beae8ccc880e7fcb48a471faa5baeb36bbe5aee71ed9f8adb9 + +Msg = 0204b1fca831919e89e108cf140b3770f531a696b1d9a4d1fb68809eb10afccc257cc90cd36717c02b2f3d6d3d1d8a93cc5c48aa7ab9f9fddfe121ce9143376535a0c65e247c6558eac49fd1d6d1bf431ba918c471cb3d536ad485ec51f6471a340ac75f160c4c54cd3ffb9dcc123124b42df1fd2eaa005e3377c5d2d55938c6 +d = 08a017d717d6d1213f2b74c53281b07258738c0c7db649ea1ac46b9a3b6 +Qx = 1eb379e27de6c04c5320cbc18e79ed9e8993710ac70ce823f1ab5762b67 +Qy = 0f552192645d350361762aae79ffba39c33c2c5c0df208219f1b339016a +k = 00e4822b2cffa327a8396301b21554da6fa52f418d67114bd58e850d935 +R = 0d64dbdadb4ada2d3a8892049f7fda3c733030522b44cd72ab850b77bd0 +S = 06fbae2d8e4fc04abd8a6e9cb011974ac851ec108e38f9c72603f7a04fc + +Msg = 2033eb48756638cb56e2cc39a3e775cfa11fce86cf71f04487dcdbc7f262bc8350a30ced54d1fcb697b28a6e96f88f782947c997872307ed963e1d68985f756435af77f57755cacbb4c6b50ed419deec9f39f0a549a13e54254fa0a5832dba2d943ad4aed8688889a2dd29dcb4ea12abd6a6c50eabcb3981c3a0c1ca5f0b9629 +d = 01b56c14442b084cfd22aeef0f8028ec57c8b571c9fc1e43de05c45e47f +Qx = 0d450c533b13b211b8c91dad0738402a5c811460426ee2f35ae068f2c12 +Qy = 15e1c9f9d398925c619f8aa0bac746eb7907d3d510814cea185a7efe771 +k = 0dca09773730a2758b7f4d9257a8e6bd942c141e46bde5ca54a79468c4f +R = 0379773ebb7a2860f3422d8f8f714b234e5abd8860defb19c659c9c6179 +S = 0cb9272a27661604425ab84632f586048483b9f9cb80b9697898e745117 + +Msg = 2986ab1cfe8873009e932dc68d4727d77ccbbf378e43fe4aa7c54416346b036b89c0aad1b82977c9fbc39a00f1dc916c0561d8dd70298c02b6cbfe572e0ef2058641e841c6875e8515f3c1082765e046c90c956d984b76e0e8e6eb433ce26c1757ac5b13422479141971c20102e9621d18f51096ae3173c2753facee2862d66e +d = 05afce37c5594586ac46a34ae291f591eacb9880a7de92701977f447fbf +Qx = 02a069ef14f2989d2b715c5006642ba966cc84df88bbc27e713e15c47bd +Qy = 0f001f60b8a8102a971faa2c42d3ea9cec37b49c7e6ec0cae9f7fb35713 +k = 09756db630ed9b708bf1ab8aae6a7559bc235c4e9f4002ed26e2f019aa1 +R = 06b9b2c1d214373647d9a2d24ba69741218064004614368915d5cfaacaf +S = 090dd607329c27483fe43b7be137c3f51c23217c939baae40b53e65af2f + +Msg = aabf5aa90ceef91c2155f90660adbcb0eedb996f5242cee15468ae217058ebeaad8cd4ff8cdc754a8ab85ba43c59fbab6386686fad5e27ad3848fe52191c7e4b203720841501792a625aef2acb6e36493b792fa55f253effca682946ad8c77e01f44e92ec3c258d0dd98d3183f4dc4a0bd3eca183794abd6232a6f9e4add8f57 +d = 00696df05dc7a54a9908a73eb18416a155cc8df4ab26032539d86eae537 +Qx = 08f9f494ddf8d0030746a8c0b8d215dda6cc2724f411a7ea407629294c3 +Qy = 1ea2e9f85f06412d29c677aecf624a83c2fbd86482dc0d564906a91d97d +k = 0d62b06628d3884f0a329a7b6b4f832fabea4ebc85ee03e63f2967e7810 +R = 02e39824f272d4b74810594810957963c777207217e53a672010605b9de +S = 0e64bc44af64b6f879f0d32f814acfbb98795ef7b2f246b3f91cacb55cc + +Msg = 29ff209eabbde02b10b3fd559671fa53e418750c32c4a18d31cc0186d1077581bbefb8770ed079f536e866414a07431ae6633955bf42a2389b6f8a565d6e4ffb4444336e0030093876a26d4e3106e9ac697788e41f8a21c755eeb86a7c60f18e5e1069f16408a4c375a6a68d42959f2fab7ac09736c7b37c80c05897d8566ce8 +d = 05ca31e88c5b2e96e433af2023a66095161710628e7bfa428944d6676b8 +Qx = 08232d4bbe25536ea7f83c145a8d2b1cd72c383eefc2adaa1ce72c7dd9a +Qy = 100b738c6f1551b3240293ee8e8ec29fad0cc485ffc2cfded96b68162bb +k = 0df9e1b418ca1d41d749ee998446ba1cc54bc8bf72eac6f30929b40b5c9 +R = 0d4248e0bb60fe46abf7bdb2effe804b9d394d8a5514a5791e149d435d3 +S = 0b89a459fb99cccebda754c4b2ae264c9aef7b5b610427f42c35dbe7d3a + +Msg = 97765d876c80819f4004a36d09ccba78e600efc71eb7e869d3a00f658d2ace6769c7ab1ef590f41fb070aa8e08615e138df45ffbb6473d4a86ba5fdf17dd6dc9ea9ee19c0332563c99e6a3451c211d286d69102b47bfa6e07d468d9bde82e5c2063fb1ebbbed6086f542cf68ba46d4f214634afb1146dd5a6f3d50912ef5b824 +d = 0ef8fe84727a2ad8bf4e646ef28a492adfaf785a3a2ba6e6f985c649a8c +Qx = 03435eb25ce9891a78c120098992c666940103eefd80d9bd64f1d4ba37b +Qy = 0ddd6a4a01e443c92afbc247f634b85f1c858a2aaad35a26f57ad4c9126 +k = 09753a236759eb32e13f19b9d2ad06f7b4db4ac7b1df96813463d0cd557 +R = 08408fc46149dcce0753d7cae0f50c8c5fcc97acf7a1a02a9f68c0b80c7 +S = 0b5ffba104acc6d0cba87523382ff928859718122c4d0d2298e74985d89 + +Msg = 21cf768d087d1e4eaa8a05e2008020e243116206d675c09be42ef2bc93617ecbb0575c873c6510ede9979215531b62126552738862fc4323d487992754e39d8f0d7e111e165ff254200e05082f59a57ef649bccaef6f980094fad3b7ef93bceb161760e200f0a2e396fbb6b6142dc84d872311bf932b84616b22231747937d58 +d = 03edb94b8c62f9af30c14a790c0f5d65e362a21cd8569b9725916d534c0 +Qx = 065133691b888cd2513964b5a905ed9334cff6367e25c09db1743045d58 +Qy = 1408e1ac721bfe2198086c1834d484b6e5692c037e09928cff87f4b5a88 +k = 01d8f800ba05d8173b0f1bb3aac0aff68c6b24cf98c28f5a69b0b5a52cf +R = 097c07d4352e39e1878c42fe97ebd4c3ba5098706879fad9be4bb2dc2f7 +S = 0bc669db3a488e613665cd26da7927c6b6a073ba6b0951c00d22ab1ffd1 + +Msg = 7b8e58eecdab3e40212bba6bf284f9379265b3d2baec3e4625aa08d0ced851da193c292ec793dab42732c07b4e94d8b19c83aed796a7e3a6c2b954a7a9a1ff9b2bd4ca62592c8b68f709f1ad38a5c8033ebb3f33d176945bfc68e9ef2b0cee2d45a13ce89d238a33c09ce2c0c63c4233aba5717b85c4c161dd7648a41a5e39d8 +d = 00a7519be62562318da1b67d22cf8e720353d22641e0cee11c7a352bb93 +Qx = 13b63dd8ca9044a3e518a67999a781a5b62994b6e20454003a9bdb8715c +Qy = 1a2f9bfaf528b7f5bc8c3b02eccb71666c83e4a598b4077de999d90fe27 +k = 0992ba1a8331bc4d88be7dee06f96098bc2ea56668f345e187f32f38171 +R = 0c55b45bc7bc3092ffa82234b06ad45525b45f8904011f1bd6cd356f0cc +S = 0e6163e70ab56d43fa27211b98b48f1cade127237bec1c6556020d39990 + +Msg = f8f268d2b04fe47e5052c8d0d653787384b9654f0bd2138a6f52b80713feeed452b976a90eea4edcfbb62d04f3eafe172ddebd7cdc3701ecd6008e3d82e8eb217b13b5228839f61075159f3bd1e1409c08903874b6dfee2789dd72c208ae769ec8c7d52552a2b1fd73dad24de8b571f88e2184d0ee7d063a121187f97e746f2f +d = 0264022fd7dc2328a6436b522793ad9406d7a586667a0daaf1bce927338 +Qx = 12d7e7f8519a7e357510adfca2f50182dc5fa12fb2a77409fb781ed500d +Qy = 0ceaa9a22b7ef9febd8a9962ce21d83fd2a2a938b9d7a78d669dd233974 +k = 026fb8fa6e746106500dd29ee32bbd03b94302ec3a123356b23b3055e51 +R = 0f416418f7aa4d437e7606afedf961b968a67d9a1524d60fe3f6df4d3d0 +S = 08d3afc975a8147fa8230fef4b16e3024180a9768702038f955357ce8df + +[B-233,SHA-256] + +Msg = d288768cbd066fad4bb2500b5683fa9e4eaedfb3dbb519b083f6b802efda0a022355565c5fc6babeccb22f3adbbda450ce5d633193d1431e40c0fe631a295cf85965cd3f5937b31866bd6a5300eaef9941daf54d49832acfceed90e572ef34ccc94eacd0fd6b903fee3c572b963d21e2881656a214d2a4c125778dbe3bbeebca +d = 0da43214e2efb7892cc1ccde6723946d2a8248a6b4d6c8872fad525ec3b +Qx = 0db09738bf0a0dd777f67e82be50dc8c2d8e91598bc0b8d4486f67c04a5 +Qy = 08ef463e2f37ac7c3d276676cbedf17ae11e767ec577da7ccd90cde3b74 +k = 0249cbd55e307a0fd10a0c70b1c0d5e2416f4d7f144779ddc11911f4a08 +R = 04d1c99f9d486fb92b132d68c0173df891ca757572f7acc03cb41d46bbf +S = 07de2deeb58d55d65fb37f600d916cfa49f889f02ef53dcce412703d1c9 + +Msg = bf0ab46e0a756c11229b0ea961f8d57218be5b00ab8b0e91d7664cdf5e0341c412c0e992d26ab12115197db39df2d1a6e18ed26a91be461432a2dfc21d98cb16003e339b0b0b1f100e4e6f4824ddac5442f22a1fac26326ed8a89cc91343d7223986d485cc8c64424e84d56be536c57e4dc5faee459b1958efd79e07e90a9811 +d = 0aeafa49d776b61f6a30d66ff64bd40dd8d79891dd5293c1b5cd3b46a7c +Qx = 1ba1b87b16122e6939da5dcadb8902177a9f9ef09194c8695008b80b588 +Qy = 08f51ee5cea1f4fc9c44c70df57326ff121268bf4e02cd9b2626fe7c1ed +k = 09d640ede5bb60b9aa78e393ed453b1643f6dade4aa20e994db53e81fac +R = 0277bbfb7479077d5fb6813670fbc7f46055718199550130b122a7cb8b3 +S = 0f8dd350bc0bd2d84cdd374c56ff2341de4102269a1e80df7e35969d4cf + +Msg = c7b1eeb7c19eb16e7f42b61d79e421b71de797a6cab4e0baee522fee7acdb533f7bbf5855316544e1b82b4f2a18ad0a2311e7622549332122171f32fc62a90e408207e0fb90d1b052821dede9c41b15b6e07d84d5d7b9e31e6396a8ed229fb6232b3051298dc5321aa589f4e289d27169f14c8cc93644916d9b72dbc92c43488 +d = 0e95db309f4305b621f51f93588a2678cb19aad0932f365fa0aaa3a3895 +Qx = 1177eefc44b6070e2c41537e75c91e2f08908c0d950bc90cd2f4720b335 +Qy = 0f751312dde55b1bcabf31665deb6c12d043d5ccc89800622a557a7ed37 +k = 00015798ef57a771d62d194389817c93de1b225398fcc0d2b81d94054a0 +R = 0eef7161a167f69a6c89b0f173db2c4a7033b5d801c0d89642ce65e377b +S = 04043f8985bbe0221fd595f9355c33e1930b5e10a1452e81c31259e1e3d + +Msg = a738eb074e1f277dc665118ca055e6328059ab26da188c16f56384c566e43df8cff3d2a10d2d15c3c1406de8f734b20be5dd1ce937a4289f0ddfd7bddabd03586556eb8233b8feefedaa1f49bdec6d45fd562c2a83fa9fcfc2013bdd77900857199e51fa9c7cbeab925ba8f6c3c5fae46bf8e9c574b302f1e5f9c44400152a78 +d = 0d4319cc8e409b8755880827f3200d3f0f1c64d6356fe74eb1f5aa42499 +Qx = 0bf65953f2d08477f7fd0428c31125184e3bad4d5da00c91991949e0562 +Qy = 0f1669d0d116817d625128ae764b3fde956432552d24d98f08a12925afc +k = 05e8704febc38bb8ea76f3c6433c1f0421dc5e5af959723a5a2f0e9a970 +R = 0307c0b838c65d1a47792cb367253bf7c9f627435f1c7ed74494b318446 +S = 00031a9b35e935be6620243f4878a38d4e617fb25f7a4883893366f39cd + +Msg = b28103d77e5457c42e026e713ea6ff03722a36512da17197140117442a976f9e2139c54a759fc26af5811b455e5a0d3a95362d9939c1e738045be9237b469ae2106ceed7e7842b44cc0a475d5af6d781e32ff1dd1f4e1833dbc7f82b27dc7e1562d0e29213fd8911105104a7a16f665b926aa137f70d868c90e72f8ee2c95b64 +d = 09e556c945052e5954915c773b2d47970c521fcc99139269c3ef46093b7 +Qx = 0db68c16ffe64bede4a849812df0b8e202f74500cb7d5349aacf7f3f026 +Qy = 084b5892ea74835e96e9dfb1bb201a4dcaf32da25dc00dca019d806f5c9 +k = 0d0c9e0b6d4526d5f6494d2c72f812fb8d26e17c7a44f6b5e3f9e684cad +R = 0a379ac253f3aaf94cc49e91fe3f2908107a9e1a4d102e02395eb18cf08 +S = 0854c2f6ecbfe95cfd14045faf71ad47561e365c1dd5f515d8817c3198e + +Msg = 463d04c84521ae671bb35c0a7acb3ae509b1b0470f39b8fe7ae5f3c9fbadbeb2bcc3a87e284cbdff07407a351f7ba743aeac50c4a1fef7375b90eb4af8ea2df040776bbf3e4389e7a80bea40530842642b9895ab9ef5ac8ed6c9ce7917d7b3ebcf80b801da845943313988c1970e7748cc306f914c37414f8247d648b580000f +d = 0becc76f8a77615c4f92ae1f91645bf5bb908e75ef22fd544aae63a3c8e +Qx = 18cd93bfe8fc8ceef2b9be14fa947b60fb122f5099cb5bcfad0cdc601e8 +Qy = 16de11e673011e30f6fd92025a60d7938412ac63b19d23e45bbf53c6c4a +k = 04e75a7b92c42ba0581eb1201fa5b3fb2ac82460e953c26ce6bc60e145f +R = 067bad23ecac0883d218b1368d822b3bf9b82453c0e5f3e336777c6a507 +S = 03788a331249463533384a61c47232aee6f057634c37560ee25895b2a03 + +Msg = 8b2379b5553ae7db6023cb010e26ae91322bc3f94dbaa369481936f90a886e5d3827d995ccf03ca59f46805fbac0337d31a8f117cc7044218a934d5bf507090e7e21178a7162c8fcb39111e6967803dbf9d752f3ae737ba024d0f4f7627e08be58efbe997a164106bfe37f67d2f19c0fcc7a6c7eebd96a72582a9c7bdf881896 +d = 020572c2a3dc3ea430cd8cde9d642081c21658e8bda165550cd9a5d37d9 +Qx = 16117486794f14d171dfc3ccffef0396cc9fe5aa45d6d39ce0f252c4168 +Qy = 1b6a12fe2adb279dbbefa4eafa273a2ddbafb2c6401067a5ef5e859fdcc +k = 0edc8d0b64496da309b10630e9e5917c9a807ccd7cc7bab14360873eeab +R = 0e1fdd3b7849806fe587ad93aef737ba0472409b7239981f0d325785fa2 +S = 0829449a0c39071a832664e8148e762efc36fda9e030e0d062458728273 + +Msg = 3090bf7373731cc44c00372c1ac59280b0f36e627ccf763fa68a7be37bb0ac8cbd4f70db54fc652566c78ad268f78f015e4bb1e41516fa56ac303a3bb4a52e1fe897d8338db5a6e37cad685e704b994504bd231c7dec0002dbd907a7ebfa809833e32eb23fffdb44fe4a18e11fa19d67356cfd703cf39a75b1a290b8a7c73afb +d = 0769cfbf2dd8248ea1e0ac9b275c9d6ddcf923fe762079b9ed62ccbaa89 +Qx = 1aadeee0e31ba9505da3e195d883643d260dac9fe5e86102c8ed7f88eef +Qy = 0d925bd5fd700fcdec60cef9c9fdd304faa102d9d721b4f21291f8c96a4 +k = 0f2e203410107c075e25c4adc2f55dcc277883d679ea307df7d52060fa3 +R = 02fc0975c2e70328da4a0ad2b8bd344a8171c2c500c55b1c92270230c27 +S = 08871b6791f7d03796a3aa537fa820f0eac8f2463c9f918468e7588b784 + +Msg = c37389cbe3f46eeebdda343e354ccd543e96b0c2a87e057aa6b9c4895a403de706d658bbc9066c140e50fef4b56af2db1f42efb70b8021254649983f1e11d04d6b10169d5a1c2093b6ab89227b88a30537c776bb7575749c3ed87bcb29effd8e4f17915b4d5dff6cab9678d88f33abead1e73dbdc5c3307ff3d3b2d5fd7bfa83 +d = 040ea4a37b388f0cc464f7e2bf92173107b268ff77a8acf5f517b4ec0e4 +Qx = 08acee84d29638a7285654d20f8e0653c7386140aba0bd2fc157d517643 +Qy = 1482ba5ebb82ba46654aa1eaa6a5f01e030177318921a0c99fa3f6eee9f +k = 0a6fbf938e9cdd009c838196ffeb61f7f545f7e7e9a6cb18d1f595a87b1 +R = 096a80172a7b3b65c0a8acfa8b89cedf9cb19f6eaa5d38436c300b7c0f4 +S = 0b7bb96ddfc9d1324bea96836c557cf88d6ede9a93ada8fbfdfcfe56244 + +Msg = 8884def8c3b9c5f856b9c2352c85ea71aae3c8d0e84ca74e70e404a21467159fc9826548d16dd1ec5a75dc2c23ca37b30312f25e1194e0f9385a0499db34c855412bbf58979ffce7fc3afeb7b8dbf9898df44023200d809f520db99eae315b5cf85674fab008a20340fae8f6974034fd3e55bf08c5522a460680218f9757e368 +d = 037fc7898df9b37b5390537352f5c0b8de22659166c19d7d4df31c3938d +Qx = 198674b40d2a68ed94d5b2c51102393d1332404f75187130669b9de0df9 +Qy = 13ee77d854a60f1aa74041ef1fb58727c09f13039bb4b33a818dfe9af2a +k = 0cf92eebec59605b1d45848f5d06e93ff2767dfa282929208ba801a9fec +R = 0f7bd93dd4df06219fb974a4e85030840c7d4877f131adccbd98cbd25de +S = 0c2c4a864459488eb5498a06b0b56ce7fc98fb29b1eb9b6238da8cc8f52 + +Msg = f1fc154d469433f56c2bd42aa52237a4a4bfc08fb6d2f3f0da70a62f54e94e3f29c629c837e7adf0474fa8f23251b9b349a16848942c0d9cf5db1d0fd99527020dbe21cf0b94a9aa21f376bf74da72d36f87b306b0696771efa7250c6182b426a4500ac14de4a1804b38db8d4f3beefb8c9bb619ac82cb63fb37c2e1d22951f7 +d = 05d5069425e7a9925d2cfc6360a708147b2c1b55ede243591885147ef3b +Qx = 1f35f161ce0963dca70066b3a6de2a74ea1941a27cdfabd9e433d8084c7 +Qy = 1d5d9cca5b741b2321d8511a777fcc2515c99ff8d13ff20266a163c94b9 +k = 01b9c83d36ada7e9367790ee850163ef4420104e0dd3299ef6d65191d7c +R = 0dca4e804bf74aa496c15025acb4232c637c9b81e9e26d6f2065d6be21d +S = 012014f77a4ddb7b266abf2c65a653988ee6f913e700f3f83f3e78c88ab + +Msg = 885cd348f7983a0721f96c0e866821223d3e5a95178b16d18652b4062b1b2278aed6f54ab06f7e37ae6ce1020aa3eb812d215194bcd212302da5b971fd86aee1dcb23057dbedb569bd0bbef80df538da69ae2358cb03bb77c64d3ead475c8c5ae5bfbdd75684b421a26f1a7b0c37548fa32d805acdc91230dd70a48232a12846 +d = 0ffe3e7b82ca62b96e057ee072a4718ca20a6cc9a3e51e4fe8ed7b4b9f9 +Qx = 10f774adc83c1893894855366f1db1962bc697b8e1d047a01a08b12da4a +Qy = 078c6ff634d5dc8ffc4d8b1a53bbf94046023095a8c2b41618c4330a4de +k = 005a4a50de4e97280d6ed1324214d91b271deb649a2dae18d21a0182022 +R = 04bc8ba9ffbca81b5f19f0d8b1306900ee642bc5cd9a9dc9867a4531b04 +S = 0353567acc062b83459017c70cff4f3b8ef0925032b51d7300261408549 + +Msg = ca3b0e2f1c7db4e73c699f06e432bb0f63705ba66954bec4a259bf31c161bb4861476e2f2f7dde9d841d1ea6bd0990cc793cd7a10432e38735c3eeda7a0d786e8821239bdd6c4972c96c2cf68ec5b935391f963a50fe16af2719c9029943b539ff0f1f5645962a6ac46c75d2037fa0c7cd46deadcdfc66e1ddcaada3a376acbf +d = 007a9cb5ce27c763646de414ca2a4dcdb774d69ed2bde7a817baddbc9de +Qx = 086d4ac1e3d54f7c154c5370f5c9a2d22cbe8f794df68974706bdc9172c +Qy = 17770a2ccac923423137731a14e97f6ca65a8cb3642eceb4e70c78ee929 +k = 0538b86e0a899281ab56d28f40bf3b7435f9a57e334a3269233766049a6 +R = 007ceaac3aa0e260c371843104f5cb91a057741b38889ee796e69f920e9 +S = 035eedd44b036b843deadb8e8df9d96b16e719ba350a634553457ae71a1 + +Msg = 4b0a31b746763beee77cecd318b90acf50fac4172cf4bfb354e5a440f651cb89d7a515e09ab19e9850803ab9167c2aee3b395a5da10dc9aff799d73756dfb0a9961d93bc32f15a96bf13962a03d5bd42ddc8b5928def7fc48fb063f42866fc5f96cf88fe0eb125b7c01906ad6a7fdade28ccb0a421ceff50ae03a974671b2c27 +d = 0c03fa9e38dc1c697f70bc6381f2bacaf860bb5632fc837f728da959ac9 +Qx = 195f386c7efe108fd1d580f0a77031e180e45a23911ba983217207a904b +Qy = 1a6837095a64f71ec53ab1c0d9a3a39d69a514065d83f1af26870e41741 +k = 0d4f48085b367787a614b57c06ee8018b2e95e989c2e8cf355e71db1091 +R = 0391710f815babf07b6287b7aab8b9d2ce04bee2a144f4d4a46fd17cf77 +S = 0ef29cbd771b8a6f414ecb73b7937ffe0a108593ffc6899f28d4030a9eb + +Msg = 3011d42792b21c0f1719faf6f744d576f72c5fdfd22b1a520d0e8d47e8c2b06823d853b13c9fa039fa30a6f2e3e27bb2100c6a35f55703806bbf0f79b09d0f629f8042ec63fa04062f15f2edb92b19237980005566f02bb12a40b4ec66e4ba6c599d928b33f72d7437c0e399a8e6a9068d1fef24917fc4f9ab5464ea6684dde9 +d = 087dba00e3fe4802e01718017510094924496bd2785d4ac1a352c530473 +Qx = 1198518db2d1255aef955b9b80471aba60cf6d8fd1feae6d8e048ab1403 +Qy = 1833332a116214e4d9fb37c8e0ab7552b87348434a67a0c41f73972dc9c +k = 0378578acdfa572b1de4e032158b28bcf00ab7dbaf07b0e772c39603216 +R = 0be2cb45d527a7685139290f1098de975b69957fff2c5c29059ce417950 +S = 06abf4afdcd2990121723b94ab8145d01cc4917cd70416620ef100c67bd + +[B-233,SHA-384] + +Msg = 05a5d3a3b79f4e51b722e513620c88092a9bb02408f5f52a32e782fd4923f4fd3094fc5536caf4b645d830260eba91b5173f3833dd65600fb9e246aec968b1f6ebdfddb4059fb2de7e636ed60bb7affdb74aefd158e54485d5f26be373cf944c6570daf8fd7e4b77fad57300667d6decf5c65db99ab8763bb4ecbb09fdf47e3a +d = 05a387e7affc54a8fbb9157b5ebd400c98e2d7bd5c3e095538987d4f8d9 +Qx = 1a97224cafc063967b25cd1a43283daa5411f3eabe9386b8b14c9768c29 +Qy = 02cefaec5141bcb084cbc9aebf28fc59780897ad1424fd439eb43eb911e +k = 0fb7ec3804654b9c3675f7b3c427f6d01f83872e96de2742e59c93151fd +R = 0808d829d78e65eea47122c92f8c2cbf5a8d6717a057ef1659fb6f8cd3c +S = 0ef338e09dac0b12fa6109d15924efb694a0b672afb4ef05f4e6f2f7b88 + +Msg = 247a101c8196eb93a440280650ad463795690bc620e46e8118db6900a71eb493d03fbcf2f73a79bb47aa8e2d8c87ef70e4cfae36fae5c45fe247d8cd0f7d0718dad106526945014b4f3bec324897d8e1fa2f457b8a68e61873b7fa0350fde3b87b7b001c13953c2050a24f71fb77eb455053e49200ebcbba7299485c0f1a40db +d = 0adae709a930d6f5a5c0e3d8ef4aab004d741d23f0ffb8287f7059890c0 +Qx = 1541eaf3dca942957c48d693d2eaf2a456646d2fb3eb8df1779b917a9b0 +Qy = 09737958276dc31852e57063119f1d2d061616b6a2fd35b4a1a3f046954 +k = 0390d5ed395f8ee3478c2765525c235587dbf5bb2316df3a1e8c664185b +R = 0ebcc4f84bf2deb9b3d669158998fc96d7516580675e24348ca58d70d2c +S = 0b99462b85e6ce6b46e5aca221250ac9de7ccf3e63b38919b61700be866 + +Msg = a16678c71976a3ce3362ca379b3272b92e8ca7085b43752473db34e4d6b61eeed3875f49f3328366fc9d0644824e0104817de458e4c1036636b18b83dbaf063f2f99818959224906571c7b28873d9c702360888df151e9ad1a7003e6130033203acf8a69889be6ebd90816f2abf0764f10be68653b1e56766ecc3150bef8b042 +d = 035d391411e6d679751092c4ea5a079c591e77ebdcb57c1d9006ae70d90 +Qx = 01298e6f1612f90dbd2eedadfa8ecce22dff1da2d1cf057c41bd37d4b06 +Qy = 073136a1caf7dae2aaaac571a900135a51ef031643e9d5f01934333b864 +k = 09e343003670f61db85aedc0249db21953d232bc45488c3d6ceaa6072bb +R = 04ac435e88f8e487b9b217e7d68fbba9bdea0b9685769878818f25e661c +S = 074d8f4dd58c922d7e79f30950bd54c10c1cc52ae3b8d00b675c8e501a4 + +Msg = bc2f080a7f0b69a6b142b8f3fb481a43bd71d07418df4f3b802568073c1a8d35729ad197f34a4e941a6dd511c63f201d1f6c34a1b66545bd5f43508c10bda1d6ef60ee5bdd25dde975e50c61f76cd36d50ee3bd8dfa2dff59524db9ef12f1e28d109b552cb42f021963f559c843476b5c889fc567b7840297c5a480e18c221dc +d = 084e79093f1947d6ab9cf399782436e36ef87c59a4c090930c9a74ddb10 +Qx = 08e756774def210e2d6f76d6e4b0b43d86adca0880f017abfc911bafb5a +Qy = 147e6a20c1aad897829339630c5edd327ef9a7e40795630504318cb71d6 +k = 0ce780ea99a344d67de7921feba6ae062817101068266d5d1a140d2b49e +R = 0fb2474b854b8e5d6920ed90e69b5b386a1b26a947b1cf28a13f7c5d3ac +S = 072722017a67ea6754873f833fc51318d41d6ef598d3ec2d3e0eb5bf41d + +Msg = ea71cede8b63ddc5648eb244184bae265cd65d50f77a9e25ff93f02b132487c08732544cb88936d4fff7c0fedb39685822dd1c9be1158f647c605c9bb5f6a1ae34722fa08882c14b36b6c93cab33c9a269c7c10f755b6453ed045ea3e56f29e95a9404ba189a0b48848120392b4dcac43148b706c3d9e4c03db410cbe5dca3da +d = 079b6be015b8006f86fd81c2792bec6b42c08bee2d295cf9dc214c326ab +Qx = 0e24338d5e33ad12d41eb623ad0905f64d5b75835fec4e693eebf9bba10 +Qy = 101b4297b5b62fcca7c61637a2a57365e911d3bc7eb0fc7adb0a9dc7bad +k = 0f06b001e5f874d16632e3c8d49f13d70f48ed4eecaff9d3b741f9d02e6 +R = 0de16d8fd7bb1783a2cc4b9ac1563eff3f87e4e6d75e6a32a4aed1ecb02 +S = 040bdb1197ee8ee51e4ecccb8d42dd985913809c131aa9224049425a052 + +Msg = 319b41d16e18059a1324c37161c937e882192cd949c420ce9c59208a0ac208ebb06f894a7fd78df2a3c5f23f25dee6595d3dacb25a699f115dd482ccd36fc54ba29dda279335424c86b07a1b1fa76a5411bcecaf4d37065b229cdce0bac75b666c6626ec37a716e9841be93c907f87453ad91d36846561f284421a89013b88c3 +d = 0ca9d751a060fde64336cdc88122819f4b3cd1b4e7df42d495197787894 +Qx = 09549785f4f9c71f20133f5a1d409b244df55445beec404cf8cd4d2cadb +Qy = 1b246647d7570f052840d4cc01182d1dc3bf357b25e5966434e1c3c2a30 +k = 09e99fe741cb23f7eb039f5df8414d069b5c2e3c144dcd6cbc6da56ef43 +R = 0cf00f519c18e7a0fcc84c1e338158399f16929ad89842ba97a4afb5bf2 +S = 05854ee1a6aa5a6a74bec0b4696e80aa275210183c86f45dde7002d7ae3 + +Msg = aebeee215e7b3d4c3b82db243a47506ffbf2263f6fe9de5b69286e8649d9218367c36ba95f55e48eebcbc99de3e652b0fecc4099714ee147d71b393de14a13e5044b1251e40c6791f533b310df9e70a746f4c68c604b41752eca9ce5ce67cdc574a742c694ada8f20b34d0eb467dce5566023f8533abfa9688d782646420c77b +d = 01dde4b2d49338a10c8ebf475b3697e8480227b39bc04253a0055839e9e +Qx = 0504bd3a97baf9852d6d46ef3db78ee7555db752120d020cd056b1b4e50 +Qy = 18dd305f6a15e91fa46d2a6d30f2ec8fbe2baec491e26d9a2ac81155c85 +k = 03b78d2772b8ce01a00ffe2e6be2f9e2ca2c89ea3b29bec6d6cf31afe33 +R = 0c0c51fba155f98900eaa2d2935acd615e917f9dd979dc8d92f1d6e00c9 +S = 08c8354f95e24ed13d8ff3755e1122dbb4117c76b21b3bdc7f4dd856f8d + +Msg = 8d353a6b6f35590baef59b638914d3e934d0145b045d221d846517ceddc8ff5e3d28826d3459f8ce1260f705e80923f39abc73d5949aa7aa8ad1734be0e992bff0c9a8f4cc9bdfa430d4cf52e29d3737b0cd3231b72b16e15e1a9040b832e4a920b4a1d94c4964ac6c8abb75bbbdb10825f882ae44c534c7154c446421a04d87 +d = 02c8bea2803fd746c874fa110a716538c179c82712f38d33d0f6d037e7a +Qx = 0a034560353561cde19db89dbcad5c9dcb74e239efc604e86ff38a0577e +Qy = 185e0b02c48be2e90c916a7c8ef2b41a57ea8d4f21d8cd3a0878a03875b +k = 02e39f851c57643bd799c4f3b2fcc5eec8ff7f9e9e279efa647f969cc6a +R = 09b2ad7efc7ed60d9cd3dedbd4159b1e05f05ce5ec2d2cdf7a0e0657482 +S = 03fcbd4ace6a140c8bfebe36ff30848966bb0d3eec323cc8ddda55faf00 + +Msg = 847f134b90f10ba3636ec24f36a94111f26d58428fda5bba4501e58c7bb55809f52320cbe9e0df55af1e40bbac9f3eaa26a55d78b60621d4356d090d98363662f406367601eaa9eb9568b1a1b319730bad7bf6a7ddf1b45eb6922faf8d065c540b671c50df758ebf8c4aca6f01878e5e0012dd038c58833e2b13ebdb9a9f3fc3 +d = 0b9119b3b4b30cbfb98ddf0a4f6953417e515fcf0e5a94e83ebc1d1d14d +Qx = 1be65d340f7e99067bbbf961c2b357e1fd47a74393cae5f93a40c5dc280 +Qy = 0c04cd8ca3ee253b99e44ee6bc0e52d2f016b16f59c738b9f2bd8c1b9d8 +k = 02c851ba0123ff0543808931ab3857b5c15d7c10c343f232913f6e0c92e +R = 0ba2b33550878e223cacb80e45e382dae84e76bca5a2ef8371b84d08572 +S = 08c370f82506e97cc15837f59e9779448decbd87bde0a463bc14b18edca + +Msg = 99d23950493bdd931915e9f9b65e4cd1329866c0071a19d4f7d6fd190689275b7b10fc07503dd1c27a4da274dbeb3aa5cb0e71e9b7b03fc2697729b7be913756e6760098951d7015df181cf14b1e0b954e6260276af553e3e59907794b863e941950718ef154669c5c262946ba120892e0239e05910c2194f712db46e37e53b7 +d = 0f4ab2a573f3771d1e4222e251faf14e06cefed544e804c299c9a8395f5 +Qx = 0b1f973d6495d277e24320622b9b99fccef8eb5c1c6952f35b82d4479ef +Qy = 161dceea4d3c9caa4f640f51b37fcbd5b8932642a94c8e7aaed5db17fdd +k = 034ff28a5ed6958514c603b3af5a991e2e9b4cc2c0a7aa73ab2d70bd05d +R = 01abe4a7b27395a37089f91eab27ccf29001ced1bb3348a6f919d466477 +S = 057449e55d3f2a4004d647ad6e8fbbd516adbb4de40b1a872ad8ecf67e2 + +Msg = 7bef2487bc2bbbcbcc1570bbd4ed437c0dbcbbf63f666a3355aec49ea6ef593da25aefe9ae0d94db50692475425dee3c88cdea975794ac69142c25732f3541457d68d9101c8be069f2b515aadadea2019dc7abefa6c12cb3f76d9f4b5e46546f77eaf636aa8f2329130922111151a4df913d18b7cf9d0308f01ad84d878adde7 +d = 0f4649cf30d4a5269296a45977de2652cb06d3ca2aff4475bb24517b927 +Qx = 100ddcc8e09ba2122a6535c6a0a2dae83abf9e17687b5f6aae7ec6a2df1 +Qy = 048f5587360ee251925b7ed02de82307ba219a707705623727f98346a26 +k = 0a38b2bd0e9a5044db19d4312ec88d19ce1a9bf0eede8c357f898b0bc67 +R = 0d0ebabc8761ea215808a2c3035b14b614f64be0c2741b3d7789a8659ff +S = 0f9e742bdca44c11bcab196f910c0d887e90f250817ee7027f6df8207a0 + +Msg = 87c717eef6dd3c7434b2c91de05723783bef603d170f654b49a04b067b077c405d2d757ce780101b930196ca4261efcfbd3fc1ebb762cc0eecf101072988aca508c41581936526d3f337053000dcf77b16172492c5d654c6612bbd2523a6ad5966d7091697a29ce882fe331f79a7eb59e5a3fe536263083cc59b8133bfd33c1d +d = 0cca24ad914c24c011f41f80d27ea41caf41fcc8dc9dc6dff5248b2b474 +Qx = 0175b73db13324a678b8afe086944a7ad257cd33fe9538c59b9177d1064 +Qy = 16a98ac9e0ff59de1ad94b50f8c709ccf4342f983c7530be64c3f1548fc +k = 029c83def3a5c386b0bc3cf2663b8f4b02f26c6e3e14fcb17e9460087f3 +R = 061df783609ceb355aba3b1753d38f42434bd75c8354029966e7a788be0 +S = 01e8a093f53a1d73d5a994b97f2b2f210125ecd3dcdf77c68ea3199856c + +Msg = 9bf48c2aebf473b3a4a928b3b6a4d2fb7e9193c9e60bc2067f9f03083a8cc7b892bdbf05601118bcc34dd283e7be996bf19b0bd36727eb9d65276b6517bf0c77ae0a9091e7a9e46182a2586eb22324939801034e5ba94ba30d1bde7d8fed51eb71036fab6224f8ff30a008422efcff7ea239ff23b9f462777e62b41b396c5dc5 +d = 0f5e12d536ef327e3b0ba65ac5fc3f7f4880f5968f3340eb8868c1d47da +Qx = 0b2910f5de9475486b3975ce91c02187e8803e68586f3a1df14df67648e +Qy = 0f28af5363ed851c42daaa810afa1fd0d2e001da7764671fd44fb6737c5 +k = 02a018753965bdfda98512c7f9da3e9235a4a77aab9804437b652182347 +R = 0b6fd02b2d84b7baf1a5eb592cde667ed6d4c2c821ca336027a72d9abdf +S = 02253faa5935885945121a374010b2257123cd5db4c54a2aa0e08c8197b + +Msg = 716d25519ae8f3717da269902be4a7566d6f62b68cd0faae94bce98c8a4ac6f66215ebac5407d6f64adf9d53f79f02e50921b6f0e8c805926a839443d30d9294eaa802faa7c5471d81fd1db148cdc621a8dd0c096e06fb0b71943337d5325e1bca77062684873fe904ed9012474ceae5b138e079f941a665a995026d13d7eed9 +d = 08c30d93536b8cb132277645021775d86c2ba8f199816c7539d560ac6de +Qx = 0d69332763cf533d48e56065e1b5255790f8c0eb23471fac9b945e62195 +Qy = 0292df8c77d9a6803f60bf0722ed57ae2aa3bc816403b000fe2940e02dd +k = 050967928d6089da5b16c88b7927de210325c8d8f5e727fa1ba3bd95b5e +R = 02434697cb5c2ad95721943154bc81e2ae16332fa6629788f505bbc1522 +S = 09a5a6792b1b9c2e200ace5a3d50c04f69084dd9222c021ef5fce14d4b6 + +Msg = 01e76755007b2ee5ac9e1d4c8adabad6d0f9c1c08ac6e2622b7c1ead89bd3ad0921b9525b49a780a262fe8fc0904a80391717ad7cac9607de55f7c744af8a132ec45ce79723f4a4a8c8b9ef658b360bd3890df164c9f1cd74eafb74feea251a34514ff2a57ae7a6d4bec2067cbf6ee4fdaabf13721bf9ae178b9034ac5e9665b +d = 0fa3f15a506ccf7b50bbbad0a54d3223f5a95eb54f0d1f4e5d0cc21469b +Qx = 0e797527d57fb3a18c71d1e82e7935e37e719439952d4b972f0c1e0c835 +Qy = 0a345bef4c5015e97a148b8991bed4b7ef48947b12f316b5621e94d49d5 +k = 075afdc12d4d50a7495f5a7d309696dca23e9356a0cab11c3b3d7b8c54d +R = 0960ef460000fe8c761038bab7e29d665100494d0874b6556862c2808aa +S = 08d3c004426dde6c18b1c9ae00a44ac947e36755d8c40eecf47bfa963fe + +[B-233,SHA-512] + +Msg = e95abeeb2c51a8cb75ab74253dbe130b5560cd52e2a63d501d26e1458aa568aca6694be91eee5fdfcf582c47c1c727084ee2b2c810281cf9b095808bf7e7c668eff00a6e48b06df3fe6a445e092c24d5687d7d89acc8063275caac186c441bc697b2f67aa71b03294e1adeb7e557c296dd91304ba0587cda3c984619f1eb4f2b +d = 06400a4830889115aa88b860b3fb65905b01fd126c4aec2785518c2543a +Qx = 1a2051662c1681bbbf6bccbd33c44c7c7fc80b81a1bce14caa36a73f7a8 +Qy = 11583d3ba8f22080488471d8103f868100a97af94809b58bff1435b16a9 +k = 0ceac6e5d10c55888b9ecab8d3f6ada7f4d0bde2f109699157d194efa42 +R = 0c148f2337008ccc3e61501dc5df3ec95d3596d97eae96a7ab085a915d8 +S = 036d1debebaaef50243005e25c791b9674cd6fa986dc3d32e089fbfb2ec + +Msg = bb8d8515365d240b2071daef0d80558fd3d0e059be9f6abb7b7a0a5f47e2ddca7d1b3b5101d5c583143258520ce8db0a87f877a395615c9bf879ef46f2f20f68bbc9706f82781fad69019396b27f292cdc70fff1772e90205a2225f80889f9daece1d03914d8776ac5bad24d8fb190ba10a2ca17768b918c2e079d83734eb372 +d = 0c7b73c324250f14fac0edc941f79bdbc6933ee8f64bf94b847bee5eef6 +Qx = 1af7266ee56bf0518f2875d4f4d9ec508a01769d9c1fd0a885a48bbd80c +Qy = 084167ada99502475478465315bf8163870a9ec1b43f15d68f0304ab03c +k = 03badc9b8098c3b4d7e943a2365093028b579519031a8643b50c0f81eec +R = 07ad4fc96c21963395f56eb63e1b0b4d2c93d827626e7bd4448697ded97 +S = 0e7504e6a9f662472e3e6f18a40f7645922fad2ef7313d600a5a6ee314d + +Msg = cd8b2403435fac9caeffa21b55eaba52d7efee0f89df7142340cdffeb89556303ca01a800429397e2ff6c746743b6bc60a87133274282d4cac02e4ca90ad95d80c93b84163b96296f67d40b2a1124b2b6534ab6b60fdee312fbcdf468d0e84eb85fce4ff360136bb31ced3998d29cfaa3ae685e638ee272058f123c4f35f8b6b +d = 03db7f28e161abf52ab0adc8c4c8544fc989af081303b8688f22b7b2eb7 +Qx = 0ab94312e53832265b929f3d529bec33dbcc5c17b969e0afbe2d559ec39 +Qy = 1d53b2c1be229e2c224e6e9fcb8bb0f044f3f9f5677c60bc9454f36eb06 +k = 034a8f980896284fe6d28b0b49703f1384d799e3f11a04b1e62da12965c +R = 0e374fb355f30d7e427bc5db99ed76a914d6e286099c72f28c07302c741 +S = 08d5ffd41f8a1fd3de6c433635fddcfc2b21809d91496ac17571afbb856 + +Msg = 4bb08eeb202564efb5bda40777d71f1bcc4c7c10b611e803e5c570876f3e319e9e2bc2d32031c56a32fc0d1fcf620d4e4377d881e9e1695bcdb78acba370b849115b86c1c4b83edfa03299da8e7fd14c7cadb81a8e4911c8e427e32c8c9b67e317575331967cf58085cff0c0d48ee0b8e7dc0b49687bb1c70c703a5dad08ec81 +d = 07e9d2fdd017d6da6029e88f78927d9ac9437f542db1f1fa99e32bfcf1a +Qx = 18429bf08752aa470a8f0801170a7ab96adfb168ee8212d76ab0b994e46 +Qy = 072a5071ce308d7daefb3e8f4da4681842ffe0f35dd8b071f0775c83f82 +k = 0a0f330e011d34714875500b70c881ff6b1c9e96da930eef75ec78ac120 +R = 0439bcdb86d40e8f64db5dbead95d85d6a771d811480c5765ffcbf75422 +S = 06c01f64e2812d18b0946ea4e6599e8cfca0a2b606c3c35c803ef2cfed3 + +Msg = 0bce683d835fe64e6484328aa13e18b0956f6887b5e4442fce36ff09aed015889794e79da8aa60b4be565c78685674c51e1e7ac60db6a763c777198a56e382a03aff8b40862f961ae23e8b8683b76a5577769422418972ab0049119382edde9e752b42e8b93f403c1ef8665d7ce8530ce4ed9ebf6d397827cba6b7645e177231 +d = 0c94052760fc74c2b405ee4dd5dd2a7d38ebc16df9cc32df706075450b5 +Qx = 1d2a5ee02d97f82ea9c8833b825cc57b0cb51d3f2a2cfa7577eba676eca +Qy = 149c68d98d0e9cb242962326a26164f3e3cb6d81b51f281474b0f8d333b +k = 0fdd3ade90da682676d40008cebeadb9b2378d8a821e9e9428018cdc768 +R = 0f6d244daea95002daff2ff6513da694eee58f8b6c2d47ad121be87559a +S = 0b04788fbb5655a053d0fb7a38c39e1fef68ff17860442ec8b8ad049842 + +Msg = a6defc770426daad4dafba3bbd2a69881334f7c31269b297e440926db54cdad3fd7ad200f5ada2b72ad221ad99a06ecac9c2563a8deed89f0d0896991d1a652f6fa282affefbdb1c1985652300d1792725071631d75a182b683a48448063c7d2563ec3d430e0fd3acea33a35cd38ec0b5b07af96af71d0bfcd879d9864ededf3 +d = 04076b93487c2da8aeaeb4725fb53b7b41b465315335c18c6ca041175b4 +Qx = 158755fd290910498f6c8eed83bcebcd1fcafef4878c860da118efa250c +Qy = 1781fdae501c2c147eca2c6c809d9428fff2f853b57c7d6add70fcfaa0e +k = 07debe933553ba3420aa06e1bc52a1653f8a19b59c0bc9c47212389442e +R = 09e09c6d96e33c845535468ec7f5b79cf30123538011d0b5ffd935d168f +S = 0963bbae921317666f5852759e9ebf05cd026a5d9f026942835ff0daeb2 + +Msg = 7803cdf4758c199962b62943f475c6c31356f5d9b997a12e21146a2399cd0dd3b97a860b2ce639e2801571599136d4a8cdbfb12fd1a5ce22374991e090533ff42823a2c58d2076b772814eea7fd7a1fde68263ef912681c72c7aa3e5a7cc44ee8c65e72228b7631e600121ea35bfbbc783b6ae3c0c8f80198ada218be533760b +d = 076ddd73ee4fc1f5e6766e229cc7236cdfce312417ea291f7c3328d5ab1 +Qx = 15185e029c0d4eb5102e0fe900ef3c921acc744feb44570a288015d0908 +Qy = 0ed56bf93394a434cd84b521040d40452bb39755da5e273a05e8c0ba792 +k = 084e9e4a9c84a602c18bbb6b183d06969c8b8538e2ff901f1c2794d5eb5 +R = 0fde8e9b1959477ddb3423661df1e7182e4b583849d6d17fafd7dc5406c +S = 01a12bd30e9c8b74912c670c0845ff5ecc77f29797160bd4992efa61f4c + +Msg = e789461e1dad0b6e21abeb6ae2e96385549d1bae39415188c8f833233da6a3328144c97ddb36e0ff4d9e19d84f869e79e609c51b32de59892fb0446dd28cc164a3e53534c950d26f87fb74e682db2038cde778bde06c3ee2eca2a077d8fcc2b0332e352e0e7e6487444a8ad60e78ff213b16fda9faf374dc6d27b7a3c4c6d196 +d = 07e1f8988ad804aae7d09a99be19384cc599e7652c02c391542be74b17b +Qx = 1fa4751e507740a7345e06a8964022fc6caa901cf0c2077a2c0fb86be8a +Qy = 0683c593a0bcd123d958deb6b430d49d5a2386d44706f4149dc526ad896 +k = 01d288de55b90dbe72cd8f1f86a3ffbc2902f4b5f0cf4e641d32aec6f20 +R = 0048d16d87dbf4fb8e994dd874c10d5d16846b9ce2cbd43d09df62ca970 +S = 0e2ee47f422095d629c188df97e2839fc6239b9e2dc26baf8161b037236 + +Msg = 9b58c145d1b6c887f2b25fb672cd49c3a1117224be697c15182d4048be92968a6500f8bcf747fcf33145c13a8d72e891a6e0c4c7310c2b62f3181bf586fe32f1ecf4feee8c2c8bf6c2bfdf9d5f88981ce080095c93e49a772d8e7b59f9cffccec3ca2f212ef4c6748f64e224f4f098334d83108bf6f8c7b43c5eb549f1526897 +d = 09b2292b0244c2aabe8b43d95039984d504ebe05eaff318760e4dee739f +Qx = 12618d89f50b7f83ac470705dbe9ed81beb03929732a3f2aa7a636eaf59 +Qy = 15f0f70c808e053b112a8c32ee422aac2b926c5b6a279a787fddf819990 +k = 0fb38174a83ceb9236fec8ea39be2b3c77c3dd2cf42d140e27838202d08 +R = 084941856a387a56022727f81a939d77d12b01dab603ea0cdef6d9cd6c0 +S = 0bb9fc30595f94d664a590ed4f163e4526809819baf96bbee629ff86bd9 + +Msg = 52310a901fe9681a23dd6e02f12974d57f2c4f653322d9a0ff8b338cc6c2bd9f4765c90c6b3c9fb17df3f492e67d204e39d81a8fdeb92c852a1dcc6151ed6c63049037235c6751c9a902748163a567b714725b4d3995e0edbde03215c645b1a1da3147f7406245432800c50f823a1f991c863427ff4c68e4e16d1b106ee40dd9 +d = 07ca463b50fdd92d9163f1c2bdfce2ee45ba1437b79162e3e959b814cab +Qx = 08eeeb146216c73ccff0096e1100008f8b1f3f0c5754c0abc4ed39f7f63 +Qy = 18c9228b11888edd66b2e661284f583a0e8d3c3e922932cd9fc1568f959 +k = 0025291ec0dc2b0c709c5e69695980564552545c2497636b814aa049ccd +R = 098dc98457ce6e69f77123d5d2460ff569786dd60fe07e847ed5bc14da9 +S = 0cd320afad2a4247fea5b74d78dc3df8967ab3159b4c8b191814d368dc2 + +Msg = ff419c011601cfaf833067cf28dbe6e935ebeddf8b5111a97f6eebf3bb28376334f329cd877a134b074790a073db766efe018fce666a34650cbac285ae856fb6b3b8b96877282bc11cd9f9c8e510ed1f69bc2725a44a1d2b35de1edfd8bc9d20c7525ab0bbc27662a7cfc1bbd1e0f4fce5b88411521e3893e027cc8c73acdabd +d = 0c3844750f63fe0c2e930bc38fe88522f4e72a2fd0db9778ade20e939b3 +Qx = 075acb00b5999f8b272a15a2cbdf8cb630dc3eeb1e78e58f58e467396f2 +Qy = 16711aca424ca335878d273eca75d804d3f009a1f3628568530ef265eaa +k = 0a63e7a20d100f14b8b709f0a6c383166c2151a36dc471f061b0f20dac6 +R = 04063be9d8e4f0f9afe0c79374c69b36910b5d2b1010e0f4db2e4cd23da +S = 06a6eb90659aa79e4a2360ea9ffb99a415175dac6c3efef104bef6fd57e + +Msg = 05a89c4824c5de66587875011e704bc6e06e991ba8f3aed331cfffe55aa266a08c729f77b8d082dca4d286b2d451ea838d726cc2cf298fddf2d7376714c5e37b64506f353917caec525a1209391449c078c5197a371feade74f8fc8a1a1d67576edfda13c14ad324342fc0b09277941dc072ec0d39434ff1cb91fc59478fcde7 +d = 0a3bea235dea86506be4476eb7999dcb8e584a34238c4a894ad6823b93f +Qx = 14093a072c21c44d1c4beddc5c8dd9a2845db0935bbb4e1c4edb0aee032 +Qy = 13286ed584deb744c9c35d7ae7eb9cad1c7ba2b670642de0399b230716d +k = 078eda19f0cced2f84c1a7b354e5a79bec035b8bb279473f32d60f5d17f +R = 0964e817f0cdc251eede4157a9bd830c476627c3f27d2931b4f593b0178 +S = 08dbf34e597ae06ad92b13900a4944e54a5bf0f16f586baad157da6dc96 + +Msg = 13e6b5241365d9d0ef9e8b05cabb3248afd221ec02eab92284b98bda3d9272184bfe5251d35705defba5085381430e99b33a3ab77d7870e5102757d065862372df2434a25556b76e54ebc39d4e6c3aba5cd6acf0c335756f7d9385c1068d4cfa37526a9a58c0ccc7f87a8189176c5d4f201499236058ec061357dcdb5acdba40 +d = 09a367cd1cffd8dfcca179e167ea437ee48e9b6f42559dda9224701d3f6 +Qx = 1052d751901f6f8e61858d3b15eb59dedd21e4e997531ef65622d575029 +Qy = 112737be67ec621509d73cd613d7b448035397fa66eb881f90a6d531ea4 +k = 0d8dd8f1cab623ba6a4e840962fb31de97a4d14aa6dd34dd21154105030 +R = 0a8276d0f069f34c60b26a55d47df69e4c9ae2981afc59e14b5bfcaa498 +S = 09351c4b3a06b839eb2e9f450d9c3d15efa45509886ea3f2610ee1dd156 + +Msg = 139a1a5090b97afb8fecfff8745efacf7dcf91a4393a7b629564e598d58d5be39c05c5830d4c8ca85d29e9e2c31ad0447864e867d0ef4788ac734f8d871daebceda98d449308c2afbe97724c3af8a468f1925065f39e52ba4b7d15728a744b1252a20476dcfff7bcb82aa72c209e72abb3c24419bc26191390ffed340c1b9c6f +d = 046f4ad2522e78b9b35297d28f361fb0ce82306322aedc119251d8241be +Qx = 0b976c53a966e0834d5f6bc3af10a5f12cb6d16cb2303a3c6cee7d35f22 +Qy = 1a1097cb56662265f4f2f52df375d70af086264752477c34c6af522f1ec +k = 06a0d21e5aadcb0c9e3f9fedd2d896b0236dc90e33778fb114e970122bc +R = 068063fe0a31b7e7925cf8959c3486985d98f58224d5f67cd0218af192b +S = 0f11a22ced98173040062ff9e69d1b2a1b5a939eda0a6944e96fc62fa4a + +Msg = 3315e5cda5f252e3291b61e493ab919c20a8af1286d9660cfa2f5ca38b6defe19ebecf820787fe692d04eae8a5f5d37abfb593309569cedf45efd0cecef6951b718924c8380ba52e8ab8c9bfb2261ed5f01cc5a5f9fc5fcdd269a0f122c597afdd9a836cf8f96838c3e8962c1788c3ce4128719b3ef4fc88569643dcad6da16f +d = 0ac82137e9c7a5ecfb8b1a7df9ab50732934566a392a6c8915ee8ca8144 +Qx = 00f7f835f8223fa6c49eaf6650e33dc9d09e1d2bb098925d908606570b2 +Qy = 06e659ce8623767e8214b076d7588746bfdcbbed59b75bb19477366cc78 +k = 080655784e3e31c6a498a63d4d84f7e5a353a66641ca17d4e223441bb1d +R = 07faf31d1d31ef4edac1c63072350536df84c417e0ef808c6be39617e74 +S = 089023aeb53ddd3e475d11c53479863739e62dd64348646581012784689 + + +[B-283,SHA-224] + +Msg = 067f27bbcecbad85277fa3629da11a24b2f19ba1e65a69d827fad430346c9d102e1b4452d04147c8133acc1e268490cd342a54065a1bd6470aabbad42fbddc54a9a76c68aceba397cb350327c5e6f5a6df0b5b5560f04700d536b384dd4b412e74fd1b8f782611e9426bf8ca77b2448d9a9f415bcfee30dda1ccb49737994f2d +d = 299ff06e019b5f78a1aec39706b22213abb601bd62b9979bf9bc89fb702e724e3ada994 +Qx = 405030ce5c073702cffd2d273a3799a91ef916fcd35dfadcdcd7111c2315eba8ca4c5e3 +Qy = 75988c6602a132fa0541c5fda62617c65cfa17062a1c72b17c975199ca05ab72e5fe9c6 +k = 2af633ac1aee8993fc951712866d629b43ed4d568afa70287f971e8320fe17b69b34b5d +R = 165ce308157f6ed7b5de4e2ffcaf5f7eff6cc2264f9234c61950ad7ac9e9d53b32f5b40 +S = 06e30c3406781f63d0fc5596331d476da0c038904a0aa181208052dc2ffbdb298568565 + +Msg = 44adcb7e2462247b44c59608cbe228ada574ecb9f6f38baf30e42b589fb9b157bb0560e5a2aa5523b71cc0d7f583b502bec45d9b8352f29ee1842f42a17a5b16136feaa2efa4a0ae306402940ecd6b71e57d1467c98e7960de2a97f88b43487e4f4016af1292381d70c18c7e6eed99a14cdeb5b3caf73688658e4c5b54c81e08 +d = 09c2804f8cab768248fb3fff8a055b3f4585c00de5c1615a19f9425b9432ea09afba8f2 +Qx = 2570ff62b03a5124f08f752aa71ddc57944cd94197fd286d5a2a107b116d7b8ff1b0421 +Qy = 37714d9abe9aa0a9668fce89a3fcd5cf2e4548102a181a777c9b3f1008ac6e8d3a31a2f +k = 0dab5ef658ae3e2ce2bc5c88a8b8022a0ca5eb8524815ffae414327e3afaea5fcb8a7cf +R = 2d99f82d92c9554722bb793988af0fd0bea776c5608f5939db7c8634eeb24ffd381dbef +S = 27ceb1d01ec9a3ec0e74d79e08024359e117488020de6458fbbcad28b173918fc7d129c + +Msg = cffee6252c7eb6d91d8fe100a1e62f0ad9f862d78ca2b747a6c17b8c9ea8980dc239b3b673310e6e7483582399163e39d889abc1a613fe77849ebc09b4f7f4fe0688b8a9869ae918a88294c7ee199be50ee9460db14725ae70b449d0cb48f30e7d817ec02c0cd586119341dba0b74f0279330807cfccc99c8c340b72c1764a45 +d = 2e625a6bc6d0ce7c06231de827068bdb0abc8ffb57c82b35ee3a0f873b9473905974d34 +Qx = 0458bf39974812a4e0964c31f40083300454104c0d65f22c5688bfff3c256b7ea958900 +Qy = 738dd33e32b9af93ade2dddf4147187a9270543afdfd66a0f2a53d6d3d815ef59795f60 +k = 0a9388815c528fdadcc5d3b125c7a38db57fa8c163ba795ee00e8e307bf760619e705c9 +R = 2481571400ecf9dd31dbd9c905fa1006cd5bc7afae759da3312ead8d5a7dd0c25a37ab9 +S = 13952fa427d348b6347b9e93d4cb2c4cae3429dbea6aafd1e58d5a34805098722b3b8da + +Msg = d058ab5dc07228253707ef224897ea0fcd09c3d5cc91fdce9e03c1c59c53fb4596be2ed929c7455e67ac7f4891aed3eb06ad88f2c4aaaabff045b959f900d1019d706b60526375851bb891494e99995928e4cd51c9616aa651ec77bd7e398916bb9ed3156391bf7fb1e29181e2b011dae2edaf803607def2ac6b194929a57f45 +d = 376ac24e1b86f8a55c052d92a0bdc6472fa03acdcdbccbf7c321ec0ccd97aa0a66b4181 +Qx = 7247c755b23bddf944e29348da82495b4f61d02a482c6111d8698cc77e8dda4c341f20b +Qy = 0f8c199138e1f4f8344facd90ac62d55f3c9a15ba7a672ce40241aa26419af790cf7dd6 +k = 25d07c7afc5a335c2bd7863c1965a48c12f2687b2a365a7c2700b008ee8a0e8e35a68a1 +R = 23fc2837a879b79e470305088acf596eb0159edc2008478cc4c3841a1bd66fab34bbb5e +S = 0a909b83bf77e74511063366ea1d1308a8a544864783459a60fb2669785ab1af8f4cb06 + +Msg = c86f2cc7ab5df5cf1a236fd83792769474cef464032800ffe98a44cf29dbfb6f24088160eb31a11a382ff2a49f3e05e983462f5304272f96c0a002b69af3d233aebe867ee63fa46666760a6889d022c18645b491f8d71b6a3b6b4ef058e280cf625198715b64b025bf0449445d3dd7e1f27153926e617bd2c96638345431d1ed +d = 2b50a6395fc02b9ac1841323de4520292f913519bc0d6a471aa28021322fc4dbcd7b802 +Qx = 696d5ac4bc40e679524e246210b7bb0f93ccfe7dc506ba87be3fd018f829c93e62ad1d8 +Qy = 65953e01d9db8fc5d64516d864a33aa14af023e601d69875ac0f7af92a1e78aff0e475d +k = 0aa25b43329de4e7739fd9134e4f4b3d68a64e55af47a2f6ccf71f518f19059b68d34cc +R = 1338a5dda5fa09667604a6a7666b0e54e6b688b98b31c25d037ddf55ee6bee7565dad09 +S = 00aec025232c16e778f90785ded5348f3d5345b8344b2a762480383777328e0a0b11cb3 + +Msg = c1328d8d2e5b6ffc850a9600bd6482518ddd9cee3fc9140febb72bcd444b0cd7e8074587d51b62cce4b3d4f34ad3355353fabe363369cf790db2df9fdac3a0ec4757e2dfb3b683eaa3e26531691ce765742e1c0bdc0e1028d347b6085fc459df0989c6a144271454eaffe413cae2ad7c8b2371fd2df1afffe56df727009765a2 +d = 24e5889722f6c35e18ca47effa9e415b1ba790066a91fb3c9f7b001ce28fc732b09bc23 +Qx = 7d4a57e6aaec6b51dce5408f6a7fbe9ba9d55f5abe2da55fcf015ca25dd74eb61c1556c +Qy = 2123390178b2992059151afb51ac652b364f562c65451eccc65d968e9e7210921c93c9c +k = 320d2a7f48cf3583e8d7e712b330d40ddbe4b6c128be5a43d72bf57d4227603762de7f0 +R = 09806a8e70742c6c4a9ee6f77fe7a36489e1fe8c442ddf9cdcfa61f019ab9b41241d949 +S = 061fda247ba7c198aa532906bc01d509088d6c2ba0f14ca3ecc5ba36f3595db1df3e64c + +Msg = 7176b7013ea27e94281977eacb976bb31c753bf80fa09680a29128a6fc15234f79f0e9900aff3217ce9be72c378042c6c34fced0158740073d1a985fa25987fb218002e425868fda5a47de51abfd04de34e2b8634cebfbdc98e80f93d94096193eaa82dc8778fc23f3765c7acdad94fdaa272df0ff0f28190c10a462ee78ac92 +d = 056d15b81f40b6378588a5efe43e21b95e18120d514bfdda0e7759a1d0766a8a35ce5ac +Qx = 306cb78fa576bdd2f43cf7b71d7e66a98b850d87ac087dd2e1ff62596a2e8d4cfff1344 +Qy = 3b1e3b12db842e00c2faef04d3e39cdb71546e4e3ecf21eacb6131c3501fa30edcc0b70 +k = 1e8969d6cad41a40d8306d2a8db3290d547106eb59f661e0d0eeb163044a92aee4483fc +R = 06786637c3bd5a95eba5ce015f151d99845255175ebb9e593d912c75cc45723612c4ed5 +S = 384471c17c45ddcf62b588993835bb913be88f7a8e46e52e211972ffb3b7768410bcb7a + +Msg = 4c3642ba040a9955b9d50dcd1c936688c17c363854358afa8ca49c6abd906dfdc4d89bb4cab0bbc363fb5b74e1f004d4b09ec9dfeed4c0bfb482a9061a1f487a3d79195ff7b65a0504bced3a28db0ebe8fcf8ab1ee4a3ae91324d15d890ac4c479144dd5538d2e36d3a587769ee9cd2d5c6f85a03362a022fe0efc4a3902b71a +d = 12fb2fb5bf5f7e42a500154823a174ba2d05af71e3b0cf47fab46e673ea1822f1563def +Qx = 2414d172d74a6281169835d18bfaae91f1f1cdfa9ed451884466e63160ecdd4a2c7906f +Qy = 2d892bb19b47a4fd9d851d3b101ba99acf6d11345596635cedd5d7557427a2896a913c9 +k = 20786f42d77195bea5761f86dbed8b452f858b447d2f3775ba2a4865d738122363b50e3 +R = 334507412368f08bd0992a5d56581ea7139e8adc88abe4bd80dfeefdc7a37a481b18609 +S = 0fd8404df06a02618cdbf6c28610d5dfac9907635d9e5f2887f11a7f18cb8b7ac95b5d5 + +Msg = e471f39c18b081362adc7da47dec254dab8d765f005ac574640d78c14222639245563912d942f3be212ee3cef134407334c8fe3602fa0e1629de5331643d76715dc1b0ffcebd484d86c5211be4b285a31688b205fa988e6c15b36daf396ccdcc209c7dde2a732f5c31c84c7ea041408ebf15e56632583af0131bd7f531b5fc45 +d = 30096c54fd480647e017f8cdbbdef292e799f054e3279d228b09816a757566a744a8266 +Qx = 2d4b28fec18cd888017fd5a27a375131bec3aa7195c0a4f255eeb3616437079e356a6cc +Qy = 27c607dcf0b068418eaa7de8da6f9707650e8d95aec571f7ec794415fc175061b451519 +k = 36880905a376faa594978713c2de1a90c8e27baee65bc60b1fa6508fab5abf843f66ecf +R = 295193f1c64181bdf749987bbc8ff2a188126131f8f932bb8ca952ffa201f109762e18a +S = 381c496b4035bba880225dcfe74fcf101103e38f9518d9427c74a5ec86ebf8f7183694e + +Msg = 8a93fe53e83075c4025228540af7e96a588520da34e3eadeb99a4ab2f3dbbb8f85fe63a3b86c1f4ec912e665ca05b43e869985eae3791b91205afb1380e16c25b74e6793fa63e4a55dcf25dc22d03f09deddeb9042b620434111afe08c5657c7d754af66ad91a1b5423301b1e8e6389a1404060d1b6a99fe0f89598482979e42 +d = 0a1b7e9c8c2dc25b494b5ef3195b294e41cd3c2c35235ab42542bd3e2a52d5826662bf9 +Qx = 6232063dbb66a56e2a92dbdfd9b3c136eade9c214d831691d9b49c56a3962d20f14b8a9 +Qy = 1b47b85bc223fde1918abf6308b74dff7f3e686af9c9d7a1855a1b77984d258c1f9aeda +k = 29b4221eebe151fe758218138535d81182c991c3b7fed93f9a6117e98c1c2f97e546937 +R = 1f8040fad671e2f32a1094413ee955ea5426bc906b8e034d87d7408e63db173b05afbfa +S = 22a353c431a9e9315ff69facfa4e15f6e6ee1be2750472823db31b49b17fc759e6b94db + +Msg = e193a8ef6f454ca1aed38bb67aca6d08280d421b196d89938c0582b7cde74dafd71716f3818940af412d4a7ff3960a8517aee108ae03576b68ee7557d35e6f1ab823d124de7243dd02b542591f62c80d822608572889573e4c9dc62f99d68e07800da6f83cb6f5e03d1f2ac15f90e38b4f25e0a75e354e4b60cc81c0bbe81d39 +d = 059b1a8fb84530bba7a607ee88310e31bc6ea6a6881603567a1081a05a3a9ff87e719ef +Qx = 0b9a71aa3cb4cff37586b1e522b0e332ad5962eec3dfeffcef3851976baadf611ae5226 +Qy = 6b1bf0b43b406b5edc6782fd391d9fb070fa3570d3cd5b2b66d7a95dbc45ccb1626172c +k = 00a77307da9845ec4572a24c9e74a17b76b6393da87a9d7b1b8456235473ff39d243ec7 +R = 36721835be490b5ffc4a42bee3c6d231417f7038c367efd9ecaf7fb3618ae8492906de0 +S = 237833bcc3e4a721e2079e579d1aaf2519c01cc238056fe0c0990dac7fe50e75eaf6f96 + +Msg = 8a99b9db191f6cabc88b430bc2293e6774d5180f019d871839289e25aec29379f14606e742190b7aa062e3b29fe0254146d9614856c5140c7315015abb98ac00da2c7e33cbcc82c24b797366f12767322c4381454d9d1eeaedb616b0ea5c66d1422da459f18081f4f966d05ce279c6ee69b1bf94b8388d38d4b770d9ed69025f +d = 30ddc2c7a4ce300cc2b75f0f977033f16c1f8bb13aae3d494c381f9a6dc8622499ae4df +Qx = 47bdfd7c77ae0c53e327c15c30d90ab1c9b670fe2241dc0ffa939fec3cf6d3c1f493f3a +Qy = 6a286aa2310a4d0468b62f3144a9da2e66d15bf86f60045824278e8986ff87a27611920 +k = 38afc3d11c66eba3441a5ea298fa593eec57b84ea29973c306ac9d46bb8d8e2f4c8b049 +R = 06c830f6c0be99fea4712f1c75f5a4e439800dcf062a16d93135c3255d3cd04bef5bc7b +S = 1eddfda0d0e02d382ae243e604f76939dc21f3ce106243b2d20aa562b78e620fb456428 + +Msg = 5c437b331831530aa94623b1736f00b986172699f0a02a5e5df0008bf25341787e2e66046f2c929dfe0058c3cb89fc5bebbe1025bb1edd1ee31522ed568e7b5b4ca3991afdc76a68cbc2c4f81863e27fdaf6a564fab2c6354e5c657de81390f8a4132669fd24a48580c716b5b7961a9c091f614d11cf45dfdaec8946a54a11d8 +d = 07899928922fbfdb5407517725edf231d15a8b62d90b7fb6d8c8d20424850dc44f797ed +Qx = 614257f54514cf37df2cd78850658a85ee362764ab8186423aa0f9a1ff486557f8f167f +Qy = 3ceae9d1370df045d20f576931ca63bdba8885f463d5c82e5edca5116ed3d2c2b0c4861 +k = 3395493478e69e6e1088166f622a4f9ec7feb998aa552b54bcf0fc67c06079f45a14993 +R = 3f31ad171dd59c9deb21851e631f223584b17f72a6807d5239ae31373512def954d5ebe +S = 28f095ae43ba5bdd899573ce6823eccd8e127c6c03cb59dff43c087ca24e1ce5504d1ed + +Msg = 91aa08567d8da4c90684dc06068f69deae240212842ff1786f04ec41b40d9187aa92c76401f9fcedced62876a34df82ad7c1e63b68bb2a972257ea8542bda6a7f1a020c9b122943b6d651abda8b8d322a8fb762eee376daa2d3637a71ed6c4f5cf96f61c0da2d6e1dda3370d80e51da2cbd8aef3267168c67359523faf910dfb +d = 2a2af63d1171930758bd3e5bfdac62cca1a83a3b55a49b3f80cf0d9ee4b2082757beac0 +Qx = 7dd6fd0868ec478e7e5c08965fa4f1efe8db4d0c04f0b6c63b5dfa397607a0d9d5ce909 +Qy = 54ff4fba9058179a2c61951fb4955cb637b01267f8f08b3aad614738c562f602d498f04 +k = 179482dddd033e8849abfd4991304137044d7433d7bf858a794340ea1cd66e736b821fb +R = 071f4cb000ca1c51c698c867a78961e6d7defbd60109f79d1d165ed045a653ddebabd10 +S = 1e2975f4a1fce0b3b0e13c3f50005fa664ee9319cf774d2e107c406d36158bcecb0e5bc + +Msg = eb5297bf408c1a55e400a20a3c10acbc5c2bc6d6ccfcc0941fb7a6fd4d2834415a6df86c3a6c4b867d1215aeb8222153da8cbbb1576c92c07ca2c36d8f243fd911f9a057e39ee25832454e28d7ed52a8d04169b9b9677a16b32d5d211b8573a8986e9bf36d7206417ad2771daa11bc21fd7ee1029b65ff7c9b2705a6dc9cf9cb +d = 35994e89e13916ad82608f74a639e6aceb756ff913aec440519946d6434af9a60a6af49 +Qx = 1f7805dfc9f90d4f8a1b241dc9d68aa41cb77b63d530cb3733cede23bb87ee5118e5bbe +Qy = 1c3f1aa3a1218de78a94ee8f88d3f787fdc68674e31792d919dbca681a6db1dabe89b61 +k = 2116684a4307c67a3d8c1014b33b928a962a8daf86c4031b0c1d47315d74bad7dab2aad +R = 33cab952e9382dc074d666f1f2ab2bd72ba394a404ce2fd02a6f7a4dc096d713827c94b +S = 33b2886738d882146c0cd715701fe4e8b94b0d28c73a6b79d2899391119ba910bcbe3be + +[B-283,SHA-256] + +Msg = f415d0adcd533dd8318b94560f86732c262ad2c6dff9dc83e2435543f429a2158cd2fbab0d96c027f71008c4895ecc644c2ceaefa80937f6cc6338d15d36e459a16bd9387a361a6d800acfd834ad5aecf442e30b70f5bfa164747cf9f89325b80976052a83a5e896c00c54f81472b14329cf23bec10a8e693005de2a506ba83d +d = 29639da33f48e4fb0d9efdf50bba550e739f0d2476385cba09d926e789191b6fb0a73ff +Qx = 770f9693777e261db9c700eb1af0b9e9d837ce5eabd8ed7864580bfb7672ced8ffca598 +Qy = 68aef01c8126889204aaca8f3ccb089596f85e2aca773634bc5775ee4d27c77f2af83e7 +k = 32a930fdb1ba2338554a252d1bf7f0169d18750a4ec4878d2968c5e735f98b9d0c25edb +R = 30cd65f1097d3fa0d05e1d6072675f1377a883b683c54b8a1f4960f90d68f3ee8c7bd98 +S = 15c61ddf43386a2b8cf557760200ac06a480797e21c92e45e6a311e1a508b03c4d9632e + +Msg = b178d86c9335b85e02178fc4551769db589ab91d823fac219c7e14e2f029753b203962389476723832f8d9631dd7764e6dd35da290afa42a794476f5c7727b3688aced848dabc9954201578cc7b25801710931f45cba1199d3788d64dc0188412e70723fb25b8ecb6718358150c4037b5b81466dac1686cb5270bb1c72d34bb1 +d = 0583a7ecbf2a975a32d07428d27ac82e5dc13d1466c4fdfc1e6a05a8d9a289f1010617d +Qx = 3775ec793ee4bff15027c70d9bb5dedfb7d2e41af8895faddddd4589cc5a00bd222b3bb +Qy = 300f7cd572d82f2f0a2d99a83977ed2034e03fdd76a0267455a524bd8199424ae5b81ca +k = 1e58b1f66c927f4ae16143856d67193d889debdac8eb03936f1b36d550c2f2639e13f8f +R = 0f897dbc8ea12f4370fcd08e8700e5e4c68dff97495f401d01b782f2ebbe259bc0dcf25 +S = 3c32424fdcca39f411663284658b8f0c1f950f0cea4354f02f4b359f18e3fefac0976e1 + +Msg = c8bfe9fa7c848531aa2762d48c153cd091100858aa0d79f994fd0e31b495ec662209a9c8761cd1d40c3d8c4262cf4dc83c4a2549a5cd477726ab6268b4b94a78b1c4a7e700812872d7f41912a723dd9abc305420ea1e1fb1fee41bf643f3a24abd6e8fbf6fde2475e290527724a6f99fd75374bf7cb01b34d3e60d8db33c4de1 +d = 0f817ab1b49131fb9bbe8c112c25a36f064efa85de7506fb9cd29d81b326bf276277f7f +Qx = 2b3a06e07fce1848494d3227ff77d1c43f4ec3c037ad73ffebfebeeae87d3bff7f7e59a +Qy = 75df52e6a34229266ff28b1c217538ae23b3912e4bae8de5cad9b57b7c1c9ca8aabb2e8 +k = 0ac57fbb899193b88fbf4ff2c502af72943b133e8d40459a833275212f6644f566f5c58 +R = 3e13307d5fc2b7ad24e9422355150578c78e1c99a6f9a24f9ca2e8bc6856936c5c4af2d +S = 05e8b77b580cdacc2660e6f8a1877d93c5983d135d63ca0e0b06aa8daedf855c9f661fa + +Msg = 9a5f563d0f9fd1f31f3a822de628ae970954f4e71292492d727109036491c29e66b9b0f2c90c26abe94c08502f5e923a9ddaf6a7d91e9541ce90d0a49f03ce4e4769753d5b7d922e1ceaac4b4cfa4262732a09550aa076b8ff9d46a50fa17de17e3b6bd606698464d116fcd5f1ae11bf45b0c48d3b738427cb47b0d1272b03cc +d = 2782af76ffebf3e2bfc0576b70e4f4bb87c762e2bb230d278ce776310a14f5b678f29af +Qx = 00dc21b3be7efaba5c7f9f22591327f0f97083d4d844415d3148d227931256d026ec9d4 +Qy = 1276f1d9e131f13bb129a1192fa24602fb508c9679ad2124e49c70a891777cd601955fe +k = 0255972b5329863f380de945574793beb0430dc416a8f2543330a125ce8d69f72dbdddf +R = 25bcb54e188aef6e362a62fd88daaacc8e697dceadc8a6b6f804ce4a36856c8da6de97b +S = 1e12e18e1e281606c16ed1f49804f8cfb33c29b0ae92c072d5c41ee3e6836cf1813d722 + +Msg = 3d6b065721da9de82cb33ec2c27107eb399b1e69ac8fa51145ed4147e20d72e27434104e76af988a3bc94f55e36677a05182fe2376dbe38195fc6a30673a4dca87336c7304f3f31d49216fbdfea00fd1e105d8b0c13ab11f8892e0045e915c17dfaab07b24ed21b06af5a8cad4f45fbee5a25bb6e87466a7bc422c0bb896440b +d = 31b827b88f14d3822244809096157df3c0aa99da90c00cd9f0b18dfe306f6881834e6b6 +Qx = 7b3ed076a2901ab2625bf05fa6db10a8c156412fd2d26741738f5eeb6a9189157526946 +Qy = 6a8cc2061352c36f264d23dc2857fbe02af34397ae5130c582e885f50f2c112f141c07f +k = 0b36f5d6da409c4a27f38ff9686cbf5f4714f4e17234fbee6e6deec97c9f0d4c585d42d +R = 356911114c9ff9ae4f3a4fcc5379c987b9d298554cdd39ce124f04707e7fd1ea25231e9 +S = 13c0a321c4c5a1e89dacddae38a9b3dda32a20627e53dcdf28ee26a550797c255eefe6c + +Msg = d125f0e2e6135567adec9e77da2afc6862e28d618416632ced829d14ee8b61116da59dfb44098a40a0b927731125617e3d2f32cfbd1546a6e758c1ab6597e75db07add52ecb61d37da2e9ed04df95b36ac249f4cbd794cb561655cbbe4b34834c497b3d392d78ed0db8db683aff0076fb6e43acba3fa2b91210cc6cf3fa594b0 +d = 27da4916f1c471cff80bfa14d12aa10270fc3b26caed010c0111f6e5a40d914a3927763 +Qx = 7d8202c88fb915446c521884fb756375a2b8d178f6a87306c1c8b67b926e830c8285c15 +Qy = 224dcebb8a7c46902532870ff855c780b2884dbce2956cd34dd6ffef8dc365b96753449 +k = 3fcb1e759418e4539f9be76354cc1914ccf9a111338890eef723431925fa132ebad8695 +R = 0d4d4f23408db58a72495aaec6dc335ce85309fedccb6ade053c23347abdc9e77a81aa1 +S = 129b6b322573dcc79704d08921cb54f31c571573da78cb09d0aab40c4036ee8f195d88a + +Msg = b380f97687ba24d617a42df1b14e5506edc4b62dfec35ed9fd886bb769832cec7f9adae10c21b7cd9152588797b4efc6b2b30a873d3f25e683ea9be070dd69731949a51121e534fabfa3a2eae0ee90a454182248bedf2595cd47ad08614177d58f7a773f5023b538f5f568682c83fb60e3fb1aa859948d01bf7b214e7f2dc719 +d = 10608eb51dc0ee97d6e488a23c582ecf0ea1df9a24db77094d87b3fb6ca98507280a934 +Qx = 399b3e571caecdfa1efb243323159a45618702600b870954cd614e494bccd70e381f68a +Qy = 2e2fc57721a500611badf48fb435a6e399cea356d281e853f55ef2cf9fc5f70dc8b3da2 +k = 0a8045b4f55115dedd8d742545f9f2bd6e5ab81cdbd318747aebfe9f74b0cbc964b6040 +R = 2d022631bb7e05d316a1b130faaca5af5eac67dd25ad609e6e2a067ff74fd4ba534db2b +S = 04595f184068433962d250394680701fbd2e2bd613a47e5de68fa1eb83cb08fb425571f + +Msg = 3f9ec57e4228e1a6ec49df02c58d756515305e48763ba1dc67298be9a1548576c28c82b4e9b3f62357d9b3c522b16d5c496a39effbdc8290edd2cadc0019e6b9fae1e61238b13b6265ad2ff413a5a0684babdb0013e7632051455e6fd943815213c555dba96cba8911e006bfddec6c3353065004538f37e48df9e339498d85c6 +d = 123f9eb8babed548df08cc3afc1d3b3bbed52b538d4654f2088fe76062fbea75b85a560 +Qx = 3b2e980ae7a847394720a9cb982fc1e41f9381b0f2e08b87fdff1bf891b9637cb22485e +Qy = 4a367d593edfaa4e17113b6b1ea3ad185b3155b1bcbd9f00f4482e509b43bf7eb67a448 +k = 2adaba166d703d4d2d431a26200acea7fb47216fd04882f91c5730a55c349770d58a452 +R = 2c83e6a7b4fd48e1ba4fda8ed7891425213764078926d8862d0eb64765ee2900b3deccd +S = 3561a949d583b7de9263d07ac427bc175b75dc52f43f3ebedf996218c94e51684ed5f9f + +Msg = bdbd7b7bf3337bd9d21a3c6db379f95408c17e49dd394e94737ceae889f45dc0ff5d48cadc53703a16b5589939506b548f8dfd34c577c084f372166cbea320c8fd07c809b211e0749ea639e68f890affa1569b66bd763c7c710989e491011371eb1d93ed9479ff0216b7f79c901a2023e2cf80b565d1c0517e73117190cd2f02 +d = 06a18e626452111922e02e31d662f4301319946a204ae8a34f06b91dd1b5b96456365e3 +Qx = 77c1fbe6a645b85fa0316ae412e8dc558c7c066d9aba900650749eb7b14a149ee57a259 +Qy = 1b2f3002ff4936653412c8ccb8a67dcae18d78dcf6dcaaa75061013d2134af2c3fa0e69 +k = 21bf4ca10d03a93d4675baa26285aaa554836bd0bab6e7fe42600ffe9137d5e304847e1 +R = 20702aa5b5cb45cbe8025b4ddda0a42a1ab746117d45382d018b2055b62791ad91abf54 +S = 12c31f9bdc096236d3ec46c4e6cdbcea47e4fba0e28d4df0fbc19e8740ce6dc0577b242 + +Msg = 436b288512ea57bc24f84fdd117da9dc1858bae8c11637f99295d88fa9d05e3c053a2584a6fe200ad190b3077d9a1608f660349dda405066c1562f6897ef69b6b674d6bc11fa470d0b96a7cf8f6e098c9ac03b0ef415aa045867ac7c11d16cee78ecf08850ccabf70f761682b561d0d0e4a889d840dc74932648ca2fb58259f7 +d = 3307fd717015b12a2dc76ada21442ac1d97519f66898b214c2ea317ab0f0905e819e4e9 +Qx = 4ff9b8d60ed177df635a3953c0f5f5c0254224bc48d34329136706d6e8fa1b16ba0916a +Qy = 2e50ef73f43ea9a5ad07c6bd68a82b7239534e195ee929aae7788c073dbe9e968c2828b +k = 14d8339f610b348f4639ac20dfe2b525517218f0c71b1908d407603b25f19971a1b5b4d +R = 2acf3dc4e3569e5038fe97920de626ddb36bf213afa0f939785dec8319eb8321234c574 +S = 01db40fa416527266a3949211fd9fec158412c447c392ed6a7c7f159a1129da864d33be + +Msg = 672faa156dc188bf16bf8933d65e091c633f294486049ce96a4a403dca28a149f4f840e8bef47412285363e9e89006614b013a41baad9885f1d9980cc897ffbd5f8a7d0e63feaeb42c07776efb307ed680ba1cebf470dd9bd8a2a9efc2b1daa569524394f9a50398add1a5bd2f7c263f9e63c2d49461acf98444fd23341ce78d +d = 14f9f412e3c7d770626e800d43cfcbba3ae6aec8563af748e8a97b67d244334b6e6d2b3 +Qx = 2293b37c84e7514564635e517bbdb9bda0b4a41217ca64c38e94a4bd00753255b4cc389 +Qy = 088c10bd909964ecfe10c373214544c6f60ab85b8f5545afb0fd2ac03d036db7ea9e67a +k = 19b21a4d73012dd2a2ec3ee280a9b855b89e6ad53438431cdb5d2cec0e5ba21300e9bd6 +R = 3baaac69d182bf1a12a024dbc9a52ba244a654716e2756c36ddf8ca634129cf9d2b23b2 +S = 13ed92730d0a6d75f2a4a56b39f82d063e1be988dc58f0ba5f553fa88b6510116005727 + +Msg = 4321334cc8ee44f1cb392a4b280a95561809dd3639ddf43b6e11cb73067597988d95b8643d86c76c3c6b932d9262b9b8b55a04fba0666dd8b8ff1e8fdf799ae3945b6e30d3af3966f1a6d634d5e012710d66cb447fc3375130968a2e1e647780aada2609d87247c90338dd71c3bcc3902311caba27d5d4ea4d73ccea960d4bfa +d = 3091a6a8bdac1e43542dce752694972e734dca31c061c7d1000754296d0748055db3f09 +Qx = 5c0761d01020a30c478617313c67008a1332a0e6f295c5a9f01b3411eef585a9dafc693 +Qy = 0eadfc6f7bb9986b0dd221b77b54287042ae8d1ae5788706b79a354fe785c66145bfe81 +k = 0afb2e2e29b26a686368b127e38c2f5726fd55a13e9f87cf00e831d3fe19d9511d07e81 +R = 2685f634a8c16ee79acf62b7a1fb3acaec0db47c6ff5f2c97a804e9550494b128b2287b +S = 12b545bd76b8d2cdfc5452291d5e4748a5e981c400daeb65c20812a65bbe936bc613219 + +Msg = 2087e22094570d39fa937f15a3ef0601709a66666344186a33b487d041793fbb9709a95af250b1df0762ea98e911aeb3ff1fa19f0aca53fd4179e454e0e91636e55cc5b17cad9e1575c82ad265dc34c4a66b7a31ecb9ef9dc756f2ac1d9dab35369a6bad4a0f47e629daab91addc6d297d1e5d81477b3966d8c3b607ed194d88 +d = 1195921b91353db9bcd00510efffe009c94f6bd8d790f5fb3e5a0101c9ca5d21c6ef2eb +Qx = 5dd8aa95e24c054d508bc5081546677b9a8e8dad40d3f8a184af7cf07cdb09ffa2e0498 +Qy = 5032f208dc3bbad6aaab63211e13e17656c750c6c2a6e3caaf55a7c30ae5ba241d8641b +k = 3223c6439db7255e89c28aeb046e906ba79f4e9b8222ba5ec201b964d3666301f74967b +R = 0fb7e194dae6420ac447e7d4f882da3c4859f53a948833a0a08f918acbe03c2e915d1eb +S = 2336f1206b46b3166b28918bdc1c817b22ab16b355030cfd635ab3dade20d2dbde08b6a + +Msg = 15c7bca449a73b03bbfa783f5a91ca0b7916889a5d99d541e2e8593c3b176a5b634ba20b34407fbd94ae1c1398f5313cab7402f3bcd7ad277a8c66d09a6df5dd086b20a0a3823fbbb80980cd86bd13e527eee15656cc977103e80113539e26695addd9eef6a1f56986168d9a53f8b5de833f8962c3826cca106ae9e8c00208d2 +d = 29dc20446e9abacb43823e12a83737b46e6e577466b5a3925e0f9d496824dadb4d4b50c +Qx = 4b3c1d41d8172ba15fc92d9586f29716821ea82274ac8e4fb3452ccca3e34925f1e736c +Qy = 23e22cec962d759bc659841f259de954911aa289e9994bd76a30149a73711bc41b29904 +k = 0931ef56f08c379d1ddce0649f45ec21eccf3dcfa178616f45b200a06f82172b91bffe1 +R = 178348d533217543af694c8d3cee8177e22740b657bc6ce6df9e57f0c1f14fc9407c440 +S = 3eb25dc4ed42495b54679653ab1cd4d61c854207994a7318026afdfd44c89cda9247388 + +Msg = d12fbb82ee7a57eaf76b63fd6bc6c0a65c85f135f019d43ff7bc295cad15d53729d904fed63d69d3ffe8b82c0ebaf0399e2717ece40e011f710b5db46aa457c23b85545953398b814816a1e7a8ab5b0b14c4a0451b0bda9d0d2ec4a374bcaae208b7fe8056bfa17d6b7ffd4ba2e9179f49b9cd781b0c06f6ce3eec26cd428cb6 +d = 3b9b77d19a42e9a555da8ab70aa5638890b2ed21daefa28ca6323fc658662dabcbfaf52 +Qx = 632fdf8ebbb755c960ebf8fa5d6b679416e488faeeb021c0782352279a7ae00eed33094 +Qy = 41aa517eff6854ba04e2de6794848823e53ca580353f2b25e45fd4efd3a369cf80fbe57 +k = 2450beeca6f1ebac3e82e3aa3239a5031f54ffe65fa6a45e2bf2ccbda448a2cf6988141 +R = 28664212774e23b6513f73a9b2da97f5eeafd10efe742e314f6913a6d0c0e3e581cc6cb +S = 025bc733edffbc1330689e7aee0dc121b64a72dff19e1d7c5990206d6daae5bae75d0b9 + +[B-283,SHA-384] + +Msg = eab0a37915c6b43b0d1e3ef92e6317b3afc8b8301b22f6059da8271fc5fe0e419ca6097daba213915855631af64e10d8382d70599d903d1535e25cbf74da3a12ba2f13c33a8562e0db03edce791f1d39af8850fd1feff0eb25f9ad0a86dfab627b96e65831bffc5f6d9693d20493bc9dd6eb3e9325dea50b055768e8aa30d49c +d = 0b9f8f3e89e9c1ef835390612bfe26d714e878c1c864f0a50190e5d2281081c5083923b +Qx = 542ea231974c079be966cf320073b0c045a2181698ae0d36a90f206ce37fa10fb905186 +Qy = 7e6eccfe1303e218b26a9f008b8b7d0c755b3c6e0892a5f572cdc16897dcf18433f9a10 +k = 31789e96e2ae53de7a7dbc3e46e9252015306d88af6bd62508554f89bb390a78fdbaf6b +R = 0fba3bd1953a9c4cf7ce37b0cd32c0f4da0396c9f347ee2dba18d636f5c3ab058907e3e +S = 15d1c9f7302731f8fcdc363ed2285be492cc03dd642335139ba71fbf962991bc7e45369 + +Msg = fdb93afd5dd1e3eaf72c7ea9a6cddb07fc2054499ffe152cb2870163eee71ace5bd420b898cb4fa80ea53fbbaece2a1eef6427b632320e9c97e38acb16b62fdbf6585b54fabf0a703307ca50f86387bed1815a05b0c8991e0743d10cdf49c8facfd7ddeb8d4a7b706b5a29e1d00ac88b0ee88b3153185495ac8388cc70104154 +d = 3a30a1c15b9ed71e102341f97c223a9b5ea3e6a335861c3cf407ef691a18cc639dbe74c +Qx = 40937b263c87461eb5d409008255d4e14c54d7a86d6e3eaf2ad9c559f7a6b9d2582542b +Qy = 7562e3a04f22ad37a1df0250215c163b45a6bd04a4b96c30fe2e2b7ded5486b172ef09d +k = 13e745c76b33e6e91f47f8423653b0056014841f4df890121655ac2044f3a6d58b9e213 +R = 22467497bf1b5d29476f24aaf5f88d905be7900406c64033913fc88601c62063a924456 +S = 19cb024c7d6be51d15337a207e66fb0e473956932faf6d755393dd5a899bf63610ff887 + +Msg = c78e35d1a5b1bbb0ec21e7ba7b7c74c859d88f3e100e40ae34128cf093885dae4e87cd09f3239dd8e79e25305220880dd352a650225d9bd193b9b84e488c458b0b5fde1af941c0c9fdf952d2fa41f665918dccae27ab7923da4710f8c27ac8ed424992568dd6f0a6c3ecead21650ed162e0292104eef3c2d8551be866a88d279 +d = 083330123cc64c11888c1fd388629d0b329a50ef31a476b909a182c930ff02d0c389b93 +Qx = 2e3a3e712676bede22893a8911ad6a683306e86487d24585bd6fe4f2657281f0bae2dc8 +Qy = 773889a95e9bd579be379fbf84dc8d26d47335253356e5b01c09eb8ed57474d6c0b0491 +k = 0d630f20623e93c274239200393cc552d03da6bb9e74f4a44a518e2642e84e761dff7a9 +R = 27b8997fb98ad04488f5dc8ae5dc88b2a3231fca76d7320550c74cc540110c0cee5d8fc +S = 1824f1050e85d527847faff236b7195965e7b93343ebac889b23425dc27226d50a5266c + +Msg = e05435f695997229cce314e50065f3c5f71981988dddccaae6efb81f936b22cb48813f506d1edf5ebd69b0be34f278592c5935f0f6db0cca1ef9d62834fbf3c4c03f4da0596cb4d67b7b767e85dde7b7c6fbef7d89babe6f97b876b33594a9e36ab87079861ee556fb03274ad4af527342a4794192b8933f28c6220f954c77de +d = 1dc2b656c207eabc9e0d6272099babca8d149c9c4258b779c2f06de75f76d77505271c0 +Qx = 2b03407b65809825a32ab50f1b556a65c3bbbd65cfcec898514637ce606182517fa1a4d +Qy = 21c97e293ec74dee17c89b962356b7bd50c7b23fcc30ec7fdd0a629d11373e28380a8c8 +k = 2d0dc9317a2af5a7d0a23c00d126b7fae4c06bda0a5c50462ba26bddf575adb091d0e50 +R = 211c396875b5dc71ba87ff2483b0ffbff60cc3656132fda7422a81964f1bfbcb5ecca23 +S = 0a0ed7bf1ca853b9b19924c706eff373b97585b692b4b535ad71cc4362073caf8f61a3f + +Msg = 0f9f36477076c4b5a7d1ceb314a397fb14646695b0803e36e98908c8a978770269f165a1fed8f4b655d4efd6ad283d7f5d51b6e1e302d360e8ebf4e887c7523a757ffd55384e114bbfc6b7a0ec8511079507b919065ca018573418f9e394854c5704227772161707b4d0246ebceb91192f0eb2ea994ce61fd98a6d14cc8246c5 +d = 0081772348ff2d7a3fd57fe703555ab2e14f5d203c4cf0292f944e827e884d95f3b1d83 +Qx = 3f7174e88ffa8bc0a770fffa4bc30a436fce331dbe7154f6e2fc0cdd09e76840f089b3f +Qy = 561e6aa3feffb2033ea716ae94b9a7402bccfed1fc4a137cb96fcdfe4685314f73a8bb5 +k = 3a8c40754ef7ddd0e289b2cdac5e06c72dc3d6ae9d0351d9295aedfd6f0e88809674bae +R = 1443b46c0e6bce31642dcf3037e25b6ba2b42daa9a83f5c0bbfb2487ce717c37b91f46b +S = 3f59d5a925fe19c795b4992c265a3c61b2452237eb34efb9aba30208ce07d1ad47e2279 + +Msg = 1d38b1c342b6611dbaf412a66c1c0b8397692755f576df33b31c2bd12b7f0707cc423376391f7b00aa4e7b7fe54532e2b39c3c5284b9c8ccce48eaf9308ed338992f1d4ecde6cbe352e46339d7d602942158387881d9b493fd40cc59d4f9b53ee4191d42352c6f7bf32c331f0c5afbd44a92901a4b713c7cf6ccddf7de4cc6e4 +d = 1eb6bf2ca1b5ffe6f6a795733eaeed12de6e87c53571e702635b9dbd0d96b47df4a005b +Qx = 0e64dbc1a08acf6ff0e820593cad79a46e3bd818ddef5ca0960fde799abacc7b840eddb +Qy = 6115d3de2bdd011ad053550471368581a5f125eb0d32090646fe4407980a42988e551aa +k = 3b28fc6d0e4a7fc449b811b78900fb9f89885f4d4f70cb5a2b3d4f8ab87bd5448f4bfd2 +R = 2601923909c8c953087b0c0acda57d8c01f814dc9722171d8409d0acd2fa4d9c1314693 +S = 3eb316cacba93bd473a4b4acae4f2b5a5b2ac9856519032e63a0c718698956e8f35673b + +Msg = 3353ad05ef90e9762bcfedd6ef44a1e8ea0392ebef30cffd48ae620f3e567e1cd44882d514e7c6759200d4bcab18afd3038c3d3f8c50f7bba32a04eee5a4b1cfb8c349939e4efe0a46fd047d02ed000d8fa1b98b0af5586f120d9ad174b3aea33905b979ece1eb3660b1e070c8821b32df41904ad68bbd8ed247aabd94066f16 +d = 3b2a3e65e5a306bf8e3955b60e856dfa9bf68c1275a678ca056207a0ec67c96eb3f8309 +Qx = 2c542cef892b06372af7d9c321ed5309995c1cbbf1a466e70bd30f3856ab7c5d18f4e3d +Qy = 2a8acdc12a7cc0b54f4dec9cf61c484a5cf86c4cf6cb5ed615479123ef1c6ecbb6c7ae4 +k = 09bb5e49188621466440a0841b007525000c2203d9821f4c6afab63ac2b97cb5e2e3dcf +R = 00a09da1c4bedff47945898f4f4ee9a0857bb56be535544aff9d729ae44e23d678fc71f +S = 2390be08ba0861b32ca35ba27a0c8dd1a4e96d28cb007133a096b52afa0126bf2a2abee + +Msg = e7ec162185fe9a5803c6b03d98041422315ccdac67e48fbd07a1ef3c5661158710abc6791bd0a75d56791b4ac0e7695d53c5989d9fa6a3b037583b2a80d2b154b024f1c36b63548be9afe1d51f2f68b2ba94d4ca1e69a35ac10e15ba72242aac20f7526b12ff9d3cde9a9bfd70d55adf9bd92c66d092d7d08e9764c84bf7f329 +d = 1fd4d1af0bb7c79ed5fea7bb45574e46534387bd916649485ef15207352d7302e81dc01 +Qx = 77057d3f93011440a78718a3cfded73e4196e7fde96e794465c51be8b679f912c10edcf +Qy = 59873441c590c43e0f00f80afad5b0166f94b62214ea45da29174874e44356b29eda6b9 +k = 3f224b35737e78ec5bc9b081a601d8fe19e33b4787449d3353d2ad225358211cf9f7f0c +R = 1a7bfe92c30ed1af478282786bdf7b5b89cd0fdba5e534bdf13899dab5af108803d73f6 +S = 2ba14810de4f5cf48b56e94bd6c439d230dfced3cb698c77627f59faff0ac5a42c43067 + +Msg = 87c8f2e3f4fdebce0ca9300fc1ebcaa934f51a12b6b8f2cb6bb6eb77965468663044afeb2a1334cb5a81e74b8427267f8b34b5e9ff0cf157a9f18be2b1942e32ca61dc23ea13c3f9fcfa16df8fe05e067938b6994982676463fb12842d4ec532cb904cf222aa805dd0d86ab9a33a83e294c6d81e8dfa273835e62e9041dc8ff6 +d = 20380b1136b5283e9b7f54b7535ebda33b129ceb177bf5d3d07b1daed5edd9fb3862530 +Qx = 5e7d0931db006c6abe04671d1aede760f2b1ac5c866570f8e5a24ed356fdab49cc5cdea +Qy = 7004920fdb0a744cc545068bf82bc5d7a46edf9265fd7c5979b9559f5421c9a98f6db89 +k = 3cfbb1204caf6011fceb8d4be987d9a41b81bcdd95b94919b220647d0e7a18feef4cd01 +R = 07096beda28c20d2e62d9b0750142d3d21b54c38c7fad1ed65e4f9b386f3dcfcc43a3c2 +S = 3d0af02aa39e329e4c39f2a1d6797f0e3d14554dedbcab9abbd158273a3c7116225abab + +Msg = 2ac53e8a50c4afe3b38904255b7cbf150c5f79dc15932dc0ac9aa631521f68a0d4b6bc5a04d55c99a36531fd4886a23a8d99f262ecd2a9feea925d7a96ebe9b6979a207b7f9378afbe404fc8e959b0333572a2c911f8743c0ba64eebc7ef12fe5435d2cb0e5091ae518b6e4233489efe3c16c6f21abf4e2c6808b733914e5a7d +d = 19f815b98836948e0a0dc9c30828c31b13e175f1e79f23d084ae1bbe64823f4866214b5 +Qx = 5109d8ce934972f5520101730d0a14b99213ea17772e3e7637d622a5de13fd2ffe3bffa +Qy = 502927e0c7baedc4bb3ed2bd1b15fd2d06dd43424393b246dd530d5d8598b56dfcb3cb7 +k = 10359d5cd8a9b7532c9902bbf1cb83d0d34bf37e73e7c0f5729b62a10bd4d8faa0f53a3 +R = 3503410a6feec71fde2feb14375d50f99ff9a2c8bef47e676bcc6c3045efa9948891ab4 +S = 159b1f65fd566ecfdc08b87e4ecf99ceea3088a750e2c3c9d868bb432de6a61f289d06f + +Msg = 0b201469cac4c078f587edecdcdb6efd5752cb4a3f43ab540463c4d908c27527aa3592f2f9acad85dd94a3c056bd28618317ebdf2e7dd6c5ad26fa3c31dd8e5c50c60418d91c93bcbb59ec1adb1db791f485ded78a5cdcddd23dd1cfa4f13443468d8a5f2d648059b9c4470d0f4fe7733d56a28a2c24456b6923703ef32cf0b8 +d = 01854e954654e726cf4bebc0e5a840e8809fd716059211c6ffeaed36829808363164684 +Qx = 7a6e7c542860e815d3fa24fbaf99989e8b9c812b08399056ae4f9a850a6711a7385b622 +Qy = 0dde6bff33891a64744dce6456600f5a6a11049906608e77f8afc38b922972c805af258 +k = 2c9cfd376903122625c7fdca50e93d4c216f0c7d07f33b3b51e54e666e13b67dc89d290 +R = 18321f9ee35d47648060213df1275ae89c2ec7d17abe8093d8a431ced23aa61d3f8df4f +S = 09e5a05a62b006a7787c97be38df6fb9fbc1433aa2241b5a788fa727229a18e07d7a8aa + +Msg = fc5e4dddf4c4a328b685035ee79069770fbebcc56c14e31afb4bbcdd5220e025f31eba794fd6c05e64f19678dab33ce4f084bc32790392f14bf35669d75b6466b4214ec30d58ca90ae285c9058f5804a1fc9d7a995958f2a0e84ee52e8a78b601bec04ab607ffc2091749cc548c6754ed14e2e5f92315bdacaa7a12823ef76bf +d = 3548f8020819588b3202f4c1ac62eaec6a47c2a19b2900c5a3cf5b4ba5804231141c647 +Qx = 38563f2482a399bf1c13f42f8b85ef64a3599c22da9688b97530718bfefdabca3ae8637 +Qy = 5c4aabf6d8a90af345008d5a244d0671cbe1afd08000c4eb37702a9bcba6dbc058ba6da +k = 32649876d776117003305f0ec9cdab5cd84bbdc747d3dad5d8d54a8fdc84d519d50df45 +R = 1f5160851981772c502088eef209f7f89a7c8ab35e630d16330bec7723e398fb37c84b1 +S = 073a7333a7037e1257d4d70be87c30bef770f9d728dd7e2615d47b399ec650aedc867c4 + +Msg = 284cad790e6207e451a6a469cee3befc3ec43e047cf91b9dff1485718aa29de36a43f7c51eacd8589f0c3a96ec18e8ccfa92941b50b2132e3612d5b45e16f60d411d1c53e373e1ba451352e28970ada9dcb9802102518a385dc571dcf6900971b00346098a58042e0d1d129bd6801fa640a895a458a45b31318fe63ebb30c6e3 +d = 3cc4505005c41142308f1489226b7b542e2e7f24f1d3089ff6b92a4b0013f490ad52e60 +Qx = 280b77ddc6648d9cc3f5557d406ea2a089c8179d4320781b2eb76ab07fcafd2535b91de +Qy = 05f23bf4171aabbf0fd50049aa017c0dae70b065964c685bc03b958cee2fc3249149d31 +k = 2ef488215648524f6caf85233736eddcd9d1d838c6a2799c3a68580492d40f9800bd119 +R = 3e8e13db22c97281307edd4037f0a75d2c70a070614e94e02c860f36a53aa738fa0db2f +S = 356f2651b51a6be0c697300a8c2641bfaa1795397eac208385c3729248e36baefc173ae + +Msg = 6d46e57abea9d115deda48b69fe8e0b36144df2f6a659509ce1b514c8cc4769d46e5f71df2a084f1db4a22fdd3ef0c2f90394f2898ce291b9f279c0664aa01419f5f6bee1fc1299871b27ecd57a5ac548f99d01871b8c238a6b46044c953b2e78e22346a0c7663af4db62799038ffb5c21ee512e26d01e70a4ed967377ab8405 +d = 144a2fc8e0aa63506e14e4307df36416f963dd9da78655832f5b991af8c3eb97df78efc +Qx = 3fe8867b560bfb21dda517b8f4d50578a11e1d0ab7ed4ab3796580d31bdf710e8e22284 +Qy = 5a302baa3795e2d132c55d90858d14d4b17aea0ab70632b135f94bb23112d163357f8ca +k = 0b5225132f19419715170f5a3f26919b4127a05b4f0406f895af1e4bba95786daf95259 +R = 0651d17b00ed9a06bfc6a913883b5cdf51bd5f2dd22307cc5ad3bb545f623516232bb6e +S = 01128d4784fc0fc050af0b97f859616d764b22f40734ba65aa15e2cf80e7bba3d15f42f + +Msg = dd750b39bd8753f4e473c4484e2b36ce2da7576813ebe05861c339ffae1d029bc793173ed394091c00685ad82f0550cb21ed1c68f0c27cb7396922239cfb886647af204e88a9101b7453a8ab662e270b87a8a13f2fe61d695597382cabeb781933bebfd7d0dcd33f77266e43e32d937f2dc89f67525e522977ce73e9ad36c8e1 +d = 24ffeaf139043ff25a395e4c560c7680c1c2155191378917eb25194136b4a69597dc277 +Qx = 0402bf61c0e36385e5fa8371a553ed8652466fdc3ed9d4a3ce1bcc567d1f451f6703dd1 +Qy = 4dbea6f67e1117116f30fe42e84383768b0da770f8a2b4cd8a4fec330a0034554a13808 +k = 3e4e78f012eaf1778c086a3bbd9e996da0ddde651236ebdb6348062f56b36f63a901561 +R = 1e2312720f6fbf44d7a6449a7f30019c38e69f2e6424d4bd1054f40798e9fe58d080b86 +S = 379d1b610a976730dfdf3300280f1c61109ad13c788e8f8f9a8d5e0130ca9482ee417da + +[B-283,SHA-512] + +Msg = 4736e59fe5812f63737eed57a570182c065538abd9fb0a1c9c2059199e7052ba57d84b5fa1cda2ad9f216610361ce1dfb9334816b6bea509283756a03aaae2e5b0597f492d078b6b015a40c9785dcc5d2ae266176980db04f5cffef40e16661a50ef871c5f531d73fd5d114fa19bae9dd2da4267a131fc31849da38c2b78d1af +d = 1d1f2e0f044a416e1087d645f60c53cb67be2efe7944b29ac832142f13d39b08ac52931 +Qx = 10b2d7b00182ee9666a6a2bf039c4358683f234ae41a9e5485fd6594e3daa880c0dfe0f +Qy = 0a419b2f40e573dc2dae4b22e6f56e842e50d631b6126153178585bd05a8b9e6e87e4c8 +k = 3e4d36b479773e7a01e57c88306404a46b6e62bf494b0966b4ed57e8a16169b9a1bbfe3 +R = 30513169c8874141cdf05a51f20273ac6b55fe12fa345609a2fede6acbeb110f98471af +S = 33fd50b214f402deed1e20bd22eba71b156305e4f5a41ab9374b481ee344ab3f27f4bcd + +Msg = e573fa7d4bf5a5601e320130de91f4ad87eb7ca6b8998488afcef69c215b0cccd221b8b66eb0af9d699af9ad6c4b4a580e82941f31e4c0a9bd83995dd076c5ac9bebb34481061e7cb1b26f6e8c6b26ee4bdf9887f7ae2eb9fad3115a21dcc96acce85d23a040c0ebbe0a56e75714dbfa803d6e279b2f4280bcb993f96ba321e1 +d = 1337362609df74d25f7adee382225e6a04dd6ee4c6b45fa31499ce9edb0ec046325caf9 +Qx = 287b288ce6f65fed9f95c99fa4b8c1aaf6de65ca563df30ac67c1066d2ba2f5a554e09c +Qy = 25567fe183dd400d256c333da92dda2e364afe84492ede9fa0e913ca7f12069b5a44b48 +k = 31b84ec438302155f2e84dd118c0d8479267f8d19c8c5d96d21177e20b23e0180dd6d33 +R = 08133e49644044bf9ba3b4c8bdc3973647d650c58fae4a7ea5a5fffabafed56e759010a +S = 1d8cc410cd04b188418b20cebc8f66ab0dc29a42f9067aa2926dbadee39abce79deb396 + +Msg = 7862864d0d78b44e2a28af44a0a16d8e9b1b8c4b794db0410c0a863ba011018ef43e1e11f2fcda2f56fdb2a69cc817df425c9cb3b458922ba00d710190cae16d61af3c304a42fbb3d0c4a74a297253fccd70aca414865b41f68b01c561be281265fa89f63f975d3101334886e85929a5a47fa8dc459b663548faf8ed7484958d +d = 1be00aa0afdfe92e24a2536594d4b41701ad4dfb223aab35ff49310bdba7566057fe8ac +Qx = 13583d8cd163fdef7c11e91f36c1d3eb2f7957d219244db883708a7c5777611b0066812 +Qy = 7a1f4df45073b838277d8da7daa7147b0f10aa98b5ec02fbbf97c89ee17f3a7ab4f3f27 +k = 26b42f369ff9b2740147914a2698cf1ec9bab44caa3b5f05957ceb9a32073729aef0fc3 +R = 37640dcfa11483b3754ea027f5f239500894dda4f4c8308f0623db256eba2113c41ae61 +S = 2096767a1f8210b175334fad61b4c7fb4e2d6c7811b5d22521af7750f101077e2fd4e44 + +Msg = e73c96d1a84cf7cc96065b3c6a45db9531cd86a397e434072a38d5eeb9a90f62bf5d20bae22b926cfe967647d2bbb5dd1f59d6d58183f2cf8d06f4ac002ead026409ca6a1f868b406c84ff8887d737f65f9664f94801b2cd1f11aec336c0dbd4ec236d1cc4fc257489dc9709dfa64eae3653ac66ab32344936c03eeb06d5852d +d = 12ad0aa248db4fbc649f503e93f86104cb705d88c58e01d3ae0099590a69aa006aa7efb +Qx = 08d262f57f9528d55cc03c10bd63ded536bee9ecc617221d9892ae1a75b7cdee175cb33 +Qy = 754e40e8823e89fe23dd2748fb74e9e93c3b33f188f80377a32bc66f6a92da1804c04cd +k = 2405a351a3bf9a6dd548e8477452c4d9d719e32762754cd807a90abddd3ad380e197137 +R = 28c5d807ea1c3ddb7f2c90f3af644c5d6a2757336ae46c2c148752a2fc150e8183cfd83 +S = 397c8c52fd67b99792229194a787518db5be8e8c291b1a30e105b00f108ce41f8ec8fa9 + +Msg = a73fb0aaec838d011110d49c5e94395ce07408917bacf7689d2cfe0948c582214b263c6b80e0a55f1e159086817605723740569eeaa1bae96b979679165c5c35ef2142525e943e595e6b4b160acd7ebe41de19775346363f779b1f80b6d5f0785b92a648028e456af8496102d19dc6526247a654bdae3368f075fa9ee92b2f4a +d = 2cfbb8f340cae8e2e2322829148981cd9e509b0c65497fd8d9da5dee9dcfd39b0f7556c +Qx = 260bb17da74429f049f3a7eb73fea9cbeb5b14ce553d7772a365376d0114ed2ef3087d0 +Qy = 5889e41bca54c09be20dd406a6e1f11f9d31d720e0c4e2e88f381ba89a97f12fa9faff0 +k = 3fd7cb455cd97f7f9cb888444f39569114589612b108657ac59178ffe31a33569c9f0bb +R = 048a10915fd3bf9ffab1cb13632359466ccc539128cd98c6273d5d8d26c64d57520394a +S = 2d0f67f9baffbb34094c5fce36f47cb73a537ff984c89e38d073678c21148056bdd6893 + +Msg = eda775984c7c9f7db47af30dab314d070fb77e9b623baa6b73e2cbda800f167b20fdc2e7219391efacf908f4ceed9b9b6bd3541b52ea087177e18c97391214758cf6455311fad336ab56cfdce57a18add8cf85b0a0bd6fa7297dbaa34bfc8585b0f06a0aae055186658c227e19cddb65de88d260f09f805c2e8854dcc524189d +d = 070e82a1f3fa6158d15b7346dd56150faee5c98c9d07c996e01a06dc9b211b12ff62d60 +Qx = 3d3ca5fe316a0820e84a8bb5d231bb14c810a87c7392d7f960e7cecacc56c337f88b0ea +Qy = 27ac0ded5633a98ec5734db9de1399c83a181d522037266d856c83e5c8047c4eff2c4e3 +k = 311b23487750c3c4b23b28424c33328c39d6f594d2a9b459a883508b985d8aca039a2b5 +R = 1465736c3c9e30e895b1544690e05108ca221cf2352ee4af1b5ee4130029a82b277b076 +S = 2819b94dca3a58cc5a96790871640fe0fae38883de6fb4712126c1c1cbfcb0c005c5af0 + +Msg = a4a13e0bfa761b9bf37fade6570d41c161e20558874911ff3bee38e5649849b159beccf321c6bc7243f99c01a2fadbab9e157e9952ca65d8ea676c74fdc976d00501c626b8465c6cf0e4fd1a7d1260aea987161b821528b0b423e62ecc5193a0a49442b0c3e4ec9c4786a3a86b199c07dd3a17033d430d2c83c100f54e0a7c31 +d = 0b471bbc5f7a07996e370da4a09e71e2119ab3a562a273f079401951fbe4df39a4493da +Qx = 333e9d5e077bc64d022e49d5d207385a19282aff1b73b307523b0f861b4ce4219308c82 +Qy = 5414e431f3b90a2d4a454d073cdd81f8b224180ac4139104166ec33ab33d079dd147ebf +k = 3e431c39ef6f4b7674a1bf414460b58998ed7aa5b1af7ddab746cbcd2ed9f42ae3827d8 +R = 151df78c0f453d396d71528032933566e176eb7f6910fa9df2e9b2f5ebb6038777ef209 +S = 08a1c4a1e21cc63fc15a78f0a11a1bc7a59a5a31f57091a12896fa670dfdc05c04053b7 + +Msg = 7ceda7a7248640f7055309ae712c19d741375d6a7e0608e07f0135bb830dc3e8863ee9e7a75331a5e1bd38c42cdd484d4f45a26c2c1d4e05ce0d0ca941f4e94ecc6b371102f31633629e9861de558bcb6407d66eb91f1062ac0e0409db68b9f2855296a7f42fc92359a7dae16c73fd2dddea52bd866a4d501aedd8fe3b3ea733 +d = 3c65cf80bfb507dff52f9bf2f93df0642020d41619b3990009409e7210fd7130ac44ffe +Qx = 3beb5b9b8785c5601093086b709c0a05955be42eca3d217e625349e5a875efa82d75ed4 +Qy = 07cd4e64475d628e6f562f0ac9c3f91075626063a52c2b621796e557799ab2f1ebf8dbb +k = 16212ce91eed7153fef806d2561912be1d988410641d5eb72d586cd4e6782deae4538a0 +R = 26ea04dded2cbeca81e75503932982c7fb5cc7d38a45a3fff8c4ed7f844dc759d8da302 +S = 061d3756e3da1c7816f0d72a8c84dd1f3b93624b631f5051c801af4e472fcf82d896c18 + +Msg = 609815edfd58c0e26a4b06dded831d2f33466a130754b96d8d7c3b4d99fd4b0789ec719bc25338d0ae8c5880560c02687d352d77c291e406eae865c3b26d00f2e63dc644ce7e01d6e96ceeac8bc1eeb257d36cbb25d89b5fff6e30b6051506a0ae54cfaf6214f30985d54cab78f708029c1fc0175bc58e888db89dea8d300abc +d = 0f4d33a9c7e6744ab3c441828bf0f1866ae1c042cc54abc754e3801263a96cbb3955dfc +Qx = 4b925b97bbe67adbb6e918acbcae0ced8dcf11d012e1a97875b750bbb7d01945bd64df3 +Qy = 4591cc9caabc0db8fe9047e6b1f8d850ac4389fe67bb84f6846b631dc3524c8dbe6a06d +k = 0483aefcad5e382351125b333dcede8ef50914b1d1f1843b075f242acba18c290c742cb +R = 1fb791c288e2cd52d3837c56b02fc99f53a6ee27ad6dd9c0a31ca08d8fa64eefccc5c87 +S = 0a041ca35422d8985c1c706dcb0b8ece64b65285bd0a934cdb41fc08223885147281869 + +Msg = 82d8ebba707b72655497320200ce719520c1ae7f46f38122958fd99322c25c9f4d4344bcb77a6658df0eece5df163412ecdca58475d56b0c2d14a0361e4cef458df146925d473a43692b15e9bbec550f1bde3444f2a5b2ecb55d2abd273ae999f16a32333529d94455e485ca4585e6b07bedbfc2bd1eb766abf0d28bdb1ae6ec +d = 3a4824bdcea6a144d85f1b194431724cc49849b6cb949b4766d641ae95477d1ec3d1464 +Qx = 2c9eb36eca01dc2fe921933f4cebe8046b3679abed80d2f8fbcf8f254bf17be3d551a56 +Qy = 34c836aa4e946425fc9f49f3f62e33d8a0afd320292a34d0ef8bde8ad79a10e3f95f2f1 +k = 23d8725af57d835018e8737fb4e8b2eed3ec5a83fda137c710fc1df875416ff82fba90a +R = 0d9f57ba8b6a9a1cbba67adfbb938211ed2d267468f79ad39ea1eca7271d135bb67c18c +S = 0f09a600d97c69ab521bd1ed6bcf0c0f69255c334e0aea06c68bba81d53e810cc553c9d + +Msg = 9c6fce18a6a96349b10c9f2f5f1505c8ab727a650b44bc0782a5f39fcb48b45fc7c1b82180d5f229b8abfc807071f931d333d265fc940c93fae7520d8d40ef59d7c6e3678c6a2ecde52b6a8827b1ffc6ed269cb9832feb20e593a7e3d4708309342875199eb2ffceba7ecd707b122516c815e83e27872eda812e3ea52ee3c4a8 +d = 27ba543ea785df1d53d4ae4c1bd0a3a994cddf0c25d2b4e8ff17ea7aa00619e858da1a5 +Qx = 7d375a9e78ccee85fd795e3fe6bc07f50af3456edda1ab00303f6de6b5b02fe09859c63 +Qy = 08d0d54ab9a239b5ff955452b32bfd2372fe095751bea4b56d52f79b4fda0fa635f57f9 +k = 00ee7010af4a517502cc5d5433d98916f6750e8a9009ea04b8132268673d4a02a3e2031 +R = 3c147b66efa47a842eb90371eeae907f0c813ca0937e488da95ff8ee16d389f3ab902ff +S = 01469d005eacd9ac84a140c93ed0aee09083a4822730a28df35058cad29267eacf03968 + +Msg = 5eac15a64c7653d125605869012b8f036804817aedacbb5a5248a595ee0c12329f91e8179c187192d3ed0d4ca2e202d8d4d9c93ad3f3ed931121c193af5b47a8a5dc39775b6c2d702708e5134f77a31bd62eaf87e39e6fd3f2b9f782c3057e162dd53b3addf92bf0ab99835c7f6649abd1c5322a1ebb2ba313df9464a74c14d3 +d = 0708d0907d14dcd5f40e2903e1e90e48a0ffaa6d4d9b84ca14df4e985c294f74eb9f2d2 +Qx = 6fb0fe1c3d5bfee5399c98518bc3ff135e0c351243fa0540717a9b1f7990eb8cf43597f +Qy = 5212fd4d6a50c08cd99ee5988103fa639b1123c878d416cc553639bdcee1f8e927bdc8f +k = 151465f40204d76f3bfc2e4052549869c19da82c678c332f536ef24567ea034358866c8 +R = 0803d3e8c876d46a9198f2f769faa76c4f66bc5ff4298b9640ccb8e67ff8d10f86342c4 +S = 00da3344354114d163d14d4c288785adbf9a8b31371c6e4420383c80ba0a430019c6acf + +Msg = df735a7e60bc267b18f313ad56bff830be5ef119baf43ce27c6368ff1dd89f010afd4f48740b11c12101c5903bfa71d6cb3d6462cf875bbd55a570ffedf3564088dfe8c8d3148231b78b5adaa6c53696737d4704daa59eab8d986fc6e519e81540f201e77b923a6a4af65d7173635b3b19b2023022186a7b8e869e1ed51717ab +d = 21fb0a6b94080da8b8299b87457dc09d21bc430ba5f3359d92aacc1151be9941739567e +Qx = 179831c55ead3d11844fea2e18d25cd4d658822e626550aef1afe37d88aadbcc9bfd666 +Qy = 75f8087d759ede340157667c1bb12be272b8318aedf2e8f8b487f4bcd12a50ca66f9281 +k = 37833e9aab843a6b967264fdb705b419ed63fbb09c12170491019acc7c21b9ee28a00ba +R = 1c9601440d109a3f4eb69a1a669bdaab9f4222a34a04ace8ae313b10bbb66811bea7d5b +S = 3d2f9ad7595dcff69b65f035ce600f2667f8499d3bd25f789d3f3c1bf83d2855f68eafc + +Msg = bb107b0eeaf175a786a61db923bc6d51dad5e922e85e57536118e032167b197b1a1f62d9bbcde04922fde781665c1094181c16ac914cf6fbbfb27bb8346b2134f05c55a8c6b9b481273758e380666d6e22c28577c29446cecc5c3df9ed9f1be060ca55ab2b7fda36a147aeb46df0275bb923e0876b703452fab42f6b7ad2ceb0 +d = 2c80151f91301fb6b0c7685bd172f20515b46bf94dbc4160d0720fbaedd40ec00084447 +Qx = 4a62b0c9749ae9ff00dc1d50d2b4a4941741abfdf13c8e416549ea27fc26b14f191f243 +Qy = 2c9cdab7c6512c322bd200167eb9657f8e8c84864b57480a80a3c6efbaa289ab8cbe4d8 +k = 3df951f8c4490fc7c2d50a72a93e0e82c5a20be8d91afd890d6846bfd146169ab58b382 +R = 1f2accc7f7c4b5f877e12cc17b227e1ba110577c9f4e1785e6dacd8491bc6017129d798 +S = 27a167e6f2b43ce9663b810ed4f8ef15029fb6f2be2ddf25c014d844953f501d1dcf6d6 + +Msg = f47e49ae30b09b7666600b7a95e81b0afa1553da5e01fd917e4ce1b58dfaddb8dc8c03c0f5591f533610deb6a7bb5faf5dd1ec4103a587a1a4c58a110a706b0f301a5c408b3d984c210d5b4a0b347d2b5447271f25b527b3c7864f7cdfa735dfded47c63b723fa0f0413c57a24ffde9a95c35f743f892ab1ed1df704cde82d9c +d = 1538abd7ce8a6028d01604b1b87db3aaf720e04220edf4d1d28c2d731aa25f509e58f2f +Qx = 3076b5c3a12b8a2e1368c7e3458458dd7ba6c5a6dda8c82cc6b30d1ef767d36e015207f +Qy = 369c7a80cf01e9f32c08f9924db08a7d0dfa5e9a8e0e29b57f5eea8506841e6e3da04f0 +k = 3f0052ba6ae6bd7a7aeb077a764d21caced6b241f63616ae4e4f0d98d2bfc0e44dca592 +R = 01281bc0bd36ba1f3e1c262d98ddf4e9bf1d80dbf97db02089fdf1d2e625abb5733ec3d +S = 076db2215d9f33054efb397c449f05db198d38a24749f046ee20032f5899dc142052e37 + + + +[B-409,SHA-224] + +Msg = f2380acb0d869d1cf2e25a6bd46ebe49d1c9270624c5507be4299fe773749596d07d10f7c2be1c0b27e86f27b4a6f8dff68cfe5c0b4c58dad1b4ebec7bd00ab195fdd635d9fa8a15acf81816868d737b8922379648ed70022b98c388ede5355e4d50e6bc9ec57737d8843fabda78054e92777c4b90466a5af35dd79e5d7a81ce +d = 0beb0df3b0e05a4b5cf67abef2b1827f5f3ada4a0e6c3f23d698f15a3176cb40e85bf741c9fbc78c9e207fa7302657527fd92fb +Qx = 1da1761981a65cb5c77ec50ebf7acc11eaf44bdd2f70242340ec26ffada7a4b5f661e13d6e7ad341cd7dd1ca491cb7a0b580be3 +Qy = 19ba11e4c4f2f5507d6bd2aa2f96b03510a03d5f8c38bcc8acd08080d9effd1f8ae5a5586603b2e112964514c831bf786b2fcb2 +k = 091e575fc79444fd2d9021bc267a1a076438d73464726bd0fe4ac2884a374e71bd462b1516b3e97c3202854bd0a286214b9e92c +R = 057ab9d5cf4d18f05eaf17d3b5a4af96c3eda8ee48acf5e02eefdfe2f542cde32a37c04f285794ddccbb14383a645db040bda81 +S = 05275de4157b32723366a0d63831e6512241e3e4416f3af02e22da8faeabbddd761160304927a71cfff4d6e8937347c9b78cd3b + +Msg = 22a97fc0a9694dabc6f274ab52eb592dbbe8beeb646ebe6cef60eff341a13017eef980aba6d24ab3afd976e2f6a84cf652654d4a54a36b2f2f62fab8858f8b0479a48fe9f47f8fd5a4a1f3141a91cbca186507b2bbfef5e4c4d2df525f04ef7c4720fb443ccad540f03a2be468d88c9545d1dad579fd7cbcd103bbebc9e9f961 +d = 0504865a30984a9b273d1bc289d734d10e0aa56e93ab14720f1a42a27d8cc932cb8804b963175de6fe57d8eafa8ab7ea0592dfa +Qx = 02de5872c40a79d5238722fcb94d5158009e28fb41ea012e92028dc3c87855fba71f50e6d0dff709867de185f9a9671e7a91e2f +Qy = 0fbf607f69609ae96982bda3f0317fe46ad1e0207030fdca702cd97fb5d5732f3abab24b10669875a64bd2a74c8603897c78d22 +k = 032d0f950d10d028db6e9115e9944e7c768e2da731df49dc9128bf145a747662de08cbe0517fca6fa185abdfcc4e3ab604e196f +R = 0e7d16daa689ddeb08074285f5293bd9f1c051ca5589e69e4b62c32af110b6f3981d9624df15c7cac0ddd62aee9c41c7b6d690b +S = 02f6bdcc551aef0e4e8da2df38288dcc29fe600de2f8b6cd8149f88146150790915148f069372151c3bdc4d719526eff252e610 + +Msg = af36c04af0e3fd64bf52dedf52fb788d2d1bd67fe05d98880cc7ad3c20436abf02f637fcec209fbf888903fdec8682717299f8a4386768153b7faeb6581db57fb9aaf4615b4ea8d924198fdd158363a1f40312527d6bd14c13d19985b668c6b88a7548104b1ff057d07082eea421f50062a315bc3866378f2d2d634f03fbc0cf +d = 0cc08a4ea5ebe32027885a8c212870e7c45b6c610117994d6a42a284c05199414a3a0e8e6645ac5c2ebf21c505a601f69c62b85 +Qx = 09d2beb607f2bab64451327e1dc67f04f7569ffc0c67b410c6db06dc04edddb1362ce8d8b8220be77c447640e7d0c676e5ad1d5 +Qy = 0ab813e800e75b6012faea43be56fe9d5a22cd46fb1f4f1ba65eab19f75f2ce9d8187e4940fddc485c42cd18d40d47415a80b02 +k = 0cfcc307f847eb696f16af32502690711ffbaa2e60e75f80cbcf7704152d5eeb9ddeb701952dd58fefb159926a83245fefa6196 +R = 068d1c646dca56393caf3239d9fb30d1dc56f991a8dfdbc0a7b69d273aec69a53056d9553e105c7917e522ffe446cbea23227c8 +S = 01db30aceed2b126cf45163b9d878a6590e9ac8284a31ccb0faeba2202679f181eaebb664b5537f408b693800f24da590082dfe + +Msg = 6bd6f52a6204b60f37929aeff28c87ef61ddeecc231e52a7772275f9329add899c130956f8c50ac2698aad3654fdb49b74a6427a62a11eca0a8ee8b719b8c0df7b9f0bb0af5fef4918a8c83367d29fddd04b6a1ecad904471e5b59c8fe3cdb06b4f8f96419518dda960845d83c49a49f1b1f2fd1d2682a9d60c25fe3ce982cf7 +d = 07156ef0a74ee1119532a2a7e8c02be1559c3c21897af9d5b34553c3d0feca4a8d5929d1945df824478e0c0b92a6fac8c84f639 +Qx = 01df419310cf133408e9bdb32fd85f8f0950263e1886f2e2e108a596e7e76153ec47bf9b33f69c1128dfbf52557f3c382de85f1 +Qy = 16a15517a811c77cc67ec4fe2bcba1290e4981880c071318aee28e30854692ed2d6bfb71e6e74fa97af750889ae8d010189733c +k = 063f127c38160e85acdd4d5dee1db1c32cd9da6075b2d2f46b010636e374e0262a0453394aaa8bbb5fe7b2dbcbcd62ad601cf51 +R = 0250cf50d52a5950999b9c0ddef219218f76dd9f22a2213def9ba98d258c2f8359d08d0efc208e23ea3614c9e27b2e4576b9c12 +S = 063479550873dea8a3ec0306ffa9252739c34c87bbac56d3d9138764347d5220bea9c27d6a308dc2ec53724d6d3ac4862d1735a + +Msg = 0eb8de25f63abc9cba16823270e9b6f3fdedf0fb90f6652a34688970932e3ae98f6d3bf0fefc5f247f72960a6975bff1f1acc2188a1775fe8974b2bb2b4c8d226ceb735113a14009e8ce66d58808fada4e6f697fd016829913352c0f659b6be354a067df00cf74919580750aa6064f21264d89dcb28b3b2d4d699115c36d1310 +d = 0a95c7abffa92e2c637611ccba66ff9d2ab121b40a85c5b71454cb0dca1f098ce1be8d9ea4933d1a91bcd270c5a33687835d6e4 +Qx = 048e6b8614c0c7156dc41884e17e36ef528a493c28c9e6275c3454d83beb939ccc74952732c18424ba21b8ea9c528966c692141 +Qy = 00ef9efe1145029d8d60d14dcf079d43e3cea0e18010f680bddc2729ffbff9a981cef2cb595a69142b25a0a39863a929adb635a +k = 0f43af45b0dd631bfe38d85979ff1612140b9cf80b4504857df17279d9d8ea12d5bcd2920fcec81326f15832df6774b9c4bf5b9 +R = 099f403ced566fde4d9755258445b6d6c2a4e234f99425aaa78ef118321f8579fb513ccbb71cc2732e31668a6a6bb0fdc7f4018 +S = 0d8568971a4f219d6d3d8bea6aecb4bf7de53886d2e6bbb0f71d054c63768c34d4d1883000019c59168fbb32f4317330084f979 + +Msg = cad58ca7a3b9967dc0ab62a43037764f8074ef9177d60bd98f623d693333971c24a575ed03cb61f4dc2e3d6285fb1204502a540f3c0bbbf23f5bbbd1544f322ce35d949d8b1d8edeb82e90927ac67ad49c91007056bf5096bd690d15ac00e1874fe33293d8003a4a2b094078cf09af799dde384143350c54a99e1f99cc31f2d1 +d = 02c438b07c6e0685d1f94a4bbafc013f8f21265d893f54e54c3ac2071606ad1ffacace0b8367aad724b1d9508c65ce52282e397 +Qx = 1fca66bdddefcc3c2072ea32f026c975a2c392dd7ed7e93e94a810e1125ec161bed698d8305830eb66fca5eeb71934ab3fd79b1 +Qy = 189c22a2c9f1fd7624f805fdf4faeeb931709d745a3feaa3cf04824f5fa58bbda144d4e96d83ce1e3282bd5fc9c50bcd68f5408 +k = 09230aa7b58505e2dc2f205b70a09cb9f4d8272f465b7380195ede0f7770af2a33f7623c310a0520e7436835cfcaf32467f154e +R = 013d0e70d8f4b1563efbd3c46feee15b88358562f769046f39df6d00477815e6b8763c023807eda87a86338c7b64214784fa2cb +S = 0662f43fabd03a0c05ebba700203fa2188e16504f8655bfd0fd090b109e68220122dff7a6cbb8bae08612e0d516e9f95ac15368 + +Msg = 281ce2643799bbfacc7d5993683a4fa656040517854f3c2dc7c4f8848dc305382e34e894d433caf12d8b493020a6a08d1fa05b08bf6c53127ad5f33bbe75b9db0615e3dd94408d028dcf3cb7598f6e7cb4c787681dabac7cba2cc06fccb7506fece6c7c1c1bf622d525ae9737085ab4ac578905950002024f30159cf0d99f50c +d = 09e8658f8f9e6cd98c0f4f0fd20d64d725653aeba339504def17f3ad12a63dc6157d80804e5f43f4ff48fc5573fde2c615ed31b +Qx = 15088531d914113a25f1598ba1d3cc611e27ea92ce8dc807fe8d446db14ef62ae2f06c293bcdd739f916cfedfc481fd941b4feb +Qy = 0a9135dc1b0384e7169fb4648973559e508319235a3f41ba174d5f58307448671cf22a3649168495c36b0bced09ac6df98f14db +k = 0d398fbed52228fe16d32a6ef539e4ee3858a1df327bec999ca25cdbc357de5a75903909973bbb0a5d0269862a74623a38da515 +R = 0e38910abb3d84b2b26ed17d2124f4787dc5612942e98521d9f94baac3d14159eeef9e09b9b20c807b479ba84640730a4ced4c8 +S = 0e370e575302ab0d8d08d5270fe89ba524b5bf21e43e70c4d335ec1525ff5696ced37f0de17e109fd833e5d179bcd4df42d7882 + +Msg = 0c061da1a16f2be130ae3b20b89745e840bee09633fb49671db28ec9a051545f57ee07e2410ae7ebc61c9af79868d3047705bfc64ac0c04ef0b286e579b650c7165443631e49e6a53c84cefa5625b1e1035a6ed89b8e839540040151132a937666524265e099272c1849f806db0fdf2be64960d5b5853965099459968e5beb32 +d = 0c4c13f65eacce85a51881caa6f82d9e48ec2ac574947d2751823a7f072d38bd9da0cdf30b6f19084a6d291052e7bbc2e1349e1 +Qx = 0af93430dd77e6016d1b076a52126a729f77e34bb3db11328d9edd56e29a7a09a7b6a54f72076fcba886ea78ab6ad81de43a821 +Qy = 1419e1bc339c03a8b4413ff009d76f9a19e201876ebbfbb3dc771b7df07bc19eb893ce23e40c679d7909c33af2bcd7d6306c0bc +k = 0889be0918e7ef34d3ed226f967301a10fc30111b3559e37f5fa5a57dd5c73ff672c5279d096c5b04c68b71d55e549d019281a5 +R = 0a4bddba9b7a402b584ceb82a54baab61e81973b7347e6dc9e3ce0f1e50dc21c9569d8ecf8a7da97c38e92e52636eb13d3b4c02 +S = 063c7291656466f7bd647073a50f410a2cd9e8c938aa1fd3b28ddc1cbdd7b78b757689dd661f5173f79896780ac3fdd4f3171ac + +Msg = 74ac2e1303297efc3ed8e624722df505df55b7f33964cc0d270604cc48b58205d8a11952232a8feb0079baa30d7d33660268b56a5a3dd90105f0703abef8f6636a99bc63bd47d9df100351bee32d8205dab0dbd2af36fd173409ff8d1fb7b24570f3c1e968458f58aea5aa2f46731ee91ffd6d3a060af6b3d5020daf1362af3e +d = 0da591461791ae7847e6d8dd8df46a63d3021644abe9520e158406c96540d8fd82ecfb1c3f6f5cfd7688c7656cc3e3dc94e586e +Qx = 1f48c95301956c62e2fd931df49953519b88ec3915c8de495dcb4ccba97bee023b1a6cd9a66dca29aeef8f4f1117eb954e47cdb +Qy = 10db6bf78cfeb92d29a922c4b05daa3cdff3917ba6978fe738296956ed141c749a938ca9f8f13f711aec930e0f1948ce7daf9f6 +k = 00576a91862cd63acc067563626977fee6f074d5726cf4f68e80d25029d4b8efe5ea845745c45e4cd42879e52854c3f385a10b1 +R = 0806435400248ec38a6d362e8b2cafc3f3bd46ba5baf538cd97683f76a733ba2b4ca85fa7d13b99f4076e7616e68d66f05ebd8b +S = 00ecae395fb324b4366f238f0df22d011bde5db6b0cf4189e3ad47101067ba87336ca47d637f09f7a40a1bc64de8c4aef7f497c + +Msg = 2afd17344552ccc577b0118caeb7dd56a0766e25f84df17c0505f9798931374b48df89a48c64e199108c36e00c0bf00a97ccde55787bb97c6765601765ab5417f3e75e35a9fe5e0f85a721d9f08440ed617afcdc200b318940a1e496040a6ad9090476b0fb4fcceee77b3fea11de09e7fb14853d1fff8ab12d66c101257e2d4f +d = 0b5eb943f0dd390b737510e2bb703a67f2dd89dc9f6dca6790bc7a260cb2d0fb8e1a81ad6009ed51010e7686d5b48233c6c1686 +Qx = 01ac00da454bc329f7c13950c848392cb4f31594fb7837f0986f61601fe244eca3db6c4f92accc2fbd1a4b8597b70e72d88b103 +Qy = 09a364065a9f67a0aa7518b75a0b4a9140787a67f852fa31342d6275c14713d484dec3116b9dbbb8af1d4945639997ded09cbc7 +k = 049176093dcde8549f95a8f1d1c87230046fd4b18a73243c3599815d4df8387a843bc8fe1fd67f3c6bbe394547e11866f41acaf +R = 09d7c4ddee55f61c5c4c2ac6efbba6164900344004976381c7b18c1de541a97cb58e14d14b6e433c4eb6d4bfe6d3e0a4e457469 +S = 0a9acf355bad544b3b120522365bcaa1e1dc6f1d3df1e30d3beb94f639e26147a81d154a684bbafac965bc39974c505fd0f811d + +Msg = 174b2b083541f8284645a810801e72631a11bd7bb805f684a7159e055afc44357f2c80df2b7853678d34a04144e0ede2327d03db6df23769ec41194a8d9d86af74d51c5bc11ea878c6a80689af71d3fdaf1c651003385332a512e03dd040c33d9c328ca89ec7ee9026bbacf30a7f3a68e0d894fb9f7100ffbc64bf17679dedd1 +d = 09cc63f32152284fca27ab2837bf1343144336a1fdf15b9727c47e877ac69ac9cf4c97b4bf42f1ab10d73de8597a554ed099efa +Qx = 044e655ad66ca9af330c33bc6d00ccbe4533a4c6a44a3f23c921b62eeec8cc1918e19956f3ed848fed93a7fd7ddea57096d1f23 +Qy = 03a71b221c85607821cd864af6f533f216b641ceae104b8e16dbfdfe7edcb2cf9ee0dc1679b696149ff42a051c51c861a3c7530 +k = 0db9bfe4c2e659006d31a7b44eb7bcd6dd23810f27c74dd587ab9af23aa5962dd18aef1e95da4ebf4aabfd558cbf72d2951bd44 +R = 0c3b91bf0794eca7faf227c4ee4085eac6d6918803242bff4da9c5dbac2e23fc32a4d4a192d7737be22810812558f820b0a2c13 +S = 03120a558c0edb58ae7ba36e886084801e7604558238c85a199af6c9e7506ea4e748791b04f3a92354a4f1407837d87faab66ad + +Msg = 758df71a952cdcffdc417b9fffdfb57582ab5c5473a8bdf0c2101953b023b77824263353dea0e2ede1f800a5757ec6ac0e1e4e3ab5a4cd85567d2d19acc6b7069a6e7368401cba2b6e642373654bec0ddd19fbf032794c15b7ef7e714e13e36875262c01e77766ed53cbcf735936dc9b33eaf2152a396349c82ca0297dbae4a5 +d = 09950355e8667bea8bbe3a2c4988436ab5394551b375e27fdc0c1a1d1b07ae957932f428f1aca0a486e54cd0b5bb0a5c5650641 +Qx = 02f623f81fb9a299b71ea8c58d5bd7d89e7be66ed8cfd7370de515eaceac90364438338a3fcf9981f1b6f0b30bc61c4b7c15791 +Qy = 16130b7c4061422d70b21251fa9c3d4e9636f5a08cea794a0fddf74ff5ab1b750cce0f2768d54fb2fb75e2851c2296b39c0ddd2 +k = 038e8c70cd35591012f45f27980095c4bcbb3bd36bec594927968d3747618c7f5810ea9e0a126e4d3e1e08185b031dbe0b37e5c +R = 0cf957d59b03aed0e48189d2b9256b5472c8a48b4911f9cec14adce5c6b4aa22d093a116364bcae01c1a739a4023da12a29c058 +S = 04cc2c22b243064758f52264ed84e757ff67c4f6596edcfe956b70f777d865d01e529f0a8a9a6e1895168780ab60950a62d2d2c + +Msg = b96d9f66b2000e9408d602096f032b112f0e05ea874229ab9daf6e05bee49b4722e4f2d8bf2eeaab9dad94438c76b7cc64dcbb59cb4e03f9ac70487a1d24d8d6b72d7462fe738a17edf381d52179b3acc0c0177c113eb4d10e8e78041deac1d56abda0ddf892edb8be956d285e7236bc6794168f8a180f622dd5f2b9e690c275 +d = 0a995493d6971c2d7e8fac3da9f8c0b5afd877cfb94924cfecc167f9d87002136ab253e3a4f9ddf5c9c99bb1dc1af0c6a3a3c4c +Qx = 0ac0e558dbca0fa6f013b7282e02717e91eb73304b4f7ac5e04f12f55824c441faebe5bb5af82189044827007bffb1e26557941 +Qy = 1178bb726242c718b416b21cdc9fd90b31ba6a8350f9b4ce3a188b1b5dffd0e8894ae6a417c4d74c920fda585624eed4c1d3f99 +k = 0d581293ab1e509baa50852bd3f21f6493cc524a2c16206e461e320c7f2c1c201b9d2a1dd4207227592a6457670a67cb72eeb58 +R = 022624cbbae5214d2c29e273c334b9ea78e10c7efff3611574d5fdf6f67a81472b606e0236aa47106097b9147fc1b56d062966e +S = 08895d107ba789d88a17c30a537402591ed788206487697a72f69285ee5eb4f03cdad6c2604e174ef4b9bb919d8b39bee6231c7 + +Msg = e7ae60ac55e6ba62a75d5328bbc15269d4638764169de0bf0df043d15f9152bed909b1fb8c7a8d8e88ac4f552c1092b62db00958a3a827f64896f6de4bbd8fa5258d6c36e3904d82d3eacf6eedba50b0242eb6b01212288448c3a9821c4fa493869c01149ff1850e8115cf9de1618cb8744626b1951d1de305745507c8b21045 +d = 070daf435cdc26ad66c3186267ad12d10f28d32d863f950cbfcf042fe9dfce553750ad098f82f7f1650c1126b3e4451bee6e11f +Qx = 19b41af3b557c274cf117d501ce7ccd04d8bff2dfc737d7efcd7888f2dda24737a6788f16b3b6cd589d3f65bd95194799d65659 +Qy = 11983077a2c371fcadbf47b10494f6ffc7ca8873b3d812c45a87c48e1b49edacc0ac37e5038cf1aba20360b74c0903c23a62331 +k = 043fb8cb87591747d12f4897dfbbc79644b87907bdefdbd7ff0f6f2e7970c7d40bb2fc08c17443d029a92487869f640607af460 +R = 05ea3493a8c04723de9de2cbd523481e3a8593ae8f010ecbd5add6db5a82d9b13ee7d24ecb417419639d0e9f4e68d14f6799829 +S = 0a9bbaded0a2894e384184e166bc06e1b2fabdc70536caeb3d0cd46b955743cfa8ac6edd03760d1b613fb445367734fa4270139 + +Msg = 666b0dc2ddffaa7ffd57ea3b2768f02d4b77c16fa007c6d1918400d195f068cae2dcaa69817e6e4c70d5b29c5598efe2d957bd12d0fafdcf5ac52dee80a2d46e77fc18cce2a49bfd787ff77b942c753974d22434742bdb494590d17c42af725b1309e54566276af3bcfbf5e174d3cf191b85903faafa1583282c97e66c5da6c4 +d = 0f8121980dfbe9ad0bf92383c7cab95fb72d5caba96e1de7772c6a179e85414802fbb86d725401451329287305570ec7fdd873a +Qx = 0c62f4e7eaf3f1bbae71734c86b8a40ed1297b9ba1151729f9363824425193e8605c2bcd6094aecc9d7ef2a41aa6b12877291cd +Qy = 1882a45555b68596dbc8bb093dbf1aab9900cf46653c58f5656f3688fbc72c5236297be2f0586a4031279b9014f2d3655adef41 +k = 0b4b5b19922bf6a34a00454374589f9c89745eb194b0352061a79401e23c0c0e1fecd7597b5a7cc1c463b76cce7ab921867de00 +R = 0f1fcb80a4fb49348fb326e808d8ed8c21c376f0713429a22bfe16d68cab0295b21d44029083769761c4fb853662d440eba4cfa +S = 0252a94a40008cc2c1a69113d8e14e989e7fe13918a2852de6930973a91784eb35e20d8ae150a88c459167f8ece998cbf6c5eb7 + +[B-409,SHA-256] + +Msg = 3e967cbc2bd936e0b6125dc5cf885735bdcd2d95b2f764de6931c4578ac8e0e87abdf96375481df67dbe1b6c43537e84ec62bfca6672cc5f3ea4125abd4a4119edffe04e42411d338e8b10abb1f1f818c50a9631a3f89feb5be5367bdcb0a8a82c96a427ba6ce99f9631d4411a2b7f5b14d32cb3901dc9d285e4cf5508940942 +d = 047682b2e3bcb5800a531858e8137692a9b1ee98ea74e929ce4c919c26ae3b3f1d4122d07fd9a70d8315fab727ccb67004187a3 +Qx = 17ffffc1d2009e844f8e625a3bf11749a8b4ea0b0fe3532d124112edddf72d518ef577f160962b88ee38b11445fdd356a26bcc5 +Qy = 0ca356fa8e90325aafb1826a694a55a80b2af52e70ad8d507d48946392da8b9fa27b8ff6927fe5130c69809d9a2c4b1d7eff309 +k = 058edc8f3665ff9166af55e69aab9d468f576bcc8f652e950082a48224b4923cb9396ed4ae06f05bcf7797352035484fdc501fe +R = 09b46600fb3b8204d4cb63ddfaad1482dd8cf8652f63c926895b8b8ebfe27295c052b3bb81dddd8687f4864f258a433010c89d0 +S = 0832f7674eea791b5f17db7cf9e2ab13253d870c6ab46ad01cdda30e78db8b8f51fd377dd55ec7786ccc92b17364a3c17ad5be4 + +Msg = ca1c90012eba4e7c5f01d8cb3814c58f48c03a16be6ed86934014365eee547070b870d1d26a872cfd28b60d9ee0a66dea223e9eaa90ee28076188d6091f26f665684f4b486af70669555db9058d485c677b2a34d4a98aa8d6f43bf6f44aff2a23c5d765e98f0438ab81be0585a5be29daece5d4116f44ce6062753a3ddc505f3 +d = 040cd1a06233ac27f3ddd108de7c6c0982793ee620d71982697713be9fd5143658929924cc88747a680779bb00da8a44e1e7d3f +Qx = 164e518a6719b1ad61a38a214ebb06dfb0553bc760799e668b1d0d098ae3f06dffd9b84c16de90db19043d72bed2601fda14b1d +Qy = 18e022ceb850eb1db59e6cf63c4a7c73bea0b70448a7dea77d5ee8a2e1a36cbc46454bacd5954792de82f3ec21ca6a509b0c7aa +k = 04a936fccec003bd9e8eb45d27c0eaedbd452e6fe99abaa62cbd0739bcf259cfb6884d1e60b82522c6146f081663f6f863576c9 +R = 0dec1635f2698d4666df2c217fbe3e644d27592c5607a5549c877257cba7bee29a8cac75a044e72d039747d0d18de1c34acf072 +S = 0138493216ffc3b8aa2e0c26f4fafaccd6609e6b15f767da7c907db64b5181bfdb447d73ede786144c70ddce7df7eff46dee4f2 + +Msg = a54c4351ebdb075d6a42a787647390f864b2bbfd8bb3d0e0ea9d767200fa344d1a9ff091bddb186acd69bcaecd767068efe4d752d185bfe63f6674279d0e7192d2077c400bbc0d5599ee28507c1253f05eae0687b965a015e1f3a292b4650106765266f5c95b77ad2d82a6a6e012f233169eb6b8d83576901cfd4a927c54d7f4 +d = 01ca6f752aae4eb7fc9c73a08d6fbd96bfde5030d759a2507bd45b6e1d1487e53abbe98fad4f41976364e0a1d830910ccf97abc +Qx = 0f6b7220bd24652572b37a0ff25e75f72d583c71c159857482ca9944b956a117a6b2ff96614898757b8a587e3c2b78d9943003d +Qy = 118fe425768bbf3a4acade281c41c745c9ac946c2f8b95d65787fb6b64deb71e6b38fd8c721e01c87efc7c2a6d8066fe3b35a0c +k = 04963aa161b5ffbe5d7e5058f0b1457ca1b9cd61d731a0470beefe5f8998904cf4594f98dcb41283f66e2b07c5c5d6a6c587826 +R = 0abf824d43d993107b552d7ded13f49ea0ae7bb845e56ad7e53cc5f9d64f99f9f250e4305ccd9f6594c92defa7f6860fab1c349 +S = 090a541f1844357f618e5ea34c0398ccbdab0cb363e266980ad304dfd675bc81c0345a4d723fbcc76ab5ed4cb0ba0af1b71bcd9 + +Msg = 6723dbddc8720feeb75e2a061b7fc49079f999fbc79ec8a8e01ab8d35b438b7049da5a23c49a58101742791f84f45d5f5cf551cd7de6926a0e2c4ffa1e378f038da597368c62df8cd8349bf046de46d02183dc05b3a3575f5f232dd2970057200e2c9cb60eaa6b4d72f8b73d4d40b98d1cc801d1a69cb5ed780a75a4064623b2 +d = 0fb9b1a9597d216028902abf743d25944258b48c9762d4589fe660396130b75f6006cacfde60f6204463cb8c18b032de1dd68d2 +Qx = 19b07f7f4ba100aa9e749bcf93a2c9955c442730c5e1f6f72c1b1d132b780d92f414a533282f7b66677c8cc8a3d5ba8b3cd3cf7 +Qy = 06ec6e9c495ccf600f8c19597e9cfdb639406b04f57a29dcd1a7a843c2c44e8321bb8508953e9c0503f77d36bdef24d5d39f85b +k = 0757f6acf74eb02b7ff3161b476dfd8349854154186c959179f11b9a15da3dface40ae6ed771096e053976866433382e640283a +R = 08fe276e7f63ce5f85fce19d1739a8a9986cd3c3fbe26fd59324efd98826f9db3b228321b3ad1d96145ca23cc02616d9e9d7aa6 +S = 016e06de8e3e0abf4a4f52bd2f827ca4c57412adcce3271fb4014069713f3723a038bf560788d8dd48430d3b30faf15ad9c0d69 + +Msg = ed53cec5e5500d62d38c829002916c657674ede4439c6f405ba672327ec677490e656bdd698f114c2ab5e6a1fc94a1a8d64466cfe9eaabd23a8b5c37f76a3c0decdef73b3e7b751cbf3b0817f4079560b5ea34cead88ba374201236bffc48eaf289bbaa4e828afa7d732473c228ad00588c9b443d65b998f21c3d7a9e9196c08 +d = 032109202d754da290c266f74f47805a06e6b5c3f721a72fc97a3bffeb8887e0c642d49a6bd034847d0a5ba09239c5dfdf0772d +Qx = 0f4dc8b94dfe0a27d4d41399005b242c3e5b14bc7cec55ff3a1561c894d73f365fa8fa2ccde1fd7bf3760b96ab2db78d2d50b03 +Qy = 13ac66e95c335b71fd1a98f101a392dd4696a806239fbdd0708acc69333febb48d4b649f14f42841d66ce03f1fb557a361c12c1 +k = 0b010ef786c13ece3a10eaff79b93ef3899aa385dcc1914e16abba90de0ca6389d664082fa727fa7c7907dc4c88bd621e6124c1 +R = 0488b8956c5999c317830206fc8b9f6760845c31bc4ba77584925dfe25c05a1e7d298a62e9748c7278eba622713df59accdd78c +S = 082701053ddfaa376c99cc42ad4587d84a358d9d8a9533888cc382623114aef51170de77ecf64af02e09bee203851abb22f5d11 + +Msg = 13829401bd41e9fe01329e9f5a002f90f1a6ecbf25fc63e7c1345f265ff02e496230f706c6ab377ea52d8707b54f8fc5c7f089044e2bec1dfc66a07da76ee12fb9ea0697d87706b0ebf677600bd2fe117f6cdefb8bd636a1b6b97549ee78f992c24acdf3a946053f06fd012a9c703efb8bd929a66aa74b05d61bff0395232b00 +d = 080536e820fac59b3203aea928475043b2576446619001647e35693a9e65d15236c3cbc12e1bbe0eb305973535c882b70197a92 +Qx = 16d7448c0afe992f8c59b19d6cec64d8fc5b10026a806760bbdbbf0012063f46d31e521a34771f826669c4d1ddd58d3aa13ebc9 +Qy = 1a3742a6f231546f0704345b9b83c72d5036522449cf60c1b3bdfa4c8d36e499d4ce62e6e7bb05c6132bed1ae44eed17414d2da +k = 042753a515e607cf9992dd1f249820dafe53993b59b1e57d8f2f9100f609cc15713d27f5dff4007e078d6da1061ddd36c169c21 +R = 07eeb1cc19ac45f52c0b63ff8ecf4f4f35958e86cc3e3a071a35446d490a426b48b6c287027b003488573a4834a06dad48520c3 +S = 01410d85f3f2adf065b60a126170c43e34e0883338118cd33b0b3eafea1d142480b236ce49d35fefd1ce4ad3d25e0cc9268b1d2 + +Msg = e696acdfcc96a6c088069b7595ea9516a36d8fe04dedeb789fbd965db0cc64b7017a821015f6210b6989e515def5a9605fec0d337e4ac59f3101a505168bf72ab6d98ec62a71d2f94071fc05b95e98d4efc59fedc138e3e49c5d0b44d1f48f7b1e7c1944ee189b242950d2bc804d31c7eeb45283c84638f043ab9533976433a4 +d = 0b05e5f0dad9583ea18fb8fc4d8c75fd2e3cf9e92cdd9b737485c953620d345006c31c288b380258b6500b84f729ce6730e5303 +Qx = 157c083ad9789966905c212dcfd7c049a8ba3863fd4886e4b118b3f06445fb0d4745c2a8a1193dc68915722089d0d382253b675 +Qy = 0867e8efb575800f834c978ee2ecf0f84f72e75dbbac86926b73fab8b47f38eee17a63baa02e3edb9d4f6b2fd2afc88b6de36bb +k = 0c72eb08acb1d422999ee8d51f9ddef9f897dccfafd886998edd3ddf30a638dbd0ed59d68885ce242fb838f022bccd4f3b5f854 +R = 01f4dddcacb088f6e24d331e8b111e390735a41e1fc29da8f5ffdbf7342f4b9056786f2a67159d1e57570bd69d69235ec562416 +S = 0809840df1ef8fce9b2edf8f970c07bdb5fb755e9d5bacd7996275c4f890173142c39299ce9eeb51d21a32acfc7761d5a2cd7ef + +Msg = 4058b9a8cc15ac148909eb97fa32aafbb6077b168dde91a411dbc973df7db056dc57ff78f0abcb70f70f800bd752197d681f44df4a7817c0e7f60f8f65489ecb6167c14b525e91fd2cc5d8b80ba380a83d031d5827c8b1262c687c90ef0e62723d9b565557f9f6fed0db48f3799274c2cd60a14303406c35802cba6261121296 +d = 0be1d277813e79051ca1611c783d66003ef759b9e104f32298017fb97667b94dcee1ce807dc6b4d62416e65d4120523bf6a4edc +Qx = 1fed0171b5b3c6d9092a6592944680a08a0d4f99f08a3ad1c22b5bbf11c0e4ab3cdae9526b0ca2b1bbd961362faccd5caeb1d37 +Qy = 1ae7d57db848e5c86c31f542f1995c76e916dea9aba882865febca630bc6a10ceb6732bd5f07f51bf2f37ecae7b7fbbca618ae0 +k = 09e3585213c6d6706524e3c8e753a2eb0edced626498eacd842d44a73c602d801a079f94b781ae1ac5d44209e8e3c729ed4e820 +R = 01098d98cf83c705515494cdef8c3f50ea8316d95b3ca5f9a1296f09021de57930184ee4b9f563aebf5fd0d5abc0885cd24c0f2 +S = 0d9706f4474a8fb0c701505516699025fde546a21a3fe519a173a3ac01f683d40b4db2642330bcdfe188693b15a476cd9339ae7 + +Msg = e793237d46e265ab84ba9929b196405faa3b0e4686e8693567e53f68e6991e57677974677682a2510c4c35b1968a90b32c4941af7813775c061c008a60f9f671cf7419c94253d6106b61e65034497f2d273a5058379bd986e3d917f708f0a2bebdba150f6d78a3af9c722a2430ab0f4bad602e91e18aaf258e3785fee78e4502 +d = 073c807bd7e07379782ab790720de4ae5106f16d34e80ed70da5b1594e660c9b775db94066b93e74f855f57d88b6ecc6228aace +Qx = 0301526b630ac3fca5085f633deadec27af353233e6f241772c7fdbfa42e47a04b0d3ae38c04eef2109390a71fa9fda652343cf +Qy = 137eacd97a8449ce83f19a13a248af52e512cfab3e2ce1ceb789874cb08757dd9e47ac21b5c0846498d8d7cd90122c437602d52 +k = 09245ba1873114ee2a3e642c5b15049a3566a2f003cb3d25250028655fba98203feef5f307a9f4c77f232976d83723f2621eaa6 +R = 0c8136d4b998ca0544ca1430abf55601f259aac7756c75d1371de63d1471053c789833c5cc257e323a71f80e21783df4efa169a +S = 0e2ecc6f0a418bee5de7c2418c4ad85d981b18048f94865821de696488ee19291912ae7da1cf5fe9708e2beb18e6cad4e3f7849 + +Msg = ffb8bc80e7619a562d8506eba7658bef0c25ace3dc1d01bdc2ef00933d4fa07b80364e5e5826074edd46a707dbc3b0ab19eec7ea8990839d7fc0a80b70661204c52bcbef57c1a7bdc861c10766033a82dafbead283d911a9502d5f9ef0a39d35ef26f3616212d4bafcd413ffd18b424fe09b48ba02ca5d97ec996205cd49d22e +d = 0a68379b2296a6c944ad5dacb593b302d8ef0b05873ce12bbc371d705f308c739d21f343349524aa72f05341e64f7435daef112 +Qx = 07fa0f698535b011833dac1ac96f3739ecf0c29f7fc1f8bd635f4f98daa70a39310611ef51b2fdc8b37eee3573dc34cd2528d39 +Qy = 0be1a9dc30dabee3403da4f2dac6622e6fb8496e72f3f17c169e7b554efd84ac655e727ae9520feaecc752601d5391270cf0cfc +k = 0630547017103c3f97de48ab6b942db94b2db9ed7dab0391ea9e71c1b788c547abc90088de5b3e36c9ee4280bb454c7c3710999 +R = 0916aac91ad329d6f330cb051941c781b9e59bfbfe45c4d4f6ce0d1aca982e1c612952bcea06784c57c121b14cc0dcca783d0c2 +S = 06a83d93f9bb81c61ac290906d74e2d3b964c39b4e96370f19cfb4a55a3f7901bca3deef4bb79ca6a798fb9b3a9b0137c5a9324 + +Msg = 946bde90a5b903dd281a51d7fa93d80f3fed07eaf50c18fe9fac5acf67326bb18effa3144e25c151efc006a50a274ec6c6a5d573051c4e2d117ceb0fa125acad07a10fb6534a8e5f5b3da2a1136779c51377bf76c3a4a93c0c6158f729f2293e414fcb952c9509f228c804f0adc1daa327a8991d48ccf4f3957c5f8ccbe3ad4a +d = 026046bbb269ddb1ec14ade56175482343a21b7c265026cef3c7d6a1ae0f6a68166b9e6c49a6e733ad2ad64df7137ef230038fb +Qx = 0d09d8118519f9d00df7514d2ff99483473f680b750604580b61017513870a3cf1c403495cba488309e2c084079d53139a36953 +Qy = 0d25e41038c18e4ba6f4e9d14f210b71f27b8ef2c1d4cdd5f63edf8fe11d548d070177e9ddae382fed2b163ff2b58546f10a99a +k = 0d6b0e5d83155a035248ccea95feb0b4d1af818e5ac6d5f41f1a255dd8b482a94de0f4e037b10339d1805dbb6b22af6ba834219 +R = 08059524790304a37f2a0d57bb2b93cec79a827b1fdc9ce2d7dfd4d277e0f71844d335314a30bbec5598a399e197a852b5528dd +S = 0e7870e2a0ed16cf340a04fed4d2048e4e231cb8918345e1852bcd3e30413a2219864851121a34fc98dd99976e2b20cf1d1bf2e + +Msg = 07f3fe1369ebfcbcacd66675bd4ab22edbbff72e68709cb57d4f590e49440f01691f490c58b5117bd24aa2fe2101b59c61c417c918ea08ea34bbb9b8aa17491ae5d9329affe894f42d7586017877fae3ce35bb80c97f92a004380374ec91e151995166e14ac00505fd1fa810cf02981bacbcebf5f81b2e633d3a3db6737890f4 +d = 0bbcda66978ea526f7bd867c3303b625f11b94dd9ee6e2c2f8688ff07f2bba83c662949d47ad47fa882cb7d203a7f0ef5dbc52a +Qx = 04cf5bc624553e833ffbee05ab863e5def062e0d57c28e71d758d6ffd3839504d7ed9d3b1a040bdce8e187ae0b4ca23aa565b01 +Qy = 0fc1a15b4f273737eb92a56928395f6518e05bf946afb65ebca3787f7f8bb3d946dfd26c4831cfd171b4c66c2237409ebf224d9 +k = 0a2cd205d957a20c79699e91684cd22746c476a79245f11e7cdf7e6b74f07cf2fd9eea65eda97e8994aaf51942e15695545abc3 +R = 0aa1da120fc19523e8162e6018e4ee053eb680ebc7e31d00db34f7b177c74c5e6ea344bba3c39ab7ebcd92996a1c156180b7dc9 +S = 071aa4588741208344b323642fe03f1cea73865ba645169df9c84bdbf7488829b83b8da172f1927de1c8cc318ede545c748c782 + +Msg = 3a1cb13438e3bac9ad4ab1d319e90e2c9f118dcf1eb54d6333c674a665d41451f93cd4a9334cd057a44c010edb668254517a63700a31eb0ca474c84873e486f2f8e158a1a7735362ea0cff8ef17d959ffd851b21a91412709b3c729474d2cb40f6ca0e397030eb2611b402916e4b656f0fd868247d80be3ce33d52054b7661f0 +d = 09be3dd3442e0330750f0a6252bf9cb317f32f942ae516a4038dea2c40ca6484fb33611bef016cc64baf166c122e87c15466fd8 +Qx = 0f05a6fdbe6f80c0f5ef3322d8accda4b9ae28c91b6198b888be713afa5e652e907e5ca9aff5fe77b6546115b4c732bbd4010fd +Qy = 00923d07aeb8c947688e7d3dcb16ca69440e2a89539a41b8fbb797523d3b766b46d257b87472f5084992422cebdc4e45556f5e4 +k = 094fe051a13ea8dbc89c4cc5511881a48ef5554de265f0badf8741ae5027eef25c617bb6a3f454a992fc68f5a548903809de09f +R = 0162687730f0ab2f57e348476d1fa4eaf13199ee44f44dad5807bbea4e5ba79e92556f287cacbbf1fdec9a8b78f37e78e52dc1c +S = 01acc734e2d0c81a56ee8c0465661c365edae56228ca43184ea1d7503da3d38e7607b1590f59f5190e5c7264cd0d7a39be71069 + +Msg = e58e7b881a563d54772125b2863718690a5276c93d9e1c5feabbdb5d6f7c7293ff0f89805b53663bb417fdd46874b8e6a466e7e3ff6737930a0662af1d5879b071b0dc4d014778dff26a2eca5992e763bf4c4698c382ac947215aa116515876008a56e5bf547857049c38a2d3737ed3393705fd346897c3beb80caab88e5b8cf +d = 0ed321fa283c662e87eaab99b7715e6cdc9b42e14fa5bbe2c56fdfb381369191a42da7e574839f90a85577485f19446fccaf6cd +Qx = 1bbb34e6bfb1c1335c48e8b44cddd8a46486fad4313581df216002b382db1d58adcae74af0d38445cac2f6cd9e2b439d106f595 +Qy = 084473a5da9f910b4807ec5ff450be353a187af6ace821b18e096c47752b6336dbedfc4b481e356e689fd9c03ffcdbf3e4ea39f +k = 06ae69e55ac1f7b0f844f5ee0b583e652e0e5bbfa4eae85c59eea1485148e34f4d33c9ddd7ac071a28ac0a6191d5ed03e88bb86 +R = 0c3509b6c0356e4a30a82fa7411d1fe17ed190b7eebf9310c44fd568494c894a4f4a1a09e58a4d030d47227e54f7220f3f79f4d +S = 0d44ccff47d9fe82627393c03f882d4b98633961a897381ce8b2cd18f38d69742802d18e6c988a23eb425b294f2c1b84cf42cd1 + +Msg = 8889ea1da1cbed98963941f6ac24f47253ff6af52de920765214f2024aeb04f7ad46936830a8eb04d95aba64ed7cda6ef242f454b67bc2de38a46b6524bd5c96739c4b580e89829a61a8249ec8dc27a50f43b8554cfb6f4fa4ca6875983d4b60a1c6b49f32ddff6fac0cafb64d55c6f594b195c207a9bd920dcf20e0080920bf +d = 0396b805073f3c3b552b1024dcf35559ac44f255b688871a3c6657f727a4b09f3806cbb75d26a00ae1728be632387e804775a8c +Qx = 09957f897a17241eec5b8415ed7ec1bde5df11583255e0a8136d076d72ef377ab3f553d6f56c054332a24098aed6d12878abbd3 +Qy = 1f58eee295765e8a55e388e235e833bc5cdc5d51a1d98e13429bcb7891b25487b7fd8ed804b1856cb6071cc28756bf00924bf1e +k = 021959970a6ad070d1ac518493e309289f3d9d6e2a8933bca715f53cee4ab9000ba2d0147282495e15e63f258dca87a5db7eaca +R = 0d1ca34413341c115f780e647519547602e0361ed4d70402f42d735353696eac6e4024ed2eacf9577252d40c27297e9389d1f7e +S = 08cd5bd43794b32d5bd2ccf7ae4deafffa0e0deb92b1eef9d3ef807d456e459f92e9f10627b7e7574ebe3c2faa858bd3e62e187 + +[B-409,SHA-384] + +Msg = 55053af9370901e38622734a5bc5589f6a20e258627f381fb0c366f3dbe58394e5997e978eb7ebbc530f6e6186f48294149b8594fb551c31c50521a8c4d67e5862921695604afb23977b6a69b21abe75966fdd11bfbdb6b51ab0a474c5fa07c4de7872a3bd81acc417655090558dfcd5af449b3347e61fa9e839bb9457de64c1 +d = 0a8fe323f6736bcabe971c7d964e75dece70cb54561da48a11c40027ebddb23e41c7b48600f569500fe8ea2abebdf480171dde4 +Qx = 020f2dfee967949643b6cb8a3810524044a4b873a4984e9795e4dd7976536a2d748b8cc636ef5c8fc92aba5677c4a0951a33327 +Qy = 0956ec5433d73162c9683558f0dfe8870cfe66575f2c34c765372c7c3bc3b291e95c4e3665e4ec5e72131975f0b1f5f30b0c844 +k = 013f26e13d43ba05e01f92457374fe2ad1ccf94ebf22334447f9360f7f9748bf3665ec3058ff6184fbfdbf7de9e1e2131cd3991 +R = 013c4c290cf89789bd6dc523deffa20c94e92e88a76eebe88457e30cddb066c7a43aadeb0493b264cdae67532db7dadf879d991 +S = 043bb7a8db3d79938beedcd6ce02f375e26ce807a2afd4fc446f372fb09a69fb34734df5dc8f6393f86577a8d29014494379624 + +Msg = c4264330534a6c2bbd8a3b757e0912558302ce302f835ad8c5474993832fd30036fdef40b10ee37293e871db5b0b149654f9e543e22111f9709ef45732125f713c031ccfbc9a2f3aba160c241d27be4dab87ab2fa9a795752ab2daf20f9d06a98d90d01c07133adfe83cb11d5176525e1bba6a9ba70ea48b224d46ddd8103f65 +d = 0105938ba9f25034da3e032dee121bdb192ac2128b50a2ed4bca042e96cfaf4660c9d35f3e67bafd4c99f9447e6dc408e0c4471 +Qx = 0f1a9243920d7cc26741eb828bb55e34c140b0e52837792ed6274a9aa6b5534cdc5c596a1141a746dee380c0d9c2f77094c36ef +Qy = 1393ed8c609751550ffd077347712f3b27a869cfb1b532c5b19c381365ae5dc8fbffcb2182777a17690616d71c66524017d861b +k = 0fc52aa8c590aa28c5353568c9dc69734adfae840f1e0642b57863dc7f4faa37bf3ca789a3d7afb32c57f66a61780e253f50af4 +R = 0c45b1629bbf3273c0e785a28cb8187ef387502ac4438a3372a5c72206a15d7c5ecf9203ecfd7e0ac910b6ceee3be50c6664f81 +S = 0a0c2d31a47ad5f9dc2d42dc36714cdce47666f6e2f05ce0e7136f166647540d1e5fbdc7c9fa0def8962f44f2f8bc9addc10057 + +Msg = 3236f1ad164e1b25d828f5202e3513c80c72a577aa9af56f041fd96cf5a3363f4b827723b1511a2f16360e32eac90ac55f4ee1146791420ef9e2af333c17d157b00e43992ef6f2be2d2f211361e468413dd93fb69232f0a0d110bc5fff361c0410344aa0636bf809062c73a7ac7c142063912b6ad7e1626fd2a384f35faffaad +d = 0ce11677ca818537dbaeb880fc967dc8bead203a2538a55e756679c4a9e7975b9b3e6aba4e6c6eab4152d0c0939027e9b0bd92a +Qx = 023c78eda396efa28c92b120c4ca1e19dc6c467234f9f73701d8966bd0826c20122af5f7c9ad5a5b855b6dc517c22131fb0b5af +Qy = 1ea47619f91ed4a010dd49ece7ec78c5e98297220b4c239ff4a8c29aaec008011acbf7e4f985c02311ca703bf4ce4ba43412ecd +k = 0dae763fced0e498e3efa1c6c412a25774c9bd6cd4bce25ab0a7266705cdd54040ec55bd7e6708e71b09ffe9c19af9a1ed9c878 +R = 0a70694fe5da7646184b23b4b434bca1b754257b8e7fa9994dce4a7a92b7ec8c7f8cc69f18d17915c6bbca24f6621f9563f7c35 +S = 009e6ba97ac2be8537afe7f8f8b9cde8841323b5cc63cf2ed46a7913096ff8d96040296a1bf9aad691b60e1f18233964a421fe1 + +Msg = 6c400ed098d8369dab6fde3553afbbd4d47836d0d12dd16015f15cb8d067a39391c85ca4e78c62b8b72c1592349ff8dc52db8ccb7fd80c085fae456dba6f4a2378e184dd59238c92cf04e40d43a66b342d2a1325a0bab12b1ac857f0564c27b35e6abed02ff5bbbdc3770ddbb2ee0513df48bcba925da6d61583076cd3129603 +d = 05a239ae0f40d76d8d3589f1662b5ca12176a4b2784faa8339b54e96a1e1294433a4d83bf904196f939bd8b33bdb4be340ec703 +Qx = 09d03b7985647027a17c06b30ce9fa1b43d0484195f584fc347f7003802613b524cb5641db3425ab4b3839e12c012853ea83843 +Qy = 0818f5e270baf5a771627b098a6f9ad8a8262e331c299fa0722a0df6ca09bdb9c92d22d72a73567cd5497d06639aa47349df207 +k = 0c22251c73998a3a49b3fc65acf01438941a8885d1c5072a5d41d779af70c044153fed4080151b524af402a4e8ede4448b717d4 +R = 02d3a7ebe5de23e0e601c6e41616bf2a9a7fb6193fef8e3f0a7fb8128a925f7bec3833669d1a304652b7bb1af5186b2f612da1e +S = 0b7bb17155068a8d9b3412d04d407556ee133e1a704ec5da87ed19dfde60517501af345e2e744d35d844f8ac8ad08b13b17c498 + +Msg = 039a149eaef2de30b0ae457b376ce6fbf88afd4cfdec02d3c5e00400d3b0484c1cd6ba74db5de65d6f2fe39871349b30fdf1ef29bcbb9e182eb3ec5629d07d98354a5dfa82d7f0db3dd10d1510c0dce086848a198893ca5ad24a663494f0596b4eee86199ea85e7e8f2f76e7a6bd4a052c54287f61b391f1e52f96b606151c34 +d = 0077390c62ac41aca995640fde0c79c76f4ea8a8dbb22323ed812bee837ab8798c5d0ba976c7aa634d4b1c2c155de2709e7352c +Qx = 1a9357770270c528f2af991c447bed86194d458f693a871ca38f271a9e6a566f5b9ba3ef3d2f9bde959e42934c95867b280e9d1 +Qy = 01f3a0516fed36d3622fae3f44d87c4bc67cee0a995cea242e530451d43781f2ebd163f6f521497fd7a1a6c7b93d33b77083a5c +k = 02555cc113c8516d741b47ca41f53ed07d509845f140dfe7dffbd01a3f751ea9f22e12c939a2ecb1827c0e56b1b1c5459b66aa2 +R = 0e88333875a507520d0b62b35146e37e7ce4e2f2478a61adfcbc6e1aa9fd0195a4960c633d9d6aa9a79323b7ee00ab802768436 +S = 094595255e8862d14980893c095608113737f42b05b561771f56ac1d54eb521bcefeb3928917c07c1bae74cb9aa80dbd34962d0 + +Msg = 08617d04fffd6644c40f7dd57919f7dcf3c888f4147535d12ca658302305bb8e220bb17ccdc480254004b9035b357120580882ef86aa5a061b2850100285b7d61588a664dd4f5394f5478e68a80f610c9204d056009c1c9e902161eda33ef61aa902e96b6f094a9f053135692182943d38b9763055a38739a2a2d133c5dbee89 +d = 08bf23b09fbbed1b55769907aafb97f4759cec98649b2c9da5157517d4f85bb70157076b5e4aaa7a940af042302f8be06a84ab6 +Qx = 0883c31c474333f74ab2b86f3eac865c4b2b54975ce19c5cfd23682d041ef3deaa43c9f9e2c194ccd3add6677de31fc9e07dfad +Qy = 0a5a36b54f4eea6b300491ca22054280b3f09b202b2a6b55df9e3271c763b6d8360a330c16f936d69fa463bc0c4071707c9cf95 +k = 0812c83aa9dc4139f8c3f7c55509f9e10e6cceed30e16afc028b1904b4d260ed0e77acc26e711a7a8e24c75fd780ed893c0bbca +R = 0fce07c6f791a05de29609b59d55b7062e82fb554341b2b2a8187baecb9c95b01ca5dbf8ac88c60babe10af2edf5985b35e10db +S = 02bd026a3e45ac439647a483261107829411c1b4a9ab603c080b92f605cf742754b654981460cf7aa72b5186b59d224dd015314 + +Msg = 34c959f549a307f21b850ae105f41299b8bc94fc292aefc61aefbe0a1bf57576ba8d9b80caac635e4edeb22530163fa9629665fcd43959f68eee32482f1845a78ed7278e6e43d09ed6fedf465001afc0d61f1d2e1d747623e82a762576b879c7024e34f43104593cdd691d53bccaeb8f212dc29bec6bc94cf69d0a8491db124a +d = 0082ad05d19b8e16f80e53a4cccf6869ab5128c5e622ed146fa8555985ccd2aa3b9957dd374586115d4d75b1c01cf98ecfc3646 +Qx = 04428d05366b0a46e6578fc7528d185a3f85da06c4179e9c9055dc0a7fb4afbc53c94954f268e36d2ba8731882bdd27d9684c81 +Qy = 136ba6048ec672601987e9b7402fea24f88c1a94717ed5a83794add0f31680592d6cafdec147dfbc400e73a6ba1d23d4cb0d707 +k = 0c00c897edea7bbfe1913e3da303d64d0d657a83c1eac9c111722b17c65391f2cf67b78219e748ceb269d6c65f01e92e6952979 +R = 0624c5bcfd8e0ef22ee6b34a8b26bc051912cabac102cbf56c364a743e8150195fc55a3fec90a8fabed5eacc1799b565745bfd1 +S = 0cddd4937da8176ddf0de7f52a4babb1f6fccf861533f796a487f35d060ad9ed4435e5a67166782b53c20bc06fd1b36c265c1b0 + +Msg = 514f4de08a6f49edbb6797c9dad6d33bfa367cc1a1b58a5becfe646c7f3352d5c5d95f7456e7112c4ddc746b9076b9756ae3916c07bbe6d3823895774a42d25d44b3309d18bfe7e3ccb1f85dacfec1654778c19e2981a853c1f40a7eafd16d331093110698c957fe9f1d86582706a6885543248b944bb70cdf9d2ea89190cb02 +d = 0af7e581aa4f9be5815f0c447e39de00da9194eee5e5f609668b9b69930b5b48a948614c2250260d1917f0ebcb00ebda4bb52f8 +Qx = 044703e0b49437315a64e397085ea2ba3f2e2c383b168f31a922e5916d590344906bd2a911074b7481aae7f3f8f4807b110f2e1 +Qy = 05a13607a3bb89a2a88e27d5eb5cac4eb498d34e6ea861c80271ed0c73e1fa893adce0c1982b8a8af6a0249796e5276d369c3f7 +k = 08e7fcadc844456f14ce9354b218d519d86c0c5211d62904c937d6fbe8cb16264d7d41d98a15e9f73a636ac3739770738d6b46d +R = 07aebfd1681bd5a2f995ad4a709e8681da742649c0530684fac251494263e98d67247e1e4fc174b409e7e24a7b055500920cc82 +S = 07b83b9b5133aec165316021472307b8b481e6381754a9d0b4f9d683c2ee7cac94ed4d8a72cef61fa1f6349b6c4a54ec38975cf + +Msg = 4e5d16cb1dcaa1abab1e371e1de02f31ef4e0944dfe1fdec45ab64326435b2af9aaf1a6ed8fdf1a6ab1182bb53a844c7cfd66da30aec0d41757f5988ada0017c4ca752597a9fd3637668bc1a92bb1556553f28d66805bb47f1ef91908ce098d452872da9800e77e1fbd43ffb0ed6fe6a62185d4be73ae96c9241b82cefb2da22 +d = 06d14107b08354e6a41d7d7d50c004419db8bdc50db43428df5e86084551237223c498bce71a17e25695bc438c5c09e009c60e2 +Qx = 088c1517355cd417a698b648508fd07a457ac13a49d1bad17dbfbc9735ee58343316e3eca570bca130c753e17a69fe5bd7baff3 +Qy = 1397a697d2113d94daefe6be491ed3edce9449c707a57af3a164d172cafece564d686fe0d25725c2919c60889af4d0354b05117 +k = 0f3bb2dd9eece25c56159f501af8b619a8c279d7ecbc08ee2af6b82ead80375e9c07227b73a10918d8c89d1a2b12cb76427a7b4 +R = 0407b224d8d9c0f11a8e09ac8d654dc6e1119e2c2804510a84ec61f9017899f9613e37d8166e0fcaae16c3cc11e9f739968c687 +S = 08c2bd7d02c4c537a308fa40db786ec64fbc2dd4c142b18cf9bcad66199afd4f44cbf221adb3837e84173d174e9c0d534720ad3 + +Msg = e29e75269754ec1194270f5c9e8267dfdd8c696008b5ebc92bb840981fd065672f07f6a0f1b19841adfc51b478371e1a0db9c3346a9f0a4ccbdecb7040191a00ddfd0a8faa0e69fcf544319c0155d02797eeef99fabbc55078f9d852927c23fd931685424249b87ed0c70a4a3e2d3b9a2f92830e7d8f7650c0bffa8f8986b7d5 +d = 099d96d2dc9c79549f031bd5346cf6a8544c312a3fbfc560dc8e378efdfe025b0e6e61e09c04c8bf4133396f993b0906c33dd30 +Qx = 0883e00d72c60f22ab085a90901ba3e8a510f19c3d62dcb3ee5066e0be094cceb30bfbed7068d0bfdf634a53e2fd002dc9e454d +Qy = 194baa5d7ae2399965fc4009ea83273676e66a56fd35a5939c26ccaf85633adf78b33dbed6da305979077418c625354c7fb6283 +k = 0c213540a452c4f2ef275dd844402dd5ea590f7df41ad35523edff09b7fbb096f8ae8a4baee95428fee03a9e6f6a14ceb90e289 +R = 071779b477245007ba1ef5f05446c4a08d1c2eab550db9c053e4588c9935f07ba87764f0fce14d4a7b982ebba89cb056aad8cec +S = 08174bb56cc85ebe7bca1de1f44cf93cf478d7fe59001c5947c66b837bd3a6d116f99dc4f9acb4f378b0321228518e1ba0057e2 + +Msg = 1a538eb447c18494ad5a5ad27be67fa60eb2c5cb2404eec1dbd7244cd802b17ca5497e779d5f779b981b165dab53ad19fd7bf2ea7dbb9b4baea782a43d758202f147e59d6b6b8ed54f4ea084bc18519943f6894d603e253ba3e8e339a6933bc3a0a47126087038e1c813c3f2997aae321b7c95a802b4b73fc7db95897b7c91e3 +d = 049f347dfd361a65910e97fcefbf60013a54837f2ae657d65e02397f59dc6bca27704fed3affdc3d833fdc621cc5e5f99b92a63 +Qx = 17942b58d42da750a366d7e4cf4cf465c856cd911e5352b50bc8a12704c1ac6ad54f9465e4fc5402b373d8bd4e4f8519341f133 +Qy = 10abcea49c66730ddad7734eb1311b2626b75ebbb299a28c9d60937e6833a9b3dda052379fbcf7875f18680924274fa1764158c +k = 0134c70f031648bf470ccca4ec19c837051bf700c851df564ef3ceb99d7d41439293bcea0c656c0e5361db92a03def51d7e4f26 +R = 06c0f9935abc5034a8b0a05e8d04de699b5916cb367e834f13642f0003510bfb68714be75c9e35b5e593eba45fe151d1df56d40 +S = 0930baf426b33eb4afbed64869a22712591db11acee7c4d3a221a1e98048f05900fe14816006854cb90631de5797f91176fdcd7 + +Msg = 7502c755bbd385079a4001b8cd653287dc3054f3b57de19d0ff8f63c0308c64c56f035117a8971d43654f89b52e923947e4760ac72be073136da70c5ad7ca1658cc0a2d2a880d3a0c0fe636fdb27b77ff260c4c1ef8a18da8e9fd777d732a37ae9906e6c4f381f0a3d941048d5a1f6f2cb8593873fa4bb1621a44bc2bebfbcd1 +d = 0dd226de602af4e9f8e25784bd1bbd4cadb0a8aef525d5e2d57b9f3555feb698765672c5099a7d6dd5faaded69d8d68b4804f26 +Qx = 07ee34cc7a24e2e693f9409f52796427ed86fa71bf88c923db305ebd5a83bf3b6f7612847f16d00f4a25614299a2df92bb693c3 +Qy = 1f63f177b54f8dd5c907ff318b66c2bfc1cee09348c035a4413fa3cf5acde0db1c8af4fb8deaaf8a3a6f8f06b0acfd20c6f0049 +k = 0e19c21b05c82dd8c873e5f30c1e3aa9348327f959a4dbd9c741e233c649a426cf7bd9d8e93232e496d0b93ce835f80fbcfdb2d +R = 042a3907a480329a6169b439a6945cdbe8e4572779c43fa6cd1f15062559dae9eda2712402ccbdf03d88a8a68b691f1f16f8f52 +S = 0d09fa4966d171a662a9ba6827fda830b5404f96f635edd8482ee009ec5c7b64a2a6c17793993610ae8297efa9fe4c35ceb5001 + +Msg = 95eca932d03f1df2e8bc90a27b9a1846963437cdafc49116ccf52e71e5a434cdb0aad5eccb2b692ca76e94f43a9f11fa2bdf94fe74af5c40e6bfd067a719523eea6b4e65730365ee498ac84c46e1588b9b954f1c218920cbf71b167fc977ee2a89429590f43bf637eecd91b0ce3be2d66bac5847205f76c06b914a970f543e59 +d = 0b6fdbc9c8c76cb2b822a940d8675889ca6f5132429da795462381ce29313a23bc132976fbeb346ed4c691e651028f873ce7971 +Qx = 147647d267afb4bdadf54baa3f5131e79dae8103f5b2ddf70e4652f9fc5495123be97215b811554241c53023a247936053288bd +Qy = 15205cd5bf0c5154b2dad8367e1b487689b898acbbf44f9ed67a37babbec739804dfe737b324ad663cd2cad79274344397099e7 +k = 07321d12d616dd2ee5f843d6ed7e92d18968b3a76c0e4ccc167790afabad1b7c0dd53d82aacac93d98679b203bad88d5ef0cd75 +R = 0672c5607acc646c67456ee77f2c02117cabd241f728ace5117626bdf91662323e7565438f46a3e25c048a8e2130e27fa1fa2d3 +S = 064aaebf9f2fcbc843ae1128eb6c7e7d1fce2b9901dae0f60afbcb08c7f2ea1b550e159947deb87dd8959921846e2923880db6c + +Msg = 8ff68cb00d03e730dddb05fe0b2344689529096c3da6eeecaf097f22c7fa340593106b1f6726f06b7ce7358edbcf801ead959438a42f94cdb467b3cd5b17fbbcf75739805f9eadc869c33c604cc58f81591b0b8bf4d42bd53a801f0f829a31af6c129fb4f20f1250f959754eff8c629b85a716b6a18465b6495798c0c5166c8c +d = 0203d77fac64591eb9a18de20a9d5eacaa1c3ec58a5ecdb3008c2d642e197141d16b3a9fdffe61429264f5b420f5e9926659a4c +Qx = 00f66ca09d15d0991b48ce7afde9a148565b73807e435ae0f16c14cd439454745f8ae153786d7c40cce3f43a8aa4f0564cdcbc3 +Qy = 00f4c919b7a97beba2559a8ad0f85dee40e8df28e23732d7de655262209a5170f94791e255e77e8c8cd64c8c9900092e0ff9d5c +k = 0859bc752300d4ba5014e302aa4cd2a979b3097dcfde5c59f4bafc5bc8a99411174d2ef3f7377df5a09269e3d9461be61801942 +R = 0691ea76acbd5e8137924bee13326ceac8231688af8595718e210bb857d6619c152e1fb46e03fa83bd6b5d81e2463f9260407eb +S = 054df52eb86c679d8f8514a09f5a3062d2424cdc19fbf6927f744aaa8c444223f1c28ddc84b1d135a886eb7ac7eab3c7b0a42e7 + +Msg = 01451c4f09720cd53377a5ed04c907a735477378ed960235a833049d6bad6e6e89958b4c4249bf0f6d4f043530c9e5426deb0ec3a12b7feb4860757b41bf602ca95655155356ec35a2db8e2657998f56529be4b714364f83a140846308a2973907ed7b08e935173ebbce5e29afe1444cd51c92824ede960056439555e7e74450 +d = 057a2e6a59d4871c3d547690237dd9846d6d5dc4ec0678aafc9c8669af8a641eed67bfea4b05fd6b3b5357ec4d0caf352691ea4 +Qx = 0351aaee4207bdac826ba17e3b08dd7f94c0c8ba0d9829d7bf0eeee7e6375458b5457bd787f0ff38564734b3a0412bbddd7c371 +Qy = 0e09c4dfbc33d61d69b5a8517baf5e4e1614920cbdd89bb05f0420be757253fb92308dfe1de8db822f57b67b393d8a70d989b26 +k = 0fbe560003dc220e4c966b21c874b828874a33a93bb69c49909376df67e5df1652fd91a1d73c7733f26c121e7a3b2d1246c9a61 +R = 08b85cf3a14fdfc69cd42750baf362286940994479f6ed7ce1d87af12c5ae075b311754f1d37d8ed10bea092bd3d9f7afd2f1e2 +S = 02360bc1f7a98cc87ee2a4feadb98554cce59aa0fbfc087747c7253e54c38815cf91c8517f5692f95bc7c3a713fb6ac43a34f7d + +[B-409,SHA-512] + +Msg = ccd494ca005ad706db03a3df6d5c6e876ef859ec77a54de11fe20d104377df1900b6b192126c598944d19a2364b2ae87ad7fd32265d59e1f22be5833f20767793677b628f18e9619f8ca32f3af3b41c31e87a98d1527e5e781bff33c1a8be3a82ea503e76afec5768d7f7dd1f17dc98a9e7f92fd8c96fca0db518bd143d82e6d +d = 00a3da7a6633608fcee9ce4253bbcec08d41ee6b00178ceb017de74e24d48fd89107c9f2db3556063abe3cb011938f4b4871795 +Qx = 0a6123b122d7d0d766897b15ba6b18b3a975d3d8058c9d359c6c6594cc0dc07d9ef6033224b4aed63d319cc2747c0660e38897b +Qy = 1ab5fad5e78f380aeffca8d15e60731720184ed456800967b2ca47d482957d38409ca07ea798bd892b529774e44080eb8510e6a +k = 0da042642b3117f30ea5f4b354047b164bd128696b8c00cc6fcc767246daf7483284e411009e05218246830940178cb4ebabf1b +R = 0e4ce613e6976e9e1c30c0c93214a0a37f0632de85eaa25464b69a251d592560b2039fc59b15ed7045c29c268693d7c9e06d8ce +S = 0ff3ad5ca70aac94facd842fecdf6a28afbceab80b549507954b7dea6da06d1facd11e0a88e9c2a549e6971a08d1af75aba8363 + +Msg = 5719e50d939a8d74efb444eb5a77cda48cbb59e7f976cdb2ea2848bfc558718b39ce27b893c229db94bf77992222d1746f8f52f858f85124a28193ae0da039c53d484681785f3367f6516fbb8a86560aea9e3428551facc98cdb1e9df8e2f37db823a7abc589f667b5c93c4c47061400220a2014197d514217fc252cef5a2433 +d = 0384723c8b4a316b450d1fce0b2645912b8acaeb3cad50860cca43bdc0206ed5b3b60ebdc29b3eda305d0d60eeaec261edc24d5 +Qx = 0fb89d87ca4282ccd048606e4d321e7ca73244b4d0c9d3df87d54e038a14939138bff33c81a9ddd64abdfd698bf103e45c96f97 +Qy = 04ff7e1706688a53a5544f4ed0f3f5e1f0fbd6f21174166d25a690f260766646cc6fb39020de9327199225e44f3d95c5984fda9 +k = 03a9f5f26eac81dc8ca0a17acc44322d43bfd18edcbafe24113f5e5fad0ef0a3db75ad1b2422c7321593e41e76eb2a767a14268 +R = 0c311000c27539247059e4a8d789ed4db93fbaea021272a90045bf6fdd70f4f32cd1e195b99ee6f03f4fb57c3a115ffeb459af1 +S = 00db8bb46fe0f99b4e6e1394a5db283e310b24d6006319986dd2c4cc169c775c89d4ad98d0fdbc3c0bef6b7fb6b43ef21049bd8 + +Msg = c84e5702a339259a61b5ba8ec1957f23ffc4f1eeef3a58f383d3731bbaabfcf49ce2ebb597960ac5115a2af1c62b193d4ab6c24433d5f168a1752e40145f19aeb6dee889a53a4fadd13eef60e28fcc7ed6a9b8b0ca286c1b3d66a4b2c327a629d15c148049e3a0ccdccf05cf22c31956014595e417060627c8125bd7c00f8850 +d = 0bd3136647572fef3de51b12e64b36460bd3a27dc660c164fc705417339cab21f9e1f9be0f3da926df459c5ba58b701d306e67a +Qx = 0f45e18834d1933a2a26e95467b6db85d8c3da372e607907798745cd9847bb8f8b51f996c7293b51550144f227933ba26722685 +Qy = 05d8b108eb3591b164745d116c80afdd4870187061c75af9b0c3e87dc8262586af14f4d6b1504d274c07c8e89247196d8ce8166 +k = 047a494645b99a3469369b72cc918708ebf453957b49ac4e209f2edd7a4861d014543754e37e1d1a0f477951a0ac2b5826a470a +R = 09de9e0147e1a268f80836d7db43779ce12e7947caa851d109273ba7e7dc7fc52c601f5bf69cffd5adf0695cd7db8de2a64781f +S = 0561aa76e1e9f2c1d4aaf6e2da143f67166f09199e1705b631d650528e94d643768cd611467284a9f543e50520e3e738e5d56b9 + +Msg = c90bf11d04a708e64b6f94d4cca64b92463eae878c377b188c82c1c5f05a038be20eca2e18034d46f00d9a6fc73c4084981748ee9d2915d87aee4e2321f4f9e11c176f01281913e324700d9cb474b7134fcc408fb4a7006acd9e63d4578ed4c2729d8e0d01b1e6174a43a024ad261eb644ae98979c3cdab75af357f6dbdf5db1 +d = 0495be0b0a9d357f6155fac008cec90442200bb842d89292fde38b7256e4117284a60249b3101b3f19f778b680c0d1d7422b84a +Qx = 11119cd910d4e962f54c9776c9180e7eac2f71cb9748ace4b7dfd2d2b3caef4964c7a55caa9763e008de600b727068eda9b9865 +Qy = 000b48246cfb7c86e9dff4ba77a3a53dbb1cefa168026b8929c42c3b0251fee5746897916e50f07dfe8b57baab7964447a2fea9 +k = 0ad4ab5ecb84118c33a4b06d1a9f5d2c4f1f3dd1cf71af596eea771f851d0371d2d72593c926d7b69b39cdf72931f6bb11d10cb +R = 0e959201622673d81ca16ed94e9e5be3f38bb8db48f9c09a585aa31ff39f14128d79d604a5f93c80aa961c85bbf99e276937f4d +S = 083099697856c780936ac01aea5e3a4d9b6e183639cd200464a5cc05232df30ff5220dce4e2af714c580d561b72dc4969166a6a + +Msg = e9b2a33906a1079280100039787377c2971c378b92e70a38ab41dc23979d6fb0c41e53a21b37632407adac6f212341cf6af8605b4978c85c9c16960e1674247f1795cd73b99ff28cdca024f5078490513c77114c2f52288f5376872c331151d7b2c08f7794f2c1f9e0d849d32d73636f0aa899988ca561a76f74543b37cbf3a3 +d = 079626354dfc4eeeb51fcf232ee9e6b0130c9bd40f15ed45606bb7faeca8f359e0c3e18bf12769254522fd4077eb24bd5454871 +Qx = 07ad047bb38bde6ae2593e1e41c36b7efbce1e0ad08def9b23d25b7ea9aa336eaf10217df16d32ada4af03dc193d44e6c77e677 +Qy = 0d2b9466ecf321605b9f4f9528124108007203ac32cfdc7cb87e1790ebf4bae497fb87011e0a81068e66a840d29583bb970e24c +k = 0074548d1a3df580e45babda6096f4c78cd70945ff190d9da463fbb03a511c45d45dd1c46dc0b9521579fb506bf015f8b835680 +R = 09e04e9ffc2cafdefb600cf61e803eb78cb416304210165fa7c93c1bfefb02cd4a255512622d524141de02c2cbd193991dcef67 +S = 01a7960232455f27768acd825b8ef91d4efacc38684d05a900a8512682ce19787033cd08c1f2412b481b88ad02dacc0ddaa0ec2 + +Msg = 672db3fb8cc8e5f831be700498d3ab3aef14b7548e8011b21351215fb6dfa09460d18f52c02c8815baf396d856a429bb9afd602a10c213af34db80447f4c06ab4bd28873c88eb9639b199042d4b2cb13cc364f734fd4ab7bebede7dd4da63decc0cc1f84e34d760013f66d71641073f16c08078880b67230f2d6c6bfe17d206b +d = 0ab42bc7d0e3c23f8bcf928e25f9f027b56f270398a1d37bea0ee5426b944a9c9ba6d0d7796899543feedb470f70b2ab148234f +Qx = 1415fe81100f208ec8afd5e882e5773a0c1d46e44627732900c7e1722cd77b3ae24438a8463bf571fd6bb422d7c583439c07cff +Qy = 19c3ef3688ed397640e873dcb20cee9755437d0023646d05612e8c360717a2e80e80f2b85860d71f9876f3a68548da7099f601d +k = 08b44ec25214602de46046b2c94a45f64e9d0903f6148dfedb76a80b8e6314e87bf7dce8e73b14bb274a88fa39136a00537779b +R = 00ec4c5bc88a959a1234413026700bf5d4287a0263fe75daa16693bf74cb5071a64eb18778da0a31210347aaa33130602f6b597 +S = 0b6c29b9177e89880f3eee3aff204b866020b3bf77d7c31204af383d9770804660711a8579a3f1ffe325f225fc7e7894ecc601f + +Msg = d7fd06b89226cfd66671ce5b4b656228c52d986afa7f6f30161680eb0c9cca177992a8a8c40167a64165c518c55f678702125709361b536bd928567c97737bd750d0e2e6e0c00296a6ca565f7c05cc8c54ae7a4e0c334c6a968fc18a959c18ebbd924457701316a4e999fb11084520dac68dc2d69187134c40891af0355ba89b +d = 07f7aa2216164ba689459ee5d5ca29e70ef75a5b2a4416ab588df1dcb9164330c0b405a9d80c3acc41c19f58e24e17ecbc0fa7b +Qx = 1decae837c7258ea9d90314ac87c57aa6d49828787054cc068edc1955245271acae72dce5c9cba422bee54f22e11810721c1ed5 +Qy = 024cdc9e1b27e5d4bd024654df000bc9a0181f7c0f4a90572c75e16b679f4362446993f9920e2244527801e8f6b1e9398bd8382 +k = 0463202dff25e6b9c633b60a3edcffc1a22031cff44dc1b0a5769214693ba02038fe5dcfb4a48db7ec49b33068061616daf2fa9 +R = 08c06b72b73dc2655645892447fc0c0f8055838b194e8fad99fc6bd50774e1ed08313eba4141018af33af95a3faa20b69bcc0bb +S = 0958f104326df6008135bfbaf5c2980cba2833af1b4f04b5918bb51ab0a0df637d6a4af902a5e07db3022c134c72315f25972c2 + +Msg = 83b7e9d3ec638fef51d2885fff5490c94e2509c126608f82660e5fc523032f3e85d69d9b76af145f6bd916dda35775abbb6d1902bf38880f8b9259822055c5b1bc726c51029972cf7474cf2a812f3251aa71813476bff55598d079f075a40c6c41498bd865ce960c518bef75a873b9d010965f342dc4b35ef5c5972efe6fdd18 +d = 021d84f070c6823a70f1a74225a472118c93ce9dc509aa6064051ca4574939dcfa96be862069424bdf1a23f62f2868326422e64 +Qx = 0f568f018b0dc4400bca3e9e4b0e5bd5245f15dc7acbcf4360b0be2ea5abbb87a3cd76aa653d32858438051cbefbcc4feee6f6b +Qy = 1fdf1e1bd7a2d3825df14f8bf8d5de825095663c3014f2eeedb9bed3c3416d56f805b623f40b847090d6b4b3bd5abc98ea55e48 +k = 03344dc1cd950a9c3d039b6fb6af8c5745395d2a3343d86dc6670580e331d59f6c0034367a6df52423a625d70292893961ceddc +R = 0fb010ba41d651fcc854762fa1437262eadfcabb95b9502a40b50f20cb34fa19ec570dad2e0521809ecdb2bff3f4e7055c02bec +S = 05a9c2dc0c1f946ce33f2f434c156c236b09098365a7f31e238b4685e7cd8c86a0b2455e5c83907167c1324bbb37e66e0b2768d + +Msg = c62c7bcc860f0e175128e1127dacf935ce62ae794cc4a0ce7966bceb023ac0498641d7281fbc86f9ef470bbc77f608f83f8d0dd6299cf08f2cdacc7a9642e4246df131820220e5c05d0dbfceda7f16b86add4793e9b6244d96b5c07cfa23574ceb43e8e8b5483192a92b301aa3b37702b8f94f0129d8af1617896b34990c9b02 +d = 0b6645344d17528968c719091b6e2072388881dc10bdb4c7fbf41906cadf3699b30f9c1dbfb4796d009480664e6276c0359e5db +Qx = 0b164b075b80fc8b8ec785d5c2ef84d49f2f4d276546c9cf2e17ea4d367828e9aaab985c5cd0882204e293dba0359d47d9bdc05 +Qy = 0a0c61f181d5d06ff20d0c41cf6d6cf7fea860075cdcbbab2efa0950e2276dafd4258a39c0fe4c45f3c04f76efa7d41392b4d34 +k = 0c497c621c5cd230fb1e4a4cb3af1cc9d8edf4af5c4af7f15c4ad0a8835b54de52d83bdb3433808a67628912a85c5d00aa222c9 +R = 00b22e5773aca4d97d2da846c3947bf9cf2474101a6f0d39d31629a6aa2a4c3a77076a671e37aeb4cee0a94e82e914c8c553e04 +S = 06ccd79ab93e344e6f112c1e4a39e8505a2aaf5cf85595cadc6ddd1afb0b1583d9334cf1c48f26e5baa38e05b6b52f9f12c141f + +Msg = b5bf38fd9e822925254418475a1ce762a94e336f12b156b1625a4574fee11ee472d537ef94b4a4b1c0a73b0140d0b818cd06636653e6c07f0f100118242a7703756f1cb1119b3477c4ced99cf45e07e83b7f2749c1a5f8d8c9272d221fe17f7c6a5fb0f8a16af46f232ce406aaf565c6b2766a2f6528c82e74fa1c0a7fcfd49e +d = 0f8c2f770cf5f8e1f900e996ecdcd84fcff5cd959777fd005d721a419123221a3237e39834b270d37752470deaa6cea023c5058 +Qx = 1f861984fa06f15b801216a1c33672cff43740f0f736b4f4abed5656a1bee33a2aec431680942f2b0b0dce9a9196b49263fe183 +Qy = 18633f4e057bb6d70a434f919b9ce4b7d9e61fbf46c1d9638100d77881755fe9829a69d696d555b1a26e25ac1a1c27b40f909a2 +k = 0bdd99022dd964306955c57b226aef036527eca481622618fa7395f53e60aa95a275f1f2d6e7354d8b55d3e83c85819e818199d +R = 02f1330f41a86c09205004215c24f42fe582da189906fb23fbcc52136fcb4970a33b896113eeabcec8151cf3b150eaf1ec2dd88 +S = 0439507edbd36ebe4fa5df34d220c1441e1a4175c9b0373fc85669facebb5bda7a4b415c269a7add207b461525c6cc94b7f7b22 + +Msg = 6d3474770933ec01b76be789304b6fda423b12a0ae8c87a5ea8d7ee9f71300f39440e1c7f5aa4b47c1a8628cfc3a490b15ef292a741344f40a8fcdd02cf3863bf3e32d53031f503703deab17fc52b3d4032f4e237dcc27231b85d3fd60b49ed7ee40c3344948d87c3f47564d20a11d50e4e520bd16c8701694fc70901a5da625 +d = 0144adae951fe897d5812ee4a16c0be4c86c5e57e615c398f5768a1223a9be20fa82ceccf8a16a31432bbfd17e594a4cd8a6a07 +Qx = 0bce072255f7cbaf565f82db122e9c582ffcfbefadab6d79680b2506792028b200ca7732a98322c290916c66c8a8ef77df6a2e5 +Qy = 1b4b6f65e678223bdbe5f8ecb68573ae3d7f111dac37d4fe3c0eb768c461187fc5859b13452381fe676257aa445bc7f38b4919d +k = 0128c12479b7f0630374880b214aa26e4e8626deca57148a6c6a0e37a97e89da8acbadbbfe7db28a0c5bd17303e1342af711f25 +R = 0a95124ec95e35747fb568e6659ff31867a4cb7c00985b36584201d1bac0775653e0a8b54cd9a9067ab3de434bc2cdf29ae287b +S = 0257e5410a6f0bd94fb3b5b10500fb45b501a3734f0c718035a9a1516d2f88e10d1e38b70c791028e262e0c3128cb84e6064ea3 + +Msg = 92ba7aaf71f625f7a2e024058dc8739da3567c306da4a812ed9e1542b7d1e982c16082166a59720203f4524c3bd463a662c26a82ec7b4376545206e650eed0d3dd7909dfe3810981393070d15c45dc4a75a8c5bdeba533cad1ec34fd20466a61e4cde3b25af9a80a9a54afdd7de1cf2a74ba32d4ea0082a037775413c61a8d1f +d = 0a51f065fb32c55bf4ff6f18ba9d488d35d9f8da593adb0ab1632533284e0adc43ccdbda9d9507b9862ac63b5ae7b0f78b479bb +Qx = 080e2f7ef17a11ae66172cf1c18eab12aca4c2ae06b8106aa1066677a93538e3dca0626e836249eb884a382c3b726736565c3c3 +Qy = 1e98d37a17ea736ae58eab093fa7dce3f10791ee9ef5ec00bfb27bf3c705dd633badc94642c385dcc276f9b1fd5e01dd76ce944 +k = 0d5cf7b3d28459db8dd69c314f6464f770c31f239a12656368c84c64693f23733661081d20dca9bec9c9659a8124b57a71ffd55 +R = 072ba8c1b4bfeca62e96a5649e851e9a311d7685603a11c1c299f5ed8605adaf27cae656cd31335a7ae363cbae5dc7a39512c1b +S = 01bb9819d25a211548461de4ff973ffbf475230baa161558d9cb7ee6f2e682dad21a465fc2ae058121224f8680296d30e3692cc + +Msg = b3fb9e48c333201324755a81f3ae5d4f0e2ae7cd24238fcc66d858e3aeb1ee03328660d6399676eb1b7d8285ba571e214d935bb45516fccfab57b8eb4c3d5f1d7357c768eb7b5e7b5710f599614bd4e92706eaba31f8a5e7e57af7ed13066af50b4540ccdc126b677789920cef8543907f0ba9dc92aae343d3425bd784ef483d +d = 095351c0bc07acfabe6477fe85f97eab520dc96bdd58b44b036328ceadaa56a1904d2217c5fd25155ff2aaf9005a3e2687fec81 +Qx = 1c1311230cfdf5824323448c68ead5e5885ba540a21ff90b951f85d84d78e26da035bfd99341b5901e1ebb18648a8dbb996fc9d +Qy = 017a037929496e560cd1c936d9eb15f79fbff737201dd880a69dfec31209faf5bd2846e3e664c668ad3d6500c5ed620f1bcc970 +k = 02234bafb54cad0d0d51f4b8508dbc8d014c303d90d21bc3f749ed7acc42f0335c5ab6d60002d3bb57cf07018e9c13b92c0a39f +R = 04d0609f06320d69870a3e66f19cd46a2e0e3e13fb8b7785163a7b567bf2c0f437b4e30cc67da288a3b34ce3110f6d87affe0f5 +S = 06c46d0248f7c309c1e5b80ac4b1459bf897e42f8f037031f5bbce0fde50af50cfdc4f60d5ad3d1af152298cfe77dcab287874d + +Msg = 9ec5f7d65082264b8a50be772c44277a73ed19199eb275fe5976f9799d8629fcb4a59a8d55074cd2eb2a0e02062d3f7cdeb05e62931a24fd1aaf14c257944d1b42eebd52726d6fe281211b39038e52baae077ea4df89675d860d6ba5a0f998d049614201b872e134367acc90066ac602e478ac3e43c3ddf4b0ca0aac1a68591a +d = 050245c1682344fef23bd549ac8d1e8e44b2840c43eec1cecd33daa4e9ef6b53f496104d7432e14248682cfd6f5b4853b65adac +Qx = 0d2f8fe524b2108e375c9603598b555d6c4c7724c7d11039178037b3a4dc82b66c3aeffcccd89cc34dc2b2f6695892323bdd805 +Qy = 1f98df95fc1837ec4d5239cf55e97d6b489b0a8d7bf12c1ccf95f689ad23e46dcf20dbb531f5179e754f0c29c8757a1dc67493b +k = 0c683f98253406c6587d87c57991fe5caa3f43b451875859feeb81176b732f1c1eed0ee44d1905d41922878617e03dac53562a7 +R = 00cdc9bc7d670a1b6794fd7da82d2ad1a0e92b82ae32656ddec3aca4de75f407f20fe782daa0004317fa3f12cefc48518298d5d +S = 03ee7c75810c2c05946b53e2f24feaa697af35174402c069b9fb03d89d73964c997eca4a5d6f9482cb23c8ce337a374ffc3e186 + +Msg = 61d657bf472676301503f6784b7286fb39fb4186bb88abf1edacb4a2693d0a1e2b77bbf2758c84f2cbfd1753e20841b1cd4b456400d53f4d686e666943f9b6ffcdb77f510be97536e9698fc84ae347d483bc8984548d1cf86b9b40d360f9c0dc5bd1c55868e26fce1460ba94ef5e94eb63c9f0776a0f446c0cfd4106d9f36352 +d = 08d3b0277f0e9fe54581d3a9499ccd7f015c08339591326859af969d2a26284e3b3beac4a0b74d324ce5cb5f38c7995e4e3a41f +Qx = 0ae18564ac04b54769e17df84aa54903df58decb870591dad73dbd712693d901f3f9ad43a71f23b77705de2b4ec1c3bc616356f +Qy = 19810f92e80560979ac6e72bee505dcdef15b4146185d2f8f5a955a4555523d982c34bbfc1326024410dbad3349e4c4e01c242d +k = 0e52dea77fc59298cb06fb1401d11c662a04500f0470965c4cfaded13b339bde52f4fa04c76a955faac16784f443b1ad9dfa0bc +R = 00c917d487d2aae1651d76147de2a706a01c8b3d223afde7d20c9dd77cc2329bd3e0e4fc01255b7c4ed1baae7d26667bc2e9ec6 +S = 0058c766fd514a405de91a4b9e99fc0b0146d954dc2e2decc2f3f066d0fe192832ad37a940949ca4e9abae0602248b3b56100ce + + +[B-571,SHA-224] + +Msg = 8e14f713a2c427b1f79491033994f76acbead614d12e73ac6f3f518f2052a10c1273aabe628ab38e0d3d5f8ff254802e9f44a51367bf80325b6fc39d907a37f731372864747b10749ea5cb3d3a83da39c21a7b02885a8c1770e4397cedc958e4baa21d5007569dc9dd1e45d2181709d900a394454090badbd0cd9c2cd2369aad +d = 0f42afce7f7b3d45f3f925ab29fc3882a89c9f585177887584703cf8bd8fc572e677adfa55b402446fe1e90dc855358d92c3267c35be9674b40c2ad5ce8dbe6a533c44b0ad8d2b2 +Qx = 63dbcfc2d9171a7cc1835c1f56ecadcb59aa6d5852fde264ab25603f06817a20f2787446445be8b2ba05c70fa25d9b9e34d5374febffeb536facd3da52d43d69fa7af4d4792c792 +Qy = 7686e0629de47916af19f9013f65fa3b5f9d196916cab2f765aff31adb5a959515e83fe3e00e91843c532041ba15f047e978bf2fc69627bb5cd7f3ecd74cdf1a8d623c1efd23fc0 +k = 3fae665eb7a54f51c522ad5721d9e2648f13f3d84e3d64c8148d59c662872b5cb7d911c27bf45884f2ef717d72bd0569d9901f2308d9a68d128c042effea148cc963a8252f1426e +R = 1df705ef13ce900ed61babed02e121dacd55a881ae32bd4f834fa8e362d059223b29ff3db835fa2b2db8fdb98c21dda5ef744cf24d0a798f501afa3a720a238ebd4fe3976a179b8 +S = 1b1e98db422fd48f1dfa049f38865f8bf9ec5618fdbfb50f21cc838051a1493e4b1e4f9ea81156481e5fd84124fbab740421173862c63920e3a833aebf0762e7b5b39a1591d27c8 + +Msg = 38b60d27ff08fb191811036dbfd5b39e1cc3427ff70efb67c851e9cb407f9fac6f348d289df98d055eec73299fcac068bd0fd9ffa3c5d244659e4f714a58d79f6727f323a7ee26369000e90e34e106f99f5ae2ae1b64ee89e5a1d304ef20c071a7773e9b977ed3d49f467d300a881c8371041394910f9c366942449045568f01 +d = 2f36613043cbf53ad36e2b38998bb867503359ae082d07d040e5a10a43e06ba9c91e7c73308e41e2391b65e634f83b162cbdf4e7a44ad818fb93a978af00f06be06731d8c5886c6 +Qx = 0fe1afd356670e1dc6bc195f9513f1dc6b03017416b5252c7b56153da538422e557d9918298ba6c78283efa0288c0ac61298846a6f8adf74df21747cbe7c18a2b825a330e843cd8 +Qy = 18b7659f0a7e8e7ae5d636ea4d1d5f3a1f846d4bf3dfbd96c6ae874354db6faedf02f75c4d1d8bd6a3b61e70ce58e38ea5de8cc16828f87a0667614f6640a3023b7f4aa93fba577 +k = 3fe351ff6ddf50752f7dfd8e5a72c9faad77dbea303fd97dc939eaad3aa7fed466fc8939a7a6bb7abee63455284a5338e59dc067236dd699bdeeae1424d993a9c76fb2fe9595423 +R = 04a0e13a9fde9f2fef417199f8584d0f60b2f04aa6b7524cd2a2826d63043b2188ca977c9567fc1ff292ed480dabc01589db8734c15aadb4ff54a552a7d9e66829fec1dc919dae6 +S = 01bc7d2c4ca9300d7a3001755ef25231d2852a7b9a3e91baf21f2a2bd2ff305be8a9de1d1bcd7bd9eac4ce12ecf8a91c0a409726085382fb8d2428adf1b42b37b50c9e8e0535d7e + +Msg = 21709eeaf9e1953822294a478dfacfb205fc25f447a73a76a32601c00784cbf2f9ebd41c22721d70cdb3842dcaff4a4f208d41c0816990e421cc4b8538ac2f347cdd0aa2a39f1aa26ace8cb6a606b23f6244894d4594a0f6a5b8f6a695fd66e1a41e2eb6a377017177fec56bb58c837e311cd04c5b50575faee32606b9636ec1 +d = 2e74948c46930cbcd9dbe2325539c7dfdd910f309fd610e6599d425aad9ae230a8d4681970a14f2a71fd08030d0a40ff40dade7de1b06a80441bbf7e2fcf1809cff39c7ef88bf9f +Qx = 1b75f2d281592c288fe6d5479a4e21ef626471819850cbbdf814593bae7e6ce2a35a978aea354649d979f161543fd4c12dae0efcdc2d95e82ae5874b9c04a2143535097b8a17c68 +Qy = 0c7160c2efa3aea1d18afc1a00b47209dfc750a5317ddebff04bc4d181f238d339a7690c24e55be2cb0c01719d34ec986a07727f2e412aa72434efef4d64ecf7c16e2e75ebd7ad8 +k = 0d3ae3d8e5e01ad838a7cc9a4d9b3e41eaf9894aed1d1ba597458391d4a2ae38c5d6efdb4d91761a415812d77fd9ceaebbf1ad49c282e693d71d89f0e2d1bbd94698a47f1f30890 +R = 1e2e9e2633885c85f70208de30ae9b7f72950e2de980607f6d0e73fc1fb2a4a8afc6388206c11b081540bb528a94e5386ce77a2d5c7830fca19223d57c1efe7ac488e69ae07e660 +S = 1250d1b920324919ef81865513db461409f6f8ad82f658dbfccfae4425906da306ba10cac84cf5379b6c1d8b252f3c6f86439413c617deadfad38a234bf2b0050fdabf7719bcc9e + +Msg = 3a131fabf3dc97334f212fce41c44300440d16de1d6060450875f7276f53c026e2a511681b5a8d75fc0d578546339542833145f7ee13c708df33e584445a75a5538829286480d339be7c777c03c998a6d3f037b25799ab2d541021502a0b02a9b9c337a8b176c4f30e5b186485a6103b1d1563ad4ae73ca806a5e4daa92e9100 +d = 1b5fab1d36f6f6d559f65d8b01edba610620fc3a38307b1fb1c5bd63e7ffbd4a9098cb8bdf50975a873f5d047ee2b627b090897a7fb5f56d3f4a0f3528179e7c969926fc0d3b0e5 +Qx = 5eb8c5a2bfc86aa9a82830d665296f74aeffa9c5b38750d0ff51d01c2dd0fb6f2209f8ba89ff07297ab9b1b06168757f48cb6eee618a7b44f1b3902187c33208288f35a06665920 +Qy = 5334c203f4ee44fdfd5f99686b18696b3433f203dd148324dcfaa03a0a250cf606486ef11ebcc1ed1839a76ad70909d835a4b30a014104a6ecbb284b33f50bfec33d8b5ede85ac5 +k = 243889e7ad32076a3ea436356eb572c1b4ae402d0218d3ee43927eca0b4fc21a19926eea35c37f09de4766f54e6079c34fb3c174afb953be1aac46d675bd300e717dfc2d0c3fae7 +R = 1d87b52dde9f502f02a502e7a331ca6dfc6204922fb94886efbe3013446d08240f6dba1210a76eaf804562aa92a14d220d59b6310d6caea0274a5e1e8aa3c6b57f239191a71fe3d +S = 2a5342df6908841b719f80ff905cee0ec3fd8be46396922c3f2f142393714b97128e083907a3a2343f0cf9aac73313279ed29eb44017e2a1cdd0fc86e4b7c536e9f7eb1bbd192a7 + +Msg = 679d85a762f2574b0b31b516270b7d33d5e166c83e91a0f48e0f3db20b52f42f9e6ee9648cf58267ffe3b713723cf3df52b5fab5c14db1e7189f7cb7170bc6ec7cc71946745e152b39180f828688a5b6c0b2957ab94283b90052a3c6e36843c391aa8810f9253b639a8d5a69aec10070603ad7a99dcedb544858d057a1d66b89 +d = 383e70c71b431eedd4574f65d01fb0304f7744d668408c847f7899eae44770a7f3243109740f177d7146a27748886b7b77ecf3792b512e8d8e37c3bf4ecef2b1253df7066498f01 +Qx = 769dd91fad550980225877d98f7c86963c88be141f91f7a3f1607e0cc6dab767aaa6ceabaf46b65a7c80b6a494b0dac1da5d2fc8c5b07ef7085ed1bbdf4273da3665a6517ea1e5a +Qy = 282fb94b4726472248f01ee43607f7ef969446313e849998fbf0058c8ad5e24457006b84fc0460b74d86ca281caa174e69fbb68673e1d28ccba17eae045eabc1839870831246a14 +k = 336909099a1540e6f69172d55e0c88a1afa99808005bf09cc803ae1e4e4fbeac2f77f984bddb482f1f13e4430e25e36962b1a4cae00f1fcd7f2c7a17372c91673d8286f9829bbdc +R = 290055d578012a5b7d88fe2f70581a0fff976756b4581875cf5db07e01f09c0bdf6ab70ffb5839567583d53c68e31a27c3fde12bd4f1e1315af2f742746277b1fb1349141ed3043 +S = 1480c63c8b90c7b51e092597fd8391a237b07f0ff7dbf615e6bdddd5aa880db29c9b9add5bde7e0e81d9a37f852c26f21d750cd2f95520d16da7404c2c3feee1489aff09f298d7f + +Msg = 236152ad31ce2ffc0dead3c142cf6c770672cd2e75af4a82fda1a72e1c775cec9b481c6f3e411644df7e7ee901c501405620af4b6e9667dfd46091788daa95ef2c6c9f5c240c06b15cb0df51f5f058d8a7934bd7845f007a35f99fa97200b20f3b5b14fbf1e372507f3b2f377e8d07d30fd3e222f398f26d8f428e320327f901 +d = 02261d4ead21f02fab19bbb0da8c272286704c8f0c6842ba47ded121e5cddef79fb34e6b9694f725ca502949faecfb21e3cc062a2b4c654bd542d9a1fe8d97bdd0905c510aa0999 +Qx = 3ef03980ea9b754b655948da63469fe526ff0ba2c0f572981d02f5693bff620b55b8e9e9f9d553a78a0138072369775c7976f028631e65887cbed62fb447c9f41da86022f4b41ef +Qy = 4446eed90f2716a7aedefa1385db9f5f803434517fcd80571adc9b7f086c9787b76306380a375668b05fbed30922746fecc0cc16f189dddab676516ed1fe4d02855a34a90975389 +k = 0b309f6c53dee8a8956358df45e72126ec76266d38babff185d4db1d449c8fa9baa4b0651af5f5b0aa70dee3dd55623060097e2f94ed12636961a7c0744b38f2f137bca239f974b +R = 2b42395206ae79bd9df1c729856101ec3c4a719616701f836c9d69b542b59ce973d91951853f89a0717abd4b929bc69e59cc379c941349dfb4f98d49f9dff572c614242fd370e56 +S = 1ecad482a8eadec6800a9d876a382125eafaa7bbd950fe5f0588126764126eb1b384424015c52ed6a335668506f25124aa78d98ec5739fe282af0c143c07da0fca53b9733e159b8 + +Msg = ba3f02c4847fae035d747db246fe4e82fb9224ff9cf568a6ae548f5dc2befb2079541d2cf9aaa6b18c281a05e7ddfcdbcefb25f41dd91cb3092b3343e16985e91c912215cd99ae4a099baf628e33a7b277e3c36a13aaef85418fca99f64d73b789f23ecbb76c3095ade0a5f7f34836a98c5be933b44a94a2eaa3f99b1d8e7937 +d = 316c78f289e1860bb623082be9d9238b88e38c5e978a868bb90f776235bdff4eff591877b7f350cf14c40356922b2b6aa51d64990360b2b0e44d6941b5dd9492b4f4e1f42ca163a +Qx = 6f4137a2c63b6b79138027464135021b034f97bcb2493943df6be844f1657a97632ac80541a3b43ccc828789517efdd9f86ba171c1262a07a6b337bdb0c8d5f018302a8046a1a8c +Qy = 425cf553554d18f6cc97f0caca2a7eebbf266d57030014273f701562d5b1444240b9d22060ac9bebb37deec393cebdad21ec7f13fe5c7f1752b4261cc2feddeb737284a6eec3663 +k = 1e0321344bf364f1ede39a49c8051f36875ad78e4b080ece9088111739041b121f3f334c6e923777fd716a52be669d6e45f381da11262fb4d09ad66dea74ca115838e19fe94b7f9 +R = 04f24ec978c52ffc7675a09334a895e044eb8eaf04d26c094d7607b77ac4168a02a972f577880a0d0c73f218815e3a7a70c91c50734c08d374a15fb42fd13367dbbe08fe9c2d4b5 +S = 060740270df0e1fdfb8e829c9601b9901223b19d07e9d7d422b9bade88a50fd6d4ec96842afc45900a0107ce85ea6d083d66ae202dba3a32e50c7c3af951cac7acdc6f4c406740b + +Msg = 6d0372b40559e075af56af853cbe18ba2d471b0fc8917764abcc69102b03d5bbe1fc12458215be66409c26c89f67c72a8933677a07f88993af6918acb074fa915fe883b24bc3d191ff1b08852f07eda98977e70eba072d8bf189cd545230f59559ac05f1fa3f4e65886d0bc274a6e02e2399812b2bf91abae81e21279c5de996 +d = 2c1bc13f8320d97a82f3d9354e195481902214e16a4fd89332a0499208e91d50e5cabeb4927ba030cb42f5bc53b10f500fa646a8c88508cb0d63ebfce5c4bd574c527d686c735ce +Qx = 2210791ca48aafed20de84ef9896a9c7584081f850b75884908c7b3dccc94e221401a6ffd982f292a9d5f9c1d066ed493da948ac7e93977dabd7b820bfc0fd21cd8d99c072bb69c +Qy = 33574c6ce7da749ceb480b4e00bb1a58203bbbca5c16923992cc9767aba5483e4d46ed39e71000a1fe920a4c1c211a14e63ace03635a2d77e72808e0664334890b819b3caff64a3 +k = 2e3db2d82c4b9de2bc0dd0a93c1c5b385f75ad03d0da527a034da2876b42e43cd88dc64833efef54af902d85c568bb8e71684bb16b28c32d80bb3e9911cb1b74be6ec520d99b381 +R = 065f4715e87ca3541ea695878ed5ccb7d2ea6eed5d6fc5ec29f9aa8deb4001cc7c06185d6ab2dde4347344d44f8300a1e92513af4690d713762336d2e6a94d3324a224f06eeadeb +S = 20104e0767530ce2f4351af4977b52339f34d13e458de0482bcd58ab38ee041c9adc7b05650260d919b2648e2f820407fd60a8d6b4b991b86eaf29c2c4d12d3b0b45cac2ab22c5a + +Msg = bbfe66c82bc060bd14fd0e40769d9b3a026eb447550dd9f118c30d8448f725f8366edef042447962ba7f7f833b9e9094d0ff600714697e632626e7d12a592e040bdcee166dcda93952323191021bd12f3b1647d0f25a41739994659dcbb19333ca30f46f539c6f0a5c354cda8969a1eda572a309950c84c7607eb8ac20163912 +d = 13bd80eafa67663e75d7ae139bf285d2b9f1e03d8e32153c73e26d06e86d7acad22bde9f121a3f1ea674dcc1fe67bc7f5398d5e92555056bc046a02b0ba86c2a0dfe32e91add5b6 +Qx = 4c01fef7f2fd8ee61726af1a2d046c7ac67716403b99e021082e96d733368c6c64d046986fb01a6b55cc930517762387eb2fa4a8eda23c700d88065bced8595188760170881a329 +Qy = 189bfdc8e7a710522ab5416182c9579ca255c5009e6ee6604ab033c1388639c0f7aad84642290954db9f4f7fbffd17481eabed38151160457d68ebdfd8695b5035e4e6e06532c0d +k = 3c5868345c5314aad5ed3a74488a85b2f049396022cdd1de855a0b33c2877f72e871805af3ed8fd7e7a392c4ff63acac6a6f0c431ce7af680984e8c81d0350abe491a01f0f9268f +R = 0c7e96b9e9a5935ccd51b901aadab6e01ebde44f57e6f0b84e7b58ab4f62ffc0f3f3f980665c581ee3de233ee49d11599529348f1ad3d362837c041cf98192bb324f577e973e1c7 +S = 2226922271fe8307bf597742618ea9c1c271c22c25b49aaa7c9292a81ecce2a55250415ea2ec8ffec54bf0508e64426cb9cd7177265fecc40e056e96cab661485e789f0c435b72b + +Msg = b35e9bf686717ce3b16a59963a32a2116130453b161a4e7ceb27b755856add836d779696edcaee3b5c986523891c8836109d431e55c23afbca022437ad19e6777efabb6da3bba1f5f44f905395b4cc7c9210590fd38da621582d059598e5e4569e904358e0dfc0dbfda4ce75538aa97480912852bccd433a9b96c9c66e9597d2 +d = 30834b0a4284097cdda2ada6947c6c281f7290a49b56becefea1e2788ea3ef78fb96807633c47c25138341768b241164ce0d42f7301728b928be2c047f2eb60fc2f844ab77306d2 +Qx = 03a21f0d8e01a64b235cc455c291e3fec8de12682f05544de207d910c7c24c4cd56f3354500d994380ebaa0b49a7604c6233a9aa24934c550c0e609f65fd4073cd6c1ee4170d77e +Qy = 67c83513e4acbdeb8343b3add40261edbf7c8fe0af7417264830edabfc40200283b92484630741378b997c3f8bed7285decc6ef8633aa804b3846d3b4517e5ad836dbb1df475818 +k = 0031afb24fbc52b01480754837cd84a5165d5f2ad1a1d572b92ab546c049413806f0f5239a77c751af4d57a84786ed1c11bc76123a82e7db3c0495b2fdc5fb9c8720eb7afb640c1 +R = 07a222cddfaea617f1190a0bd88af4d1983d2543dfba25c5036fe24529bbe2e382de89dc1e36c1f6df59c8291d1c4277198084902e5619b64128c265bcf03b7d8cd6b663c225f11 +S = 1ca84c146ebbd16300b813621d503d8c754e4b11446d5ee31cbebc71f4b85ed09c5c94bbdfc3570e8882ef790393234c5ee9e52f7d5b74ff4171d930af817eafc40ef203a1ce613 + +Msg = 57b5ae7e95c638b258d1e09b3fcb4341e203f5706862e199b103c8fdac72cbc5155e5cf8b300a0b3fb0ce1f897c45f7aefcc528182f73dd450cd84d5fe9eadff3f704dc2a01b4e847c22df430efd1c66b0199f3e5b59348af5386962a5ef25204fd230b54d58d7fae801c086f8f405d3d0aa7a9a9da15c22b868817cd897d853 +d = 0c81a79ced1eaaafc31b69a40d9939f4e484d625db6364a8e589b6b4d336d458b44287ea6c6aa7661113fc07806b147ff98216fa0c08708dc9d651821b922741deda522b4e436ad +Qx = 25f9b767b8796466c1cc8a1fe6286d591c04a0d115133fc7910640032b898a5c86547f57794e5aac0148996151d3ecbe0d5939dbff5722679ecff378e3f21bbf1354b1eb294d1a3 +Qy = 074c2b91ef3472e60426d2fe182ccc678aa0abb8dda15a428e4f6f1ac401b015b2b7d83535a0a92770cff7666659e1cd33941bea1168cffde82db0ea83668c2d387e6f4bdf28cc5 +k = 27b407a29553203b829a87eb25d6d140e41184634ae1c64c6ec38e9012d0b06a1f4ad9877d7ac4236a22145095990233e6c102a0052ba18cf6e47e289cce4f2ca21514d8868bd68 +R = 02416e11fe2f8e4738ecff1710dc827f4e03c8e7f04a4f52e755f0c1676abbd122eb9751ec1fdf6c7ba04b4e29f8dee52bff7e9e726e28cb3de6f9abf2dbf58c0519ccc7d70f076 +S = 0b96f107a26097a468c1d410bf90e223cd72c5ec98d4ee4ec2e32259d7670d7e7689e62d36549086139f6111884530e20f908d7be1edab75180c81a70ece341f7eda6e4a43a5ad3 + +Msg = daebfef74b452f039c999ba0528be3bd9e16deb5f46f6eae87b63db8b89952c949fd7db08311871eb2596865eed107aa065f030226ea675ee3256c31a3f85ddf4c21760582144e07af208f33c5f47cc026db5403186a65a47940691ea2d74ffb1245676260ef5717dd879d8b5b72d96f87fef5f762d4fd17454cb5ed83d8a11f +d = 2f24670c0f77d2ca0266a743023d2c7413d56d0b5ec77b454ac59087efc4ea4d46179e10278e4ba416ffd8c3f9786ed202faf8251c0ef5a9ea5371fbb35b7afe3d15a9cb4bad975 +Qx = 2da72b8ae64c5ee717c33758ec26153a342936f9d41dcbb136590e1303b0e220ee84c8a06b83d4d9fc924b8808de94dbd780cc8243bc4448efd27dfaa1572aae6abe574be664939 +Qy = 3b3a95d962c48a81c48713247801e4ee630ec7956c9989023ba16f02f5bd1ef2edcdd1c8d314be933225c64b7f8a80542b209b944e1f3fab95795ffa134e7e28e82307dc62c2962 +k = 2bbb9abd2732994011c8d294c5342e8b1f7f3c1f5718187e9f75832604b43bf75abad5ddc85e8d92cdc42656cc9f3349afad3f9022ccbb4937d9ffa9cf48314b604e82bda13475e +R = 3986059f2e096a3675215698e23b53f471c578891f6d721a34a0d231d16348d5bf9853c79c4f4aa94642ad06cb7bfd11f724800cb5477636b6fc0586fb6efb8eb9bbef62329a884 +S = 2beda064eb3ffa1c3b5336613704b3bc3d4ff7b0e977df16477c7e33d480d678804bbdc08088186fbc4764be398a26c13f88bdd23e844be0d7ce598bb87c1b3430da02ae96b3767 + +Msg = 62af0493ae79d71b552c4647d1fb7ab2f282a91cd44aebd8ef344dfd77b521b0c0a3f72e4513c8ecc0e4b84efef3df9482a07ccc1b740c571c5e69cb913740a792aa231b9dc87edfb72bac188293c6c6e788cb3dff32e8f483f8f34e21ee7efec71302cc3bdbfa47908a135f6ef3ff179dcef26d1a3987f7be967a6c0f799b0c +d = 20985f2c6fe3ea04bdbab66a8b6167e5969c073b9d53cf3c77cebbf73f4dbf75e601620ec9c3107bf3fbfc6c79f8f063409bf8fe1d14b19e323d857e23dc05157d270c7514137e4 +Qx = 010712d50ba7752962b140cfb943d9e8dc3bfa497bfe81c42606f4da5157656fe2ba5cfd33ddffa0f27fabef8e267688943514df45e642ee0454e05b49f7c00f5785777897d225b +Qy = 1a2c7db6595c6d4c55110210c564cf102739760e7f5a29706fcb2515d99ca00949d5b4f291716d0aa1e3a47efb9632410f60e2fee1ada47171f902f632bee85da75c7f3c895c24e +k = 2f26eaba6452e687af452d5e1208fa011e4c84ada92a38f0a204a254641c23ffe1c184fa8bfaff047db590ab40accda408717e4f30811b75cf3a5877ef99279476ab924d92565bf +R = 1280adcac1c79352635f4165f9c5c1b6e1e6e33bd74d781773f483f637462f80340f8d22cb24c9db5e49ace95a676df3dde53c8721f672006382ff806410bfcdbceda50e53285e6 +S = 07dd52973ef30dbd480047732622fb1b695fe3cfd080264d2aa30a6ff3dab4ab362518c4f3de4fae042fce78c0c8fa0e763eb187eae2ff8f2e79b3f38cc3c1aea897e1f28b71a19 + +Msg = 566f17851951777ebea3f8285610cd8ee5f882a68e7a4205e6fc9e2d66d210ee2505ee73d6503169f7b903012d43e7e99efa493a8e6ef926b16b9ad8f52156840ab561fc6b680120a88714fd66d1d0742189bf06c155e1138ee5314707173f7352e2cea0fc26e1553643f2490428718e44afd8372cbb7bf5b88234318ebf4355 +d = 2b3d641607b8a141f876f6d285ee46aea543880e772dadd5dd83d595b9643191d9597218e1d6adb081df133304037bcd2c05c24a54e6c4cca64fb2cc4569d6882315360059496d8 +Qx = 42f2bffe25142ac6c1af26643b0f1c317b34950a8a0f112a0cd4ea4131303674328e0bed5d9bc7ffcbb9712387cf67129365b4fa8a9e785b787c170463b24f6a7962c1e003c8732 +Qy = 070962ac4d3220f367f18caa7ceaadcb82fdba45cd2c034a97aab71f7f7546c09736cb080c10d9a95a5f984aa4a3ed32d22636a7b3d5ab29c86d85db59f6f17ba29eb220bb141b5 +k = 23d7021f5376e7b11be07288a0e47b4326c026df80d7e08c9a0fff11deccdadd479dad503ef2d4fa3f0ab2aada604b57fa7e09dbf5c8d493070b5faebb27cf68ad0b78bb6f3a9aa +R = 3059720e7a2dfff03789e7a514f75f2af5ed18cf1568fa2a5354dcddc9d3c7a90605e9b9a3d0d6fbfebddd615cdd52845ff922873079e06c4f349f7798410ee18e0c69045193668 +S = 1cc40209692cf5f8ed8b82372c95033e4199d378a28b9edcba516820ba21af1bcf5c5df2ef4146b91fd37dff89ec8f9962eecce5c5e285d76a5f03eaf99fa132e98cc40ad66c296 + +Msg = 25155825fc4f9a1c4dd1db837008e7e2594a879052431f5bfc76d0d2565b8fa726008befaeddceef73f3c60fa2cdf6d9a70e56d27210bd013034b38861ae49640ef208d3fe294ac4362f8eea44f58af3af8a9167a36b5acafb7ec95652d5885a0e08067ce1dfbb45a0c89ad1acb53eb404bf88fa5c3c463a0f912b5a2522a0d9 +d = 1afeb5ca87c81025ddf09c2b2c5ee22ba0105c0e619b67a324467485bd839030d149fee44d8bac6f5902a1245a50c3437046b7c89a84116b2147cddc645b6d2fd24d68e8d53bf5b +Qx = 119c46988a79e3ae8833ef096b0a1e2886c4b114ccfe881886859abc031df2b1e75818c82be8c5abafcbc5d7b3b8344e98e3f413d737938845e6eab5aec7e507f7baf0d339a362f +Qy = 3190912dfb5a1a31fbbbb50784b18051489a3cc0f44c42c71d3a54886ecf40507c3240395e8ced37b5253b915fdedd38f75bb26df2a0a8edba865f898a15f2d96f632f7f0638864 +k = 1facccc127c856db1994c4d9e9c76de6bffff81a88d7aa0ca1645e250e07674fba73447911c5b47a1aae815d5e96164854636d3168d0344b2d2d913127011b6434d5a5e545d3bcd +R = 21da49326f39577ee9f65cee64006525de88a834365a00f4f8cfb9a01dcfd6349a3d06bf95990a2c17b7e95cc0589714b7a795c7016b29bc844ae9031488ca354548976eed68415 +S = 3364def38a8ee3116cbd971794c859776107154234d8b198efb19655647bb9228c7c6be2e703672f795ed37481e994b6764d0b7c1bbeb2bd1db90b34f460278a54bd480bf4e9adf + +[B-571,SHA-256] + +Msg = 29acb0fca27e2a10d7b9e7e84a79af73e420abdb0f80dd2665696638951b52dd39ca028166b47a3b6a2eaeceb1a11c152383f0bec64e862db1c249672b3770909f775b794e0b9b28a5ec8635a996d912d837a5f22471b40ec2e84701a8804127a9f1a0b3c96ff654700bad3167240c2518fb5dedcc1be9f56a807083e587bc56 +d = 32c97639b69c7cdbf419286d0a1b406d9b1f2886521a8b979a36118d2a368aace5b02dd8c515f2041e6fb9f026d1e82e789dc826a56d2ef732b1bb0f49be2b696ab5d3d5694a2de +Qx = 0087ff1d8a4644edebd43c2d43d49e140940d215f272676fdfb72ccf58a12021de3d668f2766848044ac404fb45cf6e18fc6700f87aa53b4fac1e35e1731814f8a9d0233e2942d7 +Qy = 29fad3638177541d8392111064837bfa77b4455c21c5f7652e3fb302f4bff4a35b74de8aff3806538ef9ac86964cff755a81cb3002b6fb241ffcae8ac9621b8e034967d650836ee +k = 16a06e3d25873f6dae16bb2e569720ee9c6ae7b5ba36854c321a80be8b4be502b895e1a3d161b001f6cbcf53d164b5485d8a5efa0476f581f9c79b3a291025be01a435e2fc5ded3 +R = 347138a43f3ed1a1a26f5f11549eb8a41f64aad302b6383879886216ebb6d08a4ce270d07a5bec6018eb313430ff017c1bbf78556436d9255e97aba1481f0f16b85e7320df79d69 +S = 28f35e1aeae288122b043deff9ac87d39478607da60cc33d999b6add6209f452f631c6ce896afd92ab871387f5ea0eae5f6d5cf532e7a6ab44dcf44acb1fd1daafaf1ad5423d8e8 + +Msg = c92d67cf6536f5046e15b02158da698bcbba4ff1e4e9e9c882cda67f817210402ef917ae93682c9c3dd817b21b73c6c00b7bf92ea80ecbbef2e67f4f4379d078a2b0f297742b2bb9c3fa3297a7e8079f488555bd37715eec92b4b1cbf897640ae8a1d2a0fbcee5423ab31a37629f98630275e35094a896cc574be0a449bb1bc3 +d = 0f93672159276c5a293582b9f49607bbdb970112f6c63b2b3b5d32ad3c8240c86b1af13a8dff6502c6b6a17712cfd988f8cd23a60693d64104143b3f91adb37f852e9e11a0ef110 +Qx = 19dda59a839aa2ed28f69a62a3e3a753c6fc789fe0d8551bf59095f009d0327386e6df5437846c6803df2442e0359a367d04f117e3965397576d4287398b4b8c92ad278df4a447f +Qy = 4159ced60503f7cfcfcd587bb3608699f54693068101a838d575715de02fff81058d025dbdda430e176f60e423e6fcbba889914f6409ce51d51e89e4cd7bbde6d24404e5b043e79 +k = 10dd216d4b3da2fa6a75de60f722f1f128776741cba002c055d1445581242a175318291fae313eea11fd905b20d26cec845f57a3d5bf23ae4dc93d886c0594f1cf7be4f59f3e3eb +R = 128d5c00a48c7352eb980d9c80781f8abcfdc1ddae415b7ac94b4d85c3d7d4f7316e2b3344ca50c6ae82938bc728e640e59e2d733f0c7f7025e66c15c81e98a845c1ed4843b589d +S = 1ab59ce5e54bffc68fda96c920b839fe03d1976ab36978bedd973715ed631bfc8e3edd100043ac527aeb5ca121da848bce4ec9799f55b22454e9af32848943058b257e815b04056 + +Msg = 15413f614c4551e3b138b64f66d15f8964c40326a42b0afce820778eee4a88edb127fbf575da5263e5a2627b5461d311813ea868e6417615e7c4938313675009caac28bc7a2f4c0bc37572d9bf36a3b1794294e09c0121ceecaa4b916df45b0dd31225415e6c87cfeeb092a008fce2c543cd62365779ae28f29fa02a15d9dcd5 +d = 3db080bc99c5fe7e06d5032167af56783cb423fae59fb5b3c6bce5fbedf56b7b39b17810e48ea9a172881aa1f42f5e267349b60294d4a208b4437666b44abcfee5a1829e9467908 +Qx = 59d1b3f680da784b49dde3b361eee819d67339447d7bdf7965550264eb63bcc7674b0921f02e15d45466dee52b4c0a50c2bbbdf226af1662086476a9eb1236e3d4c2b6219af1bdb +Qy = 4e3466200dd6ecbc268cdc1937ac5123cbe33f32110cfdb8b7536987ddf5c9ef2464d2334f315b9b489cf227a6300b6e054fe40d36c057a692f2fd3e762624069e2adefb65d24d7 +k = 37fb32a902eae0c5d7cc9f9018a5d1a906a3d1b9adf5bfb696ff63f105cb2e736d9bc1961677fc897fd3a9e9bedd370be6f25a03fad425b5a293c66180df78db33aec4a188d3db6 +R = 3aa8ab9fc9073429e52469088aea91f00cfba271b9dbb84818460883effa0c51d6a48c1905d6f58d1312af073dc8735c29957f30324b467797acf86e028410de016338b972013ab +S = 198a746411333172daef76359e7ad23035a0f5d14c283cb268828bd876b96b5f767e0c1e2796def7a51429f39ab2332ac25d8e4f263f8dfb9c4c98da2ccc398fb3bb9a6b28ca28b + +Msg = 9f901557451ae2f8ec79b6d4adc794cbfd9b2e6d28f19409532d91682820205308b41498a4e1ca247a2baa8da93de95e3c0f7afd6ca46bafdbdcc6d3374a12684676a50988b86a960a82180648c8c1e38f8fd9af604c7be3be4b24799f4544ac96d6360cdb83d1d0847fda21642934fd6cf65385b50d86d4656987901fb88d0c +d = 06ee767f6f36bb8f364f324d8346455c899a49237d759003dd52cfa13b9baa4c71347b134b24ecaee32d247c34e3787a0c64bc5d299b55c86f64b47521d22f2c09db225b0c84cc6 +Qx = 3f971125860f4598fa310eb7a8c6b4e0c31bb721fdc17ce6df9af557beded6006b8eab10ebe7f3c4f3d759d4a87dcfc1fb767ef87beb1f5c845e3f41503a33b28b2b5aa1644dd1a +Qy = 3296062514d4e89d2105dda5bd65a315b9770c45afe4050d8c3d15001405b1e32be5867ee90cafbe4e239dd44d030b4fda855182f1fcf80963c1300cb842459aaa8c2827371876c +k = 2b247e2dd0024f534ed2797110df6ea4ba166c34d91c94e43b045c0ff80f124bfec1cf3be3da7c58389d352c8c5c1bc2a2e876a7e56301b1e688a085ea0222697fc63141564365c +R = 2858eadd14373aeca65ee5a2cbbaceae4b54a50e0941a696406dd86d05c07c5599379c066b2288d01b2a43c9ae34bcb8c36f59d490aa8d066fd3d7e539ebc620a7176507ccfb232 +S = 33c20d26dca20af2c56982fcfa6f085bc5c317d01f3b1dfe0ade1ef6e3e960b18b626d17d6696c936f04090ecd9606c2a6ecea1cd1883bbbca8b3dce3b0acb2688fb2834aaf922a + +Msg = 959fe5a19d7aea2ba611c7203e19f8e3f3cc101e03a98f91adfef602c424c580d5a868659368a930f9883d699fc633bd07f6cf8de474937db0bea86fa7cd140ec2f202663813033a757b93bd72afba15be5e47a4eb93e8a666aa1c72c241ca3922547d63fa3732fec54afea7ade84302e2f044275bb67433fb6b125b7913143c +d = 38e2571d9f22309a636586d62863ed67a70538287f3ef88b88c3c2fa1a2900d48c342b6f15c26b8e7fb4875cda4093b7de7ceda48fe1e2cc2975afe958040881de61f309931e48d +Qx = 5a221634ca85059543e2caf8bdf79c43bb78deb35e9c89e07d553bafb6b31750a1d85ffa7689e528c11d8a3dae442b4fb2a4a21238d636eb04ccc04c8b5d794b0a213fe0480b1d2 +Qy = 225ff457b6cbc12d152b08025cdb7e1e921ee553add9cbf83228d678d5a9f5d3d1fb4327a74c1dcb5d69a5b98f3ed1aebef0af09bd49d253a903636ef5a66844c500fa221470f2f +k = 3b4de49d57040141f3584ff596eda457e2835085d350b75391d90abe728723e1d1ac6413979d4fc3eba98d72a01248e6510c722df15df876da881ad50539e4248facafcf311b464 +R = 00f259038b4d3d036bde101aab29f4558e88e604c62f967bc7a35eeacc6a56294268f8ab00a34f9a0319b07754f502c98718e8b5c91093cdbff2c8496fd63d6fc2c50a35f87f423 +S = 2350d5406922e8822a91f7c95cfe8524f017a14cf7174ce534c60aeb351510d06ac20dc1249129247b21c72c14b02b710c26c10899bcf995143aee632e294176e903645b660e998 + +Msg = 97b9688d9ed5101b8cfb19e84b89cd644262ca1c7ee18944e29ddd3b4cca78e06338b270385b00a5e8b91ca5e628de3bba50e36ecc695b3ea737a9cf8b36871c473a54ba17819f49e730c0f253b0c769aefa6c16366fd2dd612f330e95fb119fcf3bf7f3e254438c0ab635ec04a8b2424a05b483ecf65b74a93636fbab7bf1d8 +d = 0c8f5736f1ae65592f3ca850f43d06441aaad8c03820f3b08d8a6db46488dcfb828459f8b3f34af73cce8dc7a5e3834e085a64523d890028e194214cef4003210e6eb530005b01a +Qx = 667ce3db45b8772f717ce20755ffaba968aa1314d75c84073042436823fb54bf8dda34a6bb45a61d610745b1fc10eb0eef71c4f55b26acceb442d822d6e2a27761c73b740f47289 +Qy = 56035da1adaae894e361f5283b3ea07b7d9f64a298be11de9fb487c2479b120381f1c60cefe5d32d37e4644ac86a170f82b1c4443eb71b940b21c7a016b559c6c79835532c276fd +k = 190468668989a607a3aa966cad071ca8e8eb152b0dfca9205bc9417a3d612ca1105c7b90340b04acd96a5223658adda16bf6b598ea9f32a2f8d1b61c2c2bdc08d6a49de246240b3 +R = 291e1fb18edb7a93badd6fab6f56ee0d390f3b6d298e97312d5277358511fc7621534ac035f3518cb140fa4ad5ef7d889c0d5f3f52a4e4d06bc9f647f99695531f85a4b76cb1184 +S = 2d916734e02b0a98406bb5a9723486a7ed40bdd0b39c4cb802af4bafd519803d23c6bed59a80c256a14eb878229942f67e0b8159d5cbf24b719043171b3958fd669adfc72eb7289 + +Msg = f08b250bf4a3980cb455338b3f4173723b3f44c97bacc9cf550149794a71426e398cb4a74bde141d8b7b4a72942f1c069676a9918e27792cb8f085ee037c78e3c468adea5123c4c64d8ca6a39f2f90140c5d2d80b669cbf0d1ccb466b18ded83a1d5f042c36188a04111c34ff769abba9aedda40a87be1e24b700225e2078056 +d = 1ee68c3994adaaa9e0d61bfcd3bc1cdf198d3fbfe28a44e5dd518867ea04b20e795eadacc48bfcf8e8216dceeaa069b756e8e99ed87b6b1d31154cc9310bc3b4555162a890b0c6c +Qx = 3efc83ad15d9bf889c9afbd769bdd1dc8925b0462c93868d85ca7554b540d8c3ef7b9a63becc85981972eee8a70b7f948098ac050ad594ef2ec249cc3b557844bae9cb2cacbf397 +Qy = 42a012b3a1d9e46cece4fc3460a2bedc9af4ce0289e95f69550eb3544f7c105b5769fa52234ac88f9045ea5cdd4937664846d26deecf511ba6996ce4072e763e8ebdfe709660888 +k = 031df03a6cec2346b92d9ae7d3d983edf577d9a1bb88098f886f38536d8d8cf25def57726790604e674d036cbcb864bdedf8475ba9c850d510ef93b844c037e04348d5f48098c20 +R = 112dcafb63bb125d9610e59883df481bfde43589e46656b5952cdd72238cfbcfee79e9165e3c9b89c9ffed12d303225ba2af19e00048e20e4edd3968807e4885003d148403321ef +S = 2ded1456df54a24214d8c1d3fb314db52b046ca31458bed69bb3aeb6a9ece509ee521fb8046ed43accc7e605440a09fd96db659c98a7dd606758c0c47e47acfa326b9ed73ba4b28 + +Msg = 1cabd16fc29d7d919622810dc8b23c770b790b98b119eeab1b20900fa94fc2ebaf76be4f5eea91fc5276c5621c8677d4d117c4a5a782ee2ca1d5b0db997fdc8a05b6b3fbb833d7a7b81c3c615c2a662929760a96feefcf89e46b563314c9b77c86bf34438458b43b694ceba741b97dfcdacc0ed57652ae62856ce10ed2690770 +d = 3a6fbf66ebc1365ea7699c72cdac2dd85907ec59cd26e2d18713354b619ccb83b7fc0db9193aa8493c1855f1a83fd987cbbb65de17c59fbe79256aa5392f4eba045346e9ba26592 +Qx = 559dd556241f9b11d0f91c5458ef6adb783f9f5051bc12cac9f0b214f836f7b149d00ba8218e873410a50445da9fbf68673f3282d783988981fb221d0579341892ba6824e0cf4a5 +Qy = 05dd0e594ce41122882538e51e9bf29d159fcbb8b29b97c5546582390ad5c59c975271c58ba1e75d70c3898fea929ef7316ee830eeefbdc69bd80d7b0e8133b977cd573a3b422ee +k = 1c5a193179ab859ec1166575007c3cacb30d31f341a0e82ed6d4ddb32da909dce08acfa10fb14183258caa743010fac6f7d0fb1f8c8f55c246e49a97f2bf571129144c23de8d68c +R = 2625d0bdf37396585d22811a12ae7e0c3f512ffdd0bf4d048379434af46c03c6067dbe7c271c417ac5307123bf58a9f2064bd2b3a2d4b4efa3027959bfe63e13a851f46a21da6e6 +S = 13f16b211b314a7e9918f3254da2f1aceb5340713985610f03ec1d0a33ecf9217d61076eb153d8f27aa31aed3c9b165be52f8d857de362b2c88db5dccfd708a996a46b76b4ebd09 + +Msg = 7bc8bbf5ebeacf40b3c82eb6eba5d994dcc6a3f2e12ef741f90f90e176d20c21e006ecdaf14cb5beef35bff46b2c374d9ee224516679b1a9e9255cd8ad8e60ed234f8ee7e0fc53c9021488158217d4b4369cc597d6053746efa1e73340bdd73c1bd2eed57b92426fd4d278d6a86e8be0f0a66ab3dfadefca8831b2f488636251 +d = 145748871a0b5c1cee628de04a12fd68ff2b154fda96e47afaa96389d66d22802968584f6753d36618d49ed205260f09d3f5ccc2b27a34390ce58179b9834ff92a86d66ea0a97ca +Qx = 6cc7ce2782dd67cf1fc16f1b24ae46fd085b969d936fefc409a9bde354cfd33a154a3113e837cfb88284d75a96f5fbe85274fdd0990af4a033a6c40b904a5e0f666e4d8b8bc3532 +Qy = 7adfea166087502657bf9e2c437beb2f62dab041553a06411f6c9dae83a2a2749a4e5a2a36fbe23d40816b1b8d206b9f5cea20ef200b9150061ca22fee2076e31c88d60a006ef4c +k = 26c820dc92f97dbf545f51db7d5ba649333dde38eaa47d8a7edad9a3cf3e6780442db234632458ff17e1d7b70019916708c128601ff547ac84dfb0173cf0a3c5d69ac96c3d7d395 +R = 338c88d1bbd0b93f3f1fe1ccfcbda65fa1667ec471730a40eda87f57b3eb63d979d8d6d819b974619799c90b09f33c051b8b522c3a1acede101857265ce1b58cc7eb5698049f494 +S = 3637bf89f9b66c7ebd8f91a8324eb70a510284b39f0f2e45578f26f5f1e4504ad70a389427f4d58960cbd918c2f8279de52096e25a1b0b0c3929fd5ef56bab6cde7c0d8e9d2fb30 + +Msg = 0cd2a45392871c0c262e7e6f036946354bb41f9c2187b8c4d399231280682f3e0a09731fbfd52c76ee63b9828c2d731f4cefee0a8c46419c398205b2ff80c67d7756db300a0a8385fa287dd37d9126f75998ae1cbab5136560592118db52fbf102b7ff0a1ed45b8a91a7d99d13a0f7fd4366392264aa1248d7324901467457ca +d = 3c71911d24ad19c20fc1d8a044d63c9bb417abc3778d7e6234c6af79b898cbfc2f2787244708d2fe203be786edbdc4c9b12b413156b7b0bab0be8af895d191d853cd58aafe1ccce +Qx = 6cc47aa586a73acddbc91398ff5782457e6da2b10e265153c678789d3d7fcfc485b03b089eb67e6d6955d5c8c7ed5f933d84853576e76fc60332e5f0a62c3ab23690317bf1b423e +Qy = 15604d94ab9f2ae1d74fe46b1a070160513709de2ba8e74fbf9922e9bbe7f6e743b25701a13f73eae0db0c98dc80c5f8528e16610fcf18f60eda3357ad5878add2554a6befc9d39 +k = 3681fcc5fc1f0d7d413abf2e44cb5cce9a4a252ec449ec4f550df4a172305eecc072454efe2040aabaf4fee58ed19c9090061d3c4835c5fec38996f013e5512c0147cb14a4f0fe7 +R = 0d3c26796bb86b1a20ed4935bc3824bcb9742513ce91a66dd523a3c0d8a5abe63488aabb806b5b113e90d3f3c80e3ffa01ad051e6b0d4edfc641689953ed65fafbaf3e554be31ff +S = 2e3129ff95b06c274f7ac08882dc1da6660269f3dbd21a3e48377a628f6d81326084bbb8d32b794fcbde8e574f853636fbbaba480fb36960b0994210bea319a99a46e29b79217b3 + +Msg = e97092625b09c9ae6e152e1cbee207d83361f34cb9b0e727c816a5ed851f12f91fbf88ad9d4c8f9d07350f5d828fd8574eafc768bc72a2b18aaf4d2b48fb10f7c3431137b51850154de9706487d69a40a8f4cb2c799f48c5d8f518aff752500de93cbb94ab04ae1e0c7183a32d79a27291dd07b5fb6e6a4fab76e85c3a8607e2 +d = 18bd74698bac36ef11add6b3e3fad227ecd868f370ec04569462565d2f0af2340bf793486953a7b79ab04f0ab1f0e4fd16bf6b576cce677d543e73aa8edb0e50372f24ddfbff966 +Qx = 231f891e63bc1c43377faa56c5799eb1c877954ca2cafdeb4883ae40bd78816ca5634f48f5ef5c22dc7d3d0df208bab4149815274d7b134cadb700d166a5e3fc73e9be1bab72522 +Qy = 469ea29ef860adf24afdd386347763008ef6fe2488d902c4d513bc0183fc52742782a6fe500d6b581902ccd4f9bf077f975bd5fa89bf240723b99f726c9fab4f953380745ff9e17 +k = 1590570de563ea96eddd900e4a0a7efa2e4a0b389854e96af32bb7555f098a8cb52d160abcfbde65998c34f91338a40d40cc03e4a9a241d3b16b0e893d3f7ffdbf8912f35c7f538 +R = 32402fbee4831b16d762ea2cb218279f4db5e20bc8b6e2e53e89a2ef3646cfb0abbac36116c8c708a1342db2fa0abd39d149e09db57aef65ad8092f37f7962f98c28331f0f20b64 +S = 2d1e38f40965e2697abc7df5896cf051ce5646f135d1ea0bb470a43250af8df0abf2a04ca1e0f1f31013025b4136a8a6bdaa474bf50752c571f883829bc3a5482ec20e2b4a72c90 + +Msg = ae6723b8df5d6ab5fcfaa22d32fdf106d211514cb1892c7c43ca6cd85c2532f85929c8a259ed251215063cf92e1502528d1e22d5cf67efa0b8ef21e8eb2f5dff881ba1433e8bcf2b6af8742ecb2bccde081e534615a305562cc22d3398f61f277d8ca785842bda85d8a40438d9bf1aceaedcfc22c85533794a69cfc320931d3f +d = 335699bfd058ee2e6163f55d1816bf3669acea8b73be9c4ddfe775230925e6093cff7a66813adf22222c8376faa106d85ac9f3c67929bc58d8986795b6d35d5b9fa546dceabbedc +Qx = 7995e02dd3d40f9bc2e6f4cb1c0d29923c9022169e64532d1b357f36264d18059c44a8617a6f1136e72648c9051a27714a0dc833428762275a1b5635a3ad91e65d2713236c20f50 +Qy = 6167d5839cd4476a638c50db218979a93da44dbf97281d90daa8b9b530960c689279fff6c342af97880db1e9c5ae57b91d7be727fd1c6210ec59416d1b675f4dd666e0b121d144b +k = 3f037ebe0e4c3910953e123becc09c0862490e7f590245c4cdf9ea5fce930a7d7ca5d17f5689edae1ce706b90efdf84cd82e06e4ab95e9e2368db91d50110eb91cf44e50cdce2cc +R = 2baaf025290897a5d68c5e63543256523fb086a6f1166ddfd3d50fb307e0f0cf78b5fa895f8b71944a7b67b8afe5f3e10f2d248aedf573860c42cd7aff258055ee7cce472e8efb1 +S = 0f4d239f5af023ff6c94ad7f66d43201c7e40262cd92467c4ab54be8d2b8e6577d14375064fbd00a6327da62f03f75262392add0ec119d820205065aa6238433fadc8d1734b8481 + +Msg = ee20c6b61886e02ed94359dff3559522ff550ca126fed4b2240ea7d999a182b7bb618c50528fcbd261d5e497a991fbac0cf4c105c0f664d6a00a9001c1ed522962fb44dd4159677ce8f1531019f86457c055c9cea6247086cdfe0442485cbbc4386ad002b4bd39a1a187752437f04569705cb7adc0c68f0fd059d946deb63f0b +d = 2c3eaf801330b3f1b0504f2399f1d24455db29911f750c246ba0a134c3b59da8b3562911197764699a92ea1d95a2aac587e24f743df1dad3e1cf7edf955203e24a0225717f8d2df +Qx = 703d69e2dfb13fb6e695b0b30b31d89c8789e8523a7eea15673aeb4f1909192c06c27558eb55f0315f395b1f3ce84d9c304905cfda1d119bec33af9ade4420de2edbe75cc5460e3 +Qy = 75e35b2d6a8550969d49ac5d656afacf68d3a1dc6d17666f46ce3413c855b627f0891912e373af2ba91211c20f067d66056e6bbc0814ff3921d944008b25d8772cc8d696bfe1d09 +k = 0a9ebaea478893aa0e3bbfd5d007bcec5ad787d9bb5a8e9b8b79865c584966f0bf040d36f62a8e97c123d2adb7f38eb49a86e9c2ce1294d04fef1b6fec7908c4ca1a70bd1699a9e +R = 2d495eb5f6fb187a0ee1fa772ccefbb969e854abb445ec19ac3860f40ee65f53b92f6a797003574bccf0b9de8014ad4e5745ed264eb3ae88040ef6518809b4c66f691d496a85d51 +S = 1840b2977ff137f2a8f2f7c25e347cf1262fd128e008e30e4752315deb5231098c65e9a585496a9d6b5b56cd0b6d7dcb7150a077fd199be2d2de0262aa84dad414e100ac6162346 + +Msg = 734a9eb8288e32f5a67cc1d88704523ca2c68b798d90e188d871d9f50d2da2063baf1ee6685c45832a1818aabc9afc0bc935e97969dc983a484f16d2bedb3c7c0b8221408be2480a5562d5d1e5d8763d1e474bf2826aa93a68c3b870e3bf34f4941cf590d88e1f5a8cd782a33992213f3f6b4b4f6dbfb3c3c8f21f5eaf4ef609 +d = 1c3ff067497e5d387f31f0ecc9c67b3c0dd6ec8c81318c492aad83c9dec6c99e4fa47447f6f7082d636c2591d0df940b947d0a4ae3778e2b7cc8fb92214638399def894ada276b8 +Qx = 2e56655e37b3e753f35eedca95f8ec07b7a3d3e14e365ec041cd9003bdb78a7a8b8ad277a67da5d63dcdeb0ee8d8efb68fe61aad9b1fbef4373ab13c44efacf68cc499faf5b5dbe +Qy = 47bbec643d74874b77f0fdbbd2df3f3ff0d35f4b3e1534b2c4d5c76b8cc51693a70e17d1d4cd64713c5c05966c826458fb5411ac840ab5998bf3cd64a0769c3e075259a70aaf94d +k = 149848f4534eeeb45fc38ddeace59e8f83f0bfb4cfcd2b8b7acd0bf19303051a6a8fe75d4cdec1be036645beb075c772aef4a58785c16d984eb43b9b0317446bc3b3abfe7ec2cb7 +R = 17eb68556224f995733077501ed295088cc1184fa3872f5f11e97cf67c7bc1febebd31206a406c4479b60246a517cada5859d4f1aeb98dfc108e96e9898c6e71e59e39b6284895e +S = 22904497dc7a98fbe117e4427d74f4ecfc4e14d4467c99227427e3abb8d3dcc406f3704a7783d822ec1118a1d91d5945d5b902a2ad325bcc9c17c68ddf8b5323df9c2bde392710d + +Msg = 68e27cc72fec8f3f1f3882c6efa08efdf21d74d13be5171da35ef2855666ad2ea6919d21dbc1cb6d296663dcbceeba2fe47a2c6507d3d4a67a61b55b0f81c93412d7e1fbe15a590e342a05f55daa55f8591171303154e615e81189a523b855829a5c96621ad118f522e397e2eea05c2603eeae6e3591215e29b2289bc384d8d4 +d = 04b4e04281b210fe78d516a5b69f878b7fa058941ee9ae8cc63b061d1eb9e12c3e0ecb8717ff4623ff5bbbcdb53c48adbd9c69636506ab929c5507d7ebafae5654aad65a263e48d +Qx = 538049d071158c62f0102fb664a47431afe320474a173463819d5f83f6737b43880ed378470d774d32ad59cd9d75e5bb06b118f1297af3f6fa910f40aaffe11e46cd56cbd29aa51 +Qy = 0a4a843af9841e2427357bdf26817656637bf4650e443ef303dd458ed092dca3cacf2857d10aa190c256467ff834bc804f8557f6c3bdde89927a5f2bd55bb9d9f1f08a044cbc208 +k = 1191110485f56335f0e65fe04b9ad8fac1c3573cb4690db3e9f62086312d394b0e354890c0f74e3df7c43e718ecf18caf6904e03bd6c0912f906de1d2bb4c49823bc6c0dbfe37f4 +R = 0dff371ac365cb7de248ddb2b2fdee624c527c6c1908dd287a294bb43a4be94c130bfa83710b0655f21695dd91703acca64fe2e7927eaf9c2b9b230de8002798224f9505379bf34 +S = 2f30f31c863bdd68fae16f97fba756e033eada18cb0a23d7d4b2c9ea3c832e61b52185fcd654d9eb281b92a9b102c3b17ebf02422a0e4a7a56a73974208371ef65434c38f4d7d1d + +[B-571,SHA-384] + +Msg = e67cecedf35058b80787589514a9c81c6b9f4bced4260411d2af75bc46b8b2c962dc9d260dc99ebbf8ee64950766efc0e394184bdc8e2891d66bd3300ecc880e9d6a3d0eb615322378afc3dba89938704e9a8d0c949d4bae9838805c00377e3fe5ec6a1a98ad7eaaba6b500973dac48b26b7fb2e1b9889f8c387de535d4b2363 +d = 30f2849a713aeac95fde5ce3af853e9d070ee60709eccf35a076567be2c43f0fa34420b0fc097ff577221275a3a56e759efc32183be2d76058a7d20e5dd59f00415114d73a15b8f +Qx = 6d4ed3cf180e0e307745faa49247f269c3fa0a69042b3b78ad645f43eaa50d479622e27429a6b6b1889944f85975fec8018d3321ed38f6c7d91f2efc98467a027ba4a02c7f231b4 +Qy = 5f2ebf6abf7d53fa32865a9b6ada9bee51c1fe26cad74dd6ef78f13872f340d64170031becb5073001fbca373be4e32ac3425d705ee942e6c4e639bf72379e34776680a387a0c6d +k = 0da9d8647d0950f558a3831b47858168b3379656e603f2bd44046ac7546892d1a7318c5a9873c6ff85683edd3881a0f1af5501d17939f0825ed37bfc9a2d95faf43d3be92b237ef +R = 0fc7eaeef74806606fe51882c6928a06bf552d18dcc4d326d44a540abb728146657048b20e5fe2868beb5f04f32d43e9ac23a7f22c6bf325bca24f5e3161c868911ee61baa8a3c6 +S = 33d63693268f3762635373fc901fd72e525965ac17e2cc009177f03bd3524107b30e4c6d80bbc4f87fb1f288ed56812994541fe063f1d91afa7213bed8be5693dc6c17ec9a0714f + +Msg = 2baa1ac3f07e34b67b6af087400f261e138b070c8475378063286c16fa73578303380236a4af2484ea01ba56c1c619f6ae4e5e6ac2594c8e5aae7e7f196f96fc5d0f507bebedd4d818e77b9120e5b4bc01c7ab6339e88b71d0886631cc7fd89659bf513faf149c61eb14d55060c8dfc7e6e4c2b4ec8edaaa6bc36eca50a6feef +d = 2ebb73d04e6e5361e20629e3ad119b33db5163ed91fd9a8aec4b774898784b6822a08992118a8fe6013094bad0be1e9bf01b27c069e4335bff7e0abd28a10443818f6b825e9cef1 +Qx = 01710eb0167e8c948d381e3a75aa1e036b70c414f69260aab434ee20b6724dd7393fc487b5b3822e5e8065b06d0785a4a7be7193352d5b9eee66755ba106ba6e40f98a08c730a0c +Qy = 6006f98fc25a641a7c6e67fedd37aaad77a9102be3e1e7d32dcb4c68029e623a42f4ca7d1ea725bfd475756b80e18904107c460fc03b9bd68aa46f9dfbd60618670c4d9a68a3287 +k = 1861e2a356a6fa8096418cde7fa17f1b893a7b63810f3fd807a82bf4c745aafdc4963eb7a0ad0488a776e915b64d2b684e46d244703eb63b77835167908f2d6b06a2ed7b53f0717 +R = 046688e12d26cd96bb05d3f418d8ec34f4426f594acd2bfd8e9abd79405e612d60737007440424bc4f546c54b7402d11880f68edd996f49277b729450f7dda5d05986b014b5244f +S = 341a80e74f3a69b966ef81ae95dbdd60ed5a0446416653c4df431ff7c4b4272665a523379d76725e9fbe196018f0e747100084c823b95d7c7b1785d3623e52e9adbe773b81b49d3 + +Msg = 0e640581f573068d8ebd2899a6aaeed0bf987ee11e22b05d25e88e9a1c3451f45ee3800d976f4603c18a041febef07a01086832a6f7ecd5d498d52e796a9d90758c87c36f4a5b704a39c456aaee2d5278183d5815d619c193da9fbc427d701bab0874bded848cb4bb066f56e119b637c78aeb6eaa387c41bec6cdd4bf7b2061a +d = 1bfab717d6f6e16d9bc6e89d2ffac7cbe0f808cc8ca2eb515af7ecce5f3b230303775710a21bd25c2cc4566bb53c78c78e3774a9f306c751cc6e149929e45eef60f56c1d2388c6d +Qx = 6935c3e8b58f7bacd045e745054c227687800ddd86d6e0c8b1e426f4df0e4b71feedefa9172c43becebbeee8ee382a75396fc5f29ef3d2cc55f8afa9232038609b5034513b222cf +Qy = 138463efe3b32259dd90b759062f848deda84f2bcc0d687c410f1ad2dd745517c96c3451432b1e490902208cabb68bb872ec493eabdf1f3b07595d23a54c53e512777abffb7fc65 +k = 00025bd48e2dbbf1ed8bd9c1514303dc503dd0799c7815870b902249cd1d7368380853d36f7fdefad973700ded1e0d66950181b0aeac73eb622c880571315f09504ed26e28e85a1 +R = 1b9d6ccb19b208022d3a579a66957429682517e84a71be42fd571fbbd0247609d0b5b33808189efb52d21e6421d3b08821d82900577791b1c54e239b0d908bfbcdc060cfedaefb2 +S = 3356320389ffde577496c5b46a0de6d53005f5ae3489c0d292c5f460a3b7adc5bd204bc50a3bcc8538e0f8319c79b9024b065223b7ed9b0f211c5c224d363f5bdfe04db97f99e19 + +Msg = 51a2a560ba226d629127ce1ea7e812219ceaddd23561256331458c9f11fe73990f21d0dcd974a3773040090cfdc8e0f01692d951a0cbb60f8448a016c67abf46a9c150466ac77e656ea827b0ea7d1e77ea32071ba8314fc8a2edf69008f498bd1c18061d7d00f3340a7e2cd73e9766862378d8702e804a1870b442beb2d0aa14 +d = 00cc53bf7f1cad5e3dede4b4f4b082831604c92dd2b147869cdf1107259305b1d50359647f9f3d7d4e1e608865c65dc7c9ea46bc324dcb8423b554dc369d621743cbfb592b70eb5 +Qx = 20187d7de90652caf1210703ef65cada3b88f978e14ce6055847be7127602ba7a5391cef0fc9b009134105da7b09b49beb7ba2f961b84e6d66bd818ea99ec106c6e8428b17394a6 +Qy = 197aef36e47b571ccc0b41f948392d6061060063137d8c3b999ae507b76132fea1563775be555616cb5816b9b19e42b34f9673aab833f4beb9d1a0848a4bbf2f6f44cd03982748c +k = 08acd0f8f9660d21d62f391112908be73a4342767328d3375a8806dffd2598b6d77fcb4793e69f2390389a78c2b11866cf0f03666a60ad088d2c77bbc49fff6efc5b7283d02bf36 +R = 1004bfb78dc0e4fc0f2624bec6893d717a476fc76bb5c1d94c1dbf157aab5d1dc80f98a3aeabaac94d9cf9e26e1dd172f5d8fcd5b2d48cb3b7f0a4863813357b5cf8eae84478e44 +S = 30b1c8857977181d12c53cc2efc53a427801cde2890cf2ea2c99c6958b6869d0ac78ee2c846c241362c885835af49c47d20c30f3cbfab27d9cfeaa6d858694bab059229e30bf845 + +Msg = 90eeecff0a2e37df318c441df220dfea013ef29774ee92a56b213e13a798858f31e52b6ccb7599e7314f12b48a89884b113c1ba0526a54f3e9a33c940944319e084bff320cf5f391c02c731c4c4f8b05afa273374a1705d6c85337782ba7d36b9c00767180cad6422c11c581672ff631fa4c49d41b02481568ec87ea97220400 +d = 2b009530cb9d586e35dd8951ccb686833afb7a37ec253e547e85b253ba999f0f186b6d4ba41091615fe57678e9801b4dc94fa683511da25637b2acc9fe60936be15af16234c4ee7 +Qx = 5913ab6a2287d946b5b6d1e6c3d64117e085da7cf6388e333cf58d22494f4b067c684dca770ddbcea5db73f048b296e9c17284a8912b3cb722d9eaa17b6b1209311fb8e8757cbf5 +Qy = 007124ac6c48ac56746563db247bcfe6b20215ccc5cfb1d43c923daa07d429c8f0513bd1ff1180ef0f7927fa23fda1af25d20b22c935c426f9ccb402c358b57b812516c43111779 +k = 27a80a19e9c320b57146845fcf97d6debcffbcae877c33c62aec62a3351ef40bd90ef4c2ca39f9e51086931d82eec4ee7870365cb14e9c54ae735069801ef12c571bf1c7c1cf6e6 +R = 1de22c8984c593a0948164e6cc8631489133972482f6a7fb1c3c13f97e4584604930d369224850a1d24f267f41bc6fca04ad79326aef61f0d429e0e1b9e9d9686ee10f2bc52b104 +S = 085c6b34687081e280a180cd0c4ffe95cebbb0ad6d3b20a7341e467812f88c23973701cbf3cd2bcd2811415d0bf0cd9df229a88754f4cb0c225a2d11f57369a29edfd7b04639055 + +Msg = d3740cad41e2e365d80ae81da97fdf06d8b6c278b505e34cb683fb55ddc5189da543540914c0accd405dbf0063f6222885fda4b316dad4a83fd03e8d7b7e936f87fc0a5b095defc8a4b22fa97f00b394e672d5efd3e0a230c7e44dfeebda88641143502a400ed62e2a51f9561e5d652a43d616f16699e875deb9610c77de8e1c +d = 2cc2d0d7189cc8fb3565a039aee7633ddc00ff427cafad32fd2010b10fe249c9724d91785e7080203626038109158e3a61a3970aa3e51688aa7f5184b22f63af63f80d3540ec023 +Qx = 5fe95a030efac2e5d9522680da58606e3e7544a317a3f24d726b69238367d30fa586864d8c143c3695126ce8dffbc7e7fb789f956dbf53aabbc38af988ce50f1fb30294ea3e2d48 +Qy = 193d1e745d82781ae5c3b3d2233e502959d6862fa7987c6416584504f65639ca765578378b75d3844df179cefdeccff3c4c43aeb8865063e176fd43a27c93e329f8d4f6fd5bad21 +k = 02df3920fe4d328315353ff11b0264045248b32f48e860dc59d931ad65f39e97e3a683c7b5c64b21c3fa50a9685fa11f49df9b14ddaae03eb02754b01e03f60fc6aef1e5d6d7d3c +R = 1b91c4217b1580cfab56812c16bb5aefc1534ee8d049aa2e1d52a5bfc11519ff89f0d36ea2bfdfce8b5d3cf1527dcf700c0208a70595e9ebe4feafd0eb597e05df54212fd6eca3e +S = 21ce52440267fb16e713eabb8bf2d502c81939799f9d09cf48a50dce5da999f3b457dcd73c212d5d070056b1f373b07ad06e90d96febb7f8cdb4c423ef946f0799c038a3ee68ff4 + +Msg = 5eb53b5f92121396c5ff30e0c92da48db4fbbdbf27297f9bc82614ab78f7fd863e34096c615a02e349d8bc7ae4b0700130704bedf32756b5ee6af10da1cd717d624fadc57a9aa6db4a6c5d6254c0e8f8c3c0d4d03c264eeeafd52cac2c1968d9d85b106167a49d0ccdbefb20bdc10a2555f8149203af52853169a02db94e5e2a +d = 3d8936c00c131e38c6566d2464c4e207c878070bbf681695a6cd98cab2c6e80fe98cda80c66a5cf584e90a071144dda59c07b8fc7bb42464dbee5b6f739b0f2ee5fdff7e5a4e7cf +Qx = 0fc3a8a320e816305772bd5116cec2795d58633a9f490be8a1a360f21d2aebed6038ca4a5081288b6bdb1066307c26897ce38c24f8ccc98a63e371ff6b54f6016917b430c267af7 +Qy = 69719c868d8fd25a38a7338811904e3330a7b2289a8384bf24f6dad5312160f0093bf556fa061ca5e52d6676a8f1a3e4656740c82d3cddf0ac4f903ea885d42610bf1b45d9e57a1 +k = 050da632cd7aa58340adeb20389a2cb9897b8ec944c47e7177da65d9386a9dec5d63be7bb2d0f5b4943932e1fd7d87d5d7a80bc50a63dfd101a6a28005c894c6a6fa4c652dc519c +R = 0e6152b9050127bf306662f6beee81d024492b91efe87a56e70596a4a72cd02dd2f10b970c9a69909f85bf4783dcd3c32505d7c148166ab43b503ab098b6d95ef09a7932359f60e +S = 1f7d68d53ba161b61eeb17139eeae1587a6bd148e288c1f73a6bfb3a0d1f6dd8f9cdc27fa9e8c7a681410500c097ad01f320303421f1239b4a9c4d5446562b5b3cb2fc45a6fe239 + +Msg = 5aced64f702a57ed7fabd045a40c967a485d2a70b0a5e82561d5141ef329469b2da5964a34df203a980111a77adca376c643b9030aa74516f054648c1534d912ea66582adf3c655dbd71ca55e47412315df5e2893e43b2e2dfe6e4dedf426f11846ebef34a99f5615460ce0475f7bc54b4a4fd99e83c982097c3136ac6188a5c +d = 3dc7de970bce28a943d7599f2a9010fc99435b93bc4ba884d42503ac2941aa63fd07db34bcbb1127d56d6a4e277d6ca32051ea3467e376f74f98c3999d2f276b282ef8a28cf0cbc +Qx = 2066a50b9f961a58620f473fcf7d5eb635da47f4ce362f428669ea578d50d1c1513c145adcc03ba98f3d67bb422141c73e2f94ef9559ccfdc0be20eb206d3d114a5db302bd0751f +Qy = 4437e655bd255e7f013d197210bed70c5c1a6cc1daccb96145c9c438c8a44b4074629830d8df9914166c9378b33040d71918cdd0f47fa64b7c69f43eee0f34414b8f64882f90ac3 +k = 3b2e20f4e258b7f0cf69a460fece9b4794a12a37c0f8e7aa6f4f51dbfaf508f6f1e0160ab4388891efb09f0ca1f73178f0e8598750c9debd3ff856cb3a2872762ef9e16487a9513 +R = 2f265aa99ff806ffeacbf9ef7be575ce5300d3cfd4225b1835774ee075d7e530c9fdcd681584223f84a497119b4eb1fe34cd31d654c2fa262d7549acc251cece9530b26cfa3ab35 +S = 2c05ce4b35544bd1f20a68eae7f3483e0a0628dbb53f0466166257f69a7a110d2838a76d204e7a955a8977508e65f2ef6d7deee13e4e2ec0f2b9a8b4bedc26b3502813b0334a1b0 + +Msg = 43c24aea343d4e088bea25be69a332c631275c36677093e057de69cc83a4c5e70ab270e5a8930f55846f1a22ec10e03007dcf0942c6761e89c65c6a4f032eed97dc3a2c7f7ed1e82552fe48828a132ba16c41f6bd82a49335428a24fa1679522000e6a1d12c646e0e4b4c584398577ea9493bb334fa3cee8bfdb6c2e66f46436 +d = 2de6ee12eefa7a4a736484b19b42a513dfc059a060976edc3b0aa4b50e98d72df6506fed0499ff8480986748e938289e54a5e86c0c29733a9bcf5985aa63d8a2b57933a04a8e8e0 +Qx = 073fa1b62d469f2991d54f1472b60da87ba51be0a9dea361d417b91a4a75373695e9f27b3c672322315d7b566b1f22b96c54adce3e958080fa8a02836955f6264dad3a87fd11f06 +Qy = 452c0a07ff65fff741c96851657a5afc7eeca239622e1260414ed736a04e487157c52da98a7845bcf6f311e0f2e59bb92248b6d47dcb93da6f7e0af644b7aec7603a01950293d8c +k = 1c87653066057636f9a98a7c69a84e103df480a92739abc4d5ba53891591e3aaaef6ef3ef5e89213abbf71af9c84d3b30898580e782f557a03694446492afb05ab801d7dd631c8c +R = 086d539546c61e82d74319f0180411172acaf08b5296dc6435d4ed7bd50cf23d3a071deb3be01f74408e64ad244f069cd41227ba127145df5a357489f944b61606ec75e8377db81 +S = 0a34d9975fbd601614d04aa41506b03fc15189ee8102c0431272d691a322f3e77bcfd19d8bddd19b307012b6c6349f5ecf88b5a69e83588b0e18096117f207304b38c16a9a8592b + +Msg = e89210565959d93b483659e62cf41f0a0147ea23890c2f1a694c377a826165e363860e4b084016cda878a43eb68465f81f397ecd50087a25215ce7c4ededa3552218071fa3acd7ae380655fc8fa884998209ffc8a2c26f1ca19dfcfee455dad35a4e72caecd8da47eb9ee21b889162f5d3032724abfd1a31e68612e18bfa9006 +d = 05468f0df2c9854f5f655743e79c750fd8812db28b096d97207bae7f5aafc6b6090c9c636ead9e0fde32a1ff8d539b53813733ca812b41b58ff85a941abe4f128d59fdf9847baa4 +Qx = 6591750fbc104f82c213fe88aa620e8a960fd6140598e2e6282e0d5c5ecffd09d22ed94166109561a7f4f694e171189056d8b300b54c8134485500effc7123aaa23862e89791242 +Qy = 05bf8ec10a9ac6a92c54e7fb2135e2aa4f84da571d33227bde0aa2e6c1532074882235f3103d9a51e80b7a9a19067f35047ddc52462db7c634c291e8fc5eb2154f6913bd0846b88 +k = 242308c430de514be1b9084a7e6c96894cd5615a7c71ea22316e539986e9702080ff6ceef2980144c55d9749830c20c9ea90b93dfcdd28fd862b6a15748dbb3d982e4a275129c75 +R = 361e1b7a0f981bcc65480b370c5e09b1c2e2a67cf41646f6a3d829f663c09115892237400317601fcee78a04269411d267dad3e8fc6f069529fbdf0bcf9b5f13c9c6de1681e8b0a +S = 2620c29f86cbf698cca5f79de364ae131345a802c0cccfaefdd7375dcc9ba6ccac91f70943eb606506e51e2ced50491eb8f48769810b6dc178d56702838f1c2f0930f2a9e4f1db6 + +Msg = 48629ec97f56273599cd9903f8a84ac2ba74275b40e1e42fa47649568babe05cf63c8417d828251acc2eec525b56dc9082b68d51b0c2bbaa7389fbee15d058cf482993b2bedc5a9101f1afdc79989a812478245d191550109fc17215679553c508c84e3d4cfdea377088d09eb214e6f92410facee4790beeecafe72b2e3ed192 +d = 3d3c6a7ab9450c94aa3b8a1ffb678e5b647af24cbfd66ee3944e6f264f406295b803767471fc67936fdfed1714b4b8761a07eec86543b7c4da6bd2fcb33fa8cda4077737f398e18 +Qx = 42d536f1b15a22f4ba80066798d8d1c2704988eeb9423319c1850a1ae6bba4097307b515640ed3112e93f1f6ae67c60a4b0d2b6634aa7038a60b52b2b447fd1651857b71711c975 +Qy = 79eb18cc7493a1c7f2f9b621969b9ce9ee37fc0701f6cf56f5d5dc6efb13a384517a387f253aae1e93bb0a919b0c22e4d6cbc79b449b268a068b7eb2853324b96715d75b8c26f27 +k = 23ce112d60a2f7c29d77d64acd9f587e0eb75ef8e739b8548e154681efc24243594eef5e33d845b1e4e89bac56f2e9586e042e0fff38bcf79c73fc9aa5fc908261df5cd2c6cb821 +R = 3a770df8a2bc35e122c1bd551c38400be47f2499ff57618ccd01e14a2e35e87a67b0e40f9a10eee7efcc3d37b474f2840fb8c24a9adf93734680ae6b25818369c8608a2f8f338f1 +S = 0728a4eae5f5638a51579e224a24ecd4c997001bb8681e23a7476fbf78b4fab84497000f20c1e67e8a4e4116498bcee49ff00026009af31c1037172188aacd264fde8db15c97167 + +Msg = aa3a9fe467b1ca638dd0622c9ea235a418b39b2e15ad81fee01b6892b240783d8db3c72e16c13df8016dac6addbfb85232158325bd7432fca3b8bf5db3abd0b4c5ccd0999609dc42199ca4680692a0805cdd68108bcb493a558ab507cec0a2782a9e976928985352edb2abc0c07078b59d2fd86fda7fc76cfe573181d934c46c +d = 01ce010ea8e6e1a0c26ab22eb90f0700dc73b232c429d36371e68e429792afb7223f10327708bcff779ea55fb5f22ad87aa054e84d10f5450f1bc9a89279062ea2173f55ab0f76c +Qx = 4b2b5acef5921e691f10ade81b91ba8e68e73b33a2494cf4ca6617707861f334eb07ca96dfd681dd63f78102f8d792d66102117b739d477e431d9a3efd79bfcc18cea156db58a0e +Qy = 7e421337d4cb7a98cf9c9c6fdf9fa242904d9906d8a6759ef64a82cbf923b2a57073ea0eabd14aa4295bec84d50a1722fecad3e5f064bd3171facdfff45b170e49f185a3c193f2a +k = 326b62065b7c779dc398ee03a8332cfb940b0f24a7d3de4a90323d9e390ad3fb1f0036abf6f525d8d88ab6641302d10db447b78780d366f32ce36ae571e323124b21984c48aea7d +R = 3d2b207b428829ed5100a92f7276e16978e374c734834b0d627cddf6aff5cab72dafefc6c038a91426e35ee0f2c1acc11c55a34a89874100b89588aba7b02e19490e66eb49ef6ed +S = 3259fef5c2a0779ae408b26e6c7d581fa973156cdb07c329dde0c12b6c498e7a94577719865b7fcc0db078ba72a27bf338ec6b8aa41c15963538c329c55dee67833faebe3b643ad + +Msg = 6c3937014361799f1461f652841b5137eb0dcaf01dd293298d002f27e9a770b9e1a30367e35c04603881f0c814cf8ecfbe1619cc49cd516b1d60d27de37ed52a5e1cc300e2face4669f308ebe6747255a3d386f16778e494a7cdd10b45171b2bfcdabd91b805bf24857708c1b75e368edb2874321324f83a19154d3a1578c767 +d = 1e7410d012aeef02b3723346d24ebafd684c99087ecccaea1cf3735d52c4c81dda41812c09f1e874dc964d858ca240a19963d5dc89451f5dd6764426ae41cb23f19cbfdca0fc562 +Qx = 400a3bb3ff07a339ff98f7c45fe032cf42c0e25de8dee2934ce42dfb0c9894f4fce27fef299b41beb8579270efc7b01c0663c3f72d7bdd9f6ff5186eca9c42d15faaef8784211a5 +Qy = 06fe998f7a0db06efed050d178865a2b7de6ca7c789cedff7f2158a5e07ac1d335ec0dbd213fc9465399028fad8b7f4d2cd16fb8ceae4d3d53abefd2b4037efd7f7245296bfdf9d +k = 2bb0fb9c428e42482d5dbdb35157ad0fa713fe732dac8604c0194e3f9738fac5cf3874bd863718712a3da45b7c4612c8685465ecaec0930d9fec32ab25818d2f25fad580009b698 +R = 1062386d3e77043298eb88be46bd4e6f33c83a7358926b30ca06a6b7139815f6e1630f73d352a2cb9bc0619d08a89d4bde1636c74b6580543ed743073eec2ae0037bea2b3c9228e +S = 1ceef759d804ff7de526559636d0bc7930c096c7b959f04f8fec5d7e96129fba14c8341b0ed84a64c6cce7cd5b058fab7f44dcf3e714544c9b6f9c1d46ce512870deb51856e9dec + +Msg = 12fea55ffda15db902aa6a4388b9807c89c193cbf75b5d2a4c95206fa43dedc45974c80079933451bdc5b3ea015ed3ca2c54156dc61afb1bc82adefed1491302a48b9d3d2f474ab45343c611677d360515b93fb36da7a1c1b2341c9cce185c881c0beef33d43967134a190c09034ae3261f3295b79aebd3fe123616f73cf2089 +d = 2139839ce38eb879d266065dde5e5ea227244323b330e3ad5a0bc690f3c210f794cf18f0d730693887548bfbc434f48ee10ed34cb41d52172b06e448df938170a5e17311cab8e88 +Qx = 2ecf46b90616b534ea25cc9993942fd7576a1c4f2f443d3b1f56d4490bf0af669c9eb9d110fe2a65609875e1a924bc4b9ed2ed2315047bbaeadaa1029b38a7a87dd8751d4128e80 +Qy = 2aec3a2f2557c7152a4907af68aa39485274f20927b2da70823440fbd09cbc308d46e30bd6b705f615b7074fe5421ca36b4aa53861983eceae9a69649495952e75b0f060b5d26e4 +k = 2e3412b61eb23d33ca2910dc25dd14c04d2c8b403d8077a72b9511d71ee9da6d7e1db093b92287f8fb00aea0576f6712c56d80cc4e3554e0faa9c7d911e3d17682de831bf649bd9 +R = 06a3075efec81a86175cd1dc2bfe82e83aff1db640184a6a3ed7a0dcdef51aa0be0005c54ac05f9b65af265af7f2ec3d1d7c137184b0d695d701ff1aed194faf2efa98ce6c5e502 +S = 237d7ff92480fa7d6d1f5a0564a2608afe5e95ce2c29dd88853d1ad9d4d2beb8d1f0423edb883faadd592394f52048bf2dc26d2dc19279477ed86621c7a5960ee3c3e2d345fda29 + +Msg = c8395546842ddb545d8ea3db4efe970453dcb06025ac3b7a25aa5ef62070f3021b9a1fea91ff7055b6c398073e7886a6f71afe53c82c47b71377dfe291972503bbeb25bd477bf0e7adc8a5d3f8b34ccd0080d61e121214e1b29802b711cdd8a6bb2275a2395c467ec2c1571952992e448d736d8bd70ee629c75b5e32b8323a00 +d = 274f70fe69e4dbb55c5d404e39f5196335047113087f8711f2f67f2be4964e4fbcb865680758df1c401cd677b0971654b7a6aeb7bee0d6d80ac0de14d4f46f356b2d5545c185aa6 +Qx = 2b2321e0a1df083919628dd8b4c318b9ded8a3e660ce5585b21e46843228b4d32da765a3776c181654aad0ce90724bf85b01b051d236342b48d41a1dbda1e9904d659c98a039a97 +Qy = 20227182fcf099d46d9882c0b0f26b0595a2a3166248898df2f3fd27c78e7c0b8b59ef0ed6745660c0dea1acb567f9d943928864dd1e94f8eb6b5b8473c0c91485643189cf679d2 +k = 2f234066c936625fca10dd080cbbb1228c4d2054cbdeafc8a0a248c0d22807fc92c661b4f69586ecf9469bc4c22895cc73ecf492fb2165a12b027194d409677e7185de24f6870a3 +R = 3a48daa8e379b3b2f377049a4d462530c9ea67019752f4af4b4192b02d6e028386dcb9ef95c8019e90e09dfc8dff5e6f6812df491906ced39befedf16caef614d8c174e7ea95fc1 +S = 33f18738cb26d88c8c048c58a210c7be70c71636dc62c022df1bd7747d8c67bfcf5ff2fb3990ed35becf6c77755ac62aed480df55efea578671bd8d50536a10e2c0192bd42d78e2 + +[B-571,SHA-512] + +Msg = 10d2e00ae57176c79cdfc746c0c887abe799ee445b151b008e3d9f81eb69be40298ddf37b5c45a9b6e5ff83785d8c140cf11e6a4c3879a2845796872363da24b10f1f8d9cc48f8af20681dceb60dd62095d6d3b1779a4a805de3d74e38983b24c0748618e2f92ef7cac257ff4bd1f41113f2891eb13c47930e69ddbe91f270fb +d = 03e1b03ffca4399d5b439fac8f87a5cb06930f00d304193d7daf83d5947d0c1e293f74aef8e56849f16147133c37a6b3d1b1883e5d61d6b871ea036c5291d9a74541f28878cb986 +Qx = 3b236fc135d849d50140fdaae1045e6ae35ef61091e98f5059b30eb16acdd0deb2bc0d3544bc3a666e0014e50030134fe5466a9e4d3911ed580e28851f3747c0010888e819d3d1f +Qy = 3a8b6627a587d289032bd76374d16771188d7ff281c39542c8977f6872fa932e5daa14e13792dea9ffe8e9f68d6b525ec99b81a5a60cfb0590cc6f297cfff8d7ba1a8bb81fe2e16 +k = 2e56a94cfbbcd293e242f0c2a2e9df289a9480e6ba52e0f00fa19bcf2a7769bd155e6b79ddbd6a8646b0e69c8baea27f8034a18796e8eb4fe6e0e2358c383521d9375d2b6b437f9 +R = 2eb1c5c1fc93cf3c8babed12c031cf1504e094174fd335104cbe4a2abd210b5a14b1c3a455579f1ed0517c31822340e4dd3c1f967e1b4b9d071a1072afc1a199f8c548cd449a634 +S = 22f97bb48641235826cf4e597fa8de849402d6bd6114ad2d7fbcf53a08247e5ee921f1bd5994dffee36eedff5592bb93b8bb148214da3b7baebffbd96b4f86c55b3f6bbac142442 + +Msg = b61a0849a28672cb536fcf61ea2eb389d02ff7a09aa391744cae6597bd56703c40c50ca2dee5f7ee796acfd47322f03d8dbe4d99dc8eec588b4e5467f123075b2d74b2a0b0bbfd3ac5487a905fad6d6ac1421c2e564c0cf15e1f0f10bc31c249b7b46edd2462a55f85560d99bde9d5b06b97817d1dbe0a67c701d6e6e7878272 +d = 2e09ffd8b434bb7f67d1d3ccf482164f1653c6e4ec64dec2517aa21b7a93b2b21ea1eebb54734882f29303e489f02e3b741a87287e2dcdf3858eb6d2ec668f8b5b26f442ce513a2 +Qx = 36f1be8738dd7dae4486b86a08fe90424f3673e76b10e739442e15f3bfafaf841842ac98e490521b7e7bb94c127529f6ec6a42cc6f06fc80606f1210fe020ff508148f93301c9d3 +Qy = 4d39666ebe99fe214336ad440d776c88eb916f2f4a3433548b87d2aebed840b424d15c8341b4a0a657bf6a234d4fe78631c8e07ac1f4dc7474cd6b4545d536b7b17c160db4562d9 +k = 378e7801566d7b77db7a474717ab2195b02957cc264a9449d4126a7cc574728ed5a4769abd5dde987ca66cfe3d45b5fc52ffd266acb8a8bb3fcb4b60f7febbf48aebe33bd3efbdd +R = 3d8105f87fe3166046c08e80a28acc98a80b8b7a729623053c2a9e80afd06756edfe09bdcf3035f6829ede041b745955d219dc5d30ddd8b37f6ba0f6d2857504cdc68a1ed812a10 +S = 34db9998dc53527114518a7ce3783d674ca8cced823fa05e2942e7a0a20b3cc583dcd930c43f9b93079c5ee18a1f5a66e7c3527c18610f9b47a4da7e245ef803e0662e4d2ad721c + +Msg = ba6be551bc60653192401ed8ff9e1acd9013d8811a7a1389528bf07438366f5772cd7aedad010c19c47622cec03a4d35b8003b39ed901b720629ab59de55a03c1ca50a62987f8da159e356245df58d5ae1936e65f3cd3acbe03ad1d0fcab4aaf2a7a947549ae776772201efbc6fab1aebfa1d99994d4f43dc28f39c0f279b992 +d = 2a69bc1df069c6e89722521a63675f318252be629e7558f3716917998e660ac960b0b750562846fe6c12ef492951e51e224754bab84a6eacd4147a5f26ae85ee4381bb14ec2a8c7 +Qx = 4685c0358ca31883cdfd7d609afa8b1e47540a97f473e0ebe98b0aaaab9418877aeead3a26fb01a4725fda20e7223a4fe7de0df6891c0812555b8b146918d3b80edd11615d95b77 +Qy = 67c92736447946c7577965b613e18950d813a4df049a6000895f9dac34d73ea46a83c6a4e7c83831af0d33026825664c44090953521175b9da2a7ac563a0fc5e13c85d34aaf49f2 +k = 1700d9ac00a987ff3a1d0be4290979317fe60f4f8ce1e0e72a026fc89e28c0070b76ada14f7a1a66ac2e8aef17eec18b568ada4fd59c05414e55356fc17d9e5079e6cabfc1f220d +R = 23a279662efec48f6cf8c7334862525b52ac37a9b03da6a063da2849f87801563242783434fca02fa23e32249666ddc6f596e07750ed21de303f4f10de56f1d37101cb0826bb8bf +S = 3b449467b150cba0d7c2b44280c5ac452f1217384ce121c979625d313394f6cef501b81980a02567ca55da2bc313dc0754b5256b08d8e3b63ea033253b205cc5dcb014574b8e9a0 + +Msg = 295720a79ac8201f40a66b06ae5d970afb15f36582897eed25cd92edcd00f70ac8e31c556eed4375ea044c2e8b227a8e02c0a3e996c9272d52ac7b3ad43b80f217295dddc84b177cf1e800ad08bf7fdd021fb2f49b54162092f8d628679c4ee335abbc90c027264c8b288c6e16eca3172eaa297ba50626b00fe0a0ad3a9dbeeb +d = 0d11ed1b78b22b3420df4ddc4acc7c2286d9569dd6dd88e0fa3ecae69bcced68bb81bbb4ca6e9b54e67856e7fdf39155aa27aecb9cc827ccb9cdcf9ac633561b27d8eebfc261aee +Qx = 1868a1335058a69e3ce24ea4e6e8dc25851777bb28d3a5da67b741ec9c46e26f2d2ae70a48c3e4feabb3b15b3c3ebd561f667ef3b95a587621de6073b9c8a904755566c5f7a3b42 +Qy = 6365a03c3f3066eca1af17bbbd08cd52e89f8095075b415cd4b82f3364cbff008fe3642fe71e8a8c634ad0e5d9979251e6cedd42cb97c2203f743210051f5ee1b70c861d2a72c00 +k = 075e49d2ff6f2aa8b44fad90446474ee0e72323a3c39e731b6c2b075cce0cb9d193bc3356f8fdae0e0143603a57028836ee6451cab101a6eb550042cb41b5c4233d3ad3e87034d1 +R = 207a8eed0b87efe65ec558a0ccbecb13b9215e176abd93c1a4803fcae713927ece70ec6c41c621357d78a13a950958871a52621f1de7ab74befd964a0e8f4820b84af3e0811bc67 +S = 2f02017714f54089652e02af36ac5165e44ac4a83747c805a9e003fde4bdb29561dcead2c76b02c195074396a2dcc1b93a256c721716f8eeda8dae443c3eea446118fec3cebc4dc + +Msg = a9cff41c6dfdc4a12f31dc375a5455950077ae323d0b7a3d9a8dde73b76e9d7b94ddf9c88ae8e6c262d704052ac47681fc35adfc56c904baaa6e146eb653984369d76a85596cb744941aa7b558c945ff2e81bd5ef7f00ecb4f43af23b4cea3bd4ba7b1899f1868a0c0ecfc62ccb1d588955597ffbbaf34cab2838efc2b866669 +d = 2c36ef754b5bd065e9eadde684750acc52795be80f54dd3d7a7d743d968a18f7e404bd71f8a76eb0395f396df5a7c2ff7e0ab6de35df34282fda6ee01fe5b9b68ecb4e378dbe32e +Qx = 4805e1a23b6eadcf91647b40903bc1fd3b9921861c942fc24d2c03d0544e7c01f004caeed04b5c4ebbce366a098a878c322cbebe7910bfb0f91b284ac1aef344152fc5831669b79 +Qy = 4f589ddb4da482ba1e9a59241b1dfbc7e9b9b69e8f69f8e90460ad58fdecc48a56842ea6aa0537abec0a605ebfb713e588685a98f62e05a7d52082bfd57e3d68fb7851b37ec5567 +k = 2f2002bdde0c0b0fd92e96abe76c0858e42fd7d94a181c711fc6753572539e18effa8155cde7b1e9ceab2394f9eba874b7ea257d7c308c8ac08500f4944af5f33057650608db8fe +R = 27f9109799bced42730faecdeea68259383a45033c6d5dc8d87adf994b46beb34177e013700b13f1253cf756a8866218e9c8adc180f3c242c56b3de28405b36940d53c2aab24f1a +S = 20a762ffb2f5a88b0e1356964fb558b555c424946109d16c7548f41a33cfe41da1f483276a27b188faf948a56670716ddf3b187570c9f514869c4492d7773d6ce453a075f9bc64f + +Msg = efa6c582d7fcf5e431aa89b3b00180c0e78efd7ccb0384d90b80e59a115a13e55001d951528c42860132531c9b8ab29dda7a657c53c2ce96fd85549f6f1810e121eb89961295335eaa0e40532d85814a4206e6fffdf9bff76599da9b2e71a22ed572910b0e3bae38ad72c7042579f106739a8628dea5a745168bd918736e488a +d = 19ffee50be5496507e3ef5c40ee88a49625e46d1dd1686a52b09ad4a8e3ee9ef364f953bfcd97c52104eecb6138067192997cd4ebadaccb73c7b2560879289a46353a756b73cc43 +Qx = 77dca410e722009ef11b37742c2c003ab3015d0ca0328a70d9d41aae04cb64f7746f1c348b08458eb3bb1788f9ffe7d0570a9b689a9b7aca43e05400bace7630d598f5b484d13c4 +Qy = 7291f74cddd9ff69470cf0d92afaaddcc4c8c274d4a7a64fd94292ddc8bf080606795376bb725ab4d32c72ef77dff34cfedd34aff2f463d635bfcd7e1fd002d84383dc5bf8d5d23 +k = 2ea37750fc3bbdeec100694068d55f92fdf35bff9ed49251c4b8bbfb2dec2dd4446999af8848e05c7b819aeb1864430ab4e8c1d684e1cf78947a71b04d5ab8ad61cc7e3e4e24205 +R = 12ff1852eaff37fee997531039adb1fb2f9b4f4199670c022e8534625fff1fa93390ee9bc7204ad2ba3efc2233260943f1d2381a3cc025b78c6d1f660a7bd6f42e5ed3c123055a9 +S = 1b4d8abb28ef1a9d77066921ed50eba64b8433cf00c66b8467269a4a914f568cdb86c766a7a6a52437c5d98cfc9a2130dfaba20f3c2001f31bba7071647d51fb9fbd5fc67ee120f + +Msg = 211acebfaf13bba33a9dd16722ec53baab92a140127d61372cbf1850f2fc894e942e25d780778235f880743953d04eca7a9205602e388172aec2abf35412b483490751f93b51239b6701cb0aab14e5179b0d7f55d8586358381dd83e3e436bf69a6820317d1701750cb1fea1293467ba589eec5f5779c2dbf2a9b8f28c4dc239 +d = 3129e96fd28c4198cc5242c1e3531a3979fae643d527044e98d7721aa56b5b4b45dfddfa17a4115e10a2b4f46d92f81cbdd7e86e588a4c6d8c2b3a83f54cebcee1d1dd33e85d81a +Qx = 73a92abcc991e3f89d82c47fa0fec48e3e7c4d97e2525f8dc2d24da39f616af4a5a804d2603703f6db7cc9324c5b56a21009373f6605f561c8503394e7746e51273b5722ffbc23d +Qy = 0684c842f03a53a60cce087f4fcdbf23b7a28c48b6b6544f583342a65d97dd87037c6fef176a1f00513713468273494a5be683b68c5e75bc08995fde763bb6f965da1acb7e894f1 +k = 0165e52640fcaf8cbdbfe73cb8058c53045e7670aafb2def28d2c9eceb5ed1634b5339cc47ba981eb6eb03ba714c7717e9ed5acc15c8f304702a0409bd4508015d4626cfc5484b1 +R = 27dcdf16b7156a7a05a752da28b5bd6b233e8a7c16eb7f9030f29c4352e6508f8424d1b5ba789dac4152ac4812ff7975cce69908371a81a4d7d9dd70a8dabebdc4e3af27234f0d0 +S = 32a654a31f09a9803e502a1440c2bcf122780f4f47aa37e15991d9a548583fdca48800804712816b212cd3c657e6bd4cb7443a0288592541473c5086e1277250612c21346538374 + +Msg = ee592e20e0a45c18089c2e41460e65a7d22ed9714379f095d43a308bdd383128aaa6fb24e9d35fd28fc95c5b792ad75c980d2cdf0f460ac60b12c5919d3cb28dac4d488196be6c2dfe462b1b0ce59f8501692255840f5215c0fd8b74b1996a267a5e3b22d2841cf0a0b6315ef4ec7180f1c8494f4c07d5869c01fa2711739efc +d = 3d723d2697cd07dd8444f992f2ab4a063db334034c25ea9be99fd7a1f495e3a644e5ea033a41264e0d24a911e55741d0cab80a0bd678eaec2bd1e60424d4491eb86d664900d907e +Qx = 0c7a229b5fb9fc774c1b6250f3bba2f0972d1aada7080641c014d012db0637a0656a43024ec0ea25ff70012646dc19eeb1033aebcc96a001ba876b2f5def6e198b8d4a53f7c7f4a +Qy = 09228a68eafaac214fdfa19923a0c19629de31ac0967c9d02c53dbf221f9affb735d3bad732f381f1ca414d70920231a78f742254d895a33ffab492f8e6094a542e77962a324ba4 +k = 3b3724a5933353bb9ff5f742f59385e780caa517a963590b7fc89882bed95cf90ca6365ce8b882f2d96e56bd866a5c437733b681308c570c51ec893ea95fede66c7aaf4561173f7 +R = 2a487c1fc29426e8e85f0a35c177cd168a444959b2f5cd4519b9edd52af3ea829cfe964ac2b59198af8e2d3859ebdf9885ebf57bdf5767da1611d3958de286f91ef397230d65599 +S = 10fc01efcb22b982f992efb71887bc79c3f32a9088bc2011c269924cee0f47c36452399d499f2933587081b872e9fd2191c20cd5cd94927839228ebcf22cf7acdf4608a2fa66310 + +Msg = fffca41927debbd53455821441d9115db99fb31bfc69752a382f57bc7abe021f148346ee29e17512c64b4918ab2391d12d6e5643bee6b5682885dc28177b292e23a37ff99b359b9cf7578432af56e0ad1028a6cce7428980654c145af8daf09addbb3be11228d3c742defca9d3b1667f48c63091fe3307ecf72667b02e008f24 +d = 1999ab45d66cd1d3a0fe6aa43bf5ef1e2a67637d53674f6fbbfb9b582be91fc42a12cdcad94b50b0fc7ac55030de24a0b99fbc4314fa743ef4b5198bcc5f54d8b669fbed78e2e91 +Qx = 0cbf3b0bb4a2e6c225aa922bea3b233da4661df5da7e0a1cd343a9b6655ee87fc60cd763dee21eaa2b81c4dd5af6f4fadc3ceea643b37a6b17a6501e1b9b689fb0c4716911c1f10 +Qy = 14b5a9ae025f09066fffa6797ddf95f27eeade06b8ca5be5738f770362d5213c46ecfca58e3c60cb2bae1f8ab1bf0577c80b4fdad02819fc174cafb33df64fc0ec79713f7b25209 +k = 253b533d3ad1c7095363e3fc80cb32471061e44dab3f9ae0ea6252f6ef169cee8badd3eccb77096ae9224f89baeee7e183058579680661655fb689419e36a61e8573de5ecb4cd09 +R = 3ba94f7682fb61de725a35caf1d4d799c4b05a1d1c44eb1c251dd8efab6b7d713c3fb917776902a1bb202f9226558f4c1e75964349717e6dff938d0befea07a9ca1bbd429dd6318 +S = 226f43be8e24062180c726b5cb721cc04ffd3acd82183925523ff9e8631aecbec2c224d5a291bb225f0da726d256aa822ee7cc2c7d69df3f2a5beb21132d91bea22e4c5db900cec + +Msg = a2f71619ea04f7057e6943c2cece8594b341ec3b96c3915d924f94ba13fd7aaeed41ffa0e842ade414784f1ef825fcf2dbcf7bd8263b802def45f94de596aec0c121fc06558c7bb06b9f27a9bf56c42090b5dc344e82b69c4f528d33be166764a593483f6fda0cf56e6000ff363ba220f5ea0ea2c3191615c7ae3bb4fa575324 +d = 2ce1cae0716205330d730e6bc6dbfb6b951dc83ee3b4a7dae75d057e32e8a46e22be75b5f09135452b29c34dfe81a9be2e8dcd243fbd946a0ed14a832a7802e20cfe1abfd3d6e4b +Qx = 75971399fa621ce535144ec1d57f544d798a0a59207166c3d657e5a80ac00e8f5b643448e3546064d68ae624aaabf36face3016561a248256ff9131950ab8b04710551e12222d0c +Qy = 224a50f321647f47de3db4fbe1bf1e3a3dce8a834312779f66037315e3326721e3fd63d4d6ef92b7ba1fa9aeb70f92e2a6701458ac8da49ac386491f2306adcd8dd781fe75e99e1 +k = 0ad95aa69cf9f40e13f8a72ed6d93388168abc8001670ee4d95fb4b726b1f958205ab2f458df8bb9ccf2405680d0e6951abbb922cc11d47cfded93c0efdb70caf0c54e7ae96d7e5 +R = 09ce019161bf29eeaf323933045f59d2efc372904ba50c4a6602b8305234a851d95f06a5b56193ad5d28488102ec25e3f421a5f5c4626b435b423d612e6ab60e0a4fe5d4952e2c5 +S = 04f7b7ac787b361c2bdfa767da9c22152e402184a7ac133f651fdcd928239215dc917401122a6d41e78299b4235e085399e594465b7f8dbfaae9bf302d83470b4295ea06bb9bd1e + +Msg = b60415a831eca2cf60c79a334ef2f327a76d290846ee588d5d33d0a826bb0c7ec3e11dbb384a7f89c8d180425dfae7463e0ea6497d2eec1dde112f1c1efccb532a2e2b66a28e2d36d4252a4c3b12850d465fe21bddc441b92e6a7b0f67744f7f6e7812a0603211a26518b311a5b190ed890ad852bed4f6ed13377cab3eebedf4 +d = 2c9d0fcfcee7e75c3245ba955ae04188b1033c55ec9c821d8de7685276bda3e9a93c3ae1b003e5ea722913e7b169d67b1aa2dc8cd42adbd9368672a3f81a6817bf3e5529dcb0c8b +Qx = 19cba4c8ddadb596d7303331f2a22461849ebfbc78ea69277f72dcfe23d08397025ff6691c61ed9958d68a9c5dd8a32048a89a2553afb9077ec43358763756b1473ab2cd8f25b53 +Qy = 319eeaa78444b7cc5d8cff4e9199ddd2c6dc7bd935a1be1d8b1c657dd5ac49bc92b0cd91304ef44ddb7ecac05518301bfa0e533402043533f99549621e31dcc282a52186478df2b +k = 385e12170ed0b23c9c65ff7edd413145fd343dd841e85c498fae5f36e57764168899902817d4dc39127010faa1da68000a511ac69f80708be5afe1631432f3bab7aaec2bdeb11b4 +R = 231ef400c6a3a0c7b26ba1b92341b72e138ca62d04ea2172854631c40c48081a18a57e9f055748245d3e83d10d21af39935b0e50c9c86956ac46c1ea03ac4ae023d84b24f830973 +S = 24d37d67afafb0676cd7b5da2960cabfc804b0b3244b5e6739f8fe43d0841693d28c61b8e76181f8aa24940d76fc5ea8ef3a95f72f67303e1ed85ad6e83cd2c44fd0e0f3f2f44f4 + +Msg = 5d15a08226cc74cf495be681b795d0bde26b19f29aca1a8c6ef77d50271ebdcb4e5fa2df23961fe11620b1c6580183f6ebdceb2c09516c8127be576496fb71449bbbf0a9d3d1c48a25024619b97c3e0d8b165897db96ae9758d13ac28441d7cbfb75b23cb423e0002046358bb6d64779974a5995dfe54b398f95f7d64fc52d96 +d = 10c057bbaa44ef0f565edc288bfe66d4f6acd8686899359bca418ba89fb690429489a37bd3c6c9f3a8714b2ca225868c6a45fee360e378a676f7ea39321790f32a4b005b81dce43 +Qx = 43b1e7d7b2aee3563813a6692f0b4b61ba82b801697c3e23724a2fbab2af80a2c56be55af41def0a90cbfce7a45ec61629906055a8b2a5013740e96859e580c444ae9f0ddf73afe +Qy = 6742f13244f1bf156d321eab2c3095ca548c3182c405187c3de2fbcb01d0e16e1fef246012c87d4d32378629a75b694572ec8583ae0cc813ac64f10bb05a9e52e4805590482f289 +k = 2b8076102a6448bd4c4e192e93cdb96ea9a6c7f6753818267ee9e67644df1a4a6c9ff64bbe9f64904648cc640fb7f0cce69f9e02878ee950b91ad559a9ec0ae15b676d933f1620f +R = 1ad97f4997037adfe306f3859d550f9fd89bce8b566e657d5742feb17466b6b8d507d5810a8cbba44d671b043ddb557df084bf5d1de74ef8bbd6a93690459fc16a17b80dd6c0f28 +S = 3262ef6e4175e7afe095d18157f67b3d12564d54954e9964e991c31bcfe1dee7e86b35491ce818400cc0f83b819f478f2f2c2d21c6c7a6be43938841559e09bce70b0d61fe51245 + +Msg = 9eca4bd88200baf61b901fca53dc1f1e7e3f83b94d58a6cc6a2adbc9b1a35fe3f8ec61787c76ed9a0d696167cd4fe46e1a0883fda564666131753c576a720125e0b712db1da0278067cb899bdb14eec08737e864544663abb1d62f34a2114be07e8e3cf56e2d17099299ce6b6d83b1a34e6153d7c6a32a72c7b1bf4583fcbcf7 +d = 2c182df7976ea93d996f3ba5d2221f3cb755cc7847bc3fe9e022fa4285046f5bfb426bafa3580beea206de36f87593ae561b4b74a03fcd61fbd0e8d6fd5668f2148819a88a650aa +Qx = 6004b26a184ed710a5fb67e9d042f7fb9c8f5584b1f70a91b0b3be41c3fd2cd1a537e962fdac8756df33f80fce2bb1bc7241d325bfc36dbaef7cf625918d589b6352fa744718910 +Qy = 36a29b04a494abfe809d956c3cd6f84ea51a7fa28cb39a52f16137a13f72f0726a84f6ae53ae24f5b468733f4cbfa0ce5bbbc1cc7b348fb996d33a45ff656a6a7557619f598a6b7 +k = 2ab349232bcb4f4816b26bd0049e130fffc90ca0b9308edd50fb9055358a87fe798d00140b0ae01ed8b1f6bb9bfb726b253c3d4949ce9eecaa6c7fa84d1ef812669fa929f26be0f +R = 0bbf2f9765b12742224ba7d064358c0305fb63e9b54a831e302a4546aa02cace798d82a188d2f536d78544c1571f481289d6ec69d117648026490e781f1eb9fca59bee05234ba7e +S = 27e07ee0a1a99c90753cdc8c0291da25a82c116e62ec58b93f91086ac1cc039b35ce7d8b53cdaa92a5ade65a7684b6e7ab79873dce33dcd467c39d0c764ee390b7fb25ca18912c3 + +Msg = 707450bd84141f3b61beb12ffa5ae89d812dd11badcdf6a88a2d50fc70e23f6d822ff4477047abc58cdfa28f97ad7f4911ae0773c04ebed1f51bb2308cf6e5712c4aaed461edd6987fdd1796aab70198276b601241f6a14225dce575830ff60f935fd9f567d1d210652e4710922fa793da78c8fdc30c273cb08365c9fc887f50 +d = 2d3a65bbe133cc98cf0eb56ee1362195968b4eab960a1d55d8b762f1361fc21348d6f275d4bea1de7158fb97c995e20b92a9c887a3e332d154667ad167acc632eb88a0ead6113a2 +Qx = 34355b54d00c3df7c2762ee2982cb777491aaf78e550c4d2ff5d5a893416eb3517671dbe522b8c553fd71edfe0306cd7628324f4f748091fc5d84ad8af33b896985674649a6f4e5 +Qy = 7e322a04eb600a3faf3e045959f1e9f798e1c965ced40fd4c0383c0d4e79a96bf693a91d7662780990d0c9dfca77a9bc0e13551d2ab35af8a153fa34ea903961fe66996ca053b64 +k = 0a59ac1240bcefc52456486ce23b780cc92c8b89314b8442a6898c373bd0adc3725e3ebac580546d1ec82ebfb2e04c608441d962d759ab5f5af1596c6623487e1347537a3c35bf4 +R = 0c47ef55d93ac36cee537160bbe39c3d4504184188533edfe589a5ab6e5a3e06ef413aa48710d304f0b2bc380fd69a34aa0b8e2e9466fd8a131cb056dffe4b809a59fd83e594483 +S = 2d8de1e8e2a52dd1be08435cda69e673b328573edeb1767849536e6f2d5fc8f18f7bfde936d8c32ecbfa97bf976133d65641320ca1c41e81c388fd6088884bbd89274b1976470fc + +Msg = d5ce9d59391cdc47ef942dd2a818d024ae3917deea8a5a4214e4db6a0c5e6b0936f3e632fdb68a3f0006e05c44b7232013e1da5f877cd197f44fd6f60c1fd2378995e9a47534948c5a09e33750f07a7165072ab38095373b07a50bc1391eb6b650ee13acd63d0352e7d9c31695ea1ec6323f9b5f57b426ace56aa7fdbf419be0 +d = 2a920e8dc928acdd56e3655b2340d4371c793e66f67405fb7a90f31e9c4ef466cc44331d1d2fe3ff7391d2576dc6640772166ef8c154a5ff1808f5dab2f03061070ec8b3f786c36 +Qx = 5edc0fb974314e21ad40d73524d5620b7279084e3ecb9e58b06340ae53d2383efd206b8b1eb3dd60c38f593efc05e2ba5fb8989472bac7db60fcada2d18d4108ab36e8c20cc710d +Qy = 0444cf65175f6bbaf647739cfd8407e7036fc6cc6208ccb9d776eb13e13b377136c683e108775d85b6bc5638926432a17344de965d45e042a0a8e0b63c7fc3a36fc15cf718f3baf +k = 35a0215892d0c52ece29559ebfa061011da8d597af6b3d1ee988ea4819be194c79a42681476140738b1b5dc191485bd20c96c282ab38ddbc3987343155366b6a5d1ce7053efcd83 +R = 1a69a9a51f6b0dc196b2a8db2e8bf61764d4c65b038f43b5ed6b5dc2673971c32928606f92b7caafb4dab3cd61ee724bba71a0d5c788cde4b96ef6b453f2a69126dafc20dbc7c82 +S = 13b5463636b8462cd9f479de8d114e29e7011489bcb9735ffe9ca0707a07df3c0aba05043eab387bfedd9fe982fbf04968f2be200e9e052cb4b02223b8579913d713acf94e7dc80 + diff --git a/packages/crypto/testdata/bls-tests/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json b/packages/crypto/testdata/bls-tests/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json new file mode 100644 index 0000000000..0da8111bb5 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json @@ -0,0 +1,8 @@ +{ + "input": [ + "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", + "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9", + "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115" + ], + "output": "0x9683b3e6701f9a4b706709577963110043af78a5b41991b998475a3d3fd62abf35ce03b33908418efc95a058494a8ae504354b9f626231f6b3f3c849dfdeaf5017c4780e2aee1850ceaf4b4d9ce70971a3d2cfcd97b7e5ecf6759f8da5f76d31" +} diff --git a/packages/crypto/testdata/bls-tests/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json b/packages/crypto/testdata/bls-tests/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json new file mode 100644 index 0000000000..c4e082946b --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json @@ -0,0 +1,8 @@ +{ + "input": [ + "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb", + "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe", + "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6" + ], + "output": "0xad38fc73846583b08d110d16ab1d026c6ea77ac2071e8ae832f56ac0cbcdeb9f5678ba5ce42bd8dce334cc47b5abcba40a58f7f1f80ab304193eb98836cc14d8183ec14cc77de0f80c4ffd49e168927a968b5cdaa4cf46b9805be84ad7efa77b" +} diff --git a/packages/crypto/testdata/bls-tests/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json b/packages/crypto/testdata/bls-tests/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json new file mode 100644 index 0000000000..115215719d --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json @@ -0,0 +1,8 @@ +{ + "input": [ + "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121", + "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df", + "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9" + ], + "output": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930" +} diff --git a/packages/crypto/testdata/bls-tests/aggregate/aggregate_infinity_signature.json b/packages/crypto/testdata/bls-tests/aggregate/aggregate_infinity_signature.json new file mode 100644 index 0000000000..b547ebcfcf --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate/aggregate_infinity_signature.json @@ -0,0 +1,6 @@ +{ + "input": [ + "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "output": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +} diff --git a/packages/crypto/testdata/bls-tests/aggregate/aggregate_na_signatures.json b/packages/crypto/testdata/bls-tests/aggregate/aggregate_na_signatures.json new file mode 100644 index 0000000000..8f12bef2bb --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate/aggregate_na_signatures.json @@ -0,0 +1 @@ +{ "input": [], "output": null } diff --git a/packages/crypto/testdata/bls-tests/aggregate/aggregate_single_signature.json b/packages/crypto/testdata/bls-tests/aggregate/aggregate_single_signature.json new file mode 100644 index 0000000000..5aa2f05334 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate/aggregate_single_signature.json @@ -0,0 +1,6 @@ +{ + "input": [ + "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" + ], + "output": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" +} diff --git a/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_infinity_pubkey.json b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_infinity_pubkey.json new file mode 100644 index 0000000000..032a76da90 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_infinity_pubkey.json @@ -0,0 +1,18 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "messages": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x5656565656565656565656565656565656565656565656565656565656565656", + "0xabababababababababababababababababababababababababababababababab", + "0x1212121212121212121212121212121212121212121212121212121212121212" + ], + "signature": "0x9104e74b9dfd3ad502f25d6a5ef57db0ed7d9a0e00f3500586d8ce44231212542fcfaf87840539b398bf07626705cf1105d246ca1062c6c2e1a53029a0f790ed5e3cb1f52f8234dc5144c45fc847c0cd37a92d68e7c5ba7c648a8a339f171244" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_na_pubkeys_and_infinity_signature.json b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_na_pubkeys_and_infinity_signature.json new file mode 100644 index 0000000000..85315bb99f --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_na_pubkeys_and_infinity_signature.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkeys": [], + "messages": [], + "signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_na_pubkeys_and_na_signature.json b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_na_pubkeys_and_na_signature.json new file mode 100644 index 0000000000..eba62099a5 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_na_pubkeys_and_na_signature.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkeys": [], + "messages": [], + "signature": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_tampered_signature.json b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_tampered_signature.json new file mode 100644 index 0000000000..6c8cdd587c --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_tampered_signature.json @@ -0,0 +1,16 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" + ], + "messages": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x5656565656565656565656565656565656565656565656565656565656565656", + "0xabababababababababababababababababababababababababababababababab" + ], + "signature": "0x9104e74bffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_valid.json b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_valid.json new file mode 100644 index 0000000000..5439474964 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/aggregate_verify/aggregate_verify_valid.json @@ -0,0 +1,16 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" + ], + "messages": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x5656565656565656565656565656565656565656565656565656565656565656", + "0xabababababababababababababababababababababababababababababababab" + ], + "signature": "0x9104e74b9dfd3ad502f25d6a5ef57db0ed7d9a0e00f3500586d8ce44231212542fcfaf87840539b398bf07626705cf1105d246ca1062c6c2e1a53029a0f790ed5e3cb1f52f8234dc5144c45fc847c0cd37a92d68e7c5ba7c648a8a339f171244" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_invalid_forged_signature_set.json b/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_invalid_forged_signature_set.json new file mode 100644 index 0000000000..b4fc984f7e --- /dev/null +++ b/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_invalid_forged_signature_set.json @@ -0,0 +1,17 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81" + ], + "messages": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x5656565656565656565656565656565656565656565656565656565656565656" + ], + "signatures": [ + "0xa70f1f1b4bd97d182ebb55d08be3f90b1dc232bb50b44e259381a642ef0bad3629ad3542f3e8ff6a84e451fc0b595e090fc4f0e860cfc5584715ef1b6cd717b9994378f7a51b815bbf5a0d95bc3402583ad2e95a229731e539906249a5e4355c", + "0xb758eb7e15c101f53be2214d2a6b65e8fe7053146dbe3c73c9fe9b5efecdf63ca06a4d5d938dbf18fe6600529c0011a7013f45ae012b02904d5c7c33316e935a0e084abead4f43f84383c52cd3b3f14024437e251a2a7c0d5147954022873a58" + ] + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_invalid_infinity_signature_set.json b/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_invalid_infinity_signature_set.json new file mode 100644 index 0000000000..81afb7ddfb --- /dev/null +++ b/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_invalid_infinity_signature_set.json @@ -0,0 +1,17 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "messages": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x5656565656565656565656565656565656565656565656565656565656565656" + ], + "signatures": [ + "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", + "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + ] + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_valid_multiple_signature_set.json b/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_valid_multiple_signature_set.json new file mode 100644 index 0000000000..6fd7766d8e --- /dev/null +++ b/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_valid_multiple_signature_set.json @@ -0,0 +1,17 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81" + ], + "messages": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x5656565656565656565656565656565656565656565656565656565656565656" + ], + "signatures": [ + "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", + "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe" + ] + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_valid_simple_signature_set.json b/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_valid_simple_signature_set.json new file mode 100644 index 0000000000..71856ee767 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/batch_verify/batch_verify_valid_simple_signature_set.json @@ -0,0 +1,20 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" + ], + "messages": [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x5656565656565656565656565656565656565656565656565656565656565656", + "0xabababababababababababababababababababababababababababababababab" + ], + "signatures": [ + "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", + "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe", + "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9" + ] + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_infinity_with_false_b_flag.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_infinity_with_false_b_flag.json new file mode 100644 index 0000000000..506c207740 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_infinity_with_false_b_flag.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_infinity_with_true_b_flag.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_infinity_with_true_b_flag.json new file mode 100644 index 0000000000..0e2290859b --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_infinity_with_true_b_flag.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "c01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_not_in_G1.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_not_in_G1.json new file mode 100644 index 0000000000..76f51aae8f --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_not_in_G1.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_not_in_curve.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_not_in_curve.json new file mode 100644 index 0000000000..956124eb66 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_not_in_curve.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde0" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_too_few_bytes.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_too_few_bytes.json new file mode 100644 index 0000000000..12a65563f1 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_too_few_bytes.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_too_many_bytes.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_too_many_bytes.json new file mode 100644 index 0000000000..190a890549 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_too_many_bytes.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaa900" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_b_flag_and_a_flag_true.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_b_flag_and_a_flag_true.json new file mode 100644 index 0000000000..6553aba4b2 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_b_flag_and_a_flag_true.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_b_flag_and_x_nonzero.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_b_flag_and_x_nonzero.json new file mode 100644 index 0000000000..baa64d596c --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_b_flag_and_x_nonzero.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_wrong_c_flag.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_wrong_c_flag.json new file mode 100644 index 0000000000..0e15859ff7 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_with_wrong_c_flag.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_x_equal_to_modulus.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_x_equal_to_modulus.json new file mode 100644 index 0000000000..f3e1640dbd --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_x_equal_to_modulus.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_x_greater_than_modulus.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_x_greater_than_modulus.json new file mode 100644 index 0000000000..67981234eb --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_fails_x_greater_than_modulus.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaac" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_succeeds_correct_point.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_succeeds_correct_point.json new file mode 100644 index 0000000000..45cda6b339 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_succeeds_correct_point.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "a491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_succeeds_infinity_with_true_b_flag.json b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_succeeds_infinity_with_true_b_flag.json new file mode 100644 index 0000000000..ddb1fdb2f8 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G1/deserialization_succeeds_infinity_with_true_b_flag.json @@ -0,0 +1,6 @@ +{ + "input": { + "pubkey": "c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_infinity_with_false_b_flag.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_infinity_with_false_b_flag.json new file mode 100644 index 0000000000..e50f48ad5c --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_infinity_with_false_b_flag.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_infinity_with_true_b_flag.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_infinity_with_true_b_flag.json new file mode 100644 index 0000000000..bb32b7cdd9 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_infinity_with_true_b_flag.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "c01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_not_in_G2.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_not_in_G2.json new file mode 100644 index 0000000000..0e5fb4094e --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_not_in_G2.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_not_in_curve.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_not_in_curve.json new file mode 100644 index 0000000000..e645a87a43 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_not_in_curve.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde0" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_too_few_bytes.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_too_few_bytes.json new file mode 100644 index 0000000000..46a78bec87 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_too_few_bytes.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_too_many_bytes.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_too_many_bytes.json new file mode 100644 index 0000000000..8763465a6a --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_too_many_bytes.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_b_flag_and_a_flag_true.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_b_flag_and_a_flag_true.json new file mode 100644 index 0000000000..b96535439b --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_b_flag_and_a_flag_true.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_b_flag_and_x_nonzero.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_b_flag_and_x_nonzero.json new file mode 100644 index 0000000000..de700882b3 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_b_flag_and_x_nonzero.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_wrong_c_flag.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_wrong_c_flag.json new file mode 100644 index 0000000000..da4859d39f --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_with_wrong_c_flag.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xim_equal_to_modulus.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xim_equal_to_modulus.json new file mode 100644 index 0000000000..be05d530f6 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xim_equal_to_modulus.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xim_greater_than_modulus.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xim_greater_than_modulus.json new file mode 100644 index 0000000000..875c9631ec --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xim_greater_than_modulus.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "9a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaac000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xre_equal_to_modulus.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xre_equal_to_modulus.json new file mode 100644 index 0000000000..9fb0046aac --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xre_equal_to_modulus.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xre_greater_than_modulus.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xre_greater_than_modulus.json new file mode 100644 index 0000000000..0ee3ad4743 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_fails_xre_greater_than_modulus.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaac" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_succeeds_correct_point.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_succeeds_correct_point.json new file mode 100644 index 0000000000..94df5ec77d --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_succeeds_correct_point.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "b2cc74bc9f089ed9764bbceac5edba416bef5e73701288977b9cac1ccb6964269d4ebf78b4e8aa7792ba09d3e49c8e6a1351bdf582971f796bbaf6320e81251c9d28f674d720cca07ed14596b96697cf18238e0e03ebd7fc1353d885a39407e0" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_succeeds_infinity_with_true_b_flag.json b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_succeeds_infinity_with_true_b_flag.json new file mode 100644 index 0000000000..4448a0b216 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/deserialization_G2/deserialization_succeeds_infinity_with_true_b_flag.json @@ -0,0 +1,6 @@ +{ + "input": { + "signature": "c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json new file mode 100644 index 0000000000..828d1d6288 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json @@ -0,0 +1,12 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" + ], + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0x912c3615f69575407db9392eb21fee18fff797eeb2fbe1816366ca2a08ae574d8824dbfafb4c9eaa1cf61b63c6f9b69911f269b664c42947dd1b53ef1081926c1e82bb2a465f927124b08391a5249036146d6f3f1e17ff5f162f779746d830d1" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json new file mode 100644 index 0000000000..ae601d41cf --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json @@ -0,0 +1,13 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" + ], + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json new file mode 100644 index 0000000000..263fde852b --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json @@ -0,0 +1,11 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" + ], + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_infinity_pubkey.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_infinity_pubkey.json new file mode 100644 index 0000000000..e07310d7f2 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_infinity_pubkey.json @@ -0,0 +1,13 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "message": "0x1212121212121212121212121212121212121212121212121212121212121212", + "signature": "0xafcb4d980f079265caa61aee3e26bf48bebc5dc3e7f2d7346834d76cbc812f636c937b6b44a9323d8bc4b1cdf71d6811035ddc2634017faab2845308f568f2b9a0356140727356eae9eded8b87fd8cb8024b440c57aee06076128bb32921f584" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_na_pubkeys_and_infinity_signature.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_na_pubkeys_and_infinity_signature.json new file mode 100644 index 0000000000..f44a27a974 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_na_pubkeys_and_infinity_signature.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkeys": [], + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_na_pubkeys_and_na_signature.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_na_pubkeys_and_na_signature.json new file mode 100644 index 0000000000..4a2b63fdf2 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_na_pubkeys_and_na_signature.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkeys": [], + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_3d7576f3c0e3570a.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_3d7576f3c0e3570a.json new file mode 100644 index 0000000000..67d20772bd --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_3d7576f3c0e3570a.json @@ -0,0 +1,12 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" + ], + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfcffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_5e745ad0c6199a6c.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_5e745ad0c6199a6c.json new file mode 100644 index 0000000000..e9d43c306f --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_5e745ad0c6199a6c.json @@ -0,0 +1,10 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a" + ], + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380bffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_652ce62f09290811.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_652ce62f09290811.json new file mode 100644 index 0000000000..6a8b5396ae --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_tampered_signature_652ce62f09290811.json @@ -0,0 +1,11 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81" + ], + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0x912c3615f69575407db9392eb21fee18fff797eeb2fbe1816366ca2a08ae574d8824dbfafb4c9eaa1cf61b63c6f9b69911f269b664c42947dd1b53ef1081926c1e82bb2a465f927124b08391a5249036146d6f3f1e17ff5f162f7797ffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_3d7576f3c0e3570a.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_3d7576f3c0e3570a.json new file mode 100644 index 0000000000..d2a946f857 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_3d7576f3c0e3570a.json @@ -0,0 +1,12 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f" + ], + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_5e745ad0c6199a6c.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_5e745ad0c6199a6c.json new file mode 100644 index 0000000000..d40529925d --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_5e745ad0c6199a6c.json @@ -0,0 +1,10 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a" + ], + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_652ce62f09290811.json b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_652ce62f09290811.json new file mode 100644 index 0000000000..0cb8f24123 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/fast_aggregate_verify/fast_aggregate_verify_valid_652ce62f09290811.json @@ -0,0 +1,11 @@ +{ + "input": { + "pubkeys": [ + "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81" + ], + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0x912c3615f69575407db9392eb21fee18fff797eeb2fbe1816366ca2a08ae574d8824dbfafb4c9eaa1cf61b63c6f9b69911f269b664c42947dd1b53ef1081926c1e82bb2a465f927124b08391a5249036146d6f3f1e17ff5f162f779746d830d1" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__2782afaa8406d038.json b/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__2782afaa8406d038.json new file mode 100644 index 0000000000..468ae9a728 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__2782afaa8406d038.json @@ -0,0 +1,9 @@ +{ + "input": { + "msg": "a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + "output": { + "x": "0x01a6ba2f9a11fa5598b2d8ace0fbe0a0eacb65deceb476fbbcb64fd24557c2f4b18ecfc5663e54ae16a84f5ab7f62534,0x11fca2ff525572795a801eed17eb12785887c7b63fb77a42be46ce4a34131d71f7a73e95fee3f812aea3de78b4d01569", + "y": "0x0b6798718c8aed24bc19cb27f866f1c9effcdbf92397ad6448b5c9db90d2b9da6cbabf48adc1adf59a1a28344e79d57e,0x03a47f8e6d1763ba0cad63d6114c0accbef65707825a511b251a660a9b3994249ae4e63fac38b23da0c398689ee2ab52" + } +} diff --git a/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__7590bd067999bbfb.json b/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__7590bd067999bbfb.json new file mode 100644 index 0000000000..6c33fd8c53 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__7590bd067999bbfb.json @@ -0,0 +1,7 @@ +{ + "input": { "msg": "abc" }, + "output": { + "x": "0x02c2d18e033b960562aae3cab37a27ce00d80ccd5ba4b7fe0e7a210245129dbec7780ccc7954725f4168aff2787776e6,0x139cddbccdc5e91b9623efd38c49f81a6f83f175e80b06fc374de9eb4b41dfe4ca3a230ed250fbe3a2acf73a41177fd8", + "y": "0x1787327b68159716a37440985269cf584bcb1e621d3a7202be6ea05c4cfe244aeb197642555a0645fb87bf7466b2ba48,0x00aa65dae3c8d732d10ecd2c50f8a1baf3001578f71c694e03866e9f3d49ac1e1ce70dd94a733534f106d4cec0eddd16" + } +} diff --git a/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__a54942c8e365f378.json b/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__a54942c8e365f378.json new file mode 100644 index 0000000000..55f4176742 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__a54942c8e365f378.json @@ -0,0 +1,7 @@ +{ + "input": { "msg": "" }, + "output": { + "x": "0x0141ebfbdca40eb85b87142e130ab689c673cf60f1a3e98d69335266f30d9b8d4ac44c1038e9dcdd5393faf5c41fb78a,0x05cb8437535e20ecffaef7752baddf98034139c38452458baeefab379ba13dff5bf5dd71b72418717047f5b0f37da03d", + "y": "0x0503921d7f6a12805e72940b963c0cf3471c7b2a524950ca195d11062ee75ec076daf2d4bc358c4b190c0c98064fdd92,0x12424ac32561493f3fe3c260708a12b7c620e7be00099a974e259ddc7d1f6395c3c811cdd19f1e8dbf3e9ecfdcbab8d6" + } +} diff --git a/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__c938b486cf69e8f7.json b/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__c938b486cf69e8f7.json new file mode 100644 index 0000000000..65c926bfcc --- /dev/null +++ b/packages/crypto/testdata/bls-tests/hash_to_G2/hash_to_G2__c938b486cf69e8f7.json @@ -0,0 +1,7 @@ +{ + "input": { "msg": "abcdef0123456789" }, + "output": { + "x": "0x121982811d2491fde9ba7ed31ef9ca474f0e1501297f68c298e9f4c0028add35aea8bb83d53c08cfc007c1e005723cd0,0x190d119345b94fbd15497bcba94ecf7db2cbfd1e1fe7da034d26cbba169fb3968288b3fafb265f9ebd380512a71c3f2c", + "y": "0x05571a0f8d3c08d094576981f4a3b8eda0a8e771fcdcc8ecceaf1356a6acf17574518acb506e435b639353c2e14827c8,0x0bb5e7572275c567462d91807de765611490205a941a5a6af3b1691bfe596c31225d3aabdf15faff860cb4ef17c7c3be" + } +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_infinity_pubkey_and_infinity_signature.json b/packages/crypto/testdata/bls-tests/verify/verify_infinity_pubkey_and_infinity_signature.json new file mode 100644 index 0000000000..51ba76e875 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_infinity_pubkey_and_infinity_signature.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "message": "0x1212121212121212121212121212121212121212121212121212121212121212", + "signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_195246ee3bd3b6ec.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_195246ee3bd3b6ec.json new file mode 100644 index 0000000000..96f61efaf6 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_195246ee3bd3b6ec.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9ffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_2ea479adf8c40300.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_2ea479adf8c40300.json new file mode 100644 index 0000000000..8d024cd8b9 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_2ea479adf8c40300.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972ffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_2f09d443ab8a3ac2.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_2f09d443ab8a3ac2.json new file mode 100644 index 0000000000..328d2d2320 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_2f09d443ab8a3ac2.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_3208262581c8fc09.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_3208262581c8fc09.json new file mode 100644 index 0000000000..65d3e865c8 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_3208262581c8fc09.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363ffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_6b3b17f6962a490c.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_6b3b17f6962a490c.json new file mode 100644 index 0000000000..1d278a1a18 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_6b3b17f6962a490c.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_6eeb7c52dfd9baf0.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_6eeb7c52dfd9baf0.json new file mode 100644 index 0000000000..5d90c78597 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_6eeb7c52dfd9baf0.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5ffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_8761a0b7e920c323.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_8761a0b7e920c323.json new file mode 100644 index 0000000000..1472779132 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_8761a0b7e920c323.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b71ffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_d34885d766d5f705.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_d34885d766d5f705.json new file mode 100644 index 0000000000..c7d8d37525 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_d34885d766d5f705.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075effffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_e8a50c445c855360.json b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_e8a50c445c855360.json new file mode 100644 index 0000000000..af9428ed95 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_tampered_signature_case_e8a50c445c855360.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380bffffffff" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_195246ee3bd3b6ec.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_195246ee3bd3b6ec.json new file mode 100644 index 0000000000..bc8030a178 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_195246ee3bd3b6ec.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_2ea479adf8c40300.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_2ea479adf8c40300.json new file mode 100644 index 0000000000..2f2f7a65d7 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_2ea479adf8c40300.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_2f09d443ab8a3ac2.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_2f09d443ab8a3ac2.json new file mode 100644 index 0000000000..46b8e4f9b1 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_2f09d443ab8a3ac2.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_3208262581c8fc09.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_3208262581c8fc09.json new file mode 100644 index 0000000000..15e948e0cf --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_3208262581c8fc09.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_6b3b17f6962a490c.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_6b3b17f6962a490c.json new file mode 100644 index 0000000000..ce1816c87d --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_6b3b17f6962a490c.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_6eeb7c52dfd9baf0.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_6eeb7c52dfd9baf0.json new file mode 100644 index 0000000000..c81da01e85 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_6eeb7c52dfd9baf0.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_8761a0b7e920c323.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_8761a0b7e920c323.json new file mode 100644 index 0000000000..b922c21542 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_8761a0b7e920c323.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_d34885d766d5f705.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_d34885d766d5f705.json new file mode 100644 index 0000000000..876f7351ad --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_d34885d766d5f705.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_valid_case_e8a50c445c855360.json b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_e8a50c445c855360.json new file mode 100644 index 0000000000..cc4cd014b2 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_valid_case_e8a50c445c855360.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" + }, + "output": true +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_195246ee3bd3b6ec.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_195246ee3bd3b6ec.json new file mode 100644 index 0000000000..5a5ed2b2d7 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_195246ee3bd3b6ec.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_2ea479adf8c40300.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_2ea479adf8c40300.json new file mode 100644 index 0000000000..92285b7465 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_2ea479adf8c40300.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_2f09d443ab8a3ac2.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_2f09d443ab8a3ac2.json new file mode 100644 index 0000000000..1c51e235b3 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_2f09d443ab8a3ac2.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_3208262581c8fc09.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_3208262581c8fc09.json new file mode 100644 index 0000000000..4c356ca42a --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_3208262581c8fc09.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_6b3b17f6962a490c.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_6b3b17f6962a490c.json new file mode 100644 index 0000000000..f75ed36e69 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_6b3b17f6962a490c.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0x5656565656565656565656565656565656565656565656565656565656565656", + "signature": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json new file mode 100644 index 0000000000..4737cdbb5b --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_8761a0b7e920c323.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_8761a0b7e920c323.json new file mode 100644 index 0000000000..a84115ab26 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_8761a0b7e920c323.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0xabababababababababababababababababababababababababababababababab", + "signature": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_d34885d766d5f705.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_d34885d766d5f705.json new file mode 100644 index 0000000000..7f0cb1af49 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_d34885d766d5f705.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_e8a50c445c855360.json b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_e8a50c445c855360.json new file mode 100644 index 0000000000..24c8e2f584 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verify_wrong_pubkey_case_e8a50c445c855360.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", + "message": "0x0000000000000000000000000000000000000000000000000000000000000000", + "signature": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115" + }, + "output": false +} diff --git a/packages/crypto/testdata/bls-tests/verify/verifycase_one_privkey_47117849458281be.json b/packages/crypto/testdata/bls-tests/verify/verifycase_one_privkey_47117849458281be.json new file mode 100644 index 0000000000..826afd43c2 --- /dev/null +++ b/packages/crypto/testdata/bls-tests/verify/verifycase_one_privkey_47117849458281be.json @@ -0,0 +1,8 @@ +{ + "input": { + "pubkey": "0x97f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb", + "message": "0x1212121212121212121212121212121212121212121212121212121212121212", + "signature": "0xa42ae16f1c2a5fa69c04cb5998d2add790764ce8dd45bf25b29b4700829232052b52352dcff1cf255b3a7810ad7269601810f03b2bc8b68cf289cf295b206770605a190b6842583e47c3d1c0f73c54907bfb2a602157d46a4353a20283018763" + }, + "output": true +} diff --git a/packages/crypto/testdata/eth-headers/1699693797.394876721s.json b/packages/crypto/testdata/eth-headers/1699693797.394876721s.json new file mode 100644 index 0000000000..e203c3b07d --- /dev/null +++ b/packages/crypto/testdata/eth-headers/1699693797.394876721s.json @@ -0,0 +1,503 @@ +{ + "public_keys": [ + "rGP8dYwaO8XL/w9eC1oHpaqAE2OxKdTgNgFlx9wQV+w3sNgI6f1rF54sHma7xgkO", + "s4vpraF87XBKNKdJjE/WuiUD9r2Ia2k9RxImeEfvqIeibn2l1g+LxQFLkryos6Et", + "k4IGdAoz2C/9o+AVmCFjJHMTNdNnllqgt0BIbWC6Loak7NVGhRBGphpLD8iClbXL", + "tf2EijDtCXxxh1PRaO+IJArGju2EfFyWSmpuGm2evwNEF52LOkbtvpyM29pM1aCk", + "rLs5jqnXgjiMg0z3s9lbn/gO4qjQcqyuj5l5WVkQhJ5leIm5lFMclJ0mAbPOeyNd", + "o12dbV3VQozOdhaEIgO1+jchy0sg9QwBE/E4YElU/gzyFMo9BltXj5IQVLnv6CPf", + "j42urTp0D+SN/Ii0Bze4E3Gr5rf1PPJw1pk6wcyRP85oSiPZOv5kTVnn+qdjSZTd", + "k2VUV5Z9H2LDV0xL2FaIyS298lbzYpgY+MLXX+EqysxXtv54YyuyLUrHvBhh5Z/P", + "oY9EZM9c663o7igPoA4JF8vxdDrrDazHSKtodzuQnjDcYPQP3vMEG18ILmUJhfem", + "omzIWU3j2NyTBlY2vwxqcaM35URnj1oBmgWlKRI0lrr/izSW8Lq1EEh/nQwo2OUI", + "kWOR9w4tVDsOadHoxaHAt1TSGRSXuWzu7Eeze9bZeloh+MyNEUNRR/Wl7/hfOzJw", + "qRCrY671TY2gSoOZle84iT0s+IRTnsgfl7ik3eEGGif20/5BGG0bevhywS1E82OX", + "s1TQ0b2UL3kAKi6vN+uZ2rZQFw5wQME8gkgD7XwWcNyRDMrhO75YveADgpsUC0Xq", + "sWMvcm0q6idb5NEy4M2gCMrwPJFkCVmzxiVo2Hwkrb62iDoygov6mavsqClMxenO", + "imDgZrE+q7NyBnprCHBPO2uYwNRolCc4doEn6/zxIq7wriMD82HGM4AQ/TcWRnac", + "mQSemiPFm7Xo3yeXa54JBn1m5KJIkm0oFx1sP90asziUSotCiy6q5eSRkyxocRx8", + "h8KItj2yzImjG1dZPdNjL8CXDjBRda5JF/Ktn3kW/XcWPwjEkf6rDeLazefWFREa", + "oLw2KUajc1ZsD70Li91irHbZcslgwLDYWJME0YJSKG9yd+O1ginmqoqLvy7i2ZFj", + "h+Cf2/VnS5JqlLpNmQ5evQqyGNNR0um8eFp94ivtJZiDZXGtYqIVLMShcYvPV2y7", + "lwKDBjajJ5bEPbznmvZvZcg6RSmSBPIf0v6no/P8AVOKVztiGR9+oVD0BgfRgl4N", + "sFJsAo4cmpReNA0FCH/w5LDkZamTadP9uLkp550C+jTzFnQaFhAHbTMhK6fTV9Sx", + "jNSXEbQq9YparnWjj+qd3F5Bg8RnoxWbWwYp8BulSFE8V3RW00yGGRHoV4LlLDsb", + "jlQmeHHY084qCA5IeGvj2X5fyUBBVkNtwqN78FpYhHC3ZWODvXnVh0bRZnzqxUNE", + "lrHIK4XNuKcCb9NDG+qc0AjwJh7n9BefTmmjmYcoN6uDahTi3UX1RI1UgApK58fy", + "lDm2Y+QQTWRDO+fUnQvqriY/IM+sC1r0AqWUEgVglL1x8EULxSopT8dZyoo/3f7p", + "pi+gKMbjTk5+6t/VtOS3Htqnjr5yT9E9l2tclLC0rUn44xjR80JRnKXuCr1FhCXc", + "rNqmJjy3/6D6FZmDiINI/vfwUUq9TYl4hLturrV8aOYQRARyFcyw8y+s4JsKcuo7", + "iq3881YvHDVwaDIzUssXRTSaJ6c2I1jYaeYXwkENt0cUm5k+6eiB4lLs3UL9dfNR", + "ltS5tBExnlMbq2r1XBPwrbHda0KGeE/4B/KD55kNw2jBbVNvxds9mS3rSwJ4kU5v", + "hsqO18R10zRV+uQkKwWxs1dubsBaxRLKfT+cjUQ3bpCcc0wlzQ4z8Pa0hX1ARSAk", + "jHzL6kfz+2wVhjyEyZqQlKAPK1g2IA7rc9v4T8jnhWNp3Hqwn51RrkKQn6lMiVr8", + "g0YKZSaRNMdiZQbYxEbYkp7XBEaYdaOsI0IpD2Njn+x6Ytb7db9V5goalT5vYh4t", + "sHXbMped+QXO+YbPzW24I6wh3UATzs/giIhTkP+KzRjXbex5O4DbX3d5QmEn2u17", + "qMFnuTAjtg4gUOcE/KyolR3xgLKuF7+2r0ZFMzlezn7Z2ewgD9CLJ7bwTa+jp6C9", + "lLLZdEi0UqmGwDnfHP1lHaWSSbZJGClBVWAYr0q2HSxq+Cop5pWZFTMW+bJi77y1", + "h8bLnKYo1AgQALxscUJblVcCkesy7yz2JBa9HONmbrLOVKzNafedUGzvv+b+taHa", + "hApTsSxbsm38v7xvbsSxUgVHOCtwS6VFxlrcv4Dt36CsPPol60RwdghDX4y70Hqk", + "kgOs0067P/diaPn+aPBmpIo/UYaGrg8iMLMi4ZQ1zPxPII5bpaOcsqQJKSxIo3wi", + "qJvHVI6iRc6VVu7uP7qYoyVvh0mfVKfF7sDEO5+07y/o9oEIZ+0N+BSojuEAwkWv", + "iX16GbcNzvGvAG3zNlmB1zBoyB8YAX8y+5lmWZSBSW79X2ys7vlDsxxSdQxG2VkN", + "iEx2n/PavBMjMOSnLs9TMUkP8IpZt91Rzyqc+AOho9v/g49ARRskN4ZmHrFjCmDQ", + "lZFdj/LfeV57qsVDOIfDnsa7uSgcXTQGpKGiAI+WxvJmra1IJMbEZCmhWONvXhIQ", + "sDHmq+1AZV1ScVMb1VNvXAexn5qZr+MmrKCwVEub2ObSDAGwu4njnFiB5J/Kyqpy", + "tAS+6/YAJspoQ/KVPPze5JTUlcji0YhlFHEC7ymo8O5HCWHSJG/lpFDGItIMpR1T", + "gNSS+9vp1fzQj+lis84rnCRcBo9obEg49X21tOixv8cpyY6T3U5cx4tmGEXXRZgJ", + "g3DDgQRSfVtRD66kW5Kx0Hf5pDVYF4/BEgTk0EhvqU3uDB0HK0LJ9Jdw5jZzwz/c", + "gV+ZBhd5ECiM8djbX4tJb2YuXabbTXGcYo8Sglbfl25QRPgWmGvWZG7MldeQVIhe", + "sVRgclwNa8OmpwBtzzw+NWHZrNZ0xS1BmdqoWY7inu8FOuUh8Sca68ZpQ5OMn0t+", + "k2bYYkP51TvdFdTNa/XdNIwriQEsYztzo11C+giVAHMVjKChz8MtZPVmksI3SgIP", + "iLSbETD53yZAf/P2rBBTmmpntt3Mc+ryf+Khj7aaoq/wWBpbDu+Wud3Ty3Yb279R", + "pKBSqVzbcb5GoFZXy8WYEkr0LhHpvF7yTV6/2GY+VjbLuxrrylu86/p6pMsMfbHO", + "rEB12kYUzQXNTiPcEdiqYwqaLpCLpy9VucktahSmVnlOdCgoZIKZVEaPArW4oWSO", + "lRsnRW4q+AQ2YIqt7FTr0DvaN/pYRSYx2mO8X/Puy1/7c9NWsZ9snEIl/LDaj9og", + "hr+xXIFV7JadvcbfTjEPMuibCpEGlB3qrlKimc+aT6bXI08hDiHKGrFzAlWQUHuy", + "mRp8k/BtUOxqQ0DGdRtz61glutAqlU5E4eLUJK+SiBnru1kMYSnONbPx6QjiFS8z", + "iV66sZkvaoHsgu+ykdfauhH7Ix7fZ/wahBW1//3AOxDoavk9Sn/9H7lzUQK3rXzj", + "rClVwdSDVOH5Xxs24IW56pgp6N5PKj4kGKQDyxKG4lmboAprgmCd1Into3Ahjc9M", + "svFor8Ne2bMIq4bIxKrx3NaDPOCRU7teEk2tGYsAboapQYMtOHsb00tjwmHGuIZ4", + "pYIZ5jt6EYkYicNC/Fpr+vc+OplplHm8GIXqVgB42BgGltCDHNaC+uuh9rNVx8ey", + "tCV43ymp6yO+2R22oWmN9JZU0rwbDXlzsqfjAOnPMuDmrEZNRj1NJuOU51mCOcS/", + "qXuAv3gPulGlhj5iAxeBJBggTT1aEAFxCqDMo4PLQIVdnaDd/dQOHS6TNqRUPKGt", + "iLLGi0JSaYUMGk9GCKyhlNpcZBreuZ4vf7kuNLgkXf8GbnO94HK+YPfyw9PRPeO2", + "ssUcEhrP98AjfS6F6ONqnlk+uk3iAx7Fii5qN1xEeHJ1bvbiTBBgHRR3JJiIETqM", + "jPPClTGhdIml+CMtVsUlH/3clb4/9/9hRy4Z+zjF6uyEHvOx7jZ1az3Y/3GuGZmC", + "j066VAuumVmeyNIxAolDYr+3JTPYzkFZAVdjRjRdFs5PvFq8aPnRYlHVEhQxd00l", + "igGS7wkD16XtLlYUpxWQHyVUsyTucjkJdNyQcn/wja+lgAQaIajmxIo+COGwQq+r", + "tMWqIWWbOuN/3mIjOwv0EYL91Xwi+19HojYEjnJaDoY2uaWVsT2ezfGMRF8Vatfu", + "mUt7rsyLto0nCjqIxY5AVK/b1xO0Ry+VIrJ8F2LGN++PAT10XOnR3I/E2YbUyTOM", + "li4scG3m4IlGZqmgIzdgQhu9jLgGbk44JZVU7DLiXSV8Sgazh/MSI4dDpuSsQmAr", + "ltemnq8nYb8OXrzWB7E01d7bqOJiyh1tPo+/I+ZBmozhu+TNI7nktfgNtUqAKpeV", + "o22tT3y6n0zIQ/5A9iQOGXOkxBLK4ptKaHElmFI8+uywUnL8R9MHcr8GkGtaJuKC", + "r/mlkDslMb32WMKP6luOuv3E8MViuXpyNkQjWfu5yRhOqtYZ1A1JpjFAYiQMJ1e/", + "poPUhl3cwJn3tpgVMAe5L4U7gPSbO+dRY+qM0fj/WEtDpo5o3jrmHNqK1LQfNVyH", + "lCdXmXXoESgFcJeXK+3anwJAyXIzYxojxQzhoAfA0NWJjesNrM9OFRjfuau6gb9x", + "jvm0VsarvBuRLktclCDorxpYYOtnCJTTrCUO5X8kIfLk6qGn+F3w8/mzSiQWkZX+", + "hgDiAxyRE60qdcGYcrXv74V2W1JPdN6YuvTv5Kdca+Vj6eGWIjiPvpr+WKpgF7kw", + "tfhVS2ipX4mG1qoAlDuKLmC6NPmqTzjocuDJ+3Nw5eKBKxl9Sbv4BHQAvXvT/5oj", + "p4npw621mWGyuML3M9u6A+wEdr3+jE8TlgDV1P9EZY5C0z9PCMkXGbijP+jPDrJw", + "oQTUutafFyAwftEjY9Hsl5Uqz+CdnjZQA0wz8/IMdjJx6+DVtQsdO9FcRp9Fc7Cd", + "grjAE/JP5kuOAzeui2poLK4za4QE6vwUBHRPgPdl79uLKHPR0/MRQejf5NkzRqxW", + "qiTF+VcuJOmyCf92E4LiYwR+uhJTK5/fc3LTPi8jLBpZFtyCF5KdvwEYqQRVlvea", + "r3YWuPL1bcaOPorl3F27SwJ+U85lKGBofxsVsvgg6gNJuupa9OO6TYZUKTMNM4PY", + "iu57wBqKFUCFjAmkFBUy3HWa5FxAL/xaB+yimN1jxMCX0JwlNGm7gY0T8GAqhK+H", + "uH5fSBuTisikgbd1zFi+KgZgRUnjyBD8RzS6t2CZ5cYX8CQ8TBQMt91tNqbcIoa/", + "kx3m2pwSkQS6UqfXe7Ra8J4I11lcIaal2trWw+IK8ZVXQ6zG4Wg6V0bFheU5Hen1", + "kII9wuWrilKgsyiD6oRRy+TJIaQs5Dn0+zBqkOnyZ+RjJB2nJ0ttRMLkuV3bywrT", + "iQGelVBkiWJCCYTp/QNZeoVK6CRWfZqmzV2wGkYWtOFHcjDy0TYqLTB+JCWj7riY", + "jfizWGHgDoKCazo5Bp6fPw/LoY2iNw4v15K0++7IonERx91+Cs719L2belzC1uzp", + "tJVARUTJM11fGEzWhzKZqTF0kF+jTBQJL2fZuFRecfqylUW8M344Df/LUz9zkOnN", + "rZ4bRXm8M10Xby0ctwCz6c90rMMaXqn7uanDBxljZIAXqi6TMdrAxC5kgvkUFlel", + "uNaGEP3uGQ7FofS+TE91CwCteNPpyWtXbGkT6rnnqB4dbWpnXuPG76xdAu1LPAk6", + "h1fppqLax0KrZgEcU/p27bXrw8L72acmVSmj5WCLXCS0SC/tCVcl6bj+1agxnBek", + "gL24K31YO/HkFlOWawujtP7A598v8I4/oG/ZBkvKA2QmPgdeFYJ0GlJDveeGycMu", + "oummiYGYmyfl4S15WVpWO9sgfWRCmpipEJCnTp0qowHT3dr5+CDat8HEItbdOGxr", + "pVtsuOT9I0EENuuL1VDe7lBUPCU0c59NUoG1ee+EUh4KEIrjJSGqjPbaXVV7UMxA", + "tqJdST1wiwNbhT8femYo2OCyBdJngpP3Y9fqTaEdKYU5UzsitD7S5fcIZIVW8wlO", + "hk1dmFjNiB7ssN3l4+DGxd5iPNnvYZ6HuC/SXF7fRaGgJbHcdjwnxfTVIP1WS0ZK", + "oK+eAqdiDn/xGcNlDVnYAWnt0K1FIGKw4+QpwDjNqk9VoYSV5Fk2eq62qSyYADGR", + "o7EJJJrCkAgG8POTONpy1PLMbRrEA7WYNLRtpXBc9DavhJn6g3F/lU7bMjEjl8jZ", + "tKqSpg3mGtCJywJ+8ZohHHIOwOUXQ7EWbj1xusCKn//y8Gh+JQxqfh24ZvfEro8p", + "iHN4lXualEMo9VsgfzRHjTGmlmq/NPot06Z33M5NlJeGThpJFvMJXJhM2H8zbPig", + "hBc66vPZY2jcfKGtXlV12ieRE1Z+WBWjZKA1anIMXgjLWMof3YkZJPSHHT6q5d5A", + "hta5PHreojMaKPF4/oKZJ102z3e4FiF64v5LedqYEmo4ZHdzgqowiVzi3ocSHNyI", + "joJcA8hAmjMCJm3F9H+/w4Hfuvutw3vY1A8HnKiWPUxa5u8NC6au8tRohzb19rtF", + "t1wolB7j+Rs1NbTqoPsXtZymW1JWYBofbQzyu01mg3/RblHWlChWZ5ASpXMKZuUZ", + "rz5pStcWhPchT4a+2FFJ2wOZceHDYhGbl5oTUlWqImEogC5Y4squr42JMENx3QRA", + "oVbiT7p+lmEFMH6JsQIQZxDiAh5pTAkN7PMgEuh5TGoJCycGPuYF20DkNb+Lbr+f", + "tNB9UPvJY05fSuuISXQGjqa5TmfkUnIH9fnEGiRJQzR9adPHOvdNjemrNlnQbG1q", + "lJzwFc5Q4nz1wv8bji4GZnmQWskRZONCPT+34FxkQp535DLbD1Say5n5H7E0tu2t", + "iQ3vaW/AS7uenth6KklluJaprhJ7wOHMUVVJuI3by8AmR+mDVhyraR99Jc98frJU", + "rRnjj7wxofmejq0UNwFjM7qbFd/6Q/5hfUEP6Cd18G/lq9LV8hGIApFJA9LCMBdI", + "oJ8R0rxgANEqQrVF3cKcGXOUSjl4fF8nyW1PaqDZyPqcR58u0yf70wN23z+lt9Ko", + "jWvtX2s/R7FCjwDDBt9VB4TNJCEuusfmOEoLEiarUBKcA0HQoQ2ZC9WbIphp52Za", + "kv95QC1QBdRjAG4KaZHqrMMTbEgjSH2RLMfuwf6fYcryTNEAIq/atfa0+Fv7Pu5P", + "p5igNx6MxNxCzNeZNLDbWjpZ8YoK4J8usXJZZCj8s/ADEueD1v0hy8FhAxf0TgjL", + "otfGKKR+TpSDMrL69u1jMWCQtv7dTZySzCwS2T6gYVt50TMFhXm5pv9IpOmRiEj6", + "pY0vscJhLSjFT6+n8uHmwzbCRDWr21Phvp3Omuvsv3Roo0i4clSVNawYqgA/g+qH", + "ltwGHvUE9yHBcEP7iPSzONPE2f0TXJCf1kVqPwUzG0vfn5rcMIMnDie7+wUReIOU", + "oV4MuWpGOrgeZhykTGGbcaFZaAu8BHB+paWGf/OLFUFuOr5V0vq9q5rt4fFX3Tfh", + "qtwgdFT0SCGwXWB1hdXxmYx/ayJmrWxuj7N6BSRJE9GuWmVbY6B5yZm9MMxjJVt0", + "olOKmnk4ida9a0xbDodDiUlN/rqCTq9Ds03bsxEIboaRIlfmNPtRcfAWSTfFYyVH", + "i+SDCjkarOVh3s3+pqphBpbSkqnmtWRIxqWQAn359nYmaGcXdScrrEbqM1ORrhV9", + "mWmrYgCbaqgXNFeTRnZpN9IrpzwAjSS+vBg9Gz08+ryQtH9BspvG4j1wFlWUwud0", + "uSmflQ24yv0jahfxQc0uqf9EFzB0m6s1cSEdIHzK+/WjmQ3BN0AMQFCGxNKHmrkf", + "rZclEUsBFS//E0wajMuNFxuM0RaF72gVt29ELXV9EwurnvTJhF5m9KoCN+4rUlwg", + "iFVMg2SOqX2sg9gGzYHZJTGYA0ayCNKB+6SJ2hWgCE/U2aAFkdHKZ6rTxXk2hdVf", + "lcgQQxyNSvSqK4ifmrPYeJLGWj33k/K/0131z9tgTKASkBD6n4rK5ZRwC+znB9Z/", + "l7UQ+fRr33egArJAPY5CttatUynqCAlAhEQpdjrT79WSZSeJyNPU+sCQPHBfUzz3", + "tFX3USMt4KSEQNCZg/T0cYthaZB5ecnygqz3F3q1sfM4/h8qzY0L7ktKrWHQNAg5", + "sBK7S3sIfZqUwyDqLg5C5ligiHs1qk/7M1+C2XWaSorXHiL++AcZ1LJh2bZwlf7o", + "rg4VoJI4UIt2neg7MFgswiSzHNhU0E/be4AI1djZNtvdP0pw//VgqL5jTBQXclYb", + "j0TEO4CjxfSIEYhZ+rBUdFz+WwgkghlEuC/Phw/abZNInqnKQiDCTbL0rQnGCAy3", + "tR8KFKZhwjOAl290v5/q3jnTO2Hbc8EJIaU38B+9ctwBOPb4X5dc0g7PHqAzppig", + "r5F9CG4uMn2Nnjf/hXAlNtexX0RDENSqgyph2FDHw/CdMbP1/SoHPn/WRgEnW2/K", + "qVvshqfIQXqN86AVgZkye6CSTTt92UzXwe+EibECcK5kuFN+05zTaZpIlCv8gMNd", + "kgluv5jrrFyCNF0+8NsPWhSvI87qcyeQh0JrKB1nAZl/4TH+ZafffWJLT/kdmXro", + "oNQVJnS4o5JWvWQOKA5Ax8kK4eDX2OBQMSN8IciQZF9Z4dvJ7kMnJvFOE+uJYtqI", + "iAtO8rJ44bLMzzajtbf7zpTxBu2fooIMuQmaelQKV+n97vXA+wp0MEmCj8K4xGFj", + "tWsFGbNxkqL/Gel14hiwI3/urdlN/UvnNj+xLazWEVGlJAIylOoI6tbUYfrqLEJf", + "s4XykLENP/6yA/Ro9kV3CifIG+rlEp+UIZ9XZLZtN4VVYgb2I2Ey/8G1mlso8x09", + "rY2U5GzAKhwK0nEF6PZy7BW4KWBRgB8ZGNC9RwYlaG6Oigq96PaFK4Ru6NkTKya8", + "uYk/ekevRXqe/ZDdwMDvODqzTpwShOYXwSaWXNnw3lxU7ot7Ugj/GQNm/kRenBMl", + "s70v7byj4Bhb1JILwLknnafXAx453yiGpMlpso35cYGtN8pLqyt59E17xKyzKxSr", + "rSh+rRVgSJZ+4fFm8CPe/NdWaB9/yyTU62Q6Li8XoQI5L8X2D7QCeAWrFjEITNzC", + "iWgWhKT1ouVqSs03g2wGz+hhOwaU0iWPjM7md5bnb0ndnaNJscI6NvlDgJfB5kFe", + "kb9MMvqIiNOCnTwz4SVQ0uy3B2LV7uzQRNSQLkp/i3olks9st3Nutr2dMS+Fwnd8", + "g8pzOEmDDLj8LvRp5+Rk/ZTe9WHOSf8Ko1Km7NDlLHrvzWmrWfPR7S1bhTbQp4ld", + "mXqR2lWAGsthNNBnrWWppE6tC1PThxu5e0bsNhSdJecS1yMNOGBUeXlhkKvT0TS3", + "kPwXBSm8wLgMRqU//9gyP9LMXPqbdepNNtshvR8ZgzWtK/qH+JkM+c2f15iezKcY", + "o066mkHyMHiRrxgl7VAbdCePZ+rvS8V8rlwMRiAsGfoNml3YuRMl9sFRoGRHYu8p", + "lXT0O/naa6tsIUEdKIb6XVcXy87iJu2oRkbKTBg18PeY2aZSPg4AcwnlLet79kW1", + "qM4sO7FLzXoxCslTrBzYar8ESkJxeo5am6uwfL0moPWHAWXO4x2JpvcFtAC7tawe", + "smtNSDvKc9PzqXa7WVoOQPmkIJTg/rutOhh0k0vhk5obNi7k6hSk9cv6mxOSeWoS", + "ptfmW/n4iVMgkK5PkGe7Y/FbIfBfIsJUD/G7WwtdmPIF4VCxsWkOmqE9De43IiFD", + "uSaiH1VcKWYD3J4k4XYkMZmlM5FPSJlLIKvKFvGcMM/QuvMZJoE5/j+Dzmmv3DJN", + "gFwG5WXuZ8qwy8y5K2ZW/bJAtDB2bq3jxrCgsbk8hA4rTwKGAUUdyhNceDI5RjiA", + "t9HR7cXnLBG1WqCqhdOqzDjbklwNMLCCx8R9OUWbj/Ln+WmnVMgUrCo+fEKoiFeS", + "sujyuUVayLFUTyYx2c83SwvIiEF4cncgNB0mttnGo6npXLkW60bGE//6u42XT7ER", + "tQWUH+0nQYk0asSCLAburUXFa5wS6MrO6/eeMJbObggfQjwgXb54Od8dbD++YmGT", + "juvuBXAr8VdLEll7cqhtW63vBkh5+p0bmv9at15ccdgdi8QE8mFAhYVdbth/WBI4", + "pIWggt7imH5SjRiX38XumcjenNwMlV/DjEBMFsNbcbzNCHcMkxAhEFRzgaLrnTeC", + "gnFLAKgiwwsxf/wdS6FjmQzB/+V2n5GQan9xrR9is5hlpTFEM6SrK6disdYrAQA+", + "j3K1JDqMTyAMEEH22BgMPiy26oMUOns/J5RS7CyNpe7nWBSfsx85ShTCMr95fJGG", + "gtCVVpePoJs9EQ5gZsINsx2i4Y3pD5c5MPdSlwBG8t+WsqAkj92DPLxQq61cdWAm", + "q+1Mhv/DE5P1PMCIDe0MKGXfiXpWqYpasEc2YjlXv0ifsXTZ3Yz8rhfCq8KnfWkU", + "o0mLvq4191o5o7lrTWQusSnfOYkmzEM8u5/8OBSsHldEBznqMtnfTTuIA+foj9YP", + "qLvqfrbHW/BYxCGjc12MZR6a5rGTFZOxOliOAKp9+mLQmCx83L3h2YAPt1ogjtCr", + "l261VD4EO4jYf9oYY0RwkR3+Dgyrq4dMo4wQCeZNQwJtljfTnc13e8f4Cbv8PiEQ", + "j9lxHCxPevKCVVmJukPpaNpKaxFDuaZoGorD5Sq7+Ra4rJA218YoQylp0gAcliOy", + "hUh3TFLrQriMU9nQdJjrijvQh6SDFvftMJtH4AnarD6wa5y17r+mqfVAQvSl/Tkj", + "o2FRFGALToBaRaBLFqpTwspdijn+bvs9NZ2ENlg8uUcZvnUO4vtLspgjtPIYQljC", + "hSjPbtgtn3Kfmu6Dw+92PYVknUYBnEyn37WNeCTCAD+I3bK8WkDE142G5otnX05W", + "ub0/ovztVSA5Zx6qGO0Z7txW79PTmFr7FFO1wQ+BQycJA+UPovFGwz3nNtZZSVXJ", + "prdMcGsz08rpt63Fx1AqyY97+UoU1XnSv3e2E65VVjStb+YxujbcFL9EUmQ2NV4k", + "tmba5C6oWMm32QPqPKUnn2GccaxuP9p0aeK7ugjH6OEtajw1/yxjg2c7G3wh214O", + "kQSsetE7RBxrIjSjGeHFTn8XLJo+/LjF+rCsHTiLAYlamiCPWZELwA+5mLCtqxvD", + "kXGnsj89uzKrNXEpEuv0MrzH0yDB4njWUiALXUmtE6SeyOVqDIWpCIi+RN4R/BG1", + "mBstfFb/OPHQLF16f4v+cdqvlNSMO8k+gIOgojwa4f8F+QMS3rCbNdRRPB/6Vz2G", + "pc9vT9Z67LhF7ryNcwTJjGmAbXdNTEaDUPf4L/D1uu7MVoN3BeOUMqjSRqoqcHXt", + "h6UeABHdBIgAm6rJxhH73gGHj5zxWE6kB1mXQrsy7xBYbZBA2uPpgAoSXeVPgMBH", + "l7Q6bRpHocQVJ4NE26DN+pUmY6cf3K9Y0xPBYeR5q10bmA2IcAVcyPDSg77I+XQl", + "uRk5GsYOIfvyXLLWo85u353cSTBz5eGcQ9MZzEiOp/orTGyfyuVHfYMGXtt/krfx", + "orJ/Kj8TPU+Gad30/Ms7yp8YUcS6m7RPvaHSWcTSSYAc570mug7irWceRHxUZR85", + "kWWeT/RbnylBy0HNM1U/KcS2W+ncaNdHRn8rXjm5vsEtraBexRQlW06doxrIGdjX", + "q/KLaSvtGe6RUtX4red28KQql2LqXzfYD0f/IZ/AqOvl5uuSBFPhztPqW7oZrlvn", + "uWT1ABHwMTXpk3OeLmOnGTO6RYMECzr5bH4tzodCJlGPe2j2IsSh14ucPsZx0zrX", + "rnRGspyhWE9BgZF2DIBDSLQx3aBO7ouwr+WE3QV+sjjmEhPVsdr0rPwZVB8Vturm", + "k/A0ldU8eBvot2435otkqiYFIwBO/2RV3cioVSrzmFTlGB+MU2WBKx9lkmU0+6Xd", + "i4hkSMu760C+PnHM7iUWMhhtzLUWl/aetcdGAAtDJ/2FvjpY+9SfHfZCo39jiKjy", + "kGJF4t+22sPxp974Dy3J7/JW8KeXqLk8dC3etb3d1JXLSix0fPBGdhTemNCmNqVG", + "sBc2UbS6BZCx0vAmUYPzcptbsJiTUjyhLEk2Egy+XvDZuYczc0QH2Z/cdmeS/xCs", + "rLcGn+BCjTULi3EKcC9WeQvapNk6d4ZGIPUZDRrH8u7YCAGcppEKYexII50uyn8q", + "g0kyJY8/l+YB/pFWUUScBGJ0d5q4YFSjoEDCsAbIjSp4qc1VLApzWkUwTRYkSXpi", + "hUQQ5vuFbai5l+vyiuJBXObh+fakV5+tFbXfYXCckkqSU5ezP+Z8if+tYUOjnXVq", + "tGTXY+Xvckq37hOmABXfXJp4CaeRiP9qfg1eVAD+vUKtczBAallwSkSgjyKJ1lnI", + "i2KQL7KFUwBYDpSDCkvIJdmX7eM781b+O3wI1qi9haN4eUM/xr7lj5tEyigPTo39", + "pq5P0D+7TiFQeV91okGrOpXGIrRhX1U7qzQqGAO4axwaL8k72S7hJ4a/LeItRVeG", + "j3H47a5Z1pNoRti1DaKVIPabM59XS6kVbT1fDNSiedNrrXyn63JN1IrvxMqc4mvc", + "gg8WShbALhNpEdrbxhufaFmnxT0OoXuPZLeD9/L09Ul3XT8W4hY03G1UrvjVZRey", + "st8pRCtGnI6ehaA8uOplRFmO/j41EJsUyBAaDS2lg3oEJ9VVn05IrjAt7HNGT+wE", + "q3rdPzG/QI+vG0bjmZiCQt/0wDEQLDmhFg/DA+X23h3GX3a7PfsFarM+BS2L+Tog", + "lGav2zXRE3M8C8ELLgjOuhEyiBwSZSRBdgL8Wj+kpib2R0tfP2xt/0nXS52OkQUb", + "o8Qmnm/bdYgvC7g1KTiPuOCNAl0A2Gmizu/b04oGDllTW8pDASgVREy4QCF4f2x8", + "me/BucQKr8pgLvpOoA2Nnfrc13qWLIM+NHqSjY1S2lH7AA9nPNF9rcgOkRW6BPke", + "pA7z0ikdh4JUCWHOKFBUZ4s9Mi089/wVQgcijCkHCLGr/Dek13Ytqz3+pYKhEkRK", + "pOuQOZC+4jdLFPpm/CYtaCFmlTfpuiQch7S1yeK4mzL/9L/CirhHHvUujuvD50PR", + "kqrL/EEryqD++GWGmnbykLfVaK4XcxS0otj/Jv8dzdOE3WtJu8kk3QeMzOnM9DMy", + "hlihXflhwlZI/URL30io97s4LZISwMZdVr+c22Gqs72GYExof7aCJg28CtLchL8B", + "sQbG0TyhekyOpZkwboSRgSfPLeIQJ6w/5aV9Nc9vOx12cccLhm9uAhaK5OettWhg", + "mR4Px/3dDjFs9L/iBHjxDBW4u7YY5r5SpQleRXylLbitwAj0fUYkts9PfWwrlKKe", + "o/1j6HoAtIukamRqJhh65tyxZ3lyGXOtoTpUWFPi5RteTfBGMNZwiErUojBMxgxn", + "ror3hCJLQ0tN+prpRIHaTEJWAgl5NmI+iruHXyXeuQeqdTC841d4aibtZO9T1eaz", + "je031ntTaGGaCQJm6bVYX7/2AxmpCkJEo8M0JkH1v6UTCZjdl9ekJQXNiWwpJVUw", + "kM1LAyHxRcB6iZwMnfQBZ5ab8zjYsp0fi6+EXvFlXl1BHk5f3ZD4bBTvDIzDl2aH", + "uChi/WU3i5h0dfmLBoeEGPXNPX1GyuCPAaYx7OuIkNsZlScquGlpQocmO+oqgnnY", + "luMuiDmhtkBjMlQD7fzd37wyQQ41Ed9nOLZirxwHaM6t1Sdrea0qU8Ji/kGX86vq", + "iJgt7LCo0oPw8TSRgNS2zlod0R+ZRRikA5uezxxid9sT6wXLzs3QrQrD544kbiT1", + "udJJQJN7blCheXytnKWNSystiYe7jsBWyi85eivbt695OcD0vN9aO2/ID2X51TXO", + "tHHHK9KXE1P0tEJIuObPUxaBKGGojM/CD9DYml4BBCjDhyKLL28UwS954xr8nQdT", + "sgGwVG8ZxduI35xoTPVe1iO9tDkn0GBRvVlUl990H+sUhZYfZOjT0YEdni6eHlSt", + "rSRWclrDrrDkylwFAqirtNvYqIl9nZHmc/6moM/9ZNkHtxS2Ytc8CHe5jUqzzmqJ", + "pWe2IYeMvb8Pk/sJENxykcot6FNEreNAfVdHXR/k8bdAelYjkNs4caDpwFgnkaky", + "p0mrU/wmYqB5ZIm+hPz6WbtyP/dIvYmA3wy0s9HilDhFsNfGdXb6CjPIsP+KhpMt", + "oCML34PNRpxySAdL7FNeuoKAz95YfXxj0wcUnpYmvHZCtLrMm+/y2Oj26jmNwK3n", + "oSnJzzPfQrWpitmL6dlAIHrhVMcV073nAbcWDf5FMEZ5+wSBpPnd4kLCKphJ/C2c", + "ptbvUaNh3y6PHZk5gOTfk9u7MiSKhgjj4rckCTk28BPtq7LjN0hCt8zpYw5Xx+Td", + "qEFZTnS2aTXv0pWmwG4r4DzIwYeyd8v1zS9ZBjDUgSgBrVXz5QJzbRJkQaLyLxhn", + "k5R1COYN9qC9iz+iSnLveDyf3hw9lN4BAcdeDnPYAD2b7t/fn0A3VhMYDXeBWVDd", + "k+TXdAhHyu6spo4Lj5qBuUdUNRCIYVBuPTzNPXFuBc7SlKwwdD659FSWrNZDiyVd", + "rgdbZuXyEcIUnEWyEdEpe7wdnmSXyzMVNjxJKppRrludCii/7NdV1oVTc2kBrGYG", + "hckhe297i6/9oG/+rXF0q50dnsSxC3jZnnQoNXlqUi1uK13cXHKCdX3YlsdmmOr7", + "rUAhehhW13/lIM5rl6CJsqOZrmsxQTnNZdGZDjY+9M64174tgVJkbtOp8LB2LdTx", + "omftFEzdMJnHxBiukuj0aWcEwsnc3l/8zDEYwhq+CeOgXniwZ0MNT8/KD4sa0HFO", + "gx1yvNIQuLo8+TApRzrCl/C6ye3tDYc+S5mQlzQ0+RMlhKZu2vZRUSI1+xh1Nwyl", + "ivojImxHCDu6gKsb5VtIyQxmKRNVM+PkwUBX0Z/r66f44sq+YXsozh8L2XoGly9m", + "jDRaHOLkTzcefYTJBLyT0FTFWr1RJU3uZ70SkjaXA+r0kRenDlrAmEXATGBjTHQ+", + "t+/LIy07Y5khziHoB0TCk+p34lmCtgnozIK9OZmnNMoEykP0HZx8FdFi4LvDFSSV", + "jNnX6VPHrgfueF1oqZnnAlZZYNN2aS2epGhVatFBIpsfO8l5JoGMB4kB9z7MV46T", + "pDSK0wwSu33QPdAUzKWZw0md3zSOd5WwOSoY+ZgomXlHg3TjdKgpe1tsQnRB4rWv", + "lN9f6HZhEBqJtJCRo9TeiTMc29iFMeuwipXyYpiG7lOz3LzCa7a8aLRDMD2NOXFB", + "pcDkKFG3adLYIuOSIucIBoRVquO994KXW1nTIB5npY/WbhbTgFWL8ghryriQqS3V", + "p6z4KZnedfIx/YB3C8sPTHINax5KJVj6HOhUOC/akr64n+pbXSKdrYX6/uep6YMp", + "puSDJfrbs1xfqX01wLjZl6wxMWHrNrzXzV4144u+OtWIDz/TCj0z9gXlknEJRtJR", + "pm1bHPJKOKWYpF0WgY0E4cEzH4U1WR57nT0T45C/tGagGACYtGVhMeCHtyvxC+Fy", + "g8mRcDp6rH7X6I/gL/3e0aUEQUOsLNA4toeyzNN6adb5NZ3hBQiz0oKpWFR1E2+B", + "pMTfDinbGatMgt1sqFcLM30VtZx9hFd6ekRKj3Yv8W/1qz5CA6HWtgoj/5Sak+qB", + "siNb32Dd5dDXjHLLaebgkVOwFU79url+G8kfGNPOxPZgqAMR/moazUGaRIq2Wxjx", + "uId6AKJLD/yyvT/OioujJ9juLpjYVTHLYf7CH9Sc0Wlkkc1RAkqcOCDPBqd8rPBL", + "sESFfYedBum+XdcEmLJ6IK7nWO+CnTfQ6hK5KqhLnTxhlCBTaAFNlCrgUXz20OIB", + "tun+n6PUyDPDvq5/eY8w8H48329sjrjitwytUbN68lSdyfLn+X8ZTliX1N7bkEpF", + "gWPuoY6swGLnG7n3QGxY6+HOQqi5NlYHfdeBwncuN3df4g6NW5gN1S/a2Yty8Qtx", + "pbIT8djdzZ5CVw9h9XwOWc1jeXQOUCOSVzlfL+f6yYLJhhaF4PvubHW87VqmtkhJ", + "i/oQatpJFEGb8diQDFmB3VuQwwIxltfpGNYoefw6V1vQol+Tk2b3/SJA32EIsGns", + "jlTHJw0scEF5byAukprpIf0PzcjvHm6ufmfUYRFP1F7Mf7eCR8ByIi5I0SkqEqz5", + "gXHyDAIPquESu5LKITwd9bEFAVFJbHDbXFMZISutqDsSDVFb19iyRzYJDFdOG3ID", + "meJllmtrj4GGfw1gS7cIAyLpJW5huB9+o/Kgbc3GrWKoI+c4LSLUzCz2CuKwCK/d", + "t4GVYRDSTkUQqLVQC3FSn4Y1qkGaAJ0xSJjoxXKk+SO6ZDrpS9/fkiRQkXeqjmtz", + "i6exLSqieG5Qpub7lvggXtMrJF42P4g+xRBH4wxezK7bpwHYTCzPseKYjqdtL0PI", + "qe+EWrSJ9h2/3NcavMKfw480lKACQ7nCC5zQ3Z6KDyMwTfhJObllLN9VQtmz7ghe", + "mMj0XjSAkRZKcaBrgWapktxpIXfn4GBj8qYq2+4gKMiC3IIliRxZOG5p3uU87+Ls", + "jPBrNOcCHpQB63Bd3kEez35+cYX4wLCu7ZSQl98xgSqf3U230Y+Tg6ilqNLVj6F2", + "tC8iuBrg+L3L/eTMmogutGyAsJWYleo8H+OXlVC7zz8XnqOSX+xbGtBQPAfnoRSM", + "iSVZAoRss1xwb26IaakSJSevz4qLj1+BSXtbccapbGAecYWsx4ZG4qeITRSO7qgV", + "jU8kQ0xdLbVt94OBvogK0IlJ7GcCIECr2hEuTVrAcHCqkTryNyrcrVGgIpzm97AZ", + "j7wnTFiCZm2jnn72Nqic82clggyK2m7sCrm1rzdgUktzohc8KG4VXFl7TtcX2Hnk", + "iaAImyNlATj8Q4YLVqL414skIm9iMJlZcEx7W1NNIXM6a4YCYCeplZjVMsl/6a6L", + "kXchY5sb0TwzrVszLkSGxCAu0o3dn+l7TSNnqHgpx0LJ5L+1CIJ/S4yt0L2rmXCP", + "qLC7nh+LBQjH1uc4JnZmPSf7J+PxwOmRopXllJj0pdvMTPicc9PVh/s7j1g4FTiF", + "tesx5cugGT50loCZrOWAjfxFfG9ATycP3ElJtg2qdge6GBGrqxuxn8za1h1Im2ZX", + "rSrummEkIjXw72ra3V0xSxjlFAg9alicplzIn1BeRLSAck12Wah8lbA8Ysq6U/SH", + "h9SyC74tzU9l9OEIf1hTLVFAs5pSiOGmP8C36XpqVpRur92QugkwDD0f72NWrGt8", + "rgfr0CZu/WFuVvtRAapxuvvtjCvdqu0nw7Bp107HVgH8ajzsvZF9isEzkDsdMyhc", + "s5ftcTT0R9m/HFEb+S8tJ9e21CW4tBE2X772ls/5XCF1Rhz13YPZO7cA5Q67mblJ", + "oJsqB9hh4BZFrM+wiPf5rVJBhr1DlxJ3VFmmD4ofu9Q+4ITk1uI//OBtqhic0eZU", + "o5aZJqouUvGkisUwdLdkZItMcb1DQwlEZ5YoRjzWg5j3ANh0wUUDtTdWvkUci6KE", + "i9t9kpFdEBlzKgldlisMpWvdFboiYRFw7UTIgOoBcM0r/w3/OIof7UZ6kv11aqXu", + "hQUV4WcfhprR4gfUSGfymx/j7CvXNtvgU7W3LVP/l9ecKCGKes4kxy15cu0mT3NW", + "kbSd4TxRF3UnZW7BqwrXTOhmZVD34Uuz4ZGZtbx+6Bxy8f3XWToRSNHQdAcIXFha", + "uMQcCcIo2mKlSOSc+hB2MBZqxcFGmr9tiqtVk47R0ULV3bxPEEPu2UlukALKyZlF", + "q/cuwCgNVpceWZs755FfXyJMDM3ixEAjfme5VInwyRVKzgS3dj2yKEc3FfaAU/Bx", + "qxq/nPYw1svKwMUD30RgMUKsgazWR3hK4Oj8l4AO8EN4vJ1/IIf5Wa1Lu+7GW43+", + "lfqGjbdZLF+2UdXZlx/E41Tf+WnWsFCF9dAftNoau0IOytXssOiG4M7Ryd6PPVz+", + "jLXLfLqIavWKytxaQ0hSSxOVo53FEZYxbXWam3LZ/A/kW3BuJkOToT/5EfDRXeRc", + "khC+KQF21+ilAF0n5+2CUGexxnixdLyBgPkrXAO2w9GCI1btuoT0YMr2v1J1zX77", + "r1HacX0qRauW+tXZMX6oZ+xMakEa9vq9cuVoIwCZoEwDag8RQViBWxp12mR03Ikq", + "tyyTgnuMvL3jV6BM6uh1VNudKD71Nf23vKRUYOpWft98G4LZbH32eeZOAeUB4LRQ", + "lBzRAiKKqB75lQYxOkSSoXxQbnFpgIxrFN0zAWTp6LcbdXy+bhuwIYQ3Kowm960f", + "iTTpo/6rq6Eu0ULaow6RvW0otDLRgqxiVQH+Hcgvlzxn8P6C05ybHaNhO7i/4vd7", + "gTN+vpDWlC2LYZIuqIDE0o68dF3cEKGsyFt0WhXGyHVK8ac7GzSDtqUCS3g1ELNc", + "qglA5OVYbnmj2XOXyK/z0RLG91nS76wpNmrMW1xqfP741QUWvzCdqLeH3iZdyN7a", + "lSy9jp1enSMTno8+l5qJtUIGGI5if44Gzfs+OKpRWeYQYpv3lxOVQRC/pvRQxuVa", + "mb0/yigLOtZ/Wy0ZPeATKHyt5210FPSCjKb6JQbm6OnaswAgevCJe52xRgiuFfsC", + "jXl4GTGM33smQF0aMn2A1MKJ5W+DCyjU4wO8sBmusLPWm/7VitzeiiRF3VKBuGrx", + "pJ2kLCfQGaIcxkia2ntxK5jE7eKLol28+pFqzvSERqK69z4DpIvnYzeKCXdNSgP8", + "iwJ8FK/+R/g+5ZtQTYOy/S2TA94sA+5Z0Wm7GZ2fS9ZTPX+MgS3XpvHoFV4+GFaJ", + "qf3CIJu/SJcKQE3j2APGWxG+lqtaFlGD0F7WR3s6DGM8PW8MuO77Qw/dtbW+jPiH", + "mZzsajHZsvKAAX3dWROAFIKfo0yrWObDWlAU7DZLhHEkQeei9xfPLw3o1UUeJQkk", + "ok0FtRx8Eou0mXnL2QGeZhhUXZUnWkS1w9HQPnG/Lr/99D//UMMIRuwn0nkEPO9O", + "sz3j3hBr5hSBzLfwenpjz00WdAEORiOI+4q16gj0RO16J3kFIH4LOqLwC7nvyphP", + "ptn2fKMZ6p3lDD/tUTJpuD+gZ5d639Hp2e4HrWGyrB3mSjnXtol6tVhwz5gv5IHd", + "r+O2Mj7haxCElATyy47swG7O8MXKBRhfZkAJOUizZRLZiW51WN6glD1+Lu6PZf2x", + "iPXr0PUN8vknKZ/fndj5+4Er0OLlhNAos89e1gb9q0z4t/8zNdfMxmg4sSTVOz/A", + "t+tqSb+PlC3Yw3xBwbNd9D5FNuB8qfTBz7v4qMA/hMVMGg2OkBxJ3lJpAK6sD5Iv", + "has8V1F+PDSOfsE6h4uTA/+arXjslbEyQuCH7EHwX0oZNmrhaf2or+xTAAZdtY8v", + "luwE49d1S310KSrVNtj/UDZFsSF1T3CME8gNjT64i31XMGoauv/hoTjOhJiw5i09", + "iQmS2mJXzrRSnWxfJwQHCD7WkqHhSxnAYNbibQCqlA6xY9+ML1sF202xQa3S5k2I", + "rHmD1Q7ER7ZeYu04BU2OgkLDG0ADD2MAmM4KTpNTbakXnD864LNKCwKq1CepfuYN", + "jiooHpRKKGc/uLR6qiiDdc79OmviDkUxMdhTY+zE/VslDn+dfKHlNAjFSUMEGUWi", + "hnXSEOZ+3bPO/u0gC54gVnnTbY3K1w8J5njY0bPrEFnRJULzrKMA84RQRFiogd1g", + "kfhw83LhGkc80OEmXCZ1chQT1JEPbt9UM6XYt/a30MF4C1+oZR+nlmtVv1nLDmH9", + "rX0uOCDpya+4r+PQG2K/fgXR1cNpcEVWIFmkQhiS43UVrYclHHgPkX48xy+9MYvl", + "qP1j2hbdakqhUyVoBY1/EoMWmBNAScFWotICZN9lOTGPZeweGnM+DwOphFB2u434", + "pnhu4pDXU+vbHfurUFebR2mXQUPMe6hVgjXqQgjoSLK+8sLXGc40sF/wJspA2PNb", + "iOehKpBCi7Rbz0sBRCwRYHQzIR/C+b7pVFME62bgtLUzk2AWC8eC4YU5E4XafFrX", + "tBeA2dZ+nouBsfYtJcDHLs/aZZ0r/mgl7bcOzQ4HJCUKw2TnvlIc3BErpjjxY2DU", + "gEFK3H4KnLlhsfMWgsM9jgHjuM8qosKpEaubH1TVxL+S4YRmys+bgDMxEqsBUTbS", + "uLOTLs4L7V+fCbbSP+u6QcvD+64Uv4Gh+5EQvhxgWIy/XpVwtNBPZ5gzBs23QwXG", + "jlghn95elSXlJbFrUzLvJ/tiaeCOjAvTwgq7iTl4ZLLFu1X1tuA+jwoOCwTl9ysU", + "i8Fh9UPsWk7y0J7Lydaia9YkoG/KZSi6Df4Jx4FBRc7nHqKg4SDQyB4wyHcdejq7", + "qQ2VAql4XlXBmWMEVvyx55S76w9fjAIuZvI4oHiZmLEmz5kR/Qt9Rjt3BtxvnsEo", + "q2tHYnz3bZVSxyOBjbXr7nc0VCQ2tQ/+FbOpbo56a1T5oJZd54QF4W4wkZPxRxCN", + "sO7NBMjQn9Nk+cpyQDaZXBa6aDDWwTpICzDrIRjGbAGc/cnazOa/2CFavgJXM+Q9", + "lGlrv0WfOiG30DiSO2IbW1mfYNJAd0UsI6iQDY6kDAFs8vm0Ru8AijtuKgxv8c7P", + "pMS5YHHnvJLkHe+6NQfd9CPZPzqUJxsfmBLfxGYOTJ/STg3XrvMkxG3rjXp8l+qk", + "iHrA6qECBoHdQFMFKZ6ZSgK8cbvGlkhOITinHqCfvw0mdTM72vQopaFP0dJ1hZq0", + "lByJYt69J1b5KmoEUaK/f7wB8y7QPQgj3/1KYRhmKKTDx8SCsYWJ/2XkxEn6NcKk", + "lwcKMzk6fJzpnFGngRtB1HfVcIbnJV92R/02nenUC67WPOHqI62CtkEuefNkwtmj", + "ssGR00ydCe+0IWS+Nc0E8m15XSVYsIlChuRV+Oiwl30HFOXI01ligqQ0pe+lJI/F", + "s8oqt9ZLceQGk70+Ioih94dBoTlAPHg9JZy53Jwp8WwAeWtjAs3OpKQxThMrT50c", + "qwrUIfb9BWaHtPpemd/5e9CIQLfE4AQ1652oDg19BxpEeiL45cHF6Tqccp5bh1oe", + "iprZd5iOuNmNn1SeT9IwU0ijTmh0Z0vNbkZ8eTu6bXovPCD6RKq79xUcpT7LFhL2", + "jMRTlU+0CgGSnVKe3KHOzdFi8ce/C7qZ/4XiswnPRqBPzIF+ucSDeSf5W1TSqoFs", + "k+AKEXR/f5dPqqnxGYsT6DtwbNsaPMpZMjDc4uxoaIt5nBpHaW0zz1o1dpEbf/5h", + "gS097To8nljuzxOim7TME7AbKgrzIkI6KbsOT22QIdHYesSveipriNNPRKi8GzxV", + "ttZIKte5tBL/vvu9zCjrPQkbEpH1T3e91TxKyF9wXEVJQPRm3Cct3nsDwm8M1uyz", + "rvtw6J2/RFbgd2kFCa/Nyr+XVBb/L6Fnd/35Czq9P13NhlxD8evm+KZp7cfzvWrY", + "k19ha8Yg3c3gfyixmmbJlnmHkrlTJk0UcfaG6E88bxJeKj06elNcQXWXPH7S5L7O", + "lmJWaT6c0B1nhV2ag085qOdij1MeE2tRE7fNuR4XtVT8vvJhGSm3RxBgZYWx31m1", + "oNFRJ8BeRBBlVyL+EBLQxZyXWEo10QEZBDB2IWI7cFXY7APWfLkfBYS/Zwt2rBS0", + "jB3kJk4E/36Cgvr4HAv7WUNlZFG+UhcCEct630/yG8y7eJQAc1V5xiL2mYL8uOnG", + "pb9KrmIrWKN+ciw9EyK0ApB/EO7DcqQsOMAnuV+M66C3tvmwiVa5w/3+2qg9V6IX", + "sLqIqRY9oHi5t4PWwpTBSRs+7gWvpvpLDq0WFtMt2pzETIgwe3AI4Swglv4RprZT", + "t5tjO0hw8sAM3UR8K7PvEJ1jIYC8ptgOxpOGWf8yUXwe6U8PG+Ga/VVCD26amgYw", + "om3ZsoVkw9lWeaygPjQyrCbih/gOhwcUxZRrBVOLPLQ7unuFwWvOtUMOgbegTBsd", + "pSDUkJX3alvZ3qC7yLLYY71pTZWLDZhsaHbDz+BcAX/qLwjseavEKfmLf3tBMVvp", + "tFsoWGP3MDojQXOwbo62PI4rcO/g37mHLj793THVKszw8Sks/RI5taV0kvNhehno", + "ga1brt6srhLxnMbSaHeceR3b266FnSGIBs+Ie5HoO+40cnQLBzaHfIHFwZae7M/s", + "mcOHF6QWpfQaQugWHMTZSQBM6nNgRNhp4LQxcTuF6y2RRLsgtp1pnoEEIc3e9ROt", + "mC4QM75NxIzCjHmQonISo6Z4LRDZ88GwDzCkQG81AR43rtr+uW7fhX3oYBpxibSR", + "qGZjO0KT5yasz26XrJDBiYysg+hTGiW1CumfDstHemkual8kiER8zYPthpq1q8QG", + "rG5+mWAgcTjVtLan8GF1bAHMSoMOWYhCPTRPI1RO0OqnkK7WOiLfN1do9nDMm5vU", + "t8ZtpIOxjwg0T8PCe99JFNq7zv1+52cvq2UdBRJ9hdJc42OwwzjW7tVcTjH1e8s1", + "p9FnaBboGnUiZ9MJAU3hdytXGxCcKQHcfJgQ9FQX+qGMgZZcEUvkie0XjlSsNoeh", + "sNQjGBTkDlOrTu2DM9QYpuLkvTkQFIthDexfkZYd8a1j9GYdUzE3pQPYCeoa1Xb6", + "hR/K3r7gaTAYbzUpP+79QNfa7eyblOb+WWdTbCwOTMaPWNP1+8dvHne5DJWAB0+Y", + "qe4pHeWZcjLGjJ9sO1aLBfRr/t+hjrN3ZpnZjMfGMgADt9hiVk0H/Sj8NpHR0osh", + "jVDpBNhRpdjgHXkC2KZ7l4VxcFyqXljbMDc1CQb5bbe7FBNU4p7ZpH715ZkU3L3E", + "gTWgYzCC5EZQkNaTC3cDQOgjZrxcN75u9t0QX4Ws9jNh4X3otfyrTILp+bQCmVS3", + "uV4wMhkr3AZDBsaDmC2IXw3ti5B6Uy8VUmolf/7/LIvdeiM0wQ10sUhJCbLjrg5H", + "hnk4me9xdAqy7CIdAIVwH3kJJRsc9ZonbI1ilJL57xX8C0cb7txEaiW3dzkasAcY", + "kZS8ReEdcnbtHJ7zrVoz1qJzcvVWhWPKjuIT4ucCne5ASrWsuuyu9pgSl5jTX9iV", + "qNFYcKq5zvjhFqd84pr6tMHth+X2H3+gFm3wvkjDG1vMLut2ptofBWpVGPZlRDBU", + "tN5/IOXRQfVoK34PAyajQp4A4CNvuK5Y6Ewg7XqYa5Uc2jDV4ufnGWEZ29mw716h", + "px0sg3R3b3c7rU3m7fxfP/HqQfBuuAd4fT+6Wx8PdBquY1A9vKUz59TX1Gq45JiK", + "kCpTO9uTeU0VDkMwhMTIIAVV2W/ojxRcLPrxa6acxTTobMWoj2cYUdp/bBGgLfa8", + "oETNWjtyfcHLWYdeQCVxg3XRLnBv/820iHTlGmddwsq7IJZwGS5AjNztWurGUZLk", + "tU/vPmeQWc84pyG2HL0dJJKwZnLaDo7BEy+EXyrKs3W/LLpenk/Wgz9hVYbswhx8", + "lRfNhDkPu/t4Yso+AXF1C0x1oVzrYDBnPna2/BzmGsJk9t0XWNgXZiq/xQCVVQvT", + "ktAOZO1xGVGuuFKQiutv03nqUWhy3VEjhLHnc+8HjlLm1hi+sgLUN9Kka8t4CH96", + "jkhuYE/1A1ujRoRkyffYi/ZMhu+3OddpMdHloQBbKIiffJL6YxQcLVQ8PpEwp1qp", + "rHn1SR270OtHZpIl54H5S5jQSUfLxVuvKHNlgxwQAki9CznJEawJtRhxW6HvBgLz", + "o76DF3IYgsfp6oUvzzloEwiAzJv6Hz8tfpKZdtJKrOx5PDpae7xTixf43T9peSRC", + "h4So+mLgziMoM4YXUAe7eBqOyRsG/ZTyKiDNhpkp3jclmEepSg8iB4qxS7dHCfrG", + "mD/B3fF/l1bJzswAs5uyrUMlh6XG0cMpajg7n1Ocmv6ExsgYRHpwnAtoa6Js5eo+", + "oR+q654sbrqi+2atoQINcSm3XqhRiSjEzuRtYjHCf1GsInO+mczfdOhZ06MhnEd1", + "kKkItH0MKaLQ5+ZaIS1+F4hFQGL0ZFjFGcfyzNeU/yHUwkuRrPQqcaUJr/ZUT2dq", + "tC1T+05TkHKTgbdKuW9IVR+RBcIlbVR8174O7VvV57fOhwM8VdDd+/4I67eC8Yvg", + "kZtRh699riEPFR3GSpy9OW0a4ErK3r9UKnEjAE78fOANbhTBcNh2+8ZNwbXRQaX0", + "rsXpFfI9MnzrN2Es7Wo/vcsxU64HX6N8MhRqeqwDj7ZeA6h2ErmowqiRiPqYwKYw", + "k6vq8F9aan6BUjZ7tVa3dg905jhHU5xtd0DmSXcMaBpnhB6LYBpDrlCqo1Er7wbt", + "jvCTDbBGxFylxp1WXVRoHSttJJ4nCSc2ruWCsp3jqsP9luEGalfK3YUbTlM0JhWU", + "j5+FrmN3QU/PgpftRac2IQzTgD9U8zEWsPKQuFPcYemeoI88Qi7ZvGvcL0KrT1a6", + "jr+8rM3dJInEopo3SiurwmmHwzEmB+rbLEsKU6F96XEHxU6rNN7wkUSzCYwILChr", + "qY9oVpztAM8sn4X+C0vKq+0GUrn75Di7WoZhKgrdtZdeO5g5XypHiGOcYCzyGoSU", + "pp+IUyV1ScBFMTyDQy1vEy2h4rbPM63wYrQ4OoS2Hwai18CZbf0P4+4VBcEDMLcj", + "sH18Px1Ib1ZX1ZNePWdAMCT/3PJdpcRg/a3JgNjWuTHeYjxPij2l62rzRhk+s2Vz", + "lR1p8yaFYV3zBMA1FRvVltQ7wyUPlm4Md3VExQbjA10DGvpKP8yhuFxBpKBBrvwB", + "gfxySEa1eB83NnlcMrIXRYuymXKvNsxEg92Yq5FoDT2bwYhC2yZhSH06hUMNyeMm", + "tHRcccRbzDAWPtT6161waxiPweGc+WL1R9VQD/GXJJNTnSeHwOWs5ahffDnRvku7", + "qdR8tMaf3lUbJkiiRECRUCpWp3ghKrVErHXMG9FNDwQ/TjHeR/zpqJDvVCjMKN1B", + "gQC0isJ4VHehI6eWe/zqi6zvWTkWgKQRaSiACYoIdx/5eGvTuN+wNMrgDVp2ZWIc", + "iQP34Ml2TOhEsV2E/uoEQG3GaxlaX4L/QCfyc2HhHPNoU4E30Tk2j1pvQodrBPBW", + "uVKJg0GatXZllmg/rrs1kpgqdraFk/gQGGtOX5T23mCDBzmtjcwWTGAdV1uEvScA", + "jbi24GeTHokj+MHZX9ovouvmzhegT0IPEG6usI6YdI44Zbnl/KGElMI1nTVifAC4", + "tdfg8JgG2wj2sesx7FQ2cEdfRrsI3weB5/45581NWwxEJ4OpotVtp2fJaF4nESpU", + "hxRJdssNVd5m9hJyXG2JqzWlIi6LADMpuJjnMmKfW3AipyI8nMnsgg09FVPnsiZ+", + "r2HwPjzu9b7zavopui7cejsByibOwlie28nRJN1G5BQQ4OOvuulZyDpvg5u8+ASa", + "tAn4fwYyqum8CBNFsXpQp2e6QZj5rJ01Ikb7O+vSntU8nW8UjC8xjC6xKEawqsTL", + "uJf6kFKUWL3zzt5c7T84I9+5ttk7lrgUKb8F6PGoD3yFfUWARc/uWClrPMvEEZq7", + "qdmilVkGQbKwnYRztQwPbgNuGgCdzRoLFthEBnY7SweNXebKkImCMuNPf3vxR/Yc", + "lX7BmGee3Qw1+D6yrm/eAQUBBMDuPRwY5SD5oW0E8RmZTg67tGd3+cbeTkQIquik", + "qyaGG5B9DqA6sYiFVdXWeG1yMbjktg+NZUW0giDmUkhXbxGHjvsuh9fgT8SC9y49", + "kkRwMziHnj6gBmPc3o8RCV3j4435J32MKswm5yAhwiKuQLzJEih4n98LaazDFEeD", + "tKhvtbAElxjK6tG8A2gzosrriOGvrbu8sM0CHZXh8z/MkW8Ll/wbkibDcFDjRjeW", + "tmUkQL0BMWUj/u/OtGAVjNm6Jo3Y2+hgoCcfAXYjDwV3Z1l+QZeIW6kHMYyiAroG", + "o0e1xw+jz9d+hZpIbcs4yJbMq99CdkaRvvGhuY5+SeP9h+hxCjlqafohL0xKkEBg", + "qtlXdQHX86XbrDKfLB/nEXEIacyCV0DzZUiPxVonjWh7tyQjVg98ssvWBUaoLqHm", + "ru7bPHOp6t7xQ5akdMqDyp44hf1fLBAYZSNgSB0L5JUk3iL8HqGLt6vKZt9dx9MJ", + "mC9xFHcvek50qaEZR4TJg+m4tMbCW0K0FwULkZQYDx9EAoqIuV9KmxpjMmAXzfYM", + "tQXZn2qUkmQcaj1iFEpw/V2DynSyC2HRc+mqg6iKDL0M9Iqo+hs2IeFf9DZGFSkS", + "p2re3fJFTRMckdXi46Rk7108QO5qKrlecO8uSeCSDST5sJJ2JQ7XsphRr/vbx4ha", + "q0EZ7vlBMxmK22hLgfXpAHDTyo9XjExsPQfeWSqa9On6GDFNuCX0wxzqHix8Yu2H", + "lI+AjGuOPhCamZZX75ZuHgLJanqubuyvkSNE4ce/fqUckRzs086itB/1Wswx35RU", + "sCzllDEPHrisySu4DeUkpD5mPhL7ZPwoKR/yB/nYrnYWMUFkEMPI9NaJC4t+btJN", + "j32+Wlf3sKRbfJ2HM4uP9nzpl34uxmn1UC530b4wiJp5doGcRceHsnm03ZZCOzcV", + "qusABdd+Eg73ZPF2SWeDPLph8rMLDp/tHT8MkLWtZYhka4FTvfHWZwesLln9SiZx", + "uSihog8HilD5xn2h2QnmZWw5gPILlruNBsDMQlV8zSkO1kzXj5ycoJDP25Mn7r2J", + "rjarEb6W+Mj8/XU4K7f0cnURWWvAjCWBTSLyuJSVJInQg5a0WPeITWs8CttphWpt", + "gg2jZ6ZgFZWausuHFUuv2Yqom/zZi0Ps/MZ6Hiae1QR3drfPcBXE3v0PtQDVHBoE", + "lcmOO2ti+E7ffyl8rpPuX4JZNHiHf5L7W/Q/1EIsPHjjfUjB7nykdPgHqz6EjUSW", + "tPA08rU/+Zieig8SwUhMWO15QkMqQpr1imZZ/q8j99K/IP97mn4KKKLgnJpzBoHY", + "iPXnlcs2qyK9z/AcrKDp0E20Y8PYjPZWw6Dg9ayGS3CSxzh1i0yPO2XjGZXGqvJn", + "qzPGVYfssyeDJZSMcGrtJlR+R+0rS8An6RGbs3vsZ931SJ+8MDBO9sgGmcEGYtOS", + "tUnO8Rv3yLz0uxHlzfWiifxL8UWCbpakRvtMcposg5pNjThinMWZ7afvoF8880Jb", + "h3o3yvVu981QNxGPeXzeHK7PRy+mvKeycY6lVxUTaiZy1JTAeiN2BsfnQwqWqUXo", + "qgICVJrb32NiriQpBxWlBp5M2zZXRLj16tlcqRM4hbgUK1269ZeCothBDz3XfPdD", + "r50TEDhoyFSCG6UYkHsGfPugJdc5El8enM4KBP/8OiofJVBsEgmgz+HWwVcsIp/w", + "tOa7IH4IoeCW9rJ6WmDv/HT8jbC2zevJ3b6I9DT0yOC9f6d+AVzDCdsPCSK9BbP1", + "ieGbZlzn9mF4hK+vhU6Iu3tQHs3RlaVmLHmALXIfU0DsqMSDQa0dbHj1GfguWpg2", + "jHIqr11drRhFBWv15W2/8Pi1AfSEZhD5naARMKScltuZYr/ZviBnBljPJ2zDCL4I", + "tVHRzojL9P+9ywETpuMZUTvWdtAHjdTmpvI60zbB0PtHpOQnve2+D8jxUjU5cfgd", + "lcCjCUPvNO8KZEQ52FdEbhwXNuGDYPP0GAOwyhGOea8/ucYI7EQKjeD3nSwkW1g8", + "qYUUhoe/hE4Sk1fsNU60baVOXvlTnpt7RszWqmogGN/v24WJmAnQ5LhEvqgxs9a6", + "lZZ1Z5+0HdYlldgmbnloNMEgfdcHUOMEsc5F0/whXOtSFNZlH8l6BhtqVw66NbgR", + "oOByrKg0VGT/UVaTH4BNOcZXjFxH5XtT0M/asPqPSfNfStFyhGBrNCx8tU3r7F7i", + "r2kR7dbHrTD5BaCj94Y0gIgy/etCBrAGk0gi1nO8ztjjeHeSYbPEt3KzS4hxmH9X", + "rSj+cKhgb4e8tdb0Th/KSZwkvO55GXH1mf/vH0A9x67Cq26+1zwfh1CpsP+PaaHm", + "oImRibumCIh8bLcpWA5XDszpynEHhl69MN74Z6+qolC6xAfDDb7hG372zUIyaaj9", + "rA8ACrnQ5v36eOcIsNgp/x3Wpx8MmvIOKd9+/5JPUm4tmgQq7APG9a+wTCN3ohjr", + "i8o1YJRhieSYQSastCFT2NrQtg5/hlGLVeqf98iZyewSghhQlDtq3v++k2O85NIX", + "jX3BdKo2HQRs8YPdICy8Ev7XgNcFP3BH4Rr5re0zYxi/mSiqtz6/yByobxIAcHe2", + "scqP7lYZJhEJSuhl9ff8/tP4kwM4bo/ZPqzmJSF7UaICPVt633zfBw6FQ4zXP9df", + "qqGN9K2V90Q5VazPjsIG9G1NitnxrbB7FDtCJVkJF+164FD8Mp1UMQ09CxmM7a8L", + "q3wFgZkpTALh7fm3kABPlxy4xBrn79JVknBZcBQc3VMY6OsYeVnxrIv0XFnx6tDZ", + "gV9TdR9tPn12xInzyY0rSSFJOMrIwrQX4tF7sTRGwoX6dv0yqX6cRWSmj0+qBprS", + "scyk9BcGOoYfbFtLvisSm8cgA95YuriVMlKD/18QRa+AjakEj6ciF4Y+PeWshyht", + "sIPEzvtVVXa7N7cfMFMoIstLHhmY41ywD/uAyhTihTGTwWpnVkF4U9SnTWJXRN12", + "jo5ImS0DlPy5oMVrvTeXQAEo4o/jla2az1gpGdZtEaSBGnGHiX5g7iq0hCgAyMNs", + "oC9/7AZhOUOZqCsuMVEAkWCz9TkgF7pXmzAe1CyFEAwpWsv+1GtsWKnXF5btCTDm", + "o0PZ/tUWzZ36BNJULZPe1vC/H/XDHP1Ph7BhRh3E5GzmWDJy0wMnZ9wmcBpN1Cd6", + "rdfJmrXWJ5UfQ1vyu4Al6DVQP2Q7PejqcCCUAnkjUT7dcwdZDMBz9WWGsGt7X8pB", + "hUqvoynislYzVWQeupXyq6WzPUQ6sW9eNCBI+X2XxOKBL/J8b0GAuBECcvMVG+aQ", + "sAnvysGlLk11KkgQr3hN8sD+TDOf+otqN2MuzPBEU/ucwcBOoniB77TxQcWA98Vo", + "pgxNsvIIzaKEsqLe9gAk89iIcxkaiPa3HOoYannIwq9OhGkvYZsX2dwvXz3SDH41", + "lEJZpW47T3RZliiZEnQCgb3kfiJwXxQsKkg//XAeeA9RoBsXfSSU3I255pFX9F1E", + "khslRriuLf6cKci+1vdIUpiJjpp+W6R6LAJ/j3VCAYP1q9z+PsO7BoxoSNDiuMaZ", + "hNPioG4WztJglLNWoWpPtqrVCtmrI++ASlhSoz7wv/dvPF+/e+sGI3bC5mnLWYZ5", + "qwGnsTyWdiDZjec2uP8j2Fbaom1c2Fdpk+4CpdaUMywEZO0Bjr/81ccbq1ytqFDO", + "oTvx/BgmthzO78yUHFpIZc79+myR5SIzCPpqCqbnsToEmaY+312f/0j96ug+ONy/", + "kw9xsJo2i4ZDWDu6UYHgB0sa1GX5vEzzfiIrlAQStOCeHyFyIm/FpvzW1Qy8liXo", + "gIXGC2sSrIpb6KfiSXdmMSXDSCeEKqOycwhUqxmd0NLqqTCEyVmfCTm+jbZ1ixmL", + "kuwa6yqiTFHNX3JJcsi2CV53sjfYP5PtNMoLyRodvxrZWtzMWeDwq7/vM/Mx8ymM", + "sqQADODd0/BUPr/kkGVwhTqFNQ11QYof8mCAmcBp8DUQ31duoMu0Breujk8hV2gR", + "lLgdWtcu+03WCGfnGvzY6H4fJL+VjUL8B9tm9hhaHmEJh6uc7vYxCaNv5VRKDPgm", + "sYfgoxeqkq7hxr14q/NDnJrPxoEj4CSa15mXLQ9B5c0yqOnfIA+EjA5zrY0v3byn", + "h8rEI9CEfuNUf0WsW6v1O92xVIFOKR82jLti3dTyxvGNd6HDn920gr7+Gg531bf9", + "q75NBeN4HhG+wp83h24AgRR64JL0BhGRREu/dE8yfJ3AWy/2ZIeUK2TWs8CZM0ZE", + "q24xgNrjmdQSQ/I1ReXm0RiET5uO26UCo1A/0RYu2Cb5/GEIiaHWhdN0tsIehgZ9", + "q/falSydj3X8xn+nlp+sCybU3D4CKWHtZ0zoXXNPEWIKlQ+x+w74MPuh2LW8Ps7U", + "h3mgN2V5AI0NqpmJX1SN0JGzq6s36R78nKvwiDUGjJg6sJJ+fI6wOW64Ol4KcTxW", + "rz92X9KTwlMHKzOngO1okz941+B52aIHm2IydVvt9uvLzpumXAH2lWAvqO4XiZhn", + "qMu4Xo84c02VudaTRsvLFpwUm5gB2dpG314ntf+NCre4cMg9s/rDKpDQLv5fuPtJ", + "jcPGR4/gFQoswRsr+xsHJiAzVRatMi3FpkRnakpq7nGoaA6vs325BltaovN2lt4H", + "qZzeXHyFrikcdMiT5ZjMDm6y3aKoHbtQSmOOsh3SxB1uXK97qinjwcMulNyg15Hx", + "kHBUJErmZQS98pvVvQOJ0gaHJk0Z1LNicu93YsAMHvejLixe0EosxfJAPsrKdk8g", + "ty3gGHgJquqQRlLYHcq9OCleeYjjuY1SecG20JewXjXKOB1OMgg9LPJMpzzIKJ0r", + "tFOKL0ulNOceg8Ajp6DLAhUaQZA5jBKUTCBAKlVtXrQ+xOun7rhbZlUGYjuDAfYn", + "onSOvrlM701gY9ElOKOIp3rIVu3cHT6ieWlmoLfuAazb5wMO9BCs30ClCZZJsEZb", + "k6H/NY1WVljTOC83xuBX48Va+KoStG/yywbz3X9LuDsE6kRcjzr1lPnqOwzKBMaA", + "iVrLKPZ/W1ec4OvZp+8nqs7zZPjj3dP1D3vXUk/eNbrMrGJ9X0PlG767xy4moH5B", + "o/2di73Jg5SIMCIpn9l5PgxPN02OQNbOibKGnTFzy2pUdjcdYJXa0Gj/IXcp9gr0", + "kh2gKPJqYaA09UJdZhjuthraqP8QFBvWWslwra79Nzeku9d9inqQzM/KNbD01YXe", + "o9hhDCUi0zDfAlEXEOUrHZvcnysVbeyhKxv3VCZsrqxPRJ7ZZdmGNVjfQ86a5lpE", + "qR2V2ByjbpqAF4iRZfzYoS3NmJzpdSQOo/VMq1Z9xk/u/hZo7dk2iqp4D4HqDIw/", + "g7vTHnmawUaGCFho6Op1h8fHlpxwFb/kX9jjo4R61TOABfnN9YOWsuqDPEr5i9nK", + "kZXB/ONr7Uk+J82O+K+PIrthZY+ZiH+occlcIcqiV5R56uX6nJJi0jWiN9omvGOq", + "qpZ5wB7PHxRSxUaI4ByyW/FXveawmx7UYLjBddZeukOcetS3wdckFfViLz+8Bo3I", + "jw9IEUUBeHpiLftL8d5mYoDj5ZIQHFnyB7HNdRS73ooT6V8rPwmvKRtouRQMHZE3", + "uebJ8lYukL0wCGaaQhUVOLcPrwKMxbvAn9arP+vGJt+RH8xldEoq15Psrz+RofcB", + "t2y4y0Rus8tPaCpc2IT2yTCGqL9ibFtcVXoGSZ3pwTMVYY1IoMVpNRKj3BQ6eZwH", + "py9FnIf6dqVbbb4eDomkQecy4VHnW8XOL0RZymC4Dm27rF0F1ZlnfA8pSPNFcF3+", + "sSiasv0wcLpJsM68nN//HoJBQUrwIupYt6Wap/2wZv0GCymXlrvIEd7BvugVB9eI", + "tO9ltMcfogzQ7YY/Q/bGUtTDXyZ3vCCD9amAgoTovYmIcD+q8PtMrI7L2hlUHsxl", + "p7huTxNm2kT9WaPuaAGKmcI7o1iHiUY72IsBd6m5QDC1jLh5pQbmRCGvlm8mHqqG", + "rwG8COYck4f+ke4pv7og9K9Wocp/cA6Zx8VNMeW/miwyBs7nWOU4lZIRRrsty7yM", + "pMlEmKpoitESak59vT7RK6RMJ4tFXaseAglcuJJMsGrFEGpraVkkDAVe3BfEDLHv" + ], + "message": "ZOUaZJZMirvzYYwSTf3ZGcHH0QjxpkkkDHYqWWwZzZQ=", + "signature": "hvW2G4MSoCl6NfJAykQgoZNchj12ptXkrOYBeKlInOr0LkYMix3wkswqcZtZrOYkCH49XENcdVTzTFI22mzr6obbF/4nnoXIXPcferxUhLpBD25V354oUbNk3zFZnpoH", + "aggregate_pubkey": "gJo644kMo1WhhRi+FtFBB/4Gmw9hGjPq9ts2JKz06MmXrYqVBM2xphZ7oIUvQ4UU" +} diff --git a/packages/crypto/testdata/extract_sig_gen.sh b/packages/crypto/testdata/extract_sig_gen.sh new file mode 100755 index 0000000000..a6314c62e6 --- /dev/null +++ b/packages/crypto/testdata/extract_sig_gen.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +function usage() { + echo "Usage: $0 [-c|--curves] [-h|--hashes] .txt [CURVE] [HASH]" + echo "Eg.: $0 186-4ecdsatestvectors/SigGen.txt P-256 SHA-224" + exit 1 +} + +CURVES=0 +HASHES=0 +while [[ $# -gt 0 ]]; do + KEY="$1" + case $KEY in + -c | --curves) + CURVES=1 + shift + ;; + -h | --hashes) + HASHES=1 + shift + ;; + *) + break + ;; + esac +done + +SIGGEN="$1" +[ -z "$SIGGEN" ] && usage +[ $CURVES -eq 1 ] && grep '^\[' "$SIGGEN" | cut -f2 -d[ | cut -f1 -d, | sort -u +[ $HASHES -eq 1 ] && grep '^\[' "$SIGGEN" | cut -f1 -d] | cut -f2 -d, | sort -u +[ $CURVES -eq 1 ] || [ $HASHES -eq 1 ] && exit 0 + +CURVE="$2" +[ -z "$CURVE" ] && CURVE="P-256" +HASH="$3" +[ -z "$HASH" ] && HASH="SHA-256" + +cat $SIGGEN | + sed 's/\r//' | + sed -n -E "/^\[$CURVE,$HASH\]/,/^\[/{s/\[$CURVE,$HASH\]/\[/;s/^Msg = *([^ ]*)/ {\n \"message\": \"\1\",/;/^Qx =/{N;s/^Qx = *([^ ]*)\nQy = *([^ ]*)/ \"pubkey\": \"04\1\2\",/};/^R =/{N;s/^R = *([^ ]*)\nS = *([^ ]*)/ \"signature\": \"\1\2\"\n\ },/};s/^\[.*\]/\]/;p}" | + grep -E '[[{}"]|]' | + tac | + sed '2s/},/}/' | + tac diff --git a/packages/crypto/testdata/rootberg/README.md b/packages/crypto/testdata/rootberg/README.md new file mode 100644 index 0000000000..0f68726c7d --- /dev/null +++ b/packages/crypto/testdata/rootberg/README.md @@ -0,0 +1,21 @@ +# Rootberg test data + +This folder contains test vectors from +[Project Rootberg](https://github.com/bleichenbacher-daniel/Rooterberg) to +increase the test coverage of public key recovery implementations. + +This test data is used by integration tests in `test/rootberg_*.rs`. + +## Update + +To ensure integrity of the files and update them to the latest version, run this +from the repo root: + +```sh +(cd packages/crypto/testdata/rootberg \ + && curl -sSL https://github.com/bleichenbacher-daniel/Rooterberg/raw/main/ecdsa/ecdsa_secp256k1_keccak256_raw.json > ecdsa_secp256k1_keccak256_raw.json \ + && curl -sSL https://github.com/bleichenbacher-daniel/Rooterberg/raw/main/ecdsa/ecdsa_secp256k1_sha_256_raw.json > ecdsa_secp256k1_sha_256_raw.json \ + && curl -sSL https://github.com/bleichenbacher-daniel/Rooterberg/raw/main/ecdsa/ecdsa_secp256r1_keccak256_raw.json > ecdsa_secp256r1_keccak256_raw.json \ + && curl -sSL https://github.com/bleichenbacher-daniel/Rooterberg/raw/main/ecdsa/ecdsa_secp256r1_sha_256_raw.json > ecdsa_secp256r1_sha_256_raw.json \ +) +``` diff --git a/packages/crypto/testdata/rootberg/ecdsa_secp256k1_keccak256_raw.json b/packages/crypto/testdata/rootberg/ecdsa_secp256k1_keccak256_raw.json new file mode 100644 index 0000000000..32e34b984b --- /dev/null +++ b/packages/crypto/testdata/rootberg/ecdsa_secp256k1_keccak256_raw.json @@ -0,0 +1,3705 @@ +{ + "testType": "EcdsaVerify", + "algorithm": { + "type": "Ecdsa", + "curve": "secp256k1", + "sha": "KECCAK256", + "encoding": "RAW", + "normalize": false, + "signature_generation": "Generic" + }, + "version": "0.34", + "description": [ + "The underlying elliptic curve is secp256k1", + "The message digest for hashing the input is KECCAK256", + "Note KECCAK256 is not SHA-3, since it does not include the domain bits added by NIST.", + "Signatures are dictionaries containing r, s and id, where id is the recovery id used by a number of protocols that verify signatures by recovering the public key. Public keys are given as a pair of coordinates", + "The test vectors were generated for signature verification through public key recovery." + ], + "references": [], + "numTests": 263, + "tests": [ + { + "tcId": 1, + "publicKeyUncompressed": "04b50c4fb1d56b3807bafb89c3a296a81d3f71ee2237d4889de42ef71d7047aaa9adf899afc706e9bfd9a223880cbe46c9be41527a0a97e0077acfa46bd1c26323", + "publicKeyCompressed": "03b50c4fb1d56b3807bafb89c3a296a81d3f71ee2237d4889de42ef71d7047aaa9", + "msg": "", + "sig": { + "r": "00ba901caf8ed8e4d6a9295b0587c4b3830498be6f1c77b5d04c58187465406831", + "s": "008c6b8926db78f685230fdd63bd86236f008473295e815bcea485c6251956733f", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 2, + "publicKeyUncompressed": "04b50c4fb1d56b3807bafb89c3a296a81d3f71ee2237d4889de42ef71d7047aaa9adf899afc706e9bfd9a223880cbe46c9be41527a0a97e0077acfa46bd1c26323", + "publicKeyCompressed": "03b50c4fb1d56b3807bafb89c3a296a81d3f71ee2237d4889de42ef71d7047aaa9", + "msg": "000102030405060708090a0b0c0d0e0f", + "sig": { + "r": "00806884177f215d3aeeb24a0ecaaa828117c6ef0a86d3eb970e458c796564a26f", + "s": "5ed8a655709fb2985f12fe88eedca699ee81a60f806b3a2e077314c927be630f", + "id": 0 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 3, + "publicKeyUncompressed": "04b50c4fb1d56b3807bafb89c3a296a81d3f71ee2237d4889de42ef71d7047aaa9adf899afc706e9bfd9a223880cbe46c9be41527a0a97e0077acfa46bd1c26323", + "publicKeyCompressed": "03b50c4fb1d56b3807bafb89c3a296a81d3f71ee2237d4889de42ef71d7047aaa9", + "msg": "616263", + "sig": { + "r": "4fb20f8a125a35c846fd90f23fac3236e05e2924c6ede08f8b6140955dbb1923", + "s": "009b1b6ece17b39a530f04537866fd2e37c549fcd58911be1b33f23ecdeca9eba0", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 4, + "publicKeyUncompressed": "04b50c4fb1d56b3807bafb89c3a296a81d3f71ee2237d4889de42ef71d7047aaa9adf899afc706e9bfd9a223880cbe46c9be41527a0a97e0077acfa46bd1c26323", + "publicKeyCompressed": "03b50c4fb1d56b3807bafb89c3a296a81d3f71ee2237d4889de42ef71d7047aaa9", + "msg": "54657374", + "sig": { + "r": "00c762e324914f265790b02b40bb723713e22300841047ac273ba984ea36994059", + "s": "00fc1cb322f29b6a4fa2eb5d0e7cb7591965f0420e330e97761c1c84c27a1e6aac", + "id": 0 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 5, + "publicKeyUncompressed": "048c421248365bd989965833232d08fc1dcf66d2159b046e1452059a68862d37c11aa4a230fa89d2700207681a3a1d68548322d41e6bb90f14fc5da9e97716ac87", + "publicKeyCompressed": "038c421248365bd989965833232d08fc1dcf66d2159b046e1452059a68862d37c1", + "msg": "54657374", + "sig": { + "r": "01", + "s": "01", + "id": 0 + }, + "comment": "r=1, s=1", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 6, + "publicKeyUncompressed": "04ca1338725271e913775f5898a320e0881d3638d7e9e25716e9909017c5698761419d874fba56e48512e44ff98a44b68b25b9e9aa81468bbc249fdddf5a5d2db9", + "publicKeyCompressed": "03ca1338725271e913775f5898a320e0881d3638d7e9e25716e9909017c5698761", + "msg": "54657374", + "sig": { + "r": "02", + "s": "02", + "id": 0 + }, + "comment": "r=2, s=2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 7, + "publicKeyUncompressed": "0478510452a27b6286e57a4502d27d6715372e194295c7fd39bd6ea3f79264876be28ed416c22e56f1142bfd4cd0703cc3eaadd561969e3df1812468d2f8d2ca18", + "publicKeyCompressed": "0278510452a27b6286e57a4502d27d6715372e194295c7fd39bd6ea3f79264876b", + "msg": "54657374", + "sig": { + "r": "03", + "s": "03", + "id": 0 + }, + "comment": "r=3, s=3", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 8, + "publicKeyUncompressed": "04f64d29dfd8f874579262d8817ea0d588ce88bd7dd7a70d6ed653cade6f010c73ab332d24a78c93ed36a8f9a52c434379984eb87db21c843c3893fecdabce8675", + "publicKeyCompressed": "03f64d29dfd8f874579262d8817ea0d588ce88bd7dd7a70d6ed653cade6f010c73", + "msg": "54657374", + "sig": { + "r": "04", + "s": "04", + "id": 0 + }, + "comment": "r=4, s=4", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 9, + "publicKeyUncompressed": "048b6a871f74b41c38b345bc1434c1096e9de1947471056b1e816a3bb7bd8cf2d1f03b3fe6cfa6462012e93d29ff4b94ca95f4acd82a356ccf07da15fb3f779422", + "publicKeyCompressed": "028b6a871f74b41c38b345bc1434c1096e9de1947471056b1e816a3bb7bd8cf2d1", + "msg": "54657374", + "sig": { + "r": "06", + "s": "06", + "id": 0 + }, + "comment": "r=6, s=6", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 10, + "publicKeyUncompressed": "0450cbc5fb1ed7753c84cbd49ddeb684ec3800e055d622371c79e89887d8d5348215108d29029ba167e48082e0181d86157340c7b7901096abd251f656cd3cd68d", + "publicKeyCompressed": "0350cbc5fb1ed7753c84cbd49ddeb684ec3800e055d622371c79e89887d8d53482", + "msg": "54657374", + "sig": { + "r": "08", + "s": "08", + "id": 0 + }, + "comment": "r=8, s=8", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 11, + "publicKeyUncompressed": "04158f0c3fe591f88831082d4c6d4c7e8e78688ea3705f2d87da86c4ea3ac9dc8fecfc6b87e624cd7378bb7e3db7d73a358dbdbdb8563d50f11df25598cd946a9f", + "publicKeyCompressed": "03158f0c3fe591f88831082d4c6d4c7e8e78688ea3705f2d87da86c4ea3ac9dc8f", + "msg": "54657374", + "sig": { + "r": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", + "s": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", + "id": 0 + }, + "comment": "r=(n-1)/2), s=(n-1)/2)", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 12, + "publicKeyUncompressed": "0414b7ba1466d05d6245ae4593d5029f176035f68f4e3e064c2c055b6344a17a9c75e8149fe716c3cb7510c4d2dbe7645258996ca2dcb3bc3d89f35578152557f0", + "publicKeyCompressed": "0214b7ba1466d05d6245ae4593d5029f176035f68f4e3e064c2c055b6344a17a9c", + "msg": "54657374", + "sig": { + "r": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1", + "s": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1", + "id": 0 + }, + "comment": "r=(n+1)/2, s=(n+1)/2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 13, + "publicKeyUncompressed": "046ec4c23be2daa943b64056acfb1043979af6731fd39e9d4113f38ebc1bb49583cf1d3cc719252a88e2ce14c7ef395cec21bb0bd9c9d306d39a0a75cb19732b53", + "publicKeyCompressed": "036ec4c23be2daa943b64056acfb1043979af6731fd39e9d4113f38ebc1bb49583", + "msg": "54657374", + "sig": { + "r": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a2", + "s": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a2", + "id": 0 + }, + "comment": "r=(n+3)/2, s=(n+3)/2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 14, + "publicKeyUncompressed": "04a9d4125ccd74f4c63fe2968c03aa139f543a196a671d8d0f13a0e9767f660583fd33fb0b0be30e725c4667c7135355f5067362b1b8e78a7b5b6a3d4cf34def5b", + "publicKeyCompressed": "03a9d4125ccd74f4c63fe2968c03aa139f543a196a671d8d0f13a0e9767f660583", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f", + "s": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f", + "id": 0 + }, + "comment": "r=n-2, s=n-2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 15, + "publicKeyUncompressed": "043f8c0d6ce23e906dfca1957edaa026a5b7ba0b1114f6115daf5072dee3ea0792cbf45d36e32501c43659c218090c3bf3782eae3567d2d9509570b8072a755322", + "publicKeyCompressed": "023f8c0d6ce23e906dfca1957edaa026a5b7ba0b1114f6115daf5072dee3ea0792", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "s": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "id": 0 + }, + "comment": "r=n-3, s=n-3", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 16, + "publicKeyUncompressed": "04df9fecaf83ce88b2822826d6490616b74ad0bb17659378f00a715be5e23a4da6140c6f280e0faeaa6e08cc88becf096639730b6b30e0f17eb3a57bccfd127b61", + "publicKeyCompressed": "03df9fecaf83ce88b2822826d6490616b74ad0bb17659378f00a715be5e23a4da6", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000000", + "s": "008000000000000000000000000000000000000000000000000000000000000000", + "id": 0 + }, + "comment": "r=2**255, s=2**255", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 17, + "publicKeyUncompressed": "042404620b2a08c7bac51d3940d0a6d8bf250c50ff7cb9f2670c2d007011726e2cb713937a1d8249a87d1dc3542021c3f711ae1ca7b00ece5f67646ceacc0cdffb", + "publicKeyCompressed": "032404620b2a08c7bac51d3940d0a6d8bf250c50ff7cb9f2670c2d007011726e2c", + "msg": "54657374", + "sig": { + "r": "03", + "s": "66666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "id": 0 + }, + "comment": "r and s^-1 very small", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 18, + "publicKeyUncompressed": "0410d8cbcb862a2c2fcc6e7f4212bfbdfeb49e9982197ccdb764c0d5866d23b0084954b58ea4fbb823efbfee39c529319fa0212c682e9b45dd2f60601aa1d233eb", + "publicKeyCompressed": "0310d8cbcb862a2c2fcc6e7f4212bfbdfeb49e9982197ccdb764c0d5866d23b008", + "msg": "54657374", + "sig": { + "r": "7b", + "s": "00de9bd37a6f4de9bd37a6f4de9bd37a6e33075be9fc98324a377f471645bfdfb3", + "id": 0 + }, + "comment": "r and s^-1 small", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 19, + "publicKeyUncompressed": "0407b3f058ee9cbe9c03e0acbbae315411ac888e9b38385b02f5fb524be224c2e0cedb49f676c7204bd18724150b5ce56d4a184091d188f49c86945a0724bedf69", + "publicKeyCompressed": "0307b3f058ee9cbe9c03e0acbbae315411ac888e9b38385b02f5fb524be224c2e0", + "msg": "54657374", + "sig": { + "r": "24f22125", + "s": "33720cedbf35ef7a26dabb594ecf3a81d53b83daa08c4f8b33095cab67debdd4", + "id": 0 + }, + "comment": "r and s^-1 are 32 bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 20, + "publicKeyUncompressed": "04ea1c82bd1eb2b11fbc284fbe825746a3486afec75ec0d9527004f4ae58aa78ad3e65539f37b4d7b09dd343fa792f8cdfc7cfb0a83695bd4409f1e7ac44ee4ba2", + "publicKeyCompressed": "02ea1c82bd1eb2b11fbc284fbe825746a3486afec75ec0d9527004f4ae58aa78ad", + "msg": "54657374", + "sig": { + "r": "00fffffffd", + "s": "00e3a8af7ae3a8af7ae3a8af7ae3a8af79c25b611dc782c69e17f5671d39e17805", + "id": 0 + }, + "comment": "r and s^-1 are edge case 32-bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 21, + "publicKeyUncompressed": "0468cc9b818c89679508ceb92ab6a4a9ad29431aa5794b2ebbe5607a0ef40303496937ec727781abfc7cdd399f8bb0d4adfd2e75152dea9038e4c51da431c5d386", + "publicKeyCompressed": "0268cc9b818c89679508ceb92ab6a4a9ad29431aa5794b2ebbe5607a0ef4030349", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffd", + "s": "45c87dc69de031b445c87dc69de031b3ed1ad8185bd38af4bd79e65f417cad4b", + "id": 0 + }, + "comment": "r and s^-1 are edge case 64-bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 22, + "publicKeyUncompressed": "0448db3f7119bf5c3730155c6bc4f68cef33c905e7fc27e3ecd8d76e2e90365e72194f1505784bcdb83ad56ff63a413c83dd7db5f7794a3bbd133819b65ada79b3", + "publicKeyCompressed": "0348db3f7119bf5c3730155c6bc4f68cef33c905e7fc27e3ecd8d76e2e90365e72", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000000", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 23, + "publicKeyUncompressed": "04b04b1cf0b0eb796620d4af685db8b51602212aa50df15a5beb63b9ea338c97b6b4a0e6162bdb1abc19edbd1a7e5068f2345f76eff2075287e9c21a9e3a2896bb", + "publicKeyCompressed": "03b04b1cf0b0eb796620d4af685db8b51602212aa50df15a5beb63b9ea338c97b6", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000000", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 24, + "publicKeyUncompressed": "0446ccf952acf1cbbda669a4978c2ff1a59b9a52904366dcaceb94d5fe8cc2b79fe2bdb86e11133349d0d5e1971e3dd5104cf821b04f7b7513cdd2265e5e75402a", + "publicKeyCompressed": "0246ccf952acf1cbbda669a4978c2ff1a59b9a52904366dcaceb94d5fe8cc2b79f", + "msg": "54657374", + "sig": { + "r": "0100000000000000000000000000000000000000000000000000000000000001", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 25, + "publicKeyUncompressed": "045904309b4018f4fa9e19d433bd41fb01c35b3362689915f129153a24cf198a64dd0b14edb7b065a5f5557bc7350329adb837ffb81d331420110680f724875c4a", + "publicKeyCompressed": "025904309b4018f4fa9e19d433bd41fb01c35b3362689915f129153a24cf198a64", + "msg": "54657374", + "sig": { + "r": "0100000000000000000000000000000000000000000000000000000000000001", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 26, + "publicKeyUncompressed": "04fd4de5b443ce19afe9046c2abd668a7a4cf880d051025fdb5118149bcbd15ca9cb60f4e0489342efe07519be25cbe2eb6eee4450f40d9c9538307b22ca64d63c", + "publicKeyCompressed": "02fd4de5b443ce19afe9046c2abd668a7a4cf880d051025fdb5118149bcbd15ca9", + "msg": "54657374", + "sig": { + "r": "01", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 27, + "publicKeyUncompressed": "04f09d29a5ba5ce675158875da3814c9fdff970982155301b6d0039410c10319f7a63e6941f26e9680ce5bf24c8387fd314a509dfdc396787ffa9e3e83283b9ec8", + "publicKeyCompressed": "02f09d29a5ba5ce675158875da3814c9fdff970982155301b6d0039410c10319f7", + "msg": "54657374", + "sig": { + "r": "01", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 28, + "publicKeyUncompressed": "0445cbcff8e30039bac5af578516640cb422a107816e09a66a94b56f400a5b6a5330525ec9b302dd99b1d053dd83477e479e271be1555481471d5c264c911f3ce0", + "publicKeyCompressed": "0245cbcff8e30039bac5af578516640cb422a107816e09a66a94b56f400a5b6a53", + "msg": "54657374", + "sig": { + "r": "0081", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 29, + "publicKeyUncompressed": "046dc9581d5ce3a871eb721d4ff8f8852502d4b6ff4042564694460de1938c51a5634f68738e118c707ef830d7736efcec8fd33eaa12333e80e2a12d0574a6066e", + "publicKeyCompressed": "026dc9581d5ce3a871eb721d4ff8f8852502d4b6ff4042564694460de1938c51a5", + "msg": "54657374", + "sig": { + "r": "0081", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 30, + "publicKeyUncompressed": "0446dfa06289b739d323b07af6562dadcb36f56ed773684b8fee5d2e3e6b3666ca8706479f53894bd452c139e73b6b5368823a0b2ccceade76c0221ef5f480defc", + "publicKeyCompressed": "0246dfa06289b739d323b07af6562dadcb36f56ed773684b8fee5d2e3e6b3666ca", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413d", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 2 + }, + "comment": "R: large x-coordinate (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 31, + "publicKeyUncompressed": "04cb39f529d8c60a564e79666bfde3a63631bd361d5ad487dcbf878b72b01f511f47958ce8177de1c8e62a12728a4cc5400199bf8d8e964eada549c2cab3ec205f", + "publicKeyCompressed": "03cb39f529d8c60a564e79666bfde3a63631bd361d5ad487dcbf878b72b01f511f", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413d", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 2 + }, + "comment": "R: large x-coordinate (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 32, + "publicKeyUncompressed": "0489da9dca6dae46ee9857cd65ef25560ab707a87666eabeb2bd503135e84ff2a21f2015cb99b8276ced9fb6f627946e5fc7382cefcdd9856d5791bc6421eb9cb6", + "publicKeyCompressed": "0289da9dca6dae46ee9857cd65ef25560ab707a87666eabeb2bd503135e84ff2a2", + "msg": "54657374", + "sig": { + "r": "014551231950b75fc4402da1722fc9baec", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 2 + }, + "comment": "R: x-coordinate close to p (Could not recover R)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 33, + "publicKeyUncompressed": "045af73d9320ff7a36c8344c30832cb18d36a452e4d9ced9a6f2b55549e4a763a0db97bd1aa8cc335625389c421ef7def9762b14e85e2b15d90725c7580386edfa", + "publicKeyCompressed": "025af73d9320ff7a36c8344c30832cb18d36a452e4d9ced9a6f2b55549e4a763a0", + "msg": "54657374", + "sig": { + "r": "014551231950b75fc4402da1722fc9baec", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 2 + }, + "comment": "R: x-coordinate close to p (Could not recover R)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 34, + "publicKeyUncompressed": "04aed424fb756b24216ec287784ee0579119853338da510d748f60c3e5617f5f7095d5f872eddbf10981caf6e6f781c448ae527ecb31f15606b89761cfdae475c8", + "publicKeyCompressed": "02aed424fb756b24216ec287784ee0579119853338da510d748f60c3e5617f5f70", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 2 + }, + "comment": "R: x-coordinate < 2**255 (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 35, + "publicKeyUncompressed": "04ec4246c98458876eefccde96e71a020050a187493794c27c6c32a0261005b17d6e3232f0e952bfcf7e408e5bd2004b68f0de422d60e5b730c920bd89e48c08b3", + "publicKeyCompressed": "03ec4246c98458876eefccde96e71a020050a187493794c27c6c32a0261005b17d", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 2 + }, + "comment": "R: x-coordinate < 2**255 (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 36, + "publicKeyUncompressed": "047b1ac3e145894f35d78a94c6bebc324722e5fbc74d762ec1421b72e13e444a843061c7a0314a8a0710ce3331d636906740abc09914fb6e9be1e1112f9a4751c7", + "publicKeyCompressed": "037b1ac3e145894f35d78a94c6bebc324722e5fbc74d762ec1421b72e13e444a84", + "msg": "54657374", + "sig": { + "r": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: x-coordinate < 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 37, + "publicKeyUncompressed": "0412a6efcab221914e432faf7634f2636a2485afe2bb812d1f50140b0f030beb2befaa5b695a22359b447ec74319ce0d9b3edb18122ee3d7d77c3aec9e44155c9f", + "publicKeyCompressed": "0312a6efcab221914e432faf7634f2636a2485afe2bb812d1f50140b0f030beb2b", + "msg": "54657374", + "sig": { + "r": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: x-coordinate < 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 38, + "publicKeyUncompressed": "04a7e988b1ce317a4d7e64e44813aeb86abd6547a1e3e4cc903bb8cb6c7ac404f390b05d642c3c5be468c37780f2d0564c474cd8d21e53678f8feb72ae44573c86", + "publicKeyCompressed": "02a7e988b1ce317a4d7e64e44813aeb86abd6547a1e3e4cc903bb8cb6c7ac404f3", + "msg": "5465737420", + "sig": { + "r": "3721150eb4be17ce122ba4892e476e14e26b8dea65772d2845933463bfab415a", + "s": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "id": 0 + }, + "comment": "u1 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 39, + "publicKeyUncompressed": "044d9afc881f3400adccf3f3675e17170f80588b4877700a5329b9dcbbeb387e083b58a672b55b2ba9cbbd08f57d36b70388a85af400ddabc45c8645681bf9135c", + "publicKeyCompressed": "024d9afc881f3400adccf3f3675e17170f80588b4877700a5329b9dcbbeb387e08", + "msg": "5465737422", + "sig": { + "r": "19d4fc1fa1a6146fd02c4ffe01e1ee2ceb1af2bb757cc09a99212b3e09f0fb21", + "s": "19d4fc1fa1a6146fd02c4ffe01e1ee2ceb1af2bb757cc09a99212b3e09f0fb21", + "id": 0 + }, + "comment": "u2 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 40, + "publicKeyUncompressed": "043cb36528addee00b99a83e97008e7e5af351d08a54f6c023c07eaa378a72220fdd45b885b5f991d37c4b32f02dd73b993d63c3fbc94ef46fd7cad4bf691663a1", + "publicKeyCompressed": "033cb36528addee00b99a83e97008e7e5af351d08a54f6c023c07eaa378a72220f", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "0083892f867f387d1e5bf376afc1601c7c5be0c1c15b987dd84a0090555ecc021a", + "id": 0 + }, + "comment": "u1 = u2 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 41, + "publicKeyUncompressed": "044900458d6c0c104a6167cd39e0f6f26669d76edec9c3fee7b4c6febb6960e06095d510a185ae029ef6dd0dc3f527eae72358061ded1457cb639bb6046b250538", + "publicKeyCompressed": "024900458d6c0c104a6167cd39e0f6f26669d76edec9c3fee7b4c6febb6960e060", + "msg": "5465737421", + "sig": { + "r": "00d34a6349e8ea829eaeba7b82890c13970a99d84f508bb3da4e66583b4fb775f4", + "s": "00a41afcd6c92ebd115fa928f3ff6943cdd817078eddd8f505362d3bc43a108c6b", + "id": 0 + }, + "comment": "u1 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 42, + "publicKeyUncompressed": "0489a36e43efb3550ce9a16f1af12367584d809336cbf7f6b22e543c8809bc850565af338b119c528653537313b4010bf8ea41568c37216c8f6865335498960846", + "publicKeyCompressed": "0289a36e43efb3550ce9a16f1af12367584d809336cbf7f6b22e543c8809bc8505", + "msg": "5465737422", + "sig": { + "r": "7e16b3bb54434731b68924debd92426a6a029682c0b6daea341ea9fa16c16369", + "s": "00bf0b59ddaa21a398db44926f5ec921349258b9b4b7ffbd92f9f88443737bd255", + "id": 0 + }, + "comment": "u2 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 43, + "publicKeyUncompressed": "0470e61e2633775725821783c45cbcd81ebfe5162ad5f743e7d4cb7cd4f251e3dc384ddea886c332f028c30f7ffd7999298b47bcfb2a1928fb8a728b213cf418d4", + "publicKeyCompressed": "0270e61e2633775725821783c45cbcd81ebfe5162ad5f743e7d4cb7cd4f251e3dc", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "21ac6c3bba55c1561fa937e590c3a60f26651d0018bf2a8919f43d0147f63f88", + "id": 0 + }, + "comment": "u1 = u2 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 44, + "publicKeyUncompressed": "04575a263220aa2d17d70be8abc7685153c03b6dc2bdf8af1cad6a61087ccfd68e7ab3cdd1401d2ba023ebf86842251c9eb302ea88483f4ba7eec1ad6ec67d0400", + "publicKeyCompressed": "02575a263220aa2d17d70be8abc7685153c03b6dc2bdf8af1cad6a61087ccfd68e", + "msg": "5465737420", + "sig": { + "r": "00e15b1aa7e219f9d4cc123533fa3a313891e9e0565b4d6f6417cd9671ba4bc874", + "s": "00a4e480fc6d51da48742be352923272d3422ac60b809a687ec76b16d7e81acf06", + "id": 0 + }, + "comment": "u1 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 45, + "publicKeyUncompressed": "04edfe79857d94d7816aa914500115b1a37d3695897346f1027dc7ee5d96322045418ad7b19eb1aa2cb0d27700c40aff31a9bce8996c511333f7f6f122677a8640", + "publicKeyCompressed": "02edfe79857d94d7816aa914500115b1a37d3695897346f1027dc7ee5d96322045", + "msg": "5465737420", + "sig": { + "r": "784f4110658302318765d938dccbc639170bef6d56129924f3a4a09f5697d40a", + "s": "00d2c515b021d6561082774868499942122ecde313918bf334266dc9e85256c784", + "id": 0 + }, + "comment": "u2 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 46, + "publicKeyUncompressed": "04686e61068e1b1d525b26c5bc1ca26ffe5d98e49d7f02f71173cac8bcd35ff2e94e8252f19278792eed6bf0db1bebc90784026c70e84516d35bf94755a53aa988", + "publicKeyCompressed": "02686e61068e1b1d525b26c5bc1ca26ffe5d98e49d7f02f71173cac8bcd35ff2e9", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "00d2c515b021d6561082774868499942122ecde313918bf334266dc9e85256c784", + "id": 0 + }, + "comment": "u1 = u2 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 47, + "publicKeyUncompressed": "0461884da00720fc2934b6cd410487991f80c2db1372f5a3b9d4dede66575dbdb130c8482c47c7475c212f7de20bd5c8fdd287b1420ebb29a4dd143ec732681871", + "publicKeyCompressed": "0361884da00720fc2934b6cd410487991f80c2db1372f5a3b9d4dede66575dbdb1", + "msg": "5465737420", + "sig": { + "r": "00ac2a543f1edd6e0f1b6d62ef7fcd791cbfab20119fa306401805aeec38c38f81", + "s": "11527d0ab80a7126a37c56084968a783aedd67aadcc206fb29637891e81c1570", + "id": 0 + }, + "comment": "u1 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 48, + "publicKeyUncompressed": "04b4fd1630f23e8f0eed2eb7735b95e138c51f2983a18de8c9bc10e46213723ed36724448f954d326693d831d850932ab5d65d32309dbdffb5db895d03be387946", + "publicKeyCompressed": "02b4fd1630f23e8f0eed2eb7735b95e138c51f2983a18de8c9bc10e46213723ed3", + "msg": "5465737420", + "sig": { + "r": "430d650352d0e91568019492087942475e1000f250355eca6a57c320cca0a486", + "s": "00bcf29afcad2f16ea97fe6b6df786bdb75c9edbf45f134171557a9b6c03959cbb", + "id": 0 + }, + "comment": "u2 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 49, + "publicKeyUncompressed": "04357553b4bf596b5508d5117f67b8af3395f83d82c6b3bbaec7612600ea5d0edb200d6ee5c68178737a6e8f5eab59669599f5d0f325be6405c0499a6777439df5", + "publicKeyCompressed": "03357553b4bf596b5508d5117f67b8af3395f83d82c6b3bbaec7612600ea5d0edb", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "00bcf29afcad2f16ea97fe6b6df786bdb75c9edbf45f134171557a9b6c03959cbb", + "id": 0 + }, + "comment": "u1 = u2 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 50, + "publicKeyUncompressed": "0455c41fc92246ce209d9836e73d809a5d79df58beb108c191c3a41ebe8ae41005db2c0f8f94066dde74d744275a00862117cbbdb4bad886bf718271051fe8731e", + "publicKeyCompressed": "0255c41fc92246ce209d9836e73d809a5d79df58beb108c191c3a41ebe8ae41005", + "msg": "5465737420", + "sig": { + "r": "00edb7bd6fa18db17b29b2edff8d05b713c2b0d9fed9038c94df4cb9819271c65a", + "s": "08a93e855c05389351be2b0424b453c1d76eb3d56e61037d94b1bc48f40e0ab8", + "id": 0 + }, + "comment": "u1 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 51, + "publicKeyUncompressed": "04e80c75c93b47dce6f6fab6148bff21dc70094f8a55ea1ae023770af16f5d33ed6defc9cbce4a1bc37261977c34c15a571cc3af735706be3df46360a3e2b7991b", + "publicKeyCompressed": "03e80c75c93b47dce6f6fab6148bff21dc70094f8a55ea1ae023770af16f5d33ed", + "msg": "5465737420", + "sig": { + "r": "08eddc1410543a6c19cad40154e9f1615f35739346d884a00aefc60d8b5b7533", + "s": "7b8911f5f7d5e2c9f31a95ff558b074eadbcb4a9b4380dcdda714c3fa26d6607", + "id": 0 + }, + "comment": "u2 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 52, + "publicKeyUncompressed": "04c22d997cf9c2c8dc57aff50e95e13397ad206223f8c380908258fe93c81000d5bb93b0b827ee95c06ddfd3245b993489be7a0ef5b57b5fdff7f250d1bac59410", + "publicKeyCompressed": "02c22d997cf9c2c8dc57aff50e95e13397ad206223f8c380908258fe93c81000d5", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "7b8911f5f7d5e2c9f31a95ff558b074eadbcb4a9b4380dcdda714c3fa26d6607", + "id": 0 + }, + "comment": "u1 = u2 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 53, + "publicKeyUncompressed": "043c0a66154cc166e3ed45426ef664ae91e3c6a2f7fb1355668b2c14e5cd4289a2e4613718a987c929e5ec5d6a6d9868ca14a087ccbf853dcc6d4ec5c5424acab1", + "publicKeyCompressed": "033c0a66154cc166e3ed45426ef664ae91e3c6a2f7fb1355668b2c14e5cd4289a2", + "msg": "5465737423", + "sig": { + "r": "62d80bca139456a0350587cf1b1ea905142bbfb8135c46708709b3222a008651", + "s": "00d82a74b849e1806dd672ab3675ca3c04774a2b6f4371227a03f0ff53822a83f6", + "id": 0 + }, + "comment": "u1 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 54, + "publicKeyUncompressed": "0432e1aa051f7fdeb4602ee4258a6bc3fdc44153d023195a6a12ec83debc1413a5e17122f21e1ea5b41505fce002733613bbada8fd5aad52b97de5f61a2fe9c74b", + "publicKeyCompressed": "0332e1aa051f7fdeb4602ee4258a6bc3fdc44153d023195a6a12ec83debc1413a5", + "msg": "5465737420", + "sig": { + "r": "29fb78ce2f3be23fb78144f4a9c308dcef6c62ba9c24a8aa88415305a3813063", + "s": "009cac2d109aec09eac2d4e903c769a7b581fb1d0640cedd44527678b1544e70b5", + "id": 0 + }, + "comment": "u2 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 55, + "publicKeyUncompressed": "04de6cc48a363a327ceae3dae1eadb6be599fb52cf0338527405a59d8cabb6765f66ad1493e4342e91547bb4226bac328852fa812f287c4b72b6b32094e620374b", + "publicKeyCompressed": "03de6cc48a363a327ceae3dae1eadb6be599fb52cf0338527405a59d8cabb6765f", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "009cac2d109aec09eac2d4e903c769a7b581fb1d0640cedd44527678b1544e70b5", + "id": 0 + }, + "comment": "u1 = u2 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 56, + "publicKeyUncompressed": "048ffb540788e105e2ee4f1031b6ef130d1d7e1de7e37db48f3229a2aadfa31b676348943bbd394581f8363c65bf5b2da0395bd8de283236aa356f9059738c0a62", + "publicKeyCompressed": "028ffb540788e105e2ee4f1031b6ef130d1d7e1de7e37db48f3229a2aadfa31b67", + "msg": "5465737421", + "sig": { + "r": "0097ad4fe249df1ae0806f391b4d63c84655b1f1767f3d460afc95edf3eb05ff19", + "s": "57f53476e2ba1ac5d9bc5604cd0918134cc61b1e106e64882a38ed9f98e6bbc9", + "id": 0 + }, + "comment": "u1 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 57, + "publicKeyUncompressed": "040974da3b84a99ebf7a99ceb222639c4e2bbebe92ce2c2c68023bda989de111fd85543becb8bfbd60c3b8fdbca8e59974c2c7a2a3eb5010a3fb84e55d21cac966", + "publicKeyCompressed": "020974da3b84a99ebf7a99ceb222639c4e2bbebe92ce2c2c68023bda989de111fd", + "msg": "5465737420", + "sig": { + "r": "4196612438c10c7d59147afc7406ad99cb9484ea2c34521d79a2418ed0cc70e4", + "s": "008c7b862bf4a630b3bafbe7671bfeaa13adb19d2860544fb78df75ed1865e1093", + "id": 0 + }, + "comment": "u2 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 58, + "publicKeyUncompressed": "046dd7bd233ae874f51745abb2a4db7694280a99adecb74b10e400b723f238e67cbdda6f0ef442d784a3f482e06f14cd186b21498a4c42955fcc76f61fab229701", + "publicKeyCompressed": "036dd7bd233ae874f51745abb2a4db7694280a99adecb74b10e400b723f238e67c", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "008c7b862bf4a630b3bafbe7671bfeaa13adb19d2860544fb78df75ed1865e1093", + "id": 0 + }, + "comment": "u1 = u2 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 59, + "publicKeyUncompressed": "04c2f060902a25d9120e27436e6a7935ea66de03989d7f052640b560c87b78f7821ab9a6d073ba26e50d886ff75ed51385fd832a472a06fd22247b46e9d015a07e", + "publicKeyCompressed": "02c2f060902a25d9120e27436e6a7935ea66de03989d7f052640b560c87b78f782", + "msg": "5465737421", + "sig": { + "r": "2f004d6a77703d40772ffc25b55d6d94e09258383969c83763ea670005c5618a", + "s": "636600e7343bc9fb093d62036de1ec9fe3cb0e5b0034a7d782b46e1866636ae2", + "id": 0 + }, + "comment": "u1 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 60, + "publicKeyUncompressed": "04aa8c9e54829ea711c45ed6aa6d8a928557059429cdc92225e4285c6e4d4e1e84b738f9901a7f7ca53ec0bf4e9808a6af53199a45dcbab40437c05fee62174bda", + "publicKeyCompressed": "02aa8c9e54829ea711c45ed6aa6d8a928557059429cdc92225e4285c6e4d4e1e84", + "msg": "5465737420", + "sig": { + "r": "00d46abf940b3f4a678db180127b6f75cc9a877f9bc9933033ff69245acf4b7293", + "s": "73f0c00f6c1b87a810545b6b12f013bd792bfe48fe390b886db255681038cbc7", + "id": 0 + }, + "comment": "u2 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 61, + "publicKeyUncompressed": "04c9723cc843491e0b9500813f0a139a30f2af2b9a1b10fd5a39ba71f7f200a05f331081791c4ab33d103acc3232f49e1ce91b70d03c12732a774acd0583c1bff0", + "publicKeyCompressed": "02c9723cc843491e0b9500813f0a139a30f2af2b9a1b10fd5a39ba71f7f200a05f", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "73f0c00f6c1b87a810545b6b12f013bd792bfe48fe390b886db255681038cbc7", + "id": 0 + }, + "comment": "u1 = u2 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 62, + "publicKeyUncompressed": "04c7282ff0ffa1ecf8e57feb7d200205c2251ce31f00fb876a53352f44a11304457e471c20e170e7743d2a279d7dd2b90caa9e04b5871a907d1e6e646fb391af46", + "publicKeyCompressed": "02c7282ff0ffa1ecf8e57feb7d200205c2251ce31f00fb876a53352f44a1130445", + "msg": "5465737420", + "sig": { + "r": "00efa367fe2ff369aee75cf43909274736969a2f007740d90c4838d8eaa5cf6140", + "s": "00dd5b05ea8feb1db2b90753ef6d2eb0f75cf40d90f5c492456d0b6d68fffe1661", + "id": 0 + }, + "comment": "u1 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 63, + "publicKeyUncompressed": "040d9bae92e0d9534258bf953ca9f17234c2dfdbd47048f482be19114d55e22d7ea03c2a75e0398f58259fdc292a58520c05eb84528aa72fd85d8d204a2dcc3d95", + "publicKeyCompressed": "030d9bae92e0d9534258bf953ca9f17234c2dfdbd47048f482be19114d55e22d7e", + "msg": "5465737422", + "sig": { + "r": "2af49285508d85a8714b8237f9ef46a9f8f137b155430cacd5bcdee8f996fdbe", + "s": "55e9250aa11b0b50e297046ff3de8d53f1e26f62aa861959ab79bdd1f32dfb7c", + "id": 0 + }, + "comment": "u2 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 64, + "publicKeyUncompressed": "0462e65d8ccbf124296fd05d9faaa7b128dc472b46659784791c04270cf6c36c076d5636286eb0fb4123f2010ae5ef39a33fa03abcb4d33612308e41416a90f54f", + "publicKeyCompressed": "0362e65d8ccbf124296fd05d9faaa7b128dc472b46659784791c04270cf6c36c07", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "00ec24397110be841ec1de0084e37a7b29cafdb9324f6d1426b774eedca63ab026", + "id": 0 + }, + "comment": "u1 = u2 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 65, + "publicKeyUncompressed": "0484493ac0cdd207e37aead4496629a786868a033d743dee81e7bff862d136afb054d5152e34100307cccd678bf67349432391b935fcff34c587145db80691545d", + "publicKeyCompressed": "0384493ac0cdd207e37aead4496629a786868a033d743dee81e7bff862d136afb0", + "msg": "5465737420", + "sig": { + "r": "5bf80cb265ac347a75f93fa3c0a2cec27fd3bc43abe7d7775a96d81b7f81108d", + "s": "22a4fa157014e24d46f8ac1092d14f075dbacf55b9840df652c6f123d0382ae0", + "id": 0 + }, + "comment": "u1 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 66, + "publicKeyUncompressed": "04a341460bdc9df2492fbc1fc332fdbf8c23fd7eabe9cf38f4f567e6c126146acc9540c429e1f8add557e76ec5b494a4490353e11890801bef84e4db43e973d4e5", + "publicKeyCompressed": "03a341460bdc9df2492fbc1fc332fdbf8c23fd7eabe9cf38f4f567e6c126146acc", + "msg": "5465737421", + "sig": { + "r": "009e09718494337de79eb07b514ac0247bf401f91a1b4c7e4ebb6addbaccb8cc97", + "s": "00c3ed1cf6d7990430c29f095d6a7fb7058d59c79927f843da08cf01a406fae954", + "id": 0 + }, + "comment": "u2 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 67, + "publicKeyUncompressed": "04a3cd2b2a0d3f35472a79a75167c55cff520cf925098cb4791fec2cbb19f91b0f70ec68fec48f10334159c0a459b179a6d2895693ce18b3afeb3aa4d757cba332", + "publicKeyCompressed": "02a3cd2b2a0d3f35472a79a75167c55cff520cf925098cb4791fec2cbb19f91b0f", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "00dfd492493eb0a46b7a9e71f2a35e3aa9e6c2063c29b2c81e74750e16f3db48a3", + "id": 0 + }, + "comment": "u1 = u2 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 68, + "publicKeyUncompressed": "04aca1267a00b72d9845d9d9269e38e55f38692fb323423fdbd8dd4812e5f2717ae8141b4d1b44a991c92e71ee720163383597f94c6a1eab19256ba2c116f3507f", + "publicKeyCompressed": "03aca1267a00b72d9845d9d9269e38e55f38692fb323423fdbd8dd4812e5f2717a", + "msg": "5465737420", + "sig": { + "r": "00f31f16f7a3adaf3c9674cb25ed0cd85f3690ce4ad0da440c8501c16b0e3060bc", + "s": "67ea2831c2cb246230c4289e72701ae0bb23a2d93ac10c079136f44b71a2b3a6", + "id": 0 + }, + "comment": "u1 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 69, + "publicKeyUncompressed": "04550d91b78f509fa3355cf4b68d15472859fea1abb2bd7f33515f06e138d88ff07840425a221f946204e036554afd4df5026546a46d8636cfb72b4f49ec4eda4d", + "publicKeyCompressed": "03550d91b78f509fa3355cf4b68d15472859fea1abb2bd7f33515f06e138d88ff0", + "msg": "5465737421", + "sig": { + "r": "1e0470905c9ead68c1384551bf78cb4a2c4ee60f88fbba08c6fa278377a83a30", + "s": "00977840f858a633b848375ab8bb342f5b7105b9181f98cac52c157153f9a08ee1", + "id": 0 + }, + "comment": "u2 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 70, + "publicKeyUncompressed": "04a13ad27a466138a276e8768c74bab50e1ecb465e0f021bfba133344a955ac71be020496c15640ec55e92a6bc462e56cee4562f601b4050aff905e9814f05d0b6", + "publicKeyCompressed": "02a13ad27a466138a276e8768c74bab50e1ecb465e0f021bfba133344a955ac71b", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "4233d9593cf6b96748164fd76a10da54a9c58cb9786704fb09e79cdf58e31816", + "id": 0 + }, + "comment": "u1 = u2 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 71, + "publicKeyUncompressed": "04b839f64e5761f407aae627cbe32b0a2ff03ac913c65e46a117d1055b1f685847f198c570ad891d7ef52981bcf88ffbedac4319964dd23d1a57e4f02cd4408c37", + "publicKeyCompressed": "03b839f64e5761f407aae627cbe32b0a2ff03ac913c65e46a117d1055b1f685847", + "msg": "5465737421", + "sig": { + "r": "4e52eefad74675e32693a6650b9005a0bcfd1eb1e4b53e331565f3c5a824464c", + "s": "31be625aae54cb37c538534937f38f9ebdb26a24af542b57b1760821fac99518", + "id": 0 + }, + "comment": "u1 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 72, + "publicKeyUncompressed": "04cbf1d4c42e291ca59e20d48089f17ef8b5abe09805ba28f13e9eb4eecc1ff52762334c7afb00b1ad3b6d28b8d279f4eec673cedb37bebcf12df471d42fdc7bc7", + "publicKeyCompressed": "03cbf1d4c42e291ca59e20d48089f17ef8b5abe09805ba28f13e9eb4eecc1ff527", + "msg": "5465737420", + "sig": { + "r": "5983230969a3ea75b94acf89825307aaa74dc9896282ef6e492a09613269f1e4", + "s": "00c0282a4fd17d2165e787f2e406f84f9850f81d50d5458b7406468c3eeef53afa", + "id": 0 + }, + "comment": "u2 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 73, + "publicKeyUncompressed": "0441643527e76396b1e31aecedb2be6b94cf6a7297938488a1bc613799f51724033f8424034d3228046cdcd2b1e91b10a95afeb3daeae9d5d6bd525599a9f44618", + "publicKeyCompressed": "0241643527e76396b1e31aecedb2be6b94cf6a7297938488a1bc613799f5172403", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "00c0282a4fd17d2165e787f2e406f84f9850f81d50d5458b7406468c3eeef53afa", + "id": 0 + }, + "comment": "u1 = u2 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 74, + "publicKeyUncompressed": "046ebc2c719dac8cf50a3c3ef2afa58c4b4a8ee02b1323cb2d17fb0a859ca56314ffdfcf37859a9e3b8e9213a1df90ea55446fea1ec732666bcd2d3a7c800ae776", + "publicKeyCompressed": "026ebc2c719dac8cf50a3c3ef2afa58c4b4a8ee02b1323cb2d17fb0a859ca56314", + "msg": "5465737420", + "sig": { + "r": "05f1730aec9240232466fd285e7fd06e1fdc94f1216d1a5f9625ed917afdcd47", + "s": "00cfd45063859648c46188513ce4e035c1764745b27582180f226de896e345674c", + "id": 0 + }, + "comment": "u1 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 75, + "publicKeyUncompressed": "04b498037b61621e34d2c95a19553071ba3de9993274536ac5f2b9cba658b4cfc3ec5e927a8c81a50fd04a4f9b5db35bf9849a0d9c5e12e63ff954f3d3891e0309", + "publicKeyCompressed": "03b498037b61621e34d2c95a19553071ba3de9993274536ac5f2b9cba658b4cfc3", + "msg": "5465737423", + "sig": { + "r": "143575648f9dc5dce0c51ef5e6a214d611f244bad2415afe43b9ea11320574c7", + "s": "648d5f7a4bfda30d9bd0ef7ead1eb493e2562e2fec75ed0a787fd817c64283eb", + "id": 0 + }, + "comment": "u2 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 76, + "publicKeyUncompressed": "046908e07a8066a088caab1f5841f68dcb79598efa3377aa9fdb10c91ece26ad830356d55d1ff7778dd11711d9ef0d5ab853f11de87df0e1d9205973c85a745e83", + "publicKeyCompressed": "036908e07a8066a088caab1f5841f68dcb79598efa3377aa9fdb10c91ece26ad83", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "00884d304e2c5c497f33dbafcadb7fe71994691224e6d4def65ca8bf3b5a907a98", + "id": 0 + }, + "comment": "u1 = u2 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 77, + "publicKeyUncompressed": "04b9ea8f6cf88d98482a0ddaab7457583f69915f4161254b96c9a6fffeae45eb26947f3c1bdfb50728bee46a4c8222865317d8220430f9abf610659b8a6067133d", + "publicKeyCompressed": "03b9ea8f6cf88d98482a0ddaab7457583f69915f4161254b96c9a6fffeae45eb26", + "msg": "5465737420", + "sig": { + "r": "009b87f0289a87e3dadd8be8aa39ca0a4eff120360281d03f92814a56d1dd92980", + "s": "75c7ba9ca4631733fedfaad24b66ad2f491727d094fcda562242ee6e8f77706b", + "id": 0 + }, + "comment": "u1 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 78, + "publicKeyUncompressed": "04ea6e6d419d7d7c23d1243aa98973918af1d185e556e548f47f60ee5863c72ffd8c8ce3170339eaf93ae824dd24eed8411c5d19cb23bd8ff2aacc39bc2f08dde1", + "publicKeyCompressed": "03ea6e6d419d7d7c23d1243aa98973918af1d185e556e548f47f60ee5863c72ffd", + "msg": "5465737420", + "sig": { + "r": "67507506649160461fbdc83bbc57840c430e60ac8dc7f93ea86b093b01c6c447", + "s": "3d3ff3a71ab0d67553065c2db345875da025ecd373fe89913654629d51aff364", + "id": 0 + }, + "comment": "u2 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 79, + "publicKeyUncompressed": "049fd8562e04f8943fdc5e6415afac80095574b6cf9fc99fab96ed958eb67c7cdcafe7ad842792301019c258954476f9625ba72560d7c7d1c3a68f730c424fb05e", + "publicKeyCompressed": "029fd8562e04f8943fdc5e6415afac80095574b6cf9fc99fab96ed958eb67c7cdc", + "msg": "5465737420", + "sig": { + "r": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "s": "3d3ff3a71ab0d67553065c2db345875da025ecd373fe89913654629d51aff364", + "id": 0 + }, + "comment": "u1 = u2 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 80, + "publicKeyUncompressed": "0487977afa6aeee4295077b54fa01c24c725794ef42152c33a904847fb4e50943d2697ec6441e12ede40af2477aa04fd5854ca406ba0e7d1b99b3db41f1b3b79fc", + "publicKeyCompressed": "0287977afa6aeee4295077b54fa01c24c725794ef42152c33a904847fb4e50943d", + "msg": "5465737420", + "sig": { + "r": "00ed553981b8b169008e15540dec3ce4a131f52ee6291e03f0658abe5dbb1a48c8", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "A = B", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 81, + "publicKeyUncompressed": "04566a223a5794b08780f642576885dc34f335fd60232bd6a1da4fb9205870866a48942bc1178a963d781174c22d5c5e6b89b6c4872aced58265c571ce0da858ea", + "publicKeyCompressed": "02566a223a5794b08780f642576885dc34f335fd60232bd6a1da4fb9205870866a", + "msg": "5465737420", + "sig": { + "r": "144badc1e5bcc7e9387203787c00250ca7e761743e6af718128113d2a221c7e9", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 0 + }, + "comment": "B: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 82, + "publicKeyUncompressed": "04de5a6b1ced8698ded178390c9604a3403776add28e4a86cb42dc2243d8faa80299ab0e66fddfffc28e072146f4d93b6786451898f93c353ffe394935704a4089", + "publicKeyCompressed": "03de5a6b1ced8698ded178390c9604a3403776add28e4a86cb42dc2243d8faa802", + "msg": "5465737420", + "sig": { + "r": "046bc0ce1bd2650ceae1f2db1829115342fe79a56ebbb590400c5ed42939def7", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 83, + "publicKeyUncompressed": "04296c4431731e01b07cecb2f52cd567873ea8f8ad0951bb5ace9c0b2a229f62215bf1c0185293cacda32bc41144a0d65978977ec9598491a034b17ef1d06d958b", + "publicKeyCompressed": "03296c4431731e01b07cecb2f52cd567873ea8f8ad0951bb5ace9c0b2a229f6221", + "msg": "5465737420", + "sig": { + "r": "009a6720177f419cfe6f4c786dacdad03533b2f676f83656681fd9f771388fe64c", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B: small x coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 84, + "publicKeyUncompressed": "04bb9031bff194677f904718407753ecd724c0c30462024ee3aabc1e2babfb6675d83bd34c4f03a7e7274badde4d70ff3ad33f61a99b4e1de061acc49054f601d6", + "publicKeyCompressed": "02bb9031bff194677f904718407753ecd724c0c30462024ee3aabc1e2babfb6675", + "msg": "5465737420", + "sig": { + "r": "00fb95db58fa45eaa85d71ce11ab48567beb9f407d3dedb5a6ea9cf038a8ee4ac5", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B: small x coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 85, + "publicKeyUncompressed": "04beb50a539d9e968bfef4268a1e742b5403517cafb722e9f07bf4a44f403c4f6695a7c672767ed3deceb81b18941067abc8f4028ffaa161c48784c61bb26dabb2", + "publicKeyCompressed": "02beb50a539d9e968bfef4268a1e742b5403517cafb722e9f07bf4a44f403c4f66", + "msg": "5465737420", + "sig": { + "r": "008a87051a235c55f267c394b59ad62c40e3fa812b089c3049b436b163912f09b0", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B: large x-coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 86, + "publicKeyUncompressed": "0475331e98b59b8bfc1f1992bbe5e6889a56a6273809822b3ee450f2ef132a2ff2c61fdc9d0c907b6b65c94deef1dae71474ce727425b5ee8a7a6d084527418035", + "publicKeyCompressed": "0375331e98b59b8bfc1f1992bbe5e6889a56a6273809822b3ee450f2ef132a2ff2", + "msg": "5465737420", + "sig": { + "r": "3c1adce9b5050e1a2b8f375d1637b49a53b2990d93c351ddfc9e6009050fc347", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 0 + }, + "comment": "B: x-coordinate close to p", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 87, + "publicKeyUncompressed": "0440d021e3c30cd91fa97f0599f26286a19cbafd09ac6993bb19fae2a9c033bfd0d31ce3407df765ddfe4335e13903c0bf2383fe0c1eb6f3289de6a47931d18ee7", + "publicKeyCompressed": "0340d021e3c30cd91fa97f0599f26286a19cbafd09ac6993bb19fae2a9c033bfd0", + "msg": "5465737420", + "sig": { + "r": "74aff12da7dfeae7746d870edbc1cb9ea2a4f2b0fb013130ba09a1d50e56f42e", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B: x-coordinate < 2**255", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 88, + "publicKeyUncompressed": "0401af136955c59c9ea06eb3ee1e5ac4d8a1e4a66f4b7f7eba6c7fa20f18c487b8c53008fd1b686a94293c6c14c59809b159a26b16514db2181d7cc0af74eaf978", + "publicKeyCompressed": "0201af136955c59c9ea06eb3ee1e5ac4d8a1e4a66f4b7f7eba6c7fa20f18c487b8", + "msg": "5465737420", + "sig": { + "r": "00f319f81eb38efc94082a89aece17c47e7348bbc30d7373a3f6c88ed205d69b86", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B: x-coordinate < 2**248", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 89, + "publicKeyUncompressed": "049eb0e5aab056d4eff9ed82625f51ae4b6adc00403cfb7269aec370718245bd391a2334b2ddb81156e043a01985d13793a5216797f7513a9f72be8a5607bc6cb6", + "publicKeyCompressed": "029eb0e5aab056d4eff9ed82625f51ae4b6adc00403cfb7269aec370718245bd39", + "msg": "5465737420", + "sig": { + "r": "4fa07c8ba666c930929e8ba01bf4b31f910a688f25451636f6f1535b84743176", + "s": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "id": 0 + }, + "comment": "A: g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 90, + "publicKeyUncompressed": "04c57c9890516c521a555e1d81f27e077f1382de09895abc77eb1ace4ed619f73a466b8e14e125b1f5670622ee522e83d838c94a01d82863a41796f1b73fbf3ffa", + "publicKeyCompressed": "02c57c9890516c521a555e1d81f27e077f1382de09895abc77eb1ace4ed619f73a", + "msg": "5465737420", + "sig": { + "r": "00c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5", + "s": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "id": 0 + }, + "comment": "A = B: g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 91, + "publicKeyUncompressed": "043fef6bf419ff7504b2173e2fdee53ff48192e808967b82b136b9181db9767e6711adc6a665efe7311879e89ac66386f472cbbfdc1654169df96402e40030508e", + "publicKeyCompressed": "023fef6bf419ff7504b2173e2fdee53ff48192e808967b82b136b9181db9767e67", + "msg": "5465737420", + "sig": { + "r": "2690f53ca7c56a0bdf2d20307d21edfd866cb45ba0531eea0d30bef7501b3c4e", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 0 + }, + "comment": "B; g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 92, + "publicKeyUncompressed": "04eedcde54d86c305b6e082e8306098a45a3bbde5cd0d768c46c437fbb30aa642f6ec666ce8b2cf2709c1c8b85eaf0cfb48caa83d1ba671290d699bd33f2500c6d", + "publicKeyCompressed": "03eedcde54d86c305b6e082e8306098a45a3bbde5cd0d768c46c437fbb30aa642f", + "msg": "5465737420", + "sig": { + "r": "00971e47e32e786b61c27ad4acc0380697d6c3ecaf7d8a2bed04f06c1010c267b1", + "s": "11527d0ab80a7126a37c56084968a783aedd67aadcc206fb29637891e81c1570", + "id": 1 + }, + "comment": "A: -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 93, + "publicKeyUncompressed": "04c57c9890516c521a555e1d81f27e077f1382de09895abc77eb1ace4ed619f73a466b8e14e125b1f5670622ee522e83d838c94a01d82863a41796f1b73fbf3ffa", + "publicKeyCompressed": "02c57c9890516c521a555e1d81f27e077f1382de09895abc77eb1ace4ed619f73a", + "msg": "5465737420", + "sig": { + "r": "00c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5", + "s": "11527d0ab80a7126a37c56084968a783aedd67aadcc206fb29637891e81c1570", + "id": 1 + }, + "comment": "A = B: -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 94, + "publicKeyUncompressed": "04ba709e633108163ec3ac9c82d3d296dabc5ded4f73ccea03fdd67964cd6fb110b765ede702f05a0f0b2e2bdc1ee834770ba014a40378fff2eb3c16d42078c638", + "publicKeyCompressed": "02ba709e633108163ec3ac9c82d3d296dabc5ded4f73ccea03fdd67964cd6fb110", + "msg": "5465737420", + "sig": { + "r": "33aa6556c6e454fa62b9a6ce00c49f14893a042cc794e6750eccc7741b2a48a4", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 0 + }, + "comment": "B; -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 95, + "publicKeyUncompressed": "04c4d48b9fd2dba3137e39e68fd94fd69b3d7c2ecffa637da0b53bfba5d8ab1dae87f0f318c5df7ba0f528e2bf964478785ffb7a2c3116d7fc6b088a792f933c77", + "publicKeyCompressed": "03c4d48b9fd2dba3137e39e68fd94fd69b3d7c2ecffa637da0b53bfba5d8ab1dae", + "msg": "5465737420", + "sig": { + "r": "00ed42889d317238391339a559e092a4d09aced855ac7665e456b368eb8984f31f", + "s": "00f756c17aa3fac76cae41d4fbdb4bac3ce340291140e79cbe2b20a243dc283689", + "id": 0 + }, + "comment": "A: 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 96, + "publicKeyUncompressed": "041f489b7ce338f8b57b71bba3eb119269333d72c7e2636ecfeff697768e0a1f3928e8d2ceab6de56cf7ca12e2198f319207712e443e9f80c2b900af925efd173b", + "publicKeyCompressed": "031f489b7ce338f8b57b71bba3eb119269333d72c7e2636ecfeff697768e0a1f39", + "msg": "5465737420", + "sig": { + "r": "00e493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13", + "s": "00f756c17aa3fac76cae41d4fbdb4bac3ce340291140e79cbe2b20a243dc283689", + "id": 0 + }, + "comment": "A = B: 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 97, + "publicKeyUncompressed": "0443d3ff7866c0267850cedc15fb086e8e7714b8d9f9938f81ff27a3cd16130e1a7626b82edc29e3b55363e791a89d6a999e9821daa1cf1c6d06bb670f7e6c1ac6", + "publicKeyCompressed": "0243d3ff7866c0267850cedc15fb086e8e7714b8d9f9938f81ff27a3cd16130e1a", + "msg": "5465737420", + "sig": { + "r": "6b939a339ccd144470743088d9790359d3d5136bf802f467d1524a14c850fcb9", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B; 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 98, + "publicKeyUncompressed": "04486ebd5f6c488b13169296def9dcc86421683d2f72bc09f189058bd466f5123341efb1d8f3249dba243d8d1fc8745b5546874326c49d0073f1615772f18c2b30", + "publicKeyCompressed": "02486ebd5f6c488b13169296def9dcc86421683d2f72bc09f189058bd466f51233", + "msg": "5465737420", + "sig": { + "r": "00a1874882e7165aa52a7c255fa05152b6da76c04ae55751c516f424acd7bfcfa5", + "s": "00fbab60bd51fd63b65720ea7deda5d61dcef782fbf8181e7cf5798068562f3be5", + "id": 1 + }, + "comment": "A: 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 99, + "publicKeyUncompressed": "04a1446b8e91d4c3448f8f1135be17451fa17da7918265b39688c665547b42e120c008ebbd6b31159e0b014edefc2ffb4ebb53c21cda9a901cb72d8013cf17e460", + "publicKeyCompressed": "02a1446b8e91d4c3448f8f1135be17451fa17da7918265b39688c665547b42e120", + "msg": "5465737420", + "sig": { + "r": "2f01e5e15cca351daff3843fb70f3c2f0a1bdd05e5af888a67784ef3e10a2a01", + "s": "00fbab60bd51fd63b65720ea7deda5d61dcef782fbf8181e7cf5798068562f3be5", + "id": 0 + }, + "comment": "A = B: 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 100, + "publicKeyUncompressed": "0410a9024ed2e49e420183caf929523cf4b0cf8ab71d5c37a3ffdaadbdba5f4d6f634a0adbbd5aca478b447a10064c087822c1a805b859de1c2245a15e5516c417", + "publicKeyCompressed": "0310a9024ed2e49e420183caf929523cf4b0cf8ab71d5c37a3ffdaadbdba5f4d6f", + "msg": "5465737420", + "sig": { + "r": "65363e90e7761899428cf8698eab0ba014970de9880ab8b9d556cab0225c8e66", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B; 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 101, + "publicKeyUncompressed": "045fa2f4009e92a67cedc1119bc8e97459a08c89c87f5b2a6b975e7be8e09c18f7cf068fa8fb53551b3d93c2e5bf5d5645805cea5a52bdcf2518bfdba241610fcf", + "publicKeyCompressed": "035fa2f4009e92a67cedc1119bc8e97459a08c89c87f5b2a6b975e7be8e09c18f7", + "msg": "5465737420", + "sig": { + "r": "06c5213afde7d6fc975f4f5d20139eb1991d455972651e14ca2be83a3e8e8e4b", + "s": "22a4fa157014e24d46f8ac1092d14f075dbacf55b9840df652c6f123d0382ae0", + "id": 0 + }, + "comment": "A: g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 102, + "publicKeyUncompressed": "04d5c8ae7a02038c30a1a8d70440f16e1b512e7b64758e904df2f7efda1ba770e67e53448de0428826fe8dff9b686dbccba2b4eef90544e83a0d24996c08001d07", + "publicKeyCompressed": "03d5c8ae7a02038c30a1a8d70440f16e1b512e7b64758e904df2f7efda1ba770e6", + "msg": "5465737420", + "sig": { + "r": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "s": "22a4fa157014e24d46f8ac1092d14f075dbacf55b9840df652c6f123d0382ae0", + "id": 1 + }, + "comment": "A = B: g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 103, + "publicKeyUncompressed": "04a0d6ba948a2bd3e9190fa66686fcc7d85042248c0ff7d03b083a323a122350bf678409cafacd5f7330c67eeb6313f9ba3dfdb9cd6c157e2e97c80382ea37a1ee", + "publicKeyCompressed": "02a0d6ba948a2bd3e9190fa66686fcc7d85042248c0ff7d03b083a323a122350bf", + "msg": "5465737420", + "sig": { + "r": "03480d375c35c1de6f8da62813131d14c7314b44867b0454728a8a6b22e19e8b", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 1 + }, + "comment": "B; g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 104, + "publicKeyUncompressed": "04d30ef3c8fe3b87da29b5f09dbf25d5fb94f1ce78fd9711e23bc4e8b307cfe6713b8e40acaa2250776121de9c09a46ad22b3050721a20b60b77568f3934a3a2c8", + "publicKeyCompressed": "02d30ef3c8fe3b87da29b5f09dbf25d5fb94f1ce78fd9711e23bc4e8b307cfe671", + "msg": "5465737420", + "sig": { + "r": "0095099bc14e4ce3ac06327e8b32d35e126faa2f0bd2fab215afcdd753cac7a8bc", + "s": "00dd5b05ea8feb1db2b90753ef6d2eb0f75cf40d90f5c492456d0b6d68fffe1661", + "id": 1 + }, + "comment": "A: g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 105, + "publicKeyUncompressed": "04d5c8ae7a02038c30a1a8d70440f16e1b512e7b64758e904df2f7efda1ba770e67e53448de0428826fe8dff9b686dbccba2b4eef90544e83a0d24996c08001d07", + "publicKeyCompressed": "03d5c8ae7a02038c30a1a8d70440f16e1b512e7b64758e904df2f7efda1ba770e6", + "msg": "5465737420", + "sig": { + "r": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "s": "00dd5b05ea8feb1db2b90753ef6d2eb0f75cf40d90f5c492456d0b6d68fffe1661", + "id": 0 + }, + "comment": "A = B: g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 106, + "publicKeyUncompressed": "049349c0837306c2694e54e6d72d6804ce1cf4e246267ecaa34e66821d8260cf15a99cb7353402bbe2ab808ee0d27bfacabb87b7a63863ff7b828a8b0ed8fe5159", + "publicKeyCompressed": "039349c0837306c2694e54e6d72d6804ce1cf4e246267ecaa34e66821d8260cf15", + "msg": "5465737420", + "sig": { + "r": "00e679646f95ed00fd9bf207508a88eb6600d181609a986da9e70127bd1f6cfbdb", + "s": "00d6043b99f8d231f1f9f43c6565ec77bb102670f986452288270a5c2dbd4a6327", + "id": 0 + }, + "comment": "B; g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 107, + "publicKeyUncompressed": "04a851059314024b705cde7b294a97a111a344e2111a6145561b9adcbc8a41cf745604b1a7bd8e7e91de26b8cd83e8880ebc55ce04bf7a254aa21b5e1ce806174a", + "publicKeyCompressed": "02a851059314024b705cde7b294a97a111a344e2111a6145561b9adcbc8a41cf74", + "msg": "54657374", + "sig": { + "r": "00e210cc0b9db3e616e12d707f5b2fed00f7b4db975220017686ae2fd6555eed07", + "s": "1097ba6ca203ef0b49e8577471897adf8294b1d937c7c0c246423b3ef07e6405", + "id": 0 + }, + "comment": "point at infinity during verify (invalid signature)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 108, + "publicKeyUncompressed": "0414869e9609ef0b92c6660ef95e50c2164732ece634c52b84ed616c72ff5a55a29da24df409aed5dc8527cc83a57478ffc8351d75cc1d555e1c4549c88e663939", + "publicKeyCompressed": "0314869e9609ef0b92c6660ef95e50c2164732ece634c52b84ed616c72ff5a55a2", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe", + "s": "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 109, + "publicKeyUncompressed": "04f3eca509a9b93074b70a7b8f2daa444b96f62b7a08f903f081e0a0390a3c3f85ceafb40bce5a554e85366785ad53d38ae4d6325cce1fc8de4a37c7423bba7487", + "publicKeyCompressed": "03f3eca509a9b93074b70a7b8f2daa444b96f62b7a08f903f081e0a0390a3c3f85", + "msg": "54657374", + "sig": { + "r": "014551231950b75fc4402da1732fc9bebe", + "s": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 110, + "publicKeyUncompressed": "04b9eb7ca189502b2a3861b5891eaf795acbd0b19a3c68399b0135c5f5192a6c08676cf0cabe4a8cebc9d43caaed5ac0ce51c6ae0f0863d3dc86e1575c885b406b", + "publicKeyCompressed": "03b9eb7ca189502b2a3861b5891eaf795acbd0b19a3c68399b0135c5f5192a6c08", + "msg": "54657374", + "sig": { + "r": "014551231950b75fc4402da1732fc9bebf", + "s": "010000000000000000000000000000000000000000000000000000000000000000", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 111, + "publicKeyUncompressed": "048906000207f4c198757496a86b85a5aa836d3abb7599e467fc34437b392504356b8064890161827b966b2e253395b2f5bbf06548510ad67586a83589ef74731f", + "publicKeyCompressed": "038906000207f4c198757496a86b85a5aa836d3abb7599e467fc34437b39250435", + "msg": "54657374", + "sig": { + "r": "01", + "s": "01", + "id": 0 + }, + "comment": "point at infinity during verify (invalid signature)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 112, + "publicKeyUncompressed": "042845a29badf037547e97b1ac1cbaffb17821e5b53c21eef2728689640fc77f75d3d78acb6e5681a1eed8dca410792395ef8e7cbe9c1e3a01e563140215531060", + "publicKeyCompressed": "022845a29badf037547e97b1ac1cbaffb17821e5b53c21eef2728689640fc77f75", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413d", + "s": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 113, + "publicKeyUncompressed": "04a1cee810c0456c156ff5b654d0706b57c9164ef0f47432397748b84ea4a05fce4185dffb218534ab83ed9e24b85c0c61be71598d78c14b333b5f8fbb43329048", + "publicKeyCompressed": "02a1cee810c0456c156ff5b654d0706b57c9164ef0f47432397748b84ea4a05fce", + "msg": "54657374", + "sig": { + "r": "3dfeec8ef9e43353c6cd74fecc6329525052040d93bfaaa311be08817beeeffe", + "s": "00fffffffffffffffffffffffffffffffebad565d7f806d4e08361258c66bde94b", + "id": 0 + }, + "comment": "s too large (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 114, + "publicKeyUncompressed": "04406d510ee11849b032e04fe4297f3676482fb45d485643d1d6c96c2719ee9512525e6b32862207ddb86b0777308bc794c6e7aa807f3e3de3c3c06090e45af535", + "publicKeyCompressed": "03406d510ee11849b032e04fe4297f3676482fb45d485643d1d6c96c2719ee9512", + "msg": "54657374", + "sig": { + "r": "3dfeec8ef9e43353c6cd74fecc6329525052040d93bfaaa311be08817beeeffe", + "s": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "id": 0 + }, + "comment": "s = n+1 (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 115, + "publicKeyUncompressed": "045c0fa04a2eb2f3a71af6501d704ca2986dc1b02664483d1765341ca403b0026a542ba2a1832ee58aa29b014bbdb94c7a0b9aef2d0755d61257f85da3500589db", + "publicKeyCompressed": "035c0fa04a2eb2f3a71af6501d704ca2986dc1b02664483d1765341ca403b0026a", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "s": "0e16b5fe2de57d71ce57f6b7ae2fee41c97a028a7844449f0bf97b8e21be9910", + "id": 0 + }, + "comment": "r = n+{Rlow[0]} (Could not recover R)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 116, + "publicKeyUncompressed": "04af3e2ee851926c927ef34547f779e35bbe116215227fa37c427290af8b8daaeca1e68ef200e56e608a24f120b574297c764ab375fb1194f2f35d7de772c58f72", + "publicKeyCompressed": "02af3e2ee851926c927ef34547f779e35bbe116215227fa37c427290af8b8daaec", + "msg": "54657374", + "sig": { + "r": "3dfeec8ef9e43353c6cd74fecc6329525052040d93bfaaa311be08817beeeffe", + "s": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 0 + }, + "comment": "s = 2**256-1 (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 117, + "publicKeyUncompressed": "047a2867f8a7036ff7e236c9442406479ad0ba2505df264e7058c78cb537617504c6e8ea91bc45efefdcfc842b57a73140e10d667754425184eb6090b4a2e8d3eb", + "publicKeyCompressed": "037a2867f8a7036ff7e236c9442406479ad0ba2505df264e7058c78cb537617504", + "msg": "68656c6c6f", + "sig": { + "r": "59294e8bc54e76d48b5594f01fe4729566d9b6df6385982fbb533183921f1a12", + "s": "00b0c7f723592d2b533938edfce827a222d9cad4a66c28ffc072ae28273b03a8b2", + "id": 0 + }, + "comment": "R: w=-2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 118, + "publicKeyUncompressed": "043385a17b6c6b1544b34411ae0bcacc6eca75a7342e21736ec39080a88819821385a90e07f2fccf1fcdf510a04d72ea70222a2949c8512d8c6c55ff0b101113e2", + "publicKeyCompressed": "023385a17b6c6b1544b34411ae0bcacc6eca75a7342e21736ec39080a888198213", + "msg": "68656c6c6f", + "sig": { + "r": "00a74646c798fd5a0af442da69c822cdf1134adba361f90663d626481aa10e0004", + "s": "0082d95c82c1cc7d5c49402440a72371893919273b0576b95f922e74ed3cd2c387", + "id": 0 + }, + "comment": "R: w=-1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 119, + "publicKeyUncompressed": "046c4885cc2bb3ee1cc1d857486b3c6296b061b4bdca1a989b3ccc65b136c50c33cac903726e40529acc705addeef6d431f34ccf7e3e452d56b0fde322584e061f", + "publicKeyCompressed": "036c4885cc2bb3ee1cc1d857486b3c6296b061b4bdca1a989b3ccc65b136c50c33", + "msg": "68656c6c6f", + "sig": { + "r": "01", + "s": "0080ba145cbcb246213e5de6415ba3259f00be3c593367e6136c730f136e6bd002", + "id": 0 + }, + "comment": "R: w=3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 120, + "publicKeyUncompressed": "043a8d2c851b64c8a3974e3203bef7c435417ea2715d05a264364e9b6c83698a4874cc2bbdee1fff0aae5ffb74d760cf5f8dc9159f44d205f5ea5d82b47f9c4102", + "publicKeyCompressed": "023a8d2c851b64c8a3974e3203bef7c435417ea2715d05a264364e9b6c83698a48", + "msg": "68656c6c6f", + "sig": { + "r": "00a10bd2bb932fae8716b0640d7d1b8e210264e3e70eea4840489c8b7252ed8993", + "s": "00ab19c8fde1a46424f3b7cc098629b9f95ffa47fc7b6c3b5cb2017af123a96c51", + "id": 0 + }, + "comment": "R: b=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 121, + "publicKeyUncompressed": "04ed888916fe8841a10732ff01da04d65e5cf01e9433181d2428b7c21458e7fd1da41a2438987bcef9d5c23b22a6a46c3d1a6f14b0032af2b1511522b798322901", + "publicKeyCompressed": "03ed888916fe8841a10732ff01da04d65e5cf01e9433181d2428b7c21458e7fd1d", + "msg": "68656c6c6f", + "sig": { + "r": "00f7b3cb719ab8ad6d3399d6fe5d24280d73956170416408edda530b80afdec300", + "s": "00d13d791abe48a19e4763409417cb0888f03c59c780990a19937ff65dae8d6fcf", + "id": 0 + }, + "comment": "R: b=-2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 122, + "publicKeyUncompressed": "04c4a053e2dbaf8a54df3c8e01ee8960410557e88cf50b4d104bb2d1172875b96c228df830adff6ca622006c51f7776d40b5a03381f6cfcd5f8de69b8645d4230e", + "publicKeyCompressed": "02c4a053e2dbaf8a54df3c8e01ee8960410557e88cf50b4d104bb2d1172875b96c", + "msg": "68656c6c6f", + "sig": { + "r": "00cdf6e7bfc3939a644fb51ec36bbd1057ca60eeb0b50563411e681368e29ec494", + "s": "59e41b81a52486f750d06fef71d2363d697745b42d1eaf0f813bb9cce289ed50", + "id": 0 + }, + "comment": "R: b=2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 123, + "publicKeyUncompressed": "04c78d7272b35c2ad449d48ad7debf8db8cae3fdbab26e864f1b7ec5e283a3ebab1e8b1ebf9054620927a7e63aed683570244db38785c932b64c0f377f62a8a1f9", + "publicKeyCompressed": "03c78d7272b35c2ad449d48ad7debf8db8cae3fdbab26e864f1b7ec5e283a3ebab", + "msg": "68656c6c6f", + "sig": { + "r": "0089882732b3ae4a65ba8dc0eabf1219110aeb783a9078a904134fa1ed2f5e8eb0", + "s": "39c78f42cb8c7acded5bb7e6712a234978bb96755e2adb72ced8ee0e29b1dcb3", + "id": 0 + }, + "comment": "R: h=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 124, + "publicKeyUncompressed": "044b3e96c7f0dee7f24ad5dce392e2d13e3b6772cd0ae2846a39851351f6c75c80b534fa259b46cf89f285698c70bb2d7ea6568947245a80a3b72074fb0c46e6c7", + "publicKeyCompressed": "034b3e96c7f0dee7f24ad5dce392e2d13e3b6772cd0ae2846a39851351f6c75c80", + "msg": "68656c6c6f", + "sig": { + "r": "26ac524f7bec740b75b1b8d841a0f2a2f29ab0bd870d2b4a3a505edfdf6fda5d", + "s": "00d1a8fe6b4dee294ad2246c592fd16309ef9382c1c881b35abf18f6e9fd67789c", + "id": 0 + }, + "comment": "R: h=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 125, + "publicKeyUncompressed": "04d3f49f5406b52133b95bdb57acfbfea9b5722d7adba26ec29b89b237cdc833c25679fdfdcb6924f66238dd56943d9ae71ec34c2b4c3bd6d35a1123b1a7596be2", + "publicKeyCompressed": "02d3f49f5406b52133b95bdb57acfbfea9b5722d7adba26ec29b89b237cdc833c2", + "msg": "68656c6c6f", + "sig": { + "r": "584d2dc258bd4650e6fa04fe9d3d2a5e768d795945ed2323f844d0a8fa0c6fbd", + "s": "00c8abab715574e297cc1c90b161f9def753315136a94e65d6590bfd98735a0c18", + "id": 0 + }, + "comment": "R: h=-2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 126, + "publicKeyUncompressed": "04a30d5cd0000bc72c67ab74b3bc2e7ab01ebe6101418bc51eff0c5b33d14a380398f8a2097e29ffbe172adcf3ebc464d025f772075dfe526904804935fcc82a87", + "publicKeyCompressed": "03a30d5cd0000bc72c67ab74b3bc2e7ab01ebe6101418bc51eff0c5b33d14a3803", + "msg": "68656c6c6f", + "sig": { + "r": "00bbad8da4c018bdc15a5af8f3da4b384c530ea75560cdfd242bfa3235d8d3595f", + "s": "39ee0a7615b13eaa3bb5810d7e237da6e825089a21f24aa8f9343384cee2ee8b", + "id": 0 + }, + "comment": "R: h=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 127, + "publicKeyUncompressed": "04d23bdd45cdaabe455f3f74d161fef2baf5596355218ebfceee8fdd535711eba37e8f21fb8ae2faab7ae947edf22ac1a4dc6618e77a5cb3c2fe395f02452ad0ab", + "publicKeyCompressed": "03d23bdd45cdaabe455f3f74d161fef2baf5596355218ebfceee8fdd535711eba3", + "msg": "68656c6c6f", + "sig": { + "r": "78c926b0ee01c000c25a83631219f08d8b34745d2ea2fdc9ebdc5a2288fa9b03", + "s": "00d9a970c7a6c2913a147d777286247eabfbc883c967d4b2633d6540a958d76a0c", + "id": 0 + }, + "comment": "R: h=2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 128, + "publicKeyUncompressed": "04cc40a53edc153c1f11c2b4b48fcfb9fdfa12d5cdb1954ebe9ce0cb9eb9495915194cdee9db0bba2bfa0cbaa3269f7d227d2a42f40d0cdaa958e054423afb1764", + "publicKeyCompressed": "02cc40a53edc153c1f11c2b4b48fcfb9fdfa12d5cdb1954ebe9ce0cb9eb9495915", + "msg": "68656c6c6f", + "sig": { + "r": "20cb4091b3c7ffedb9eb8004e85992cbbeb64d5ab9aae69b377f3e51096121a9", + "s": "474fbdac834550d040e850573cef7c811a4606c48d4294f2f0d8408924be04c8", + "id": 0 + }, + "comment": "R: s**2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 129, + "publicKeyUncompressed": "046dd67b7eed4215eae733ca6fce8d7c5b2d639da3f70bc644740db77b0ed87f916f98829a8be0181d6fbc5d05cdeb898f8b0b18d2c5f838c310558ea98995e0e7", + "publicKeyCompressed": "036dd67b7eed4215eae733ca6fce8d7c5b2d639da3f70bc644740db77b0ed87f91", + "msg": "68656c6c6f", + "sig": { + "r": "0097ec18e01255bb88561e1189d22e88bda5ae30d6863d0b73a17c25b86df045aa", + "s": "09509359c51f287b70acaf46da6011cd0b6ad89684fee1532776519afa3a3755", + "id": 0 + }, + "comment": "R: s**2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 130, + "publicKeyUncompressed": "044eda1046079c0713d2a67a7ba70a0a6b3efa892e321e89ccbb72f6964d6b91dfc038b86cce7aec12a22c6ac7181a99b510fd3627be620202bf674eb6d721f12e", + "publicKeyCompressed": "024eda1046079c0713d2a67a7ba70a0a6b3efa892e321e89ccbb72f6964d6b91df", + "msg": "68656c6c6f", + "sig": { + "r": "4748a68e39e24489eff66e714577e4769b9b81cec0180df127049bf588ae94dc", + "s": "00cd72b150b2fde97af02cae987277390181a50164ae7de6a8665a26846d52941b", + "id": 0 + }, + "comment": "R: s**2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 131, + "publicKeyUncompressed": "04dba6e1b24d436db5d9888f59545bc2e7f307b337730c486e7c47d6c91300854100c90583ec734ca34b24865740d4579f44367d9ea73547c4162d9b563678b4cf", + "publicKeyCompressed": "03dba6e1b24d436db5d9888f59545bc2e7f307b337730c486e7c47d6c913008541", + "msg": "68656c6c6f", + "sig": { + "r": "1fe1e5ef3fceb5c135ab7741333ce5a6e80d68167653f6b2b24bcbcfaaaff507", + "s": "00fd4973481206e6af78004bf8fa497819f2c6f56636fe69ddb8829284341447", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 132, + "publicKeyUncompressed": "046a46e363d0643fd18d3f5cb760d4dfa998127c67434d7aa4c78d1eb286572ead0b250c98ff7fc61ce61869c09c46bfd9b7062638444ae0cdee2e75cc2806bb12", + "publicKeyCompressed": "026a46e363d0643fd18d3f5cb760d4dfa998127c67434d7aa4c78d1eb286572ead", + "msg": "68656c6c6f", + "sig": { + "r": "146d3b65add9f54ccca28533c88e2cbc63f7443e1658783ab41f8ef97c2a10b5", + "s": "008c75a37676c244e313af3ba0d24b22553ca9cad04f357930d8cb868387a2d6b7", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 133, + "publicKeyUncompressed": "0405499aab23da51a8bac7ce5dfe87e1d5888a1afa5555e20e831229afbd0796b5076e8f82033d5dfc242be42e901bd1da4790779b982eece615decec2e1accf88", + "publicKeyCompressed": "0205499aab23da51a8bac7ce5dfe87e1d5888a1afa5555e20e831229afbd0796b5", + "msg": "68656c6c6f", + "sig": { + "r": "00cbb0deab125754f1fdb2038b0434ed9cb3fb53ab735391129994a535d925f673", + "s": "0090a0156d3c8e16fcde9a7249be815b8250b94efa0b52e553c824af928073e53a", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 134, + "publicKeyUncompressed": "047b952475d2439eb637db1611fd4f51adb2b68a3600022e9c071e8b0c6a6a147ceb932d04ac1dc214b55fe25806fa0dfce442920d9440339ad20c1f8c813490d6", + "publicKeyCompressed": "027b952475d2439eb637db1611fd4f51adb2b68a3600022e9c071e8b0c6a6a147c", + "msg": "68656c6c6f", + "sig": { + "r": "0092b1637da83a0c4fc16eba2e4f4dd88367eb24d6f6bcd8d3b5d3c23d76f02e77", + "s": "652ef3655e7cebcfa3979c0a602be1b7fa97681b36a6205de29c4519405ac3a9", + "id": 0 + }, + "comment": "R: x3=-3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 135, + "publicKeyUncompressed": "0456d50c8f2c07a1892cf799f8070591dcfbe9e67c8d3c62dfbf44b3ba1b0c2e438b41443f8b98b826aa8e0a80ab68ba7d8a8851c609c7cba747d859360a9d8670", + "publicKeyCompressed": "0256d50c8f2c07a1892cf799f8070591dcfbe9e67c8d3c62dfbf44b3ba1b0c2e43", + "msg": "68656c6c6f", + "sig": { + "r": "00e962e355d01eff293794cccd6e340c760785ceae509696165f3282e770d6ea70", + "s": "00e0f1a394169ff5534d73cf61235fca89070cd603b866da1d6900de7b1947b540", + "id": 0 + }, + "comment": "R: x3=-1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 136, + "publicKeyUncompressed": "0454610266bccc9815800444d6af615d87e37bb4c13ff75467500b436b127ad7bad94418507837cda1647cf95120457ca9e7fadec17209ed98ead0a4008094c795", + "publicKeyCompressed": "0354610266bccc9815800444d6af615d87e37bb4c13ff75467500b436b127ad7ba", + "msg": "68656c6c6f", + "sig": { + "r": "008c389a588a34bd242ee2e36880cea50cbee41736966fb69f47aa6cc30243871c", + "s": "00a5efe65edfa7f5c038063d6c5fa461574af07980bde881aa7582c1756cc24558", + "id": 0 + }, + "comment": "R: u1=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 137, + "publicKeyUncompressed": "04e74c1f29d917b94f998241008b4a9733cb85f1aa511d1a1218055ea7f79438d8062584816afad90013ee7a31cc4d875ec5c561040badf45c937e7f225a345940", + "publicKeyCompressed": "02e74c1f29d917b94f998241008b4a9733cb85f1aa511d1a1218055ea7f79438d8", + "msg": "68656c6c6f", + "sig": { + "r": "062ff933046837c65858f18db000dfc6b9103135c332845d75b79526eb8ab230", + "s": "009c516863e822db7cf48a8d416fdd9556b767f043e81e9758fbfdce1c9bde0496", + "id": 0 + }, + "comment": "R: u1=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 138, + "publicKeyUncompressed": "0426442561f61a755bb414d37c0371ed1af1c4919e6f134993553e0ef863744305d00ac647f7c15fb68341f376030d12c9c6d571c4e3599acb3ace2154259bbe51", + "publicKeyCompressed": "0326442561f61a755bb414d37c0371ed1af1c4919e6f134993553e0ef863744305", + "msg": "68656c6c6f", + "sig": { + "r": "6d976c7471630b1578c42b09cf307b2c880bb793a65dc503429dfe151231c2e3", + "s": "00c5cac9c6d6a459f8c9dd484ba06b15b597ff90e8afefffd844b626fb46162a5b", + "id": 0 + }, + "comment": "R: u1=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 139, + "publicKeyUncompressed": "043e174fe8c71dd86dacfa88b2325fc94ed82a39b1adac742aa3e0d2891c1cada70e53d792b5a697b4821f04c0f1e17e2cf2e32d5a5c39c9f258770d4f84839359", + "publicKeyCompressed": "033e174fe8c71dd86dacfa88b2325fc94ed82a39b1adac742aa3e0d2891c1cada7", + "msg": "68656c6c6f", + "sig": { + "r": "00e434b415eec4924484d20597735f7f68a9731418ebd3e6c78f5fa072d52b2e6c", + "s": "76714a5d1d1f4b6a9bdf46f6ae1ea299af60854451fed9849382d8bee41d4d37", + "id": 0 + }, + "comment": "R: v**2=2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 140, + "publicKeyUncompressed": "04025e799587245c8e84fccc25eaa6e986584e22c59c7b9e0f270299d750024ded3a772772d9ac678b64ef8b96392abd6c18c992630873856b8242ce280dd86a4f", + "publicKeyCompressed": "03025e799587245c8e84fccc25eaa6e986584e22c59c7b9e0f270299d750024ded", + "msg": "68656c6c6f", + "sig": { + "r": "008a9813e0c6517ed57006b2ae943df3b6520f9138d67bb1ca108828095b6bd7a6", + "s": "00b4aa9edb8f5917cdf1e2ea6fc842ea768c8f4d309adf886c712392c803ecec9f", + "id": 0 + }, + "comment": "R: v**2=2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 141, + "publicKeyUncompressed": "04677bc295152f80cf3dee43dfd87c7fcc6b2c8948caf3b99844d5a22a1ec9245699d239e217453267df0b337a1d89c43b84089ac88167735e5cf2a066e9258617", + "publicKeyCompressed": "03677bc295152f80cf3dee43dfd87c7fcc6b2c8948caf3b99844d5a22a1ec92456", + "msg": "68656c6c6f", + "sig": { + "r": "182c488e1b18bac4e4481dc408637bf1942d07fbb98165ce871b691a33064c67", + "s": "28598d3ecb1d2bfdce4e9325d6ef3df415f4cac45029cffc51e9917fcff36b44", + "id": 0 + }, + "comment": "R: w=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 142, + "publicKeyUncompressed": "04749d24d3e485339ec06749193d6ba2e783e98c88fed4e43d901ff718556dfaca0e3f1d5bf07fba1bb952c1da32b00a4155a4bfc69013bfb323103d1ff0199823", + "publicKeyCompressed": "03749d24d3e485339ec06749193d6ba2e783e98c88fed4e43d901ff718556dfaca", + "msg": "68656c6c6f", + "sig": { + "r": "00a0488bb1e1b8d18f79188dd24daf46a74a6924c52c7ca768f478920e9863a9b8", + "s": "120edb8ddde4b6616a63cfa364fbfbff9bfd0b9d2f88e6f79291e69116ac9398", + "id": 0 + }, + "comment": "R: w=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 143, + "publicKeyUncompressed": "04ab58127459ff65c519fc7a1923990172500058de9a235bdb6f814deef3334f3ceba75aa2df4ccca77dbc1d061f5b00902eb3ae6d59806a4960de1b60a4fb241f", + "publicKeyCompressed": "03ab58127459ff65c519fc7a1923990172500058de9a235bdb6f814deef3334f3c", + "msg": "68656c6c6f", + "sig": { + "r": "00b223e881920d6c20f82e583ae99b6e1673b61b16366f4d8085b368ba98e719d6", + "s": "2472b2bd7abd82018905e6df0b8b7f5d58742f1b1456b405f0d7d49d6b88f902", + "id": 0 + }, + "comment": "R: w=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 144, + "publicKeyUncompressed": "046ae1a414a14ad7126d8d4b25ec7592a55116835d3b23324373a5dd8eac7ed71dd215ad73a108714a54178312a710b2bb8d3a96c30235e1cd10b46c15454fa23b", + "publicKeyCompressed": "036ae1a414a14ad7126d8d4b25ec7592a55116835d3b23324373a5dd8eac7ed71d", + "msg": "68656c6c6f", + "sig": { + "r": "134116593aba3ba809ab243cd27f0e77f73c7936484ca7c345eefe35a612329a", + "s": "00adefb65e71c5b30b08ab9917b948fdb68761fb7294a481d52031c8ccac6f4167", + "id": 0 + }, + "comment": "R: b=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 145, + "publicKeyUncompressed": "0477453b46740678d05be8d7e6395a20fc1d783191f6de127cbdebcef53ea98c81aca75b222a6efc109c617260921f8b6da515cc8a1bff492e6a8f0b53a9a67a23", + "publicKeyCompressed": "0377453b46740678d05be8d7e6395a20fc1d783191f6de127cbdebcef53ea98c81", + "msg": "68656c6c6f", + "sig": { + "r": "00a057e0542d9d30b57fea2312c94c57d1e3450aedb7b61dd05d5bc4aeda9bf9a6", + "s": "00a220b3ee4f228fd45a30e9c92c0a0dce547ba98bd58fca455a665368fd87453d", + "id": 0 + }, + "comment": "R: b=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 146, + "publicKeyUncompressed": "04a022794fa351c9bcb7c38b212a56f11f15f8e546c9223e839eb1fbe107e9cb705fe60c2d0089cbbb1dfab8147734ae3e2ab5a18c76a5ece3ea7cbee436fa6fbc", + "publicKeyCompressed": "02a022794fa351c9bcb7c38b212a56f11f15f8e546c9223e839eb1fbe107e9cb70", + "msg": "68656c6c6f", + "sig": { + "r": "5c46a07644c32bce98f69974fa56b0edd0fbd1fa061daba09a4d7dc1533127e8", + "s": "00890cdf3f4569a2402996bc61a569d848d19ae59338f1d76331857a73aae56d99", + "id": 0 + }, + "comment": "R: b=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 147, + "publicKeyUncompressed": "047e5572320c75b72534c7a8c4b27b47e8e832565626ae6bb567b00efcf1bc97f7588cc6a3b6828558a6cf4d7af4db2f6b7e8ccadce5d3290819f04c1740ac4f58", + "publicKeyCompressed": "027e5572320c75b72534c7a8c4b27b47e8e832565626ae6bb567b00efcf1bc97f7", + "msg": "68656c6c6f", + "sig": { + "r": "00ecc1207635725787ce3e2405a3299938646496c0fed6e9ef3d7305ccb6780346", + "s": "008b44ba910b35320ebd5ebce926f5e729b800576d7aa36e716252dc29ce22e6ec", + "id": 0 + }, + "comment": "R: b=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 148, + "publicKeyUncompressed": "0429129e36a0b48a6951550af2b4a28016eedac1b5bf1883f9ac177252c3fa0fde8783e4526f786d32ca97e91f7c82c5b81bfff6aa3b2ba844f47c45b0a73efee8", + "publicKeyCompressed": "0229129e36a0b48a6951550af2b4a28016eedac1b5bf1883f9ac177252c3fa0fde", + "msg": "68656c6c6f", + "sig": { + "r": "0087b1d4cb6f7530a53613a40b30f83f091fc5a21cb4eb7c38526f0bcc81b205d5", + "s": "1d54b4b7437ea7ef35ebab5015be1874b0521185df5c4e87e73f95a867a95e85", + "id": 0 + }, + "comment": "R: h=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 149, + "publicKeyUncompressed": "044b2ae8b7c31f45a3bb8e446bfb32b3374a623d570f91205f98c425a9f9dcaaf8c2cec078874fa7051d7693b43a40c76ad1e62d666a3816bc9a0294d9bf5d8cf6", + "publicKeyCompressed": "024b2ae8b7c31f45a3bb8e446bfb32b3374a623d570f91205f98c425a9f9dcaaf8", + "msg": "68656c6c6f", + "sig": { + "r": "7f82ab9bebfafb121b398faba731c8badbcff94f8d9bd93dfda0007d66479c84", + "s": "4a804e056b550e87b01db4e8be3984ebe38490c52e23b24da783edc6d2e05819", + "id": 0 + }, + "comment": "R: h=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 150, + "publicKeyUncompressed": "04074732db1131a8669db8c7cd4ef09e034cc659600aaeabb687d8a51074780e9074e54fa6c4e2ed28f6f93ca5bdf5a67c32e456868d55aa0f4d5394153ed8d44d", + "publicKeyCompressed": "03074732db1131a8669db8c7cd4ef09e034cc659600aaeabb687d8a51074780e90", + "msg": "68656c6c6f", + "sig": { + "r": "00bdd2c6eebdfb600b60540f546e1e46c72abb243f8b90711ebb64119577949b60", + "s": "2430c47acef4ff6e1b1cf3fa24cc27e09da742a28239ccd7eafbeca73938ccc3", + "id": 0 + }, + "comment": "R: h=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 151, + "publicKeyUncompressed": "04a024485c4abc8ce647d45b28f2a5dc49201b23860d8e8b1830016017e6209cb4de3c86f00e8a6a3f6e5b18dfe88931a165b7f20436a780b54988c7cf2805f645", + "publicKeyCompressed": "03a024485c4abc8ce647d45b28f2a5dc49201b23860d8e8b1830016017e6209cb4", + "msg": "68656c6c6f", + "sig": { + "r": "32b575485a17f6733fa8774073d4c8ea9bccb5c5fe767f9ddef91da300037dd1", + "s": "00dc5cf3d3dc373dd57266a574a580d0e8f84017a3561c1e59c281ea8ff013361d", + "id": 0 + }, + "comment": "R: h=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 152, + "publicKeyUncompressed": "042aaf34fd3609dcfcafb53ffc3b866fe4bd2d4c605f35577f879ccc042408662f0408ecc3f00cae8e273b8ade666b8b2ec8d524aa15753fba2a83a7b22a1c43b2", + "publicKeyCompressed": "022aaf34fd3609dcfcafb53ffc3b866fe4bd2d4c605f35577f879ccc042408662f", + "msg": "68656c6c6f", + "sig": { + "r": "00d0d6b87b213e7ae95c42f7684be4a95df6654580cd7227bf95e421174b71e101", + "s": "00cdcf1cdd1ced26112292eef91107f2ad0a76e6cd932812bc7bb06f2caf417762", + "id": 0 + }, + "comment": "R: h=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 153, + "publicKeyUncompressed": "042019fee922a3ce8a6c7579e77eeaa715cafaadcc5240cb9065681984fb9197ccd00b3adb090f4bf50e002d9763879f3a839ee8171d7d53c5ba035fce0eab9d03", + "publicKeyCompressed": "032019fee922a3ce8a6c7579e77eeaa715cafaadcc5240cb9065681984fb9197cc", + "msg": "68656c6c6f", + "sig": { + "r": "00ba78ce6f6699a2ef114d2d24e8c8ded95fb03a3ae62a5877ea8f9a8c34db8f65", + "s": "00ea3357f1f6ce96b1ed4bb075b55ddcd37d87bf952829e648d9ef8d7ee672cf56", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 154, + "publicKeyUncompressed": "04d1b2397cdc993c68aed00e37c65606a52695b0d16aa4fada058a3c06b45d10eb424f0087f4037cf53a56058472f61e1963cd25d0d1e56aaefd740447695fe846", + "publicKeyCompressed": "02d1b2397cdc993c68aed00e37c65606a52695b0d16aa4fada058a3c06b45d10eb", + "msg": "68656c6c6f", + "sig": { + "r": "4eb1138f020b7f4cd906e48d3069ce87784a45a12298e30a6a3052c311da333e", + "s": "5352d4a98d46cc1174eb1c661b2c38d7c4a9b47903a28180c3e99e43ca2265b5", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 155, + "publicKeyUncompressed": "04d7069063eb744bbf7bc2c329311ef038520ab5ad5664ec21bfde2c70aafbd26ac499e8b8ab66c9e9143c5557d1184a0604439ee4bf4e001a6a0ce43e0f2c7657", + "publicKeyCompressed": "03d7069063eb744bbf7bc2c329311ef038520ab5ad5664ec21bfde2c70aafbd26a", + "msg": "68656c6c6f", + "sig": { + "r": "0083012d22f551497e1206269456da6051ef7e675e6408d0bafac2181037d005a4", + "s": "2cd7b9e13f339f5b4228ebf5734ada006a10f2c40892db0b9a15adcabbd08d30", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 156, + "publicKeyUncompressed": "04ef9fb4a759f8c37665461424487b10270416d1cf88af3cfd1a573fd82379539b9c058db2bb29298443c69594c505d545b24505ac019228123467f3c0cbc62996", + "publicKeyCompressed": "02ef9fb4a759f8c37665461424487b10270416d1cf88af3cfd1a573fd82379539b", + "msg": "68656c6c6f", + "sig": { + "r": "66364f70826d992fdd4014032cbca8fbd03a0154980b139c5be34f02416164a4", + "s": "00d7377563323bafc64b1a53f769e2a9d6c311961ae98a65bd1db4d9158e60e504", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 157, + "publicKeyUncompressed": "04f3575237ec27a7505c59fcf12cc58ab6c7d20d2cc531c4531cbda57fac59673fd0e20a8aa72703276b155d6a01915e65fbb280fbe95a43ed9fe98baf7750dd17", + "publicKeyCompressed": "03f3575237ec27a7505c59fcf12cc58ab6c7d20d2cc531c4531cbda57fac59673f", + "msg": "68656c6c6f", + "sig": { + "r": "00df50e22016f8c3e11172bed7ea7a782ad015c47081ca93ebb98d166f89c30455", + "s": "51d1e5a795bfcd06ea9098d57f35cde2dc9850b1d136dfdec8f3d128873478ce", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 158, + "publicKeyUncompressed": "046c4d2770c47005f8042af9f12c5d9367a7577c247a9a2ca39ae652137b3cd263df2e48f3c2a6fdbd4a960dda7a3626a08c9b687143421f626d2b54f947641689", + "publicKeyCompressed": "036c4d2770c47005f8042af9f12c5d9367a7577c247a9a2ca39ae652137b3cd263", + "msg": "68656c6c6f", + "sig": { + "r": "2e4dbf4e08a3373514f2f4de78bbd12698375300795e4c3a9b0d952bb655c34d", + "s": "008973caf392ea9e52da674645c0c4176e5fde2bf3e5403966024ccfcff81123af", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 159, + "publicKeyUncompressed": "0421471b4abb801647bb2a89d6e8042a508ff0607a0e12bd15550b071f86c49fda9207a470e06ec3a0d320c1b181ad29c930a2ad4f1f485bc6f65268093d6f8519", + "publicKeyCompressed": "0321471b4abb801647bb2a89d6e8042a508ff0607a0e12bd15550b071f86c49fda", + "msg": "68656c6c6f", + "sig": { + "r": "00d67868d3cccb21068a5abf195be028810dee7a57e1827e644c1952618da0441d", + "s": "009759dc002c5b5a05a489230e9504b9b95503e48828edce89501c1d42250a1294", + "id": 0 + }, + "comment": "R: s**2=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 160, + "publicKeyUncompressed": "04c70317a38122a00e91aefcd24a91368250557fdf9aa2ec7f18d45f6784c55113903b4a8756989900d58eb6545baf1e3755043f3cf081824f9db5bbcf98b7bf2e", + "publicKeyCompressed": "02c70317a38122a00e91aefcd24a91368250557fdf9aa2ec7f18d45f6784c55113", + "msg": "68656c6c6f", + "sig": { + "r": "5484cf29f94ebc6a2baafaf590fd4e35028b7c3c6fa12ec75a401ab805d51566", + "s": "00b8fe7bd442c4c01708d872b5c3749cd48113a7059bb2ec541849615eceb45f31", + "id": 0 + }, + "comment": "R: s**2=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 161, + "publicKeyUncompressed": "046896c44d5d813eab2a16db0cc085be21e67dc42bb8e3b35878164713e3dabb04395284dd96475d175bdb632b50ab60f1ce43aa748f9e87218c7e7e66a1b695c7", + "publicKeyCompressed": "036896c44d5d813eab2a16db0cc085be21e67dc42bb8e3b35878164713e3dabb04", + "msg": "68656c6c6f", + "sig": { + "r": "00d502c80239e6228f49fa45f113228949ef86096baedc52d459a692e46c8a9edb", + "s": "00c2e45b284fa9f9627595077e45fcfdff471a1ad41e4a71075832b91c0849bb63", + "id": 0 + }, + "comment": "R: s**2=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 162, + "publicKeyUncompressed": "0461a1a03c0a23cd66c69e3d9187129471e2a28e96ed037317b5689212e5a4c85c919e38cf9bc07fe2308c2af2dc83ce790c4bdeaa464d2cc57a89df2df0a46320", + "publicKeyCompressed": "0261a1a03c0a23cd66c69e3d9187129471e2a28e96ed037317b5689212e5a4c85c", + "msg": "68656c6c6f", + "sig": { + "r": "0085408cb788a55cf0372677d32edc10afe975808f72c8ccf8a6d29ff72741b33f", + "s": "074008928ce9517b683099828b83e84b03ec4e582f70cb5f9dc0fa9690d4976a", + "id": 0 + }, + "comment": "R: x3=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 163, + "publicKeyUncompressed": "04dbb689c797c091af16387a217f9054983af79d04816124ad299cda9684f3e0ad2a1c261128d04bbd382b8adb9dc9e3e2b287e89528c6379d83aef279ff28f146", + "publicKeyCompressed": "02dbb689c797c091af16387a217f9054983af79d04816124ad299cda9684f3e0ad", + "msg": "68656c6c6f", + "sig": { + "r": "5d5855edf773b1078e4df05f207ea98208669219fe8b10dc715e5a189ff6879d", + "s": "008b4c06b206d81f4851a64cdf628c40b0ce1832e9f53fd336abc76e270700bb3b", + "id": 0 + }, + "comment": "R: x3=-2 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 164, + "publicKeyUncompressed": "04c196e57d6a5b67dd3a05ed0eecac8fdb9f31e0ed0ffb0573fecf3c08ffdf76705c5c05bb052f39d900bc8cb35d7206f8babc30c17cbf1afb6d3e25d16f2aebd2", + "publicKeyCompressed": "02c196e57d6a5b67dd3a05ed0eecac8fdb9f31e0ed0ffb0573fecf3c08ffdf7670", + "msg": "68656c6c6f", + "sig": { + "r": "00ac2c4c0f43253848c3967ae4829f3a9ef1641f2cdd3985e5e3fd6a1b966cc526", + "s": "48bdef44b24465bbfb286c4b770eab32f9443ed1f3de2ae9c1f5c529147b9189", + "id": 0 + }, + "comment": "R: x3=2 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 165, + "publicKeyUncompressed": "04e3c8b43c911094b7e68f5a22917725a90b13ab2250960650332ed23a888b6c519c058a7e312a52b2822a993008fb75886e4ad67613176bba1ec398ad3deafcf9", + "publicKeyCompressed": "03e3c8b43c911094b7e68f5a22917725a90b13ab2250960650332ed23a888b6c51", + "msg": "68656c6c6f", + "sig": { + "r": "00aa319e26e2e06a58151519210faab6833523fe9ab5cbc61e63867a4d08d9948f", + "s": "28397ac924ab1352ca834605cd243200879f792cbe15f24c8c3b3e347bccbf7c", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 166, + "publicKeyUncompressed": "0441ce39e29625f0fbe6b5599c3645adc4fbb9e48b4e823c6f331a1260da8fb2ecaded1e4381ef7f02d52d8c9810b151196b27bae5d7e8581b1562f6707bfe7440", + "publicKeyCompressed": "0241ce39e29625f0fbe6b5599c3645adc4fbb9e48b4e823c6f331a1260da8fb2ec", + "msg": "68656c6c6f", + "sig": { + "r": "00f53995a19dba354482341320dbd4c86b77f90491b451f6085d7af793f643f53f", + "s": "00c305e46918e69f0902bbdbce246cea076d43b3c1900506907d71124f5fa346b1", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 167, + "publicKeyUncompressed": "04961c331857524212bf175f30dce4a43c884148b02ca0c30737cdde04c8644a0f9b92992caff79ab77094425456b736648bf5eb1f56737095728269bffffe7d04", + "publicKeyCompressed": "02961c331857524212bf175f30dce4a43c884148b02ca0c30737cdde04c8644a0f", + "msg": "68656c6c6f", + "sig": { + "r": "6094cc377f65606368b6d3be1480811152e2fcd395e243d93efe8e1d00e26e90", + "s": "00e0eb7385b7500b0a50d934ddb49ae50f8dcf1acd9afe667fbc920726a4b8b27f", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 168, + "publicKeyUncompressed": "0437f5c03e501b8762f7c60cd164e3191ddf4fc499e9a8802da3460939e8a72785b04f60781483c1e06454046aa32093b9f74a6f7b1f3da76425f36af7832001d2", + "publicKeyCompressed": "0237f5c03e501b8762f7c60cd164e3191ddf4fc499e9a8802da3460939e8a72785", + "msg": "68656c6c6f", + "sig": { + "r": "52e2d4bb76b61eada781352e010f71773a1f0a896c59aa7d76806ccfffe711b3", + "s": "1edcaefcc85e8bfac446bd108f5855e5696fd17337b75f479ac798c1fa159efc", + "id": 0 + }, + "comment": "R: u=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 169, + "publicKeyUncompressed": "040e0472a951a962a19b5073252f9c6e3afd6bb038ab3964b1bdbda1200af6df68949cf5f819fcddf2069629e5edf55cdc7c7f4212b807d46f204609aeea511c1e", + "publicKeyCompressed": "020e0472a951a962a19b5073252f9c6e3afd6bb038ab3964b1bdbda1200af6df68", + "msg": "68656c6c6f", + "sig": { + "r": "00d0e7adc9576c09f56523e65caf86ba40a8742e3c650ce02edae474177a37ec85", + "s": "4c6362ea30b3485b1330123419107363637e0b547309b8f18a4cf30be6acb896", + "id": 0 + }, + "comment": "R: u=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 170, + "publicKeyUncompressed": "04d45a9cee63667ec7fc9b6f43715f8e7566e06f909396c66ea452c2b86307a5bf248503ebf4cead6009309e73b07e2b74c2cac567fd9913c8634f3a25bd6a6e27", + "publicKeyCompressed": "03d45a9cee63667ec7fc9b6f43715f8e7566e06f909396c66ea452c2b86307a5bf", + "msg": "68656c6c6f", + "sig": { + "r": "00dc357d7b31ddd75cf35ae4754f69d4481d6cc73a2e997553ae9b1f1685e0fa26", + "s": "60eac0d0fbcfe91046a1876cfdc337cffb158e0d8f0fa6e7e1576d4fcf301fd9", + "id": 0 + }, + "comment": "R: u=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 171, + "publicKeyUncompressed": "04ca1d63d81177bb9e7a0b5c306ff339122dfb8d452500f61f7cd3ee075f03f55b4600fe9ce5bca95f678618c8d3cac676c5a0559a31615846d905ee6392de1a0e", + "publicKeyCompressed": "02ca1d63d81177bb9e7a0b5c306ff339122dfb8d452500f61f7cd3ee075f03f55b", + "msg": "68656c6c6f", + "sig": { + "r": "00f806874a1656c3820225872fb35ceb8d83369c49af89b7b44449968e54171e3a", + "s": "00acef2f692ac93dcbc75e11a6db04ead23d9892cbc99e7ba794da48fd6f91cda7", + "id": 0 + }, + "comment": "R: v**2=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 172, + "publicKeyUncompressed": "047168e24e434b5151ed786fae8f9cc2bd7a7f6341d56bb2c9331c743123f8c6e2b3967ea667b2172966aff0f84ecce3d3be50c74ce6531867769cd07e1b6f90ea", + "publicKeyCompressed": "027168e24e434b5151ed786fae8f9cc2bd7a7f6341d56bb2c9331c743123f8c6e2", + "msg": "68656c6c6f", + "sig": { + "r": "00a6d57d3e60ea1e3df4cfa62d013c50ca3661f6844d10218e99270eb94214b5f2", + "s": "299e4876a34592bd9cff84514ee9ae621ed4d55ae00b25f4b5599a64cfedbbb3", + "id": 0 + }, + "comment": "R: v**2=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 173, + "publicKeyUncompressed": "0440f748a61b8b122911df369ecc0e94a8f75af4c2ec7fca5caf550b2e50761c23e6f155690495a988778e708ea7791827ebcedb2de7076bb604fccde64dc53fbf", + "publicKeyCompressed": "0340f748a61b8b122911df369ecc0e94a8f75af4c2ec7fca5caf550b2e50761c23", + "msg": "68656c6c6f", + "sig": { + "r": "3831ea2c3eb8e320a641a33eef9c751e3a9fc42d69bfc6ff0b5eddc321986cec", + "s": "00e9e755aecedfed76b53124ba758813b5807f6802500e8e41a82967865d8d7822", + "id": 0 + }, + "comment": "R: v**2=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 174, + "publicKeyUncompressed": "0463d162907505542e505110a4e82fd962a442b7d902ffb762dea762ad7d9e10cbd765a606a3d77f0505eeab593349ce124cafe68ce45069e3a9823ec5bb8c3c0e", + "publicKeyCompressed": "0263d162907505542e505110a4e82fd962a442b7d902ffb762dea762ad7d9e10cb", + "msg": "68656c6c6f", + "sig": { + "r": "00cfb0f361195ceae1012d6019de0cdd6fde17cc3aae7ae3c71b7b265223aa0f3f", + "s": "00ce4aa0d6a443e765348dd483f3944352015406700338fb2dcf4e5da11bca016f", + "id": 0 + }, + "comment": "R: v**2=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 175, + "publicKeyUncompressed": "04d5510b619a2a3d69bf922013b2f81fb4f9013fbc9aec027d6404a041914f44b74d8c92ff9eff3f866a34504d889f84c3bf7ac44e0b7dd9e88555bf34f55c140d", + "publicKeyCompressed": "03d5510b619a2a3d69bf922013b2f81fb4f9013fbc9aec027d6404a041914f44b7", + "msg": "68656c6c6f", + "sig": { + "r": "00e339cf4216310345db53610fcf669fd581c32fadad7f4e0f9f4dfcffd0e6d50e", + "s": "0086a6690b50d33dc3ba8fe4a6f7ef80da8ca733a8b1f0c7f62ea7128324fae131", + "id": 0 + }, + "comment": "R: v**2=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 176, + "publicKeyUncompressed": "04c2b2604092bd27fff3a8e0296aa9a577e5d0cf88a7d32ac4da2e5be1b081eeabe64dbb2879a0afb58e168d3dd76a49e3ad1bf8a55460a7d0145bf97f3c95f95a", + "publicKeyCompressed": "02c2b2604092bd27fff3a8e0296aa9a577e5d0cf88a7d32ac4da2e5be1b081eeab", + "msg": "68656c6c6f", + "sig": { + "r": "4d9aa20dbcd8720481cfdd672d411277e76f1a138fde8466b1f5bcea9509f0c9", + "s": "4e56463791c98456b9c20b47291fa65d664c10a98631629f9017e10cb8fef672", + "id": 0 + }, + "comment": "R: y2=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 177, + "publicKeyUncompressed": "0457b7dcb9d0ffe12bf5844a79f6d988664e4f80798d9d45415ef491f9981a121887d168b51e34dd7d7ce6643e2c198760bbf608865aaf2ad98380efd5dac91d43", + "publicKeyCompressed": "0357b7dcb9d0ffe12bf5844a79f6d988664e4f80798d9d45415ef491f9981a1218", + "msg": "68656c6c6f", + "sig": { + "r": "00fc20d7de00e7434edce5bf642adc44b5262138b3e62698179e003a80b733771d", + "s": "26bb96f94db18ec0b3e7911f8a6c82af063f8ceceba1d906d016824d704edce5", + "id": 0 + }, + "comment": "R: y2=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 178, + "publicKeyUncompressed": "047b40113c11436f7dbf78625edee824eb80ae37346be85a8cea6aa92c5f87c1d46266035924d38b8d714f56cfb06cbc7558b86e88d559f73f68aabc9fb14cc67d", + "publicKeyCompressed": "037b40113c11436f7dbf78625edee824eb80ae37346be85a8cea6aa92c5f87c1d4", + "msg": "68656c6c6f", + "sig": { + "r": "00b644861442404aaca14a6334a7e2a8d2f26fad3889fae381b00a0892b3c29078", + "s": "008b4c23a2cc31c3338a65b0bc46d2b4e8f15287a3152019697759f51ec421dc7c", + "id": 0 + }, + "comment": "R: y2=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 179, + "publicKeyUncompressed": "04962157c25935322d7bccaf4b483575822dfe227ae27ac9e0330162172cc148ba5bc583fef4b714a5718a28c770033d98598dff2f4b39e898471df1bb1727e576", + "publicKeyCompressed": "02962157c25935322d7bccaf4b483575822dfe227ae27ac9e0330162172cc148ba", + "msg": "68656c6c6f", + "sig": { + "r": "2cd8fded031c3fa851b9615519946e2e3c3af9dfbe98af6eb8411e325f2ba548", + "s": "0098fdd24f28b2d2ad81648efd7c09d4d20cde9c580cdd2e4fa069b3d125a32f30", + "id": 0 + }, + "comment": "R: w=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 180, + "publicKeyUncompressed": "04614ce24a07d3410433cd0f4771aa1cd269b1561a6b8a808b6df95396fb1ebd88e17894c3eaf34a1acfb456d1b10f288bf40dfadc0292e4bf8d283f233e5b3f9b", + "publicKeyCompressed": "03614ce24a07d3410433cd0f4771aa1cd269b1561a6b8a808b6df95396fb1ebd88", + "msg": "68656c6c6f", + "sig": { + "r": "0080f8aa5c3924d5408c1429fff22e12864c0ac7fc8485bb13c798d3a83aea3a86", + "s": "062c47eb39654c9dbb0a05ef656d34290a7e51ca67d66eb8049748f53d20ee75", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 181, + "publicKeyUncompressed": "0425610bed648fae745e2acadb1acef2c66751146bcc7ba2aec5b54bf89311da41040057b2d2561dd7f9f71a3a97e59bb9d8383c392ca8c5891a90493edd53b8b7", + "publicKeyCompressed": "0325610bed648fae745e2acadb1acef2c66751146bcc7ba2aec5b54bf89311da41", + "msg": "68656c6c6f", + "sig": { + "r": "6d5f358f6583ffb7ae3d92b49e93db79c54d78f1171e3d4b7f8964db757d17fa", + "s": "00b7053f1134d2560a3cf844cfa86138ca8358b7181c4fdee16038030a99e6a191", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 182, + "publicKeyUncompressed": "0422784362cb1c8ef7f83961f01d49e643a57d25ea3e9921168148c3aa017ced549e098d192881e52626251d2c2cd98fec56e39a63d07dd9a1244a681709374be7", + "publicKeyCompressed": "0322784362cb1c8ef7f83961f01d49e643a57d25ea3e9921168148c3aa017ced54", + "msg": "68656c6c6f", + "sig": { + "r": "00998e160d64594d72239a198007febac886621250f1e46fb2b302991002c9dc85", + "s": "00f223829c7a0ebdf6e1abd4a3273de19006e7d8374dddee248c80a372c45bc37d", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 183, + "publicKeyUncompressed": "04adccb6b7b5523ec35e236606d2529003c560c172ad591551b07a3337bbcfeb4701c5cd864c012180d45f5866078138575dee18d60408b5587c96400bb2673a25", + "publicKeyCompressed": "03adccb6b7b5523ec35e236606d2529003c560c172ad591551b07a3337bbcfeb47", + "msg": "68656c6c6f", + "sig": { + "r": "48ffde16773b462acfb2af7b2a62f2cebc093eaf8a69591ca4227d25259c5136", + "s": "00840b96db1ad6f783ff2276be88a38d17a068ee5ab032beb7d5af2fe02a2ecae7", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 184, + "publicKeyUncompressed": "04dbfaf3388fb7cf97ebc64c35f6b94ef4e026b6f6823a568c530d91bfc378072baca0457d1255fded582cc6c566c99a347bba535a15696abc12256cb665bd9100", + "publicKeyCompressed": "02dbfaf3388fb7cf97ebc64c35f6b94ef4e026b6f6823a568c530d91bfc378072b", + "msg": "68656c6c6f", + "sig": { + "r": "50c12ca1174712690062544755cd56b3222bbd9ea375ffd3d36cd840d88cd6d7", + "s": "6058c31623b49be93a2668a8bb71a0f5564a0bddb678af7119db0ba78fc25aab", + "id": 0 + }, + "comment": "R: b=-3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 185, + "publicKeyUncompressed": "04f08b7ec6abdb8278fbf0220198b1f8cde061b791397915d73b1fa192786d291f745988a0aa41022297f4e535785f20168024610cae1699d5601e425b82ad3dd1", + "publicKeyCompressed": "03f08b7ec6abdb8278fbf0220198b1f8cde061b791397915d73b1fa192786d291f", + "msg": "68656c6c6f", + "sig": { + "r": "00fa2ab59de0ace71417e1312bc305feb4dc9870554ff7e4d831efa81653ee372f", + "s": "00e4b73648c009a0a03d050aba74085d919ca7137b2f222e66504018275a4168d3", + "id": 0 + }, + "comment": "R: b=-3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 186, + "publicKeyUncompressed": "0479772f39d4c0d70162496d7336cdc97f2119b2087b8076f3c4d24cb0a8a83b95d6cf1e4f2768e27fcc2253dce70bd47347148650f4b71fc48ad3f7797c4090ac", + "publicKeyCompressed": "0279772f39d4c0d70162496d7336cdc97f2119b2087b8076f3c4d24cb0a8a83b95", + "msg": "68656c6c6f", + "sig": { + "r": "00efb7bafaea260e320e3bf1362e0740d2e5b05ddf0028cfcb6f3a7fde5b892711", + "s": "00dced5f080b9c7c40e7c235fc8cb170b62cb2493609352e9cb4946e001f4218f3", + "id": 0 + }, + "comment": "R: b=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 187, + "publicKeyUncompressed": "048699c7a582e3bcadc6f4a587b0effaa4813443111195c0bde46d34c5d50ff39803cd5b05f2da334341a3eebed8511accf414425de8e7bff11f0e0ee88f8c323b", + "publicKeyCompressed": "038699c7a582e3bcadc6f4a587b0effaa4813443111195c0bde46d34c5d50ff398", + "msg": "68656c6c6f", + "sig": { + "r": "5fc7a26931c3e9df34a77cc50d004f23bc2e0fc8919c1f68089c4b09684de9f4", + "s": "70d7a27b3e358566db974c2012c29cde1568e82221215daa9ba022358a360bed", + "id": 0 + }, + "comment": "R: b=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 188, + "publicKeyUncompressed": "044ebb395fe6242953490d509750be0ff1c64eeabed5eaf2b6291b1ac63411b41cfc6756c5ea57765f24a909a3fdccac4f533549aae804a6d93c4b0ffa989b8d62", + "publicKeyCompressed": "024ebb395fe6242953490d509750be0ff1c64eeabed5eaf2b6291b1ac63411b41c", + "msg": "68656c6c6f", + "sig": { + "r": "00fc927b3edb46e16592d765bd3ee5cf0432566717ab050d91b562dcb61d3f4c59", + "s": "008302ab7adc26c93ec66d72da61a1e128e8b515c349ed3ee4b860c6ef51a2cfcb", + "id": 0 + }, + "comment": "R: h=-3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 189, + "publicKeyUncompressed": "0419738140e454928b105d5f8974239e7be3bf32b1373f859b98c42f21e8f64469468b4e6171be1dad8afe7f6612f7142272b779f8bc04c000ed671cc55092ee10", + "publicKeyCompressed": "0219738140e454928b105d5f8974239e7be3bf32b1373f859b98c42f21e8f64469", + "msg": "68656c6c6f", + "sig": { + "r": "079f55086844c6d028f5a64df87e41cfb835f339f50385a1e80633d51de8d41c", + "s": "00956a992b3f7f3c39151d4d95456d66247ec6bbf1e214e0e2a1763093a11cdadd", + "id": 0 + }, + "comment": "R: h=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 190, + "publicKeyUncompressed": "0425c8f72cc342417c2160ad8a8ecaae862146237ee59c0c28ae630096a5b9ea7762f256197b4c5c7e0d3c91c1daef5f022386cad26497497cf683a10671f7c310", + "publicKeyCompressed": "0225c8f72cc342417c2160ad8a8ecaae862146237ee59c0c28ae630096a5b9ea77", + "msg": "68656c6c6f", + "sig": { + "r": "00ca3b5f98617c55b0458f98e78422ccbc647b60efcf1fd41487f272c65c68ca27", + "s": "00fd3f9ca1dfaac0d3f7f4907c5c3d01f12d57060dd8889bcbe2d64426b10ba1dc", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 191, + "publicKeyUncompressed": "0432173ede124f234c571f54fa608af48135696030cd73524e01e300bd08a02070a70564403b1bdbb19ade5d2204ae6662c915b97cf32660718b17f9ee5b63b07d", + "publicKeyCompressed": "0332173ede124f234c571f54fa608af48135696030cd73524e01e300bd08a02070", + "msg": "68656c6c6f", + "sig": { + "r": "3b564da6ade39539341c3431a2f723c2919deada8f7adae407860fba968db5c4", + "s": "00f1935a54377bd6f3ec265e935763fa97e30c3cb0197fdd8ec99e1a3a86dfabcc", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 192, + "publicKeyUncompressed": "04750f50c46834ec9d8af9cfaf620e61209466c9e74cdfafafb126eea86607e761f0d714f50fd8d9dfeb968fa33d4aebcb11830b434d6c22919825dc9e2cf1b9fd", + "publicKeyCompressed": "03750f50c46834ec9d8af9cfaf620e61209466c9e74cdfafafb126eea86607e761", + "msg": "68656c6c6f", + "sig": { + "r": "00fa6e52c0f0a01516865432e6d8e60f8109e6b435a165510770877d7d0d097873", + "s": "118b09dd94863e8313f45e1346bde16b0829bf6244337bf0eae658a485baa36c", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 193, + "publicKeyUncompressed": "044113ad55eeb0c908eef8f74c1d3c1f2bab39d1f411b3df34611b4863b041fd7d7c495daa948f4b3cb4b2c1c616936caf4120de838f914c0237de448481b8facc", + "publicKeyCompressed": "024113ad55eeb0c908eef8f74c1d3c1f2bab39d1f411b3df34611b4863b041fd7d", + "msg": "68656c6c6f", + "sig": { + "r": "00d7fc85fca243acca7d5a48419de09f7bbe56518ce57aff346faf4629dc7aafcd", + "s": "300945315ff01021b417edc088fdb868236dcfc9be533c6adef8c56e02c6c499", + "id": 0 + }, + "comment": "R: s**2=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 194, + "publicKeyUncompressed": "04f5b508126760e40efca7cee2f739d72ef395558368904f803ab9585ae33c09d357659b96f2f762f31b73dab7e0a351f751ddb3329b83fe75c0506741db4b20b8", + "publicKeyCompressed": "02f5b508126760e40efca7cee2f739d72ef395558368904f803ab9585ae33c09d3", + "msg": "68656c6c6f", + "sig": { + "r": "009c923bf090cf99af3b6b1fad6215097fa711c7a5b006f4a4879d223acde2302c", + "s": "336c66d1bb56db9ef3661c10ac9fab3708d1ba6e15427746b6d91b0757e37d20", + "id": 0 + }, + "comment": "R: s**2=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 195, + "publicKeyUncompressed": "048bbf8b86aaa4b951fae2f949524dc140775013d807feb0545af16d2752819822e620790a8ae60f5ab3923277e51e85e1a147301c0987498dd633addf8719fcc3", + "publicKeyCompressed": "038bbf8b86aaa4b951fae2f949524dc140775013d807feb0545af16d2752819822", + "msg": "68656c6c6f", + "sig": { + "r": "008b713e12ccecb986473a9811000a57049a97e6cd6a7e0c2708b3979955a31865", + "s": "009ce854d09065ea8a50914351c4c17a56319e9b01b35da15e41b6780392c56e1a", + "id": 0 + }, + "comment": "R: s**2=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 196, + "publicKeyUncompressed": "04d47162d9f7484f6b5e48381b3594cb02c920d1b1aa5c23943b37e6b078847f0cb03c98f0288d7dd929b2da1d9d63bc631bdc82b94ff304a011d6b8fd6f159219", + "publicKeyCompressed": "03d47162d9f7484f6b5e48381b3594cb02c920d1b1aa5c23943b37e6b078847f0c", + "msg": "68656c6c6f", + "sig": { + "r": "721e26b036e3d93466af8261d5be42c22c6ffe53fcd81421aa9c9aab94adc1d0", + "s": "2aa7308282053e7f0d578e49a4d27364871a50fcb1172b2c0a0b43fc8674ff0e", + "id": 0 + }, + "comment": "R: x3=3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 197, + "publicKeyUncompressed": "04ae0241edaff529afe6eafa7075e63e92e333bb3005308842b14c1bd29026a27f6e0b5fb491b1a44cb75d9cfb5d6d2b51c90689d36cbb34102d62c77bde82887a", + "publicKeyCompressed": "02ae0241edaff529afe6eafa7075e63e92e333bb3005308842b14c1bd29026a27f", + "msg": "68656c6c6f", + "sig": { + "r": "670a7f78b37bddda2fbc2f4c2b0ada5086c01c165756f938a1404930b8191429", + "s": "0095858e5ef5fc0994bf5890399cc3e0c9674486e7193eb2b2d79273426e4a3972", + "id": 0 + }, + "comment": "R: x3=3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 198, + "publicKeyUncompressed": "04b4c33d9a0c183eab02c71fd9428af8d058a52fb2388c5fcb79109922d4950f760227c6f847878643772475521d155cc9cf135e96779e11cab6c3bc3377a30908", + "publicKeyCompressed": "02b4c33d9a0c183eab02c71fd9428af8d058a52fb2388c5fcb79109922d4950f76", + "msg": "68656c6c6f", + "sig": { + "r": "00a072fd4cb6f2968ca031ff41a2684e7c85f8931bee2a91933e74ef261f42fbf2", + "s": "7da493074de510d855a800657fcf9b4bbc39433edb03b684b3538c99d027c999", + "id": 0 + }, + "comment": "R: u1=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 199, + "publicKeyUncompressed": "04b987d18f9943eb48380652e8f0e1d96f40a0496dd0393546f9eac9fa543b823e9442c98234ee6b6e2b935ebc34d06faf83f33eaef000300b8f1070161fb901a4", + "publicKeyCompressed": "02b987d18f9943eb48380652e8f0e1d96f40a0496dd0393546f9eac9fa543b823e", + "msg": "68656c6c6f", + "sig": { + "r": "2593cb11ee4201c6d35c584fbaf1af07726c0738329509ccc30104c1dce3e572", + "s": "00b57a51452c1a639ade8b1d80fc977e9d40851c95c40e7793d3148e0d6de1a2c5", + "id": 0 + }, + "comment": "R: u1=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 200, + "publicKeyUncompressed": "04a60784c1cc47ef11b1b884c947af3b6ffbb72d50cf791a87ad73bb12a5a7b949607f9f9a0136a409b5b9ce9ab1cc4ad83475de75ff44d62ecf3ddfe3cea99e9e", + "publicKeyCompressed": "02a60784c1cc47ef11b1b884c947af3b6ffbb72d50cf791a87ad73bb12a5a7b949", + "msg": "68656c6c6f", + "sig": { + "r": "39f937a15acb67ac8c71a86ea2a6027c079b65abdf40649ffe8a0c1703d91acb", + "s": "00dee5bccee2ec6caef0ca24cc8a7a877d5d90216a0c2a17621d4253d98c73a6df", + "id": 0 + }, + "comment": "R: u1=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 201, + "publicKeyUncompressed": "04107d3bd2467da2d33edab98c1e92d719b7ff7dad10a52ef8aedced9c66eee7e5b17d4dc30714826537a1a2c32163537931ef642355d28b0b97851ee779b0237b", + "publicKeyCompressed": "03107d3bd2467da2d33edab98c1e92d719b7ff7dad10a52ef8aedced9c66eee7e5", + "msg": "68656c6c6f", + "sig": { + "r": "4fd4444b3fe68887b54e541aaa0952b7dd79d4b37380085583ee4f0d21e3372f", + "s": "00c9ea71fd414ac2ea18413aff640500a0d255e23347f4311d934b9b6e5e64f01f", + "id": 0 + }, + "comment": "R: v**2=-3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 202, + "publicKeyUncompressed": "04afc27c8b3e5cdefa2dff51937ac944dcb16a860d97196a63b1d4f8bd6556d750e807212702256040a53981074eaf8c0c5245d98484a170b2c98a2259965a42a5", + "publicKeyCompressed": "03afc27c8b3e5cdefa2dff51937ac944dcb16a860d97196a63b1d4f8bd6556d750", + "msg": "68656c6c6f", + "sig": { + "r": "03c90857c5e116eaad3933995ca8388c2e6cb176e034291d9afa910d5133692d", + "s": "09bda51ec7d7152b22c813672c2ba2cb8a724bf184bc0980f8da59874c0d96ea", + "id": 0 + }, + "comment": "R: v**2=-3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 203, + "publicKeyUncompressed": "043e524eb79a9f3cd200b7d7eb3b814db6a856f274853917a473918a4dfc42ecbf63b3c9b47a6db7cdc219c5c8a31a230d734909199d3d844c5e69ca6b2d167840", + "publicKeyCompressed": "023e524eb79a9f3cd200b7d7eb3b814db6a856f274853917a473918a4dfc42ecbf", + "msg": "68656c6c6f", + "sig": { + "r": "009a32789cce6ea4fc1550b13bd41c4cc26425e7198e95c8a164a6e9d1bd9d9bc8", + "s": "165560e1859bbdd3304ffbf4485e3c392325e4ace525c9fd0c761b4b835c9e38", + "id": 0 + }, + "comment": "R: y2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 204, + "publicKeyUncompressed": "047a73caf0f907db005b55d795e1c8e6753070c3db8ad83181711737f642983b5b5388074ade36d87103d1742f6628df6f4b59f6a9c49919c026fa736a96476243", + "publicKeyCompressed": "037a73caf0f907db005b55d795e1c8e6753070c3db8ad83181711737f642983b5b", + "msg": "68656c6c6f", + "sig": { + "r": "7e2bcd47d28c6fb2fae14a0a337808cc1b7017d855b376b76dea0428643bab65", + "s": "032163b9e4f302d6ba5c11818d5cec16cf45d847dfe557dd67bdf9d4f17c535d", + "id": 0 + }, + "comment": "R: y2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 205, + "publicKeyUncompressed": "04b43f01e7d65291e96db90cf298c8d01bd9f258628f42896ae10affee625d0cff144f8fc13197cbc6af155fc74080f25902763ab2730e8b4519f786ee5b7a819b", + "publicKeyCompressed": "03b43f01e7d65291e96db90cf298c8d01bd9f258628f42896ae10affee625d0cff", + "msg": "68656c6c6f", + "sig": { + "r": "00e7a1ba1b5f04eb50efce04b9f86baa71806a010e1bb6c0a72d6f1203de26b131", + "s": "00955df9794b28ae62d404f91b811c924f423c764d7398e402b166a21518562443", + "id": 0 + }, + "comment": "R: y2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 206, + "publicKeyUncompressed": "0453f2931502bdd05f6a0503e9b65e972bf5f7c1b972bfee9d23d4bef3c846084540539ba8b48fbd7c47a39fac7f9e2f41347d81d90dabbdee865097b8c4e7b8a6", + "publicKeyCompressed": "0253f2931502bdd05f6a0503e9b65e972bf5f7c1b972bfee9d23d4bef3c8460845", + "msg": "68656c6c6f", + "sig": { + "r": "00a0407e2bac9a2216a6a6191cda91ccad48488ca65f795554864d929abe6f36cd", + "s": "00f54422ffd1f33edc82ee7003cb37766740a497467277df2d3e325110ba7e846c", + "id": 0 + }, + "comment": "R: y2=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 207, + "publicKeyUncompressed": "043a5d1b8996eb5a47d58124ac2054fa2e39fef0a89dd2b14104a0db76b50649547c5b4086f3c6e0faccc6812a72c686fba033332312521494f32ae5778e44339c", + "publicKeyCompressed": "023a5d1b8996eb5a47d58124ac2054fa2e39fef0a89dd2b14104a0db76b5064954", + "msg": "68656c6c6f", + "sig": { + "r": "00f34cfbabf24531eaae5c0d025d0d7eeba6b838e34829b17ef472cc7c5e5f65ca", + "s": "36a30d8e18828ed2674cbcf2db475457074c9e8ef94bde9ea2939202f9d0919d", + "id": 0 + }, + "comment": "R: y2=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 208, + "publicKeyUncompressed": "045faa35346e441b414aa01d373683b5da44bb453964596c6128002cf3b09b3f486bcd2e114b7cbf5eba61c056e610ed944e718e7b3a4037bb20c12bf7e653325e", + "publicKeyCompressed": "025faa35346e441b414aa01d373683b5da44bb453964596c6128002cf3b09b3f48", + "msg": "68656c6c6f", + "sig": { + "r": "6c7286286120abfeaafdd9e0c860b46710ff3a76585cf92c853fa0e6e3315bc7", + "s": "0082ed8d86cb41a15dd475d99ab058efdfa765da537c28e84d04a732aea9164110", + "id": 0 + }, + "comment": "R: y2=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 209, + "publicKeyUncompressed": "045e97d9bf51728f46c76c12a895cd3b77f0089270ffb5906ba23498e58f2f5ece618edb72fa7f604edd4ad258fdb5ccdbfbb0727da3bf23ba5daff7499eaf1212", + "publicKeyCompressed": "025e97d9bf51728f46c76c12a895cd3b77f0089270ffb5906ba23498e58f2f5ece", + "msg": "68656c6c6f", + "sig": { + "r": "00ea7c672f008d17448d3926688a2dedfb6306f6589090e2b51022f5d380b3960f", + "s": "00b53cc500100e60174e30aafc5b13f0c59bd8fc710d540944621a21046207586d", + "id": 0 + }, + "comment": "R: y2=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 210, + "publicKeyUncompressed": "045c1dcc0e18d7f734f4af3b9da83819130d5a4c8772da2981fd6475819fd9e7119f8d8abd2d8fb7cbd08fb893df1f47f9792c945e4330d47d4acd1860f04955ff", + "publicKeyCompressed": "035c1dcc0e18d7f734f4af3b9da83819130d5a4c8772da2981fd6475819fd9e711", + "msg": "68656c6c6f", + "sig": { + "r": "009eaf88dd46d1a13159eb0ac581971c9c1a2670db5b12a7d515aec2a38bcf78b7", + "s": "00dc4b7f0d2cdabbda9706a9c888a1fd6130fc4d1b518ec1c49d2f952447e1f85a", + "id": 0 + }, + "comment": "R: y2=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 211, + "publicKeyUncompressed": "04b31234b16ee1c3131f2ea64409bbcb1f80fbb0a383cad47dfcf677c2c370e9aad3f287b309ff3319b845d99d5fbbb6258af951152ef80d6e6862eab783bdfa6d", + "publicKeyCompressed": "03b31234b16ee1c3131f2ea64409bbcb1f80fbb0a383cad47dfcf677c2c370e9aa", + "msg": "68656c6c6f", + "sig": { + "r": "76d40ff3b8a1478a18dbced1f43af56882d298cc145c7575da2e4786f37ce998", + "s": "1d4c7a0778ce531ad979b1cc7321cc772281c69c8909db0fe6235f99b37c0652", + "id": 0 + }, + "comment": "R: y2=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 212, + "publicKeyUncompressed": "04e3a6daafd6471f7e33caf3ebd54e3e730b1f85d45ef6432f61d6db9d0cef0b29c3471364204d88f56989ae4cbb52b4fc9fedf178c6d23d34ea3ea2b20fe4e232", + "publicKeyCompressed": "02e3a6daafd6471f7e33caf3ebd54e3e730b1f85d45ef6432f61d6db9d0cef0b29", + "msg": "68656c6c6f", + "sig": { + "r": "52b47af77cbe0358c26382cb5e7c6751d022df1a781d16bb0a7a1ac755ec16aa", + "s": "00fb33e02ce079638a4938c27e446b9237df329cc9c2f58b2bc23ebf7ed1d3e5d3", + "id": 0 + }, + "comment": "R: w=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 213, + "publicKeyUncompressed": "04ceba3f5a0972fa49b022fe0d977ab0fd2cc1a2ed1dc81f138866a10a6fb485b785e031c08cafef75dceee61ddbe1b9d3fc39e7fff979bef303b7b392c95405e4", + "publicKeyCompressed": "02ceba3f5a0972fa49b022fe0d977ab0fd2cc1a2ed1dc81f138866a10a6fb485b7", + "msg": "68656c6c6f", + "sig": { + "r": "5c941ae565517a61b48805595d2bd351b1a8be7eadc160788b698e542147aff7", + "s": "0080d70b011a4c81a04b1a04e4ceb1826e454d8677ae718ce2c433f8d22cb9f619", + "id": 0 + }, + "comment": "R: w=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 214, + "publicKeyUncompressed": "047c3b7bb4655c14f972bdf776e73b5a4418866982b985cbfa394da2578e7a4ae72ddb1494dc749da198882e72fb582630446dc68493c363cd6f45a6d544fc6920", + "publicKeyCompressed": "027c3b7bb4655c14f972bdf776e73b5a4418866982b985cbfa394da2578e7a4ae7", + "msg": "68656c6c6f", + "sig": { + "r": "7810608dfaf1100cdcc2b3e3c3ab5ff554c50739f264bb22cbf78c015e853461", + "s": "008c8807b4e5143d7f7acdc0a2c801dbef2c55ab8e1279f685c8a3e8b00b670451", + "id": 0 + }, + "comment": "R: w=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 215, + "publicKeyUncompressed": "048c8cfcf68cccda1df5fa8de5dff5dcd70de9f6011dd1e1786222c5bfbd268468f6bdae51a92e416e6bf6b7f6ac92f8b2acf4f5fa9cde2b143d54eae64793e3a1", + "publicKeyCompressed": "038c8cfcf68cccda1df5fa8de5dff5dcd70de9f6011dd1e1786222c5bfbd268468", + "msg": "68656c6c6f", + "sig": { + "r": "6f2c48b03420102d51f6dd5702fd9b9416effbc17ab5c0befe973c9e8fc66c79", + "s": "0e6f35e1231d1eb89a0ae03fe76c760d01df88361d89eb69f9a950223189c31a", + "id": 0 + }, + "comment": "R: b=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 216, + "publicKeyUncompressed": "04d187849924051a7b4dd0c829ad80101825ed3a9013d7907da623c216bf256db208de2766a0780c7245cde473cd9352daa934a7f0dc2e3af1639dbf64b32378a5", + "publicKeyCompressed": "03d187849924051a7b4dd0c829ad80101825ed3a9013d7907da623c216bf256db2", + "msg": "68656c6c6f", + "sig": { + "r": "35bd5043357f08e3e34b18688ae2621dae2fef42dc67ff34f99b5c156135c59d", + "s": "5a69ef58a2a6dd8b72bb83b1f3a089c9ee12008fcbe2f55da88a2c1d2abd08a1", + "id": 0 + }, + "comment": "R: b=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 217, + "publicKeyUncompressed": "042fb905a9e9c1f2c4fda52e4964d17bb7c89eb134a66bbca83d6745438b2d0609b2bf1478b26d27569360867e29a00143e3b781100a30f6371657b5ef1c73a023", + "publicKeyCompressed": "032fb905a9e9c1f2c4fda52e4964d17bb7c89eb134a66bbca83d6745438b2d0609", + "msg": "68656c6c6f", + "sig": { + "r": "00e7343558f3451544cdf9cddf7e42481da3907de586d9199f6bdf650131f20596", + "s": "008f3793eedd90c09a43c713bba513949cbabc10f1bfad0c7b0aa7546da3943375", + "id": 0 + }, + "comment": "R: b=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 218, + "publicKeyUncompressed": "04e5c8ed1443cdc4128b40f8c167dd5bf176f2d7b176ec94fbe610ce8a4571ac8d257586740f1c8d2c05b1b872e9985acc36efffdd702431272be4e5f5b6c49726", + "publicKeyCompressed": "02e5c8ed1443cdc4128b40f8c167dd5bf176f2d7b176ec94fbe610ce8a4571ac8d", + "msg": "68656c6c6f", + "sig": { + "r": "7ecc4c5bf89043cad1bc59dbd11b28b05d7f3e7950703b9b79350116a2500b70", + "s": "48f046976d94a18d945ea142370417aff78b7ffdd2408a38424436913979648e", + "id": 0 + }, + "comment": "R: h=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 219, + "publicKeyUncompressed": "049fcb1725161e018d05020f246230c9c947eb9e10c664ebe1b1b422d59515ef4908e3d713136186a2cc89934acfabf4ec5ee87b4fe7021cdfb9070609465febf9", + "publicKeyCompressed": "039fcb1725161e018d05020f246230c9c947eb9e10c664ebe1b1b422d59515ef49", + "msg": "68656c6c6f", + "sig": { + "r": "00f156aadf85ab9bd15b2e015c01dfaccb83df42514e91511aced3d0b77245007f", + "s": "37bc36a92eac48b3b8b5ac80ff67918dc5a86d54abd0c496066bf62e84bf1c4c", + "id": 0 + }, + "comment": "R: h=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 220, + "publicKeyUncompressed": "0422fe3b9e5ed56171b0a8903c6e1f15a87151dd877ef52792b44ca06d7faab2990e0969a952d00d0615850e5a9fabbd7769ffaeafc8eb87c7e03ada1445b61801", + "publicKeyCompressed": "0322fe3b9e5ed56171b0a8903c6e1f15a87151dd877ef52792b44ca06d7faab299", + "msg": "68656c6c6f", + "sig": { + "r": "00e2fa649f609e816e4d1d15800667c89bbdab05a9895e1f50c1d7f29dfbacf74b", + "s": "00b0ffe38971bc1268674e67a71bdcdb6b12d661188bae621540658c514875433b", + "id": 0 + }, + "comment": "R: h=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 221, + "publicKeyUncompressed": "041c45fa45220980f1ad90a09a7cea2b66ae94e99c6db9cbe1dce6d8eab7814c75b961f613d68ad37b68e2b536e43e5a5f14a877d33a649c77975bf8461741af89", + "publicKeyCompressed": "031c45fa45220980f1ad90a09a7cea2b66ae94e99c6db9cbe1dce6d8eab7814c75", + "msg": "68656c6c6f", + "sig": { + "r": "00da660577820909a1ab4fa0efdffa93a917f1211b242e62c8853acaf751343898", + "s": "60d01017385985ec981c7ea984a108f776a1b25a48ff9681dafd001bf554a340", + "id": 0 + }, + "comment": "R: s**2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 222, + "publicKeyUncompressed": "04643ec12ebedc7a41a6bc85357a41aa100c9acc2f598457489a51fbb9999afd0cf631a6202456034b6b251b69a64c157d412ace99b1a6bbf83ed7893ef2d8e73d", + "publicKeyCompressed": "03643ec12ebedc7a41a6bc85357a41aa100c9acc2f598457489a51fbb9999afd0c", + "msg": "68656c6c6f", + "sig": { + "r": "1d9317b6bd2f64972845f38aa4956bafcd9822d6a0c8b701a0f303bdf1589da5", + "s": "00e53bb4e52e50c62ede05a47413a77df999a14a6b4f4f4a92cfcdfd45ec1c1858", + "id": 0 + }, + "comment": "R: s**2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 223, + "publicKeyUncompressed": "043e70a12385700a86802783c80a6ef7a8802a4197fefb3d044e79660abc92797f8b9f071a144991a2011aa0dbbe69f8963446e6005a2cf51db083cf6397b399a1", + "publicKeyCompressed": "033e70a12385700a86802783c80a6ef7a8802a4197fefb3d044e79660abc92797f", + "msg": "68656c6c6f", + "sig": { + "r": "0806e2d1c0c791c72c6a6b857b7000a71a76bc0e3b08e635d9d23149bd7325f2", + "s": "115e9a0df4316b6ae936602b1323565d44bff9c2334bc215a7d4bcc5b55d1095", + "id": 0 + }, + "comment": "R: s**2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 224, + "publicKeyUncompressed": "043d1447bb7b1a36619ce3b72e879038c40b73ae4d6786c50625975ffe01cbf5550c1adf511263b289e4e75d96acc554d5a663eced13801923a6c862dc01e88165", + "publicKeyCompressed": "033d1447bb7b1a36619ce3b72e879038c40b73ae4d6786c50625975ffe01cbf555", + "msg": "68656c6c6f", + "sig": { + "r": "00c63c2c8070e8b2a4671c77a9f218fa4d0f688cc52a2c7cbf4bf79d775e476779", + "s": "1fab52b30d81de8b9f7f74b0679ebad2b63259c610d279a3a724c87271ef5fa8", + "id": 0 + }, + "comment": "R: x3=-2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 225, + "publicKeyUncompressed": "045f3e738264c0c349391a61aae7ff0329fb228d2631d1171494d66f3fe5cfb52c20a0e4466f3eca419024986dbfcb6570e994e2e60160c9bd9d11ed9d493fdb70", + "publicKeyCompressed": "025f3e738264c0c349391a61aae7ff0329fb228d2631d1171494d66f3fe5cfb52c", + "msg": "68656c6c6f", + "sig": { + "r": "008578451dfbe898a0d895c43895bf305efd97470532135a48f13b226b4376a850", + "s": "630d8907fb9a8f7451eb3785a5d54efad6fbcb2bbc4bf7e0b5ca4cb4e7afa000", + "id": 0 + }, + "comment": "R: x3=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 226, + "publicKeyUncompressed": "0490c3e075e23631fa1f0785542e99428a97299b58100e730311bc17220848ef4cb605cfc7f062f3f1427b0f0caaeafe65cc9356475774908c6130084b00c6ec44", + "publicKeyCompressed": "0290c3e075e23631fa1f0785542e99428a97299b58100e730311bc17220848ef4c", + "msg": "68656c6c6f", + "sig": { + "r": "0084888416ad6c664babb691af6370f05a86fbfcdac9db699022618bd02609813d", + "s": "00b584d0de1297f00a80216336f707a156e5fe0719665b8bc400c77c8f1b4f4fc3", + "id": 0 + }, + "comment": "R: x3=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 227, + "publicKeyUncompressed": "04c629c150fe0637867ff25f0cb4fea3c863802a92842bce22a69e4fb6283f025a269654646a4ff086352c81773669c6c9fb2daa11ca0b48a487073376badd6f0c", + "publicKeyCompressed": "02c629c150fe0637867ff25f0cb4fea3c863802a92842bce22a69e4fb6283f025a", + "msg": "68656c6c6f", + "sig": { + "r": "581c24b2d98ffcd6b32b403cf450bdecab690bf647fc59b728054a850d7d97b9", + "s": "3e101bda47ccaf860c55f75ffdd4adcd0895f43695d8ea33164f22edddf6be60", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 228, + "publicKeyUncompressed": "04a7ab9ee687a461003d46a8cdbe5c78bc6a289453f056b01400bb2e7857f0a9c2ae15b24ec3ca7d471caab7eef046b4d1dd784e926bb0cd8ed9db088b8bc1fa52", + "publicKeyCompressed": "02a7ab9ee687a461003d46a8cdbe5c78bc6a289453f056b01400bb2e7857f0a9c2", + "msg": "68656c6c6f", + "sig": { + "r": "6fae1a2420945dfbde8ed9e512ff5275e294d9e228e5e3be3d6b66d33f931347", + "s": "00d06d3afba03035bc1a60daa621ab8e8e412a10204df93ea1bb81bbc22c3436d0", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 229, + "publicKeyUncompressed": "040e79ef2f259f0ca8f4721a9a27480b2f29f8ddf8f052c974590e24d619485391cf8ca05dd135fc7a3452b035a8f893ac2411203ed68587d4d5a4aaa7b4b0cee3", + "publicKeyCompressed": "030e79ef2f259f0ca8f4721a9a27480b2f29f8ddf8f052c974590e24d619485391", + "msg": "68656c6c6f", + "sig": { + "r": "6035d7474987b752bb3cbbf6577a2a4a2d186e5e23b227b583fcf8637e1905bb", + "s": "379341ceff60eaef543bc82e45f6b17a4e0c42f68b2adbe26ca765d35cad08c3", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 230, + "publicKeyUncompressed": "041217eaee2e324ada0c221ceae64c5662dd10dea58047526f5edf68d0892f17a7333b6b69263b762852b517a66057265d6c2e6589524ec7e8a54ecd57af81a598", + "publicKeyCompressed": "021217eaee2e324ada0c221ceae64c5662dd10dea58047526f5edf68d0892f17a7", + "msg": "68656c6c6f", + "sig": { + "r": "00bd18c5aced6589c6cb3317efca9412d29e15f6545d3b32144fe0d19e9d34dc27", + "s": "00ab547d2b325ba55e5ef90dee668b2db074139742e65bdd58d58ee7cfd0d7dd16", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 231, + "publicKeyUncompressed": "0423f9520b17f30a0b50e999f26540477c57c6bbdd31e28b6e7ee6727d978a6e1a24810f2b1944b0dd72b909255474d0a48045b580e707b4e39bfca8b18128d81b", + "publicKeyCompressed": "0323f9520b17f30a0b50e999f26540477c57c6bbdd31e28b6e7ee6727d978a6e1a", + "msg": "68656c6c6f", + "sig": { + "r": "3835c12905dba52d6e45e5ddf8afef9d72021a278f1dc28a9a8f4ea6b2ef512f", + "s": "66f1d4fbdaeea45de621d5ef2b1a6c8754d0e6fe4968423bf265ed4bccac19cc", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 232, + "publicKeyUncompressed": "04538e3f48932b4dfdafb2b8578561817b9d1d2c5d70d6073efff7586461826ac6bfa212afe311dce49446eb6d6d03d87985e65f4dc88c672d398d30cedf2d9450", + "publicKeyCompressed": "02538e3f48932b4dfdafb2b8578561817b9d1d2c5d70d6073efff7586461826ac6", + "msg": "68656c6c6f", + "sig": { + "r": "00e2b1630bc912bee679902c19ddf1c2e334d19b4d7f12a6362c2235fbe4b2167c", + "s": "07f698a9541a82f2667c79cde8b3729d05a442a38a5cdc6ec6928d3adfbcb59d", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 233, + "publicKeyUncompressed": "040bc7920d9e1f7c599b3d9aa28e4e9f5490b6954e38ff744a8b2eb7be58f0b2a4a6fb26d57b40518a0f100598ff3b76d881412a19e55fe0ffd5adaede9bcd6fbd", + "publicKeyCompressed": "030bc7920d9e1f7c599b3d9aa28e4e9f5490b6954e38ff744a8b2eb7be58f0b2a4", + "msg": "68656c6c6f", + "sig": { + "r": "29a269f4406bb2efbca27cffce85aa9d428ae9f6419452cc8cca558d55be2b26", + "s": "3ec26a5c29ec23f836ba96d9e5e087a0eeac022f5bb7a71510ebf90625c3e69f", + "id": 0 + }, + "comment": "R: u=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 234, + "publicKeyUncompressed": "046224e25cb32410d8829c494503c8703bbc354ac5f68ef565f4291fe9cf0c5f34857e7fe61eefc551d80f7066f674391e27f1219c7fb9f9c49940e23daaa06271", + "publicKeyCompressed": "036224e25cb32410d8829c494503c8703bbc354ac5f68ef565f4291fe9cf0c5f34", + "msg": "68656c6c6f", + "sig": { + "r": "30b802ce54737fe34c2740b89ddf6384bfbc1a29adfc813097f46577b1869f2a", + "s": "00d7100fc138b0da159f93bc13ec45353e3a99dbf59ae9bfea55eced0e10f5f639", + "id": 0 + }, + "comment": "R: u=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 235, + "publicKeyUncompressed": "049476a89795c262789b6cfc68bdba08d8ed43a276281749789bc19d10d541d77b9dc12833ff9e2e7ce7020402cd9df5c3764d9fc43a705d238c4776126931aa80", + "publicKeyCompressed": "029476a89795c262789b6cfc68bdba08d8ed43a276281749789bc19d10d541d77b", + "msg": "68656c6c6f", + "sig": { + "r": "00a5a5933d6b20cd2cf7364247939af1ddfdb8fbe0106f2c02db4144f9f8bb31df", + "s": "5f9cb1b4604e8b92368a55077874ec03754b0d30369904115d5de5e7a01d3224", + "id": 0 + }, + "comment": "R: u=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 236, + "publicKeyUncompressed": "0427f2875c9deeb82b782ddb9513aae71e55f545a33655f0fc809c91dbc9b65c9c0e268abe8ded2283130763c5f590408c0405f7b3ddb4d36727c9ef69ca2a9afe", + "publicKeyCompressed": "0227f2875c9deeb82b782ddb9513aae71e55f545a33655f0fc809c91dbc9b65c9c", + "msg": "68656c6c6f", + "sig": { + "r": "310728252e58de9013f52a9291dbbfe645d6e79703887cd99d72261bd620df7c", + "s": "5a224be63be31142f39fea750a948da055b551514721688798c0329d7745153d", + "id": 0 + }, + "comment": "R: v**2=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 237, + "publicKeyUncompressed": "04332117b4e4dedfc880c410eba311c8b77c8ca5d8fbbe1dfb0de0efcb80586ce340b8e4f40725a33a83a96928db60f0b2f1f65208b084df7b5ab635ab8e752941", + "publicKeyCompressed": "03332117b4e4dedfc880c410eba311c8b77c8ca5d8fbbe1dfb0de0efcb80586ce3", + "msg": "68656c6c6f", + "sig": { + "r": "249ce6da270f17d618dadc5e0a335d88dfb6438a66ea9fa5f1967f29697a5161", + "s": "00b578f34f2274aa16b36f739491636e4a8fd10f49b2d7f1ed1293778a2ec016ca", + "id": 0 + }, + "comment": "R: v**2=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 238, + "publicKeyUncompressed": "04c65288a2bf331b465a83a552676b5ed745cd17d21d6ff44055ead9cdbb6d1c9335f416de0d2daf2849411d31598f0d19641844f7bbd4992c103670958ae67b3f", + "publicKeyCompressed": "03c65288a2bf331b465a83a552676b5ed745cd17d21d6ff44055ead9cdbb6d1c93", + "msg": "68656c6c6f", + "sig": { + "r": "00ffbc1a8150c65c61cee4bb9002226810fef7a91f0c5d573f52858e8ed8d7a68b", + "s": "5f9fdf9c7a860118542ba0368b736fc88df66b65b8667afe27d5374511c34d5a", + "id": 0 + }, + "comment": "R: v**2=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 239, + "publicKeyUncompressed": "04eebd8c40ee0fda77bfa1f0bb9e73e6b0d9f5d696676c1350399c69c3d322b99a5f179c83c1ddb17abbf78843ac0007cc88a0e7317de39ab7a9310dd4d20d03c5", + "publicKeyCompressed": "03eebd8c40ee0fda77bfa1f0bb9e73e6b0d9f5d696676c1350399c69c3d322b99a", + "msg": "68656c6c6f", + "sig": { + "r": "00fdc4ee73929db589196c036a8020a1d734a8ecb66e8fa4231b6247bf94e37242", + "s": "0099da465cdcbf35b7885635aecf216151623512cbdb97b0e85e8941c1e42b4f5b", + "id": 0 + }, + "comment": "R: v**2=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 240, + "publicKeyUncompressed": "04e45c47fe12356581e3a5085068d8a05a435556f6f3798c8d810ae026396f85afa37362d456a838ff40a4fdb6658894c6a1cabafdf94cccd5f284e0dc8cee62f2", + "publicKeyCompressed": "02e45c47fe12356581e3a5085068d8a05a435556f6f3798c8d810ae026396f85af", + "msg": "68656c6c6f", + "sig": { + "r": "00808de6e779b93dbb1e9804d0e64e9e4d56fc53de30693825b865a5c8b20ab950", + "s": "009d4d9994c71e9e202913132ff2e51dccce8f85568aac6d9fba6e14e7cf0126e8", + "id": 0 + }, + "comment": "R: v**2=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 241, + "publicKeyUncompressed": "049f5e38af3d4c00136b43f50c897d7f8e7e50112dec01edbe1fcacb8be3dfe59ccf7fd526fcfc0616d02d3eaf324f64346c80fdee186cb12f74572249e8a89144", + "publicKeyCompressed": "029f5e38af3d4c00136b43f50c897d7f8e7e50112dec01edbe1fcacb8be3dfe59c", + "msg": "68656c6c6f", + "sig": { + "r": "78160f6074fbb4ae2932832f2aa56c5519ea101725e22cc990ee2c0cca399431", + "s": "00c80bf373fadb351beabeea197f68da063d09a3cbf78c8cd79d9dac2c9e3b674a", + "id": 0 + }, + "comment": "R: v**2=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 242, + "publicKeyUncompressed": "04e502931a959cffc52b7d0e3b6b991abcd5e5e5ca76de197afab8e3ee8c73623c9e9c0d61fe38f08457cd26d86584f0b95c46227efbad2fa6b0c7cd07cd14ea13", + "publicKeyCompressed": "03e502931a959cffc52b7d0e3b6b991abcd5e5e5ca76de197afab8e3ee8c73623c", + "msg": "68656c6c6f", + "sig": { + "r": "0089511707dbcf67779e7ad96e35e0cece74b276056dadb8e5dae784abf692b16b", + "s": "00a087603e2da910764e53de8579156c658166b6c9abbca1234289e1e8b6589cc7", + "id": 0 + }, + "comment": "R: y2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 243, + "publicKeyUncompressed": "04cfdc9a64940f7ef8283fbfe0154783f2144e34c9e586e7502159fdc80393f6156e896c8270792c0f0d34638b879b2a7ff815bc944be85b075012d69049fb19f0", + "publicKeyCompressed": "02cfdc9a64940f7ef8283fbfe0154783f2144e34c9e586e7502159fdc80393f615", + "msg": "68656c6c6f", + "sig": { + "r": "05ac5bbb2cb53119f81f5b26014e862ddb31a7d8d8d8263440109ac833472e37", + "s": "61d4c9e7d00ef3a589b6f50bcb581b4d634fcc51192205a94f36a00ad6c1d952", + "id": 0 + }, + "comment": "R: y2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 244, + "publicKeyUncompressed": "04dd9e338b1c1560af1c6b15a8219ff6ba9da420a6b2a2c2129b1823364613a0b06d0dbc6257e5d99e9fd477b30daa4373cfa03e5fa3de46b25a64e0b26c1974d4", + "publicKeyCompressed": "02dd9e338b1c1560af1c6b15a8219ff6ba9da420a6b2a2c2129b1823364613a0b0", + "msg": "68656c6c6f", + "sig": { + "r": "71028d3cf77b676e6965cb6bc8d0ab03b01be221b97a20e5e507e08ad6261c8d", + "s": "7746526b111dc78cb686ff7375e10f9c22a2cfe40d74336eec17e3d506ceb7d7", + "id": 0 + }, + "comment": "R: y2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 245, + "publicKeyUncompressed": "0400ec8f32da5002da5af7fd322da8039276560c2ed492995435a740e1fa167f298c548fb63025e971c5e38bf06fcacd7e89ee78f1ad3b3acadd40c055dbcf403f", + "publicKeyCompressed": "0300ec8f32da5002da5af7fd322da8039276560c2ed492995435a740e1fa167f29", + "msg": "68656c6c6f", + "sig": { + "r": "22d7a30ef0976f0b5f74cd13ad2ae1f9b665a8ac8ae155b7e04f6ee375da4932", + "s": "537a45764ef408db34da523e058405e840f5df2be9e8f1de2bdf11d2ed365264", + "id": 0 + }, + "comment": "R: w=-2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 246, + "publicKeyUncompressed": "043e363dad79416a8f040dc4ebc3a36bf33783c939a45b105c80ac171c86765949f47f9223f88aab046011c1a7032ad27f92f4638d95e99e29f908a4803fae0c2e", + "publicKeyCompressed": "023e363dad79416a8f040dc4ebc3a36bf33783c939a45b105c80ac171c86765949", + "msg": "68656c6c6f", + "sig": { + "r": "36cf38affa4324459c4ff9e58468ca698a1be73352cb4627d8363821fa03d928", + "s": "6e85b4acdb5f3111db7cd93ba543982a0056378819345a793a16fb93a79ad901", + "id": 0 + }, + "comment": "R: w=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 247, + "publicKeyUncompressed": "040bf8f1fc47602b04dd40e8d95770d94d1aaed3da5e810f4b0a2d04a42e566d07e21ab791177ac75cbd7352236d0fa8119e66861a518bf150beb0956c692b421d", + "publicKeyCompressed": "030bf8f1fc47602b04dd40e8d95770d94d1aaed3da5e810f4b0a2d04a42e566d07", + "msg": "68656c6c6f", + "sig": { + "r": "64e338755dd45ac4d51b6ff926695532a412635fcfdc9b1eacd2fd475f2ce0b0", + "s": "31a4a5d1aec8f6ae40ad880b154f65676af8b72d042c25d41a112d286fbdf730", + "id": 0 + }, + "comment": "R: w=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 248, + "publicKeyUncompressed": "0428c702037728cd36861b5a60b137161b54ae835027d5683b2494e4224cecb6c64b5c1d53a38f418fc82c939721c6f1d94e9312fc53ed67487d0cd11eac0a6ea1", + "publicKeyCompressed": "0328c702037728cd36861b5a60b137161b54ae835027d5683b2494e4224cecb6c6", + "msg": "68656c6c6f", + "sig": { + "r": "3bfa4cb1c450fc911f3eda274fcd86d5c8b4229ae86f1dbb77c74813d462ad73", + "s": "00a0005a4c4d04b72660ce7286293f54f2a4174d39b58a9e83853fce3c420be2d3", + "id": 0 + }, + "comment": "R: b=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 249, + "publicKeyUncompressed": "043fbddc597a4c30dcdbfdd8b053aae1ebc406f405820c89d7e14d1db370e580e2c438e12c633affb2094f0f08fba4c120be84cc30a16aea67255585e94456bcb3", + "publicKeyCompressed": "033fbddc597a4c30dcdbfdd8b053aae1ebc406f405820c89d7e14d1db370e580e2", + "msg": "68656c6c6f", + "sig": { + "r": "00c81f07ef1c44d920b57569d5c96efd1d5197a01948bc93ccc7cf997bb4b8ed21", + "s": "600e9ba0e0bfb4d4ba0f2d0546ed3b9bc2bff38f7482527d7d018c06a3c38e2c", + "id": 0 + }, + "comment": "R: b=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 250, + "publicKeyUncompressed": "04dbb7bb93d742af7eb4ace37fb1c76be175834dede3c5b2c921c9df4a912badfc6f5b96b85678f70126ee3fb10cf36d8dffaf72bbb94d3050e7cf443c3f779322", + "publicKeyCompressed": "02dbb7bb93d742af7eb4ace37fb1c76be175834dede3c5b2c921c9df4a912badfc", + "msg": "68656c6c6f", + "sig": { + "r": "00ee592bf5200e40d3e60923508277e63baf857f592f8c3708d89aa502f369757e", + "s": "00df6de2447e2d3830f69745b3d5ba13c5ddf009ba4b3965e2a00196fdd64b3683", + "id": 0 + }, + "comment": "R: b=-2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 251, + "publicKeyUncompressed": "042e61564ee3db0dd56a0b351726cd2ace1119752a72599586c9f3a07500e5d08b39d445347dda356595f040d198e5269814fd073ba95b661dee21e57235ec8a81", + "publicKeyCompressed": "032e61564ee3db0dd56a0b351726cd2ace1119752a72599586c9f3a07500e5d08b", + "msg": "68656c6c6f", + "sig": { + "r": "008efc9a2cacaee578396fba5f4c0cba23afb6a7bb1206d84d975fe3ac834f54bb", + "s": "00c523426a3c233557e27f6707982db6c2204315b642b0445ef4becd502b5d157e", + "id": 0 + }, + "comment": "R: b=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 252, + "publicKeyUncompressed": "04e2f3e1349cb9f8d071f6d7f441320558245f8d90b377b510f3a7157758a2fa1835f6f8a938a05b517e100b39495cc34c3a8c4cc2d6681b2d0659c0de7b6c3f08", + "publicKeyCompressed": "02e2f3e1349cb9f8d071f6d7f441320558245f8d90b377b510f3a7157758a2fa18", + "msg": "68656c6c6f", + "sig": { + "r": "00898fb815ac930e9a2149dd0f3147e46aaaf1c95bafecbb19d691ae1c1a344ab8", + "s": "2bc8f2347e92f601175d84c237cdfaa3e9a550b6c4595da1cea2ff8287925edc", + "id": 0 + }, + "comment": "R: b=3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 253, + "publicKeyUncompressed": "048ea066e2d9e7455fafcae4e019a95b2e38dbef91add4ffb7d9cc76027bfb0a1dde5de2dea3cf1a10319416b7fbd00b2e2f1f9095f0c6273f72a568cae55c3a43", + "publicKeyCompressed": "038ea066e2d9e7455fafcae4e019a95b2e38dbef91add4ffb7d9cc76027bfb0a1d", + "msg": "68656c6c6f", + "sig": { + "r": "0aff7d84b9e77d16722bcd183030031f83544b82c8ac02b231bf1f832fb3152e", + "s": "0c3ba649264793392a9860aac4c435407694d1606a8e30adaa65b11dc3e3cd56", + "id": 0 + }, + "comment": "R: h=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 254, + "publicKeyUncompressed": "0463354b7e4afe30c57277786995310112eb75ed89fb161bc9fe392783f208bca9cc23cfb101ef2d05717e7ae634ff0170b15e50127901b60e5d20aafb7d3b5b4c", + "publicKeyCompressed": "0263354b7e4afe30c57277786995310112eb75ed89fb161bc9fe392783f208bca9", + "msg": "68656c6c6f", + "sig": { + "r": "00a994cd28ee8aaa2ad8340b97516b7a7ce4c25dd98a8f42c3360798576c9be430", + "s": "093bb9a7d34dbbb869548d50bd0bda3a37d0fbbddcd79c0a7f1ceeb6fd9dfe5a", + "id": 0 + }, + "comment": "R: h=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 255, + "publicKeyUncompressed": "04c838945a52a96499ad9cbbb510e9201df020823ab2b9acad02188b48685e0d6dee0750e7852393b29dc72d2009f0f6690b3316f384e858a7bcd17766c9507ab3", + "publicKeyCompressed": "03c838945a52a96499ad9cbbb510e9201df020823ab2b9acad02188b48685e0d6d", + "msg": "68656c6c6f", + "sig": { + "r": "6e63387edc4d2e4f868e23e9041c99c4becf4448cbd65e447a3874298f3eef25", + "s": "00f5127a189cc6b69f2b44e1eeb5be82037dcf3e72b177cbecbe3e216436fbb00d", + "id": 0 + }, + "comment": "R: s**2=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 256, + "publicKeyUncompressed": "0449e348d2f2e576b23eb50513d9c18aaad93564a94f123bb27c234195e0bd922e8ea238c17a7c1000f42d32f5486a0f07a0986998d86b9ef729908993340c9ec6", + "publicKeyCompressed": "0249e348d2f2e576b23eb50513d9c18aaad93564a94f123bb27c234195e0bd922e", + "msg": "68656c6c6f", + "sig": { + "r": "00f4d5b67f9a7ab82e45c963b9fe42e19c443dde7a3983ce54d886048abcbf60c3", + "s": "00ed78bd18362da34c8ca1ac2d71fc54cccfff19250c3af409686cc2842d57bf79", + "id": 0 + }, + "comment": "R: s**2=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 257, + "publicKeyUncompressed": "04016e72e06ecd72748036f5b606c691415ed29dd5634bf2f1f318069ae8679b3611e8e07669dcb1eafcedb3358b37496c63546869c9588804619b3e8f27b6e1c5", + "publicKeyCompressed": "03016e72e06ecd72748036f5b606c691415ed29dd5634bf2f1f318069ae8679b36", + "msg": "68656c6c6f", + "sig": { + "r": "009cc711018938198233a8785cfda0849efcf2dd3cfaa5d366ad418749b401a876", + "s": "10b9c1f14ab73d65653d17ed4ce257cf0635717f37aa54451533891bf348ab19", + "id": 0 + }, + "comment": "R: s**2=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 258, + "publicKeyUncompressed": "04f6b11421b1c23b9ce6504501254816d907179636effb4bbeeac894be2e435172e2136bfd37aba92e8613d475db1c6f8795e25effff303b596b05b90090e26f50", + "publicKeyCompressed": "02f6b11421b1c23b9ce6504501254816d907179636effb4bbeeac894be2e435172", + "msg": "68656c6c6f", + "sig": { + "r": "4b5f4333594b430ba097a86910808e4c19820cc151eed6f0b9dc6b411eca3cc2", + "s": "01dc97b8b80c6ee00b06ad74f05512efbcde47f5af90e6ad315a4df6e7009cb2", + "id": 0 + }, + "comment": "R: s**2=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 259, + "publicKeyUncompressed": "04131ac0b190e320235113cb28348981f74e032d1cfce7050e341d2f41286c62b5403fb33b884a18c7f4632f015661a9541c8b1f643367c56eac0e2dcb2916209b", + "publicKeyCompressed": "03131ac0b190e320235113cb28348981f74e032d1cfce7050e341d2f41286c62b5", + "msg": "68656c6c6f", + "sig": { + "r": "00af89ec349694079885953fae86acba5c1e25c42e58a675ec7e19a9e3828477ed", + "s": "00a6720e85cbcddb75902811e1c88a41340d451936262ad87835e72708ba374c95", + "id": 0 + }, + "comment": "R: s**2=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 260, + "publicKeyUncompressed": "047a261fb4c4ea9876ebbd5754c5f4aada28e35b91484a72bd8bf5734fa596d584dd13e2983fdb7e7070746277a639765f6e39bd4f34fe6a81f3b7c762a60c3017", + "publicKeyCompressed": "037a261fb4c4ea9876ebbd5754c5f4aada28e35b91484a72bd8bf5734fa596d584", + "msg": "68656c6c6f", + "sig": { + "r": "0516d0981020b55bd9d317e868d2b757c8582f10556ab322c809eada5eb14780", + "s": "00d153d6528afb8152f36313ae016f432b3d35f1d2fc971b161696f0c8f2b144a9", + "id": 0 + }, + "comment": "R: s**2=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 261, + "publicKeyUncompressed": "047e6f6904fc69d8883a6bfe029b3e52a6d9be3fc53f3e16eedd8a56f70b20f9f54f753bd1a4b067ad50c0de7c0548bdbc9d68bc18574874fbd6dc84a2f40997ba", + "publicKeyCompressed": "027e6f6904fc69d8883a6bfe029b3e52a6d9be3fc53f3e16eedd8a56f70b20f9f5", + "msg": "68656c6c6f", + "sig": { + "r": "49b03912dd12a5981e2a3645eaca0dfaef57a50c81e9510d31b19535bb6bc13e", + "s": "29eebcb16b4906804c380caef405b95992fa4e5139b926705e0b1969220f97c6", + "id": 0 + }, + "comment": "R: s**2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 262, + "publicKeyUncompressed": "0490bc927a921a7db231665dc71ce55e41def758a9b2a51059f7a3422bb4ca23f785cf4756159a3720f8e7cf042d2d2dda03498d8e0e678cf295012a7185c31ef5", + "publicKeyCompressed": "0390bc927a921a7db231665dc71ce55e41def758a9b2a51059f7a3422bb4ca23f7", + "msg": "68656c6c6f", + "sig": { + "r": "00d11233ed000eafb50963cfe4e8ed5889cb59c251f3a84c50ffd3d6f0f52c222d", + "s": "009e27b274ad2571632d731c26621cd4af8e97893ad9b29129c16c4c35b6acbee4", + "id": 0 + }, + "comment": "R: s**2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 263, + "publicKeyUncompressed": "0458f4d1c042ea961b704181eadfa6fdab68fd061742a474e04ecee4e51750e47aeccd454c7fa48237349443d14fb9304eba692151caaea36e5bb7a6490d4263f1", + "publicKeyCompressed": "0358f4d1c042ea961b704181eadfa6fdab68fd061742a474e04ecee4e51750e47a", + "msg": "68656c6c6f", + "sig": { + "r": "00e53d930022deaab2d871f9d52c48997b454e98a18a6e62a1ce7a93d74f6814f3", + "s": "2b2e89fc053d1f6da3787d341e7aa09777c314a432a8bc655c94a8d8aea982b4", + "id": 0 + }, + "comment": "R: s**2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + } + ] +} \ No newline at end of file diff --git a/packages/crypto/testdata/rootberg/ecdsa_secp256k1_sha_256_raw.json b/packages/crypto/testdata/rootberg/ecdsa_secp256k1_sha_256_raw.json new file mode 100644 index 0000000000..9f064f378e --- /dev/null +++ b/packages/crypto/testdata/rootberg/ecdsa_secp256k1_sha_256_raw.json @@ -0,0 +1,5944 @@ +{ + "testType": "EcdsaVerify", + "algorithm": { + "type": "Ecdsa", + "curve": "secp256k1", + "sha": "SHA-256", + "encoding": "RAW", + "normalize": false, + "signature_generation": "Generic" + }, + "version": "0.34", + "description": [ + "The underlying elliptic curve is secp256k1", + "The message digest for hashing the input is SHA-256", + "Signatures are dictionaries containing r, s and id, where id is the recovery id used by a number of protocols that verify signatures by recovering the public key. Public keys are given as a pair of coordinates", + "The test vectors were generated for signature verification through public key recovery." + ], + "references": [], + "numTests": 423, + "tests": [ + { + "tcId": 1, + "publicKeyUncompressed": "04c2e691b8f80df46ff64ff044e3b1cd7ae7302a40ee19cb41d8293757a4f43f9b3381015dcbc7c2b0c0d74a2acd8285405f03731b8765fbaa76570adb13b0a9d0", + "publicKeyCompressed": "02c2e691b8f80df46ff64ff044e3b1cd7ae7302a40ee19cb41d8293757a4f43f9b", + "msg": "", + "sig": { + "r": "6d0a7d5727c5469602bdef52b82c68d414b1d2c96e3bc54457af31852fc22d6b", + "s": "7f6cf4675dd72ae473d3126c65cf64a2bf71b2b4ea5b49dce98a344429a4d69f", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 2, + "publicKeyUncompressed": "04c2e691b8f80df46ff64ff044e3b1cd7ae7302a40ee19cb41d8293757a4f43f9b3381015dcbc7c2b0c0d74a2acd8285405f03731b8765fbaa76570adb13b0a9d0", + "publicKeyCompressed": "02c2e691b8f80df46ff64ff044e3b1cd7ae7302a40ee19cb41d8293757a4f43f9b", + "msg": "000102030405060708090a0b0c0d0e0f", + "sig": { + "r": "00ba23f380587389d6e2d7e650ae446ccaa3e6a346c27311c7a6bf99a85da86ba4", + "s": "1aa16c817987e8e123bd43c413c84ad07e04c2ba93a52d6e408c8880d1bcfad9", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 3, + "publicKeyUncompressed": "04c2e691b8f80df46ff64ff044e3b1cd7ae7302a40ee19cb41d8293757a4f43f9b3381015dcbc7c2b0c0d74a2acd8285405f03731b8765fbaa76570adb13b0a9d0", + "publicKeyCompressed": "02c2e691b8f80df46ff64ff044e3b1cd7ae7302a40ee19cb41d8293757a4f43f9b", + "msg": "616263", + "sig": { + "r": "3f5ad9f237fc8cf9d2978db4d7bd06b776918af07b34849d333bbf734dc3ce91", + "s": "00da3e1dedd8d5885efb66ebe548bb531236b83d2ec0365d5480959d1b1fb858f0", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 4, + "publicKeyUncompressed": "04c2e691b8f80df46ff64ff044e3b1cd7ae7302a40ee19cb41d8293757a4f43f9b3381015dcbc7c2b0c0d74a2acd8285405f03731b8765fbaa76570adb13b0a9d0", + "publicKeyCompressed": "02c2e691b8f80df46ff64ff044e3b1cd7ae7302a40ee19cb41d8293757a4f43f9b", + "msg": "54657374", + "sig": { + "r": "00f4917a87584e1376f6d42354ea2caa6291510e1469f841f7276f8d01c736b080", + "s": "52d76ef14cd39490aa7aa4efee62b8640dfc09b695301b90e5540e8c2b6c4e9a", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 5, + "publicKeyUncompressed": "04d75c44c516b611ecd0bade37956f5d4587dced7ba13fac8a513576f6e66ab34c3236e2f1bc633403e50c1be53a0415f859e4ec362c432451ccca729d77f83fbc", + "publicKeyCompressed": "02d75c44c516b611ecd0bade37956f5d4587dced7ba13fac8a513576f6e66ab34c", + "msg": "54657374", + "sig": { + "r": "01", + "s": "01", + "id": 0 + }, + "comment": "r=1, s=1", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 6, + "publicKeyUncompressed": "0425b7d035f5af2cfffe4b5e3c1c56f0d9a3020092bf8a5efb3d33121ed98f58cf2b7c21f78133bbe84b0595d032a1324351f088aa3ae2d2928c8535e945e92b93", + "publicKeyCompressed": "0325b7d035f5af2cfffe4b5e3c1c56f0d9a3020092bf8a5efb3d33121ed98f58cf", + "msg": "54657374", + "sig": { + "r": "02", + "s": "02", + "id": 0 + }, + "comment": "r=2, s=2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 7, + "publicKeyUncompressed": "040b6b40b66e0b37d19a35edb26beb70e06b048bd6a28d67f98ae4be31522b5b7d8e87a4fd5dcababf2b70aa4526a1f20bb2002ae645f19b123ed5d4665871d69d", + "publicKeyCompressed": "030b6b40b66e0b37d19a35edb26beb70e06b048bd6a28d67f98ae4be31522b5b7d", + "msg": "54657374", + "sig": { + "r": "03", + "s": "03", + "id": 0 + }, + "comment": "r=3, s=3", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 8, + "publicKeyUncompressed": "048a16649606ca1cc742001fc42c027053582dfb4b3a3d606058a7aca15adac96e48bfc2fe81b304354cdd2602639f53493bf02dadf5a5ba09cc3813ebfb81b0ae", + "publicKeyCompressed": "028a16649606ca1cc742001fc42c027053582dfb4b3a3d606058a7aca15adac96e", + "msg": "54657374", + "sig": { + "r": "04", + "s": "04", + "id": 0 + }, + "comment": "r=4, s=4", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 9, + "publicKeyUncompressed": "0490d0a34d671b4d368ed03f299d91fa908199552dfd4e3978f2d0b23bad69698ebc1fc6705592aeff387d69827beaeb18221395765db8fbba532a0aee3593ad66", + "publicKeyCompressed": "0290d0a34d671b4d368ed03f299d91fa908199552dfd4e3978f2d0b23bad69698e", + "msg": "54657374", + "sig": { + "r": "06", + "s": "06", + "id": 0 + }, + "comment": "r=6, s=6", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 10, + "publicKeyUncompressed": "0460144f9b8e12261b14f521a93e213f7a556e2120def8e452a207ef69e1c014fd20632a937723373b8b6fa7d7a74159e5f990925d00c721f8ced1620c6dad9f14", + "publicKeyCompressed": "0260144f9b8e12261b14f521a93e213f7a556e2120def8e452a207ef69e1c014fd", + "msg": "54657374", + "sig": { + "r": "08", + "s": "08", + "id": 0 + }, + "comment": "r=8, s=8", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 11, + "publicKeyUncompressed": "04678d2ee21a0c08fe02a9b089abb4bd7e48180da308888f8a9cac2977abd3e154e8b39204fe4acfa719600dc1b4b95d8e6107974acdb052c543aa025f8f29e57a", + "publicKeyCompressed": "02678d2ee21a0c08fe02a9b089abb4bd7e48180da308888f8a9cac2977abd3e154", + "msg": "54657374", + "sig": { + "r": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", + "s": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", + "id": 0 + }, + "comment": "r=(n-1)/2), s=(n-1)/2)", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 12, + "publicKeyUncompressed": "04383b08c435679141c1ff0592f3fc9acb2f19ff57b485f8024bbc8f225d4373cea787b8ac246fe555f5d60076b07502fcf146bc5f758c17545731501bad30cf93", + "publicKeyCompressed": "03383b08c435679141c1ff0592f3fc9acb2f19ff57b485f8024bbc8f225d4373ce", + "msg": "54657374", + "sig": { + "r": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1", + "s": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1", + "id": 0 + }, + "comment": "r=(n+1)/2, s=(n+1)/2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 13, + "publicKeyUncompressed": "04c2969326f46373c627f850a7665be4f4a82e436724a7152f134853040d57a13e125eb0f267c44f40a4cacbffd66b7e314f4362d78ca19d3093f398a85ed305e2", + "publicKeyCompressed": "02c2969326f46373c627f850a7665be4f4a82e436724a7152f134853040d57a13e", + "msg": "54657374", + "sig": { + "r": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a2", + "s": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a2", + "id": 0 + }, + "comment": "r=(n+3)/2, s=(n+3)/2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 14, + "publicKeyUncompressed": "04c85577db17f793d63ae8ed50eae42200620c68830a8511c88b9792abace7d324712e973754330ec2dbcaefa8fc41e61520270213be2e99e2847d32ee361b03a0", + "publicKeyCompressed": "02c85577db17f793d63ae8ed50eae42200620c68830a8511c88b9792abace7d324", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f", + "s": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f", + "id": 0 + }, + "comment": "r=n-2, s=n-2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 15, + "publicKeyUncompressed": "04735083e84d510dea522f851cca22131c6dff759908a3c893913819b706750cc8622ed034314b31af57813b53074cff28d449a577175c57d92ea45914ede2a84c", + "publicKeyCompressed": "02735083e84d510dea522f851cca22131c6dff759908a3c893913819b706750cc8", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "s": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "id": 0 + }, + "comment": "r=n-3, s=n-3", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 16, + "publicKeyUncompressed": "0483eb6ba02b1ee7c153b94cd77404cdcfc5985613d58bccacdc7bcfcc8a3daaa5a077c26b05079ad8641ccf8574ef6c7ac3ba1de087c68dbbf5ca0cc96a8a99c8", + "publicKeyCompressed": "0283eb6ba02b1ee7c153b94cd77404cdcfc5985613d58bccacdc7bcfcc8a3daaa5", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000000", + "s": "008000000000000000000000000000000000000000000000000000000000000000", + "id": 0 + }, + "comment": "r=2**255, s=2**255", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 17, + "publicKeyUncompressed": "04dcde11029521ef6e0f97c414e7f23f25f87874b0ca5a36188c89b0eaf2a0b9d475b94143cb26a8a3248f1d6af8c3c0601800ae5cf784de336d22a3ea98c25930", + "publicKeyCompressed": "02dcde11029521ef6e0f97c414e7f23f25f87874b0ca5a36188c89b0eaf2a0b9d4", + "msg": "54657374", + "sig": { + "r": "03", + "s": "66666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "id": 0 + }, + "comment": "r and s^-1 very small", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 18, + "publicKeyUncompressed": "04f454efff2800090687e16db017b61a1d460a98a99ef58262b3248a33888d7c10648d3fba5f80470a6f80d918ca66a26111d2b1e23068d2fe730ba8969fe3c805", + "publicKeyCompressed": "03f454efff2800090687e16db017b61a1d460a98a99ef58262b3248a33888d7c10", + "msg": "54657374", + "sig": { + "r": "7b", + "s": "00de9bd37a6f4de9bd37a6f4de9bd37a6e33075be9fc98324a377f471645bfdfb3", + "id": 0 + }, + "comment": "r and s^-1 small", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 19, + "publicKeyUncompressed": "04b626aea678c76e08ee4a838a45f3cfad7cf8e6f9be52d370d98027bb8c51c43c808814c59c9bcb52be644cd89b015eda56a8eda2e6be0c0f570bd5c41457db56", + "publicKeyCompressed": "02b626aea678c76e08ee4a838a45f3cfad7cf8e6f9be52d370d98027bb8c51c43c", + "msg": "54657374", + "sig": { + "r": "24f22125", + "s": "33720cedbf35ef7a26dabb594ecf3a81d53b83daa08c4f8b33095cab67debdd4", + "id": 0 + }, + "comment": "r and s^-1 are 32 bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 20, + "publicKeyUncompressed": "04e913b9cdcef3b9a97acc1fedd3cb2f6d6be421a5978d7f47d165dd78f42b83c1114c85e29a543809a0a5aab99d6bda5bf20e7eadda7dfb8c18effc5f6e164580", + "publicKeyCompressed": "02e913b9cdcef3b9a97acc1fedd3cb2f6d6be421a5978d7f47d165dd78f42b83c1", + "msg": "54657374", + "sig": { + "r": "00fffffffd", + "s": "00e3a8af7ae3a8af7ae3a8af7ae3a8af79c25b611dc782c69e17f5671d39e17805", + "id": 0 + }, + "comment": "r and s^-1 are edge case 32-bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 21, + "publicKeyUncompressed": "04c4d16b255735d1260d0eb2b4330538fdf664caa20b69982ee4f00a80552ef426af2e753f582733bfe82ca6744fb6c4a565fb01e78b96c0e33b5a76ac7b8b4877", + "publicKeyCompressed": "03c4d16b255735d1260d0eb2b4330538fdf664caa20b69982ee4f00a80552ef426", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffd", + "s": "45c87dc69de031b445c87dc69de031b3ed1ad8185bd38af4bd79e65f417cad4b", + "id": 0 + }, + "comment": "r and s^-1 are edge case 64-bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 22, + "publicKeyUncompressed": "0426610c04f6e727a21f56bc3bac9983d947bedc5bf103957c3261efd669d1a72017ce851ae114cebb4e93c45bca46d2a16d1eed3c5ee77f0b064a424376bc822e", + "publicKeyCompressed": "0226610c04f6e727a21f56bc3bac9983d947bedc5bf103957c3261efd669d1a720", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000000", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 23, + "publicKeyUncompressed": "04ca9486b6b1dc7c837f3b2167b808c6efb7acb732beb560812c19f6162756ad3fbd2d61fc42fdea0a2c3061908ddffd0192d590b0392abd648e26bc2c6745af15", + "publicKeyCompressed": "03ca9486b6b1dc7c837f3b2167b808c6efb7acb732beb560812c19f6162756ad3f", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000000", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 24, + "publicKeyUncompressed": "041e33b42255949d05ffaee5d2c3047400189df1a4ad861d948671e453e610f59d16697ba5c1ae91e38edffd6ffd3a4a943a621365cf73c194e15a46fdb8d2b3d2", + "publicKeyCompressed": "021e33b42255949d05ffaee5d2c3047400189df1a4ad861d948671e453e610f59d", + "msg": "54657374", + "sig": { + "r": "0100000000000000000000000000000000000000000000000000000000000001", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 25, + "publicKeyUncompressed": "046cd7088e6e302fe9adf40d46643c4bf5ca6dfbaa9d01ed967d0e1fd21a997d20d7220da606b820c8575629ce9755ede04e8f5b4ef085d6378cba0c9ee3c1c569", + "publicKeyCompressed": "036cd7088e6e302fe9adf40d46643c4bf5ca6dfbaa9d01ed967d0e1fd21a997d20", + "msg": "54657374", + "sig": { + "r": "0100000000000000000000000000000000000000000000000000000000000001", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 26, + "publicKeyUncompressed": "0436efeceb8c9c1934b61eaa5d7dee65a3e115d399a7dd9c101d1961321ae1ebb54b238335174e5bf598a2495371e86e01b0c8ee7697b47a5835ee8bf642c84892", + "publicKeyCompressed": "0236efeceb8c9c1934b61eaa5d7dee65a3e115d399a7dd9c101d1961321ae1ebb5", + "msg": "54657374", + "sig": { + "r": "01", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 27, + "publicKeyUncompressed": "04f2fa1478dd819a615b93652aba2919121d8932c7d9e344113333cef9e76fa20cdfb3a5721203ce20f8a44a5624d59ff90fbbad2d2b2e34603693b3ee32d6639d", + "publicKeyCompressed": "03f2fa1478dd819a615b93652aba2919121d8932c7d9e344113333cef9e76fa20c", + "msg": "54657374", + "sig": { + "r": "01", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 28, + "publicKeyUncompressed": "048864c6063b1101aa7f72aab53ed1ba02fee6be6dc659f8d49c64dd6928dd1f460ea617ea0249081ac4b4620572549442caca4e0a0cff394fe03b135174f98135", + "publicKeyCompressed": "038864c6063b1101aa7f72aab53ed1ba02fee6be6dc659f8d49c64dd6928dd1f46", + "msg": "54657374", + "sig": { + "r": "0081", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 29, + "publicKeyUncompressed": "04418f34cdd9dc3b7deb95978a2ac559a02bae6433afe9c273eeab69c22c8d46b49021a33f5a3c324d0355e0bea83caf727cd73d483a3d09b35319a07779bbb6ea", + "publicKeyCompressed": "02418f34cdd9dc3b7deb95978a2ac559a02bae6433afe9c273eeab69c22c8d46b4", + "msg": "54657374", + "sig": { + "r": "0081", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 30, + "publicKeyUncompressed": "049a344a76b4f6c53e8600981b0b012f78202fe6a97b417bd5fd47d8fe834912807d9a598917edf2a79cc59eaa11a2a616ab60d44305499396518067cd2b164b3f", + "publicKeyCompressed": "039a344a76b4f6c53e8600981b0b012f78202fe6a97b417bd5fd47d8fe83491280", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413d", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 2 + }, + "comment": "R: large x-coordinate (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 31, + "publicKeyUncompressed": "042c21614a7c55e9d712d31cfddaece17e07909ff44b88e0842b127be79d2587f551dd7465512e8d4f4e5b45e9d04589e37561db11c15d30e463f14fd2bf822b29", + "publicKeyCompressed": "032c21614a7c55e9d712d31cfddaece17e07909ff44b88e0842b127be79d2587f5", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413d", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 2 + }, + "comment": "R: large x-coordinate (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 32, + "publicKeyUncompressed": "04d0a23e90fb46109c458ba4a649eb0be117fac10f08ab5c36f9b8c480a8156ba67db1d793cc5de9ee5f5abaaa56c26ca1492b6e38188a20607ace54b895c28eec", + "publicKeyCompressed": "02d0a23e90fb46109c458ba4a649eb0be117fac10f08ab5c36f9b8c480a8156ba6", + "msg": "54657374", + "sig": { + "r": "014551231950b75fc4402da1722fc9baec", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 2 + }, + "comment": "R: x-coordinate close to p (Could not recover R)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 33, + "publicKeyUncompressed": "043ac3bf9d50c0cd231b89d2add69ed1f008e649e486a577a44c640b450f16b3a47331fadff20b3c09675ed0ec571653e59a3f4b2d56ce67f893f4053e61742372", + "publicKeyCompressed": "023ac3bf9d50c0cd231b89d2add69ed1f008e649e486a577a44c640b450f16b3a4", + "msg": "54657374", + "sig": { + "r": "014551231950b75fc4402da1722fc9baec", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 2 + }, + "comment": "R: x-coordinate close to p (Could not recover R)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 34, + "publicKeyUncompressed": "04a1397a932b27b569aabcee009d511800aad091b41da111fa8c8dfeb95991647502b45e413298460b78d8801c1a43f68aaac97bea25432fa944dafa16fa4cf94a", + "publicKeyCompressed": "02a1397a932b27b569aabcee009d511800aad091b41da111fa8c8dfeb959916475", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 2 + }, + "comment": "R: x-coordinate < 2**255 (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 35, + "publicKeyUncompressed": "0462391174a0ad4f36065fa243cc21980b8f11032fa8cb22f54bc00d2c4255636f6964c11a9b8910de321eb9121fca75dccc63f4c20c591dac8dc203dd7073ab13", + "publicKeyCompressed": "0362391174a0ad4f36065fa243cc21980b8f11032fa8cb22f54bc00d2c4255636f", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 2 + }, + "comment": "R: x-coordinate < 2**255 (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 36, + "publicKeyUncompressed": "0490c3ac4c9e88c9e990ca80b444909ddb5c6fe9cab46e6e42f47458b900f46ae8496fdc433e254f910f96dde1788614cc53de9b7c94764f9af6e82eaf107af75e", + "publicKeyCompressed": "0290c3ac4c9e88c9e990ca80b444909ddb5c6fe9cab46e6e42f47458b900f46ae8", + "msg": "54657374", + "sig": { + "r": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "s": "2b5ce742f6bd4e12b4983a1bdfe5b6ff13df0737868cfb51b1dba9634f59889a", + "id": 0 + }, + "comment": "R: x-coordinate < 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 37, + "publicKeyUncompressed": "0478194244a6acd1a33d54107c6c932ca4ca9a450000e6b2484174d3f2d8874c1d6202ad9b8cd2f0bd87e51ce28323f137486ba91c177f27c5c05f0d553e254fdd", + "publicKeyCompressed": "0378194244a6acd1a33d54107c6c932ca4ca9a450000e6b2484174d3f2d8874c1d", + "msg": "54657374", + "sig": { + "r": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "s": "00a8e2d4a662c989fe1b71d772e25d72d0a9c74f6cd7db16953fbcdb3677e10435", + "id": 0 + }, + "comment": "R: x-coordinate < 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 38, + "publicKeyUncompressed": "046cd5d78f37ea8eb21d681ccea59348c5cd1d14849b202c25f28c4c8018843172eecff4284399cb83d5d2d0fe4a70a1d1734ce47027f33a34ccfd01b5eedbfdf7", + "publicKeyCompressed": "036cd5d78f37ea8eb21d681ccea59348c5cd1d14849b202c25f28c4c8018843172", + "msg": "5465737420", + "sig": { + "r": "783e92fa46fa31dec0dac399219d651de3bcbebb5f69e328a3ee5778b0f6cc0c", + "s": "58ce68e6a62175931f1d6cd57ea955c01814e2ebf3220c68d8b74d4241dd0e28", + "id": 0 + }, + "comment": "u1 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 39, + "publicKeyUncompressed": "04280aee69248c84e1fc975932c886fb99b16b4242fdd03510b299f5bdf8f3103904cf19878d7874ef30845bc42b07c52da7caaa08df1a752e410705e88c869c33", + "publicKeyCompressed": "03280aee69248c84e1fc975932c886fb99b16b4242fdd03510b299f5bdf8f31039", + "msg": "5465737421", + "sig": { + "r": "0092e395eab9b22e72a1a9d6c8292209394efcf9fa7ef4b15f636c47f84fb0cfb9", + "s": "0092e395eab9b22e72a1a9d6c8292209394efcf9fa7ef4b15f636c47f84fb0cfb9", + "id": 0 + }, + "comment": "u2 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 40, + "publicKeyUncompressed": "04c92d27dbc948e4a88e20ad88e2b1664df5da75429196d84d182a70c9d0ed8bc08a55a0781c0f582d2b6b4378ac6cdd97eb512579fb4bc82a700bb8937ddb100a", + "publicKeyCompressed": "02c92d27dbc948e4a88e20ad88e2b1664df5da75429196d84d182a70c9d0ed8bc0", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "0092e395eab9b22e72a1a9d6c8292209394efcf9fa7ef4b15f636c47f84fb0cfb9", + "id": 0 + }, + "comment": "u1 = u2 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 41, + "publicKeyUncompressed": "040c68deae6f9b8efc7ceabfdae0e97c509b73d09d15ca3fb53558af1a9c022b36cdc73cea13d58085dd006145510f68d8e45f132717ab46469a8a57b9644165fe", + "publicKeyCompressed": "020c68deae6f9b8efc7ceabfdae0e97c509b73d09d15ca3fb53558af1a9c022b36", + "msg": "5465737420", + "sig": { + "r": "744850ae83b4aaf8d8ed7b815f9acfd8f8597a2e1564cc0efed9273a6b4d16ee", + "s": "2c6734735310bac98f8eb66abf54aae00c0a7175f99106346c5ba6a120ee8714", + "id": 0 + }, + "comment": "u1 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 42, + "publicKeyUncompressed": "0404887b3a27acf4ecd0cd99b5aade7bb9411de9b2bd8ee5356b8e44aa6bcc666bbd6d4b560b398ec18992f13cfca60c15e29ea044769e359fcad0600f173d6c2d", + "publicKeyCompressed": "0304887b3a27acf4ecd0cd99b5aade7bb9411de9b2bd8ee5356b8e44aa6bcc666b", + "msg": "5465737420", + "sig": { + "r": "00a84f14e12367ae2ca8f017521dc114ff1c60f88979d17d9df0a4f3ee8c306cb6", + "s": "54278a7091b3d71654780ba90ee08a7f8e307c44bce8becef85279f74618365b", + "id": 0 + }, + "comment": "u2 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 43, + "publicKeyUncompressed": "04e20c10a2132d7d42d123ad5661bb907bf2ac3a6f84225dce48fc4f6413e647ae39a0f6d64a4f3054c6e98cbfc82f926954062a265c9ac4a3d3833ba45a26f379", + "publicKeyCompressed": "03e20c10a2132d7d42d123ad5661bb907bf2ac3a6f84225dce48fc4f6413e647ae", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "75fc6effef0c1e1bd4bf3076ad4afbcf313d12806d965c192f0b77b3faef4d2f", + "id": 0 + }, + "comment": "u1 = u2 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 44, + "publicKeyUncompressed": "04bb8c4a91e1f274d9f7fb508ded04c000793c6161fe331513808c5fc2cf881531fa6a0df300cdffb16bb620e5e1b725777c76abda84d898f380064a35fdc7582b", + "publicKeyCompressed": "03bb8c4a91e1f274d9f7fb508ded04c000793c6161fe331513808c5fc2cf881531", + "msg": "5465737420", + "sig": { + "r": "604fd26382849113d1380d2cab364513de1bd3bc9de85bb06d290988748813ae", + "s": "72ef784ce20b27310a5f24472a3871ea46413ff0e0ce398c32d88e9a5b5bc523", + "id": 0 + }, + "comment": "u1 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 45, + "publicKeyUncompressed": "04c7485a4ce01d67ec0288b56ccb3f5e06529f04905d9604563bddf3586fe88cd57572be3c28e4dd0ea2280edd952f245313dbf0b8ff691ae14a135626e1713ae1", + "publicKeyCompressed": "03c7485a4ce01d67ec0288b56ccb3f5e06529f04905d9604563bddf3586fe88cd5", + "msg": "5465737421", + "sig": { + "r": "00df7558149e892d12fb075f933b9394097e1460d2524fae6dacf306d913965da2", + "s": "4a7c72b18a2db9b0fe57ca86693131587f5c20461b6fe4cf39a6579db1321f36", + "id": 0 + }, + "comment": "u2 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 46, + "publicKeyUncompressed": "04d7f88d637741406f73119445ea8fc87e4e409242c2358267b0c5b4d92fefeb99c81cb58a82a3e3ca49c4aad9567dc8795124739b6536ce04c3de8870e45dc8c0", + "publicKeyCompressed": "02d7f88d637741406f73119445ea8fc87e4e409242c2358267b0c5b4d92fefeb99", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "4a7c72b18a2db9b0fe57ca86693131587f5c20461b6fe4cf39a6579db1321f36", + "id": 0 + }, + "comment": "u1 = u2 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 47, + "publicKeyUncompressed": "0456d1599905df6e0c4e577874537249f80c1e1f8db58b3e260ce4cb9689c1bbee4b13bbf631031c7bfb9400fe5ca00365838044386ad2b6ede32f1ce42ebcdafc", + "publicKeyCompressed": "0256d1599905df6e0c4e577874537249f80c1e1f8db58b3e260ce4cb9689c1bbee", + "msg": "5465737420", + "sig": { + "r": "00e6f1d807df58ec13e69edeed27d5e52856d7abe35333cec1da2373c859c7cf68", + "s": "00a731971959de8a6ce0e2932a8156aa3ea299f9fabc2693d2e71b114a8e593319", + "id": 0 + }, + "comment": "u1 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 48, + "publicKeyUncompressed": "04fbf501a6cf7f7cedbe4f6ec1dd0f3d0ca9543233a037a9d51ca83bf9165a536448276c002c88bb0dcb65cbd2d06789e0b6c739070a2c6fb75d2ebb9895724690", + "publicKeyCompressed": "02fbf501a6cf7f7cedbe4f6ec1dd0f3d0ca9543233a037a9d51ca83bf9165a5364", + "msg": "5465737420", + "sig": { + "r": "00dabd06c887630d14d343f4076210b84ac5ede198140f61b451268869360d0902", + "s": "2542f937789cf2eb2cbc0bf89def47b3f4c0fb4e9b393e876eabd6239a29383f", + "id": 0 + }, + "comment": "u2 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 49, + "publicKeyUncompressed": "04120e05d2bb1621e391e5f7438fd4889eb38400b3e71a8db5a83d802eb60964c2fe9d83cad5ddc040170bb1e526c40b9ba308dcbc1ac37f9c2bf44db2ea36d7e5", + "publicKeyCompressed": "03120e05d2bb1621e391e5f7438fd4889eb38400b3e71a8db5a83d802eb60964c2", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "00f8f5065a317e617437f81d0f8bf001337a2f7179abc5230c03a3d67c95da0639", + "id": 0 + }, + "comment": "u1 = u2 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 50, + "publicKeyUncompressed": "046038db5e172408ee8d79a321770760255879f7afe018e985903e72cfde0600ce5ae7ccbeac2c9240561e97fba3c67b25d1bbdd2956817737af41482a22fbc1ab", + "publicKeyCompressed": "036038db5e172408ee8d79a321770760255879f7afe018e985903e72cfde0600ce", + "msg": "5465737420", + "sig": { + "r": "5cbc22e763a67b4cf8bf94912e7d836bcb52232e8dd9ae43a1a37e5755a02f2d", + "s": "00d398cb8cacef45367071499540ab551eaea46b70b5b79a075376b7ebaf47ba2d", + "id": 0 + }, + "comment": "u1 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 51, + "publicKeyUncompressed": "0472680623c09808f8408089c7a9828ec426fa853c7953faff5a55a0376369a2fc95ba4ce4af4c63da3a33fa18b856c349d9c0a9e3278b32b342494d7e650e4988", + "publicKeyCompressed": "0272680623c09808f8408089c7a9828ec426fa853c7953faff5a55a0376369a2fc", + "msg": "5465737423", + "sig": { + "r": "7c1f1d800600eebbcc8d6b3293e40e04b303c852c1b85cd62a6b7bca0f5a6ca1", + "s": "41f0713ffcff88a219b94a66b60df8fd03d58a49f6c821b2cab37161606dea50", + "id": 0 + }, + "comment": "u2 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 52, + "publicKeyUncompressed": "04962c232703f4cc346ba1f521e387c6dd5c0e2d78ebef4dee85441fb15a21469392c76bd42fa4f71bc90d1a7ebaa562244e6b7dcd480e6a3b196c3951beed73d7", + "publicKeyCompressed": "03962c232703f4cc346ba1f521e387c6dd5c0e2d78ebef4dee85441fb15a214693", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "00e8680e24aafe9f125b64bc78bcc1320572b32f445766a7d07a8c8df44ade86c6", + "id": 0 + }, + "comment": "u1 = u2 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 53, + "publicKeyUncompressed": "04071a24261c48749b79962a34620526b53c6b6709ec8aaf13b5aefbe0fa8b01e609d6dc22b91972ea5816b33d106a3947ac3678157f6b157b57e61de35ce20ea4", + "publicKeyCompressed": "02071a24261c48749b79962a34620526b53c6b6709ec8aaf13b5aefbe0fa8b01e6", + "msg": "5465737422", + "sig": { + "r": "00efc687fcd278ac2215de373bd225b399a3901105770ef2caa7f43102c18d85f5", + "s": "5731d761b37ec2b4eb539e6b922915819b6009da9690716404f6cefb51e03400", + "id": 0 + }, + "comment": "u1 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 54, + "publicKeyUncompressed": "0467f55311d565b49ff51271fddaf5944b97dcaf7db1d4874589666559f749fbfa9f26eb822a91866d61b1d79403a94c0aed4599eb47263133844d5efd13acca37", + "publicKeyCompressed": "0367f55311d565b49ff51271fddaf5944b97dcaf7db1d4874589666559f749fbfa", + "msg": "5465737422", + "sig": { + "r": "00f0b05e2cd0a19d497cb61e4f5d061063177d8b4f8dc6af9e4440bc5d706503c9", + "s": "5a6fe09bba74cb922bc34b3ae0fdfa88c9f564d49aee30486921559410027f93", + "id": 0 + }, + "comment": "u2 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 55, + "publicKeyUncompressed": "04ed0349dd3671226d9dc9b09ba85c74019571418260ccd3e821359d8dab9ec4cbf916ae2d5c5c53dd1f362017638f1cd5655d50f861843fb8134c1fbca11013ae", + "publicKeyCompressed": "02ed0349dd3671226d9dc9b09ba85c74019571418260ccd3e821359d8dab9ec4cb", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "3e36dbef7066b24db38d666d6e5bc7e9ccaaf1bce97e413ef2af11012b03b55b", + "id": 0 + }, + "comment": "u1 = u2 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 56, + "publicKeyUncompressed": "04406ae9e017a60e325f0c0bdbf7164cf5902ecbbe2d39184d0693d1f8d9fc22cb31ebe012b4f7c355c602123dfbc3adcc9c1d73f88fcac21bb9ff51cfe12111d4", + "publicKeyCompressed": "02406ae9e017a60e325f0c0bdbf7164cf5902ecbbe2d39184d0693d1f8d9fc22cb", + "msg": "5465737422", + "sig": { + "r": "774a212a9e9b27f6e4e0bc2a694cd0ce07487f1dcc10f15e883a171f3497c113", + "s": "67844e076bb274d2f39892408ae5734d828fcbb14a31fdae5c8af57fc12af90d", + "id": 0 + }, + "comment": "u1 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 57, + "publicKeyUncompressed": "0417e2e354b2cc787006824b903f17b726c2c7b28a81931e93a8bc10e9fe7d51ae69e6bdb27158b0e658a211307b7b0bd83cf536747a319a4b3e298c4709484cdd", + "publicKeyCompressed": "0317e2e354b2cc787006824b903f17b726c2c7b28a81931e93a8bc10e9fe7d51ae", + "msg": "5465737420", + "sig": { + "r": "00e35b995517725d466c0b3c8a53fc5041f45a8406dd89c1770ae3ee04d3c4ff2f", + "s": "009f54148894e9208b83fdc0b122672324fe13631d931e8cb19747826faf6a6791", + "id": 0 + }, + "comment": "u2 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 58, + "publicKeyUncompressed": "04661c4c61113769688fb45b45a6f37fc5d78ea9a5d0c5af6bc9c631f9bf48698a8e5a07029efad99915dc335e6ee853a820a1d0c45267e9faebb984097d6419a1", + "publicKeyCompressed": "03661c4c61113769688fb45b45a6f37fc5d78ea9a5d0c5af6bc9c631f9bf48698a", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "02a43801a01949598b8245a66af0401742f05fc090835047de86a0a4549d848a", + "id": 0 + }, + "comment": "u1 = u2 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 59, + "publicKeyUncompressed": "04f8f922d9ca88ebbe10e3dcc4242a663b78ddee84fa994b123bb184080d52a6c41fd04b4934fa91b9352a48d2ae9a0301a3414882a9dfba3c331e7daaaccbad03", + "publicKeyCompressed": "03f8f922d9ca88ebbe10e3dcc4242a663b78ddee84fa994b123bb184080d52a6c4", + "msg": "5465737420", + "sig": { + "r": "00a5f2833088b98f843c8f8d710fcd8fadc0e8f37918b90d9c02bc9b27887d1fab", + "s": "61071595e8445ceafb8e1506127a1851ba47f51c961a42e60eadafc52b40d0cd", + "id": 0 + }, + "comment": "u1 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 60, + "publicKeyUncompressed": "042e4b02c899bca9c96d2d6245ec6ea5b6f5ee30f9814a0977fb64aeb6d9eabe168595c17a7dbfdc3659ac82ef5786333bc5976f2259ed33344af07536bca50e1e", + "publicKeyCompressed": "022e4b02c899bca9c96d2d6245ec6ea5b6f5ee30f9814a0977fb64aeb6d9eabe16", + "msg": "5465737424", + "sig": { + "r": "00f3c708b5e5c911989ac06ae8abf5a72abcdbeb2a73f02c9212c6445559dde2e8", + "s": "00b89a6c784ce346a10e76cc27e76f3141f2bf9bbfaa4082f9c64ed9911357f2f2", + "id": 0 + }, + "comment": "u2 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 61, + "publicKeyUncompressed": "0448ccad69e865fa7eb07b26234905513c519c2c6d3a30a0f40adb703362a824fdda5b8616b24d051bed7b5e02a37a59ea50b4479a68a80f3228f864c0fc3bd2a0", + "publicKeyCompressed": "0248ccad69e865fa7eb07b26234905513c519c2c6d3a30a0f40adb703362a824fd", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "1b894170d15c9036109ba55a2c3fc1d8c1618f335309941cde3912c8ced922db", + "id": 0 + }, + "comment": "u1 = u2 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 62, + "publicKeyUncompressed": "04f4e32a306060481563fa915d804bcf126e55a2c5e67a83408d533740c32960e0d135c19e5cf1c1b6c691a9411526f29360985eb6454f5e1db497b5aced96d953", + "publicKeyCompressed": "03f4e32a306060481563fa915d804bcf126e55a2c5e67a83408d533740c32960e0", + "msg": "5465737421", + "sig": { + "r": "00f9b25e6e3c8e540dfdf16d783d0a473d2d943318057f5d5cf5be31055bae6e1c", + "s": "5800065c0696510a9defc69ba0a0e2f223ba74eab107c989c117680026e952f2", + "id": 0 + }, + "comment": "u1 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 63, + "publicKeyUncompressed": "04cbe454685d1733faf2f444964794364e5d1730ca3316b036f6a6170cc58e830e7cd85d7e2de215e042364889e92646daf21dcbcac8744fb183df0fa49c4024f1", + "publicKeyCompressed": "03cbe454685d1733faf2f444964794364e5d1730ca3316b036f6a6170cc58e830e", + "msg": "5465737421", + "sig": { + "r": "00ac8169a68bacc553066b4799e6adc6e7dea8d9e0f5c35871ad8784d7dc10918c", + "s": "5902d34d17598aa60cd68f33cd5b8dd102a2d6db3c3e10a79b3cab22e7eae1d7", + "id": 0 + }, + "comment": "u2 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 64, + "publicKeyUncompressed": "0472fbf5fcbf1588a8b6770870ce0ec90797414620799220a027e471a7a053c12c0e32ac6e77d8cb982ec00546918682d576dd27257349e0c7823751c8bbf908ee", + "publicKeyCompressed": "0272fbf5fcbf1588a8b6770870ce0ec90797414620799220a027e471a7a053c12c", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "5902d34d17598aa60cd68f33cd5b8dd102a2d6db3c3e10a79b3cab22e7eae1d7", + "id": 0 + }, + "comment": "u1 = u2 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 65, + "publicKeyUncompressed": "04f598b9a296a45911f6ab1fd478dd19c9980f737b5494767a9dffa63604d07a19e52eedbf32db46bfaf6598679b8cf08c12c35f392383c68caf81a69aa80e3163", + "publicKeyCompressed": "03f598b9a296a45911f6ab1fd478dd19c9980f737b5494767a9dffa63604d07a19", + "msg": "5465737420", + "sig": { + "r": "65c4be65fbdc9da97d66539efd1f74fc094312bdde54231d4bcdb7fe8b422733", + "s": "4e632e32b3bd14d9c1c5265502ad547e8a85170ec904876a0e63c4084c7c24f1", + "id": 0 + }, + "comment": "u1 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 66, + "publicKeyUncompressed": "04affe23d2ca78ac19e6657c8eb5d8ba3b9a2de9640421a74f07ef0e2a0ef321de37cdd60b430451abb3b5a48b438647b3ff9d6191f656a1b2984f7c866d582a65", + "publicKeyCompressed": "03affe23d2ca78ac19e6657c8eb5d8ba3b9a2de9640421a74f07ef0e2a0ef321de", + "msg": "5465737421", + "sig": { + "r": "6b3b0de0ef323d4e9ec31f6d3c158ec9e8675eeb62f4a1be78cac7f5bfc726b4", + "s": "2989e43e219b8562c279c12587d4e26ae9e01f0fe95f5cbece3ccea150a7f3d9", + "id": 0 + }, + "comment": "u2 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 67, + "publicKeyUncompressed": "047093925b07f66445743c12dea0d3187329b6e242427aea872cc3a75a51f8e0ce1df2796475415b7f1ce7e5f8795dd0e9ba59f657e1bf525db2359b501cbeeb1e", + "publicKeyCompressed": "027093925b07f66445743c12dea0d3187329b6e242427aea872cc3a75a51f8e0ce", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "2989e43e219b8562c279c12587d4e26ae9e01f0fe95f5cbece3ccea150a7f3d9", + "id": 0 + }, + "comment": "u1 = u2 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 68, + "publicKeyUncompressed": "0494ed53794521c163c983a4c7fa9b0c5ec4d4fc3bcb4529d9ba044edce8e24e2676c5e9ad204ef906ed616c6184e82e24e8090b9b9379bb97ad8bef13ea5b621b", + "publicKeyCompressed": "0394ed53794521c163c983a4c7fa9b0c5ec4d4fc3bcb4529d9ba044edce8e24e26", + "msg": "5465737420", + "sig": { + "r": "201ff412480671899b42d42cd6613d77e04dba3f0c1ce83f104bcf68708bdd0a", + "s": "3acbe871057e8ae4a10baf4a93cc614d0f58b5132da734ccb5d7f1c98659e84a", + "id": 0 + }, + "comment": "u1 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 69, + "publicKeyUncompressed": "0466e59ac272cd15ead4abd20896edc5287c2183f3766e39b97d53fad2b141fd272ee8fce8dc534e749f42d05267e3a4c8c60374f61b73989825df62b0c1c66325", + "publicKeyCompressed": "0366e59ac272cd15ead4abd20896edc5287c2183f3766e39b97d53fad2b141fd27", + "msg": "5465737420", + "sig": { + "r": "7768bd22333fcc2997b0325a9d678ef0a04801f621a0353c3bc47fb6e24d7212", + "s": "6ca920c4f48c11309f3d964807cd478fb9277323356c379fcd07140ab6f5e0b0", + "id": 0 + }, + "comment": "u2 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 70, + "publicKeyUncompressed": "0472405cda9af247396da574308f8f260f414c4098166deec554c9a78a462f38094272770c6691fcd90553e33d68041b86d57c44d85d4bbabd5b9096e9232a10ce", + "publicKeyCompressed": "0272405cda9af247396da574308f8f260f414c4098166deec554c9a78a462f3809", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "00e162f355262287286994ce7e68a89a6a56be51cb4eb138a7797c391e26808d0a", + "id": 0 + }, + "comment": "u1 = u2 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 71, + "publicKeyUncompressed": "04aeb7d333d919eab259b0f23f9706f60288b43b8373ea277830f40d10d7675b585da257ac889c0b2ff9a7e23a0d6b51e025a1ad5769921e321174019a4a518ca2", + "publicKeyCompressed": "02aeb7d333d919eab259b0f23f9706f60288b43b8373ea277830f40d10d7675b58", + "msg": "5465737422", + "sig": { + "r": "0087e9e46929047f2ecd14a409857c1a872afaa41c8965f925db5bb3c166faa507", + "s": "445fc28c8982255c587958eb8a9a74d45a4298358146e86fdf88aa807a9f8989", + "id": 0 + }, + "comment": "u1 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 72, + "publicKeyUncompressed": "0470abe7ffe0438d8fb679512b34fbb67e6f428fe2fd1401d4a223ebdf3c03775e25a9b13337a8cca87fa207a230ba9d0c5252fdff83fe185d0a6368245e0bd9ea", + "publicKeyCompressed": "0270abe7ffe0438d8fb679512b34fbb67e6f428fe2fd1401d4a223ebdf3c03775e", + "msg": "5465737422", + "sig": { + "r": "03ce4a855a3179c3dac0171f45990c1c2dade420cf2b031db9b76fe1e8e63edf", + "s": "009701b173f05b6d403a640b51f913533d8dc9c1c5ee221dd27942ea483696b952", + "id": 0 + }, + "comment": "u2 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 73, + "publicKeyUncompressed": "04f119b6a464d885f91a69ee8d540da3f4948406e92f1a1515e2019fb2b1ada59707487c3471f19cc198f8cbdf39ee1af8af25f842fe81ff908930226b0f26bafc", + "publicKeyCompressed": "02f119b6a464d885f91a69ee8d540da3f4948406e92f1a1515e2019fb2b1ada597", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "009392c4eadc01bcaa623ef3ef33b3aa9465eb8574c361ed503c302b7d724b3c07", + "id": 0 + }, + "comment": "u1 = u2 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 74, + "publicKeyUncompressed": "04a6fd09148fd3450bb7ee4495b5e34d33cd19b8640ca6a1aa6a73cbbd375b4852a2fbc53de08b6b350acafaae50344c47eb0cb86f19026ec134a9e52ab60b6b66", + "publicKeyCompressed": "02a6fd09148fd3450bb7ee4495b5e34d33cd19b8640ca6a1aa6a73cbbd375b4852", + "msg": "5465737421", + "sig": { + "r": "00f627daa0761d1193d3cf2e8be9d03d32a910dfca80dc19dcedd33b0d38ae1209", + "s": "00fb92d4ef549954ea224408b2f21f8e36373de0bcd42fb6df5fe4971db5c93cf3", + "id": 0 + }, + "comment": "u1 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 75, + "publicKeyUncompressed": "049e9025a35c95fea89eb01132400a05e23a5c74c347a00bbd7f0414f07bb4d06b9d06f5d5eb08607ddc4c63314ff33080ec2bfc6ed2c624ac7e64992218e69ada", + "publicKeyCompressed": "029e9025a35c95fea89eb01132400a05e23a5c74c347a00bbd7f0414f07bb4d06b", + "msg": "5465737420", + "sig": { + "r": "00ae40410576751b1037f8d5452c850f0181a3c5f19a3c3b07d28d483cacc8dff4", + "s": "00f3f910e0477958efca3cae0f02793bd141c9da37c77a553f81e291e0b42363fa", + "id": 0 + }, + "comment": "u2 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 76, + "publicKeyUncompressed": "04f5a7e634ea317e1f4419cadbfb5f7598148bc98223fc294c81f372ba83a62ba35bdf4fe3b99d5fdda8419077c1b6f254962827b83481b76f57fc7826ec1a4150", + "publicKeyCompressed": "02f5a7e634ea317e1f4419cadbfb5f7598148bc98223fc294c81f372ba83a62ba3", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "28154bbb734e869893bcaba7e2458a408e18b0109e7ea21eceb0ae628231ad2c", + "id": 0 + }, + "comment": "u1 = u2 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 77, + "publicKeyUncompressed": "04952f3c585f0392802376305daaf8fd8635e806b56bd6c7b302d08d95002affe14691c6518f15374af5c59ab1c65f3fe3405b3e6e3694eea08c626fbc8bcf2e0b", + "publicKeyCompressed": "03952f3c585f0392802376305daaf8fd8635e806b56bd6c7b302d08d95002affe1", + "msg": "5465737420", + "sig": { + "r": "00debee70ed8d882c7cb9702378c2964303dfd1523e13b4a91accb979aeafb7300", + "s": "00841f49ddca76f445fcdd406fabb78711d69ed6428a0317c60dbb7c30eb908772", + "id": 0 + }, + "comment": "u1 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 78, + "publicKeyUncompressed": "04c4524c43949220658ff411828469f62f5b3805f5dcc925c6322bae8942cdc00197ecc84e9d9add3e42c3e74f58d10644f4d02f76062f149c1b81a0c5f753f418", + "publicKeyCompressed": "02c4524c43949220658ff411828469f62f5b3805f5dcc925c6322bae8942cdc001", + "msg": "5465737420", + "sig": { + "r": "30619b5c6ae8fba0f8a110396ae2c1cfb8763496f2d2ce0906a9c9b99d99265f", + "s": "34b6c8ee237fa7ac8118b31bcb4531c7691c65b7af8a26fa19f9aa22324b9232", + "id": 0 + }, + "comment": "u2 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 79, + "publicKeyUncompressed": "0497e465b4af1ebfe3fd5a80a93f1b5622ad2f798963e9f775f5727ccfe2a74bde7c13a59c2db034160920c39c0d33b8cb99c0473b9e54166c1c94bdf1eb0fb467", + "publicKeyCompressed": "0397e465b4af1ebfe3fd5a80a93f1b5622ad2f798963e9f775f5727ccfe2a74bde", + "msg": "5465737421", + "sig": { + "r": "2c00032e034b28854ef7e34dd050717911dd3a755883e4c4e08bb4001374a979", + "s": "1913f315804cd89deb54e94230001f87c2b77b810b1b3f3d386dc550820a900b", + "id": 0 + }, + "comment": "u1 = u2 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 80, + "publicKeyUncompressed": "04ce345825434ba79d60e792015e547c4321d49cbe52048e33fa88fa6e4b866399e6d1c686eb8fa5a3a8e69108b8fd2fcc5ec87df4f8d343d5b7cf39ea8cde8f16", + "publicKeyCompressed": "02ce345825434ba79d60e792015e547c4321d49cbe52048e33fa88fa6e4b866399", + "msg": "5465737420", + "sig": { + "r": "00ed553981b8b169008e15540dec3ce4a131f52ee6291e03f0658abe5dbb1a48c8", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "A = B", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 81, + "publicKeyUncompressed": "04573b528c2fe0e903820c280f4c1adba29ea5d6e8e07ebf053d911a6e621246de5091dcbc4bbf0e42ae2e6d8c21800661b3a541f15e574ba0befd0b52f8afe0fc", + "publicKeyCompressed": "02573b528c2fe0e903820c280f4c1adba29ea5d6e8e07ebf053d911a6e621246de", + "msg": "5465737420", + "sig": { + "r": "144badc1e5bcc7e9387203787c00250ca7e761743e6af718128113d2a221c7e9", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 0 + }, + "comment": "B: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 82, + "publicKeyUncompressed": "04742b7a8771057e6cf3cecac04e938784f2cd11cb77fdd4ca6c76f458fef8ce7e25ff1fc38ce228ccd5a6b41c5efde278f72904e6eee6f04433710e77ffa908c6", + "publicKeyCompressed": "02742b7a8771057e6cf3cecac04e938784f2cd11cb77fdd4ca6c76f458fef8ce7e", + "msg": "5465737420", + "sig": { + "r": "046bc0ce1bd2650ceae1f2db1829115342fe79a56ebbb590400c5ed42939def7", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 83, + "publicKeyUncompressed": "042a0d07c1115f810cab89070f7f9a5ad58fdf1c96a906f778c5f2f8ef15b5de8424186b275480406d8a59577c075df877ea5aaa2db0dc3cb48957707234e45be5", + "publicKeyCompressed": "032a0d07c1115f810cab89070f7f9a5ad58fdf1c96a906f778c5f2f8ef15b5de84", + "msg": "5465737420", + "sig": { + "r": "009a6720177f419cfe6f4c786dacdad03533b2f676f83656681fd9f771388fe64c", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B: small x coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 84, + "publicKeyUncompressed": "0420603e7585d82f67cbcd4ac35b21d30b21f06b49a2f7b816bda23b1be45f5d46557f684fdd0bdf8ac1a49b6fe665e3d82500493d0808bfa0b4a1ac4d9d7660f0", + "publicKeyCompressed": "0220603e7585d82f67cbcd4ac35b21d30b21f06b49a2f7b816bda23b1be45f5d46", + "msg": "5465737420", + "sig": { + "r": "00fb95db58fa45eaa85d71ce11ab48567beb9f407d3dedb5a6ea9cf038a8ee4ac5", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B: small x coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 85, + "publicKeyUncompressed": "044830258f917edba2a9d7bfcf1ccf9bdc8f8de5fe4600855bbd7746f4f23c883b5bb64223491643d037b020631156faa735455b711ee3ef03b43ee0846633247c", + "publicKeyCompressed": "024830258f917edba2a9d7bfcf1ccf9bdc8f8de5fe4600855bbd7746f4f23c883b", + "msg": "5465737420", + "sig": { + "r": "008a87051a235c55f267c394b59ad62c40e3fa812b089c3049b436b163912f09b0", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B: large x-coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 86, + "publicKeyUncompressed": "04d5b9b3c9e58c592c84a1564f512eb1a164f1d5c6476970bced99e6d06082da50e1669ba354b79713cb668082b0bd02cfc14506f49ac507467063486c2961a929", + "publicKeyCompressed": "03d5b9b3c9e58c592c84a1564f512eb1a164f1d5c6476970bced99e6d06082da50", + "msg": "5465737420", + "sig": { + "r": "3c1adce9b5050e1a2b8f375d1637b49a53b2990d93c351ddfc9e6009050fc347", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 0 + }, + "comment": "B: x-coordinate close to p", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 87, + "publicKeyUncompressed": "040b057d15a478696c1bd04432624864b047f6bae78a8ea925b1a5d8ee24fdcf51e7d1f19fa6e000bc29469565f9244509168f8bddae1c266cdc483812cf664e17", + "publicKeyCompressed": "030b057d15a478696c1bd04432624864b047f6bae78a8ea925b1a5d8ee24fdcf51", + "msg": "5465737420", + "sig": { + "r": "74aff12da7dfeae7746d870edbc1cb9ea2a4f2b0fb013130ba09a1d50e56f42e", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B: x-coordinate < 2**255", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 88, + "publicKeyUncompressed": "045429662e5b6661eb44ad6ecc5f486ce599382178e52a9692d928e20ffc6bf6930d88e06499dc015d6ddfe3fdb220bcf247bc06a2fe214f4a58cd48b8ea380703", + "publicKeyCompressed": "035429662e5b6661eb44ad6ecc5f486ce599382178e52a9692d928e20ffc6bf693", + "msg": "5465737420", + "sig": { + "r": "00f319f81eb38efc94082a89aece17c47e7348bbc30d7373a3f6c88ed205d69b86", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B: x-coordinate < 2**248", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 89, + "publicKeyUncompressed": "049529aae8dde7e06113eb5d9677b9298aa47952596dbe3acf0dfb8bfd007269ebb32db531c46d17da528439e368da2f7a64e590b85f7472062d8d507ff599d7ef", + "publicKeyCompressed": "039529aae8dde7e06113eb5d9677b9298aa47952596dbe3acf0dfb8bfd007269eb", + "msg": "5465737420", + "sig": { + "r": "4fa07c8ba666c930929e8ba01bf4b31f910a688f25451636f6f1535b84743176", + "s": "58ce68e6a62175931f1d6cd57ea955c01814e2ebf3220c68d8b74d4241dd0e28", + "id": 0 + }, + "comment": "A: g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 90, + "publicKeyUncompressed": "0473b3e7a0bede8c06f12f2b3cbc471a1291c438a49a070d75240f84bacc04b835ca943a572ad36355bb8f663c43feb81f3d83edc0a5738a07227a7352b75eb9db", + "publicKeyCompressed": "0373b3e7a0bede8c06f12f2b3cbc471a1291c438a49a070d75240f84bacc04b835", + "msg": "5465737420", + "sig": { + "r": "00c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5", + "s": "58ce68e6a62175931f1d6cd57ea955c01814e2ebf3220c68d8b74d4241dd0e28", + "id": 0 + }, + "comment": "A = B: g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 91, + "publicKeyUncompressed": "044d65accfa66c1e6ce5677e6015e05bebcf7afd283d31d610b3ea21eb3b5f85d29738d7b5de0497b1b76ee62dd0929c1c17dfe2030c6a70f8cf39441ab5494e19", + "publicKeyCompressed": "034d65accfa66c1e6ce5677e6015e05bebcf7afd283d31d610b3ea21eb3b5f85d2", + "msg": "5465737420", + "sig": { + "r": "2690f53ca7c56a0bdf2d20307d21edfd866cb45ba0531eea0d30bef7501b3c4e", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 0 + }, + "comment": "B; g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 92, + "publicKeyUncompressed": "0425bef21d64f004f3248ed7d3dcc43a93270a5d34c3a75de7b461bfb30fae27ffa2ba4e7abb788fd325ab7ca1ba157bab6e0b138ea5bc9e8c4dd905b4a3e5ffef", + "publicKeyCompressed": "0325bef21d64f004f3248ed7d3dcc43a93270a5d34c3a75de7b461bfb30fae27ff", + "msg": "5465737420", + "sig": { + "r": "00971e47e32e786b61c27ad4acc0380697d6c3ecaf7d8a2bed04f06c1010c267b1", + "s": "00a731971959de8a6ce0e2932a8156aa3ea299f9fabc2693d2e71b114a8e593319", + "id": 1 + }, + "comment": "A: -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 93, + "publicKeyUncompressed": "0473b3e7a0bede8c06f12f2b3cbc471a1291c438a49a070d75240f84bacc04b835ca943a572ad36355bb8f663c43feb81f3d83edc0a5738a07227a7352b75eb9db", + "publicKeyCompressed": "0373b3e7a0bede8c06f12f2b3cbc471a1291c438a49a070d75240f84bacc04b835", + "msg": "5465737420", + "sig": { + "r": "00c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5", + "s": "00a731971959de8a6ce0e2932a8156aa3ea299f9fabc2693d2e71b114a8e593319", + "id": 1 + }, + "comment": "A = B: -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 94, + "publicKeyUncompressed": "04b36d0762576f03fb9c1df38cbe7c909bea0af427fd8710a7b553ee25e8364d0dc25648084d62f12d26ace2fcee65a473c9af1f363eb6c3f4c5711310434a0bc1", + "publicKeyCompressed": "03b36d0762576f03fb9c1df38cbe7c909bea0af427fd8710a7b553ee25e8364d0d", + "msg": "5465737420", + "sig": { + "r": "33aa6556c6e454fa62b9a6ce00c49f14893a042cc794e6750eccc7741b2a48a4", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 0 + }, + "comment": "B; -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 95, + "publicKeyUncompressed": "0407e7a84191959e3e00ad07cd5f110bfa71788a924cbe4d7c22103605c6640ca6d9c3497d621a2ab50566c017324c4708c5f3d3921b15bf6f9d106634b69aadfa", + "publicKeyCompressed": "0207e7a84191959e3e00ad07cd5f110bfa71788a924cbe4d7c22103605c6640ca6", + "msg": "5465737420", + "sig": { + "r": "00ed42889d317238391339a559e092a4d09aced855ac7665e456b368eb8984f31f", + "s": "2c6734735310bac98f8eb66abf54aae00c0a7175f99106346c5ba6a120ee8714", + "id": 0 + }, + "comment": "A: 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 96, + "publicKeyUncompressed": "042b027a5c7d007543d495ab3a715df5c826f45c93841ac1214597d07c008124f32ce2723445d725cb0f4049fb0075227485dd9e44f41239bab4c5ce0a452b1e6a", + "publicKeyCompressed": "022b027a5c7d007543d495ab3a715df5c826f45c93841ac1214597d07c008124f3", + "msg": "5465737420", + "sig": { + "r": "00e493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13", + "s": "2c6734735310bac98f8eb66abf54aae00c0a7175f99106346c5ba6a120ee8714", + "id": 0 + }, + "comment": "A = B: 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 97, + "publicKeyUncompressed": "04bc3c7a8b679eeaf3e14be0a219fd0103e09207bdcb2a07fdfc9056e8e69f1221b795b4c184238148f2a184c107b2c41425a1928b3bed1c9534b9b0fa98a619af", + "publicKeyCompressed": "03bc3c7a8b679eeaf3e14be0a219fd0103e09207bdcb2a07fdfc9056e8e69f1221", + "msg": "5465737420", + "sig": { + "r": "6b939a339ccd144470743088d9790359d3d5136bf802f467d1524a14c850fcb9", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B; 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 98, + "publicKeyUncompressed": "04fa8ce5e37d714fbfe23ea596afa201021bd1802c2d56d9357cb2c2a82b0242357038d86fb477b3eeca01e117bc5fa417b99e0c8f8b6bdb381ed7c7540d1d7891", + "publicKeyCompressed": "03fa8ce5e37d714fbfe23ea596afa201021bd1802c2d56d9357cb2c2a82b024235", + "msg": "5465737420", + "sig": { + "r": "00a1874882e7165aa52a7c255fa05152b6da76c04ae55751c516f424acd7bfcfa5", + "s": "16339a39a9885d64c7c75b355faa5570060538bafcc8831a362dd3509077438a", + "id": 1 + }, + "comment": "A: 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 99, + "publicKeyUncompressed": "04b321708e6ec2ca422ccde6bfaa1efc11d97cb77647c821d71ded82201c0efde892cb41adfe1a0a8c2ce082f5acae3fe5cae0ea18bfd529db8bb6ffc3d7b05b87", + "publicKeyCompressed": "03b321708e6ec2ca422ccde6bfaa1efc11d97cb77647c821d71ded82201c0efde8", + "msg": "5465737420", + "sig": { + "r": "2f01e5e15cca351daff3843fb70f3c2f0a1bdd05e5af888a67784ef3e10a2a01", + "s": "16339a39a9885d64c7c75b355faa5570060538bafcc8831a362dd3509077438a", + "id": 0 + }, + "comment": "A = B: 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 100, + "publicKeyUncompressed": "04d332e035d6e2a18bcdfb326cd27e975829f2741abe663520ce9baeac38202d08c0a8f70fe8b16e34b97986d691c4b3778352dd33ba6b2149f9e4e49c21f05c3c", + "publicKeyCompressed": "02d332e035d6e2a18bcdfb326cd27e975829f2741abe663520ce9baeac38202d08", + "msg": "5465737420", + "sig": { + "r": "65363e90e7761899428cf8698eab0ba014970de9880ab8b9d556cab0225c8e66", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B; 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 101, + "publicKeyUncompressed": "04f475ce1a1ddf5a48706da5b45c33f0fa8be5b6af18c4a0fdb469ffad0fe5e7917c938f9e8021defa40f4f4ae9fe1ee288c83aeed56b011f34b473a4db3ab2589", + "publicKeyCompressed": "03f475ce1a1ddf5a48706da5b45c33f0fa8be5b6af18c4a0fdb469ffad0fe5e791", + "msg": "5465737420", + "sig": { + "r": "06c5213afde7d6fc975f4f5d20139eb1991d455972651e14ca2be83a3e8e8e4b", + "s": "4e632e32b3bd14d9c1c5265502ad547e8a85170ec904876a0e63c4084c7c24f1", + "id": 0 + }, + "comment": "A: g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 102, + "publicKeyUncompressed": "049662f73402ab979c49c72fcf392d543a598dc141d3490265863029bd31bab4499c72775be1b79f6de51584a5628def1fa5dd28de2ce0ff392c83444d31f1744a", + "publicKeyCompressed": "029662f73402ab979c49c72fcf392d543a598dc141d3490265863029bd31bab449", + "msg": "5465737420", + "sig": { + "r": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "s": "4e632e32b3bd14d9c1c5265502ad547e8a85170ec904876a0e63c4084c7c24f1", + "id": 1 + }, + "comment": "A = B: g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 103, + "publicKeyUncompressed": "04a637d3ca5d6a1e16e84650a7317d2c3e641ebb179eb217eb94cc453f672463d4e7187c9ff0bb1e53f6983548c526e66cdbb812427893f3fdb1c46a31df3740ef", + "publicKeyCompressed": "03a637d3ca5d6a1e16e84650a7317d2c3e641ebb179eb217eb94cc453f672463d4", + "msg": "5465737420", + "sig": { + "r": "03480d375c35c1de6f8da62813131d14c7314b44867b0454728a8a6b22e19e8b", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 1 + }, + "comment": "B; g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 104, + "publicKeyUncompressed": "04311165a46d6a2bbcd2b8bfc73c91e055661cbacbebfd25e2b02b7fb897fb536550c430205f7f5cb69792efa844ee5f8005300b8be7901c2c7feeff002bc2c34a", + "publicKeyCompressed": "02311165a46d6a2bbcd2b8bfc73c91e055661cbacbebfd25e2b02b7fb897fb5365", + "msg": "5465737420", + "sig": { + "r": "0095099bc14e4ce3ac06327e8b32d35e126faa2f0bd2fab215afcdd753cac7a8bc", + "s": "00b19cd1cd4c42eb263e3ad9aafd52ab803029c5d7e64418d1b16e9a8483ba1c50", + "id": 1 + }, + "comment": "A: g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 105, + "publicKeyUncompressed": "049662f73402ab979c49c72fcf392d543a598dc141d3490265863029bd31bab4499c72775be1b79f6de51584a5628def1fa5dd28de2ce0ff392c83444d31f1744a", + "publicKeyCompressed": "029662f73402ab979c49c72fcf392d543a598dc141d3490265863029bd31bab449", + "msg": "5465737420", + "sig": { + "r": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "s": "00b19cd1cd4c42eb263e3ad9aafd52ab803029c5d7e64418d1b16e9a8483ba1c50", + "id": 0 + }, + "comment": "A = B: g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 106, + "publicKeyUncompressed": "047a9cf8489debcd1cc00ee3f767edeb6daf804422826722a4c7ad3fc7c9d3a261e1943e6231a1f48df5e592340c0d2b01fe6a609ef31d2c8512650c0659b00092", + "publicKeyCompressed": "027a9cf8489debcd1cc00ee3f767edeb6daf804422826722a4c7ad3fc7c9d3a261", + "msg": "5465737420", + "sig": { + "r": "00e679646f95ed00fd9bf207508a88eb6600d181609a986da9e70127bd1f6cfbdb", + "s": "623cfca78bab9aff41a3cf6469e1795dca46a165c809836c179eabac54c9ee23", + "id": 0 + }, + "comment": "B; g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 107, + "publicKeyUncompressed": "04ad010f2e8c78d85db0744332a791bb2ce6099fc045338c045edd198c2f312eef1e3181b10c695c65ed5438051e74c11074a3cac80f27a8ffa92a08458a64853b", + "publicKeyCompressed": "03ad010f2e8c78d85db0744332a791bb2ce6099fc045338c045edd198c2f312eef", + "msg": "54657374", + "sig": { + "r": "00e210cc0b9db3e616e12d707f5b2fed00f7b4db975220017686ae2fd6555eed07", + "s": "1097ba6ca203ef0b49e8577471897adf8294b1d937c7c0c246423b3ef07e6405", + "id": 0 + }, + "comment": "point at infinity during verify (invalid signature)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 108, + "publicKeyUncompressed": "0487473d2049013cf2e9f2a42006ef7e1a506fa41cd72928bdf0a08487e210d84209dcdea60876f3077693d0e6ce704ca0027579c40086dace4204cb869e5fb9ca", + "publicKeyCompressed": "0287473d2049013cf2e9f2a42006ef7e1a506fa41cd72928bdf0a08487e210d842", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe", + "s": "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 109, + "publicKeyUncompressed": "0498fda9b49a827001274d4d6fbe94925b55276628147194d50309bff04ed4def25403e28f796f40df7bff90d34b4bcd626ef0694a6390ad10d7e0d4fb6cdc50ce", + "publicKeyCompressed": "0298fda9b49a827001274d4d6fbe94925b55276628147194d50309bff04ed4def2", + "msg": "54657374", + "sig": { + "r": "014551231950b75fc4402da1732fc9bebe", + "s": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 110, + "publicKeyUncompressed": "043f3ac1198b7e2024cb2fe066fe9753a32c95e69fc49bddc7fc8d9fb0cbead864c1382f321278db863c7802c02d2fa8b6991c8eef59425e0b80c2b6572ac904d1", + "publicKeyCompressed": "033f3ac1198b7e2024cb2fe066fe9753a32c95e69fc49bddc7fc8d9fb0cbead864", + "msg": "54657374", + "sig": { + "r": "014551231950b75fc4402da1732fc9bebf", + "s": "010000000000000000000000000000000000000000000000000000000000000000", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 111, + "publicKeyUncompressed": "0468864c719fff6194fa830b364261ecfd3cd7def45da47c238d0a374cc44f29d05919d8bbd61c8b813917a68f50cb3e4ef7a4a50d30799ac568af22e13c457f40", + "publicKeyCompressed": "0268864c719fff6194fa830b364261ecfd3cd7def45da47c238d0a374cc44f29d0", + "msg": "54657374", + "sig": { + "r": "01", + "s": "01", + "id": 0 + }, + "comment": "point at infinity during verify (invalid signature)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 112, + "publicKeyUncompressed": "0403ac59f741aca44e66a68bc14b9ae91d063b610b1f2bb5c8ca53e456c35d0545811c3bc1ad08df64784b1c0e60258695f17e7831f38ec8d9964862519000d1eb", + "publicKeyCompressed": "0303ac59f741aca44e66a68bc14b9ae91d063b610b1f2bb5c8ca53e456c35d0545", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413d", + "s": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 113, + "publicKeyUncompressed": "041b55fe1f2f8bf763c554bfec6a4127024512b28b11af74e993c071d6101dd72c39b536feb9c7bb7598880bad3eab2228e67b47d116e9f09988a81e35bfa447c8", + "publicKeyCompressed": "021b55fe1f2f8bf763c554bfec6a4127024512b28b11af74e993c071d6101dd72c", + "msg": "54657374", + "sig": { + "r": "00bc1048303f50787738b31fb8be51b5d92e5a2d66d125817d7c5bc725dc8f3636", + "s": "00ffffffffffffffffffffffffffffffff661eb7000659c50ff88609f7cf4ec28d", + "id": 0 + }, + "comment": "s too large (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 114, + "publicKeyUncompressed": "0455e23d299bb6c265145ae12c19827e977cf316545099d9b9eba892d84ac445a9caa70da878fac4e9d094324da0f084a84980386e3ab3dd771029300066e1aaa2", + "publicKeyCompressed": "0255e23d299bb6c265145ae12c19827e977cf316545099d9b9eba892d84ac445a9", + "msg": "54657374", + "sig": { + "r": "00bc1048303f50787738b31fb8be51b5d92e5a2d66d125817d7c5bc725dc8f3636", + "s": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "id": 0 + }, + "comment": "s = n+1 (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 115, + "publicKeyUncompressed": "044d18ae600d3d8186b0386cc455d30afbe1328be74e86cde1b0a24ef2bddd9bdb2614cf5db6e45adbfe5bf1290a5370576237aaaf52ebc012fc4cbc13b0a9eb5a", + "publicKeyCompressed": "024d18ae600d3d8186b0386cc455d30afbe1328be74e86cde1b0a24ef2bddd9bdb", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "s": "426393ac4c3118aba18027f740750d1da1f4e97a1d46cdc3a35e498b75457613", + "id": 0 + }, + "comment": "r = n+{Rlow[0]} (Could not recover R)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 116, + "publicKeyUncompressed": "0457e6cf235ed3b63c25d4954a99a3ad2a88a619600e07278af429eaa2670884d2ea26aa01b697b2b43af0f65974d0bca65c7d6d592a215f476dacf7cb57d480bd", + "publicKeyCompressed": "0357e6cf235ed3b63c25d4954a99a3ad2a88a619600e07278af429eaa2670884d2", + "msg": "54657374", + "sig": { + "r": "00bc1048303f50787738b31fb8be51b5d92e5a2d66d125817d7c5bc725dc8f3636", + "s": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 0 + }, + "comment": "s = 2**256-1 (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 117, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6ea128df5", + "sig": { + "r": "0080b0660d2689851df208c6714ba6f86a3adf7a4688b4543b309f249c9dd7200c", + "s": "1750e1b34ab6441518b0bce1285151e19b6428d3c3a39b9376e5177a8e247b84", + "id": 0 + }, + "comment": "special hash:cntany", + "valid": true, + "flags": [] + }, + { + "tcId": 118, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad78c580fa", + "sig": { + "r": "7bf52a66dded914830cf79efde6627914ea70f4a1ee15b8375a1631ca6b879c1", + "s": "3c329be028a7fb31d83d1940a7fae813435e8339fbef3946792d5408a554a7ac", + "id": 0 + }, + "comment": "special hash:cntany", + "valid": true, + "flags": [] + }, + { + "tcId": 119, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad4c3b2207", + "sig": { + "r": "00f4331bb83ca6d9cc335cd75aba67c4ace136f09559596afc2415cc1b3cc74f7d", + "s": "4bd3ebe0861b09ab52b9d59500488fb82583227f0ba5610fa01ccae850fd1ff6", + "id": 0 + }, + "comment": "special hash:cntz", + "valid": true, + "flags": [] + }, + { + "tcId": 120, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b505a66420", + "sig": { + "r": "00c06bc70a5d48fec4893674d9606c71c4bea02127efdcd5f65a2069394fd78f0d", + "s": "7b03c2b69637c887e4f774a96189027a10be26fa5feafb32e640dcf32304d1c3", + "id": 1 + }, + "comment": "special hash:highcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 121, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a60e419d57", + "sig": { + "r": "00ca57f2cf198e8f01a6948510e32d6ac9ef63c597c83681cfac563dbbfcf05b87", + "s": "00ad1b5ce8c6b4eb1d51e9e3a2f154df4d4fe329fd50e8c91d042e4a285c191673", + "id": 0 + }, + "comment": "special hash:highcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 122, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadf0e16d16", + "sig": { + "r": "7edecfa770d8e33f3a42aaf860d2ed33f48061dca36b5c02b11681d267c4b8b5", + "s": "1c0759d5db2c775b4eb9d00814ce5494ca6147266d37e72c936c90b56a87a72a", + "id": 0 + }, + "comment": "special hash:highcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 123, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b53a00f714", + "sig": { + "r": "3eab94a5cec32cca0520a3006721bf758b47710cc9d01696fe9d4427ba55d2af", + "s": "6eb95e9763f7021097924ea4cf8dfa3bd8253517566a93670fa3701a8cfb323f", + "id": 1 + }, + "comment": "special hash:lowcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 124, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a66709b065", + "sig": { + "r": "00f6f282899486b246df72ce10dc13809cadd49e04a0960b645873dfa49046c62e", + "s": "00af4c68234bd67ddcfd709e20453afa01a5730ceeb9a5443d7d4f54742d140b55", + "id": 1 + }, + "comment": "special hash:lowcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 125, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad623b7ec1", + "sig": { + "r": "14a34f8c00c8b1b01ff63c292df32eecbe3b96a1f14c476f876fe74ae3a60107", + "s": "00bee797030f8f36f03efd9d059471f05fc78e1fd0a3d9cd967d19de5178a0228e", + "id": 1 + }, + "comment": "special hash:lowcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 126, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b52241bf15", + "sig": { + "r": "009bb9c7637fcf5c8e30509ac4c44afbf3bd5cd78608a235894b2496a0b3f6dd36", + "s": "00ec3d21dd8987c3178cf9d1d8cbf641e05ec313db0a702746a6a334246cbb04f6", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 127, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a61950beb3", + "sig": { + "r": "00f67a25d66416d8e5785e0255464e406d2884565c346cadda6b9be61da58ebcc4", + "s": "00c2d58bf7a2a7f42abf7687d0fbbd51e421fb32d3e9edd742f2facc03c3942232", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 128, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a67a082ef0", + "sig": { + "r": "1e52003d8d6a62d10b37a4140634d179c07586b7fce2f9c2da3d8be491eda339", + "s": "0cf8db5e7886cc945dbbb3afa13c29e73fc93bb6828a3809e6389c31dcb4148d", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 129, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6933d5b5d", + "sig": { + "r": "00eaacddf894f15911d965b900ecf5ab58435eeadbe9fadddaaf051ba917af89e9", + "s": "00f17dbadd9bec8b7ba71d38022e78fd4b179df116802598680f99f912239fa68f", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 130, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad32bf7072", + "sig": { + "r": "21ed7f49cb17a37b18aa2fe26d2caceebfb2e66b60fecbbf1d223ed75f37f3bb", + "s": "00ef80a4533be08a2a88e40b9f6b0106ecb71d952a3180c6d0931fc16cd48cdaba", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 131, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad50912efc", + "sig": { + "r": "00b356cbacf40554945ab73a3258441bc6c0bd508f460f9557dabb527a5f5ff21b", + "s": "00a0f7cd971de8db33f47d7fa2202023ed4a8af1960e51c15fa7e92604928f66d7", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 132, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad6d4daa23", + "sig": { + "r": "0091d47e81f9056272c39b407a6f0d852195c5e875ff8a2a33e7a44cdf68bc89ed", + "s": "009b26679effdcdef9ccf49d087a9cf95690d034bb204c6fd868d8b009bac58182", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 133, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "7a4fb3250aa05393", + "sig": { + "r": "00c9d9846713e95fe6142fd124c3bebfb2b67eda75cd095e9a2e5af6bce88c827f", + "s": "009a88bac30ada510da37c26d6356c8d9114eb75f3ff22e186c60959cbe2d9fc13", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 134, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "7a4fb3250c91f0d0", + "sig": { + "r": "758358303b4bf67af9f288a0bbe1c2fab06216e44eb81fc16d3434fc13724076", + "s": "24036cebbde36b3796db50989c8224d058387b8d100673cf8922ff850c1127c2", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 135, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "a14672e603ab2a8e", + "sig": { + "r": "65504c6addcbec97d1e03004b687d00eda8b8c935aafb4577e2a23b031ad93b2", + "s": "67312bdf302746478cdfaf078cbb4123d1e8471ff8faee8cfced3a3062168a10", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 136, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b506e3e5cd", + "sig": { + "r": "00c8665cbd10d06282b4cb81cc695f84b05a3083d5d7975a00e00715689140684b", + "s": "00c01a9c8ae7ab6b2204b43aa54bd3afcca18c6513ab9c2d7d02a477fd61f095b8", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 137, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a604fa6bae", + "sig": { + "r": "00d51f4cfdce68fce1d4c15f3b76a661c1ee754b6baec31d3e533e54ba838ddc2a", + "s": "00ed65c4be03b51c4ceb4062b678e389232e186a98a233b98ffa42843f3bf22efb", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 138, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a634f58a08", + "sig": { + "r": "4461985cbccd129521cfdcdc0c43a7e58d55bc908301d7ae384b46f036dbe51c", + "s": "00e68664acdb3ef8dba6e6927af2d8809239312c7a1cf20fbbfeda7c7fb1ab444c", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 139, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a68713bbaf", + "sig": { + "r": "00c7e8cecced1890035c613a3154c32b8d317e0f37b13501d597763a6273960181", + "s": "4ddd17278f48126847bf8af47658152448c8186ae859350a21d67dcb0345e89f", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 140, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6a250a7cf", + "sig": { + "r": "009f87627add0e896593f7e26c2156fb02b6c44f24241a7b196984659417d3bfe6", + "s": "10c28f98927b800cdcd0615a94bbb8d5e7af39bee678727571841c6216cf649b", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 141, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6a9287504", + "sig": { + "r": "00ac6a5229238a09f4feda1b8934070c0eb18c85f04c85b88fed58bf4233417cee", + "s": "4eed08574c6c05ba7cba3c14159090b12607b577de40c631e03dda70c7c9f5ec", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 142, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad0fef680f", + "sig": { + "r": "0b66f24be965a0b82cb93d46871dc2ae6cc2b11b45d1ffc9f9af618ff0295c70", + "s": "41d2dee0c212f22f502b81315930902c70d9020e2b1c85a3f56259ef2cbf6f61", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 143, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad24322c79", + "sig": { + "r": "49a267c6b88fd495a4bad328d9190a7a7c4e84f05925e3bd8a26c8aee6737b32", + "s": "00b3a99ea45ea48336480b694189e22de3805d12141db605f24d4996de7ccbbe17", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 144, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad3d23fae7", + "sig": { + "r": "20856177bde9af3b326c7b5d8bd8b07d5e6a26947ad4daaf7271804244dd8f98", + "s": "00c7b45f05b36b42bc95713a5565ffd4c423b05345a8b0fdc41311c1c248d14938", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 145, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b507e674e8", + "sig": { + "r": "00d64d81395c9c048dc3bd5a2379c18ade3711ebe26443b5d63ed41daae6d51041", + "s": "0099c72faaa4bd2dd6ad8ce25284569c62c00d5b9993911ee0cd2a786e84a77cdc", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 146, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b513eb738a", + "sig": { + "r": "59fd9d0f69c5f543beb8afe558784685c43228af062b5b8156813bae64db2704", + "s": "04f76637771aca0b7c5c10339ad4c0d524c2711fa525e585be3eeef6367c2f31", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 147, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b51cc7f01e", + "sig": { + "r": "00a6804bb8fefba87076d7b12d893005344ee2f0be8d23a7de0774fa9ba308721c", + "s": "234fdd127c6ba3e090c93af87528dc9e9eacc2515e08de2f4a7abf70f7531dc4", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 148, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b5204bb2be", + "sig": { + "r": "7794df5a5c07f323fe7bf5ed085c9c8c7e8b9b185f604bd23de2319dae04c270", + "s": "00c6a082668fbf82d49672f1976983d7c261e5efffbf28758e902fd746357712d0", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 149, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b521c74e81", + "sig": { + "r": "00bef0aec3bc14b476c5422d28f34220cf141d342764632bb5804bbaf9d5c0b900", + "s": "2da9a8ed0e515fa71728c427aef632ef5fdd974ba2fa2d7dade7e1e42c2c090a", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 150, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b5264518d2", + "sig": { + "r": "1714775e68b0dbda1ee8f99fc9f90cfe3cc646bec5032ba5dcb9a4f55f548110", + "s": "00f37b1baffbf0b92aad6fe46fd027d352c88f965c860997cc51045d3bcd5815c5", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 151, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b531bec9a3", + "sig": { + "r": "00c4b6450712f7010b8703ac4aff18bd7a4258b1809c79b22be7d93c2a40211d35", + "s": "00f750143cd3a118f3200888d0ef960928f2e2f80610b6f208ceaf2742e64911bc", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 152, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b531e54c87", + "sig": { + "r": "00d03c42b6018fd9389db3d88b3af3a8dd39c50319595347838436af6823525617", + "s": "1e5132d9c1595663403e917c2f5e7a30a0befcebb7f4f52aeb9f81789c8098ed", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 153, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b534bb16e2", + "sig": { + "r": "5b751fffbe774f4d8d38e685628df8c953885aaa3c495ea1d06b2851e976ea2f", + "s": "00a732889ac8037b8e2128e6cdd258cad228b577525d476d29dd4a617ca32c1c02", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 154, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b537a98d3a", + "sig": { + "r": "3b466ef1f25d09f111c87c90ef875c83d9b6958315de6c8ea29ec06dfc1c4544", + "s": "00a4a9a90ae0ee4912240bf2eca5d31537cbf59aac0c55dd4b37d66b0302b32a1b", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 155, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "049a27b53a9072fe", + "sig": { + "r": "1d117fb6704ae6b2421b9f1c5e09a9817ed9c341152346ba390a49233a1b4251", + "s": "00bf30e2d72fe7b7821d065feaaccd538bdca31cbd19e0eeac8f05eed6d46fbece", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 156, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a607e9597b", + "sig": { + "r": "6bec4a765689f50e3130ef5272bb4d61336278b8332bea3858a11b942e4e0fc7", + "s": "125f684e6f6f911e3bc7576ab7c69c4a89223e4979a5068c63e9016c3cdf4265", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 157, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a60c3de294", + "sig": { + "r": "3a8cf66c59108d9f25a9a7b787683048d9117c49f9b4853bfd1706b76b8f59ef", + "s": "00ffdbb4100f4a48c18a5bb645edad42be8bd95996dc561e7e442b5c412fc2bf04", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 158, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a60f0a7105", + "sig": { + "r": "00aa00712ed49b3dcf6f59e40e622f7862d9e840ab1b4168f7f616008346215db4", + "s": "79346dee7747e70384d0630490d661850139ff1ca3080320b269295e56943516", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 159, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a60f40b849", + "sig": { + "r": "4406d9b01352882a7337422ca3b5110b5972d701b8f77b7a0477975ee092fa8f", + "s": "00fa579c1c1b4f42236e8655d31b87c21124a20986b66035d13a1e34d93e3a0c60", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 160, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6100fe0fe", + "sig": { + "r": "00d6745bbb5d262a7101d4df8661a58366638562d417ba168be7a22e1d012a7250", + "s": "00a5c26833cd98c8545f509f6e371e96006677bf81bc4951384aca0bd50d035db3", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 161, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6123d535f", + "sig": { + "r": "00c2df8ef915eeba2ccab38146ec0d1c9e3e42b89592701beb6dfef57e5223d574", + "s": "091adaa985ac6e75caaa681fc968e8b1964fdb7177cabad272711a16252ca54a", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 162, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a619d0abca", + "sig": { + "r": "356b643add96ffbbcf5ea8ee002aa7e968f9a786fe3ff24b7bdcb7e44bc6cdb1", + "s": "00dc58c48f92252a24e8096a2421fc0f7e0313b4c201146ae7910252a4ed63e2d9", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 163, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a61fb36417", + "sig": { + "r": "3bb3f21f3933cfa77b7eb9e5c2166d3110f310393783281252bd53edda42550d", + "s": "00ef7d6ac58f4ce04696e77087caf18b7def6dff084ee9bed7dae8fe7acf74e02a", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 164, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a623579acd", + "sig": { + "r": "00acbdd830bc2b4092585b27ad709d9c39fa3150f445606e4a7d6619d208c2ccf0", + "s": "009458fa49aad9ad99e594389c1a5c9bbd2b3451b21ad40b6691f3145d9e9a601a", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 165, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6251c93d0", + "sig": { + "r": "00cc342c6db1ddb7de5cd96a742da971f750cc354a408a8081c4260afa2418366f", + "s": "0e5f471102f87e756b03ae248cf06222eaefe261147a595108e57f03bfd48bc3", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 166, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6275790ef", + "sig": { + "r": "009c55dee83c756d612fb75543b87c2544fe8da61026f353f98ccde80a3e280d41", + "s": "00d8d06345bba7a213ded6b6ddd12435cc3a837044e9588a567e0dfa236e0d78d8", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 167, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a63830e73c", + "sig": { + "r": "5ec18190037417b25702d9d47449ca2f8597b498d33fe6924fb8c5fe8c74dd90", + "s": "1c4f465abdfe2ff38361b1da0ce7dcd90de2ce0cf5ea5b29bcc1949e0168a0b1", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 168, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a63fc5544a", + "sig": { + "r": "00fe1693f078151eb9ad9dad0c119f2d7240b9e9a8c0d4283923cd5cbaf309fa94", + "s": "42135f7eb71ab315196a57aef824d385185ee212759e1d5c8da39b3d38a81b82", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 169, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6421ef200", + "sig": { + "r": "71524332bc0e4b8a1d3236850a311b318b14d30a4137e73ff7d5cddc64f24f7c", + "s": "008b9c0674168849eade298407c3e7026ddbf0867beadc9f83ce25009c29a53257", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 170, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6437fc4ce", + "sig": { + "r": "00ac5ceba10665e30bb7fa60f7386d67aae34f8fda2c313bbbb23ff2873e6e5364", + "s": "4422c3124d58ada49c79aede2eb2b23efe587ab41b97f6cbec704b1fdcf02e66", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 171, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a644e295fd", + "sig": { + "r": "00ec996b8f286249078d47acad72830ce4922763c8ec3788c090b7a23ef70c3311", + "s": "028b046670baeabafa4b827e0769ab33f57a89178b372949423e22bd9a079edf", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 172, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a64587d9df", + "sig": { + "r": "00e4384b2f7c7ed8394338d3b96d20a8f7010a0524b1f29998d5bf08e40bf87cca", + "s": "008c411b2d9b74b3e4f941f269df26a6d4a1da8fefd5c74f70b7d90bee3f744fd0", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 173, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a64b5b7ad9", + "sig": { + "r": "00e0ba47f92074db6db2f531d9336cd2384f4ecf002096f14f1f720ac81e1056ce", + "s": "38dda8010624f2883912054696a0d12cde93435d9a2b452d42ce1ab6bf0f4e7b", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 174, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a64c2f0d77", + "sig": { + "r": "0ddbc8be97b006ae1b1461dd19f16a7a1564d395a12e77cf0cd50e3940aa964c", + "s": "00f42b0d77ed91ec8f7439202c125efff31a120409058330d7264ad086302fb4f8", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 175, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6599334cc", + "sig": { + "r": "7837b98d9e4de97507c1f56db6eeba4a6e63c731c98cbb4b17c6d9c00a63a9b9", + "s": "6e87af4a66e8f1fe63f3b7e98d32bcee3a4d4af96faba6993c7e2a557672d18d", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 176, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a661db38ba", + "sig": { + "r": "6fd231d69f5df6c8636f6349628d506edbe72d814d42911230bcd20f44695a70", + "s": "592d0cfb63dd34f78ec03c090674a143d954a92a38e4a10254f4181c4d5e643f", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 177, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a665c5aa3d", + "sig": { + "r": "0097847dcb1d562c82566e256645c091c4f717ea07cc1f61822d837c61d824af8b", + "s": "00fde642ebaea5579347dcf2bc67fba2dd82b78240a56704147dd9c3b3c168062d", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 178, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a66783bdbc", + "sig": { + "r": "75a7c973b602dbfd219e5c0f7f877284331a503cfb9611d723cb3ee63ba7230e", + "s": "5de5a11779389b8b78d48f83bc17bc51ad6a0de0f74011a563e4e49bc36a4e41", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 179, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6690cc109", + "sig": { + "r": "1cc0bcf8ce7a1da4d5bfc3a0d2df3bfc9296af314fbb7b5997c904b1b2f49c93", + "s": "21fc1a0173900ad7d7f3103567370d66adfcee93d81f8884530fbe65c3a988ef", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 180, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a66f5fd90e", + "sig": { + "r": "6e06490a7603d31f58bb395a33859a296dad33f023e6c61dbf12ec736231c18f", + "s": "2a031bb1fc1776f51f128c7d59e23ffe423d527b17c80e707186e1afd406dde1", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 181, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a67011c21a", + "sig": { + "r": "00a26f74a362d3cd02038955296426a217753d4c59b8bb229b5b85c4e1c4a05800", + "s": "008208d5ed26614d102023da2f53a22b58f0b9ecf5653353e1d977eb7568735d86", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 182, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a670554c70", + "sig": { + "r": "0088ae478e781b5f1fbb32989ae49ed9ab26acd96bb75f27c5eb81dd9ccb69821b", + "s": "00c4f2a84b31e6e57b51889cd04c6cce8603eddbc6b48aa113ec9e3e8ef318e8d6", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 183, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a671a4d73c", + "sig": { + "r": "00eb6cd13ce95116a0bb342302fc5e7caafa2ae7e8100332752225555d95be3e7e", + "s": "008011ab5a6530227291df5484d8969ce9bf2791c04d872a05495dde7952f2d0ad", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 184, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6751c0d43", + "sig": { + "r": "66827720da6a74ea98a5b3a328f3d414fd9376291141f033c1bfde4131f3b72a", + "s": "00f3cf3678318094482032bddfd10d002681692bb605486651c4eb05b80424c79d", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 185, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6793b55e8", + "sig": { + "r": "00ac5b26cebd6733e06ea26b6929fe8bc26b2de707adfd4650380b182e19521ecc", + "s": "008b78509bdc6f0e4a430c958b032285c9b95f44e2fe2e32b4daa685362034d877", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 186, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a67a525edb", + "sig": { + "r": "00c67fe640f3f2f5ad10d6526a1b92168eaeec3d655dff5a3e40f61f183f4c8324", + "s": "00a91c6ce59be98af99f1d63f53192c4f1523bed752b908536bd6a561e0d8831cd", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 187, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a67c53ae63", + "sig": { + "r": "5596ecff148d5c6c59b41c2e81d7237a88fcb128daac24d1f33c9efe4fb03fc3", + "s": "0080d05c3277b34118daa57934ab51f2cc1bef0debedd879d94a8a55dcb1af27a9", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 188, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6846162a5", + "sig": { + "r": "0091fdc62a77ca2cf582c244a3f212de7defd27c9998afee4fffe869d2917acbe0", + "s": "35685428d0f8edddac743a1ecec837a41a902d90e32adef5b3ae839d21789d48", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 189, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a68d2ac003", + "sig": { + "r": "2ae94dc9ab3347011a49dfee80f4c31908e6ace8109d595bd6c7a9c56dbe62c1", + "s": "00b40e142785696c9d042d033ec6f52eaf09e31f169f5715b971391897f4a946cf", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 190, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a69fd3e3be", + "sig": { + "r": "729d1b0fc25a6ecf1dc84b8d862aeb8eb6c733e6b30709161ef20220c824f601", + "s": "00bb8a43173f73b8fb3361d25c950b6269914fa72e219d051c31a14238f39210ad", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 191, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6aae79dc5", + "sig": { + "r": "00f8cb81df021ad833c2833386c5d1e8ece62df493de832d95e39af07d599f77b8", + "s": "24696f9aab16454c0993306bec2336e2e84144477dc883a84d5af0d2b66b0b4d", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 192, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6cc60ca34", + "sig": { + "r": "00a0013daa14e5847b66f2a33f89ab1aad5f56af3f1303ca180d2c396361e29c65", + "s": "00b13df41d50246fc502ed57030251c264a06ef97a9a4d42443b2116deb8bd6d87", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 193, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6cd6245ff", + "sig": { + "r": "2f58f7d1b618e19664e78b177069cb637d61720902e156c9b30aa765bdc3a332", + "s": "00ebd3f4277af386bf8c6d7f278b0cdb8d063dc55c6abcf11c417456243ea6538d", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 194, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6d808449a", + "sig": { + "r": "00eddd2e715331b5010da97937b41738c9620bb898adc45413b7f3721feba7b27c", + "s": "00fe3b4c657912a7c345280bdfc679ec50a5244ba5f4d8854cecf60d94eebbf3c9", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 195, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6db0af485", + "sig": { + "r": "76181975cc1fc7deb55f26e4a55eb41766c3ef7e7fa2c288b94518e7f4efc613", + "s": "7870d8e540d05ca36da6a6531ce2c631e9c73bd682b6ae0cd19d8b2a3215edd6", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 196, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6dda31d79", + "sig": { + "r": "74e06cca9bddd9be53f8b504925be0dffa5787b3736c92474cc7761573daa27e", + "s": "63da5e3d6c46a4e893838c2835d7c821f65a27ed3b6126c5371fb4397cf6de63", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 197, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6e025e7e6", + "sig": { + "r": "00c9b48bb447aca569c5945b1f934da98c097ecd3051427d42fad73446de0b2595", + "s": "639667b352bb8fe097487762726fe5c29016afe7ae4d63f9e13573228d102b53", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 198, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6e17464df", + "sig": { + "r": "47fc5cc42f722909552dd0f01bc32f8db61d4cdf23f2c14c43d62f7c51f59da0", + "s": "3128aa8ffc797144848b522d755189bf391a37be94ffa6f0689dd546f174ddc6", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 199, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6efdd2c01", + "sig": { + "r": "00d45f020e6dd5464f05e94efa3e06ab96abda8c17248c0c5d963d2aaf3a70efb9", + "s": "7f8a3b02ae704357d6daf356fe966d54fed4c4b89867d86500bd16e23951bf26", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 200, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6f8afb997", + "sig": { + "r": "00f4d29b5276fd3064a32e35e96746b92006af5d6138dc4778429254cecc935188", + "s": "00f891b4ec0aad2d60ac46935aa6d58cfba8f785875f218026bfbab53c854cee4f", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 201, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "07b3d7a6ff92caca", + "sig": { + "r": "313320fbf71638a92b0ed0f779d6635a10b62697ba7ca3cf84c0d5aa5c4f1c59", + "s": "00cc488bd67181f35af236faa5cb7b0d2a05cb9274958beaa49cb937fdd91404bf", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 202, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad0113a8df", + "sig": { + "r": "7d6df391a9fa42846274c42a971318448dc514483027932afa32aae33031328a", + "s": "714abb58b8b1748643ca65e9d0e24f94840462b6d842af0dc5579d0661ef479c", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 203, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad02b68f3b", + "sig": { + "r": "0095e0ffa02d074129874bf3e384e75cd2945e75c02907aff877cc2f758ef1149c", + "s": "00f80944f6c80bc9132002edd4d31493a70e12512fe016bbe9bdc58ce0fa45481f", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 204, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad02ec10a3", + "sig": { + "r": "00a6a19add5bff5e48a2aca65fd9344a5d74b1761150e8b366e4291d6e78655b16", + "s": "0ce8287f65cf214ce68a908d3516dafdd603a2186bf1385f174d95ff3ac414cf", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 205, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad06945c63", + "sig": { + "r": "351adae9f6371ea7930eaa9155c43e8009bb66396b6aa7a2588f868147f89194", + "s": "60bcb408fb13a139f1fca79ada7f0bbbb8a89a1e7b274cbd90245b37ea267ffe", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 206, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad09f9b734", + "sig": { + "r": "00abc353a8d91718891714827982490eac1e75ad708be81aa6667340731d2230fd", + "s": "71a3012b441b3cb79f1d0cc7d643e28ff38c4e084e127d64c5a59086ba24d38c", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 207, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad0b115d03", + "sig": { + "r": "0086f4fa4c7803698e9292e200a134c84229233ef64a52b9c3a39e88fa689176b0", + "s": "00fe72495fe02b753d4861d62bf39832e9d97b03572925b279531b5a13bd002df1", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 208, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad0b2ca028", + "sig": { + "r": "7384b17f27061b24d2c98ff04a820bdcc72515d01d5963ba7f138f6668c4f53a", + "s": "00a022e06eca13d784917b224210ca60dcb93e60a3b8119fc82b48a49368c209f0", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 209, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad1a5b39fc", + "sig": { + "r": "00ec75ea5357a14e2e6fb2f2fb576cea18b94549ed7dbff6bbe7015b6f4c842bec", + "s": "51c2a394e0120a3e1cd0310fd30108080fce771498831f2eea5341094a009610", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 210, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad1f772244", + "sig": { + "r": "437b5322ede7a65979720401c4b0aa23ac2578cb10599a791ca8ffeecdd6cd02", + "s": "009e9a390f88837b973861b81a34bb269abeabc5a2b81612f7fe3ffae764e94efe", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 211, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad214bbd7b", + "sig": { + "r": "00c538719415e43418c6d72e4d4b5e14539a1b5cc05ad9f4573afa3a746377f508", + "s": "1aa9743c7d8de6ee87d28dc526ca1572e5edb06602bd530d8229881ffc4e02b5", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 212, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad21712346", + "sig": { + "r": "00d6e98ba1b27c5faf247e497cf436ff3aca6f00f6cc4f96a35b72dee70a8c2b8b", + "s": "00ace5999bef19c139e74080fc002a9a3b342f0e053a345e3d70e9602ded4646a9", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 213, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad25062f89", + "sig": { + "r": "1838f7b7e25230c0044c61f139a9991a90c980f10eb044e1cba017bacf90773c", + "s": "00b155a9a14d56e6c9b5b8b05cf60b8e5ed5a8c76e7f0efed2605c70ebe36a7834", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 214, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad2ac5e021", + "sig": { + "r": "70d6c519841d101abe2da489c7a018b712e242f6e9487eea5212b4d2e78fb45f", + "s": "009104c58ac846452cfba2c7b08144fbd9931d20e67430529dcc8ddfa0ca440208", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 215, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad2e8b3198", + "sig": { + "r": "65bc46f8ad28a0e11ba7f9e47626e585a80205860632b1a4d5fc0def9eeffc00", + "s": "7b30f3b7c300d601b4f053cb1002678d4c8d436e8ae255cd88205a64fe65ac06", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 216, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad31a5f342", + "sig": { + "r": "172b44278c829d6311f53dcc0597e9398880fe4d7c61bf720acdadb9adfc4698", + "s": "5e9ba3ed246330111408920634c94b9023d8feaefa57f0e2ca0cc9e6bb85fd8e", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 217, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad3632d31f", + "sig": { + "r": "009c0ba405171ac3328c5ab02a3fdba3804551e7d9224e6c2f89565aa3c957427f", + "s": "00deb71397958ef1505f2bd589843467a83dd9d17e2958fd5a847a32af3c783dc9", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 218, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad3d64fd6d", + "sig": { + "r": "13ec161e1add018bec58edee8ae4abf16002bdb93cc1bdec785f5750ef3c9f41", + "s": "00f883e7908b53e1e544cabd523f2fc2731c5e3b9d93bc43d8fef4e97ff2797707", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 219, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad3dd0ba8f", + "sig": { + "r": "00fb69d2cc17719bb94ba8f547af0d7c305ba098ff2ef920f94620446437de9ee4", + "s": "00d87601cb68b9d2bf189610dff7568af944b3432959df16f2de0fc8dca1a797aa", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 220, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad43852af4", + "sig": { + "r": "1c7997b544c669e03e2488f6f69622d2fc2ec0d4b791ca0fefcf5e011be2264a", + "s": "00a1253a79b9eae054d08967581161b51ddf50b45214cd51a901e5df69e4cb2090", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 221, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad4de703c2", + "sig": { + "r": "7e515852fe58b92029ae14099d6d7d5b84326441143b58bb928bc3fbdc52b34c", + "s": "1bb9a44ae040a0500db5ba23fccec1a3302aac9c94f3e47181d434fa7e03e7a8", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 222, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad4f775bfc", + "sig": { + "r": "00f1caf3affa73f426444b79f4c772fcefe441fcbcb07df0020b9908565862091f", + "s": "6fdbff9ea43317dbbfe6efa01a2dd3fd478c660f841c50e34964155256d599e2", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 223, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad5638b579", + "sig": { + "r": "12f8558756ea27f7caeaf8251ec09f701341b6f8c2d9698f3b19734931fa1ad6", + "s": "0094133d462e4dcb088659b46501a7ff6f6b94bbb4572aadae21d95f3f86ed531d", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 224, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad5829f099", + "sig": { + "r": "2ca1c2ef1edb84fbbfbf1f7b85ddc70136b71565a88396139d6ecb39f7fd803d", + "s": "3e9561707627e85a33651bddffe2174b236aee790e6e740edfe94fd91e9baf42", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 225, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad59da3396", + "sig": { + "r": "008ea49c14fdbe9abf111cb40545b9814b6bf24e9e8ee30776a3159d324257b06d", + "s": "009a4aaeb5bc4c25d428d7bc1186b2e236990fea5ea4ec58bd2eb5d7891811b60a", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 226, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad6378ebae", + "sig": { + "r": "549d07c49a48b993bf374b94aa2b180dd7e10ffc5afe562f9c98143797d212fc", + "s": "00eca61795f3dad2ee2b5233ff2b6d3122ae5941c6b61f1f39d76ef97e2deabc79", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 227, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad663517c7", + "sig": { + "r": "0f9c8d4ff984e6fad0360cf63b51d07531e895dc20c08346289ec13b16b2656d", + "s": "7c360bc99e44c0db73a94b25e4ef84c26a5949e1ec9267d5640fe930e0b52009", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 228, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad679e392d", + "sig": { + "r": "35c53bd71164e6c6f400b34341cc35e22ab3c62f376068d628f5a00e65869ed4", + "s": "0092d05dfc93464dd22f42cd6fb68d51b43ecc85ef68a00c1b94b2c5bab68027a8", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 229, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad6d1e5152", + "sig": { + "r": "00ac21766f03f80a4248d6978db5ffbd543ffb57276ef80c4c3ee4aaca75d6d719", + "s": "008231d15f92f16b70e8de82a5dc21408220cbd11a4215dd9700b674602863fb9d", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 230, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad6f4ceb32", + "sig": { + "r": "149e3227fbbab4bbda7f7cea443c683866d1589d072147631cb1718af56c591e", + "s": "00eccd840331ead62e65d69bdbfe80dbe4beae75b680a5a64c391bffd0e8669784", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 231, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad7106bfbe", + "sig": { + "r": "71fe8026bdedb57ca60fcc02a523f991ca9bfb728abd47ceb52556c6fc2fb0a2", + "s": "2eb04905661490156d642e5556d3acbcb14e7bd78c09692b50c69228ab1d949d", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 232, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad776a3831", + "sig": { + "r": "0969054e8ad9194312cce8cae3bee0f5218cb329a26ef3465f86f8529828c007", + "s": "08a7e67a63529db1083ac2bfefaa28d7db741c3eaf8362601b04857fbd1b44af", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 233, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad7cad23ce", + "sig": { + "r": "00c223fd1a31e69b2617ed8b683245900a78ed32697a7ea0de01ededd778765e13", + "s": "4cfbc3684fd84df4cac43f8ecb2ca4b88c67f1f2e5dfa461f66b37b48dd0116a", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 234, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad820b64a4", + "sig": { + "r": "00d7bd7a23f971630518ec2f460e8fd73f0c361aa1d269fb8c2d900ce3e53cf8ef", + "s": "0fbd9d27ea45ed37d3fe704c32353889da376377a1d8c1e0c7eb8dec1e3b4391", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 235, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad85978f4e", + "sig": { + "r": "54bfcb1705552e1f6fc7b34d90a916a123d47d72463cf081aa69e3049f898280", + "s": "00bb6d387a87abf1f24181f763e6ceb704657b1f5d437bae349ec34a84df325df8", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 236, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad8732d356", + "sig": { + "r": "4643095c37e0f378f34501fc8e8f60d135d21665795a8581d3db20a167aa8b3b", + "s": "00c4ba1b7ed29c0bf52955a0c2c86b160fca52c2eaaf4e0888f04202d57d7b820d", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 237, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad88b66c1a", + "sig": { + "r": "008db9f5e967019b765e957ee025e09dc1455c9d0a339825ce04667f74283ccc34", + "s": "68ad8a13538eb6ba31b68ddede238447dd07f80cd02c469af4f48dc68413db28", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 238, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad8e69901d", + "sig": { + "r": "00b9921ade995b33cb29b1c6999e64059f4ce8548196bab26ed15dc2a2d940125a", + "s": "72ebac7f01cec46e79b435212154057735de0e181649b0fb2e099b8787ec2877", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 239, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad9c99f28d", + "sig": { + "r": "009847ff70e746361abea12e357d253bd59f4779f00348a9e065e51b61194fdcd8", + "s": "009a4e38152b01e60b131a33436e61f9e58c33308e1d1f5635f00a7abdace85842", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 240, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adad9ff5ce87", + "sig": { + "r": "342a65ce8f21aae8ea3c9a9d0dd424742e239673d71119001ff90c33b9608258", + "s": "141a14cbb61616e248782a578f19f7f64b4066b772b4b19386d2323f10dbd87c", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 241, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adada8e1e961", + "sig": { + "r": "00e3284c1e08d58d7b1c39569074314f4ba343b2b70c8c06da682a206a56a25bd7", + "s": "00929759943d20b3ff34f7c0ccc27524fbd07bf78ca78bd9b00702a7b02fa31fb5", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 242, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadaa1372b4", + "sig": { + "r": "00c8866b8f19321339d66c034f072d31e236a8780abf1dc7a05aff36a2d47d67ca", + "s": "1eaf8a8311adca9740bb53e831c19b0dfd34a680f676e36bd3f48a8727733940", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 243, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadaeb3ccf3", + "sig": { + "r": "00f50f483fb3fdea5537f0552de895c1907c4a05b2dffd63e222bdf47fd154133d", + "s": "00957a9265d87ce85e85f71a9e506d19705f8aef63a69b5b6f1f4ca9d92a3da748", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 244, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadafa2d999", + "sig": { + "r": "00da10b6a25c131b5abea02dbfe0ce4dff619fbb039cf5506cbbf503ecd2ff5dc0", + "s": "0198ed87e9e9f06c822b34e19baaa65b85cba9036f4907a754442730a321dd91", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 245, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadaff26e48", + "sig": { + "r": "00d3f9f49046095326139d2555f492bad50b5f25e3dd6a6aedc0e4f8e1b9daa17b", + "s": "5b3597a991fd549823ddd72bfb22f7518e43b643850c65866fc887389e1e8fb1", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 246, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadb4fe386d", + "sig": { + "r": "66c18e479f70019689f82fa90c1777071ff4100d12b3c01d959fe109affc8883", + "s": "25ce9d0accb3d9b0e653c5cc18c875cb8e63fefa087a85f4693b38d4459f4a22", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 247, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadb802afbf", + "sig": { + "r": "1af772b903aea4f1a9fc33d6606f94fa1259bdf84f13d6a4dfc8a60fce5ad370", + "s": "009717c7fd8e5332da61656e7b55fefe0b06891a9c0f9de024feb7edfb8efd2393", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 248, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadbb02d527", + "sig": { + "r": "06704b30fd3c5032f4a58f33e8198b94d46ca3ca2084d04a85061762b2422bf1", + "s": "00a508b8223fe86a4693158f84c0ae1098d0326d626a4319872884b673bb1bfe17", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 249, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadbbec9eef", + "sig": { + "r": "54f1de5c2f76adad72bf6a2a696fd3b8b42ca9245e80a9381dbbf8098709e5f9", + "s": "762525904586e59370d673073133231701e7fff2d229609071b2b2448b464496", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 250, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadbf14261b", + "sig": { + "r": "00c743f6b65afc53e7139f23abccdcaf07eaabf0f533b743b01c6d28ae48a018fb", + "s": "008bb492f7b9bba987a946d726a924db3df6e8c8d3c996eaa8ad99fa650fad8de2", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 251, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadbfca34aa", + "sig": { + "r": "712c4f1598baaeae619435bd3375481a6f353144578cf11a178c2fbf6554940f", + "s": "5bc42b21ea5924feb520a3548079a39f1462adfafc5cd3202ce5e74ac41c3ba5", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 252, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadc16365bb", + "sig": { + "r": "00e0219b2abd5a61b9853554663066520f01dd0408bfa4f9ce363fb52b70a6f0db", + "s": "00b7075505a0c7d2637b532fda7bb70623a5dfeb82018ba89352d561518b0e9aba", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 253, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadcb65063f", + "sig": { + "r": "00b0c8bb31d90871aa0811dbfca1051507f2d4160e295e0a8cf20d07661dcc7719", + "s": "009098c92a75c5f3c6ad3a55bf4d579682281f074034b39ff9814a22e013d6f7d3", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 254, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadcc5819aa", + "sig": { + "r": "1aafbe02637c5fb1b30c3f51eea59a8859a81b0049d4d43e1da9481c75269f63", + "s": "12d146da7b4643f2e79862ac558f163361183cc737ae39ce0626abc54662fd22", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 255, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadd13f13b6", + "sig": { + "r": "3610371643c6e87e9a4981f7eec734acdf9ffc30adc2f156f477dc3e19a2d116", + "s": "00be0934eb9be3c78a28e295aec88daea3f8f75182d239be1e5d07d4e1d022ea77", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 256, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadd1cbed9d", + "sig": { + "r": "00c2a51933fb25d111f983680dffe5c019e68f096be66a4ff246f9613d330fc3d4", + "s": "49bf6a4b063727903dba2a2507ee6952665f731e5978e9cce8836a229ec251c6", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 257, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadd2da2518", + "sig": { + "r": "10c315fb49377e58e8b01644490dbecdd1423f9b61d8bf90c6894fcc6bab0fde", + "s": "53864e1663139ba2b856176cb52b33a5a49c2ec5e05e396e4deafbcdc80cd401", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 258, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadd4c1f5ea", + "sig": { + "r": "00a0bd8536989f11f97226b759ee11ad64da7050fcb23ab897d4736d282e82e685", + "s": "00da93b451acc2ab38b1450934cc3c66621500abbb508a03360e5b28b0c9d51ac3", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 259, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adaddf9020f5", + "sig": { + "r": "7216e2e15f7a04e02239cc37290579c1ed5ca7e0a08ede2b368eaf29e26bae93", + "s": "59d629300f25dfe9c9048f41b15f02dae0e58354a2596073d85b4ec75a82a9de", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 260, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adade57bccf2", + "sig": { + "r": "7451d1ab852583b7f276d9a79b67b19f867096480094cd341b8110c487cfbce1", + "s": "76f5ef1d95bbc3de3d85cc8e75da0738bb54c5a30fbaa72845dbbc1fc8cae58d", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 261, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adade875e79e", + "sig": { + "r": "1e8cbb17c3bee99566e434f7481351b0ff1649f5f859963525a0267d285e2b19", + "s": "00ebe2b439b443fc9943d6cf294b3190112ac4d9db54cac98b84fcf94af0a05891", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 262, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adade8f1c621", + "sig": { + "r": "60e0ce766189795f1df8fc07168dbcf07beb6c9c56af32ff7fab72cecca24c4b", + "s": "00b25b57f8b9554a9e6380c041677bea974a61a286fce83afefe2a4d659e99a43d", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 263, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadebabba01", + "sig": { + "r": "00fe8c7e0703784d77ef5921ba1533b08d15091c31e68c27e27614f6ec3673ebff", + "s": "00e42b165da7919beadb3d0a5a0d10bc9751a49f62709a731b8f1a4d61ec0fbad6", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 264, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadeda614a1", + "sig": { + "r": "60ba85eb2ed3794dbe5e82e10e84f52ac6f28d7094717ebf2b285c428fe67ee0", + "s": "560860120b930a4c066b21ec2d39132f1446506b05652adfc3574c681484dfe1", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 265, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadeedd377c", + "sig": { + "r": "6fbf241499a46baccdba99345110ae67c8105a511985043e719735037cd7abb8", + "s": "559efc7ea111d6c54cf5f5e9cced63eafb957ed3cb91fffe4b7c2d6f32e3d2da", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 266, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadefa84192", + "sig": { + "r": "00f261726805cc36cd7116dbcea35a68bf8aa0cf4d080a81c0bd69062a33d3042f", + "s": "116a21b410576d6c0eec5b0373856be3deb89e427091580ca314e275795080a7", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 267, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadefff788f", + "sig": { + "r": "0974f7a1f330ec4180d382648aff2dd10bc7f514587773edf30a0343a267e858", + "s": "00a029cf85116c33063d3d83999ab47ab66a41c92cce1318c6d1f7df1a356255ba", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 268, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadf57cce0d", + "sig": { + "r": "4af3d0a14cd50c975c69b7ac8060209c4b6b6164be55cb1bfd3b126a075a63e3", + "s": "00c5ba9e2e1cd689b59b9aaabab92b7a38b312cfdd162d342bba3b0ccaf8a779e5", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 269, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "1e58adadfe4eb4aa", + "sig": { + "r": "00cf4b224feda0afa715ac56782c0dfc55e9e4618dda23ac38973bc7efba0479a1", + "s": "6f9ab11b191fb0dbb5e3e5e0621f699f5b18088ca8d5214efd02a3c216801232", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 270, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "7a4fb325039369c2", + "sig": { + "r": "00aedd0797f66dfd84451ad90cc504eb18edc3297fdf4724388c792ac274762467", + "s": "0905cfbdf33a2e2bfe938dc63820e7443bb155eb01cd5a988d32fa45522bf3fc", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 271, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "7a4fb3251001fc0e", + "sig": { + "r": "00d3aaf8f6f56ca31661fd4817ee0ece0fbfb4f558e8281b0e133683b207f0f82b", + "s": "19a53dce89cc72dc9cf19d1a497b90bbab62161af38a149f8032a85204ae4190", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 272, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "7a4fb325107d46fd", + "sig": { + "r": "00cef6f4425cd15a0e1a0cd7df4b1503b499c823d4d0f0d7e46bc0df570bf7f7cf", + "s": "32888e593c4d33bbdcb5142b60beb8c2b4504f443f9b82e968669108def4dc40", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 273, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "a14672e602d4137f", + "sig": { + "r": "00c1637378bca12f224171d032ea912b5bd6e78d46800062ac2764318b94c02b08", + "s": "00dcee6a77fcc21813022fdc2c67dd4a73993d324876e6110bee1a99ead4b9700a", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 274, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "a14672e604d55a14", + "sig": { + "r": "3b7e549428251539a4f19f9c201ddc6e6e2f2b8565c283b066f1ef6012ca36e7", + "s": "2da5074052cee7e901e7afde37f8ee4999d0b6abc80d3abe61b2d5a5f2a32cc6", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 275, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "a14672e606f7e881", + "sig": { + "r": "0e19aeb2c959f57db45f6ce299a454e1718a2d3bced866808a2cd3cbdad98af2", + "s": "6c27516a14898ae22b41b412df944e1c0af0891edf757eefbc3579e88a7c097b", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 276, + "publicKeyUncompressed": "048b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0635b886e3dc62c09edad498d5860dc08c48ca749603fa29b281928e5f60b7494", + "publicKeyCompressed": "028b4fcbb2b0c4b46f293e87b603d3a8994485124471862d5b94ce286fedf589c0", + "msg": "a14672e60925a734", + "sig": { + "r": "19818b3fbdca701a05463e8cb5687008ca4ddbc5058c8b6712f8753dca275716", + "s": "6ec7c6a1604bbea2f3e04f3448f2926f0f15f26e1822a24c8a7b44eb97cc3413", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 277, + "publicKeyUncompressed": "044939bfaa7f23523ba3e5a3aa6ab0f85b0405138da4dbfdd3303bff14174ac13463e35553c65ab5f413485fd7ee202c14f2451f9bc3fd6f9d8a4d340f5e8059ad", + "publicKeyCompressed": "034939bfaa7f23523ba3e5a3aa6ab0f85b0405138da4dbfdd3303bff14174ac134", + "msg": "68656c6c6f", + "sig": { + "r": "59294e8bc54e76d48b5594f01fe4729566d9b6df6385982fbb533183921f1a12", + "s": "22ecdc9db85a6c7a41252395f334650c18f78808f015272e80587f4f66b2f1ad", + "id": 0 + }, + "comment": "R: w=-2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 278, + "publicKeyUncompressed": "04d3b5eb64883c6a25a3e17353a44acc0153883aec20a35e9cce7b5eaf746c943932cd830bf8d5d4675d11c5efe75905868201055891393d58e0fbf5b0acbc14e2", + "publicKeyCompressed": "02d3b5eb64883c6a25a3e17353a44acc0153883aec20a35e9cce7b5eaf746c9439", + "msg": "68656c6c6f", + "sig": { + "r": "00a74646c798fd5a0af442da69c822cdf1134adba361f90663d626481aa10e0004", + "s": "262c3b64e57e7f7bf2d86d3640aff9485728d2f9f31fceb177899911b1dd976a", + "id": 0 + }, + "comment": "R: w=-1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 279, + "publicKeyUncompressed": "040db3e2f8bd8b5b50bebfd6d705b69a584cdc929fd938df3b3b26617fb677906185becceb63d7cdedb52e9cad6c593e22a7c1b05b04933a31516b340eacdcfa03", + "publicKeyCompressed": "030db3e2f8bd8b5b50bebfd6d705b69a584cdc929fd938df3b3b26617fb6779061", + "msg": "68656c6c6f", + "sig": { + "r": "01", + "s": "008044529b6db462fb3b667236d98713f06a65e235897020faac8625f36ec3c202", + "id": 0 + }, + "comment": "R: w=3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 280, + "publicKeyUncompressed": "04221b9ac2144909580ff60ec25048bfed01a0b27a7732a5f1f076da4c71a4e4a98fe5fe363e29011f4a94991c488782472a9c7c668aae22b50c8ecc00a7065f0a", + "publicKeyCompressed": "02221b9ac2144909580ff60ec25048bfed01a0b27a7732a5f1f076da4c71a4e4a9", + "msg": "68656c6c6f", + "sig": { + "r": "00a10bd2bb932fae8716b0640d7d1b8e210264e3e70eea4840489c8b7252ed8993", + "s": "745ed97f0ca3906bed67854e68facf8cd0ad3eb5eea331c2adcf60684beed0b1", + "id": 0 + }, + "comment": "R: b=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 281, + "publicKeyUncompressed": "04c7409d2f9899b0852f3fb747bae59fcfc047997875678d84abfe593aa09550024eed36fa53386726742e9662d0f248adcc21c2b8246ed5c9d38beb5d96dad327", + "publicKeyCompressed": "03c7409d2f9899b0852f3fb747bae59fcfc047997875678d84abfe593aa0955002", + "msg": "68656c6c6f", + "sig": { + "r": "00f7b3cb719ab8ad6d3399d6fe5d24280d73956170416408edda530b80afdec300", + "s": "0088834dfe447a90c632cad81806e2e72a28c50363249c8efac4fa8ba83b17e32a", + "id": 0 + }, + "comment": "R: b=-2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 282, + "publicKeyUncompressed": "04921e5b31e02e2de0ac5d39c9dd9988f960bc5b352ee87df481b30c1dcb86af6d82a214f8a926a0775d6ecf10dd8a92e3c5c3a9ace772c224f3de137ae1ac1392", + "publicKeyCompressed": "02921e5b31e02e2de0ac5d39c9dd9988f960bc5b352ee87df481b30c1dcb86af6d", + "msg": "68656c6c6f", + "sig": { + "r": "00cdf6e7bfc3939a644fb51ec36bbd1057ca60eeb0b50563411e681368e29ec494", + "s": "00b22ac5edeba9595aec4a8dbd744e2a2b17cb9e7a527f8693cf1bc76b09b5bc2b", + "id": 0 + }, + "comment": "R: b=2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 283, + "publicKeyUncompressed": "0414c4d1d379d1bbef305466a360e53b0d5151829ae5460ba179eeecd78a21efbf18b38ec33a0f253e9403d30ebab5c5aea93906d04d44e8e94739612e799cc6b1", + "publicKeyCompressed": "0314c4d1d379d1bbef305466a360e53b0d5151829ae5460ba179eeecd78a21efbf", + "msg": "68656c6c6f", + "sig": { + "r": "0089882732b3ae4a65ba8dc0eabf1219110aeb783a9078a904134fa1ed2f5e8eb0", + "s": "00b57493b9ace7d816de8949f1cc3798a805184ae992aae6f101597e9dac238936", + "id": 0 + }, + "comment": "R: h=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 284, + "publicKeyUncompressed": "047aff7565bce2c098e1dbb736b0fd802df34f0ca3e18747802c6c5016ca0b520ddfde557c99ef67cc04011e5bf76e6e27fffc9b98d67f344d17648855b743570b", + "publicKeyCompressed": "037aff7565bce2c098e1dbb736b0fd802df34f0ca3e18747802c6c5016ca0b520d", + "msg": "68656c6c6f", + "sig": { + "r": "26ac524f7bec740b75b1b8d841a0f2a2f29ab0bd870d2b4a3a505edfdf6fda5d", + "s": "009f3fad4d041506fb47c263c0dcb86893d48a45dd393e4d4f41e4c2cbac7b7e3a", + "id": 0 + }, + "comment": "R: h=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 285, + "publicKeyUncompressed": "04e3afa5049f2e136bc4ee9a2ded5514523c7547390d96aaa6ad4c89a139b84b4139cd0e23a1961ca9d63a95b24086a9c9cbd9ab2ea2fe6049dbdef36fc9562e3d", + "publicKeyCompressed": "03e3afa5049f2e136bc4ee9a2ded5514523c7547390d96aaa6ad4c89a139b84b41", + "msg": "68656c6c6f", + "sig": { + "r": "584d2dc258bd4650e6fa04fe9d3d2a5e768d795945ed2323f844d0a8fa0c6fbd", + "s": "105409e29d9ae52b9560810392ca8c74721cdcf66e553cf03f5f019d608f2875", + "id": 0 + }, + "comment": "R: h=-2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 286, + "publicKeyUncompressed": "04827a228c5c096bda80a4867f85f4c24430f17e462a20ac58409895f6eed300c038461fa2daf1ae5a809f31ead920dc33800b200ffa529a84309d014974b5f23c", + "publicKeyCompressed": "02827a228c5c096bda80a4867f85f4c24430f17e462a20ac58409895f6eed300c0", + "msg": "68656c6c6f", + "sig": { + "r": "00bbad8da4c018bdc15a5af8f3da4b384c530ea75560cdfd242bfa3235d8d3595f", + "s": "00871f17ad4aca6e71af82a28453042eebf404605f68efb2b3d9a92283be9a5546", + "id": 0 + }, + "comment": "R: h=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 287, + "publicKeyUncompressed": "04244333b5db14598b330062ad7f71afc46de4f1c1bebfe69211c83f9aaa3e7759537f1f1d5b5a607deece4d05043521dcd0dd073f6508e57b5825b6df55cb4080", + "publicKeyCompressed": "02244333b5db14598b330062ad7f71afc46de4f1c1bebfe69211c83f9aaa3e7759", + "msg": "68656c6c6f", + "sig": { + "r": "78c926b0ee01c000c25a83631219f08d8b34745d2ea2fdc9ebdc5a2288fa9b03", + "s": "4bac5b82788c7831c8bb4232c71f0aa96e6e92d392417ab1ce349815d09afeae", + "id": 0 + }, + "comment": "R: h=2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 288, + "publicKeyUncompressed": "0482e4f250ddd281d342d1f2256ed40a9ed7489a60cf531eeebec0001f6553bc15ea8cc88852f020ea4e24c6997a4597b2248e4debbb6d50f7bf0c9133a2e35cd0", + "publicKeyCompressed": "0282e4f250ddd281d342d1f2256ed40a9ed7489a60cf531eeebec0001f6553bc15", + "msg": "68656c6c6f", + "sig": { + "r": "20cb4091b3c7ffedb9eb8004e85992cbbeb64d5ab9aae69b377f3e51096121a9", + "s": "00d278239b206cd1ceedace118235784c9343b890c563a980d582b94a70aadf90c", + "id": 0 + }, + "comment": "R: s**2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 289, + "publicKeyUncompressed": "0416fb547e719801440d2f3e198ab1db9399b6b567f09a1ed16190331e90f5265c9b1a5cc451410201fc2e284cb08968593260d11a6fbd4c6aad762ff2f2a8ae94", + "publicKeyCompressed": "0216fb547e719801440d2f3e198ab1db9399b6b567f09a1ed16190331e90f5265c", + "msg": "68656c6c6f", + "sig": { + "r": "0097ec18e01255bb88561e1189d22e88bda5ae30d6863d0b73a17c25b86df045aa", + "s": "008b0866e4a606a957bc8fa6a206b58f5e4b6659655c38b637057f9fba76d013fe", + "id": 0 + }, + "comment": "R: s**2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 290, + "publicKeyUncompressed": "04e34cae0317cf43124dee7d92a9d20c99c2cd858e09218785fe14a55bf0293ec9ac9d3e0f986d7cc7f358f41c45eba8f7ff59bfb0be99ae2deb45152791302cb0", + "publicKeyCompressed": "02e34cae0317cf43124dee7d92a9d20c99c2cd858e09218785fe14a55bf0293ec9", + "msg": "68656c6c6f", + "sig": { + "r": "4748a68e39e24489eff66e714577e4769b9b81cec0180df127049bf588ae94dc", + "s": "00c000cb762374567a2bf608c2feb614814d77c5d6a6f530d066371539d2e2c93a", + "id": 0 + }, + "comment": "R: s**2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 291, + "publicKeyUncompressed": "045cdccc33d4d89c63de81a95524b0364740ab00e68ebd6d79314dc83f75aff89d3632dd751fc1eaeaef342132610a64fd62a2a9ca4a93ca5d09559f54637352d8", + "publicKeyCompressed": "025cdccc33d4d89c63de81a95524b0364740ab00e68ebd6d79314dc83f75aff89d", + "msg": "68656c6c6f", + "sig": { + "r": "1fe1e5ef3fceb5c135ab7741333ce5a6e80d68167653f6b2b24bcbcfaaaff507", + "s": "00c5d0dc55dba99d305d3368edfd7b9c56a52412c7b64a433427e2b3af52b359b8", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 292, + "publicKeyUncompressed": "04afcaf52839c476a3b6f3c60a00d86ddf0cf8ad89efe3289c61883d3840e72e50245575d748a121222bfd456d74b5d1554a2c6bca08a50b74d592bc3a32046a4f", + "publicKeyCompressed": "03afcaf52839c476a3b6f3c60a00d86ddf0cf8ad89efe3289c61883d3840e72e50", + "msg": "68656c6c6f", + "sig": { + "r": "146d3b65add9f54ccca28533c88e2cbc63f7443e1658783ab41f8ef97c2a10b5", + "s": "008e81c5df25b853fbddbf5788c194a8db940bdd857d26193453a27bc6ee3b78b3", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 293, + "publicKeyUncompressed": "04ea0004c36b214ff568a53d2cb422d9a3580775fdaa7981beeac9d5e9667eae1635457dc9fbd59d3a3686ba965f91a27cedd381da375e637ae0a981fd5f1651c5", + "publicKeyCompressed": "03ea0004c36b214ff568a53d2cb422d9a3580775fdaa7981beeac9d5e9667eae16", + "msg": "68656c6c6f", + "sig": { + "r": "00cbb0deab125754f1fdb2038b0434ed9cb3fb53ab735391129994a535d925f673", + "s": "00c92eb3c0e885e0749b3fd00669b2e37693e9b7fb25f822ac485d1a25137203d9", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 294, + "publicKeyUncompressed": "04fd81032cea584bbe87fe14655549ce6e14c8fa6cb8edfa697b8012f0681d3c7a90b376cf1c283f71e338cc040d4af83175a2db408a98f1a927aefcf7f60e21d3", + "publicKeyCompressed": "03fd81032cea584bbe87fe14655549ce6e14c8fa6cb8edfa697b8012f0681d3c7a", + "msg": "68656c6c6f", + "sig": { + "r": "0092b1637da83a0c4fc16eba2e4f4dd88367eb24d6f6bcd8d3b5d3c23d76f02e77", + "s": "00fe18f340b68a63ae03f1dadd08fff2a4900dc2d264b777dfdd8663153c933a96", + "id": 0 + }, + "comment": "R: x3=-3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 295, + "publicKeyUncompressed": "04f5a62a9bd184b715b8f6ca2e579fdea7032c82d2b86e0472d1d6638beea2a1cd99f585d4dc6e64ed7d4b57373512b61aeb1de613846657e996bed671a7fb6a26", + "publicKeyCompressed": "02f5a62a9bd184b715b8f6ca2e579fdea7032c82d2b86e0472d1d6638beea2a1cd", + "msg": "68656c6c6f", + "sig": { + "r": "00e962e355d01eff293794cccd6e340c760785ceae509696165f3282e770d6ea70", + "s": "00a4c5f7253cac18ea0ba76d6e5d9f7f497a00c6ec00b054c955405da2cc6e063e", + "id": 0 + }, + "comment": "R: x3=-1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 296, + "publicKeyUncompressed": "0488379c28b72c0485d60b8e3d897889beaaf92b23d03bdcb05204b454955a485142ca9ac889a2a9434f24cff016e2b0fddd241d82b93c9e97843aad27cd4b7eba", + "publicKeyCompressed": "0288379c28b72c0485d60b8e3d897889beaaf92b23d03bdcb05204b454955a4851", + "msg": "68656c6c6f", + "sig": { + "r": "008c389a588a34bd242ee2e36880cea50cbee41736966fb69f47aa6cc30243871c", + "s": "00f8bcb53ed9dba83196fa4fe26892242697ff2da5b4cfe5f42fff6e3c76f35c36", + "id": 0 + }, + "comment": "R: u1=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 297, + "publicKeyUncompressed": "04e47d0c1d7dd2df4a5c6d01f47e9cb1cf85bea7992f391f90954dc50584b571ff4da10863cf2aa34d25c6828b56536e3811ce5fe61646fdacf4684d256d3c1cb5", + "publicKeyCompressed": "03e47d0c1d7dd2df4a5c6d01f47e9cb1cf85bea7992f391f90954dc50584b571ff", + "msg": "68656c6c6f", + "sig": { + "r": "062ff933046837c65858f18db000dfc6b9103135c332845d75b79526eb8ab230", + "s": "0aad9d10ba712011519f6aa12858b0e93c30798a8da56c1038d7825deb7c421c", + "id": 0 + }, + "comment": "R: u1=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 298, + "publicKeyUncompressed": "0482105c5c93868ba4beecc84951ba22281eee3a4fd47c395330593b9dc107eb0947a9bf96c8eb60868ce8be17d389b46fc01c3b9afd14618b8f60a915718de334", + "publicKeyCompressed": "0282105c5c93868ba4beecc84951ba22281eee3a4fd47c395330593b9dc107eb09", + "msg": "68656c6c6f", + "sig": { + "r": "6d976c7471630b1578c42b09cf307b2c880bb793a65dc503429dfe151231c2e3", + "s": "18abb8321e56ef53b0bc946014879be9b16342be9126eb1a57b76efb442ac7f2", + "id": 0 + }, + "comment": "R: u1=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 299, + "publicKeyUncompressed": "047a2f270b836380d489e81677349d74f3f9578674561e7871d19ee9e7f0acdebf2a3f6846da23bceba23fe83534fe98d01929c530b433823ac48006c65568365c", + "publicKeyCompressed": "027a2f270b836380d489e81677349d74f3f9578674561e7871d19ee9e7f0acdebf", + "msg": "68656c6c6f", + "sig": { + "r": "00e434b415eec4924484d20597735f7f68a9731418ebd3e6c78f5fa072d52b2e6c", + "s": "47f496c31f729684d1b99837975615eab781d65a4b523780074d6d1fa0f3ffe5", + "id": 0 + }, + "comment": "R: v**2=2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 300, + "publicKeyUncompressed": "044676d2c83bde387040a49fd4589c74d073f93927f30ae46bb7f247393f2cb38dcdd041276df7f1e96c342703e357572ea31e7eca7818625fbf1c8a5870fd8b50", + "publicKeyCompressed": "024676d2c83bde387040a49fd4589c74d073f93927f30ae46bb7f247393f2cb38d", + "msg": "68656c6c6f", + "sig": { + "r": "008a9813e0c6517ed57006b2ae943df3b6520f9138d67bb1ca108828095b6bd7a6", + "s": "7e936bf2d8bb873d8936396aa2169bfe8fc873008b82f0087e53b4029c986acc", + "id": 0 + }, + "comment": "R: v**2=2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 301, + "publicKeyUncompressed": "0451c79508bb3ea8d9bd50e2984c8aa6ccee49ee2fb4ac4ae5324bb8e7339a85e9fe157594af2772a858d4a81aa97a3bfeb8f2c851b26b474922622c804d98ce1c", + "publicKeyCompressed": "0251c79508bb3ea8d9bd50e2984c8aa6ccee49ee2fb4ac4ae5324bb8e7339a85e9", + "msg": "68656c6c6f", + "sig": { + "r": "182c488e1b18bac4e4481dc408637bf1942d07fbb98165ce871b691a33064c67", + "s": "5291dab36b4bc4da01dc5ff1f0c0833bb93c7d8037ba98e9378ce3b2f8507fe5", + "id": 0 + }, + "comment": "R: w=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 302, + "publicKeyUncompressed": "044325b92047fa758d8cbcf1604c4c5f7e55dc51552b42630c2527eb30e688982fbda1a44f09510c241274150dd65bcc55abb1ce1d002b4828c1d158bcf0bd37e9", + "publicKeyCompressed": "034325b92047fa758d8cbcf1604c4c5f7e55dc51552b42630c2527eb30e688982f", + "msg": "68656c6c6f", + "sig": { + "r": "00a0488bb1e1b8d18f79188dd24daf46a74a6924c52c7ca768f478920e9863a9b8", + "s": "064243aeb34bbd5d94fe4fddc60dcfc2631da54cc5ef94c19819164b101fb699", + "id": 0 + }, + "comment": "R: w=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 303, + "publicKeyUncompressed": "04bd1eac189b9f06116e8c485273f2d5e31567251431f2dc23ef7fb9625c1611f2ef83c3f65cd5567238b06faefceabb65106a8fc3e6ffb92d5c8110e24f7889a8", + "publicKeyCompressed": "02bd1eac189b9f06116e8c485273f2d5e31567251431f2dc23ef7fb9625c1611f2", + "msg": "68656c6c6f", + "sig": { + "r": "00b223e881920d6c20f82e583ae99b6e1673b61b16366f4d8085b368ba98e719d6", + "s": "00f31fb233dd042ef4024d0017861d7b2ed449d4158b991a8bf2d74feffa94744e", + "id": 0 + }, + "comment": "R: w=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 304, + "publicKeyUncompressed": "04d8001367e49098526dff0b675721eaf4346bb5220e7085a2852ac90f60b6aed3f06a6a2f7bf326e3b20ed9b8222f77cf6de8fa546fa70652963a83ce5a5e2b06", + "publicKeyCompressed": "02d8001367e49098526dff0b675721eaf4346bb5220e7085a2852ac90f60b6aed3", + "msg": "68656c6c6f", + "sig": { + "r": "134116593aba3ba809ab243cd27f0e77f73c7936484ca7c345eefe35a612329a", + "s": "53343157487adba6a1501aa74d81c27077ef98b60f8c779c4af45dafdfe2915f", + "id": 0 + }, + "comment": "R: b=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 305, + "publicKeyUncompressed": "041c9f298e085e53f0e54166219c2e1ebffe9dde377f08708a9eccf833f4e44b6d083b4018843b6c390e61416d3397cd538d1e9b71a4a62b252389ae5c9d37ad24", + "publicKeyCompressed": "021c9f298e085e53f0e54166219c2e1ebffe9dde377f08708a9eccf833f4e44b6d", + "msg": "68656c6c6f", + "sig": { + "r": "00a057e0542d9d30b57fea2312c94c57d1e3450aedb7b61dd05d5bc4aeda9bf9a6", + "s": "0e36d01328cb9bf0994c8c0285d2a8e1eb6f505dae06e118a78560a11f65c73f", + "id": 0 + }, + "comment": "R: b=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 306, + "publicKeyUncompressed": "044d91799947098cecb1872a7907465e6928621a9f256c8cf32bb92427c870516ee008f799d59ce8a7207b2ab140caffd09eb8ca493580a216fa153c8759a92bc2", + "publicKeyCompressed": "024d91799947098cecb1872a7907465e6928621a9f256c8cf32bb92427c870516e", + "msg": "68656c6c6f", + "sig": { + "r": "5c46a07644c32bce98f69974fa56b0edd0fbd1fa061daba09a4d7dc1533127e8", + "s": "36c5cdee3eedaec1f633aee62a7688d054ffbded141083662049f5f5af7ebd46", + "id": 0 + }, + "comment": "R: b=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 307, + "publicKeyUncompressed": "049c3eca7878bfff23feca0e3fcd090d27c2bc367faffbc4eff7b0e561d843c6213e5eea47e97019a81154c30c3ede09f503b041fd72d510bc7facf4a1936c8af5", + "publicKeyCompressed": "039c3eca7878bfff23feca0e3fcd090d27c2bc367faffbc4eff7b0e561d843c621", + "msg": "68656c6c6f", + "sig": { + "r": "00ecc1207635725787ce3e2405a3299938646496c0fed6e9ef3d7305ccb6780346", + "s": "5d2b16c5ccee4c152d881e84c24d7d226e9f6a224e99dfe955108cee519b360c", + "id": 0 + }, + "comment": "R: b=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 308, + "publicKeyUncompressed": "04a451aa39e31654c8bddd5ba69d8f0deb560bbac1e068be8e17da0cb9df7d8e0f2290a278b7c3b9642fda435eff16ff240a1d6bff7e722b049b8000f9b5613393", + "publicKeyCompressed": "03a451aa39e31654c8bddd5ba69d8f0deb560bbac1e068be8e17da0cb9df7d8e0f", + "msg": "68656c6c6f", + "sig": { + "r": "0087b1d4cb6f7530a53613a40b30f83f091fc5a21cb4eb7c38526f0bcc81b205d5", + "s": "0093e3ba82aa55dafc53d02e46a5c616b9b05ac6e9d6c70f380d84d682bde01de6", + "id": 0 + }, + "comment": "R: h=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 309, + "publicKeyUncompressed": "04a10e71d2dfcc5cab9b44f5e247c12c4eccbee7bd600577b38266837fe23c56cc913727d52c5c8c3c6e083bf860b6bef3b27ba3294f32416ac3a812bea2d301a3", + "publicKeyCompressed": "03a10e71d2dfcc5cab9b44f5e247c12c4eccbee7bd600577b38266837fe23c56cc", + "msg": "68656c6c6f", + "sig": { + "r": "7f82ab9bebfafb121b398faba731c8badbcff94f8d9bd93dfda0007d66479c84", + "s": "07f2f5fc9043c70a826c1381a31aeb2e5068eeda50da7409ac7df538bb87ccd4", + "id": 0 + }, + "comment": "R: h=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 310, + "publicKeyUncompressed": "043e65aa70e5fb661b9b1f0909672b0e71962038730f33179cdcb08d24a1d66ed56eb7ca2c43e61a39e76ffb6f75f9a829c2427deaf548510cff2fc571f9c5e79b", + "publicKeyCompressed": "033e65aa70e5fb661b9b1f0909672b0e71962038730f33179cdcb08d24a1d66ed5", + "msg": "68656c6c6f", + "sig": { + "r": "00bdd2c6eebdfb600b60540f546e1e46c72abb243f8b90711ebb64119577949b60", + "s": "00cf8a50b75d18b0708211a9e3f4e7eac2ddeae4c16b6995bbd137c7a7eb50ef6f", + "id": 0 + }, + "comment": "R: h=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 311, + "publicKeyUncompressed": "04730a1339add3a4420b329d393b51afec8c5c18e9ebfd158570bfeedb85d62b5b27cffef0854ac87ff8656237feb9f815d2859e60abbb0b28ad1dbb13bc20c980", + "publicKeyCompressed": "02730a1339add3a4420b329d393b51afec8c5c18e9ebfd158570bfeedb85d62b5b", + "msg": "68656c6c6f", + "sig": { + "r": "32b575485a17f6733fa8774073d4c8ea9bccb5c5fe767f9ddef91da300037dd1", + "s": "2b098ad8e942313c50eae6c3fd594c84cba5916eeb30ca5a5dd20f500aa9e7cd", + "id": 0 + }, + "comment": "R: h=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 312, + "publicKeyUncompressed": "048a4a7a4bc6223f35fda43aca4ee3e16d47ba1bdd4399a6458dffff9797845a9b36cf5538688573709431d7fb5ef0873d10942ccb2941e595bd809f83065e2636", + "publicKeyCompressed": "028a4a7a4bc6223f35fda43aca4ee3e16d47ba1bdd4399a6458dffff9797845a9b", + "msg": "68656c6c6f", + "sig": { + "r": "00d0d6b87b213e7ae95c42f7684be4a95df6654580cd7227bf95e421174b71e101", + "s": "2eace5d99fff14b7cc4304703a0753cd799b13c3ea1c718892dcfaff94fd010f", + "id": 0 + }, + "comment": "R: h=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 313, + "publicKeyUncompressed": "04fd141d91f190e608fe947da2438008591ce653524f3e698a86faf83b4694b915c18c04c1ed351709d68b9d3c2887dc7acf60869ae1f4be7889fbd1f65bb9c262", + "publicKeyCompressed": "02fd141d91f190e608fe947da2438008591ce653524f3e698a86faf83b4694b915", + "msg": "68656c6c6f", + "sig": { + "r": "00ba78ce6f6699a2ef114d2d24e8c8ded95fb03a3ae62a5877ea8f9a8c34db8f65", + "s": "00e0d88d3b4b65a15b4971f230e591d89c1f44c05ca06320d82839cd8a0baff2c5", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 314, + "publicKeyUncompressed": "04db832722851434536cb877a75cb9c054896a593f194f02bf418e1bdd45616ae04e560a0ab49cc3a6c14e3fd5cc4506999a4fd04299942d510f10f337be599f35", + "publicKeyCompressed": "03db832722851434536cb877a75cb9c054896a593f194f02bf418e1bdd45616ae0", + "msg": "68656c6c6f", + "sig": { + "r": "4eb1138f020b7f4cd906e48d3069ce87784a45a12298e30a6a3052c311da333e", + "s": "221c6f6e449be2e9ffdacf0ccec3357143db29f29b249e96d8791d49c33b6356", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 315, + "publicKeyUncompressed": "04c1739ef85fcffd942e5a7034c1f640b169dc529685f0ac41001bada80f6cd89d89d2ae6f7620566043257abbb53a6d1e27c933eb66027856315ab967b98bee5f", + "publicKeyCompressed": "03c1739ef85fcffd942e5a7034c1f640b169dc529685f0ac41001bada80f6cd89d", + "msg": "68656c6c6f", + "sig": { + "r": "0083012d22f551497e1206269456da6051ef7e675e6408d0bafac2181037d005a4", + "s": "00805d98c1c9fb54e5476bcc217d8653f1f80d283955fb78a59680aa2aca5455fb", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 316, + "publicKeyUncompressed": "04107f8e0c32056e2ad6c99ca1cd4815b749eabba682982afd4eefd2e976570158e7550df49f9175c12f8b4175e48b96a9b5764574937abf99b025a7f1beda0acf", + "publicKeyCompressed": "03107f8e0c32056e2ad6c99ca1cd4815b749eabba682982afd4eefd2e976570158", + "msg": "68656c6c6f", + "sig": { + "r": "66364f70826d992fdd4014032cbca8fbd03a0154980b139c5be34f02416164a4", + "s": "085f965cef8147ea3b5400b24c082974e1d3327a5b7801a237a4b31d1bddce46", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 317, + "publicKeyUncompressed": "0446adcf9e3818eb4c38b764bfa899da67722a82f39b21094a1ab816aced0b0fcbfff1df287807a83a586a99d1694b40eb2b9ec9345d6e885ea2701d0b56e0dae7", + "publicKeyCompressed": "0346adcf9e3818eb4c38b764bfa899da67722a82f39b21094a1ab816aced0b0fcb", + "msg": "68656c6c6f", + "sig": { + "r": "00df50e22016f8c3e11172bed7ea7a782ad015c47081ca93ebb98d166f89c30455", + "s": "00b4be4edc20872e56061b42793605c47caa061bf9e2d1c9054044f8085aec6da3", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 318, + "publicKeyUncompressed": "04852030dfafc779872245c4efcfbf117e7ccbe948c7f69cf91a28145a8283256186dc679902bdfed8b95ba86a0509314b1cb9fbfb02dce889fe5005245b9fbacc", + "publicKeyCompressed": "02852030dfafc779872245c4efcfbf117e7ccbe948c7f69cf91a28145a82832561", + "msg": "68656c6c6f", + "sig": { + "r": "2e4dbf4e08a3373514f2f4de78bbd12698375300795e4c3a9b0d952bb655c34d", + "s": "2c81310a1f1fd3fe7e29ff7fe78659e399a6b53c7e365e836117f4e333ad5e06", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 319, + "publicKeyUncompressed": "047ca85cef12dffb00aefd6fc4190e8ca3b4b3bc12ef3fdcdd51a2cf7b7e47446b19fed5ca6424d194cd98dabafa7cfda494c1546eec915ed29c469adf7a3c2236", + "publicKeyCompressed": "027ca85cef12dffb00aefd6fc4190e8ca3b4b3bc12ef3fdcdd51a2cf7b7e47446b", + "msg": "68656c6c6f", + "sig": { + "r": "00d67868d3cccb21068a5abf195be028810dee7a57e1827e644c1952618da0441d", + "s": "1e33092141bc90ac63ff67aa44d0b97f7eede5411ec1cb0faf98e6539815f320", + "id": 0 + }, + "comment": "R: s**2=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 320, + "publicKeyUncompressed": "04fd205531fc7a406cf89c0f00299534af082b017502c91d5b84a5dbbb9abe50eedac331816fa3f4982d4cf1f5fe6f649bd84094b6d2e51e122e874dda34770a40", + "publicKeyCompressed": "02fd205531fc7a406cf89c0f00299534af082b017502c91d5b84a5dbbb9abe50ee", + "msg": "68656c6c6f", + "sig": { + "r": "5484cf29f94ebc6a2baafaf590fd4e35028b7c3c6fa12ec75a401ab805d51566", + "s": "65c5fb15b09e5a8ce8c72fc3f78ac1bde8e7c85177e06fb746be2f6720e2bcb3", + "id": 0 + }, + "comment": "R: s**2=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 321, + "publicKeyUncompressed": "0406055d28e7b02a268a67a2a9bcee9c15ade34d2f42aed9cb840271c2e6d60b4a1804ad550064ca8178bf34564223c6fbfc88c4333e96ddfcf2f89a8a5fa1ae57", + "publicKeyCompressed": "0306055d28e7b02a268a67a2a9bcee9c15ade34d2f42aed9cb840271c2e6d60b4a", + "msg": "68656c6c6f", + "sig": { + "r": "00d502c80239e6228f49fa45f113228949ef86096baedc52d459a692e46c8a9edb", + "s": "19fd6e3d69132c623e1a9dee2b444b518899845798c2107ce9fa0467f94b3d9a", + "id": 0 + }, + "comment": "R: s**2=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 322, + "publicKeyUncompressed": "04f864879f2ffd6a89cd5a9cdd74c104c8abb830a5efdf9d988b1d8f9e9b3709268c6c3246dda594f5704134e5d6004622ae568566fff0d534798b00ba420aef88", + "publicKeyCompressed": "02f864879f2ffd6a89cd5a9cdd74c104c8abb830a5efdf9d988b1d8f9e9b370926", + "msg": "68656c6c6f", + "sig": { + "r": "0085408cb788a55cf0372677d32edc10afe975808f72c8ccf8a6d29ff72741b33f", + "s": "6c9a04bb6aefc9a11233bf76e4e3286fcce302d33e322ba888f3af9e395fb048", + "id": 0 + }, + "comment": "R: x3=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 323, + "publicKeyUncompressed": "04fcdbfc2c15587dae2e5c74ad83546e0482f671f0a2bf136deb469940b1eb5395bb6cee9425466cfc845be723e6ba72eab9cfc0caec7032c3502dc0e6e259e130", + "publicKeyCompressed": "02fcdbfc2c15587dae2e5c74ad83546e0482f671f0a2bf136deb469940b1eb5395", + "msg": "68656c6c6f", + "sig": { + "r": "5d5855edf773b1078e4df05f207ea98208669219fe8b10dc715e5a189ff6879d", + "s": "00bb26665c5013c7a3c9e2c570972f5cfb481240856e0b2082136cc61c05409483", + "id": 0 + }, + "comment": "R: x3=-2 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 324, + "publicKeyUncompressed": "0498a7030a724dfbf82931de90b67b459c4da962cf49d3783425b75848ec562479bc3bef77ebafde81b1dfa872649317fadf31ce669ae3c0165cee7fab2e39a646", + "publicKeyCompressed": "0298a7030a724dfbf82931de90b67b459c4da962cf49d3783425b75848ec562479", + "msg": "68656c6c6f", + "sig": { + "r": "00ac2c4c0f43253848c3967ae4829f3a9ef1641f2cdd3985e5e3fd6a1b966cc526", + "s": "6304c2df2dc7c8c684b1df37650de43f9efff836b16017f513c0bad4f49ab224", + "id": 0 + }, + "comment": "R: x3=2 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 325, + "publicKeyUncompressed": "048e060687a4e8611f24fc31b48505636f9e06b6204b8a0bfd1e8db6d8e6e664ee10634f4693d5704fdca5cf6172cd64fd5e67e5d93840ee96185ae99e81d538ed", + "publicKeyCompressed": "038e060687a4e8611f24fc31b48505636f9e06b6204b8a0bfd1e8db6d8e6e664ee", + "msg": "68656c6c6f", + "sig": { + "r": "00aa319e26e2e06a58151519210faab6833523fe9ab5cbc61e63867a4d08d9948f", + "s": "0080bb7acdd2ee8c733955f616a225b3b2739ec51f7d8486f560143f0047e3efe3", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 326, + "publicKeyUncompressed": "048fbc2dcd5d6df04471520637ca6eacb69206dea0bcf879b5abb13283bec3dc50a374946d6cf894c76240097fb157dee678734e39a6cd5c86856a7a46310fe31f", + "publicKeyCompressed": "038fbc2dcd5d6df04471520637ca6eacb69206dea0bcf879b5abb13283bec3dc50", + "msg": "68656c6c6f", + "sig": { + "r": "00f53995a19dba354482341320dbd4c86b77f90491b451f6085d7af793f643f53f", + "s": "00b4c34d8e0a2997061b36fd8a2b2a0db5ebdc1ce236b1d4ccd1af3257c82963f1", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 327, + "publicKeyUncompressed": "0451080b71795c8d5dadac47d8a923274de951b9af0924e77a1ff770ed9be7426b0aa96a0be2a9260982f0948ce2eeb95f7f7a4966984d79414b4ad6d5c15e65c6", + "publicKeyCompressed": "0251080b71795c8d5dadac47d8a923274de951b9af0924e77a1ff770ed9be7426b", + "msg": "68656c6c6f", + "sig": { + "r": "6094cc377f65606368b6d3be1480811152e2fcd395e243d93efe8e1d00e26e90", + "s": "00bb8b09d6b26a41c679fc2c266cb0319937f26b5563a064fff9b55f2b1ccff419", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 328, + "publicKeyUncompressed": "049c32e76cd8fb0f2295e311d9b5ce79df7fdcd9da306639d3c9c14901e5037ff8264b074e823d9789f0f519bf1d2f4834c4f32da34a9e1237a736e5c252c4458c", + "publicKeyCompressed": "029c32e76cd8fb0f2295e311d9b5ce79df7fdcd9da306639d3c9c14901e5037ff8", + "msg": "68656c6c6f", + "sig": { + "r": "52e2d4bb76b61eada781352e010f71773a1f0a896c59aa7d76806ccfffe711b3", + "s": "00f2ccb11f4705c2c91e080e43e8771f1b35620d0d737ee5a4614972af868a8410", + "id": 0 + }, + "comment": "R: u=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 329, + "publicKeyUncompressed": "0467be124f7dec968c04727e51953bb5124c87ad4965c39cf6bdc33c1f81b4a8a1865b01ef849998a267dafe31dc305131b77f242ec9aa4da3c3e048face3a5125", + "publicKeyCompressed": "0367be124f7dec968c04727e51953bb5124c87ad4965c39cf6bdc33c1f81b4a8a1", + "msg": "68656c6c6f", + "sig": { + "r": "00d0e7adc9576c09f56523e65caf86ba40a8742e3c650ce02edae474177a37ec85", + "s": "5b4447176b8889bb3671ab0319a519e18f7984048958aeaa0d13cf0e92242aa3", + "id": 0 + }, + "comment": "R: u=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 330, + "publicKeyUncompressed": "0475667b18275a956a584e01a015de048723b187577ec9205246f34da23b529490dd733ad497a010f65f2a1b5e35258594a5fcba29a3cd1fb26bcc9103629f8c1f", + "publicKeyCompressed": "0375667b18275a956a584e01a015de048723b187577ec9205246f34da23b529490", + "msg": "68656c6c6f", + "sig": { + "r": "00dc357d7b31ddd75cf35ae4754f69d4481d6cc73a2e997553ae9b1f1685e0fa26", + "s": "00a2f8d9fbdcf418bb7a0f668037e3ba04d291bc451aff2c73bd1b8ec5142e993a", + "id": 0 + }, + "comment": "R: u=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 331, + "publicKeyUncompressed": "0417cf0e3c3139718c4ca062801573eea5c12023f44676de4ae91a59dc474212f02e425c6867e9526fc01b01544169a3dcaac3daeaf1b5c90ba4bb6de3858ddbd6", + "publicKeyCompressed": "0217cf0e3c3139718c4ca062801573eea5c12023f44676de4ae91a59dc474212f0", + "msg": "68656c6c6f", + "sig": { + "r": "00f806874a1656c3820225872fb35ceb8d83369c49af89b7b44449968e54171e3a", + "s": "00e07b55135657569cf7d5c350e110df6696152dc89c248765bbe29a1bf60de89a", + "id": 0 + }, + "comment": "R: v**2=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 332, + "publicKeyUncompressed": "04b4130670436373d095335da2f73b844b60f36bbe10c23fa8f46ba8a752dac74d66a7bf1185d9642926ef4205bd08e2940fb34db33e99510dfba526ae3256b50c", + "publicKeyCompressed": "02b4130670436373d095335da2f73b844b60f36bbe10c23fa8f46ba8a752dac74d", + "msg": "68656c6c6f", + "sig": { + "r": "00a6d57d3e60ea1e3df4cfa62d013c50ca3661f6844d10218e99270eb94214b5f2", + "s": "008ad6244ad876868539e665f1c2e5a2a1dabcae56adbcbf8769286f0017480456", + "id": 0 + }, + "comment": "R: v**2=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 333, + "publicKeyUncompressed": "04dc98451e3a6deb44ff1c43cca2cf969264a11454405c7250e079a162354d121bd86e888864e25fd11001c1c3cfcf690ea0fa6254b61ff9b7bffb07b9556dc38c", + "publicKeyCompressed": "02dc98451e3a6deb44ff1c43cca2cf969264a11454405c7250e079a162354d121b", + "msg": "68656c6c6f", + "sig": { + "r": "3831ea2c3eb8e320a641a33eef9c751e3a9fc42d69bfc6ff0b5eddc321986cec", + "s": "00c428db994094a74b6b0df4c97e4483b8769db27c484bcc71b509020f5f30edbe", + "id": 0 + }, + "comment": "R: v**2=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 334, + "publicKeyUncompressed": "04ef464df7d5cb6b0bc38f31605d8448ef0542ae3d144766c63ad9b8d5f781a43c79bee78277d1e4953ee2b990be0d96f5b4d403c716e895bc114f03b84eb3361e", + "publicKeyCompressed": "02ef464df7d5cb6b0bc38f31605d8448ef0542ae3d144766c63ad9b8d5f781a43c", + "msg": "68656c6c6f", + "sig": { + "r": "00cfb0f361195ceae1012d6019de0cdd6fde17cc3aae7ae3c71b7b265223aa0f3f", + "s": "307b271c38609dcce32e80ac165b8c097b485be22e4784cbfa0944f4e3ff4b8c", + "id": 0 + }, + "comment": "R: v**2=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 335, + "publicKeyUncompressed": "043ca8afb63b20b2935ed4eb3dcda78efec8fa742400189eb303e65e1a8e52c2385fa5cdd5367a19eaf4425df07aec68ba7f466e43c4f1f602080eb71804222ed1", + "publicKeyCompressed": "033ca8afb63b20b2935ed4eb3dcda78efec8fa742400189eb303e65e1a8e52c238", + "msg": "68656c6c6f", + "sig": { + "r": "00e339cf4216310345db53610fcf669fd581c32fadad7f4e0f9f4dfcffd0e6d50e", + "s": "00c695961c628dc260337f5caeae19b129404916fa0ec7c959447c251f04c7690d", + "id": 0 + }, + "comment": "R: v**2=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 336, + "publicKeyUncompressed": "04ae585014e5227c83c8507316a9632dc394e53a7e00294234070d9e7cd3e443ebbee931b73df0a111efe75bcd24cb6c610728be4e63632edc8085dba79ce6fb45", + "publicKeyCompressed": "03ae585014e5227c83c8507316a9632dc394e53a7e00294234070d9e7cd3e443eb", + "msg": "68656c6c6f", + "sig": { + "r": "4d9aa20dbcd8720481cfdd672d411277e76f1a138fde8466b1f5bcea9509f0c9", + "s": "392edfb6aa01eb1ab6266b0f0a764f2800e890d026ab80c8878c0537cf1e7325", + "id": 0 + }, + "comment": "R: y2=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 337, + "publicKeyUncompressed": "0468bd307a779f6e79a46793d4964c323f5af6e3aba285ae17d4ed0b52296a24b0df6099a85c49cfdd1c757fea53f9e6402c826a1b756c4735b30704aecbaa2499", + "publicKeyCompressed": "0368bd307a779f6e79a46793d4964c323f5af6e3aba285ae17d4ed0b52296a24b0", + "msg": "68656c6c6f", + "sig": { + "r": "00fc20d7de00e7434edce5bf642adc44b5262138b3e62698179e003a80b733771d", + "s": "0080590e5eb7daaeb49e948be133a7f8787bed500f7055e6489595a71964b58f00", + "id": 0 + }, + "comment": "R: y2=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 338, + "publicKeyUncompressed": "04b1bc53a5f1fdc97fceacc3088eb402b97c655ee6f4083d7d31ce081005622ef8ed5b41745cc8989d409cf7ea1824776a1cb2d9a1691aabe5afebfbaf4a2f91e6", + "publicKeyCompressed": "02b1bc53a5f1fdc97fceacc3088eb402b97c655ee6f4083d7d31ce081005622ef8", + "msg": "68656c6c6f", + "sig": { + "r": "00b644861442404aaca14a6334a7e2a8d2f26fad3889fae381b00a0892b3c29078", + "s": "2de3cc37c8ff78e4de22523affd617660d130090f908f6dc28f1fc8cee9b287b", + "id": 0 + }, + "comment": "R: y2=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 339, + "publicKeyUncompressed": "043deaddc1b1ae664c3b70c927812d1b2857745db2fa80074eb83b7bd01cb26a5a03bac27a581b5eb724fd120d2097dc3ebcdc6d73d6f94454d7547559129c3f01", + "publicKeyCompressed": "033deaddc1b1ae664c3b70c927812d1b2857745db2fa80074eb83b7bd01cb26a5a", + "msg": "68656c6c6f", + "sig": { + "r": "2cd8fded031c3fa851b9615519946e2e3c3af9dfbe98af6eb8411e325f2ba548", + "s": "00e782037f32548ff8a16c3e956ad3780cbe4be037b1572f2249f8efa121a4aae9", + "id": 0 + }, + "comment": "R: w=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 340, + "publicKeyUncompressed": "04cfdf79206b27678b6e53da7c361ac08193cf96ba540a0375e338092e325ae4ffc7623c21091774afa3d23c33f95269ce9b9538fa099625575093107bc5ee8bf3", + "publicKeyCompressed": "03cfdf79206b27678b6e53da7c361ac08193cf96ba540a0375e338092e325ae4ff", + "msg": "68656c6c6f", + "sig": { + "r": "0080f8aa5c3924d5408c1429fff22e12864c0ac7fc8485bb13c798d3a83aea3a86", + "s": "792a3914036e62433063f68d62a1f7ccb5c8af903fcc985bb2545f41f98ece20", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 341, + "publicKeyUncompressed": "0460e3cf62536185eec30aa4e66f53df71e7ff26f25814f60f318d49a0ace7027c1abe4e67d3b62d8aae093bb449fdebc6fe4dd30e902f2ee25f096c5e52c41900", + "publicKeyCompressed": "0260e3cf62536185eec30aa4e66f53df71e7ff26f25814f60f318d49a0ace7027c", + "msg": "68656c6c6f", + "sig": { + "r": "6d5f358f6583ffb7ae3d92b49e93db79c54d78f1171e3d4b7f8964db757d17fa", + "s": "70fa282ae140f5118acb1d1b3a6f13b9fbe1b93ddd675fcb4540b49a252ccdca", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 342, + "publicKeyUncompressed": "045801298199e23a20bb5b05d83e4ca95a20a81b803f4b15ab596f573e3aeb785b33fb3e6ae3ee87a16fc08da6d6f40d5975735c87018a3ce344a13591cf887104", + "publicKeyCompressed": "025801298199e23a20bb5b05d83e4ca95a20a81b803f4b15ab596f573e3aeb785b", + "msg": "68656c6c6f", + "sig": { + "r": "00998e160d64594d72239a198007febac886621250f1e46fb2b302991002c9dc85", + "s": "4e96a53bb7cd2d8a4adf2546d931f9a281d49636e841b4236dd60aa09a80de24", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 343, + "publicKeyUncompressed": "043b97befac3c7f1ee87038c0838ddcd1cebb01b79f8cdca9a4f231b1846cfaf9abd3b194bf31b68bcd3b3571f9422fdfff79dd1dec38553aa90599fb1f9dcc824", + "publicKeyCompressed": "023b97befac3c7f1ee87038c0838ddcd1cebb01b79f8cdca9a4f231b1846cfaf9a", + "msg": "68656c6c6f", + "sig": { + "r": "48ffde16773b462acfb2af7b2a62f2cebc093eaf8a69591ca4227d25259c5136", + "s": "5b7756e842e62368c57856c0f2c178e4ea211b08cd645055ebe8696f5c1d475b", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 344, + "publicKeyUncompressed": "0449ce2ec585225144df5deeded6b58be955f57e6448e7116f5ceeb004a9da80cdd882a235521839c7eaa76cec9a2591ff9ec2d24512acfc1351a9455f8fbbc7bd", + "publicKeyCompressed": "0349ce2ec585225144df5deeded6b58be955f57e6448e7116f5ceeb004a9da80cd", + "msg": "68656c6c6f", + "sig": { + "r": "50c12ca1174712690062544755cd56b3222bbd9ea375ffd3d36cd840d88cd6d7", + "s": "761ba651764404f4f20048424a097d3c99fee60df2f58bd8278a08e99437a8d2", + "id": 0 + }, + "comment": "R: b=-3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 345, + "publicKeyUncompressed": "04f5a28f9e5b6d43a3a5079c695e2b60a6e5a32764889d9d51897d0beb29386bbc1c69ca66e242e8667b58156dea008957ddd160db521c2bd898891f238b7dc60c", + "publicKeyCompressed": "02f5a28f9e5b6d43a3a5079c695e2b60a6e5a32764889d9d51897d0beb29386bbc", + "msg": "68656c6c6f", + "sig": { + "r": "00fa2ab59de0ace71417e1312bc305feb4dc9870554ff7e4d831efa81653ee372f", + "s": "405ace23972368e07e5d6248041e40119f1f2a9ce55acf48857f0ca3267b08ea", + "id": 0 + }, + "comment": "R: b=-3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 346, + "publicKeyUncompressed": "049d69ac9db3c163580c0a8c08d1d760ee93402bb7af3f86c3adf5c2cfa3b873cff9694dc045d97bf370fa3c10f9bde795cf84e93ea645e325582ba4d2777f2297", + "publicKeyCompressed": "039d69ac9db3c163580c0a8c08d1d760ee93402bb7af3f86c3adf5c2cfa3b873cf", + "msg": "68656c6c6f", + "sig": { + "r": "00efb7bafaea260e320e3bf1362e0740d2e5b05ddf0028cfcb6f3a7fde5b892711", + "s": "43a61a85edeb6b5a280746f52792445026dbc02c22b7d18c5038afa859663236", + "id": 0 + }, + "comment": "R: b=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 347, + "publicKeyUncompressed": "040943f511e29a59a39107445ff0451862e4444f441b7e126cf0a433598f6d55108fffbb4ebdb109b1a712268761650881f43940bc7d9f5e252386ae02e8f5c54c", + "publicKeyCompressed": "020943f511e29a59a39107445ff0451862e4444f441b7e126cf0a433598f6d5510", + "msg": "68656c6c6f", + "sig": { + "r": "5fc7a26931c3e9df34a77cc50d004f23bc2e0fc8919c1f68089c4b09684de9f4", + "s": "00ba0dc954701bc2b6c8f5f78684a3fc5076e05d1e532b379fbddcf27bd706a3b7", + "id": 0 + }, + "comment": "R: b=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 348, + "publicKeyUncompressed": "04b60b6d1bb7232b5518fb3c5ff293776c21ed2bf9972bf6b30d4b207a59ee70272a71d55520ad2b62a52bfccec2dadadb3bed914cf1759b73d27019e3259666a8", + "publicKeyCompressed": "02b60b6d1bb7232b5518fb3c5ff293776c21ed2bf9972bf6b30d4b207a59ee7027", + "msg": "68656c6c6f", + "sig": { + "r": "00fc927b3edb46e16592d765bd3ee5cf0432566717ab050d91b562dcb61d3f4c59", + "s": "0098b2c55524cbb33a4cccc6dab8035618a37350eb19e50811cd2a0d56f4d0b264", + "id": 0 + }, + "comment": "R: h=-3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 349, + "publicKeyUncompressed": "04d571b49b0a0560c94af8c949bd0bb8193bc53b876c6601d0828c991b9ad3a5e54cbd70f4fe29e04fbdbb93d4b058456f98a20c272f6fae24c3a2b3b52515adbd", + "publicKeyCompressed": "03d571b49b0a0560c94af8c949bd0bb8193bc53b876c6601d0828c991b9ad3a5e5", + "msg": "68656c6c6f", + "sig": { + "r": "079f55086844c6d028f5a64df87e41cfb835f339f50385a1e80633d51de8d41c", + "s": "7224394031a9863e901479040236f5c736bb0879565d95561d8a77aa0180156a", + "id": 0 + }, + "comment": "R: h=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 350, + "publicKeyUncompressed": "0457f2ad1a6e0a4114bd62fefda3bec2090046d24f77894ab263915bb7c11926567d8999b22cddab2eff0439c3eed2e904f3ce34e512f86f2a13c8ec0b1e598dd6", + "publicKeyCompressed": "0257f2ad1a6e0a4114bd62fefda3bec2090046d24f77894ab263915bb7c1192656", + "msg": "68656c6c6f", + "sig": { + "r": "00ca3b5f98617c55b0458f98e78422ccbc647b60efcf1fd41487f272c65c68ca27", + "s": "009dbbcfe22672ca9f7e6f33911ef276af68c71d0a4a7c88bfa7c6a75743745197", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 351, + "publicKeyUncompressed": "040a5360b12535f6b374e005a59ed6bc39edd00a372c6797b3bad77bf553bdd076d4307406d30a2c337b29c5fdcfa7fc433d6ad0de78c9dbd3a7135d3d1b910e06", + "publicKeyCompressed": "020a5360b12535f6b374e005a59ed6bc39edd00a372c6797b3bad77bf553bdd076", + "msg": "68656c6c6f", + "sig": { + "r": "3b564da6ade39539341c3431a2f723c2919deada8f7adae407860fba968db5c4", + "s": "00b49851662605da4987377bb9ea7158e731c93a3372a7e5a117a8bf3fc20d5a8a", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 352, + "publicKeyUncompressed": "04c5341353e4e8bfe5d5a43f88946ad41651847b93f389474a40faa7c381b891f060dc0951f214183a8d88637628b7920729f5afc5862476d5bd2b9d8345a176b9", + "publicKeyCompressed": "03c5341353e4e8bfe5d5a43f88946ad41651847b93f389474a40faa7c381b891f0", + "msg": "68656c6c6f", + "sig": { + "r": "00fa6e52c0f0a01516865432e6d8e60f8109e6b435a165510770877d7d0d097873", + "s": "0095179904de636dcb2d3699e034908f6eaa076719822e8fc84676a0d3ed23bfc0", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 353, + "publicKeyUncompressed": "0409406139c718f3102e50588775d619890e6420f6c1cf1d979f60e3d0c36ebeaa1bfaaa3b1c5367581b4a5567350250780684d416f79faea75f5ce4222bf752a7", + "publicKeyCompressed": "0309406139c718f3102e50588775d619890e6420f6c1cf1d979f60e3d0c36ebeaa", + "msg": "68656c6c6f", + "sig": { + "r": "00d7fc85fca243acca7d5a48419de09f7bbe56518ce57aff346faf4629dc7aafcd", + "s": "6e80f5747a35389111d815213b2c435c68085f3321132a7eee5b64ecba9f5709", + "id": 0 + }, + "comment": "R: s**2=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 354, + "publicKeyUncompressed": "04fd935a6473b8b0b024388f4098b7ad07a750531bd641a5ed679f4535764af232af126c6b516eda5c4c1401b31cfca073893957d1980bc26d7c5a625ef9ea82f8", + "publicKeyCompressed": "02fd935a6473b8b0b024388f4098b7ad07a750531bd641a5ed679f4535764af232", + "msg": "68656c6c6f", + "sig": { + "r": "009c923bf090cf99af3b6b1fad6215097fa711c7a5b006f4a4879d223acde2302c", + "s": "68df3a2d1ce2bc64dd1c284c63045ea5647ea79b661fb05cb59ce5f12b3e553f", + "id": 0 + }, + "comment": "R: s**2=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 355, + "publicKeyUncompressed": "045a254761877ce052a23defa39dba2126effb4ef21057889df01e23f5a5d2aff0705cf05f7fa893ee73950a602936db4777190a87471b01a4e06bdad756e01300", + "publicKeyCompressed": "025a254761877ce052a23defa39dba2126effb4ef21057889df01e23f5a5d2aff0", + "msg": "68656c6c6f", + "sig": { + "r": "008b713e12ccecb986473a9811000a57049a97e6cd6a7e0c2708b3979955a31865", + "s": "100b8aab93c41dbe43e90bbd9fc3bd04bd61daa208d78311a21b5e003c917e58", + "id": 0 + }, + "comment": "R: s**2=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 356, + "publicKeyUncompressed": "04b55df2a5472586eb386a4a33034b9851f58dcb852031e8f1c92e62a2da08364b5b06fe1b64ba9c983bf801d6bf2bfd7e1ec25cec13d396bea7c847b77844c7e0", + "publicKeyCompressed": "02b55df2a5472586eb386a4a33034b9851f58dcb852031e8f1c92e62a2da08364b", + "msg": "68656c6c6f", + "sig": { + "r": "721e26b036e3d93466af8261d5be42c22c6ffe53fcd81421aa9c9aab94adc1d0", + "s": "00feb937119fe21348314d87ea4dfbc76a876ea521f235873d3dc06aeac5be8bc0", + "id": 0 + }, + "comment": "R: x3=3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 357, + "publicKeyUncompressed": "043818b6eca3e096cd83095e3dc6d615fbde123c7954f9fef750d335c7632e6de25176a883c402201ff885aad7ba91252d4db9808c6cf0abe01e353a3babf49aeb", + "publicKeyCompressed": "033818b6eca3e096cd83095e3dc6d615fbde123c7954f9fef750d335c7632e6de2", + "msg": "68656c6c6f", + "sig": { + "r": "670a7f78b37bddda2fbc2f4c2b0ada5086c01c165756f938a1404930b8191429", + "s": "2e7e5a4684151cb851bc246a7406dddbe1b020374a5ab750808c03a1e1f04f94", + "id": 0 + }, + "comment": "R: x3=3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 358, + "publicKeyUncompressed": "04a662cda65d04935d49692c336a3814b0a716e613c1ed1f971e06476e0bf30aef501ef9e02665938a367f083c8757770670902403d8abbab946f49a713b4991a0", + "publicKeyCompressed": "02a662cda65d04935d49692c336a3814b0a716e613c1ed1f971e06476e0bf30aef", + "msg": "68656c6c6f", + "sig": { + "r": "00a072fd4cb6f2968ca031ff41a2684e7c85f8931bee2a91933e74ef261f42fbf2", + "s": "299ab53a09b356796f18bfeff085e57871888c931d269e3ceafe7c04c0ededbc", + "id": 0 + }, + "comment": "R: u1=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 359, + "publicKeyUncompressed": "04eb7b756f5bfce8c64066da9c2a89709266efd6da0750d71cadf5a92972f0e129e0814a4c6c763a237c8584037fa698a26bb6902d522f4522527fd5154d3eeff5", + "publicKeyCompressed": "03eb7b756f5bfce8c64066da9c2a89709266efd6da0750d71cadf5a92972f0e129", + "msg": "68656c6c6f", + "sig": { + "r": "2593cb11ee4201c6d35c584fbaf1af07726c0738329509ccc30104c1dce3e572", + "s": "0086d74f13f2d8abe0aa6fd74c6a6ad07251363b984916fe3031ac03dc367bab40", + "id": 0 + }, + "comment": "R: u1=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 360, + "publicKeyUncompressed": "04b5a8636b98446e9dee1c6cf2cbd059707b2d92ac1d7de2b5bb7f1a558ed28e400d57251fafd48704170d3e61dd6ec617e809f60e1833bc301d45e978950f966b", + "publicKeyCompressed": "03b5a8636b98446e9dee1c6cf2cbd059707b2d92ac1d7de2b5bb7f1a558ed28e40", + "msg": "68656c6c6f", + "sig": { + "r": "39f937a15acb67ac8c71a86ea2a6027c079b65abdf40649ffe8a0c1703d91acb", + "s": "00c43d90cafaa4c45df05e0c69ad9480a3427f40af28d8f410de0c11d0299d1bc2", + "id": 0 + }, + "comment": "R: u1=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 361, + "publicKeyUncompressed": "0481c2414c12b47863656c6afa98b7a09c0b5e30d813e25801247866f7900309af1a849d5ed5f8237adea32519347703ca30be63e6be777b64f445b653034a6e32", + "publicKeyCompressed": "0281c2414c12b47863656c6afa98b7a09c0b5e30d813e25801247866f7900309af", + "msg": "68656c6c6f", + "sig": { + "r": "4fd4444b3fe68887b54e541aaa0952b7dd79d4b37380085583ee4f0d21e3372f", + "s": "00800c39b3e356c66abee9777301ab19fa14e33a54e5562021d26cdf79904e093e", + "id": 0 + }, + "comment": "R: v**2=-3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 362, + "publicKeyUncompressed": "0478a30410df361dc0589c56eddc6dbccc65aa13868ed3e6ebc9ffe737d79ffa27ab4fe9616370657ef9a9b66c91701e925b3d1f496e28714c550e6b209ac22335", + "publicKeyCompressed": "0378a30410df361dc0589c56eddc6dbccc65aa13868ed3e6ebc9ffe737d79ffa27", + "msg": "68656c6c6f", + "sig": { + "r": "03c90857c5e116eaad3933995ca8388c2e6cb176e034291d9afa910d5133692d", + "s": "04b6b1b78a950e9c4676b2f6e06ae1bad08f14c164a894feec13b285dd35a83d", + "id": 0 + }, + "comment": "R: v**2=-3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 363, + "publicKeyUncompressed": "04e43e6464f58445051ad7ab01478f5e83096bd20db87514617453385c9e9749177c14d3f60c6d47bb5d03307e41672d602ea28152be7a285155725ea95f87b0c6", + "publicKeyCompressed": "02e43e6464f58445051ad7ab01478f5e83096bd20db87514617453385c9e974917", + "msg": "68656c6c6f", + "sig": { + "r": "009a32789cce6ea4fc1550b13bd41c4cc26425e7198e95c8a164a6e9d1bd9d9bc8", + "s": "00e12efc8768624650bd222d3b8da99b3bcbb9badcc65ccfd31ec9e31d2755a74d", + "id": 0 + }, + "comment": "R: y2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 364, + "publicKeyUncompressed": "04d787933d747ee33b2bedca2a2a80ef3177849015e3cb17a328bd95cb26bd35972b1ffed5094c5d412860b73e0fbaf67b0624f41d881776f83c19ecf8c75a0a32", + "publicKeyCompressed": "02d787933d747ee33b2bedca2a2a80ef3177849015e3cb17a328bd95cb26bd3597", + "msg": "68656c6c6f", + "sig": { + "r": "7e2bcd47d28c6fb2fae14a0a337808cc1b7017d855b376b76dea0428643bab65", + "s": "00ff82bf4304a335a8f2b64931cc475515173d0f193002b6214cb42e04e4e7dbb9", + "id": 0 + }, + "comment": "R: y2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 365, + "publicKeyUncompressed": "04375895f32fab1982ea5400b36111e5db192d129b42f153c57ea63d1a907f9e973e72a72cb974da74c3c3f9c4fb58ab624bc95d29d6962c84c3bc6423a7b4705d", + "publicKeyCompressed": "03375895f32fab1982ea5400b36111e5db192d129b42f153c57ea63d1a907f9e97", + "msg": "68656c6c6f", + "sig": { + "r": "00e7a1ba1b5f04eb50efce04b9f86baa71806a010e1bb6c0a72d6f1203de26b131", + "s": "18f5313bcb3fe388f559fa539b63d0acda2abc32e7739845ab1b21c53977bfdd", + "id": 0 + }, + "comment": "R: y2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 366, + "publicKeyUncompressed": "045e5b9aac53177a0417a69cec27fe4ac6e280f0a2a97b8763547cb3ba5cbaf6cc1566dc9394a73ff7a1185cc99fbc3a5c6e1162928629a66dad5006ac58e80f4f", + "publicKeyCompressed": "035e5b9aac53177a0417a69cec27fe4ac6e280f0a2a97b8763547cb3ba5cbaf6cc", + "msg": "68656c6c6f", + "sig": { + "r": "00a0407e2bac9a2216a6a6191cda91ccad48488ca65f795554864d929abe6f36cd", + "s": "00de9fdb1963907d72bd3d9481facd37881a4c3044d50e22f851a84bf06bf1eda8", + "id": 0 + }, + "comment": "R: y2=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 367, + "publicKeyUncompressed": "04798a0684f6b341138225755e1eb014d6b6406e307aed982afd53f730e52990d3d37ee088ed312e31f5d32c59952361cfc26da7eb87ec4f197c3116c0f9ccb56f", + "publicKeyCompressed": "03798a0684f6b341138225755e1eb014d6b6406e307aed982afd53f730e52990d3", + "msg": "68656c6c6f", + "sig": { + "r": "00f34cfbabf24531eaae5c0d025d0d7eeba6b838e34829b17ef472cc7c5e5f65ca", + "s": "5183df5ca1025d1fa36d14d1aba05c13ba59cbba9a334f71931ce27354b8f0d1", + "id": 0 + }, + "comment": "R: y2=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 368, + "publicKeyUncompressed": "046ca55af21823df3048232af324b6ae80f708bc5b7b95b4722f6ff6a987878dafe1b5a0aee399700e44f4cfcb729397bedfb35e3ad18434331be84a93349a5f1e", + "publicKeyCompressed": "026ca55af21823df3048232af324b6ae80f708bc5b7b95b4722f6ff6a987878daf", + "msg": "68656c6c6f", + "sig": { + "r": "6c7286286120abfeaafdd9e0c860b46710ff3a76585cf92c853fa0e6e3315bc7", + "s": "00c983329033b284f04487c76d4ee72d61e87b8a296e91abd031d40483850a646a", + "id": 0 + }, + "comment": "R: y2=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 369, + "publicKeyUncompressed": "042dc7e5acd964dc5e794a36364c0e770937f88f1e4550de659f5f2cbd09ad5969b58abb6efe7489f09a13c7bab155477a92b6b1b2d5172cef6304ef0d35ba0530", + "publicKeyCompressed": "022dc7e5acd964dc5e794a36364c0e770937f88f1e4550de659f5f2cbd09ad5969", + "msg": "68656c6c6f", + "sig": { + "r": "00ea7c672f008d17448d3926688a2dedfb6306f6589090e2b51022f5d380b3960f", + "s": "008ec8a3468d09b3e4585667c69fd2d6238ec7cf5d1a0cdf51355fb78e9cb95229", + "id": 0 + }, + "comment": "R: y2=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 370, + "publicKeyUncompressed": "04e03325ac72c9befe693c981c46246f68a32200ff680528ce47e4342235c8848c8e8c0ec29c23965b6eb977cb415836df973de0cd8334cab86507e08a3c0c9f5b", + "publicKeyCompressed": "03e03325ac72c9befe693c981c46246f68a32200ff680528ce47e4342235c8848c", + "msg": "68656c6c6f", + "sig": { + "r": "009eaf88dd46d1a13159eb0ac581971c9c1a2670db5b12a7d515aec2a38bcf78b7", + "s": "79e09a8fef0eaea174d8905430ac7967878c22f92ecf5e67cb56960d9049c34e", + "id": 0 + }, + "comment": "R: y2=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 371, + "publicKeyUncompressed": "04ce885ec148536dc881255255eef0d8aeb88be98c1344f5e7bc88e4ffba177c3ffc1d3663f99aa5e2cdc7ca53cc5622d0c4cb40d4e26084870c8e7f6346bd191c", + "publicKeyCompressed": "02ce885ec148536dc881255255eef0d8aeb88be98c1344f5e7bc88e4ffba177c3f", + "msg": "68656c6c6f", + "sig": { + "r": "76d40ff3b8a1478a18dbced1f43af56882d298cc145c7575da2e4786f37ce998", + "s": "00f0fdaf2fbc2cfcfcd80378a624d57172a6cd93d294f6e08115e2e54b18b22d6c", + "id": 0 + }, + "comment": "R: y2=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 372, + "publicKeyUncompressed": "048c132cc936f33f479aae135ee322aff938f07c3f15a05b4ad1d96ec1206e0ae0f030b26ed85b1b00098ab9fa26f18bd41cdc36b387a4e392731dfa8101d98ad2", + "publicKeyCompressed": "028c132cc936f33f479aae135ee322aff938f07c3f15a05b4ad1d96ec1206e0ae0", + "msg": "68656c6c6f", + "sig": { + "r": "52b47af77cbe0358c26382cb5e7c6751d022df1a781d16bb0a7a1ac755ec16aa", + "s": "00e5d3a4b4b58d612743cbddcf5d8bfb7cc59ebc92e102021895f23e1dd7d2d9bb", + "id": 0 + }, + "comment": "R: w=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 373, + "publicKeyUncompressed": "044d227f6db18e5021584ec10ecffd5590d7d07b97fe84e5910a852692ca34b97a2d95743cce545927fc87a5334f0e909e8420ae023cfcbcc463b98694fce52b34", + "publicKeyCompressed": "024d227f6db18e5021584ec10ecffd5590d7d07b97fe84e5910a852692ca34b97a", + "msg": "68656c6c6f", + "sig": { + "r": "5c941ae565517a61b48805595d2bd351b1a8be7eadc160788b698e542147aff7", + "s": "00c89cd5ac3815ec83f71c1dedbaf5cc6f7bb55ba2eaea4acbb06b545282ea7774", + "id": 0 + }, + "comment": "R: w=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 374, + "publicKeyUncompressed": "04c5578aa60777a48813d396b9ba2d297bc7f3305859e1ac2156ca1c445e564ce678cf36976af321fd3329ee5f6abefadaac76d37017cb06cd4617344ba3209c76", + "publicKeyCompressed": "02c5578aa60777a48813d396b9ba2d297bc7f3305859e1ac2156ca1c445e564ce6", + "msg": "68656c6c6f", + "sig": { + "r": "7810608dfaf1100cdcc2b3e3c3ab5ff554c50739f264bb22cbf78c015e853461", + "s": "149df6aa86d8b1703bfeda337e3d89ed03fcfd2c0a2816779d7ab332a61e3759", + "id": 0 + }, + "comment": "R: w=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 375, + "publicKeyUncompressed": "04864ed664ab48dca218743a5ab0a999cdf97ba050d285c3e135287153a132c0bd6f2870cf5a7cc056b42e641b954f3646864b6d82ca3695feedf22feff73fe097", + "publicKeyCompressed": "03864ed664ab48dca218743a5ab0a999cdf97ba050d285c3e135287153a132c0bd", + "msg": "68656c6c6f", + "sig": { + "r": "6f2c48b03420102d51f6dd5702fd9b9416effbc17ab5c0befe973c9e8fc66c79", + "s": "00a9786b77538acf446d5845982fead0485085fdadd6789960aa715652bde09abd", + "id": 0 + }, + "comment": "R: b=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 376, + "publicKeyUncompressed": "0484f060de90a4378bea46f7691ad0dabd847d845b48d5aae3094a147fa627c50872029ae1585af3c2d59c64ed37eac76b11606cd65ed3d4496e152fd579ce426b", + "publicKeyCompressed": "0384f060de90a4378bea46f7691ad0dabd847d845b48d5aae3094a147fa627c508", + "msg": "68656c6c6f", + "sig": { + "r": "35bd5043357f08e3e34b18688ae2621dae2fef42dc67ff34f99b5c156135c59d", + "s": "00ba1270f04a87cc5b634c15ad8e65aa94943510c2a2b020956acc2bced2a3c1c0", + "id": 0 + }, + "comment": "R: b=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 377, + "publicKeyUncompressed": "043a9f85944621584bef9325f53ba5faab0d476b13c5be573f67c26ba484d8d33476cd9b6170fe1b9406d041db071be8e45af22ce29e3f5d0f3c4a2e78722c6270", + "publicKeyCompressed": "023a9f85944621584bef9325f53ba5faab0d476b13c5be573f67c26ba484d8d334", + "msg": "68656c6c6f", + "sig": { + "r": "00e7343558f3451544cdf9cddf7e42481da3907de586d9199f6bdf650131f20596", + "s": "008108bd6a5f6150bdc554ad6c6c0079b36beca4b0838e511f0d9d37437c1bedca", + "id": 0 + }, + "comment": "R: b=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 378, + "publicKeyUncompressed": "0414e65cd1a9c2152dc0f23f8a496ae3f79a16805da4afbdf37e469d2705f5bf6edce3aebef9a5bf1b77d025853b617737a570e731559cf6346e8210efb10d9c80", + "publicKeyCompressed": "0214e65cd1a9c2152dc0f23f8a496ae3f79a16805da4afbdf37e469d2705f5bf6e", + "msg": "68656c6c6f", + "sig": { + "r": "7ecc4c5bf89043cad1bc59dbd11b28b05d7f3e7950703b9b79350116a2500b70", + "s": "297789d0d68c5564fb5cbea9beb31c3945afeb7ecc642c4f1a2955d3ca9df7be", + "id": 0 + }, + "comment": "R: h=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 379, + "publicKeyUncompressed": "049d937f43b5cb357c0bd997b0dbb8d2396f71f983700ead80eb49b798e3dbdfb67309f1ded53b44752a65990800d8245d71d0726c2b30c9bf0a354ffd43bb64a6", + "publicKeyCompressed": "029d937f43b5cb357c0bd997b0dbb8d2396f71f983700ead80eb49b798e3dbdfb6", + "msg": "68656c6c6f", + "sig": { + "r": "00f156aadf85ab9bd15b2e015c01dfaccb83df42514e91511aced3d0b77245007f", + "s": "0600ccc97a728723141103fdc094f0c316f8cc58942c746dffb6942d16c03824", + "id": 0 + }, + "comment": "R: h=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 380, + "publicKeyUncompressed": "041aa458cdb9a9d527ef65b976d3873d974e86664f5d956d09a9ea26482a9354fbfa95174252e3c3976e519b1b4e455322481bf33c59606d15beb8dd1ef54eb472", + "publicKeyCompressed": "021aa458cdb9a9d527ef65b976d3873d974e86664f5d956d09a9ea26482a9354fb", + "msg": "68656c6c6f", + "sig": { + "r": "00e2fa649f609e816e4d1d15800667c89bbdab05a9895e1f50c1d7f29dfbacf74b", + "s": "12305a66142b1381a95eab255a42bee8fed00c72b51b2571bbdb97b858a83b59", + "id": 0 + }, + "comment": "R: h=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 381, + "publicKeyUncompressed": "040d0a4731187fd0a2f5b497c3a5022b1adc7d93f702cd50b1a4a1fb9a515a71d0b276ce22a8a1e9931d4b804c845b0e2cc78edf1580305979726cd477d8a9e3cd", + "publicKeyCompressed": "030d0a4731187fd0a2f5b497c3a5022b1adc7d93f702cd50b1a4a1fb9a515a71d0", + "msg": "68656c6c6f", + "sig": { + "r": "00da660577820909a1ab4fa0efdffa93a917f1211b242e62c8853acaf751343898", + "s": "00b78c45c4ceed90724dea068a6fe3544bc692320bbe543ec20d9a45e6c9f9ff14", + "id": 0 + }, + "comment": "R: s**2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 382, + "publicKeyUncompressed": "043572997afc42797d4f32c798aa2dae84e60c5617091c64ba03b92f8d1a4b0951f6a3fee8c015faa6378c6f69f7f7e29e2395c6d0a8f3ae27fa9ab99581399b9f", + "publicKeyCompressed": "033572997afc42797d4f32c798aa2dae84e60c5617091c64ba03b92f8d1a4b0951", + "msg": "68656c6c6f", + "sig": { + "r": "1d9317b6bd2f64972845f38aa4956bafcd9822d6a0c8b701a0f303bdf1589da5", + "s": "24afbc667a4ddb7e00afd26fe70452b1ed3778545266d463b4f5afc861cbb752", + "id": 0 + }, + "comment": "R: s**2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 383, + "publicKeyUncompressed": "04618be274e83e6b0f9354ecaa337f746f5a1b1a0c9235201deebeadfdf3f9b90a0e8ca6bf5a88198d54a789d5b0404586fdf162a211318270c3fd0c436671fa54", + "publicKeyCompressed": "02618be274e83e6b0f9354ecaa337f746f5a1b1a0c9235201deebeadfdf3f9b90a", + "msg": "68656c6c6f", + "sig": { + "r": "0806e2d1c0c791c72c6a6b857b7000a71a76bc0e3b08e635d9d23149bd7325f2", + "s": "00a0977457d2e743d103ff5f6623c2b980881e8727b5d2cc1528a5d30adf300bac", + "id": 0 + }, + "comment": "R: s**2=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 384, + "publicKeyUncompressed": "04f2ae2b2dea450a08ec6960592bf1244981b34158705a73bdb1c680f27ef2a12e3ddf31bfa2579319dcd1870fc6c311c83647ee0cb678370e9061362013b50139", + "publicKeyCompressed": "03f2ae2b2dea450a08ec6960592bf1244981b34158705a73bdb1c680f27ef2a12e", + "msg": "68656c6c6f", + "sig": { + "r": "00c63c2c8070e8b2a4671c77a9f218fa4d0f688cc52a2c7cbf4bf79d775e476779", + "s": "00f4e2c16d9b0cfce06468ce64a9b207ed24bccf97d1a3755a93bd252c24e790f5", + "id": 0 + }, + "comment": "R: x3=-2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 385, + "publicKeyUncompressed": "046f8b05c5c3d4258bdfe01a312c08e7bd70fc34d79bfc29552d774186fb2fa21902cc9c89d7f89f9f7fc028b40340888a2163eef6b908f83051f31312f7711db9", + "publicKeyCompressed": "036f8b05c5c3d4258bdfe01a312c08e7bd70fc34d79bfc29552d774186fb2fa219", + "msg": "68656c6c6f", + "sig": { + "r": "008578451dfbe898a0d895c43895bf305efd97470532135a48f13b226b4376a850", + "s": "4b78011ab0d06ea5e8714e993c05d99ed0a5b061628976c01dce6c3b67eb55b0", + "id": 0 + }, + "comment": "R: x3=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 386, + "publicKeyUncompressed": "04d9ba0029075beeddab2d8daa12ee87b6304cfd8562fa7436f47e0272f67bd09077f175bb3c8ab18c84285262708bd1c71897507f51d5449b3c7c89983bac00cc", + "publicKeyCompressed": "02d9ba0029075beeddab2d8daa12ee87b6304cfd8562fa7436f47e0272f67bd090", + "msg": "68656c6c6f", + "sig": { + "r": "0084888416ad6c664babb691af6370f05a86fbfcdac9db699022618bd02609813d", + "s": "55e9ed7d9ca3e8000d222ab3e1b1569998266b1196c8ad427e597f6244262441", + "id": 0 + }, + "comment": "R: x3=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 387, + "publicKeyUncompressed": "04f4b38096eef06d10c1b094e788d2228ec481bf61563d53e0264494d4216e87ac2b001f0fe68506c7437a9cd5cbe2aae8c1bee21e13624914151b8898b69883cb", + "publicKeyCompressed": "03f4b38096eef06d10c1b094e788d2228ec481bf61563d53e0264494d4216e87ac", + "msg": "68656c6c6f", + "sig": { + "r": "581c24b2d98ffcd6b32b403cf450bdecab690bf647fc59b728054a850d7d97b9", + "s": "00d1ee99e6668d01359170b0a482bbd3b7ac7fee42c30f80d25187edb16882da61", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 388, + "publicKeyUncompressed": "046ff225eec658188360226217b07237e22c382b4578f99113d3ab162a2ff767ffd93ec6a98d1816f577be34be76d67352e988e8dd0ec0a458eeec3a8c94dd4392", + "publicKeyCompressed": "026ff225eec658188360226217b07237e22c382b4578f99113d3ab162a2ff767ff", + "msg": "68656c6c6f", + "sig": { + "r": "6fae1a2420945dfbde8ed9e512ff5275e294d9e228e5e3be3d6b66d33f931347", + "s": "00e4d74fb33766c4ce3a10f37e6d1fff9ebd3a13ceffa23dca3b6ed68c6a48d2ba", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 389, + "publicKeyUncompressed": "040015fea316c2ce7c2f6183bd53d8d258e31e2e88ab1b92fbd23f5d6feac8e5cc248f8c88817767394026eeba604d2a3950f7bed40dabf10f108c75e1a6c62100", + "publicKeyCompressed": "020015fea316c2ce7c2f6183bd53d8d258e31e2e88ab1b92fbd23f5d6feac8e5cc", + "msg": "68656c6c6f", + "sig": { + "r": "6035d7474987b752bb3cbbf6577a2a4a2d186e5e23b227b583fcf8637e1905bb", + "s": "00a95bd9b0363e5810b86f557bcbd2b7e6443b2306f1adda26c26a19b732172fd5", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 390, + "publicKeyUncompressed": "0478f75c53bb4a46868f7943b9742887414a2799257d461f73a867ba88c9f96a791f6316e14bd67ddf1cb0729c92f860e2d3d2ac7acd7d7b74d74e3a00f36e374a", + "publicKeyCompressed": "0278f75c53bb4a46868f7943b9742887414a2799257d461f73a867ba88c9f96a79", + "msg": "68656c6c6f", + "sig": { + "r": "00bd18c5aced6589c6cb3317efca9412d29e15f6545d3b32144fe0d19e9d34dc27", + "s": "7d286ba54903e978c86f6d1cdd53f665d154dcf79219972c58fd5083c7bc7e6b", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 391, + "publicKeyUncompressed": "047b499d695ee669beb965139116d0791cc8a9809f29df3053cb06b1b822b6e13158081122232adc4dcd4f3a254d8eac24ea22f2ac1dc678a5af3605796863d3f5", + "publicKeyCompressed": "037b499d695ee669beb965139116d0791cc8a9809f29df3053cb06b1b822b6e131", + "msg": "68656c6c6f", + "sig": { + "r": "3835c12905dba52d6e45e5ddf8afef9d72021a278f1dc28a9a8f4ea6b2ef512f", + "s": "7a808105019fa513ceedf686ad7fdb7f3afa6a1adef183ab1082b4fc85e88b11", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 392, + "publicKeyUncompressed": "04bd363ea988b1a5b5c700c969e63d9c1123455ea98b40cefacceb09a058cd2d84e5b0fe6ab30f1abee2b25e477f36d07951f3411e59e4188e3a4ea1abfb45bc8c", + "publicKeyCompressed": "02bd363ea988b1a5b5c700c969e63d9c1123455ea98b40cefacceb09a058cd2d84", + "msg": "68656c6c6f", + "sig": { + "r": "00e2b1630bc912bee679902c19ddf1c2e334d19b4d7f12a6362c2235fbe4b2167c", + "s": "3c088fe7bfe494a5b40072ba9190af6303cc41a6b1a53288e0146c9346f1fe55", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 393, + "publicKeyUncompressed": "0487ba3c85865d8fdf0767ba900b6ada7ee962de9237e4c216ce6271c07c4fe55ebb6ea457b5c4918f03c12117a5260a0117461787b6510ea193a96f95974f1907", + "publicKeyCompressed": "0387ba3c85865d8fdf0767ba900b6ada7ee962de9237e4c216ce6271c07c4fe55e", + "msg": "68656c6c6f", + "sig": { + "r": "29a269f4406bb2efbca27cffce85aa9d428ae9f6419452cc8cca558d55be2b26", + "s": "50aa2153c371074f9b640103fdf59f868a7297fa60615dc007b5cb70abf7df4d", + "id": 0 + }, + "comment": "R: u=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 394, + "publicKeyUncompressed": "040af3ea4cb0b3fe78f45f12413b7f9096c6b144799126d399ad178438fa3d08be3d654c7cfa8eed82ee93e3d3e29b611d3cc0c27ca56627e5d16843fd342e3873", + "publicKeyCompressed": "030af3ea4cb0b3fe78f45f12413b7f9096c6b144799126d399ad178438fa3d08be", + "msg": "68656c6c6f", + "sig": { + "r": "30b802ce54737fe34c2740b89ddf6384bfbc1a29adfc813097f46577b1869f2a", + "s": "00f9706c39888be82b13082b8bdee9a4594d39becdc2f859952bf646701daeb8e2", + "id": 0 + }, + "comment": "R: u=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 395, + "publicKeyUncompressed": "04d1ea1439e4bde2bfc0874d9e54259d590bb10178ab6c6772887bed9657289c734cf3ccccb59ac4d6c3ce98ed9583410d221fff6a8695b3372928881119fe72aa", + "publicKeyCompressed": "02d1ea1439e4bde2bfc0874d9e54259d590bb10178ab6c6772887bed9657289c73", + "msg": "68656c6c6f", + "sig": { + "r": "00a5a5933d6b20cd2cf7364247939af1ddfdb8fbe0106f2c02db4144f9f8bb31df", + "s": "00e72bdd1153967b9cec036e19c07c6af5cd0815647e498af269cd67598f0d9ffd", + "id": 0 + }, + "comment": "R: u=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 396, + "publicKeyUncompressed": "04a78754ba0917839ceb08bc5a6024de2b0ea2474e327e578324bdef7070422e523d98ed68f65cadbf9a2f5c30f106b8c85196aa74f1a2723b585de2f79c3fb697", + "publicKeyCompressed": "03a78754ba0917839ceb08bc5a6024de2b0ea2474e327e578324bdef7070422e52", + "msg": "68656c6c6f", + "sig": { + "r": "310728252e58de9013f52a9291dbbfe645d6e79703887cd99d72261bd620df7c", + "s": "00d607cad5d9af4c3faadfea1f6c32e55999814665fa1db4c26c1c62c3dbb6bb7c", + "id": 0 + }, + "comment": "R: v**2=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 397, + "publicKeyUncompressed": "047a36ae848fe6e59dc1b3d06500e6214d578f5e977c763dd79f044a4e02d8a6fa60e59d9fd29b44730d193a582006a8f2d932b0656591a2ffba71febd84b839d7", + "publicKeyCompressed": "037a36ae848fe6e59dc1b3d06500e6214d578f5e977c763dd79f044a4e02d8a6fa", + "msg": "68656c6c6f", + "sig": { + "r": "249ce6da270f17d618dadc5e0a335d88dfb6438a66ea9fa5f1967f29697a5161", + "s": "1f91b9d7d569530aeaee2d1c05818b8406f11b797084037aefafff006b896738", + "id": 0 + }, + "comment": "R: v**2=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 398, + "publicKeyUncompressed": "04005827526b5ce4c4e537c8010ff26cb8e47a1cc0120ac73ed080043e7852d79cb3d0c469501838e1340d305ebc24e1781b6d58d19fa2639f3cff07874178acdd", + "publicKeyCompressed": "03005827526b5ce4c4e537c8010ff26cb8e47a1cc0120ac73ed080043e7852d79c", + "msg": "68656c6c6f", + "sig": { + "r": "00ffbc1a8150c65c61cee4bb9002226810fef7a91f0c5d573f52858e8ed8d7a68b", + "s": "43d7ddde2ef54bbc009b5093020a3630e272b7a75f24f67cca7c5fddf0130fa5", + "id": 0 + }, + "comment": "R: v**2=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 399, + "publicKeyUncompressed": "04bc2133e027c17607ac0d0e95b42b236c9b8b17478f0687a5cbd72882d62e40085c1b2173c1f0e82cfa9a8bfa89d1657a79318817938de5d57b6d030d1e77383a", + "publicKeyCompressed": "02bc2133e027c17607ac0d0e95b42b236c9b8b17478f0687a5cbd72882d62e4008", + "msg": "68656c6c6f", + "sig": { + "r": "00fdc4ee73929db589196c036a8020a1d734a8ecb66e8fa4231b6247bf94e37242", + "s": "00ecadd88040e2b0cb7b01cb051115639689036009969555fe582a02ff8d79aa48", + "id": 0 + }, + "comment": "R: v**2=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 400, + "publicKeyUncompressed": "0488f9e79668944bd652faa029be9b7d135c3aa4129d82faf89fb64685eed3129094af637e13e5186e1dbdc9f4b45b60f8f53c442d60ecfbfb7107b3ac5620c30d", + "publicKeyCompressed": "0388f9e79668944bd652faa029be9b7d135c3aa4129d82faf89fb64685eed31290", + "msg": "68656c6c6f", + "sig": { + "r": "00808de6e779b93dbb1e9804d0e64e9e4d56fc53de30693825b865a5c8b20ab950", + "s": "5af5197fdf0a539034e1ba3f43b631528e85afae4e64a68c82abe68ffca165af", + "id": 0 + }, + "comment": "R: v**2=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 401, + "publicKeyUncompressed": "048433942ca409eb9e18241c5cf1c29b98d896be8b89e7dbabe7d5618617519b6891a4872ad42223925bfaed7a56480b484b5712d67a3bf5bcd5ee00e92ca7a0de", + "publicKeyCompressed": "028433942ca409eb9e18241c5cf1c29b98d896be8b89e7dbabe7d5618617519b68", + "msg": "68656c6c6f", + "sig": { + "r": "78160f6074fbb4ae2932832f2aa56c5519ea101725e22cc990ee2c0cca399431", + "s": "42165538dce08ea860666e0b3c1cd16e18cd91b99af898c09dd73a48670393a1", + "id": 0 + }, + "comment": "R: v**2=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 402, + "publicKeyUncompressed": "04e7911858552a4981dd559c07e11d2e4c4ecd279f6298764fff2115392ca6ab8ba711c749b74c487e76553fff0dc3a01776da3218e82c02c5417129194ffd10b0", + "publicKeyCompressed": "02e7911858552a4981dd559c07e11d2e4c4ecd279f6298764fff2115392ca6ab8b", + "msg": "68656c6c6f", + "sig": { + "r": "0089511707dbcf67779e7ad96e35e0cece74b276056dadb8e5dae784abf692b16b", + "s": "588dc1a4925a14194dea54a5ae48f23f516ee9e2120fc1b9d79b11552fcdd434", + "id": 0 + }, + "comment": "R: y2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 403, + "publicKeyUncompressed": "04c3260715c68e73c147e670868f9a9d20eed06639ea6e2cc530b39d6cf8cb0f8b8107d8ed7e0e900e82dd21bd1c349427a2bc90f941eb682d8d5327023ea7839f", + "publicKeyCompressed": "03c3260715c68e73c147e670868f9a9d20eed06639ea6e2cc530b39d6cf8cb0f8b", + "msg": "68656c6c6f", + "sig": { + "r": "05ac5bbb2cb53119f81f5b26014e862ddb31a7d8d8d8263440109ac833472e37", + "s": "57676d8eeb28a3637d5b553eaca7d73339cbc0ea454cfc5ad795c49bff752c9f", + "id": 0 + }, + "comment": "R: y2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 404, + "publicKeyUncompressed": "0456c10c146e6fda4f60d067ce98b4c162e02e317ac9a7b6040b3ef69c156583e2dedfdd988b5059266d6c19e466b65f1aba4c85f729c040cc119ff6ac440ac8b6", + "publicKeyCompressed": "0256c10c146e6fda4f60d067ce98b4c162e02e317ac9a7b6040b3ef69c156583e2", + "msg": "68656c6c6f", + "sig": { + "r": "71028d3cf77b676e6965cb6bc8d0ab03b01be221b97a20e5e507e08ad6261c8d", + "s": "00bdae12651b4f9d08463ce7c0f657facb012a5b0db633031d2badd2b20034ec84", + "id": 0 + }, + "comment": "R: y2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 405, + "publicKeyUncompressed": "04f3af8eb32ed2e51c3c0184bcd8dda938e52fa4f64b6ce135d3bd836e68cc3e43169f9dda3a68e51dcb5c5cfd21eeddd4ee2ccafe1076beca9e79626941ec76ff", + "publicKeyCompressed": "03f3af8eb32ed2e51c3c0184bcd8dda938e52fa4f64b6ce135d3bd836e68cc3e43", + "msg": "68656c6c6f", + "sig": { + "r": "22d7a30ef0976f0b5f74cd13ad2ae1f9b665a8ac8ae155b7e04f6ee375da4932", + "s": "00cd83b6aa8193a0ed8b3a609b1bbc574764840499bacc0c6bdafea126c77e18fa", + "id": 0 + }, + "comment": "R: w=-2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 406, + "publicKeyUncompressed": "04b34fc9a91fc9b943058202cc92f897e8f72ba37c898c48f7c67d09a0a2a657a61990fff22ce9b34db2911125c3f7d32398ad06aaff49f4007f04a304c775a496", + "publicKeyCompressed": "02b34fc9a91fc9b943058202cc92f897e8f72ba37c898c48f7c67d09a0a2a657a6", + "msg": "68656c6c6f", + "sig": { + "r": "36cf38affa4324459c4ff9e58468ca698a1be73352cb4627d8363821fa03d928", + "s": "646029ad942625ff8c9284fffd419ab9497b638c2f5685420ec161583817ee74", + "id": 0 + }, + "comment": "R: w=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 407, + "publicKeyUncompressed": "044e4f31df506dc96ec77543e2527ec38f4453d550d1d9c848f936f0527fd71713a78d28d29585e24189ca185570f6d92789055a588eb1de32f0b21ebe34eb0679", + "publicKeyCompressed": "034e4f31df506dc96ec77543e2527ec38f4453d550d1d9c848f936f0527fd71713", + "msg": "68656c6c6f", + "sig": { + "r": "64e338755dd45ac4d51b6ff926695532a412635fcfdc9b1eacd2fd475f2ce0b0", + "s": "1f73be58980f407d395e28583709b9fb5c4c0ed07a2421e0bb5c7263d105d937", + "id": 0 + }, + "comment": "R: w=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 408, + "publicKeyUncompressed": "04cbbe449f47e2be215eb4b6c7db7f16569c6809650984c8ab99703bdd2e77c7be89ee06c5e783414b72d73926969c36859b6943e2def642e430484da5f589f63e", + "publicKeyCompressed": "02cbbe449f47e2be215eb4b6c7db7f16569c6809650984c8ab99703bdd2e77c7be", + "msg": "68656c6c6f", + "sig": { + "r": "3bfa4cb1c450fc911f3eda274fcd86d5c8b4229ae86f1dbb77c74813d462ad73", + "s": "20300b430bba795cc4698f2b979a2191cf2cc939774c6e0bc4edbe734cef7c78", + "id": 0 + }, + "comment": "R: b=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 409, + "publicKeyUncompressed": "048c3a3e9fe922a79ae466f48dd3c2cc71f42afa637bdfa6574b9aa9948432dc61cd33b95a0c574c29220025b0d3afbc3bc5b6b7457243d386ff85114184bc5ace", + "publicKeyCompressed": "028c3a3e9fe922a79ae466f48dd3c2cc71f42afa637bdfa6574b9aa9948432dc61", + "msg": "68656c6c6f", + "sig": { + "r": "00c81f07ef1c44d920b57569d5c96efd1d5197a01948bc93ccc7cf997bb4b8ed21", + "s": "00d6923499e36175945608acc09c0e89e044909f141dd76aa4cc00fdb550821e96", + "id": 0 + }, + "comment": "R: b=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 410, + "publicKeyUncompressed": "0405816e21ed2c8d8725b0edbcdec0af97c571da316683f2cdfa0cb6f40cc674af5e27ba6637db97f22df4796762cae6527a295fe3a637ed4c5b08caeb031fcdc3", + "publicKeyCompressed": "0305816e21ed2c8d8725b0edbcdec0af97c571da316683f2cdfa0cb6f40cc674af", + "msg": "68656c6c6f", + "sig": { + "r": "00ee592bf5200e40d3e60923508277e63baf857f592f8c3708d89aa502f369757e", + "s": "314702ab468bae8316ce08990d54de145a2be26c011f22d3302b433fdc783022", + "id": 0 + }, + "comment": "R: b=-2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 411, + "publicKeyUncompressed": "049ca66ba544a15a215389b831aba7bd27bc561dae07e1928fd1791f83195d93b4687fbf2fc7bd0bbdbd3cc3e9b9327a207a42c53810ed7e2de4dcd7ae77d31219", + "publicKeyCompressed": "039ca66ba544a15a215389b831aba7bd27bc561dae07e1928fd1791f83195d93b4", + "msg": "68656c6c6f", + "sig": { + "r": "008efc9a2cacaee578396fba5f4c0cba23afb6a7bb1206d84d975fe3ac834f54bb", + "s": "32aee72be4b5de5c6cd5a05b9009e3c88334bd061a9b190c69e12c5c0575c7ae", + "id": 0 + }, + "comment": "R: b=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 412, + "publicKeyUncompressed": "045eaf7975d61ba676c5cbcf91fb78c5a8b3afc16b521613f156012cdc348d2ecef76bd487804724fcfd4d3e78c81d1563bbb83ec0fb93654de6289faa0e3ce544", + "publicKeyCompressed": "025eaf7975d61ba676c5cbcf91fb78c5a8b3afc16b521613f156012cdc348d2ece", + "msg": "68656c6c6f", + "sig": { + "r": "00898fb815ac930e9a2149dd0f3147e46aaaf1c95bafecbb19d691ae1c1a344ab8", + "s": "00de9b0633ca48353c3b05ec504ba7656f6740f84d07c8177611f7afc4aaa451b9", + "id": 0 + }, + "comment": "R: b=3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 413, + "publicKeyUncompressed": "049b19a2625feb98bb7ea39352486cbf0301849e86ec4e814131533295c8f529510f1602f057a2c5e33e92d2e63d438c71e99fa1097c6b5b35f5a8617c1bdf4983", + "publicKeyCompressed": "039b19a2625feb98bb7ea39352486cbf0301849e86ec4e814131533295c8f52951", + "msg": "68656c6c6f", + "sig": { + "r": "0aff7d84b9e77d16722bcd183030031f83544b82c8ac02b231bf1f832fb3152e", + "s": "74dc015699f15dfbd2710aee4eeca183d47c89930626b1ab5a7464c86398fabf", + "id": 0 + }, + "comment": "R: h=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 414, + "publicKeyUncompressed": "04e1904bc47dae71e2ab88f858ac0b2ac9bad94e2c5a6000da975fbd166fddd87ac7840d31a1597a4b4e118d21fe7dad9cf65e0f646eebc547ca996229b2e2ef23", + "publicKeyCompressed": "03e1904bc47dae71e2ab88f858ac0b2ac9bad94e2c5a6000da975fbd166fddd87a", + "msg": "68656c6c6f", + "sig": { + "r": "00a994cd28ee8aaa2ad8340b97516b7a7ce4c25dd98a8f42c3360798576c9be430", + "s": "00e5ac35007564eabd0085c0167639cc3c0e92e5d33b76dd7ce38a1d190d4bf26a", + "id": 0 + }, + "comment": "R: h=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 415, + "publicKeyUncompressed": "043e63e1db729cc8c7f0fb73750e7407ebff2db6804476eb1b7cac91dc5169d419d417a1689575ee05dd58df9d55da7bac6c1ddde3c72392b20b053dad09188b37", + "publicKeyCompressed": "033e63e1db729cc8c7f0fb73750e7407ebff2db6804476eb1b7cac91dc5169d419", + "msg": "68656c6c6f", + "sig": { + "r": "6e63387edc4d2e4f868e23e9041c99c4becf4448cbd65e447a3874298f3eef25", + "s": "1c9efd64cdf4b049454022d252aec7634c06f90ae8694bf980f6ca29432fa36e", + "id": 0 + }, + "comment": "R: s**2=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 416, + "publicKeyUncompressed": "04dc3b5359a0fc459f07ffc4c3ff2427e202e561d7974d309a5659b35bfe474dc3bc8e545cde85adac6591636ed036f658661187d63fbaad991ea1101533a8fe98", + "publicKeyCompressed": "02dc3b5359a0fc459f07ffc4c3ff2427e202e561d7974d309a5659b35bfe474dc3", + "msg": "68656c6c6f", + "sig": { + "r": "00f4d5b67f9a7ab82e45c963b9fe42e19c443dde7a3983ce54d886048abcbf60c3", + "s": "2c01c79f75f56d583b39e517c90c08b608e5761b6cb78e5390e14b4f140c348e", + "id": 0 + }, + "comment": "R: s**2=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 417, + "publicKeyUncompressed": "047eb4957d1cf30781d340b4eda2b24562dc933b8787e279c47a0ce047acb8c71e8efd934207b873d6d32b525667f633ebbe77828872446d562d427c16e48d86ec", + "publicKeyCompressed": "027eb4957d1cf30781d340b4eda2b24562dc933b8787e279c47a0ce047acb8c71e", + "msg": "68656c6c6f", + "sig": { + "r": "009cc711018938198233a8785cfda0849efcf2dd3cfaa5d366ad418749b401a876", + "s": "0092a5be2cedba8b68a28b1b6086d6b8644e7fe2c0676d679f24407eb467478030", + "id": 0 + }, + "comment": "R: s**2=-3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 418, + "publicKeyUncompressed": "04f958e07ed34a136e2ead4712dbdb42e0c20ef5e4b16942e543ecfd56d010013e962db7242ed92dec950557db27a62bf155f70ad907ade2ff4359fb3e7143ab7a", + "publicKeyCompressed": "02f958e07ed34a136e2ead4712dbdb42e0c20ef5e4b16942e543ecfd56d010013e", + "msg": "68656c6c6f", + "sig": { + "r": "4b5f4333594b430ba097a86910808e4c19820cc151eed6f0b9dc6b411eca3cc2", + "s": "1fef94c537d97f1a6404c57dacc3c808743510151f9c35a1d062807b096099f7", + "id": 0 + }, + "comment": "R: s**2=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 419, + "publicKeyUncompressed": "04853c1674107d7c63ce80e420c53c93db151f38365eb8124292bc667e6669cd7d1f3934a741b58d3dd825a2cc29ba1ca29a3c0bf1f6376fb31e59913a44ea5b0c", + "publicKeyCompressed": "02853c1674107d7c63ce80e420c53c93db151f38365eb8124292bc667e6669cd7d", + "msg": "68656c6c6f", + "sig": { + "r": "00af89ec349694079885953fae86acba5c1e25c42e58a675ec7e19a9e3828477ed", + "s": "35af0520219d18ac774a7c661b9cae1bca67e3565cddd388f4dd90e8b6f4cc60", + "id": 0 + }, + "comment": "R: s**2=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 420, + "publicKeyUncompressed": "04d2459991eae78252f8a4ceb5ec9076ef15a2a502c4bccabadc63e1a5703d883a8e6d484f0a437e4c076ef1f0e2c8aabf1addd16077d5e610d54eae6056147780", + "publicKeyCompressed": "02d2459991eae78252f8a4ceb5ec9076ef15a2a502c4bccabadc63e1a5703d883a", + "msg": "68656c6c6f", + "sig": { + "r": "0516d0981020b55bd9d317e868d2b757c8582f10556ab322c809eada5eb14780", + "s": "1804a7b33f5bbcbe36334fc188e84e1a93193587e1cd17cb55cc38b29eec45bf", + "id": 0 + }, + "comment": "R: s**2=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 421, + "publicKeyUncompressed": "04829fd2523d3525b986febf3ddce30333400147d0ad88fea149051aeacf185423da42c1dfd1ee356dea22e32959548c16da6d181cd6276bf3e943fb1caa2d3998", + "publicKeyCompressed": "02829fd2523d3525b986febf3ddce30333400147d0ad88fea149051aeacf185423", + "msg": "68656c6c6f", + "sig": { + "r": "49b03912dd12a5981e2a3645eaca0dfaef57a50c81e9510d31b19535bb6bc13e", + "s": "00b4efee9a9291a8085e8544f928235ce9c5efa306455c0111ed68754ca19f9dc6", + "id": 0 + }, + "comment": "R: s**2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 422, + "publicKeyUncompressed": "0496bb6d77c4331b177e329bbd2d25b2deffcb1d969a5bee41c7ceffbd83117ac0e3d5d255f8cb8ce6b9bb93206ffc3dbe6a1be83b6d6f5dfb73529b9ac62c829a", + "publicKeyCompressed": "0296bb6d77c4331b177e329bbd2d25b2deffcb1d969a5bee41c7ceffbd83117ac0", + "msg": "68656c6c6f", + "sig": { + "r": "00d11233ed000eafb50963cfe4e8ed5889cb59c251f3a84c50ffd3d6f0f52c222d", + "s": "3f478bbd4a79c6185091a62ba87594b4398b4b292df2ab36b44c648780fc21e1", + "id": 0 + }, + "comment": "R: s**2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 423, + "publicKeyUncompressed": "0419dfeddeb2cbcff27fa40dafca52ee2170e6c004d17a33997076f0e211a9e9894d0caa582523c147a168ee694efb5bbc7743ad01d7fb2426805cbb02574aabd1", + "publicKeyCompressed": "0319dfeddeb2cbcff27fa40dafca52ee2170e6c004d17a33997076f0e211a9e989", + "msg": "68656c6c6f", + "sig": { + "r": "00e53d930022deaab2d871f9d52c48997b454e98a18a6e62a1ce7a93d74f6814f3", + "s": "00e70f08d954993ae973ee3825d1f896de5ea0409df88835df543618e56c1dd9c6", + "id": 0 + }, + "comment": "R: s**2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + } + ] +} \ No newline at end of file diff --git a/packages/crypto/testdata/rootberg/ecdsa_secp256r1_keccak256_raw.json b/packages/crypto/testdata/rootberg/ecdsa_secp256r1_keccak256_raw.json new file mode 100644 index 0000000000..6caca6b516 --- /dev/null +++ b/packages/crypto/testdata/rootberg/ecdsa_secp256r1_keccak256_raw.json @@ -0,0 +1,3481 @@ +{ + "testType": "EcdsaVerify", + "algorithm": { + "type": "Ecdsa", + "curve": "secp256r1", + "sha": "KECCAK256", + "encoding": "RAW", + "normalize": false, + "signature_generation": "Generic" + }, + "version": "0.34", + "description": [ + "The underlying elliptic curve is secp256r1", + "The message digest for hashing the input is KECCAK256", + "Note KECCAK256 is not SHA-3, since it does not include the domain bits added by NIST.", + "Signatures are dictionaries containing r, s and id, where id is the recovery id used by a number of protocols that verify signatures by recovering the public key. Public keys are given as a pair of coordinates", + "The test vectors were generated for signature verification through public key recovery." + ], + "references": [], + "numTests": 247, + "tests": [ + { + "tcId": 1, + "publicKeyUncompressed": "04a0009c3b693aa32d0547fe1cbc10bcd2e0e971d6f5dd8e18326bb904655ea1c5c17aa5bdecb4f86ac3a1e94d54beb591589197ceb5ac061afb9ddd311f2931ae", + "publicKeyCompressed": "02a0009c3b693aa32d0547fe1cbc10bcd2e0e971d6f5dd8e18326bb904655ea1c5", + "msg": "", + "sig": { + "r": "2549ca541c1b0a06379725f05a295e23f24ac9ee5d087fe773d045bd29c825f7", + "s": "265034ab0c6643fa28d1f116b2040fe45903b3072fa95ce18d1023346bc07255", + "id": 0 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 2, + "publicKeyUncompressed": "04a0009c3b693aa32d0547fe1cbc10bcd2e0e971d6f5dd8e18326bb904655ea1c5c17aa5bdecb4f86ac3a1e94d54beb591589197ceb5ac061afb9ddd311f2931ae", + "publicKeyCompressed": "02a0009c3b693aa32d0547fe1cbc10bcd2e0e971d6f5dd8e18326bb904655ea1c5", + "msg": "000102030405060708090a0b0c0d0e0f", + "sig": { + "r": "008799631131d6f61405eb770ba66df274e75464ad8ca419f54c3b7b3099b1862c", + "s": "0ea2d4f842b88a20e178c3980bce30d44147072e1ce683706f9204867e7d2697", + "id": 0 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 3, + "publicKeyUncompressed": "04a0009c3b693aa32d0547fe1cbc10bcd2e0e971d6f5dd8e18326bb904655ea1c5c17aa5bdecb4f86ac3a1e94d54beb591589197ceb5ac061afb9ddd311f2931ae", + "publicKeyCompressed": "02a0009c3b693aa32d0547fe1cbc10bcd2e0e971d6f5dd8e18326bb904655ea1c5", + "msg": "616263", + "sig": { + "r": "00e5d49e587060dbe0b484657540cd511790bf00e562cad532b781b20aed88bdbd", + "s": "00ad3636b42741891a3bdb1c9db389f7262bbb60670cf8d910652f3c9731326e2b", + "id": 0 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 4, + "publicKeyUncompressed": "04a0009c3b693aa32d0547fe1cbc10bcd2e0e971d6f5dd8e18326bb904655ea1c5c17aa5bdecb4f86ac3a1e94d54beb591589197ceb5ac061afb9ddd311f2931ae", + "publicKeyCompressed": "02a0009c3b693aa32d0547fe1cbc10bcd2e0e971d6f5dd8e18326bb904655ea1c5", + "msg": "54657374", + "sig": { + "r": "0562adcacb0ab69493c6096783650721fdda1b80cc111bc1d295bbae6d925292", + "s": "00b6a81b6b65534de1d81a59ed67de9c08e7bcbd0c60f0cc51240276273db26f5f", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 5, + "publicKeyUncompressed": "04d372ac5e8f88e19470342f4d936ec18dc69ea4677a3191a4c6012e09148289e6f4fec98c6ebcfa0dd2b3f950b12f73d97d27bd60b01d1f7d84d01847a74a2295", + "publicKeyCompressed": "03d372ac5e8f88e19470342f4d936ec18dc69ea4677a3191a4c6012e09148289e6", + "msg": "54657374", + "sig": { + "r": "05", + "s": "05", + "id": 0 + }, + "comment": "r=5, s=5", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 6, + "publicKeyUncompressed": "04fae09d7e64f341702ec5dce1394f91f7c58bad5d3f8b80d0f7cbad6a36a1b92369d7ae8135663c190523c78a67410fdbd59c320679225d0ec44436b30fc456cd", + "publicKeyCompressed": "03fae09d7e64f341702ec5dce1394f91f7c58bad5d3f8b80d0f7cbad6a36a1b923", + "msg": "54657374", + "sig": { + "r": "06", + "s": "06", + "id": 0 + }, + "comment": "r=6, s=6", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 7, + "publicKeyUncompressed": "043d845b56288c8c983d50dafb97e6182fb40817d3226501e1b209bf4e7f02a35d975bae53148e0db51ad43376176c8426b2e43913866feba9c94a14a265949e91", + "publicKeyCompressed": "033d845b56288c8c983d50dafb97e6182fb40817d3226501e1b209bf4e7f02a35d", + "msg": "54657374", + "sig": { + "r": "08", + "s": "08", + "id": 0 + }, + "comment": "r=8, s=8", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 8, + "publicKeyUncompressed": "04e9e3cf506b96325151a73e661523ea7a8c06b388d47d2791b0a428544f1db47545410b125120be9def320f80d24f02a0d9c9c1404d3ce404f00c645f00c61c33", + "publicKeyCompressed": "03e9e3cf506b96325151a73e661523ea7a8c06b388d47d2791b0a428544f1db475", + "msg": "54657374", + "sig": { + "r": "09", + "s": "09", + "id": 0 + }, + "comment": "r=9, s=9", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 9, + "publicKeyUncompressed": "04284b6c826d1f79275a447ba592767fca834795b46eae3a45a39c7b4a1d2e5173df9649f6b954414285f45bb748964173a2257432f874e62fa658c18c4595f2a2", + "publicKeyCompressed": "02284b6c826d1f79275a447ba592767fca834795b46eae3a45a39c7b4a1d2e5173", + "msg": "54657374", + "sig": { + "r": "7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "s": "7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "id": 0 + }, + "comment": "r=(n+1)/2, s=(n+1)/2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 10, + "publicKeyUncompressed": "0413e352a42802af4c8e107df369bf9a9348e6fbaa9fcf9e325b609e643c2184ff04a274afe2c8fcc58887f766f03eaf2193b4369dfddda69d2af00bd770d2108e", + "publicKeyCompressed": "0213e352a42802af4c8e107df369bf9a9348e6fbaa9fcf9e325b609e643c2184ff", + "msg": "54657374", + "sig": { + "r": "7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "s": "7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "id": 0 + }, + "comment": "r=(n+3)/2, s=(n+3)/2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 11, + "publicKeyUncompressed": "044639ccf0d42467d05082bb2e8c2146d196b295b13d2c48624127cd88789ca7a22352b0aaf9bed14c1924587a910ee6cf47c78a87aab277ff15b4bf3f26b4ee97", + "publicKeyCompressed": "034639ccf0d42467d05082bb2e8c2146d196b295b13d2c48624127cd88789ca7a2", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "s": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "id": 0 + }, + "comment": "r=n-2, s=n-2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 12, + "publicKeyUncompressed": "0412818025fa916250d2eb96c0278d1e144efa171f9e99dccf9c9165435028743138b067891a32f42dbcf40322334216b404d26f78853f0ca5920021cfde76c2c9", + "publicKeyCompressed": "0312818025fa916250d2eb96c0278d1e144efa171f9e99dccf9c91654350287431", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "s": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "id": 0 + }, + "comment": "r=n-3, s=n-3", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 13, + "publicKeyUncompressed": "0443df016d32756883902412519843591f395e7ffded8862d9d6397f036e5e15627dc285c0949793ad726630433e90077d6abcb569d0f97616abcb5f9c6ded63ab", + "publicKeyCompressed": "0343df016d32756883902412519843591f395e7ffded8862d9d6397f036e5e1562", + "msg": "54657374", + "sig": { + "r": "7b", + "s": "00b21642c7a6f4de9c8590b21642c8590af2b6f12ae38add9423fbae7161a92517", + "id": 0 + }, + "comment": "r and s^-1 small", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 14, + "publicKeyUncompressed": "04ce3f6b6329526ab78839e7a46dad7998253660aedb0ad66bc2d2e68385384be9a8ec8fe7405070d3139e8809c88d8ef98153403c66664f0b4311b8197767a8ce", + "publicKeyCompressed": "02ce3f6b6329526ab78839e7a46dad7998253660aedb0ad66bc2d2e68385384be9", + "msg": "54657374", + "sig": { + "r": "3039", + "s": "00e62027d80c0b6a9ea2c034e51427b717a4eab2c011de1f466bdbc6bb4fd7667c", + "id": 0 + }, + "comment": "r and s^-1 are 16 bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 15, + "publicKeyUncompressed": "0451f3c3c88ac6708ed4c984925daa62358b58ee169d38c7278c42c35285fe3e6732c274e778195f05d52fc3a87dd195e96940ba116303458366f6f927e3a22055", + "publicKeyCompressed": "0351f3c3c88ac6708ed4c984925daa62358b58ee169d38c7278c42c35285fe3e67", + "msg": "54657374", + "sig": { + "r": "24f22125a254278f", + "s": "008d00c610ee357b04f2eeacc811ffc54895931b3287c3a4e3f80b39005d45688a", + "id": 0 + }, + "comment": "r and s^-1 are 64 bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 16, + "publicKeyUncompressed": "04a1ba16b8ad1c97abfb70803ed3ef37c45f29a5584ea2fa01b47393f098d465b8ff2fd16a9d618380b59aa72d0e0a7e3a063b8e5b8995991a62ac1ef7d5c4690d", + "publicKeyCompressed": "03a1ba16b8ad1c97abfb70803ed3ef37c45f29a5584ea2fa01b47393f098d465b8", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffd", + "s": "1d702a231af70e2602791bfd535e466efac1e065553149e559e3e70f9bf9a3e6", + "id": 0 + }, + "comment": "r and s^-1 are edge case 64-bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 17, + "publicKeyUncompressed": "04fcafa281c79547a7029ab973aee900d22ce428ad4d132d196b0583ca8439e3d58025546a5bda1005521624e8a41a283fbea776a89ac5a28b6f793b14c233a6d5", + "publicKeyCompressed": "03fcafa281c79547a7029ab973aee900d22ce428ad4d132d196b0583ca8439e3d5", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000004", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 18, + "publicKeyUncompressed": "04ed4ad8d7544147e24909875f31811ace36ead0f68076cf8d3e2e376f0d58a23fd6ef49e9232926690488050a0dd277a3c0fc645a17fadc41c1d71bef73421c2c", + "publicKeyCompressed": "02ed4ad8d7544147e24909875f31811ace36ead0f68076cf8d3e2e376f0d58a23f", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000004", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 19, + "publicKeyUncompressed": "047c0ab77748801fccedf5a20ef880d221bd4676e71849ea0c1bf3c832a9f3d0ea8ee8efe6acf5dd2b503fb8600004724085a6f72140281ea74820fcf2224aff69", + "publicKeyCompressed": "037c0ab77748801fccedf5a20ef880d221bd4676e71849ea0c1bf3c832a9f3d0ea", + "msg": "54657374", + "sig": { + "r": "0100000000000000000000000000000000000000000000000000000000000000", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 20, + "publicKeyUncompressed": "04e8dc2281d996162fcb36329783a87417d1402a35b56f2b04a85e98468f37304fef6ba607d34eaca3b89b81d82dcc4428f01da6cb071027af89bdb624a8d2c51e", + "publicKeyCompressed": "02e8dc2281d996162fcb36329783a87417d1402a35b56f2b04a85e98468f37304f", + "msg": "54657374", + "sig": { + "r": "0100000000000000000000000000000000000000000000000000000000000000", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 21, + "publicKeyUncompressed": "046cc501ab4ccbe491bd0967f212444da8e7c2d68d35548adff4723932d5f9183c3483e2b733a900b8749712569a6fcaa7f69dd90fd256bc623ac545437a909dc3", + "publicKeyCompressed": "036cc501ab4ccbe491bd0967f212444da8e7c2d68d35548adff4723932d5f9183c", + "msg": "54657374", + "sig": { + "r": "0080", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 22, + "publicKeyUncompressed": "0427a4b9f169a2d5ee2e66aa64756887b17212bffc462ace548a13aa811749e835c726ad8458b21191be15d17ef0fac6cbe5f2404f825bf9efcdaad82a9d121668", + "publicKeyCompressed": "0227a4b9f169a2d5ee2e66aa64756887b17212bffc462ace548a13aa811749e835", + "msg": "54657374", + "sig": { + "r": "0080", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 23, + "publicKeyUncompressed": "04bb3816e0107fff850a68300343d0859667e5b2574673de3e84b663b76f35cbe4a1ba3d261c411214b41efb1d573ffed76b1ff8fbb27ab4c1c45e21c120f0f579", + "publicKeyCompressed": "03bb3816e0107fff850a68300343d0859667e5b2574673de3e84b663b76f35cbe4", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 2 + }, + "comment": "R: large x-coordinate (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 24, + "publicKeyUncompressed": "047c42683243164cea8754bdb552c07f57aa5d75f201ffa49abf4a58a0721e7cb772623ff6d98ea5a77a86815d5681b22d3e545294eb1e7ae5999be9f39993ad97", + "publicKeyCompressed": "037c42683243164cea8754bdb552c07f57aa5d75f201ffa49abf4a58a0721e7cb7", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 2 + }, + "comment": "R: large x-coordinate (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 25, + "publicKeyUncompressed": "04b864dc5273fb1a362c2dfec6c3c1efa3d0f9f922819ab211d2d27e78b463f3d3b848d9aa4d5809ba3eb5965f176e9648ae5940859ce9ea1a73c4fd7aad4514db", + "publicKeyCompressed": "03b864dc5273fb1a362c2dfec6c3c1efa3d0f9f922819ab211d2d27e78b463f3d3", + "msg": "54657374", + "sig": { + "r": "4319055358e8617b0c46353d039cdaac", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 2 + }, + "comment": "R: x-coordinate close to p (Could not recover R)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 26, + "publicKeyUncompressed": "04301e4933a35224dbaf59b0d4694221272b1c579a738983ef1116024ce767381b9fd7788b8dfb34887a245d1b1567e9bae500ec124916fc6c4d51185914e86bf1", + "publicKeyCompressed": "03301e4933a35224dbaf59b0d4694221272b1c579a738983ef1116024ce767381b", + "msg": "54657374", + "sig": { + "r": "4319055358e8617b0c46353d039cdaac", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 2 + }, + "comment": "R: x-coordinate close to p (Could not recover R)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 27, + "publicKeyUncompressed": "04eb030e764aca1c61707b5d4e3ee140ce6eeeccc41686c1674507fdc88ad46b558306c6340ccb33b511ed443a092b2ec0eb4a2150840ab0202d2666e3c32975a8", + "publicKeyCompressed": "02eb030e764aca1c61707b5d4e3ee140ce6eeeccc41686c1674507fdc88ad46b55", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 2 + }, + "comment": "R: x-coordinate < 2**255 (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 28, + "publicKeyUncompressed": "042f63a94f417404f0dfb36f8816221d75425f563fe88f5c36229308fd131d325cd789b8c84be4f6ea4ecc17501d73f48c563e8475d3d19125652e9e2bbe946fbe", + "publicKeyCompressed": "022f63a94f417404f0dfb36f8816221d75425f563fe88f5c36229308fd131d325c", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 2 + }, + "comment": "R: x-coordinate < 2**255 (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 29, + "publicKeyUncompressed": "0402e41326ee944eddb1223b13a36f2e71219ffc32563e7908abce4869f06c1996fc4f0c00c5a2e376d7f825ac3d2d04c122b40170f990908f2a80fa1be1615346", + "publicKeyCompressed": "0202e41326ee944eddb1223b13a36f2e71219ffc32563e7908abce4869f06c1996", + "msg": "54657374", + "sig": { + "r": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 0 + }, + "comment": "R: x-coordinate < 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 30, + "publicKeyUncompressed": "0408005306bb7b1e07d8e03f2707c39555e81d045cb3999cf6654ca73f87e625fac96934db1a8c03b9b8fe9e915487cb7ecaf8397df9f6cf2d6758839c8958fa94", + "publicKeyCompressed": "0208005306bb7b1e07d8e03f2707c39555e81d045cb3999cf6654ca73f87e625fa", + "msg": "54657374", + "sig": { + "r": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 0 + }, + "comment": "R: x-coordinate < 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 31, + "publicKeyUncompressed": "04c2d2058aa78905fe7ad9756f261a0bbb33995a00b7e8c156bf32cfe0866a325d8572bc79b69859f7673f0e17e24acf436b354d08e2113ce2bb801a0db4abee77", + "publicKeyCompressed": "03c2d2058aa78905fe7ad9756f261a0bbb33995a00b7e8c156bf32cfe0866a325d", + "msg": "5465737420", + "sig": { + "r": "00ce72b7154350663c68acd3307dd00f4ec968a61a6d2c6896febf7b6f28caf76e", + "s": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "id": 0 + }, + "comment": "u1 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 32, + "publicKeyUncompressed": "04c0c29be3e7fa6e3126c863ab95294451693f9ed61e989bd7dc263a4284c38ddfac1666bf8364a5e676c7cddb8f8267e427bd3beb119d77643dc24f7f1f71d164", + "publicKeyCompressed": "02c0c29be3e7fa6e3126c863ab95294451693f9ed61e989bd7dc263a4284c38ddf", + "msg": "5465737420", + "sig": { + "r": "2a7d4c90af879dd70fbeb52f8eed9e113515de81f6e6d0018968c3f10d41481b", + "s": "2a7d4c90af879dd70fbeb52f8eed9e113515de81f6e6d0018968c3f10d41481b", + "id": 0 + }, + "comment": "u2 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 33, + "publicKeyUncompressed": "045ff812f0cbf089b8ff494293a2a7b40b525dc81a4c7f91e7cc19de5bf512c76b3162d952c3f803e4d1ce8306b831659d9b5767a2070842cf966b4751737a0d73", + "publicKeyCompressed": "035ff812f0cbf089b8ff494293a2a7b40b525dc81a4c7f91e7cc19de5bf512c76b", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "05070213946974a1de009713ab64b5a3c3cc755130b33a53a21f8fe1deb13cff", + "id": 0 + }, + "comment": "u1 = u2 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 34, + "publicKeyUncompressed": "0481dc4011bb36cedad5508193e12d8046ddf4f5c6a77f48d9da407e20762439415ebf2e3fb26646b5bada17220bcf554242a91f20d2f9eda9945ca2d2b63cfc2b", + "publicKeyCompressed": "0381dc4011bb36cedad5508193e12d8046ddf4f5c6a77f48d9da407e2076243941", + "msg": "5465737421", + "sig": { + "r": "00e750ba811783b89ca0d42fe8a322b302c65ba365797cb1fa228ed0b0f75f42be", + "s": "00a41afcd6492ebd11dfa928f3ff6943ce5933167259c07429d020f1df5026fe73", + "id": 0 + }, + "comment": "u1 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 35, + "publicKeyUncompressed": "04277af3a01bdcbcd3ed834f991f727fac0f84d635e1660040a2b062e67f844d3dab744ace6d92f6c93d8dc324057d5071f4486b649c750bb9a82c740c0465e731", + "publicKeyCompressed": "03277af3a01bdcbcd3ed834f991f727fac0f84d635e1660040a2b062e67f844d3d", + "msg": "5465737420", + "sig": { + "r": "58f3b884a5a67275cb52ee869c688ac2fd019062c7ba6d7f630d9818b2d619a9", + "s": "00ac79dc41d2d3393b65a977434e3445615cf44588376906022b63b16dd79c9f7d", + "id": 0 + }, + "comment": "u2 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 36, + "publicKeyUncompressed": "04ea6b8171f88647a3b6c36e50b8f3d220babbfc0b6c2b87ce7fd4a67d22c11617355e0c10b1f9d60872c482b291ae68eac7e5a1e5dcee77a3ce2fa8b371f1abc2", + "publicKeyCompressed": "02ea6b8171f88647a3b6c36e50b8f3d220babbfc0b6c2b87ce7fd4a67d22c11617", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "045a700e1a53a782a5e7e09143d8dfa9c43770d8abb0a5dbf11f020b9fefdabb", + "id": 0 + }, + "comment": "u1 = u2 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 37, + "publicKeyUncompressed": "0430b8d4c88a2e1320f95ac6d1431496ee50f57ba9ac569ce3d0977ae6d69552ea16b267dbf5e91c70e7f17a70686dce0ad62eb69e2a73625e1dc315a7929b8750", + "publicKeyCompressed": "0230b8d4c88a2e1320f95ac6d1431496ee50f57ba9ac569ce3d0977ae6d69552ea", + "msg": "5465737420", + "sig": { + "r": "2b151559881a0f71abf4afaf8b4cff9b21689d69faa808bdba437f89a71f6b4a", + "s": "00a4e480fc17fc84f3742be352923272d3983d7aa3288a12972e0d903f4c29c5b6", + "id": 0 + }, + "comment": "u1 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 38, + "publicKeyUncompressed": "0498568a31bddc28c3ab68057e29ed2d8e8c607fe2784a440419760396acbf5c09473f10007502b5573d3e7448a0de5403b2597592819f0c849fb0a4c45c6cbc2e", + "publicKeyCompressed": "0298568a31bddc28c3ab68057e29ed2d8e8c607fe2784a440419760396acbf5c09", + "msg": "5465737423", + "sig": { + "r": "00805d24be7a7f1b481e77fc7fa49029b1dfe6509dfbe5f408b913a911c58d8c76", + "s": "2ac9b6ea28d509180a27fed536dab8909ff77034a94ca6ad93068db0972f2ed2", + "id": 0 + }, + "comment": "u2 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 39, + "publicKeyUncompressed": "04fb0a04765cb673b3871feec71d9e605d9656a82229c47412f0566a1877bbf290bcdcdc96bc92e93068a1ce087eac2df06bfeaa52cd6f4c11614efc85bd8b682d", + "publicKeyCompressed": "03fb0a04765cb673b3871feec71d9e605d9656a82229c47412f0566a1877bbf290", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "0cda3cb6a146af17ce1595013a736ecaa001ebe55ced89a938f193fb9b8282a0", + "id": 0 + }, + "comment": "u1 = u2 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 40, + "publicKeyUncompressed": "04605dea3529e68ab2bdccc8cd0d319acbb69e8010ce5365154a7ac8e92a92c2a581c4767eb5102a2b27b452951e93d71141808c15a2abe265ef328a4d93ae8b28", + "publicKeyCompressed": "02605dea3529e68ab2bdccc8cd0d319acbb69e8010ce5365154a7ac8e92a92c2a5", + "msg": "5465737420", + "sig": { + "r": "6b5db778b38628e5707b7ea7552f403a163363c375a377361ec9295652013524", + "s": "11527d09b80a7127a37c56084968a784b1158571d49105445d4ae4c81448f980", + "id": 0 + }, + "comment": "u1 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 41, + "publicKeyUncompressed": "04a74ab39e2686abbd212968e9794cc3a629c4c7160b90f49559f4fffa31f9ecdf9ac1c370734f6e56f158899fa8810be732b6acdc90e0ea7fe698670ca9aa0578", + "publicKeyCompressed": "02a74ab39e2686abbd212968e9794cc3a629c4c7160b90f49559f4fffa31f9ecdf", + "msg": "5465737423", + "sig": { + "r": "00915ce49729b041d9dd7b29c5110f618cb6ba66a6e5c99ffc76b094a26273ff3a", + "s": "6ea31b67d64fbe272284d63aeef09e73062c9406c14dfe887d09362099ef2617", + "id": 0 + }, + "comment": "u2 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 42, + "publicKeyUncompressed": "046e2feead6e3ce8ca7e6ed80be30349071eee9abda2993781349d5de22ddf75c283a0e486704541a9723944df74526c52d3612a984955d01a22054a9f5d1b7cc9", + "publicKeyCompressed": "036e2feead6e3ce8ca7e6ed80be30349071eee9abda2993781349d5de22ddf75c2", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "43ea3a71be552c1e36b5a48ef6dafbebf2f4e890db827f0bf62978414ba0d771", + "id": 0 + }, + "comment": "u1 = u2 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 43, + "publicKeyUncompressed": "04c01ad7730c6c54e591eb7db06f8794e676a2451fed84d9893c1d6f75fc5398c3daa43210924bb81889368b82fb2be99e7d0e711682bb40cd85ef7bd9ff0749b1", + "publicKeyCompressed": "03c01ad7730c6c54e591eb7db06f8794e676a2451fed84d9893c1d6f75fc5398c3", + "msg": "5465737420", + "sig": { + "r": "00ba256f798be4df6700f9cdaf0cd0453f2dd9eae4a2654eecc0de98da10414b30", + "s": "08a93e84dc053893d1be2b0424b453c2588ac2b8ea4882a22ea572640a247cc0", + "id": 0 + }, + "comment": "u1 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 44, + "publicKeyUncompressed": "04c4506e091c5d8fd513548ebd8d85d8318169e227c8255f82eb069815b29c9cde67027ef9086b3adf7e029027ff9685cb807cb0acccd3bcb84c72a4fcee9614c2", + "publicKeyCompressed": "02c4506e091c5d8fd513548ebd8d85d8318169e227c8255f82eb069815b29c9cde", + "msg": "5465737421", + "sig": { + "r": "6635a38c6b013438b70b46cd53d587caffe2c0124ec849338ff2676f05702da8", + "s": "00cce52e38ca7f65e4a47a5c9956153c1a3cf59aa47fb379eb2bc0970b79ab0e7d", + "id": 0 + }, + "comment": "u2 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 45, + "publicKeyUncompressed": "043446e754502face71a3c69492e3d05477a00b75d13ccbfade3b5078e573868bc922823aaf88a835049700b9e4e59aa7f86e7d77bf6be905311f488bb9e31dd07", + "publicKeyCompressed": "033446e754502face71a3c69492e3d05477a00b75d13ccbfade3b5078e573868bc", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "1d1a3fa75d6b3dd574ed54bba83944ca0379027856d1d5eb5cb3731dcaa600e0", + "id": 0 + }, + "comment": "u1 = u2 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 46, + "publicKeyUncompressed": "0419128f03aece22dc983ce953f32c6d80d3bccb3c79a0b7f889a02755c209f61c128f618b94d9f3f5b5a5845f1dae669abc66a2ee20953c66ed55e114b2ad366e", + "publicKeyCompressed": "0219128f03aece22dc983ce953f32c6d80d3bccb3c79a0b7f889a02755c209f61c", + "msg": "5465737425", + "sig": { + "r": "00d59b87cdafd686f2adc6b55a3c09713c300a95190e0847004ab704d0289cda24", + "s": "00e84ee6104b2ad6da792ee2fdb59ec49656a7af2f865d153040744217b7712270", + "id": 0 + }, + "comment": "u1 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 47, + "publicKeyUncompressed": "042824d07ca74f4ef4fdd5b00941ca78b2e397be0f183c8285922d0d8521c702ae69e751dab814545d5aae87212c496e1989a4b8deb8fe21f1058e7cc0466ea8cb", + "publicKeyCompressed": "032824d07ca74f4ef4fdd5b00941ca78b2e397be0f183c8285922d0d8521c702ae", + "msg": "5465737420", + "sig": { + "r": "00d79eac27587a32e11018547952bc6acd7093fbedb76fe234ba1dc84548ed7f3f", + "s": "00b820714737d74460a54d392ce46bdc65ecb5a6b3bf47a873605a88013969503c", + "id": 0 + }, + "comment": "u2 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 48, + "publicKeyUncompressed": "04a64afb20762109093be3f91860c6964d3f44a0b5a73e79eee695d88d7e8b370fd633884f1a09de2ab44b3c4076b83daec73485248459e82735c319a50c1b6e94", + "publicKeyCompressed": "02a64afb20762109093be3f91860c6964d3f44a0b5a73e79eee695d88d7e8b370f", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "00ca042c0f96727e568c7b30fb0732eeab3d0f05c6b2e0ad576c0105f82553030d", + "id": 0 + }, + "comment": "u1 = u2 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 49, + "publicKeyUncompressed": "04d7ed46213c25f1388c580e9ea341054bac6398c1960e5f3d38eb9b0c3c486a00ea736b56e7c4c51835ff1845ec6ea1ff8b3955af087d31331363b854e33a9966", + "publicKeyCompressed": "02d7ed46213c25f1388c580e9ea341054bac6398c1960e5f3d38eb9b0c3c486a00", + "msg": "5465737420", + "sig": { + "r": "00c488f18c195180dabaa02950fa532dd9ed885fd745bf9dca6dd6406cf9520866", + "s": "00d043b29abe687d08ba4c1134db7b54b3edbd166e7cfcb311a2706990cdf782f4", + "id": 0 + }, + "comment": "u1 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 50, + "publicKeyUncompressed": "0483949b2200b0312c78d406138160d0ccde0fff427fe954cd95f81314ff3ca36710ca8851c2d6a29c596ad708847e6826adca8d3fed3eca50339f3659ea77a0e6", + "publicKeyCompressed": "0283949b2200b0312c78d406138160d0ccde0fff427fe954cd95f81314ff3ca367", + "msg": "5465737421", + "sig": { + "r": "0089c98179d376bcc7f557ea0b8b968689f52ec6b532c438fe47caf9155503265c", + "s": "4ad7b2e73c1b73d86888046417484b7de75309546be234025321b8e353f3d40e", + "id": 0 + }, + "comment": "u2 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 51, + "publicKeyUncompressed": "04f6d81cb218e9fe49be95bb34c37581ac30442246b9093d589f074aef493bc76b76195da4497bebc0194c402b885263b22c1054883bb2246d63448c6dcd5a8f40", + "publicKeyCompressed": "02f6d81cb218e9fe49be95bb34c37581ac30442246b9093d589f074aef493bc76b", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "1265f5a673fa50ceb4e517f657b5e5593934cb587a9910eefe5d43753b9f61a9", + "id": 0 + }, + "comment": "u1 = u2 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 52, + "publicKeyUncompressed": "042110470c2dcbefb34351bb344c49410faaa074b0dc996cefaa47086105dbf5baf4cc3aac1335a5ac904cea4cfd9c75cf713cdd8e33506073ad2b6ed3efe4a13e", + "publicKeyCompressed": "022110470c2dcbefb34351bb344c49410faaa074b0dc996cefaa47086105dbf5ba", + "msg": "5465737423", + "sig": { + "r": "30b9841818967851ab12a149d1f5df40a8f08661f950d1ce4c050fcecb8ef67a", + "s": "137fe8e11fa9c953c99edba9a03219b9473efc53575de0bff6de8671029b6b10", + "id": 0 + }, + "comment": "u1 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 53, + "publicKeyUncompressed": "04cef7f64ed174219e3efd673aa1250c48e7ebf9ed15f9a4b049819ffd61c768d44af7b808044488beca8948213a12683ebb13b16eda942778f234a277a6a8fcba", + "publicKeyCompressed": "02cef7f64ed174219e3efd673aa1250c48e7ebf9ed15f9a4b049819ffd61c768d4", + "msg": "5465737420", + "sig": { + "r": "70489fc4fbcd5e50fcb2059e2502c6d134ba9296d20c249dbd555545b80b2da1", + "s": "00cb6356e3009984d0b75448571f48bf0675cfe67f4ca4cbc923930f54072ed053", + "id": 0 + }, + "comment": "u2 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 54, + "publicKeyUncompressed": "04ae46af4da6971727734c0cdc7d67e4213eaf05c03832ca4e32102858f00562d66f822a4df53b6865cbcabaceaf8ffe53b00063ddbf7cc88d4e437c4f5179479f", + "publicKeyCompressed": "03ae46af4da6971727734c0cdc7d67e4213eaf05c03832ca4e32102858f00562d6", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "00dce5f8dd7287bc40edb1cb0d4890de80484dc85b26a50011b39d349e965e4f7e", + "id": 0 + }, + "comment": "u1 = u2 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 55, + "publicKeyUncompressed": "04dbf1fbaa18731258d81720810fc5f4c53d5d01420555cd810f973fc8e06fe71e1708c9d6157a4ba3ad569d97dcc37f237f25f7adf65bfa388352bc67fccb0b27", + "publicKeyCompressed": "03dbf1fbaa18731258d81720810fc5f4c53d5d01420555cd810f973fc8e06fe71e", + "msg": "5465737423", + "sig": { + "r": "00d1f048e882a2c6acd8dace007a93b7ae685a131cd505d1751d2cea29c7d9d56b", + "s": "00ef0143ae44b6fd6cf94ffcb93d4297dd945c28cc870cf28a67483b57d4466fc2", + "id": 0 + }, + "comment": "u1 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 56, + "publicKeyUncompressed": "040e41456187c12b6eed39d86bf575a9a28d5fd194dafb4a9c131c31fbfdfb0b4e7fa46c8c67246ace09c5d93ce0a290c1b9c44a4b00826a558ede7010a14a3355", + "publicKeyCompressed": "030e41456187c12b6eed39d86bf575a9a28d5fd194dafb4a9c131c31fbfdfb0b4e", + "msg": "5465737427", + "sig": { + "r": "48e0d3ae13400accde44322047c22bbe229789b967d9630482c48b54abf4c929", + "s": "0091c1a75c26801599bc8864408f84577c452f1372cfb2c609058916a957e99252", + "id": 0 + }, + "comment": "u2 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 57, + "publicKeyUncompressed": "04c39ed2ff18aba180ff0eb97c861d76cafb986aab6a8140317958e4f7c0abe7e062cd3307c3f89535fb1122d19d6df72c34f81f4ce7035f02767828402bb4d280", + "publicKeyCompressed": "02c39ed2ff18aba180ff0eb97c861d76cafb986aab6a8140317958e4f7c0abe7e0", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "51bbad6323449ab2def4aab7655846cdc421ce713c1322e254b76cc038ac9bc8", + "id": 0 + }, + "comment": "u1 = u2 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 58, + "publicKeyUncompressed": "04c4d2dfcbe07ce0d765dc077cc84f7a5ab10c3d2b890c1bac07f77380d7306b41446aab9b54d586d0e7081abc08dcd9e06ca1d644e595618d5162de5be46b1da7", + "publicKeyCompressed": "03c4d2dfcbe07ce0d765dc077cc84f7a5ab10c3d2b890c1bac07f77380d7306b41", + "msg": "5465737421", + "sig": { + "r": "3c1f82df7be5189140e6d78d79ed9c321ce53f48f886bca5c471b7295806b84e", + "s": "6f940ca3db450bbb815b5c30025af0c5d1e8963f8e450ae79aa998cbb48d7627", + "id": 0 + }, + "comment": "u1 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 59, + "publicKeyUncompressed": "0463fe1f3105d35d276d938d093677104a6a2c21dc74833a77b2695b67e619f7e51fe2b56d8b413bf756d448a521569a10efd74c58291184ad216dc618861bc232", + "publicKeyCompressed": "0263fe1f3105d35d276d938d093677104a6a2c21dc74833a77b2695b67e619f7e5", + "msg": "5465737421", + "sig": { + "r": "00f3148795d125b99c11693603d41de5d74de5d58970011145833fe991f4244b2e", + "s": "19d6f0d25db48cc9dd2d93f857c43450de024a486e2d1a7ee0f3c262107db446", + "id": 0 + }, + "comment": "u2 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 60, + "publicKeyUncompressed": "04f756742a4fd335f4f95f905525f4a49075515ed45b4496f194ecbb25d59a62bf5b8b22300d1726df11a414c2a05d7065b4c13a49a5d1dbff6aebd980e190d4f6", + "publicKeyCompressed": "02f756742a4fd335f4f95f905525f4a49075515ed45b4496f194ecbb25d59a62bf", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "32bc5bc6b67c57e27207befc3a8d251e2ad9800bd0783684656b2496d9373bc2", + "id": 0 + }, + "comment": "u1 = u2 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 61, + "publicKeyUncompressed": "04e2da133a4bb5ea763f8a3e89907d0a5069f8b4de4da341f1ed54060d3ce72fb348af87aabf3df28cbe7245ea3121fd6f88234c893193e1e131649eadd706e052", + "publicKeyCompressed": "02e2da133a4bb5ea763f8a3e89907d0a5069f8b4de4da341f1ed54060d3ce72fb3", + "msg": "5465737423", + "sig": { + "r": "3b0e4d12fc68add0d2e0ed271a947c7b3395423203476f08f918cca8ce7a1679", + "s": "3686d0cf847c3113e922c74e229179ebea27518f0a61fa69a81a857901ff5f77", + "id": 0 + }, + "comment": "u1 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 62, + "publicKeyUncompressed": "04d2b8589e0c815c7af74b531b333c469bc44d926b371f63bdb9fab8357134bb5fec1a8c3f4620be0cd4423c0a6bd54d48b2266ad464ebaecfd282518335fa4377", + "publicKeyCompressed": "03d2b8589e0c815c7af74b531b333c469bc44d926b371f63bdb9fab8357134bb5f", + "msg": "5465737420", + "sig": { + "r": "00a582238b58a80d01da9dbd007381a52a158c37fc07be0c4430cd96d2c7aa120b", + "s": "0096305f99c7d205d8238e835513b1076909f4c53d7381eb45fcaf043992861721", + "id": 0 + }, + "comment": "u2 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 63, + "publicKeyUncompressed": "04ea51360b1f79b9b03cb02b5121f10db553ed5430fa8bd048979da798babded890a635972631cac9133f3087f5917ef624a967d9af577a8f89675f65ce909f7b2", + "publicKeyCompressed": "02ea51360b1f79b9b03cb02b5121f10db553ed5430fa8bd048979da798babded89", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "008689666c3e6ccc008f3b3373e7e378e21131a06556356e04219dfbf59d11fd71", + "id": 0 + }, + "comment": "u1 = u2 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 64, + "publicKeyUncompressed": "04d726ae868eb081f6f6211977593a956f86d6fc53545378136f8659030ad9019fcbf3f4de59bb12441e2eef7697398bdefdbb4fe45394447381bbe21f18998f81", + "publicKeyCompressed": "03d726ae868eb081f6f6211977593a956f86d6fc53545378136f8659030ad9019f", + "msg": "5465737420", + "sig": { + "r": "477886c1934feedeb2905e0da655d9d56e282299759273c82d83c9ee9f9d1699", + "s": "00bc86e4fe8fb2895ada46a86f27b29c64c11d352992b2d13aca8f92ff1ae97b56", + "id": 0 + }, + "comment": "u1 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 65, + "publicKeyUncompressed": "0452ef35fb443c0649842fe8fcce90ba296bcd59a953128523a83321edaf7d0d3ba68c0cdcfa7ea0103a22808e3d0ad081fde5f79b32314168489f808c77cfe401", + "publicKeyCompressed": "0352ef35fb443c0649842fe8fcce90ba296bcd59a953128523a83321edaf7d0d3b", + "msg": "5465737420", + "sig": { + "r": "00aaf2037e638a2fd6f15412a25bf747260188c4a4b13d62c26f1b520c5ea43e58", + "s": "58fd96ca2483e10ad5fd675bb57b1810ffb176ae28fd32778e17dfb80ff51a6d", + "id": 0 + }, + "comment": "u2 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 66, + "publicKeyUncompressed": "047192c89bfb78d8eeb935b19aaa57e7dfa260840b9698c7b6068487a31fd54fca1bc36cce664a3368eee6a4e9fb029ca1231e61a2c11eea25ad9cc5e989aeba32", + "publicKeyCompressed": "027192c89bfb78d8eeb935b19aaa57e7dfa260840b9698c7b6068487a31fd54fca", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "00a84e90bdbd831f41ae75ee567d404915555dbd8927ba7904545eafa594cbd998", + "id": 0 + }, + "comment": "u1 = u2 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 67, + "publicKeyUncompressed": "04c1b8b175b1ece331b052168e7ce689487d408118260e69aaffae4b6e5c6f042abd7fce2ab2184f9de2cee0d1ff41d0d47e51c081b2bd23066fa54cb35d2b3224", + "publicKeyCompressed": "02c1b8b175b1ece331b052168e7ce689487d408118260e69aaffae4b6e5c6f042a", + "msg": "5465737423", + "sig": { + "r": "0082fd4140cbf7c0a88da62b79bac4c048f8a565fca544a2007726e401591146e0", + "s": "6d0da19f08f86227d2458e9c4522f3d7d44ea31e14c3f4d350350af203febeee", + "id": 0 + }, + "comment": "u1 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 68, + "publicKeyUncompressed": "0434f41af11ba1833f5a20846e56672bb497629f5c65913308f3fc035d17faed33d7363970066996b7eaeafe365389368b5fe0a178b7a864d0ebba3ff70c807434", + "publicKeyCompressed": "0234f41af11ba1833f5a20846e56672bb497629f5c65913308f3fc035d17faed33", + "msg": "5465737420", + "sig": { + "r": "00b9fd68bb11ef397669e0bf25a579041c890aa717081f2221c570716243a1415d", + "s": "1df5e0a24002608013f2b2fff9467ccde47f6af8147ffd71a02b498b7b0be07c", + "id": 0 + }, + "comment": "u2 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 69, + "publicKeyUncompressed": "0463d04c6b5dc1090b98532f00ebe404ce4c6ba75b8979f165aa839020329ed771347ccd173193287c94d0001c6330ef37ee5a3b5eae969896d412b3d3594704ea", + "publicKeyCompressed": "0263d04c6b5dc1090b98532f00ebe404ce4c6ba75b8979f165aa839020329ed771", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "62c3c708bdb4960cb5b17c488b12092b1f8a2f5914f3db980eaba83c2e7037f8", + "id": 0 + }, + "comment": "u1 = u2 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 70, + "publicKeyUncompressed": "043c670f7abaa6b332b357ec5c0c352fc44cfc0e8c06309405613c1bcfec63db9b91b70909bbc802511b0e77b3b580b509cea2b7587f5efb5beda0fe3e3edef008", + "publicKeyCompressed": "023c670f7abaa6b332b357ec5c0c352fc44cfc0e8c06309405613c1bcfec63db9b", + "msg": "5465737422", + "sig": { + "r": "00e20cd792581915165380c846c9938f21602ac0352d03b2830f019bd81808a760", + "s": "00cc40451ecf869a1eb2d191ce7e0194267999ee73fad9ac508d228ae7fc515d03", + "id": 0 + }, + "comment": "u1 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 71, + "publicKeyUncompressed": "04a2239179433af4a70c29dbad75e3a15372d1b5a7ab8a4f43aa8f0c6657c5faa695a8cdd945194b235ef6af751e74be0721d270bdbd6774d53ae1a07fb6ff47f0", + "publicKeyCompressed": "02a2239179433af4a70c29dbad75e3a15372d1b5a7ab8a4f43aa8f0c6657c5faa6", + "msg": "5465737420", + "sig": { + "r": "3c000cbedf59be842f00d96ce259b698aac0468f4960e6f3b5c2b82a71fb1048", + "s": "008ad41af7ba19f49b7c67db650694371a0f91a652adf4149bd3920c6378184484", + "id": 0 + }, + "comment": "u2 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 72, + "publicKeyUncompressed": "04eb8b7af0d3ee3ddf9502f40f41cc44ec8068320451c462bca4e69bf219d6e00aad16a578961350f0c0b06a883fe3627f537e6659643b7272f466e6c15820f2c1", + "publicKeyCompressed": "03eb8b7af0d3ee3ddf9502f40f41cc44ec8068320451c462bca4e69bf219d6e00a", + "msg": "5465737422", + "sig": { + "r": "5a8a266f7d8aee338538cac32177b3df76a83e7a36a5f5019bde5745252ffb44", + "s": "43eceb926235d361e7f14aaf7c120de3ea9cef86aa8e8178bb55ed9635e4ef64", + "id": 0 + }, + "comment": "u1 = u2 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 73, + "publicKeyUncompressed": "04c8e4aaf26340ef2cd67a02f10765b5085b5d68acba63b4a54b86bc0aef5417edecd8f0f7ac78c65741b9ff9451df82d44a74f45d5ccfaf0475d67c53f9576db2", + "publicKeyCompressed": "02c8e4aaf26340ef2cd67a02f10765b5085b5d68acba63b4a54b86bc0aef5417ed", + "msg": "5465737420", + "sig": { + "r": "00d7e44235059ff6ff53f4253ddb243eea241e5131a266c7be7e0ffe6048674706", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "A = B", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 74, + "publicKeyUncompressed": "04464dc3db8bad6efe4d74f9cbd08e0a39d3a530672533300f089dd9a86e69e5b142b490cb7e7d92116f02ce52301c7116d3ef48bb079e2063d2da1d1e078f7857", + "publicKeyCompressed": "03464dc3db8bad6efe4d74f9cbd08e0a39d3a530672533300f089dd9a86e69e5b1", + "msg": "5465737420", + "sig": { + "r": "57d14f5026ecfce0a0fbbbbf858e47cb35198a810edfa2a4245f85ef788b0314", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 75, + "publicKeyUncompressed": "04d0b12f3e437363d123ae65fb1b189b99d0700db4f79ea6fd7709cd73de19f11230f2cba814652a08e2830e8613874c4456670cd2ece3542dc5d230d14e4c096e", + "publicKeyCompressed": "02d0b12f3e437363d123ae65fb1b189b99d0700db4f79ea6fd7709cd73de19f112", + "msg": "5465737420", + "sig": { + "r": "48ae535fcf18f02a1fb64256845ed8e019d11c267cf17c4486f3644b82516f2e", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 76, + "publicKeyUncompressed": "044c78753d5d8fc35e6b85ca7f1c018f8b08dc36900b5eaf851c202415b76306905771aae5ccae804e66268536e1397e83d84253b1ee7fe6c3b69177ee3c62d077", + "publicKeyCompressed": "034c78753d5d8fc35e6b85ca7f1c018f8b08dc36900b5eaf851c202415b7630690", + "msg": "5465737420", + "sig": { + "r": "00e4403b16fb0674e83ad503c19f63672a166d48ced83c0f78e36e0d6dfad42805", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B: small x coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 77, + "publicKeyUncompressed": "0481dec1382315bfafb7c379657babfcd5d69362b2d65c42fbb1339dce133d9f76b457f30dc3b420638730d987810d694aacde6f9036295ea3cea47ccf09a49861", + "publicKeyCompressed": "0381dec1382315bfafb7c379657babfcd5d69362b2d65c42fbb1339dce133d9f76", + "msg": "5465737420", + "sig": { + "r": "5afbf23c7699fecdc6151c421b05c38fac15f74c64d2c872c65e955f969c6e12", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 0 + }, + "comment": "B: small x coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 78, + "publicKeyUncompressed": "04285d8e910a8df2353022ab96e36981b8e65d935298f5609920a0ca35d556865cc2f5c4beb6b4c3b5d2a7eb38cbd1c8bdbe7b69bdf70f27e9e528890984a05299", + "publicKeyCompressed": "03285d8e910a8df2353022ab96e36981b8e65d935298f5609920a0ca35d556865c", + "msg": "5465737420", + "sig": { + "r": "00d022d1e94329cd44d7a18377e1d56bde93572f6c11822c2b692f65a1b2b0de33", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 0 + }, + "comment": "B: large x-coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 79, + "publicKeyUncompressed": "04141783ec06e48fcb46485e3b4e7bf0431a8e3c63b9690e0757c177a6bf848c660f5401e31ab2c3964e7edcb1adf9338927623a4e11e88eab464c9018d42f9502", + "publicKeyCompressed": "02141783ec06e48fcb46485e3b4e7bf0431a8e3c63b9690e0757c177a6bf848c66", + "msg": "5465737420", + "sig": { + "r": "00aadf944ce0d6fd6a7967f920babe97da3eb81fd469e7e56136028e3e9eb04fd1", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 0 + }, + "comment": "B: x-coordinate close to p", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 80, + "publicKeyUncompressed": "04ae3be508ac7d61b4517be9640020d64d761f9adfee7493401f1cd7fd621ba0d55f757f75831e7e9cc247cc053f31c6bd8ad58ec9b43689c79c97a0125f41b3d2", + "publicKeyCompressed": "02ae3be508ac7d61b4517be9640020d64d761f9adfee7493401f1cd7fd621ba0d5", + "msg": "5465737420", + "sig": { + "r": "00a3561db55be9206b9483c3c9dc7873c4a6c759f5725e745de6336b5a64dab412", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B: x-coordinate < 2**255", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 81, + "publicKeyUncompressed": "0487ab6ee91da4a954e167d280a100b0da217b7b19d9d958a4590b522d88104711f47a01ac3f9d0c7253ad1e39ee973cab0634544c3e9209feb4d8881556446153", + "publicKeyCompressed": "0387ab6ee91da4a954e167d280a100b0da217b7b19d9d958a4590b522d88104711", + "msg": "5465737420", + "sig": { + "r": "68316a85e59282303651b5af78c37ef60de875524570ed6404008df656382fd0", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 0 + }, + "comment": "B: x-coordinate < 2**248", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 82, + "publicKeyUncompressed": "04c68e6feb91ce9b9160c55f6ca255a03c688aaa7feacf771d0712acf393e36b99422126e0090c8ee288ede2a63d9b3c42486a3b0d89399bc19f29b102e12a0704", + "publicKeyCompressed": "02c68e6feb91ce9b9160c55f6ca255a03c688aaa7feacf771d0712acf393e36b99", + "msg": "5465737420", + "sig": { + "r": "00c0184c80542e178ac307eb4a955832952cd7bf7fa08747974be92b617967e5d1", + "s": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "id": 1 + }, + "comment": "A: g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 83, + "publicKeyUncompressed": "0404f0395ea48159e41467933e3e99fcad06faf8ac75465bba114a1d5bbc3d60122e4db505d9acfdc04f9247e2be871b7f2391a4f4333cb7f83dfca487e4b39a74", + "publicKeyCompressed": "0204f0395ea48159e41467933e3e99fcad06faf8ac75465bba114a1d5bbc3d6012", + "msg": "5465737420", + "sig": { + "r": "7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978", + "s": "00eead82f547f58ed95c83a9f7b697587b0bd1753bd2869940966ee5fae81a2bd1", + "id": 1 + }, + "comment": "A = B: g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 84, + "publicKeyUncompressed": "048dad6df7b81c84bfa3d8fa278bf9c4983b57ea38d6b9aeb925641725095fcd5e9efc667be97124419f58448da27c58d13841c08ba75f12ccfc641e29958ffd28", + "publicKeyCompressed": "028dad6df7b81c84bfa3d8fa278bf9c4983b57ea38d6b9aeb925641725095fcd5e", + "msg": "5465737420", + "sig": { + "r": "0985cf6e5a90f03e5488693dd74b2907845b5434df5593aeb9912345a7344bcb", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B; g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 85, + "publicKeyUncompressed": "04f33abfcd04c46d70666386390e29c6c01affde7ce760cad9995c0cd08c42d798dd8c1c1774582dce88d4f614eefe2ec0aea94af7a535f8c98f22ecaddbf3ae02", + "publicKeyCompressed": "02f33abfcd04c46d70666386390e29c6c01affde7ce760cad9995c0cd08c42d798", + "msg": "5465737420", + "sig": { + "r": "00b2509e6211892906ddf5c8433d39eae66fb59a6b6250d083e8e911db6f3747f2", + "s": "11527d09b80a7127a37c56084968a784b1158571d49105445d4ae4c81448f980", + "id": 0 + }, + "comment": "A: -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 86, + "publicKeyUncompressed": "0404f0395ea48159e41467933e3e99fcad06faf8ac75465bba114a1d5bbc3d60122e4db505d9acfdc04f9247e2be871b7f2391a4f4333cb7f83dfca487e4b39a74", + "publicKeyCompressed": "0204f0395ea48159e41467933e3e99fcad06faf8ac75465bba114a1d5bbc3d6012", + "msg": "5465737420", + "sig": { + "r": "7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978", + "s": "11527d09b80a7127a37c56084968a784b1158571d49105445d4ae4c81448f980", + "id": 0 + }, + "comment": "A = B: -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 87, + "publicKeyUncompressed": "04f73e577649f69c6268fc8e42b0249ca2c89b08b1a60a1c22acb7c8b666f108d72c7c99a1c4176d40fab3b17d49f84f83a3ba25cf596e043af802fc59c5db6704", + "publicKeyCompressed": "02f73e577649f69c6268fc8e42b0249ca2c89b08b1a60a1c22acb7c8b666f108d7", + "msg": "5465737420", + "sig": { + "r": "00dddd63df54915edab89d853669776af1210f3ae694c8a9dc8ef20a688c3edf86", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B; -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 88, + "publicKeyUncompressed": "04982c472667bbeca5c68d6b06a8cd96b64eb8dbb03a6aa5b011f9f0233a5075dd7aa439fe9f82421e2c4a0754471fe165e0b46b549044e9bcd6b91be40d7cb7ff", + "publicKeyCompressed": "03982c472667bbeca5c68d6b06a8cd96b64eb8dbb03a6aa5b011f9f0233a5075dd", + "msg": "5465737420", + "sig": { + "r": "6d83b811d0272c3185731bcccb73840f714f19d2c60393ef9b2f7c2aaba0a50d", + "s": "00f756c17a23fac76d2e41d4fbdb4bac3d645c37f4bccf1be2c514585ef23ea891", + "id": 0 + }, + "comment": "A: 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 89, + "publicKeyUncompressed": "047c75c7b5a6fb35c13015cf98ca42050fb0884d7eb986e0f0db2922c06b02d7e2534b01ce3f58232ed7381ee7d4307acfd82a3d6f40207d37478e3b2696bce87d", + "publicKeyCompressed": "037c75c7b5a6fb35c13015cf98ca42050fb0884d7eb986e0f0db2922c06b02d7e2", + "msg": "5465737420", + "sig": { + "r": "00e2534a3532d08fbba02dde659ee62bd0031fe2db785596ef509302446b030852", + "s": "00f756c17a23fac76d2e41d4fbdb4bac3d645c37f4bccf1be2c514585ef23ea891", + "id": 0 + }, + "comment": "A = B: 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 90, + "publicKeyUncompressed": "042b6fb48848fed520c192929bee5da69962decc1c33661417e72c02e004c0931258d9ed0f8cb6e431cb293686b8eb7f15ead3a8e1347540487c9d5863757b358f", + "publicKeyCompressed": "032b6fb48848fed520c192929bee5da69962decc1c33661417e72c02e004c09312", + "msg": "5465737420", + "sig": { + "r": "00953c08269f92f17ab80478c2beea2cde894869e1e349c1e32462effeda72a6b6", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 0 + }, + "comment": "B; 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 91, + "publicKeyUncompressed": "0484fff67362913b71beb3deb0bc88b560d194328f326b13bfaf2f4ff5acdc1683e3466a8d33c307124ab9f37882ba72d90243ed3fcc88d2b60c825b1ae0e9fda0", + "publicKeyCompressed": "0284fff67362913b71beb3deb0bc88b560d194328f326b13bfaf2f4ff5acdc1683", + "msg": "5465737420", + "sig": { + "r": "77bc3055fa00efc35c2fb17316bcaa23fd5ad6f2f052b7721183d4094eee8699", + "s": "00fbab60bc91fd63b71720ea7deda5d61e90a1995131f35d33dc671190f750e6f1", + "id": 0 + }, + "comment": "A: 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 92, + "publicKeyUncompressed": "04ec576f26d876df379dbf01522b99847b44d3321f407576314522cd1ee42e678020f98c7fa012cbbc8399670add2f08ec034c8c1808852b3bf4204690c0db23d5", + "publicKeyCompressed": "03ec576f26d876df379dbf01522b99847b44d3321f407576314522cd1ee42e6780", + "msg": "5465737420", + "sig": { + "r": "62d9779dbee9b0534042742d3ab54cadc1d238980fce97dbb4dd9dc1db6fb393", + "s": "00fbab60bc91fd63b71720ea7deda5d61e90a1995131f35d33dc671190f750e6f1", + "id": 0 + }, + "comment": "A = B: 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 93, + "publicKeyUncompressed": "0480e7f7258b0e45f04469980dbef55353b28b773799063307f96ee72335bc59ea24c3ad65795dfcd61bd6210db34392963917345239100fc6d039b07ed1a305bc", + "publicKeyCompressed": "0280e7f7258b0e45f04469980dbef55353b28b773799063307f96ee72335bc59ea", + "msg": "5465737420", + "sig": { + "r": "64d15bdda3c85c6baffc72871949d9633ee5f4555688beac9b33d60242405eea", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B; 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 94, + "publicKeyUncompressed": "04031e495c5e39bda5bc1b2a4f5b66efea83b581628a442c0f41538f84e62afd4b3e1a0e77dcca249f21c1422b3861adc01e19e9ae8b5cb3ed3bdb1b6b9b53641a", + "publicKeyCompressed": "02031e495c5e39bda5bc1b2a4f5b66efea83b581628a442c0f41538f84e62afd4b", + "msg": "5465737420", + "sig": { + "r": "00ed7a264a8502592ea677623a6ac8e751611a528b104950d8b5f5df6a44e035bb", + "s": "22a4fa137014e24f46f8ac1092d14f09622b0ae3a9220a88ba95c9902891f300", + "id": 1 + }, + "comment": "A: g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 95, + "publicKeyUncompressed": "047fbf4a4edd2dda34cca3c3a2410ce1b5028faf2c758dff3ae887496d8c0e5d688b046d14da3a9bcc01c9b7029a3fe7c1244e09f982df85c249c49d38916f5b43", + "publicKeyCompressed": "037fbf4a4edd2dda34cca3c3a2410ce1b5028faf2c758dff3ae887496d8c0e5d68", + "msg": "5465737420", + "sig": { + "r": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "s": "22a4fa137014e24f46f8ac1092d14f09622b0ae3a9220a88ba95c9902891f300", + "id": 0 + }, + "comment": "A = B: g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 96, + "publicKeyUncompressed": "04b01af7be1fd695c926d37baef448963b4ec07b8cca47206bb204b85e159cbbf7f4a336037728dbe85ed41b247307f80857f26e5759c2a41af93af0ee7f228856", + "publicKeyCompressed": "02b01af7be1fd695c926d37baef448963b4ec07b8cca47206bb204b85e159cbbf7", + "msg": "5465737420", + "sig": { + "r": "52cdd8d0c6fe33cbd7fd39b2afa4a4163cd8d32b4c4a4d3fb5aedeff7c89845c", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B; g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 97, + "publicKeyUncompressed": "04121bcf2bfb364a9d9c61feea715490531c734a1f425ef1abd45c6b6234dd20b38468f22e9e2cd3d7942fd1ca8e77e5a7d907e3919852eefdd29fdbd14e85666e", + "publicKeyCompressed": "02121bcf2bfb364a9d9c61feea715490531c734a1f425ef1abd45c6b6234dd20b3", + "msg": "5465737420", + "sig": { + "r": "1096696c9b44f12e2fa18b98fd4f05250643d0a9a7e5ba5267fdbee78b93b597", + "s": "00dd5b05eb8feb1db1b90753ef6d2eb0f65abbefc9fdf593fc39240132d3d13251", + "id": 0 + }, + "comment": "A: g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 98, + "publicKeyUncompressed": "047fbf4a4edd2dda34cca3c3a2410ce1b5028faf2c758dff3ae887496d8c0e5d688b046d14da3a9bcc01c9b7029a3fe7c1244e09f982df85c249c49d38916f5b43", + "publicKeyCompressed": "037fbf4a4edd2dda34cca3c3a2410ce1b5028faf2c758dff3ae887496d8c0e5d68", + "msg": "5465737420", + "sig": { + "r": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "s": "00dd5b05eb8feb1db1b90753ef6d2eb0f65abbefc9fdf593fc39240132d3d13251", + "id": 1 + }, + "comment": "A = B: g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 99, + "publicKeyUncompressed": "0472fe385eff01bb0746847f86fdb2c238a7b10bbb49f9c93feeb5312b41bef9bb6ab7d8fcbb4b5b9ec289bd7e1859bb748e5386fb20b0fc24ecc6b2408e46fcfa", + "publicKeyCompressed": "0272fe385eff01bb0746847f86fdb2c238a7b10bbb49f9c93feeb5312b41bef9bb", + "msg": "5465737420", + "sig": { + "r": "40bfe5cad72e741c7ab53bc449bea32f9b9cbb49fd864ac694e91c6e758f63e1", + "s": "77b93a89fba7d9a433342caeab7e5a5cf320350209a7c18cb0e2fd5b688f14bc", + "id": 1 + }, + "comment": "B; g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 100, + "publicKeyUncompressed": "04a99a0e7399ca1d7d4017233571381d1d6e13b1075fdcd538ea98df9f62bf9b5acf75c7dad906464ff55b214928a382fae56c5acd6bea2bb17bc416062fad321a", + "publicKeyCompressed": "02a99a0e7399ca1d7d4017233571381d1d6e13b1075fdcd538ea98df9f62bf9b5a", + "msg": "54657374", + "sig": { + "r": "61c1d7309f79d427e19f7d0df4a86da27a66132cbc68f9994f53d94fd18a8f87", + "s": "00839603a42b9f57947b1a6bc9a36c112ca6977ac6b6d217b1f6dcae4c5aef9ae5", + "id": 0 + }, + "comment": "point at infinity during verify (invalid signature)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 101, + "publicKeyUncompressed": "04311641197a36d7b4592ac22cfa88e4d0921b5e396c5fa8fc1cad922925133bf95d7590e835d33dd16ea42c5f03b0257eeed3443fd942498af7bd5453dbd449b7", + "publicKeyCompressed": "03311641197a36d7b4592ac22cfa88e4d0921b5e396c5fa8fc1cad922925133bf9", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc", + "s": "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 102, + "publicKeyUncompressed": "04554efa11c5b704a41bff093a68bee858b74a1cf621b2fadfdee54681193ae3c7f3bc958bda487b650f0e5ef4991953cf628edf744d8920527845928ca05d519c", + "publicKeyCompressed": "02554efa11c5b704a41bff093a68bee858b74a1cf621b2fadfdee54681193ae3c7", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000000000004319055258e8617b0c46353d039cdaac", + "s": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 103, + "publicKeyUncompressed": "04e16cf316cae74dc2e7e81d5228e2e68ceec3a7c498304a95214943683650a36a24e94b9798da6657a705b19af97eab9026a383cdfc7be603c259630be8b3f3ad", + "publicKeyCompressed": "03e16cf316cae74dc2e7e81d5228e2e68ceec3a7c498304a95214943683650a36a", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000000000004319055258e8617b0c46353d039cdaaf", + "s": "010000000000000000000000000000000000000000000000000000000000000000", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 104, + "publicKeyUncompressed": "0445a318af55d481c4e6a7ef104c9579b8044a0636d3687713d7a9eeaf6ed69bd7de4efe2f6d0fc8ac63fbf62672d865da35c8e961e9212f50ba0cfaa11812e89d", + "publicKeyCompressed": "0345a318af55d481c4e6a7ef104c9579b8044a0636d3687713d7a9eeaf6ed69bd7", + "msg": "54657374", + "sig": { + "r": "05", + "s": "01", + "id": 0 + }, + "comment": "point at infinity during verify (invalid signature)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 105, + "publicKeyUncompressed": "04f0479f65d30010fbe350f61420c9bbc3b02676f1a0e616ea65353404b6f5db9893636fe97bfcd1d72e221f541568cdbb6004e81f6decfb2f8446712edd528c85", + "publicKeyCompressed": "03f0479f65d30010fbe350f61420c9bbc3b02676f1a0e616ea65353404b6f5db98", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "s": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 106, + "publicKeyUncompressed": "04f65cfbd616cd929d86306118d50084493ab96f388871f720f5b8d857dfaae581059e5213e90da92251c07fa286c2a2723101c29097bad86a3820d96bebc03baa", + "publicKeyCompressed": "02f65cfbd616cd929d86306118d50084493ab96f388871f720f5b8d857dfaae581", + "msg": "54657374", + "sig": { + "r": "2042a0b0ee3263284e3d1a0fb131d16d6a6a14f2cf35430027ed822791b9ba83", + "s": "00ffffffff3819c29161219a96f640bbab98477168beb0d5b84f50821e66bbfb03", + "id": 0 + }, + "comment": "s too large (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 107, + "publicKeyUncompressed": "04104d9f6a73b38b72aa260767a61f27ad42d3a6bc1d096d411aa0e8f2826ba02f3c23a5c9eeb742187c0c6e8a06673b0b01d8241d9ef8c5052210b931649c0ccb", + "publicKeyCompressed": "03104d9f6a73b38b72aa260767a61f27ad42d3a6bc1d096d411aa0e8f2826ba02f", + "msg": "54657374", + "sig": { + "r": "2042a0b0ee3263284e3d1a0fb131d16d6a6a14f2cf35430027ed822791b9ba83", + "s": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "id": 0 + }, + "comment": "s = n+1 (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 108, + "publicKeyUncompressed": "048d347ca6837d5fe368ffcd565523afd34a58e77373ee91e5517a0121ea2eaa72c04c280ac42691e5ba05c18c7940804c48cf20f083039a8bd694a03fcd4c8d93", + "publicKeyCompressed": "038d347ca6837d5fe368ffcd565523afd34a58e77373ee91e5517a0121ea2eaa72", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632556", + "s": "783e27b1db66d4f1a115a611bdb91e5f8af5312a5fce5fd23b5ff29680bc1391", + "id": 0 + }, + "comment": "r = n+{Rlow[0]} (Could not recover R)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 109, + "publicKeyUncompressed": "04b6a7d5f2546e772b87f086146a7c23982d458ff5b4eb7997bc65dfaf7ecf1929ded5ca88daaad96773fb880aa784448cbf262f267193c385489e5d9b3b68293e", + "publicKeyCompressed": "02b6a7d5f2546e772b87f086146a7c23982d458ff5b4eb7997bc65dfaf7ecf1929", + "msg": "54657374", + "sig": { + "r": "2042a0b0ee3263284e3d1a0fb131d16d6a6a14f2cf35430027ed822791b9ba83", + "s": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 0 + }, + "comment": "s = 2**256-1 (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 110, + "publicKeyUncompressed": "04cf296889966b477c7a3c69db76145525780f2816ae4c32ff1f4d66987ebd4f44c5c55f5050337521fd7f2d2bb4a093785b5e35995d8afbd2588acda0247d36ff", + "publicKeyCompressed": "03cf296889966b477c7a3c69db76145525780f2816ae4c32ff1f4d66987ebd4f44", + "msg": "68656c6c6f", + "sig": { + "r": "0081bfb55b010b1bdf08b8d9d8590087aa278e28febff3b05632eeff09011c5579", + "s": "6eea692963f0478703dc1dbfffbf68c8037bead20a17cc5e725be35964121736", + "id": 0 + }, + "comment": "R: x2=0 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 111, + "publicKeyUncompressed": "045baa516db161001497d57cc7f9d832ac24764eae2b52100ee38bab25952297a42516f984949df3bcd6166a1fd77b6eda4669d58d2f0c84e04a6296486d67d1b2", + "publicKeyCompressed": "025baa516db161001497d57cc7f9d832ac24764eae2b52100ee38bab25952297a4", + "msg": "68656c6c6f", + "sig": { + "r": "00e3f4bd402343936c2bff08e7430a86ad85b72bedf0ec53f385093a7e1c55d096", + "s": "00a2077c5299ad49b45c113c8d7a91ec9ba90df5d491b4773a4937e914d11b23a5", + "id": 0 + }, + "comment": "R: y2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 112, + "publicKeyUncompressed": "0400e2cad4402da4555b2af202c43388dfd87aa2e1bcbd8633cf7e513c878d0b26ac747a778ca75be8d26f6374b767887e00ce76b7a3aedc5fd5572137c8dd6a1e", + "publicKeyCompressed": "0200e2cad4402da4555b2af202c43388dfd87aa2e1bcbd8633cf7e513c878d0b26", + "msg": "68656c6c6f", + "sig": { + "r": "3477806617481c3944ea395d71a15a7b95daf52825f2b26ca73d89a7f0d63cb8", + "s": "00ce2b52b4dbc0c232d4a32108accfb3c1bb08107c60d8f02363d2315e2eefb4ca", + "id": 0 + }, + "comment": "R: y2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 113, + "publicKeyUncompressed": "04700411ac0f923c1219137e68e48e33a055e7d2cc6dba2143cf650250b8c05389a1763c033ccbfe4bc1f8d99d91d313c265b81ec991af83114e3335f02caf1901", + "publicKeyCompressed": "03700411ac0f923c1219137e68e48e33a055e7d2cc6dba2143cf650250b8c05389", + "msg": "68656c6c6f", + "sig": { + "r": "45170061e1e3a4aacaecdf24c4943b5e45549b20c00135e6cb34aed92cf8b728", + "s": "00c6d1540ad3a0d8d46a2bdda04e881ef4af4211bd7ad80cc8bb3863cc4e843810", + "id": 0 + }, + "comment": "R: y2=-1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 114, + "publicKeyUncompressed": "04c365fde6c85eb44dd0f89d6494fde26dd55dcf23b0bdce049314c94e560ec60113ec9ce85c2da5855bed08f06cbe8bb71cb2fc768c81c4ffd9e1dd7e2b3eede8", + "publicKeyCompressed": "02c365fde6c85eb44dd0f89d6494fde26dd55dcf23b0bdce049314c94e560ec601", + "msg": "68656c6c6f", + "sig": { + "r": "00d9ef981511b93f7adc6ebdf36a8f4b823aa6090057ad3738fe18a42e46dfe12c", + "s": "0a6960303d668ebc05d1aa4e40bee167bdff34711aec2916cdcef176affa9125", + "id": 0 + }, + "comment": "R: y2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 115, + "publicKeyUncompressed": "04eb9f2e67b5bee346b0c438155eb546cc77fe493462ef21e75debd91ea16fa68fa1d0970b285dceeb706ed9f7b022c5ac267fcd8c0c9e76a55bb725be0aa851c3", + "publicKeyCompressed": "03eb9f2e67b5bee346b0c438155eb546cc77fe493462ef21e75debd91ea16fa68f", + "msg": "68656c6c6f", + "sig": { + "r": "00af8bbdfe8cdd5577acbf345b543d28cf402f4e94d3865b97ea0787f2d3aa5d22", + "s": "008f899903f5b953636ad0c6eadb8e483e2891000625bfb0b8dd8ec1fe1c3d9b16", + "id": 0 + }, + "comment": "R: w=3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 116, + "publicKeyUncompressed": "04d2dff3e26456e0016b3da386ccc584fe9ce2abfb89c8e0fae0f01c5247b2995507721d3ab6945e969669b58a7b6c412005fe6eaa1c8f0da5a618581f4ffe712a", + "publicKeyCompressed": "02d2dff3e26456e0016b3da386ccc584fe9ce2abfb89c8e0fae0f01c5247b29955", + "msg": "68656c6c6f", + "sig": { + "r": "507442007322aa895340cba4abc2d730bfd0b16c2c79a46815f8780d2c55a2dd", + "s": "00d1fb497ebd66ab23afa7abdfa51cdc2bb40a722b8c82979b237539f9d321d406", + "id": 0 + }, + "comment": "R: w=3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 117, + "publicKeyUncompressed": "04c42d28ad6b94db29e0e111fb65490d154010cf57ccade316033db74150c873b303fac3dfdd9aeb74fa065e4df38a81e94ffe5a89b5a422bcb600b2f7d3af3e5b", + "publicKeyCompressed": "03c42d28ad6b94db29e0e111fb65490d154010cf57ccade316033db74150c873b3", + "msg": "68656c6c6f", + "sig": { + "r": "00de16fd61a828098877199f6b9691ac16b068ea147264d32ecebf8afb1cee87c6", + "s": "00b6d4278ec5a783688ef0dc8b40483307f98bc1babadcecfbd508f41d45d1e8e8", + "id": 0 + }, + "comment": "R: b=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 118, + "publicKeyUncompressed": "049976f021fb35ce0b01b556da77fc92e88148419fb44e52cf000bcc3eeec06fb721ca31be2aec898afeee54740e7a09a0ad88a3fca33d2c8216f276bb751373e1", + "publicKeyCompressed": "039976f021fb35ce0b01b556da77fc92e88148419fb44e52cf000bcc3eeec06fb7", + "msg": "68656c6c6f", + "sig": { + "r": "15802d3d7aec18b1830f8b59148e86a2e59edfda163b8823e320d6c65c8d3386", + "s": "486fcffb06ae7fbbb3c56a1a0d5a4d222d7d2bb6bcaed9bcd83efc9d19800358", + "id": 0 + }, + "comment": "R: h=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 119, + "publicKeyUncompressed": "04af3583dbce72eae4356f24013045bd6569705db92589912cc6362495ee786d0c3afe89882c10d78753d633e99e0559e592f46da3ac6d3754d581ca2f7d39b4e5", + "publicKeyCompressed": "03af3583dbce72eae4356f24013045bd6569705db92589912cc6362495ee786d0c", + "msg": "68656c6c6f", + "sig": { + "r": "00851eb1b8699d1cc01c6b6048139797dab3981c924f9ef81bd1f464c3182c8709", + "s": "20813f0131bb98d224a5aefbb5246c1ffa765786f7a6fafaf4ad11bda3b9137e", + "id": 0 + }, + "comment": "R: h=-1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 120, + "publicKeyUncompressed": "043e020ea6063f22e50c04a7b27aeb5e90ebfa4c564ce370d6c39367205d565f19911cb0cb2eed4968d5bdbc06293679b2b49ea57081c8357307106e987d704553", + "publicKeyCompressed": "033e020ea6063f22e50c04a7b27aeb5e90ebfa4c564ce370d6c39367205d565f19", + "msg": "68656c6c6f", + "sig": { + "r": "00be2d2738a9b2ccddbdc0954d6e990d23ee62920b2e6a49d3125bc3002dd07ffd", + "s": "00b2d82165f6887256b82a7c85608dfb3c59631b6556aa5a9cfe9c4b5e2e9288f3", + "id": 0 + }, + "comment": "R: s**2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 121, + "publicKeyUncompressed": "045715840ef4a5d697de8cc9b31b8503dc0576c1eea217c20c3a557ce34bdf61b1b54891293c6135bf426e51ad57ea7c35e4f230dacfd0779e869d3ed159270d67", + "publicKeyCompressed": "035715840ef4a5d697de8cc9b31b8503dc0576c1eea217c20c3a557ce34bdf61b1", + "msg": "68656c6c6f", + "sig": { + "r": "09e78d4ef60d05f750f6636209092bc43cbdd6b47e11a9de20a9feb2a50bb96c", + "s": "00f4889ec371c54ef31cf815338b2ebf847da0618ee3d4bd9f7b00f69caf8f98aa", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 122, + "publicKeyUncompressed": "0456a29342040e36a4b8431ac59b98d9b8a9d65f4cbc98d8bef80c9736b59560ce1932f6f488010d0345a6c063361e988c811baee576e2751ae92679a147565670", + "publicKeyCompressed": "0256a29342040e36a4b8431ac59b98d9b8a9d65f4cbc98d8bef80c9736b59560ce", + "msg": "68656c6c6f", + "sig": { + "r": "008d0177ebab9c6e9e10db6dd095dbac0d6375e8a97b70f611875d877f0069d2c7", + "s": "451078019ec72b4261d2a232c7e2806f3cc85588aacd319e025965deecb8ab7f", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 123, + "publicKeyUncompressed": "043b584d141e4f9c7ee0a583105e50829bfae9ff26ab28befbc58ae2b77c141c9fcfdebfc2c5d8599887595aa581e003a6d96443bea18cead076390b3f4c790aac", + "publicKeyCompressed": "023b584d141e4f9c7ee0a583105e50829bfae9ff26ab28befbc58ae2b77c141c9f", + "msg": "68656c6c6f", + "sig": { + "r": "6916fac45e568b6b9e2e2ecd611b282e5fcc40a3067d601057f879ce5a8a73cc", + "s": "27ebcbbda29384519badbb642d99e4762232bb1a23a0591683a99f7c53172af3", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 124, + "publicKeyUncompressed": "041dacdb0135e4c9976f1907a08a07456e977501ca1c3139a0d72e492b151b1da3bb07c083fe1b7312aed8ed451acdf10c84652834f2078951382003dc490dcd60", + "publicKeyCompressed": "021dacdb0135e4c9976f1907a08a07456e977501ca1c3139a0d72e492b151b1da3", + "msg": "68656c6c6f", + "sig": { + "r": "00e8f28207e8621cc82d634671493877fea23e3ce7fb73b4e0a6be4d6c7d9f3564", + "s": "00ea653774d237018aa723bcc15f6982199dbeadb596f3f425875075789a62b2af", + "id": 0 + }, + "comment": "R: s**2=2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 125, + "publicKeyUncompressed": "04c44eb8d4e604cd634ceb2795e30d604a233099a0d663ee4daf1f4ed2ce8fc6bd5f100616f683ec89e080bd09a514313fed0edf92ffc9394bb1941985d31b9209", + "publicKeyCompressed": "03c44eb8d4e604cd634ceb2795e30d604a233099a0d663ee4daf1f4ed2ce8fc6bd", + "msg": "68656c6c6f", + "sig": { + "r": "00f6e0274e045257cc028cfe83df31e1678c2c4c0573371c315dbae73fd412d078", + "s": "00f78e2b701901e310d69c6f945e68db5c444e9dc84795096abf1d28e666e73fe9", + "id": 0 + }, + "comment": "R: x3=-3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 126, + "publicKeyUncompressed": "04aee5b9b43deaaaf5f38b749190826bcf0e407d5acdc7b026d6d895930b68e9c3a79962cf80d48cd0a571b035beb3151b53758e537a848e5be21d5e3f1d6bcd1c", + "publicKeyCompressed": "02aee5b9b43deaaaf5f38b749190826bcf0e407d5acdc7b026d6d895930b68e9c3", + "msg": "68656c6c6f", + "sig": { + "r": "100121f1a09443851c9aa2ab6ee6440e2ac5e1be648274bd5d26c12fb3ba3f7f", + "s": "00fedae13f3dde18069d68c6ac93128afd6a6cad3dc46985776a116334d2488072", + "id": 0 + }, + "comment": "R: x3=0 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 127, + "publicKeyUncompressed": "04925a329233f3d46c38d7f87a93c8bcd14c3a07bbd5a403c74462601549f421d2781f85dd250e71bbdd8558cf2014a7ff0b5ff7d6ee8e001ec123021e05652ada", + "publicKeyCompressed": "02925a329233f3d46c38d7f87a93c8bcd14c3a07bbd5a403c74462601549f421d2", + "msg": "68656c6c6f", + "sig": { + "r": "00dca4cf4b841c05e45b3b70f1c6e02a1a03811234c3c044b2928981030bf6d39c", + "s": "563c051976e50c06137e9b67ad1631f6eb2aa9e7db268fb21144852bf9f6a5df", + "id": 0 + }, + "comment": "R: x3=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 128, + "publicKeyUncompressed": "04f8bd6cc89d937affca97aae338a0c3bb4aed9219ab2c21733d78f0a5b25ecde95bcc4dbe0940cd4a8d0c1311211c1025ab84bf0fd1459df6c932a931025ee7f3", + "publicKeyCompressed": "03f8bd6cc89d937affca97aae338a0c3bb4aed9219ab2c21733d78f0a5b25ecde9", + "msg": "68656c6c6f", + "sig": { + "r": "00d006f2785f3e4d6a3e9fee57dc668cf1c48e4a6a69ee72706d0f54075db6d9eb", + "s": "1964e1c2f66c894fa7af49013cc03db15739087981bf82fff391032007187e52", + "id": 0 + }, + "comment": "R: x3=2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 129, + "publicKeyUncompressed": "049f7449c951d1f6ba80bc7aab3dde63e13cac0b9adf257ab8921f8b8c64c3ff72c81bd76498068be99863df7af41c6cc7e1350fab3b984194f709e815c6e19bed", + "publicKeyCompressed": "039f7449c951d1f6ba80bc7aab3dde63e13cac0b9adf257ab8921f8b8c64c3ff72", + "msg": "68656c6c6f", + "sig": { + "r": "45d3fb3ac7aa271f91b234ad1d18ee96d3d7d7654c5a5a4c3166ab50abbf5b30", + "s": "00b7200656c05aca4f776980c47b2ae948dcb67e8f82dac306ce3efe3f8abdfbd4", + "id": 0 + }, + "comment": "R: x3=3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 130, + "publicKeyUncompressed": "044d4f9d7b2e47d160c08eadc9130766defb404ed69ceb904cbca1dd837af92026fda0755f9da6f1c565696e57749e9098ea4716fd5dfb20c3791c2e0bbb7dc92e", + "publicKeyCompressed": "024d4f9d7b2e47d160c08eadc9130766defb404ed69ceb904cbca1dd837af92026", + "msg": "68656c6c6f", + "sig": { + "r": "0092db0aeaaa4ae24b119b2e30f29cb79d836c220e90fbc9031144261ffe75dcd1", + "s": "00e8dcfae19ee5015f393d4ef40e98ec4a4c6645ea1918ad9756d7177d8eaea6a0", + "id": 0 + }, + "comment": "R: z3=-1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 131, + "publicKeyUncompressed": "04ed4fc026c931298b94d8e23798f1494745383d9c4ed79b298b1dbe5e70db5d7ca7ace88569222fe4300b64ff6fd323bd125f3888791c54aa513216d3eec77315", + "publicKeyCompressed": "03ed4fc026c931298b94d8e23798f1494745383d9c4ed79b298b1dbe5e70db5d7c", + "msg": "68656c6c6f", + "sig": { + "r": "00dc64ac26b3cf53362fdac1c0eccd15d50d58bda1a355ad0b732bf99e70532f0c", + "s": "008b78dde28ecd0ed2ea837a68938254abf3fda52396c44a27e3e39885cd751ae7", + "id": 0 + }, + "comment": "R: u1=-3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 132, + "publicKeyUncompressed": "04032702ead24ef7336f56a7e1033f41896f6fa0797c309bafc7052dfed8e30f9ae49bcd1335644d6dee5fead76e3c4bd8fda36cbf29e9edf24ea7b5cf29d422a1", + "publicKeyCompressed": "03032702ead24ef7336f56a7e1033f41896f6fa0797c309bafc7052dfed8e30f9a", + "msg": "68656c6c6f", + "sig": { + "r": "1ad9ee1ebfe0a768960e19421ec32322fef50aaf8eba16b7ad65d99ffb243fc6", + "s": "47f7847dd57aca8cea98ba49056341b019bff301b4048e8d02814932346142fa", + "id": 0 + }, + "comment": "R: u1=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 133, + "publicKeyUncompressed": "0484690f40717a2112dc0d964f2efdef12d80ce5db006a4fc377d04b00320b1003d72771e0624435ba72d69bd10ade673dd89d4b53f0e6fa16c2a7ab05cc3119d6", + "publicKeyCompressed": "0284690f40717a2112dc0d964f2efdef12d80ce5db006a4fc377d04b00320b1003", + "msg": "68656c6c6f", + "sig": { + "r": "1b7672ce8a192d8826af545fe544db7d11c8cd5d379187910e5cbff5b010339a", + "s": "42602bce80e6251d3f788c9c2c5e70d6567b144fb1a242e75257c4ae44cf41d3", + "id": 0 + }, + "comment": "R: u=-2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 134, + "publicKeyUncompressed": "040b841842270a6702cd138a9c65c310944176c7096527e0ea51df6b6095de04e636476d5f4692718dc119e13cf2847245cd712a3ebab0ec73e000e9c45db08294", + "publicKeyCompressed": "020b841842270a6702cd138a9c65c310944176c7096527e0ea51df6b6095de04e6", + "msg": "68656c6c6f", + "sig": { + "r": "00e10df2402d508d573d3ab41b0f3717273c54e7c0b509c33350a9f2a6ec5ba85b", + "s": "00d9c701ff43a8e8a8dd356ba821b29245a5dc329a14103d2e6a007d711a4e053f", + "id": 0 + }, + "comment": "R: u=-2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 135, + "publicKeyUncompressed": "04ac211ecabda3ffd1dce56ae270322e8eaed4b553b87af81f374aec74d44115fd77accda10f4f61a4b2272ba5ce55177e507a6faed86e928e5bf47819f4a05a8c", + "publicKeyCompressed": "02ac211ecabda3ffd1dce56ae270322e8eaed4b553b87af81f374aec74d44115fd", + "msg": "68656c6c6f", + "sig": { + "r": "03a8409c233a9533040ebb555820d443f49813e0f49228e17341ddfd2447e1df", + "s": "00d06337378cf8464a4f74f5e660d38d25e091b19c4132efe30363920cbf8b4007", + "id": 0 + }, + "comment": "R: u=2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 136, + "publicKeyUncompressed": "041f7536c94a3c95542aef13c5976c29507e5f1ee04ab053a1adfecc1e1930d4d0b4c4b7e8e4e8fe609bfb54b82676d77dfbfd70d1748f57441a3a19d2dcfa6fa2", + "publicKeyCompressed": "021f7536c94a3c95542aef13c5976c29507e5f1ee04ab053a1adfecc1e1930d4d0", + "msg": "68656c6c6f", + "sig": { + "r": "008556fdab5268b568871532bb325da41b437caa7e59065f522e31983899870991", + "s": "1f2a18271ea9aec54cc4df2fa4c92fcd4bc603b219f69ccc0ec68d1faa759bb7", + "id": 0 + }, + "comment": "R: v**2=-3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 137, + "publicKeyUncompressed": "0457812d96185d8868dd18cfe2b756685fcca0b9e05dbfe0574a9be5707122c90ae4cf7ecb2a661caec7d8ac950be2eb73d21aaaee96341e361ed7b01136a2ed3a", + "publicKeyCompressed": "0257812d96185d8868dd18cfe2b756685fcca0b9e05dbfe0574a9be5707122c90a", + "msg": "68656c6c6f", + "sig": { + "r": "594b38e571e1e6bc11306b17d76d3c8b7a8c650d12fed44dad531a1c3e08e9b9", + "s": "6fee183bf10e59510cc72d5fa065664df08cbae726ea28d5d4dcdd744555f292", + "id": 0 + }, + "comment": "R: v**2=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 138, + "publicKeyUncompressed": "0434d58edfffc190517a17010b84a0f6b0181a40d4aeefcd95883bc1cc9b8877b449a26d33b549ab9060b779f65824ab32a7f52db2224c44f37dbc6e44bcb0f47c", + "publicKeyCompressed": "0234d58edfffc190517a17010b84a0f6b0181a40d4aeefcd95883bc1cc9b8877b4", + "msg": "68656c6c6f", + "sig": { + "r": "00f3c0b02574fed1d737abe3eaf06cbce1294475024750dd474b1722f815ecde1f", + "s": "00feafc2b7a3a9615396cee22b552f0f3f84658dc6543c4227b0b94cbc8724a437", + "id": 0 + }, + "comment": "R: v**2=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 139, + "publicKeyUncompressed": "04ce1dad27c755715d075d4e7c971d24f7d1ca0d53fc8219c629f4591f17ae1ea9e49e596367d4cc904e33bc027e9588e7d984c299b238514e12dea14197c495a9", + "publicKeyCompressed": "03ce1dad27c755715d075d4e7c971d24f7d1ca0d53fc8219c629f4591f17ae1ea9", + "msg": "68656c6c6f", + "sig": { + "r": "4c52f8345031965608a68c513a9a99c7077e0161bd1a1e0da360b233312a9cdf", + "s": "00f3f0a8d0b865933c0e8f4d2a8eb99a5e1e743c2e8ac73c5852893a02f9a550cb", + "id": 0 + }, + "comment": "R: v**2=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 140, + "publicKeyUncompressed": "04edc1a1299c6a3fe814b9f116fe7c70c31cb391399849a15792a7db0ea6b5c1a9cf940fcc8a53cc517b751023857d6b53430a5d0378a6f746d7689cf888f0ce65", + "publicKeyCompressed": "03edc1a1299c6a3fe814b9f116fe7c70c31cb391399849a15792a7db0ea6b5c1a9", + "msg": "68656c6c6f", + "sig": { + "r": "02495ac9f43e45aae30d3366e351cc08828cf3e11cc3b7209fbd1730c4a14f4e", + "s": "4fb0fb50033e000e23b622e19b1b9b8f823e26cd24b7ab2d64abe83bfea95508", + "id": 0 + }, + "comment": "R: x2=0 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 141, + "publicKeyUncompressed": "044a652eabc687ef8cc26eac4f4949cb495ed13a3285b94447d8e975a719cf998cbbb742f5bdfa9d2491efdbd40c253fb6e79d0c198402560fa76a3c5fa933b097", + "publicKeyCompressed": "034a652eabc687ef8cc26eac4f4949cb495ed13a3285b94447d8e975a719cf998c", + "msg": "68656c6c6f", + "sig": { + "r": "009e6c031feed8a8e8eb3d04de0b8d62c268d61131d225aa3420141aa17dd8d135", + "s": "496d18cb28a2c7c8facb4414f893aac5981d3df725604a0c5212ca2d77b9b2ba", + "id": 0 + }, + "comment": "R: y2=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 142, + "publicKeyUncompressed": "046a9d2ef155b347b18125a260e527804cb9e13eef0a6e878d6b509b53b08da66969f3f026c8073e184fa384d4583b661f2b5f4350129e8ff6fd8287906d8b0e57", + "publicKeyCompressed": "036a9d2ef155b347b18125a260e527804cb9e13eef0a6e878d6b509b53b08da669", + "msg": "68656c6c6f", + "sig": { + "r": "00d3e9423ae5ab78c1c32dc26b6c5c6762fb03859988f18aa8b655055d4e94b182", + "s": "00cb0d18f480a897ac729deb4147fa1865efccf1bdd6b20dc8be74f6158e522a07", + "id": 0 + }, + "comment": "R: y2=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 143, + "publicKeyUncompressed": "0427a619dde54cabbc1b061e61adc6e2d99b22b9e24bb95e95435bb2d15c828dc964b9f0c1be75184cfe4936b299062e58dbd935e0c34a16997955dbee5b170749", + "publicKeyCompressed": "0327a619dde54cabbc1b061e61adc6e2d99b22b9e24bb95e95435bb2d15c828dc9", + "msg": "68656c6c6f", + "sig": { + "r": "61f127502b1792c64f08ce2fe482b97fb5c96fb27d11bad0c43d6bec71ede3f5", + "s": "008c668944533b871207e5829a6928c9b1fd901f6cca29f64dd5b7eab1da8e7ab8", + "id": 0 + }, + "comment": "R: y2=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 144, + "publicKeyUncompressed": "04995201389ede8b29c537eee68a4b17d4e721d27b7b41e7f697cd6f80cad42b959a1d3f8fd4ee2c4c19c71db3f5f449b38caf672ae0ce3f37ffbb981b5d969d06", + "publicKeyCompressed": "02995201389ede8b29c537eee68a4b17d4e721d27b7b41e7f697cd6f80cad42b95", + "msg": "68656c6c6f", + "sig": { + "r": "4ccc7675f1f08200ae2b3e96293774621f387720b842f3261df37e6c32a5879b", + "s": "00bdababf0f6dc8587198b1f4c3ff9172e191e6311ca861b3e4599f7782ad6d937", + "id": 0 + }, + "comment": "R: y2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 145, + "publicKeyUncompressed": "04836e2b4bd2d9ccdab5a7d06c84fdd93f1565e3f12275dee3f7886aafed643d1e216db969528e6aa5b626baeffe8a4f9e49b0fdbfb69fc6f94df5a888d211c05c", + "publicKeyCompressed": "02836e2b4bd2d9ccdab5a7d06c84fdd93f1565e3f12275dee3f7886aafed643d1e", + "msg": "68656c6c6f", + "sig": { + "r": "0096d990ec5473803f3af2c85fa52ceeac3724096d14d5d6afe96148b0f01fa4d3", + "s": "660dd07ce84324defb63672b6b505ec28839db3b31bda4f235ead769e45af2fe", + "id": 0 + }, + "comment": "R: y2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 146, + "publicKeyUncompressed": "049b9d0724c2bdce3a81c9b2eb80dca561227e757d0edd0fc4f71e4c85b0052e50def2d276df6f041380c1702bcee1de3ba0a24c1493ce2cef2fab672983fce6a4", + "publicKeyCompressed": "029b9d0724c2bdce3a81c9b2eb80dca561227e757d0edd0fc4f71e4c85b0052e50", + "msg": "68656c6c6f", + "sig": { + "r": "41983b5e4fd04fdd5342c3f6d95edaebf1692eda9463ef48de63a1f4e009768e", + "s": "1d0889daaa56f7a7040b0e5b8198030cf0a498ea16ac03e4285332bac20f4c68", + "id": 0 + }, + "comment": "R: y2=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 147, + "publicKeyUncompressed": "040f38fb9cde7df71f29a761b42ae2a467b762545ae5aebe93f583dd35418de1f14f34542d116298864abd3c14010ea39b27f6824673c0812ba718288fa8c654ab", + "publicKeyCompressed": "030f38fb9cde7df71f29a761b42ae2a467b762545ae5aebe93f583dd35418de1f1", + "msg": "68656c6c6f", + "sig": { + "r": "00afb102393ce571d0863e6c5053baf9dfd879b7f1a2f97dd6b7651e099a4a407a", + "s": "0c2581029e1f46f0ccc231e1ac5f3c3c6f9492b92d0a4f0abbe200cadf85c0a4", + "id": 0 + }, + "comment": "R: w=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 148, + "publicKeyUncompressed": "04ccf9f44079f421c1b33b39fde9b146ba4d231354c32a9af3f4f4a91b21efcb29a0bb6fa3a21768677833db7005c666ef4877e7f44db7d9ca836f908bbdfc833c", + "publicKeyCompressed": "02ccf9f44079f421c1b33b39fde9b146ba4d231354c32a9af3f4f4a91b21efcb29", + "msg": "68656c6c6f", + "sig": { + "r": "2ac5023330649c40cef0df17091dde7bdc174214f59f5a0bdb7076fc4482d866", + "s": "7be6bf4aa0eedf1d68da29b0c1bac0410cc1c915dedfa334c3a15592d0440df4", + "id": 0 + }, + "comment": "R: w=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 149, + "publicKeyUncompressed": "04d79eae470f52f86e030a52e781f493701efa16150390406f59002a9cec24c1feaa0dee8ee92049a369b231587e86a955d3a072144a4e308098142eac6eaaaaa8", + "publicKeyCompressed": "02d79eae470f52f86e030a52e781f493701efa16150390406f59002a9cec24c1fe", + "msg": "68656c6c6f", + "sig": { + "r": "00a2a027822b7801a45288c10d56e89323025d683780bba99c1769e847d340a984", + "s": "3e09f7397866e1847f3b4bf827d270c5dc0cb8fcb8c252ae2a98f941cb9ad41b", + "id": 0 + }, + "comment": "R: w=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 150, + "publicKeyUncompressed": "049e26d17a02ebc0866faf23cbc98faf3dc49f28be8c3435d3443fcfb86de4ca42d96f12f1f76a1d713fd45b58b906d86aa4250bc50afec9e535e5b15630136c25", + "publicKeyCompressed": "039e26d17a02ebc0866faf23cbc98faf3dc49f28be8c3435d3443fcfb86de4ca42", + "msg": "68656c6c6f", + "sig": { + "r": "00abafa2dcef57c183e7ef837d1b0fb3339d7dad0fccc4040ed9f5f31210fc7cea", + "s": "00d934758ecf616cd689807a228ac759eef66c72f662721fce1bc420c96dfe4a5b", + "id": 0 + }, + "comment": "R: b=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 151, + "publicKeyUncompressed": "04517105f5d696aecb39a7483a2c3171ff4eff3133d6eef7177c658bac77db566590b10ae92594f12cb5fc9f3aba0d4191fd49d51de042198c0348c9b307c8d641", + "publicKeyCompressed": "03517105f5d696aecb39a7483a2c3171ff4eff3133d6eef7177c658bac77db5665", + "msg": "68656c6c6f", + "sig": { + "r": "3c70c74ed8f746cbb70f0b928672e3aa21e799c64e028fdd07a6e05bdbf86d9b", + "s": "00910c030f1ee0bddcfd79bd1de185c8a352cc4ce036a242f669707da5f1b978b0", + "id": 0 + }, + "comment": "R: b=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 152, + "publicKeyUncompressed": "045b21c1f7cb16419367ac5207d90e6665132914906724578a9c5a9924c5ac5ebe9b4912fb4482e6f713c4ae700b47c763ed63453206f9c1f7d151caef0d426e18", + "publicKeyCompressed": "025b21c1f7cb16419367ac5207d90e6665132914906724578a9c5a9924c5ac5ebe", + "msg": "68656c6c6f", + "sig": { + "r": "0080a997849fd32975698dff60367e6aedc8f34c87c1e13934c9213f7e8ce12de6", + "s": "00a7f5a7d8664993bc75b37d779425c8e1368b949ec9dd8feca31bd1a0a95c1aed", + "id": 0 + }, + "comment": "R: h=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 153, + "publicKeyUncompressed": "04a3562590511a7ee9fdf6d132d8a809cb70fb3a69ebd52a6be113330ca2ebd734409dab65294cf8df0cbcfc58099b0e34d8555f8dcb9473072eb88125effe8af3", + "publicKeyCompressed": "03a3562590511a7ee9fdf6d132d8a809cb70fb3a69ebd52a6be113330ca2ebd734", + "msg": "68656c6c6f", + "sig": { + "r": "70299e2de1c90bb9f3136dd368a425a8f9e319ee250267895af4f52f5c730077", + "s": "5d1be61ccf04570703cc773b05cb9f831029d4294992206b7d55bbdb05517bc2", + "id": 0 + }, + "comment": "R: h=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 154, + "publicKeyUncompressed": "0468bf81d20fd1f02f9142b054debe09ab34303b87d00bbc7363eebd34e4dfbbbbe6d4c81760708f97070a58fd51277f1f298c6eaa27bdeae9f8848a92787bc0a6", + "publicKeyCompressed": "0268bf81d20fd1f02f9142b054debe09ab34303b87d00bbc7363eebd34e4dfbbbb", + "msg": "68656c6c6f", + "sig": { + "r": "3a06155ea858f061eed65c9d392aa00f4cb70bece7160b23c4069d4917dd6949", + "s": "00af026e2222e32865625865c73525ad7bc75635a5af6b35b1d06941ea38516534", + "id": 0 + }, + "comment": "R: h=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 155, + "publicKeyUncompressed": "041cf04d482fcefb954f92383073c3085d3b0fe182add48e56cddc4d97324d062ae2b95a52dee572aeaff3570c80c668da91032a82ff561cc92189adec7a4630dc", + "publicKeyCompressed": "021cf04d482fcefb954f92383073c3085d3b0fe182add48e56cddc4d97324d062a", + "msg": "68656c6c6f", + "sig": { + "r": "2dc3896bde982e80023cb97dc35dd727039972475efa9035f00254b38ecaed29", + "s": "37dfa6161f77f707051ce25221b11b0b837246ae630f62636ff00e7e3a45fbe6", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 156, + "publicKeyUncompressed": "04dee39879a3dc936fafc0211e992aa57d2d88dc27fb31808e82624630882ff941f5194c641f3a7477d174667a5cf5111bdf65dacffde5b3f0b2f0dbd5d6421878", + "publicKeyCompressed": "02dee39879a3dc936fafc0211e992aa57d2d88dc27fb31808e82624630882ff941", + "msg": "68656c6c6f", + "sig": { + "r": "0087468a3a54d8bb346a050e9745f64477d460953576e738d891ac2be25d922e70", + "s": "45ea813f0a893359218de143fcae6e342483a66e63256b088ae8036070048747", + "id": 0 + }, + "comment": "R: s**2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 157, + "publicKeyUncompressed": "0499fa5f66f830ad2f84a94bc59945ff11b1c9e7392b49deb72efbea81d4f53d46bfdb2c30e72df5bb02586561fe0f9d3971c19722231f6a27588d0a4ede87684d", + "publicKeyCompressed": "0399fa5f66f830ad2f84a94bc59945ff11b1c9e7392b49deb72efbea81d4f53d46", + "msg": "68656c6c6f", + "sig": { + "r": "00e0daf6dea6aed50232f24c4268836abe20f3e014fba530e8f2d892a0c52fe038", + "s": "00c5480f26a7ed3f9ebd859e3fb9c106063e9385f6fa4177f1e9e16e4e0db4c5", + "id": 0 + }, + "comment": "R: s**2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 158, + "publicKeyUncompressed": "0489485a86fd44fae41e98172199164e668d691410a14346236dede34706e8fe72198f8adfa93531bf1311ccffe851a46f4a2a4abf8774eaba607dd6d2950fa8e1", + "publicKeyCompressed": "0389485a86fd44fae41e98172199164e668d691410a14346236dede34706e8fe72", + "msg": "68656c6c6f", + "sig": { + "r": "00eebb798553d86d9fb67812eda033fbf2438ea0e3722d041e344c94d16de90641", + "s": "009afdf40c98727ba5c73afc12add91f4938acd5c564336993a39a07d858acac37", + "id": 0 + }, + "comment": "R: s**2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 159, + "publicKeyUncompressed": "04bfc47246ebf83356a49d62491947fe08e7e87c5e38f1c3576f22fda6b18a9499a448ed8e503cccbfb03b1f4246887a2589e12620245bffd515a0f027203a151e", + "publicKeyCompressed": "02bfc47246ebf83356a49d62491947fe08e7e87c5e38f1c3576f22fda6b18a9499", + "msg": "68656c6c6f", + "sig": { + "r": "00e2eaae70c5ee8e7a7e9d8af7111745309450aa147972ca00ab4d0627dfa02d59", + "s": "727aeb3b968e1993a7623affad2ae54270fefa6787546ffeb904014dbaa43f86", + "id": 0 + }, + "comment": "R: s**2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 160, + "publicKeyUncompressed": "04c6b0006fbc5023593bbf00803ccd7c86c2612e08d3549662c2c23bbae1a88bf8a628e4c07e75f11fa39ab643c1d3824bf03e83b627172be7916220617cd917e1", + "publicKeyCompressed": "03c6b0006fbc5023593bbf00803ccd7c86c2612e08d3549662c2c23bbae1a88bf8", + "msg": "68656c6c6f", + "sig": { + "r": "00a122dde09dcb45bb9fdd2d09adf28dd4c97b9438ff01731cf98535f34c3ed749", + "s": "7cd974399d48032cb84c3ce86c2db90dabcae5663ad685ef7ccb6d7cc52c5930", + "id": 0 + }, + "comment": "R: x3=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 161, + "publicKeyUncompressed": "04f3e486df08ba61d1a6e60bc551edd4b33b83df831a29354db54bf1367eefb639bfaeda397fb648327034b897f1922b8c0360dd7a02d168717eb8ece325be1470", + "publicKeyCompressed": "02f3e486df08ba61d1a6e60bc551edd4b33b83df831a29354db54bf1367eefb639", + "msg": "68656c6c6f", + "sig": { + "r": "73ae4017ede4357af4ac31bf724593d396320c2837d855ffd4b1ed5fc98b9729", + "s": "00c2bdf7f4cffba46789867b32ae6b8516d4e95d6e57576368cc7aba2566ac08b2", + "id": 0 + }, + "comment": "R: x3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 162, + "publicKeyUncompressed": "04dd04a8779583730b7547d8513df312c82c47985adddbb0c3d4f517a6110e3bd3eef30a3092c56c47e843a14068c0931f42563351c1a8bdd458c4f6537c51c9af", + "publicKeyCompressed": "03dd04a8779583730b7547d8513df312c82c47985adddbb0c3d4f517a6110e3bd3", + "msg": "68656c6c6f", + "sig": { + "r": "008df110bb5baf68a1e0fe0ce44fc7b14f2dfdf9f63ecbc85b664eb12b702518c4", + "s": "5afaacbac78403f24336ad3d0b286d183534bc41e4d213c33a9caaadc50ff9bd", + "id": 0 + }, + "comment": "R: x3=0 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 163, + "publicKeyUncompressed": "04c5678f2e3c270a61a8b536abee96d4619d9b918a3fb5c35df5b69c47c97e9a8bb0aec1aeca962768c5438e991428ee1cafdeb5bdc49bd12af07b5bec2c23a711", + "publicKeyCompressed": "03c5678f2e3c270a61a8b536abee96d4619d9b918a3fb5c35df5b69c47c97e9a8b", + "msg": "68656c6c6f", + "sig": { + "r": "144f69853b3c2763563e48afa941b6e1e3c2830a59760b7e2560505b65245b22", + "s": "1cd7dd1a26a0236a213bd2c4be5bbcd940ba1c087a67a07e3cdc6d9090f63125", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 164, + "publicKeyUncompressed": "041f302b7cdfdba224d738560fe785b5c62e26897e3fd7aef22d071883f3536cfd408a20c3d165dcc0e11fbd3c6e73c799f944b23f48beb307563f826e0586683b", + "publicKeyCompressed": "031f302b7cdfdba224d738560fe785b5c62e26897e3fd7aef22d071883f3536cfd", + "msg": "68656c6c6f", + "sig": { + "r": "57caabb051db60b3b6ac866bd9965b2faea60fc41e182f812219da2455bb5c91", + "s": "00a7d55b6c30d7a932f60570f393f5ee7b0b587d4445049a88773d42ab3a0538f3", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 165, + "publicKeyUncompressed": "04c2b7bf7093392bc4ecc94e0e8e5dbbad687aebe06429c840faa20f622d8a37b756d1bdb053e6d229be468da83ba5347c991137992996e90baf208c40433d1755", + "publicKeyCompressed": "03c2b7bf7093392bc4ecc94e0e8e5dbbad687aebe06429c840faa20f622d8a37b7", + "msg": "68656c6c6f", + "sig": { + "r": "00a653a2d51e89aa5bf400bcfacf6b6476e7c3d8d9879b31139b195ad4b8bb6d72", + "s": "00a021310f89aa854b11848962864b53ea2a4caedac7799ccb3e1d58e3c2dd96f3", + "id": 0 + }, + "comment": "R: z3=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 166, + "publicKeyUncompressed": "0402cee6aecb44ed1452f55e1c2c3109e77cbc3d79cf0e35957a8a646d1a37bb805bf243d326ba19a2033f484eb931a1597b215afbb4efe9ab647f904aed4ee268", + "publicKeyCompressed": "0202cee6aecb44ed1452f55e1c2c3109e77cbc3d79cf0e35957a8a646d1a37bb80", + "msg": "68656c6c6f", + "sig": { + "r": "00c05b61b9b8af7b3e937516dcc5820228a845899b1b953419eefc3320b189fc63", + "s": "125f08f49571a41ca66e3e9f4a74c9734f2eec70f9590b0a2ac287ae48b6c772", + "id": 0 + }, + "comment": "R: z3=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 167, + "publicKeyUncompressed": "04d1ebe853b6dd4d3e5f8e6fd9e735ce4120081b735c166e34db69bab620d6839d4899adc63cdf08bac3252f73487614f93534a9bc5a42ed6190b78d2c03b26a46", + "publicKeyCompressed": "02d1ebe853b6dd4d3e5f8e6fd9e735ce4120081b735c166e34db69bab620d6839d", + "msg": "68656c6c6f", + "sig": { + "r": "00dc7d6606ceb858ebcb6d0ee0f1a524a8a43322df57e2b622059df5dd748c54c6", + "s": "00e52e22fd2cac62255c43c96c5fc835269d2acfc02e16e9fd1386a43e66049f6d", + "id": 0 + }, + "comment": "R: z3=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 168, + "publicKeyUncompressed": "048b6729a67009c65a474f6ea1121756ee0d0f2b630c4e3418c938f407b2f3c17355a11875b9e6bfdd7c22b43e85c3166af418e11a77db5a961ad73416b05b6f3a", + "publicKeyCompressed": "028b6729a67009c65a474f6ea1121756ee0d0f2b630c4e3418c938f407b2f3c173", + "msg": "68656c6c6f", + "sig": { + "r": "3c7765e478dddd5f2fa0bfcab074bb6db939ecc421eb888fba6e325ca19879c4", + "s": "0090c632fcba48ec4637d6bdc92896c00acdc782d66e051b5b3ad01129b4a90754", + "id": 0 + }, + "comment": "R: u1=2 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 169, + "publicKeyUncompressed": "0445421842b1a9dc6c601c17dfed67ed977cfb1cc72adad7c3e890762cba75e9affa4f8d3cd32ebd1f6db890ce0566d105fc33406a3e18eeb5a896aabdd1ff8d0e", + "publicKeyCompressed": "0245421842b1a9dc6c601c17dfed67ed977cfb1cc72adad7c3e890762cba75e9af", + "msg": "68656c6c6f", + "sig": { + "r": "009004592c20ae8f841db0317b241fa209d312c1f5ef5b94f06d04d09ef87c5e75", + "s": "1092d572833a93ed8badefb0970e61a43be100d433b25abb7b81ba571d235bf2", + "id": 0 + }, + "comment": "R: u1=3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 170, + "publicKeyUncompressed": "047150e37bb095a048876a484edc8aea148ceed2ef4a6a8146351aad04cd345a088ef1ee84e5f05d21387c17bd8ce9c76088bbf626610036c86545cea1f6efc55c", + "publicKeyCompressed": "027150e37bb095a048876a484edc8aea148ceed2ef4a6a8146351aad04cd345a08", + "msg": "68656c6c6f", + "sig": { + "r": "51ff091bd9abe18ebfa9f5797b0d185bf1b9dd3cab6df2fd04b9fac830fe0625", + "s": "00aa9aa400a7e16cc0d2a3e3cb7fab68dedd227adb9b1d0b45f5a2e4a8619b44d1", + "id": 0 + }, + "comment": "R: u=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 171, + "publicKeyUncompressed": "049cc4f6095587db487fc27574aea94a7be2b8d28ed1c4a77485916f626be360e499afb06cf273a66701f2c8b767ddf9ddd6bf9e5c2796176a5f13f41daae471bd", + "publicKeyCompressed": "039cc4f6095587db487fc27574aea94a7be2b8d28ed1c4a77485916f626be360e4", + "msg": "68656c6c6f", + "sig": { + "r": "38467fe82fc695ba460f30d93d635c3b65a2b25824ba575bdaae07285b2a6769", + "s": "00a951680196620a861f1b89f41454fd2b8f3d7f0b7e9ca276eaa0b765dd25cc28", + "id": 0 + }, + "comment": "R: u=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 172, + "publicKeyUncompressed": "04c3742fd65774d30e22676caa4d17eed05c098a1f178b796ae14f1c4cfa32bd0bd8a76fe973b97d548c950479090fb71d6ae89f30b18c693019e6b22cb7e90e2d", + "publicKeyCompressed": "03c3742fd65774d30e22676caa4d17eed05c098a1f178b796ae14f1c4cfa32bd0b", + "msg": "68656c6c6f", + "sig": { + "r": "00d3c153403a498c04b7571cd63c7f4d9f610602b16d01555a1a9d9273befd226c", + "s": "00b5882d9f5b6f6e068f045d81fcb07d06649cbfd202d0c6bda29a3a560b2598c9", + "id": 0 + }, + "comment": "R: u=3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 173, + "publicKeyUncompressed": "04d50d5819c49a3853819e0daa9277036c46f5bfcb2770aab04ba89ed1a5f77a8cbf792ef4b9be42316139740445543cdb6a5c3afb322b780774411e048cbefe82", + "publicKeyCompressed": "02d50d5819c49a3853819e0daa9277036c46f5bfcb2770aab04ba89ed1a5f77a8c", + "msg": "68656c6c6f", + "sig": { + "r": "5755181d433d73ce9c071bb3e755f2bc78fa48a1c016ba5225f66a3887269542", + "s": "0095a5204ac2fc4c089dba45c20df3a585e52f7bd9821fbd8366cc28e302b9c80b", + "id": 0 + }, + "comment": "R: v**2=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 174, + "publicKeyUncompressed": "042fb8a409cf0bfe8a0625ddae4428186c83fddc936ff1c04024b98ab053d4bc9683b1b1fc0e511b9f69a7ed04f395e32713e2229849534189aa8fb720593ea336", + "publicKeyCompressed": "022fb8a409cf0bfe8a0625ddae4428186c83fddc936ff1c04024b98ab053d4bc96", + "msg": "68656c6c6f", + "sig": { + "r": "00c03de55f1518a637f71e539ef4989a883c468ad9d0b0c7d8702e89224f02754b", + "s": "009b5de330cbd44426a12b5f0bbab117059c004aa6b62e2f2b859006cef70566df", + "id": 0 + }, + "comment": "R: v**2=2 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 175, + "publicKeyUncompressed": "04fde67f2f9075a2f912f3f98bbdc2c57716f7287f29de4bdce2e1e59748296018124257c19bdb1793b01c9399f0f668d012e59729c59f83d9d4b4092734ffb1b1", + "publicKeyCompressed": "03fde67f2f9075a2f912f3f98bbdc2c57716f7287f29de4bdce2e1e59748296018", + "msg": "68656c6c6f", + "sig": { + "r": "00c2ee7bea87fbb8b162ca8dc44448aab0356c95c1ee66198a38ab75868c797d17", + "s": "00c712e673b1c6e83fc3745c247e82cfbf878cb719914487a5905361b787cd1819", + "id": 0 + }, + "comment": "R: x2=0 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 176, + "publicKeyUncompressed": "04bf2f647f00dabb36e644809be9c10313ee16eec10e96379ee542abad3e4ec3a8fd8857f129fc229e62bc43aad916d160253dd2108ddc1ee367a3690b3337593f", + "publicKeyCompressed": "03bf2f647f00dabb36e644809be9c10313ee16eec10e96379ee542abad3e4ec3a8", + "msg": "68656c6c6f", + "sig": { + "r": "083fc07aaa8b51ff33669d240dfdaab825daf06eb7e7a19a40f86a019355b633", + "s": "00c8378ced1a323c4498373bb6dcf8bbccd3cf2719fa4576de9bac1652257944e4", + "id": 0 + }, + "comment": "R: y2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 177, + "publicKeyUncompressed": "04fcec2b5e6ed033bd4758050c980a753d3ca821462c0802ec688e5c808702c22020d968faf018feb0b753d65ac706989f12b355fcd810a683f7b4c379828da375", + "publicKeyCompressed": "03fcec2b5e6ed033bd4758050c980a753d3ca821462c0802ec688e5c808702c220", + "msg": "68656c6c6f", + "sig": { + "r": "00f19f8d708c8074c1ea70351961c9f667754e06e1aa6f83c05a3cf5ec06c2fa8a", + "s": "07dd88a3d07c365cba4c90fcb580cd6a79b541fd21c93f9be8b2f8c427866b3c", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 178, + "publicKeyUncompressed": "045bd1f26f9db15354390560046ea87184836e70d41d6ef0e0768318da40db86a123e237681e8819a8f6b56195123e48368d68510e2acfabf4c009f4f15ae2404a", + "publicKeyCompressed": "025bd1f26f9db15354390560046ea87184836e70d41d6ef0e0768318da40db86a1", + "msg": "68656c6c6f", + "sig": { + "r": "09d8f4cf514e685daa5ebaa5c46eefdbe194e01c4e17659e611950d57fe2b6d7", + "s": "63272065697c6e7a3616be8d9ce3cfc0b4392342f71311a547bce53c34c0a0e1", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 179, + "publicKeyUncompressed": "044af4febf1eb17607c90adae71b38f3b3dfc426fca2bea1b75e77a1a22610f2379e3492273a72a555bf72da2afd388535af7a3a30ca7ac289e0bc51dc0441faa8", + "publicKeyCompressed": "024af4febf1eb17607c90adae71b38f3b3dfc426fca2bea1b75e77a1a22610f237", + "msg": "68656c6c6f", + "sig": { + "r": "00f0dc6573f319ca8d094db16e2e257958c195e31ad4c96dd4b04ab41f2d32a988", + "s": "2cacd76e96be257429a968120ccbc1a23f8062a064d52d70f73e352fd53b7db8", + "id": 0 + }, + "comment": "R: b=3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 180, + "publicKeyUncompressed": "0472c516ed180c9db606f4c95e6b09e75cb7633c03fedbcf3cc50caef9bc1923ba98c76e216e534d140bbaff379253050d4b1f92db9c58fcf57ebd04a86241f9f8", + "publicKeyCompressed": "0272c516ed180c9db606f4c95e6b09e75cb7633c03fedbcf3cc50caef9bc1923ba", + "msg": "68656c6c6f", + "sig": { + "r": "782b68c39f139a003a930ed98e14168a9c656cf0b1564cde0a2f252f7a927d30", + "s": "00e34731055f349390daa3fc8621dd5786f568e1b3194e8f6d00de0c3bebcd46a0", + "id": 0 + }, + "comment": "R: h=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 181, + "publicKeyUncompressed": "04bdd0c6cd9839f9e8abb9f914455a8e56249e4221810737ee11c6e9ac1b691a153ca55a69811a2702054d975260505100a8720b5ca93122b2c4850503bc666133", + "publicKeyCompressed": "03bdd0c6cd9839f9e8abb9f914455a8e56249e4221810737ee11c6e9ac1b691a15", + "msg": "68656c6c6f", + "sig": { + "r": "0084c763085295190928266b708bfb9a01296cf2f1f2a058fd64419d4fee3ec0a5", + "s": "7b6b7c8f00f46acfef1e5d2abe54451d5cff582ea1c1fe004435b00d2d70220a", + "id": 0 + }, + "comment": "R: h=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 182, + "publicKeyUncompressed": "04a2a2679427fd685eec38cd59de738b7c65f010fdd9617dfae1e3f0a731c242911f3c7a1307cd52977ad537deba109546e2a4659b0a3845642cf94af1e3aa83d6", + "publicKeyCompressed": "02a2a2679427fd685eec38cd59de738b7c65f010fdd9617dfae1e3f0a731c24291", + "msg": "68656c6c6f", + "sig": { + "r": "2e4124ed0ab49f465ddc25aaeca1e25a949dd79217f5936af9e6a840594b973a", + "s": "00806e98e9790155855420f16f985d3aafd36dde0f8fd10fc4f043330921f4915a", + "id": 0 + }, + "comment": "R: h=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 183, + "publicKeyUncompressed": "04bf219b21723b351a85f0cedf33f7d0c03a8b6a0f65f9effcb8919f9508c42ecbf8c38a24abb9da3a02e9ac9fb5a91d356720bbce4c979afcc993750199a79f74", + "publicKeyCompressed": "02bf219b21723b351a85f0cedf33f7d0c03a8b6a0f65f9effcb8919f9508c42ecb", + "msg": "68656c6c6f", + "sig": { + "r": "64c275a99b3e10da6d7a866a6b998ca64c31ea5171b6a9a8ce96d001b011b86b", + "s": "4eb94fbfb7252fc7442859cdb76379457962e2f8f9143d4488b4ace2db69eda4", + "id": 0 + }, + "comment": "R: h=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 184, + "publicKeyUncompressed": "04012d7e88dd7e6371b7c6f6990e7cb23703de40cba3a3a635df04fc4477562763b176961aaf74ee0557f6baaa613421c93b0f67d7aaac3bdd13c016bdb3c42227", + "publicKeyCompressed": "03012d7e88dd7e6371b7c6f6990e7cb23703de40cba3a3a635df04fc4477562763", + "msg": "68656c6c6f", + "sig": { + "r": "00ee67c92d40b499e711a801b58ef1936f4868cd8cb2dcc3a4b1aaf3faddc85882", + "s": "009176ef54646bb4db570a7e881a637a6520eac5fe6c8dea64e94fa5a36f0db1d4", + "id": 0 + }, + "comment": "R: h=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 185, + "publicKeyUncompressed": "0421885a677b2474fb4f2b65ef8c90ccef4466612e76907ada01aa81e2638b53811d864867942b1103ab715f53e3c9e367401f5795cc6bdc7b91bcba756efa5816", + "publicKeyCompressed": "0221885a677b2474fb4f2b65ef8c90ccef4466612e76907ada01aa81e2638b5381", + "msg": "68656c6c6f", + "sig": { + "r": "39e5eb47a9845716415f0d8e925c31049702c9cafa7dcb2ceef5560e0c0297b3", + "s": "58ffaefb06cdadeabd010e7fd81babb263d27bd580c049c2068e292b955cf3dd", + "id": 0 + }, + "comment": "R: h=3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 186, + "publicKeyUncompressed": "04c93b106a3cafcab49118346f7fff0b6b9c02db00e274283a71ca2e782007191faaec78be863e82891fa3a7c624f99d208ed4894e51a9eb2d50cdf84a9141e2e4", + "publicKeyCompressed": "02c93b106a3cafcab49118346f7fff0b6b9c02db00e274283a71ca2e782007191f", + "msg": "68656c6c6f", + "sig": { + "r": "75ecc48752a8833f9d9de5271c2ec98992725c5e1561e19826e293567a78e808", + "s": "4da9c43d64f3576bab60f98c8729e75555f1d8364e2b3f6c4d3c5444097b326d", + "id": 0 + }, + "comment": "R: h=3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 187, + "publicKeyUncompressed": "049b8ec0d9cc302b8607a7ad57570281f60bfdccb908a4ff9485c31c881db71751f98437e803d57ed0ee12367b1e0fb322decc6a07ccefa73a458b392e086594fc", + "publicKeyCompressed": "029b8ec0d9cc302b8607a7ad57570281f60bfdccb908a4ff9485c31c881db71751", + "msg": "68656c6c6f", + "sig": { + "r": "00ac0a86d75b1171904c1de94fcd8805eaf5ffae92becb6b98ae6cc7279eca30da", + "s": "00e8d0f2f003a8016651d2a07fdaae533e560855153f6dd3ec852312b418db0183", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 188, + "publicKeyUncompressed": "04e599c52763fec07f2d044d95e721e80aee0b6276253d19c2c7f08bb51a105939d2f370e3fcc36286870bf8ab25fd969551a0a7647ef1b1cbac2d870d8e2d457f", + "publicKeyCompressed": "03e599c52763fec07f2d044d95e721e80aee0b6276253d19c2c7f08bb51a105939", + "msg": "68656c6c6f", + "sig": { + "r": "0090ec05a4505ead5aa4d8e629f49e256ec8f9094180972b09151b41a11c2cc0e1", + "s": "008186c9af41c430d05af42c478e1a32d183cca95f8c4c6aaab523eb28adab6cf8", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 189, + "publicKeyUncompressed": "0424966c4e31dc3cfd75267764327cf0a5293d0461f1e1676255d854defdd2a887144cfab797375960e744b1a72405839c42227c0452f777575f8d4347eff3a9d5", + "publicKeyCompressed": "0324966c4e31dc3cfd75267764327cf0a5293d0461f1e1676255d854defdd2a887", + "msg": "68656c6c6f", + "sig": { + "r": "00984046b079d62d28e0237e067a53eea649a463faf5e5ae1331168fbd6454f6a5", + "s": "0090077277301c4731f32a261485739026e7041ed2a443b103b80ba3628aa65689", + "id": 0 + }, + "comment": "R: s**2=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 190, + "publicKeyUncompressed": "045062de179f83cab36b8aa2ea14508a886113fc1dee4f4dcbabdfe435a54d62253be6cecca4fafcc85257d9b3776f545e82cb3cba9086517f6de40adc09acbdac", + "publicKeyCompressed": "025062de179f83cab36b8aa2ea14508a886113fc1dee4f4dcbabdfe435a54d6225", + "msg": "68656c6c6f", + "sig": { + "r": "4b8f4cd9c1e2d33a068ae498a7e59bceba571a423efac7dfcb33baee87c72510", + "s": "72eff2f1f3c8ac17efade5e943d1aae93ff94edab67e3b4b8bddf1f586949238", + "id": 0 + }, + "comment": "R: x3=-3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 191, + "publicKeyUncompressed": "04b01df1bd5a96d45a0a9371befe7cc30746a05e3e7ef99181ac6756cb16a409f392a5c8327d60f85820ca83d1f237b77a6e07762fdec6b8dc2bd69f89035d731c", + "publicKeyCompressed": "02b01df1bd5a96d45a0a9371befe7cc30746a05e3e7ef99181ac6756cb16a409f3", + "msg": "68656c6c6f", + "sig": { + "r": "117921cd569ed3c9cb1e16014ff1972ec5a747753ece69481586543a81dfbc99", + "s": "00e12af5d0e62f3d00feff0534d6c6546e9a847d7d281a63ed40f80fe9ef3b3150", + "id": 0 + }, + "comment": "R: x3=0 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 192, + "publicKeyUncompressed": "048ef283866378a380373cd88051393ae2abd5efddaff0876723c75026870c1392eababe946a2b4b06d6b0e1f5884b887e2b727bdff1dcdc59b1574a89861ae383", + "publicKeyCompressed": "038ef283866378a380373cd88051393ae2abd5efddaff0876723c75026870c1392", + "msg": "68656c6c6f", + "sig": { + "r": "4919f309d1f8c8f5d38c2759d1430e3a3888faff767ae0ecc6813d0511336b4f", + "s": "00aea24df22346fcf4273ec49c21f6b80c4616a120a7f1d84e53b8c91a74954b13", + "id": 0 + }, + "comment": "R: x3=2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 193, + "publicKeyUncompressed": "04b595efa21521b66ac503b85b2335d99fc752c1360a20dfce756d2e56ef0bb37a21e55ef2e3f9eeda18f7080a24650d7b8b4ab3ddfd567a60c8f522aa465f5dea", + "publicKeyCompressed": "02b595efa21521b66ac503b85b2335d99fc752c1360a20dfce756d2e56ef0bb37a", + "msg": "68656c6c6f", + "sig": { + "r": "649f43f659fdf648e4de1a75257e311402a95bcb26f2cb242fe98ca85473b8ec", + "s": "7c2211d68a7bf002d967018db4100fb7080cebaff98ed241b54739cf354cefde", + "id": 0 + }, + "comment": "R: z3=-1 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 194, + "publicKeyUncompressed": "042a79b73289b02e0f44036ece316a98aab7e90b4a534f00ffcbc29284f068cb744e8c543815b3b7a68b0d88dd2f161b4a3326d9cec5b3c8287b745d73ab90cf99", + "publicKeyCompressed": "032a79b73289b02e0f44036ece316a98aab7e90b4a534f00ffcbc29284f068cb74", + "msg": "68656c6c6f", + "sig": { + "r": "00f56503713cb789b2407ca2341f887c93f8d462ae4e9c27689f0a1801c91220fa", + "s": "00923d5e85ee5303f309686757d7bbc11348eed5edaea057508fd10eabd4772d70", + "id": 0 + }, + "comment": "R: z3=-1 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 195, + "publicKeyUncompressed": "0465485b6c8e1a45b24dfaaf1e0611a213de30657c00a09e82bc36b569d760ce6cbf07254c8766e3be6bee23a389c51690b2d170357cf7d54210c9dd5fd508c822", + "publicKeyCompressed": "0265485b6c8e1a45b24dfaaf1e0611a213de30657c00a09e82bc36b569d760ce6c", + "msg": "68656c6c6f", + "sig": { + "r": "2d07ad8cb9cba3ded7512e2ab2a1e3ec4e6203a6893e5e77990ede8e29970a72", + "s": "00857dabecfb7abe29e987490da413b0e6085681a610d451fe0b5e2d3a9d8d6f68", + "id": 0 + }, + "comment": "R: u1=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 196, + "publicKeyUncompressed": "047d7a21ea588524eb19b91e0cfb73e241f11bfa8c5f00b1d5c7e5eace44021001952b6168103206bdbc8f470aa5182a704258cfeedf1c9c7518a0926a3acf97c1", + "publicKeyCompressed": "037d7a21ea588524eb19b91e0cfb73e241f11bfa8c5f00b1d5c7e5eace44021001", + "msg": "68656c6c6f", + "sig": { + "r": "00a63e0c6554986bd71b299d17fb2f1b0ab029ba5025de0c40ec976f0d3e4719f0", + "s": "63db849c041723ebc01e5726b5eab63f065ba17dbc6ed578e1a96b21f55860af", + "id": 0 + }, + "comment": "R: u1=-1 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 197, + "publicKeyUncompressed": "04d3546dedaa8ecc70d3382b9eb5df2074e4b1e8a61bd4f217c36386f1ccf8cdf8dbdbef76184c331f96a8ba531fec14da25923e8073ac1356e05309ac303361df", + "publicKeyCompressed": "03d3546dedaa8ecc70d3382b9eb5df2074e4b1e8a61bd4f217c36386f1ccf8cdf8", + "msg": "68656c6c6f", + "sig": { + "r": "009d05f09ffc104eb07f4d52ffa285ad1bea383f70dfe8830458f81331c338ea12", + "s": "00c2edb152683f32a2ed577d3b2c36ad8b583f9e13b81e1557e82e9669a1fa0423", + "id": 0 + }, + "comment": "R: u1=2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 198, + "publicKeyUncompressed": "04636c6da6e35077bd21460f2588a24ffd849dd1aebbda6ba26fd47c8126ddd4e68594c035a5ab15ff68ad86b1e1800c89af6536776908c09d2f7824f9b2bab184", + "publicKeyCompressed": "02636c6da6e35077bd21460f2588a24ffd849dd1aebbda6ba26fd47c8126ddd4e6", + "msg": "68656c6c6f", + "sig": { + "r": "10d6410ebff86d27bac87ee9532d871a3013637ff179850b556c070842dbe7c6", + "s": "41b58f24694b1875338c6bdbf7eb5e1d30968d36341fdbc07553e1d5fddd95f8", + "id": 0 + }, + "comment": "R: u1=3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 199, + "publicKeyUncompressed": "04867a52ab5d834ca73ee5223bfd22ffdbc046a3e943c55f8a2a31c9a5a8dd134615d97b3c8b500fed4de3d398f11cdc2773e14a4038231a98bade3bc1b7dec599", + "publicKeyCompressed": "03867a52ab5d834ca73ee5223bfd22ffdbc046a3e943c55f8a2a31c9a5a8dd1346", + "msg": "68656c6c6f", + "sig": { + "r": "6e302d509c7a101aa91be9f50681c9a0fc6e23648ed5e48ebe7193709b838f32", + "s": "00f9d9e4b803a3ce78bf1f29e019fea091fafee0953a2ba77524e8fee5a195288f", + "id": 0 + }, + "comment": "R: u=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 200, + "publicKeyUncompressed": "0423860319bf6083c6aac7bd4b3a20871c37d6912ae0191921cc6d3759132fe89581e0c5b8ca436dc19560704de3b1231bdaf2f6db486cb2c81872442db1effbd9", + "publicKeyCompressed": "0323860319bf6083c6aac7bd4b3a20871c37d6912ae0191921cc6d3759132fe895", + "msg": "68656c6c6f", + "sig": { + "r": "009b085c23103e9ee43f9a63dd7fc0964cc19b4433ecba1838aba6db3a4ae2ea12", + "s": "3a0b97f06fa01b380e9e6c2b4a2423c785e6c9dc97f5c8e12b10d6b487b50436", + "id": 0 + }, + "comment": "R: u=0 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 201, + "publicKeyUncompressed": "0494975cce6418444e3098011c4bf2add2173a3ff77e5ba1c05bb0978899fa7c1f70cdca5b96f7c4e50b655d034a44b1e9cbc351f262fb8c0b4dc3ec3294a66892", + "publicKeyCompressed": "0294975cce6418444e3098011c4bf2add2173a3ff77e5ba1c05bb0978899fa7c1f", + "msg": "68656c6c6f", + "sig": { + "r": "4cc5d73de553bb661b4bcf7c2765dda32bd658ff38a1c16d51c75f294769695a", + "s": "1f987afa3181211cb3c28bdec1e379761e055ab43fed42723a43949addf0ca69", + "id": 0 + }, + "comment": "R: v**2=1 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 202, + "publicKeyUncompressed": "0489e77d2ea09abee020707291f2b0bf422dbe530bc100fffe380cf5c3f8978ec92f1c7eeb45726f5b4ff65f41bd2a62ad6da4226048902a3ee94df4958877a356", + "publicKeyCompressed": "0289e77d2ea09abee020707291f2b0bf422dbe530bc100fffe380cf5c3f8978ec9", + "msg": "68656c6c6f", + "sig": { + "r": "41e9d4cfa8efe80b895a8cbcce2568e251db7ecdfd20a7ad710d4a4bf2addc6b", + "s": "4896d37000e999af0c6a3df02b9ea654eb3236bd23b5eb3884c5bf743215e855", + "id": 0 + }, + "comment": "R: x2=0 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 203, + "publicKeyUncompressed": "048945fd1223b5fe90c85df6ec76deabde84f9f4e54e5be5c6b98d197de5b917f6d7fda139914754038d833663d558cc3e9c8ed42fc60e6e993116c49a5f39a001", + "publicKeyCompressed": "038945fd1223b5fe90c85df6ec76deabde84f9f4e54e5be5c6b98d197de5b917f6", + "msg": "68656c6c6f", + "sig": { + "r": "00ec88507f0b351dbcd74bbb91362873511204eb9e2b2675c3a137f96b1584aae3", + "s": "00b021645eecf531d0712632a60bc7acb6dddcc6fbf33aac3352cc84c3d1fe34a6", + "id": 0 + }, + "comment": "R: y2=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 204, + "publicKeyUncompressed": "041c1b46a975aa9c6cd7b609110aa1d0617ff13c2f14b36ff1972ef1825fc9a810bde996f4b599b095db05c0ba0afa4bb1fee431e6fd914391e2fbf2c097849d3e", + "publicKeyCompressed": "021c1b46a975aa9c6cd7b609110aa1d0617ff13c2f14b36ff1972ef1825fc9a810", + "msg": "68656c6c6f", + "sig": { + "r": "00ef3eb0332fb3908126a4a56e59f875a38d4c62b28a05ab689f4c89df1192483f", + "s": "3a4be5ae82ef14e3cb7f328a25fd155f1effe3145d5eb6db46cee7a9afe0ced1", + "id": 0 + }, + "comment": "R: b=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 205, + "publicKeyUncompressed": "0447ceec14256d20be12e00c94c9a7a569e3506968e2f804d08a775e5a0a8dec272244028018d51450b2fd78f5668c42a29665bf9190451a77f585a47b58021edc", + "publicKeyCompressed": "0247ceec14256d20be12e00c94c9a7a569e3506968e2f804d08a775e5a0a8dec27", + "msg": "68656c6c6f", + "sig": { + "r": "0780d995655a44c061621a6deb166f53fe76230da60ed2658d57e7a91dc90bd9", + "s": "0091b2fa586fd39f1b637f8f4c0c290a18fed7d7bc9d6e861390fe22f8aac84571", + "id": 0 + }, + "comment": "R: b=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 206, + "publicKeyUncompressed": "0489f40ceeffb06c37a78f992fa9a843728576e6a4e94e8cf0b25a451c7c2efc140fe51583fb0d1b07e6696f0349fb9120bd27b63c5392b30b975656052e3a308b", + "publicKeyCompressed": "0389f40ceeffb06c37a78f992fa9a843728576e6a4e94e8cf0b25a451c7c2efc14", + "msg": "68656c6c6f", + "sig": { + "r": "2fe268e46c447ff46a1b7a9a17dbba8c846cccf97459e8b47d8c44038ad018fb", + "s": "36931168035342a05ffcd9d278f4b283f514e5ea155377984e4bb9e7cdc2f0cd", + "id": 0 + }, + "comment": "R: b=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 207, + "publicKeyUncompressed": "04350c6755018e027902f44cb59360c619b19aad0e0ee865ef9e5eb70af2a205abbcc3d17cdcb65de90cbcb0a317263c351e030c238ecc80a2bc846d034c586351", + "publicKeyCompressed": "03350c6755018e027902f44cb59360c619b19aad0e0ee865ef9e5eb70af2a205ab", + "msg": "68656c6c6f", + "sig": { + "r": "7cc049629717da3873fcc837d172f7a31bd617e235f2ef30016bf2b7e3dd394a", + "s": "386a7ca10b24688b5de9c2c1af17a8226b58e9d6426b2568ed90bc8420f55c3c", + "id": 0 + }, + "comment": "R: b=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 208, + "publicKeyUncompressed": "04ddb2e07d089b04edc4fa967b814bb0825b3d3e9e96274964da4d02b0326a8b4ef92e4750ac756ef0cce598eb5b9f94a1bc9c16221102698ccbe9246df7d21f64", + "publicKeyCompressed": "02ddb2e07d089b04edc4fa967b814bb0825b3d3e9e96274964da4d02b0326a8b4e", + "msg": "68656c6c6f", + "sig": { + "r": "5b763276f00a55ea1fe4ec980a4e25f482f23abbbf36928a043ea64cacb327a0", + "s": "009e0c399bf2f03b077a3478327960e4eb453b56d94337d7066f827ae8d283ed08", + "id": 0 + }, + "comment": "R: b=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 209, + "publicKeyUncompressed": "04637f86dfecda787ad9db64dcba34c381685b2dd46c3230c04efa6a744551956c55e6212a510c2643bc077798b81d6b45fe4004d5512708dc89bbc149b0651163", + "publicKeyCompressed": "03637f86dfecda787ad9db64dcba34c381685b2dd46c3230c04efa6a744551956c", + "msg": "68656c6c6f", + "sig": { + "r": "2c40539453ecb592eee5771c8c2b7d3b82f13902ce4f96ae11539c42e45b022a", + "s": "00ca1f486f27f30d2fe0a47f90879156ffb334b72006c6234911b0a1ad2fe8fa50", + "id": 0 + }, + "comment": "R: h=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 210, + "publicKeyUncompressed": "04b0223de3cf79e6892918ff8822797dd5987f456e1b62b680d464b1bf35be16901718d2fef5cb6315a04bf00943f1ce54d09559d4f192f35b1eb0fa1720487b4a", + "publicKeyCompressed": "02b0223de3cf79e6892918ff8822797dd5987f456e1b62b680d464b1bf35be1690", + "msg": "68656c6c6f", + "sig": { + "r": "00c42d9f9a1ce6062e1c8c61c189f6dc1996856d400055d77c16517edcff401827", + "s": "651d6848c6178cc3885213983d40b5c4b38d743d304197b0b6654aa2154c8487", + "id": 0 + }, + "comment": "R: h=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 211, + "publicKeyUncompressed": "049a5d97032f70f9a23ab3dc9f2c5fb7b174a81223c175478833a57a8e717f81c99e01ca8cd66affb336ec222827e10bf43ab44dc8f04a5ff5211a5c5bf95360f7", + "publicKeyCompressed": "039a5d97032f70f9a23ab3dc9f2c5fb7b174a81223c175478833a57a8e717f81c9", + "msg": "68656c6c6f", + "sig": { + "r": "13744b5595ef9b31162372bb090f5db8be2abe8fc928f0fa3ce3d941c6a129e7", + "s": "00acad9e6f77954796d546a92e6a0e4b50993e9b589f2bb3897dfbce7ef3c216e5", + "id": 0 + }, + "comment": "R: h=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 212, + "publicKeyUncompressed": "040ac507a54b40a2988429d487767cc234ca740dbc9e8040bd4716fb8a2729ae7d26a5220abd5f25b985a3e36ead45d53dc6beab1939e5c46f7507c6cbbfeebaf5", + "publicKeyCompressed": "030ac507a54b40a2988429d487767cc234ca740dbc9e8040bd4716fb8a2729ae7d", + "msg": "68656c6c6f", + "sig": { + "r": "36fef0ce5d5d6306831eecf4db8e8c56dc19753e3b65940d4f009d5e63b82383", + "s": "00aba658141388edd2e6e7014e20be8410d82bb910106f10dab1c632c1c7c339de", + "id": 0 + }, + "comment": "R: h=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 213, + "publicKeyUncompressed": "04a0f957a8aab21fc9c08e7bd7b05c4b1ede808aeeb4d719654e8e5ede8052af57198c0b9b857c62bbca466f88bd8912fa51d29ebf949112474a07ae5a1af218b1", + "publicKeyCompressed": "03a0f957a8aab21fc9c08e7bd7b05c4b1ede808aeeb4d719654e8e5ede8052af57", + "msg": "68656c6c6f", + "sig": { + "r": "46b463e34ba3a0b488beaf00c6309d5d913e4dae395e9fae9a2356ed0a3bb86e", + "s": "1a4d0bc98b1b0cff4220c5eca1315af9a1d8c9a9c8334c0b0756976d833469a4", + "id": 0 + }, + "comment": "R: h=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 214, + "publicKeyUncompressed": "040943deb0379e7f3b94c9e70a0bb55175b9834e462068c933101c13f61889f8df6f16cb1c3b61dd3c51aef179630b176c625f0c8bb12bcc5ac28f8ade38da54ac", + "publicKeyCompressed": "020943deb0379e7f3b94c9e70a0bb55175b9834e462068c933101c13f61889f8df", + "msg": "68656c6c6f", + "sig": { + "r": "7a7c383d359af0d14b69c0de89bc141cf88be73adb6de70da0ac0fe398df86ff", + "s": "4f147b7e41a30ae8fbf14094f8eefcfbf9edf0660df0fa9aa561b3d3a0337599", + "id": 0 + }, + "comment": "R: s**2=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 215, + "publicKeyUncompressed": "04863f0e0036ea66933a98f1a4523e79bfc8d7fc759a0cff3913b58e25234633a195703ba32bd796f8f54e99b4b67ffa37e113415e4015a834f0c1ade09c25cfea", + "publicKeyCompressed": "02863f0e0036ea66933a98f1a4523e79bfc8d7fc759a0cff3913b58e25234633a1", + "msg": "68656c6c6f", + "sig": { + "r": "00a3dfd954239db2c932df89c4031edd3df7ab10ba5069d4024575c76b05f45e09", + "s": "33da03c04fb3c4c572ebc3d3de5ea6c790efc805d62886a5087329ceacf14f09", + "id": 0 + }, + "comment": "R: s**2=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 216, + "publicKeyUncompressed": "04c125101d39f5c62deeff8e012743dbd3beec6f8ab219fbd4babf879febb4879428b441974cde95aa36f29b1a7ad72f813ed97967098abf11020635ecbe8ea5e7", + "publicKeyCompressed": "03c125101d39f5c62deeff8e012743dbd3beec6f8ab219fbd4babf879febb48794", + "msg": "68656c6c6f", + "sig": { + "r": "00ead6f954fe239dea0a2beb666bdf157f3f70e08fb268cb51fe68053338b9393f", + "s": "50248d93e7cc97ff0f9ed5ae9d591a472987752fcbdfd94ab8fbbfea966068bb", + "id": 0 + }, + "comment": "R: s**2=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 217, + "publicKeyUncompressed": "0470de838fe172280fb4aa727e6a473d2cc00337156588eff066abc7d045a0b4c29ecbb64deb5327c00adf10070b0a0f6af460dfa2e557b60c83a82b3f4eda3854", + "publicKeyCompressed": "0270de838fe172280fb4aa727e6a473d2cc00337156588eff066abc7d045a0b4c2", + "msg": "68656c6c6f", + "sig": { + "r": "6ec0381227a54a91841a0b753a89e332d7117b4f70ab3562881808ae73f3493a", + "s": "08119211e4d03e34c0e1948dc13f631cccd38c4abab07d7846af13dc483392a2", + "id": 0 + }, + "comment": "R: x3=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 218, + "publicKeyUncompressed": "0416c92c7e2ec23cf1f771b6f080608e12d01d0598e7bffa7d9cb9fc6e556460aa58435c6dcf8186102fc8d386dabd561c6de8e6210f4a829a93f1cbf2a56c221f", + "publicKeyCompressed": "0316c92c7e2ec23cf1f771b6f080608e12d01d0598e7bffa7d9cb9fc6e556460aa", + "msg": "68656c6c6f", + "sig": { + "r": "1da05b38dbaf1d74d3e30c322e70168850ccedb36ee765cc15874480e4d66ef2", + "s": "00f99dc25bf10dbd52378a00147087e29dffe36d2fe3700335cc960f9e02677d9a", + "id": 0 + }, + "comment": "R: x3=-2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 219, + "publicKeyUncompressed": "0478a69fbeb201539c11840ea0eec202bb24aeb8b193d816005ec731c3f01c5981ab79d8893c61b680aef3326c149373f00f044bf0400d6f62428e63c7ffa373be", + "publicKeyCompressed": "0278a69fbeb201539c11840ea0eec202bb24aeb8b193d816005ec731c3f01c5981", + "msg": "68656c6c6f", + "sig": { + "r": "66fd79ea023c047c3d6163406cb8fe2e1482ae34e2197d31c929c46867ff8ee4", + "s": "26da55f3afb8b05889f622a7e19e7d436e48a1370594d95f2efd14aedb82817e", + "id": 0 + }, + "comment": "R: x3=0 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 220, + "publicKeyUncompressed": "044fb971b4fb4de453032f152db0fa0891c0d313f41bd8f970bcb596c21060da37475d2bf7741bcfcac7fa01e24323e411d68542be2fdc049bc9f16edd47205d75", + "publicKeyCompressed": "034fb971b4fb4de453032f152db0fa0891c0d313f41bd8f970bcb596c21060da37", + "msg": "68656c6c6f", + "sig": { + "r": "0c3508b28c914471f770529e922dd35bc450316d9065d616ad9f00f3cca04c37", + "s": "009979f65049cddb76ff672f888f20bee8bd7b34d202b5f967f34f0cfb604c8cf3", + "id": 0 + }, + "comment": "R: x3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 221, + "publicKeyUncompressed": "04dc45b72be2412854823ee5bd32af9d85bc0bc737a9181c2563098e7aa349475344b62b1d0583089de79150c0a5125ec8e32dc92da3ede5c7841f01b5f605474b", + "publicKeyCompressed": "03dc45b72be2412854823ee5bd32af9d85bc0bc737a9181c2563098e7aa3494753", + "msg": "68656c6c6f", + "sig": { + "r": "00c3d6fc07d2b7fd08882721dfafdcff50909b48fbbed447ae1aa4ee69ff83d53f", + "s": "00876bbab08bb284a3bf1222fdf643ccd1fc2a19ed728aa4c4e28f652e9e28fd25", + "id": 0 + }, + "comment": "R: x3=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 222, + "publicKeyUncompressed": "049c80b15d1a2ec78fea394fbdcb1d68f209e9078f2f8088fc165493915358e4fb2c43141e501ec32952161de315f25e16317210b02b196146456e7efd1327894e", + "publicKeyCompressed": "029c80b15d1a2ec78fea394fbdcb1d68f209e9078f2f8088fc165493915358e4fb", + "msg": "68656c6c6f", + "sig": { + "r": "008d8bcd78685b7052718b099d76717b50bd78412d07c84b738144537c53fdda62", + "s": "00e470883fc186dc0c3b6ca668c2fea22ee6375b38d87b65ea9121783abd31c480", + "id": 0 + }, + "comment": "R: z3=-1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 223, + "publicKeyUncompressed": "04f45dbd753ad5ac0cc75bb3436d0cb2d11b076eb22ea30316ef51429a3279421f2a2c395d221eece1a827f4ff71674f9b09048d92a4adf176117641cd26d68a17", + "publicKeyCompressed": "03f45dbd753ad5ac0cc75bb3436d0cb2d11b076eb22ea30316ef51429a3279421f", + "msg": "68656c6c6f", + "sig": { + "r": "2f89f84909c72cbe94fd2bfe82c0120a3555697f55ac8fe68c21b1ae4e180554", + "s": "00f29af8db917f6abc52ab289bdf0bda62ae4f49b99ef90373631882c1765d4a88", + "id": 0 + }, + "comment": "R: z3=-1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 224, + "publicKeyUncompressed": "048e420fd8995c1e86f73faf70cccb6981fb6260a8d72606be293e3fc45e7a3d74b8f0882b3840deadbfd0ff69946cbe3207ccb605bf4db0c3dd79154174c4c657", + "publicKeyCompressed": "038e420fd8995c1e86f73faf70cccb6981fb6260a8d72606be293e3fc45e7a3d74", + "msg": "68656c6c6f", + "sig": { + "r": "00cc7bf7ad32379c41b7b28a4993df8668502d7514c4f6e54ff61e66d2e7c25b", + "s": "44d6d5594c39f9693b955ea95b1e08075fbfd87bf699f8d3379391ada34b9c32", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 225, + "publicKeyUncompressed": "04de907ea2aceac4618ab2a3f88c890f080a654ea22e9c5e096e4e6d555e0d45b62328222d4e5b0a2c44fd75cb367dd7934fe8313ea4b6d8945f5d8b0c90d78ab4", + "publicKeyCompressed": "02de907ea2aceac4618ab2a3f88c890f080a654ea22e9c5e096e4e6d555e0d45b6", + "msg": "68656c6c6f", + "sig": { + "r": "4001af78648bb4cc6c8f895fd66f67fdada7320c26ade81b6c3d61d48c83f532", + "s": "4e270d146bbc73618fa7ea20a8c2cba1a7c9510c94545bfd91f7281df6195831", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 226, + "publicKeyUncompressed": "04b1ff5efe9305e65a5ca017d86eaca58b29523e13a05c2569dd13efd55636bfc5671d19030b2a18d0f503ff6a3ef1aa76ae6ef5ae8388f019b274db02afceea10", + "publicKeyCompressed": "02b1ff5efe9305e65a5ca017d86eaca58b29523e13a05c2569dd13efd55636bfc5", + "msg": "68656c6c6f", + "sig": { + "r": "00a90a1bd0a54cc0d80062f53313b8fdafa89efc15126329dd824d452b80555f95", + "s": "0097d7da96061109ebe10396c2c720775754dda141b8905dc702d48fecc36e8838", + "id": 0 + }, + "comment": "R: u1=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 227, + "publicKeyUncompressed": "04e8f9d2fd00ad8955ab9247bfd143cb5fe7a50b3ff707488177510881509efa94ebebac117f796a5aabe792f419454f796710c9b695a197878cfa8e9aeaee00f6", + "publicKeyCompressed": "02e8f9d2fd00ad8955ab9247bfd143cb5fe7a50b3ff707488177510881509efa94", + "msg": "68656c6c6f", + "sig": { + "r": "00e62f13414fa3f975271e020ecb043e1c5430355e63e3cba69440f4941d5060ad", + "s": "4d21fbe22a1ca1bb4d9bfc04a5428155c0a2e375002da8196f2066f0a9a49e77", + "id": 0 + }, + "comment": "R: u1=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 228, + "publicKeyUncompressed": "0437cc00961e26a5c5d275c955bd51d0b386193fbc118a578f6c14933646a315d57fc802176e6be3193b77675fc0534c1db33224210beede00c92354e231ef457c", + "publicKeyCompressed": "0237cc00961e26a5c5d275c955bd51d0b386193fbc118a578f6c14933646a315d5", + "msg": "68656c6c6f", + "sig": { + "r": "00e1f5a8f3524ccc1f31a2bde450187d4f3307376eb109647bc778e15ca646b7a4", + "s": "008e90335ae897625082b064d46dcb63cc33feada00d4d7914383c3c7cfa3a8437", + "id": 0 + }, + "comment": "R: u1=-1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 229, + "publicKeyUncompressed": "0441fc2d90cad55f32c03532626994c5b103ddfb6338873d54ff548d93f11472da0f6c9ab1e27efb9c886d77da474c84b662a952cd332870352ceaa6e50fbb0299", + "publicKeyCompressed": "0341fc2d90cad55f32c03532626994c5b103ddfb6338873d54ff548d93f11472da", + "msg": "68656c6c6f", + "sig": { + "r": "00caa952ad57d56a21e0d54c35b0cd034256d9cd7bae81246a6cd473c9ba9e0288", + "s": "1566f23c6ab34b88968528cb831827a27fe04e9c19e54da0ade8bcb1d28392b7", + "id": 0 + }, + "comment": "R: u1=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 230, + "publicKeyUncompressed": "04e8b1989b0b6b5eee465593c6f81b37b3396cf51e97217dcb8e8fd85610b20df4932eb04ec99a7185381e30ad968d910099fec37c827d3508edcd5d3d59fa7b4b", + "publicKeyCompressed": "03e8b1989b0b6b5eee465593c6f81b37b3396cf51e97217dcb8e8fd85610b20df4", + "msg": "68656c6c6f", + "sig": { + "r": "0087f9d2f48f029188b12fa3b0f2fc76817fdcc63ce2617723a4b25a544f41e18b", + "s": "45f8bfa647740a630894bdd6f8a94728012fda4df73b2276fb3da227cb33ee8f", + "id": 0 + }, + "comment": "R: u1=3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 231, + "publicKeyUncompressed": "047fce31bd3f9b3fb1a842ea17a53baad2352094445a7cf39efc987812ec4b995dca312366f972a01f6bebf5680bf8185621ff50fd028b50e7d1ee7c9da56e29fb", + "publicKeyCompressed": "037fce31bd3f9b3fb1a842ea17a53baad2352094445a7cf39efc987812ec4b995d", + "msg": "68656c6c6f", + "sig": { + "r": "008c4989c84f34517fe93ea1c77a799615ed9dfc194d93cdca258e9b0e14e435a4", + "s": "4345fa9f5917c7e61824a14a8319947eb47a95aec1fd88c54e88c2fb855b8780", + "id": 0 + }, + "comment": "R: u=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 232, + "publicKeyUncompressed": "047416cb6e9b532938adde612e2f5580a97832d89d881f41fc31c75047f2b3ac152c25a58686b933f74ec031fdae871ba2dac4b885808a4d24e28dd79473ed91ee", + "publicKeyCompressed": "027416cb6e9b532938adde612e2f5580a97832d89d881f41fc31c75047f2b3ac15", + "msg": "68656c6c6f", + "sig": { + "r": "37d85fef8747cb6625c89f090d609f42bdd30cde9d69fecbdea1c21afbec5609", + "s": "5568375c18eab0c1bf6f5454de3b7a9abd1a29f8652ab0cdb19cee100c590158", + "id": 0 + }, + "comment": "R: u=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 233, + "publicKeyUncompressed": "045844b942cec91c9d6dfa2f97ee3b933bf342437b51c7b2541a035213f1311becd62d024025d47d1e774725c4ee3320e98b412772d413328ba146143320b5e421", + "publicKeyCompressed": "035844b942cec91c9d6dfa2f97ee3b933bf342437b51c7b2541a035213f1311bec", + "msg": "68656c6c6f", + "sig": { + "r": "00b9cbbeee86618b5b768176834e6d4a8323b97100024211abcd079df865a6a2d2", + "s": "00c0ffe6e67317e49123d8dacac48676255e10c45a00cd5e0e29b1e90694f6eb74", + "id": 0 + }, + "comment": "R: v**2=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 234, + "publicKeyUncompressed": "0493c0b8f22f73a1a27c863f0871d764f77ee5ff0a2a8251b0f0a1c9c32a7a86676b96a4d62db806e7ba37003399664e95bc5231906140c72682934230995cc671", + "publicKeyCompressed": "0393c0b8f22f73a1a27c863f0871d764f77ee5ff0a2a8251b0f0a1c9c32a7a8667", + "msg": "68656c6c6f", + "sig": { + "r": "00ed66b0a6171288a6df5fd55deb22c10eaeaca9fdb93b5d59956b51987aeb1942", + "s": "0b794870361405c0424b06be315d84e3a8f19fe1361b5250cc2e2a99deb8847a", + "id": 0 + }, + "comment": "R: v**2=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 235, + "publicKeyUncompressed": "046e3b719c523c4cffc2203d34d2e0df31e308e4e6246c970a080b5d1cc020eb87156c8455caeada889c7ac8f8de193d65725e4f4ba937e14ab64193c91e68cb01", + "publicKeyCompressed": "036e3b719c523c4cffc2203d34d2e0df31e308e4e6246c970a080b5d1cc020eb87", + "msg": "68656c6c6f", + "sig": { + "r": "00927301ece93ac72c494a5ca120221836d84859b17c67e96d2d9318088e8a9fc2", + "s": "0303a8e75fa28ec5a985949a9ad1776452d542503271a687ee2039aafd1bfc72", + "id": 0 + }, + "comment": "R: v**2=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 236, + "publicKeyUncompressed": "04291b734bf5f17536dab9dceeb8a345399f747e3d8895d09bc232d03c76bb4fc909d49f36d64cf58a47d194ec905fa16dd61ae4c4395a64b73cb62e6dbbe1200a", + "publicKeyCompressed": "02291b734bf5f17536dab9dceeb8a345399f747e3d8895d09bc232d03c76bb4fc9", + "msg": "68656c6c6f", + "sig": { + "r": "7ff6ffbfdc347afbcd0b2d320aac84c0f4ad3f262f47f3e7eb1c65fc340b53b5", + "s": "0085cf180404a24e0cef7cedcb311a1e902d1c0562a7825ab8f4b3bad9f75e7245", + "id": 0 + }, + "comment": "R: v**2=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 237, + "publicKeyUncompressed": "04ae34b2fd61a937d5cfdd8d5db1515414247cbdce3234c9c1ae5caa647459c5f90b106681a3cd83faa06e5b309fb0cec5331878ca1b748713a59d2d8387bdae86", + "publicKeyCompressed": "02ae34b2fd61a937d5cfdd8d5db1515414247cbdce3234c9c1ae5caa647459c5f9", + "msg": "68656c6c6f", + "sig": { + "r": "00df302c7721144e7d4a6a06dfbd5f06d63ac7d3610c6170c0b35824aef84be24f", + "s": "0c05659c1d4ef90ee726cee55fdf933b5e7939733043ccf685089ffed959a073", + "id": 0 + }, + "comment": "R: x2=0 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 238, + "publicKeyUncompressed": "047d72e9375e95326a338b0f175956879c181f8b31ae600c9627e68005167d92cc8db65f76976673e506f709df937d138cbc3b46f3d18b2fd97206c595e037e822", + "publicKeyCompressed": "027d72e9375e95326a338b0f175956879c181f8b31ae600c9627e68005167d92cc", + "msg": "68656c6c6f", + "sig": { + "r": "00810cc9530b007654b603dc10dc6bc707b0d3c827bb838175c38f1be2dc0e1c49", + "s": "08531eddc074009066bd3b90047d8551d70ead992fa13454a1f999d8a50b678e", + "id": 0 + }, + "comment": "R: y2=-2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 239, + "publicKeyUncompressed": "048cd900f1432461b0bad3883603fc0cfd51f92e759bcd722651ac8cdddc1cfe790d9bc78b22c351d0b1ee4bef048c669e3d1792af1fb9f074dda9c19eda222886", + "publicKeyCompressed": "028cd900f1432461b0bad3883603fc0cfd51f92e759bcd722651ac8cdddc1cfe79", + "msg": "68656c6c6f", + "sig": { + "r": "00a655cedd14387c223a3a766e5648e7d917c1b51892317c6231b869efd11aed86", + "s": "00a31c8eec009d1e57f5964354f7343a02214a8f004d3f4355ba4034615913a2ed", + "id": 0 + }, + "comment": "R: y2=3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 240, + "publicKeyUncompressed": "040c8b3c05cdff3a6fe784bb55770e4a85fd1509960b70a3435f27f2381396673e8e97de89407f22f253bf9cafe0752651cd7bfa76b6b88916fea69862154f5e89", + "publicKeyCompressed": "030c8b3c05cdff3a6fe784bb55770e4a85fd1509960b70a3435f27f2381396673e", + "msg": "68656c6c6f", + "sig": { + "r": "00c6ec18ec85ec79926b1d630f301d1a08ace807cbbbb6b1e74f66a4e34b3c79f9", + "s": "4f9c2480129b419ff4dcbe90a4f518796c8d4e69f0b1f5c608dbb886019e9ac4", + "id": 0 + }, + "comment": "R: y2=3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 241, + "publicKeyUncompressed": "0468f52cee55d8fc4a46a75befe9db6e4ac2d0b61fc4e869fbbddfbf9c2a88d9a0025013c614cefb5241202737256deb6e5bb88c794e228e0001fb32a92bb65415", + "publicKeyCompressed": "0368f52cee55d8fc4a46a75befe9db6e4ac2d0b61fc4e869fbbddfbf9c2a88d9a0", + "msg": "68656c6c6f", + "sig": { + "r": "4cf2e653839afcd7407d9f807f484a10bb4b2623b57812437126d88f09e33f2c", + "s": "76e665d57afa97e20e88240b2ec0d2720ef2875a86450ffd814297de2af55ea3", + "id": 0 + }, + "comment": "R: w=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 242, + "publicKeyUncompressed": "047d00cf88234c426b4835df20b6790735ccdff004a5c6ed55fe97ac0c9834399ade36b311eac69a954722b96bee92f531b83ae048277e7c6f1b53ee25e364ca7c", + "publicKeyCompressed": "027d00cf88234c426b4835df20b6790735ccdff004a5c6ed55fe97ac0c9834399a", + "msg": "68656c6c6f", + "sig": { + "r": "00dc76e5f5bd796d75523d87449b10ebc5961522cabf56fc66b4b9b9d448747fd3", + "s": "009b7687f94300cde6df9b8a83277a75d981751cbf65fded90d9dba90b29ecc614", + "id": 0 + }, + "comment": "R: w=3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 243, + "publicKeyUncompressed": "04651c2f2f95d9b00ee39bf8fe9f261a9005877d6bdaf0462832490f53746df88bd0e11f367915414bfb42037eb7dbc480dbc5322f9b31d4ca95a14fecc44347c0", + "publicKeyCompressed": "02651c2f2f95d9b00ee39bf8fe9f261a9005877d6bdaf0462832490f53746df88b", + "msg": "68656c6c6f", + "sig": { + "r": "00a933b332f3805199e1ceb439e3ecdacfe9bc916851a636e54159e97f21f41ead", + "s": "0093ec50c35ee1a05460d2c52c43035eee7c3001ded0858d4d8d17a416586011a0", + "id": 0 + }, + "comment": "R: b=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 244, + "publicKeyUncompressed": "040e2908dae4d07e2a977014404b690d465b93ce8021abaa3595ed56d73ea7575729558dde019d195d3c152ac8331e2dfe0d75f6f3b94645175c3b1f77ad14c31e", + "publicKeyCompressed": "020e2908dae4d07e2a977014404b690d465b93ce8021abaa3595ed56d73ea75757", + "msg": "68656c6c6f", + "sig": { + "r": "51aa95a3108b9f9bfcf07788e9bc3a95e4be465e8d175dc635158dd983fc6086", + "s": "5457a08194ce8369acd555b8e7288fe56c3579f30c250b771d80d4b6eda139d5", + "id": 0 + }, + "comment": "R: h=-2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 245, + "publicKeyUncompressed": "046e8006f1096e78dc1912802e73bd8ef733443d45d9c1a809f68a9f6c138e8958a75821c148a46c1df6953e184e5fbbd9361504109a1c90c5a8d967e9d95078f4", + "publicKeyCompressed": "026e8006f1096e78dc1912802e73bd8ef733443d45d9c1a809f68a9f6c138e8958", + "msg": "68656c6c6f", + "sig": { + "r": "00ff219ff783c3ea55256663273a5ae39135895cfca3b6771d645977eb779798bd", + "s": "0e27004def07d5b9bc061c36a5af8356e6433182e732c7a9ae356451ece2f446", + "id": 0 + }, + "comment": "R: h=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 246, + "publicKeyUncompressed": "04c7d94ad71aef9c21e849b30b0be8a472e80861448ef0b9600c749d6d5ea6a2db45616e01fdd2a4dab0f56f0ee081c32133e4e17a7cca24c902131d521c1bd3f1", + "publicKeyCompressed": "03c7d94ad71aef9c21e849b30b0be8a472e80861448ef0b9600c749d6d5ea6a2db", + "msg": "68656c6c6f", + "sig": { + "r": "30d33d47c71ac31f1a3a0801c96d35046fa3bce782d3fff0fa1165fc5955dd7b", + "s": "00f30c3b5bef2a3cee3853275941d6cf25e1f7478c62caea737352cbf2b0c19f99", + "id": 0 + }, + "comment": "R: s**2=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 247, + "publicKeyUncompressed": "0447079cd0f557f08b5ba52e7e00d1dd3fa8441d69af0d80da44ce9e42dfad18eb9a7b4503f45500a521618626f9fe8d879d16c92e87750bc17293203a45d9fac7", + "publicKeyCompressed": "0347079cd0f557f08b5ba52e7e00d1dd3fa8441d69af0d80da44ce9e42dfad18eb", + "msg": "68656c6c6f", + "sig": { + "r": "00b270df208af53772ddaf632480405eaac58f0cbdbfaf3dc58b9ce8aaf8015f79", + "s": "00ed43a0c84cbabce3d7b6bd7f8b1049c7a2d716dbf02b3ede079713cf3e8d2b37", + "id": 0 + }, + "comment": "R: s**2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + } + ] +} \ No newline at end of file diff --git a/packages/crypto/testdata/rootberg/ecdsa_secp256r1_sha_256_raw.json b/packages/crypto/testdata/rootberg/ecdsa_secp256r1_sha_256_raw.json new file mode 100644 index 0000000000..7b6f4c7274 --- /dev/null +++ b/packages/crypto/testdata/rootberg/ecdsa_secp256r1_sha_256_raw.json @@ -0,0 +1,5720 @@ +{ + "testType": "EcdsaVerify", + "algorithm": { + "type": "Ecdsa", + "curve": "secp256r1", + "sha": "SHA-256", + "encoding": "RAW", + "normalize": false, + "signature_generation": "Generic" + }, + "version": "0.34", + "description": [ + "The underlying elliptic curve is secp256r1", + "The message digest for hashing the input is SHA-256", + "Signatures are dictionaries containing r, s and id, where id is the recovery id used by a number of protocols that verify signatures by recovering the public key. Public keys are given as a pair of coordinates", + "The test vectors were generated for signature verification through public key recovery." + ], + "references": [], + "numTests": 407, + "tests": [ + { + "tcId": 1, + "publicKeyUncompressed": "0478d7ebd671ff11457b9029420fa4ae9c1952bdc3f466e9ddd67d0dcf5ff4cac2d7f9fd5fdc2f7809a06bb1bb76cc9bdfda34e3877e7791e37f61cee905001827", + "publicKeyCompressed": "0378d7ebd671ff11457b9029420fa4ae9c1952bdc3f466e9ddd67d0dcf5ff4cac2", + "msg": "", + "sig": { + "r": "1aed68d0defeb7aa8143aed4f5969e872f9a7d00ef524a552b72c8d9a30256c0", + "s": "70d6dd0ecee8dc2ecf9d8968d7fbb01c2eb62997ffa4936ccb946adabf7a0ea3", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 2, + "publicKeyUncompressed": "0478d7ebd671ff11457b9029420fa4ae9c1952bdc3f466e9ddd67d0dcf5ff4cac2d7f9fd5fdc2f7809a06bb1bb76cc9bdfda34e3877e7791e37f61cee905001827", + "publicKeyCompressed": "0378d7ebd671ff11457b9029420fa4ae9c1952bdc3f466e9ddd67d0dcf5ff4cac2", + "msg": "000102030405060708090a0b0c0d0e0f", + "sig": { + "r": "1df5d83faf0c861a47037a66e1307f37078a8243a505c457e83772811261b5cc", + "s": "542949813764ec8c257a9e1ef313d8c9a6607ad6d59f109361ef9055a96bfffa", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 3, + "publicKeyUncompressed": "0478d7ebd671ff11457b9029420fa4ae9c1952bdc3f466e9ddd67d0dcf5ff4cac2d7f9fd5fdc2f7809a06bb1bb76cc9bdfda34e3877e7791e37f61cee905001827", + "publicKeyCompressed": "0378d7ebd671ff11457b9029420fa4ae9c1952bdc3f466e9ddd67d0dcf5ff4cac2", + "msg": "616263", + "sig": { + "r": "10297b844574025822882c844688eb466e80dad008aac18ef247f1fbd0173248", + "s": "00ef9767420e1ce26f7173ecde8ed7523e41ade0db11806f3d51b050531d801f67", + "id": 1 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 4, + "publicKeyUncompressed": "0478d7ebd671ff11457b9029420fa4ae9c1952bdc3f466e9ddd67d0dcf5ff4cac2d7f9fd5fdc2f7809a06bb1bb76cc9bdfda34e3877e7791e37f61cee905001827", + "publicKeyCompressed": "0378d7ebd671ff11457b9029420fa4ae9c1952bdc3f466e9ddd67d0dcf5ff4cac2", + "msg": "54657374", + "sig": { + "r": "00e94f07da4b86c64ef27477603e9ced7161ddba26644147029420dd37ff662983", + "s": "7644fbcd5eee4a4b8593af948eda2c0f568155a18d4ca075c74b35018866b868", + "id": 0 + }, + "comment": "normal", + "valid": true, + "flags": ["normal"] + }, + { + "tcId": 5, + "publicKeyUncompressed": "04103c6ecceff59e71ea8f56fee3a4b2b148e81c2bdbdd39c195812c96dcfb41a72303a193dc591be150b883d770ec51ebb4ebce8b09042c2ecb16c448d8e57bf5", + "publicKeyCompressed": "03103c6ecceff59e71ea8f56fee3a4b2b148e81c2bdbdd39c195812c96dcfb41a7", + "msg": "54657374", + "sig": { + "r": "05", + "s": "05", + "id": 0 + }, + "comment": "r=5, s=5", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 6, + "publicKeyUncompressed": "046ddef3dd37789cd572c4e749c3c50ee1f0d0ef8f19c0e81e6e1a82202125f7475d58524eab7c7c7865fd0efeb5aeea57e86d773033e9a66aedc53b0fd1326592", + "publicKeyCompressed": "026ddef3dd37789cd572c4e749c3c50ee1f0d0ef8f19c0e81e6e1a82202125f747", + "msg": "54657374", + "sig": { + "r": "06", + "s": "06", + "id": 0 + }, + "comment": "r=6, s=6", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 7, + "publicKeyUncompressed": "04eeb67b9a7755c2f997999a45c3c0f88fc606fe5cf13207f176dc22d91d8dcc5e3cedeaa4020ed96afc6fa690a8cae81b05974362a0241633327d4932b5972067", + "publicKeyCompressed": "03eeb67b9a7755c2f997999a45c3c0f88fc606fe5cf13207f176dc22d91d8dcc5e", + "msg": "54657374", + "sig": { + "r": "08", + "s": "08", + "id": 0 + }, + "comment": "r=8, s=8", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 8, + "publicKeyUncompressed": "0469eab3d6892ff32700bc6bc56f9a860da29d17a7956746f8519fc22ba5c67b5fcef770cdb7bbfa304797de81d521926ff8b38fb4918bc607d356aebc767f7905", + "publicKeyCompressed": "0369eab3d6892ff32700bc6bc56f9a860da29d17a7956746f8519fc22ba5c67b5f", + "msg": "54657374", + "sig": { + "r": "09", + "s": "09", + "id": 0 + }, + "comment": "r=9, s=9", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 9, + "publicKeyUncompressed": "0478d844dc7f16b73b1f2a39730da5d8cd99fe2e70a18482384e37dcd2bfea02e1ed6572e01eb7a8d113d02c666c45ef22d3b9a6a6dea99aa43a8183c26e75d336", + "publicKeyCompressed": "0278d844dc7f16b73b1f2a39730da5d8cd99fe2e70a18482384e37dcd2bfea02e1", + "msg": "54657374", + "sig": { + "r": "7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "s": "7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "id": 0 + }, + "comment": "r=(n+1)/2, s=(n+1)/2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 10, + "publicKeyUncompressed": "04b4cec42bb4f6ca080f38e4e0c19dcd4e100ccd8a93c1145a31d5a2dee7800277ff35258c19d9f89298f893ecf0a6bf8ed83c71b3d0abfcb57a15a6ac6a4c54cc", + "publicKeyCompressed": "02b4cec42bb4f6ca080f38e4e0c19dcd4e100ccd8a93c1145a31d5a2dee7800277", + "msg": "54657374", + "sig": { + "r": "7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "s": "7fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "id": 0 + }, + "comment": "r=(n+3)/2, s=(n+3)/2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 11, + "publicKeyUncompressed": "04deb1ab3dc75d808c6d19bbcc6138436b2bc38b8f6590a84f3c12e00143b1b92b5c7f1d652862c6e931c3c6d08a5efa910f92bd50c04059fa87f2e3954a6e5d71", + "publicKeyCompressed": "03deb1ab3dc75d808c6d19bbcc6138436b2bc38b8f6590a84f3c12e00143b1b92b", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "s": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "id": 0 + }, + "comment": "r=n-2, s=n-2", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 12, + "publicKeyUncompressed": "04c485cd6855dd663043b79cba098ccca51fafc718d53138bbf3161b0cf180dbe013e33954c2d91127471f3ef66f7d688cc87a7f9170529d2f1398c5958387d555", + "publicKeyCompressed": "03c485cd6855dd663043b79cba098ccca51fafc718d53138bbf3161b0cf180dbe0", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "s": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "id": 0 + }, + "comment": "r=n-3, s=n-3", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 13, + "publicKeyUncompressed": "0474a621acb0b017a37e79ed19e58be4275fd962b0cb9002062f33e31353213748b9c36177836bb033fc1a6dfdd216686e76c0af1b845a9b6bf5a0f796b503db28", + "publicKeyCompressed": "0274a621acb0b017a37e79ed19e58be4275fd962b0cb9002062f33e31353213748", + "msg": "54657374", + "sig": { + "r": "7b", + "s": "00b21642c7a6f4de9c8590b21642c8590af2b6f12ae38add9423fbae7161a92517", + "id": 0 + }, + "comment": "r and s^-1 small", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 14, + "publicKeyUncompressed": "04f785ceeefe2e6560b2146f1816ba9929ed6cbf6788a2e82af3de8c3e62967639ba2018e53ca9bdcf67edc0f3b06ce1a8008a4540243e7264fca1d9c89857c791", + "publicKeyCompressed": "03f785ceeefe2e6560b2146f1816ba9929ed6cbf6788a2e82af3de8c3e62967639", + "msg": "54657374", + "sig": { + "r": "3039", + "s": "00e62027d80c0b6a9ea2c034e51427b717a4eab2c011de1f466bdbc6bb4fd7667c", + "id": 0 + }, + "comment": "r and s^-1 are 16 bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 15, + "publicKeyUncompressed": "04adedeed10b833c27928977292391a6f08a8c1c968db010f6d3f7898f1e47e7047fc3e55945ca1f0d5c21a988ba1afa465212dd158916b7314414ed1492d631b5", + "publicKeyCompressed": "03adedeed10b833c27928977292391a6f08a8c1c968db010f6d3f7898f1e47e704", + "msg": "54657374", + "sig": { + "r": "24f22125a254278f", + "s": "008d00c610ee357b04f2eeacc811ffc54895931b3287c3a4e3f80b39005d45688a", + "id": 0 + }, + "comment": "r and s^-1 are 64 bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 16, + "publicKeyUncompressed": "043ca84e3dcc7e60a84fb164818c74d562d9567355e7b52eb3ac4dd4614758447b7048c1e0f9266fe92875f78b53ad7cee5e0551f6fd2d0aefb864217a067192ab", + "publicKeyCompressed": "033ca84e3dcc7e60a84fb164818c74d562d9567355e7b52eb3ac4dd4614758447b", + "msg": "54657374", + "sig": { + "r": "00fffffffffffffffd", + "s": "1d702a231af70e2602791bfd535e466efac1e065553149e559e3e70f9bf9a3e6", + "id": 0 + }, + "comment": "r and s^-1 are edge case 64-bit integers", + "valid": true, + "flags": ["special_rs"] + }, + { + "tcId": 17, + "publicKeyUncompressed": "049ff8dd1a14ed1d9fcb5550fce9872a4265ceb2b4d91c36c3bb2788043cab3f72e61aea69c49a64686fd17824d69334ce0be26d54228e77178bcf2f36452c0d83", + "publicKeyCompressed": "039ff8dd1a14ed1d9fcb5550fce9872a4265ceb2b4d91c36c3bb2788043cab3f72", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000004", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 18, + "publicKeyUncompressed": "041821e8332bb36f75bcc020868bbbf8f5c1e847dea812e6b27805dcd1614e9b47e3fa914dd55fbc2df62032618823370ff07133bff4dd9365e0c1f78147008f17", + "publicKeyCompressed": "031821e8332bb36f75bcc020868bbbf8f5c1e847dea812e6b27805dcd1614e9b47", + "msg": "54657374", + "sig": { + "r": "008000000000000000000000000000000000000000000000000000000000000004", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 19, + "publicKeyUncompressed": "04f3cf45431c08d3645a2a4dce9e6cb8a454d98e14391c5c8d552e7cf4a2d0cc3615cfdda84ca29e5c4999d7d60caf84365b39f0bda36cca5d2993e7133e4703e9", + "publicKeyCompressed": "03f3cf45431c08d3645a2a4dce9e6cb8a454d98e14391c5c8d552e7cf4a2d0cc36", + "msg": "54657374", + "sig": { + "r": "0100000000000000000000000000000000000000000000000000000000000000", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 20, + "publicKeyUncompressed": "04fbc967eaafc13fa11a2e61ede16ad4380918b20e5ec1b26a9c1914a529b25a7dc9750fa195cc39b2a74f71902a896c29bb733651b6e951862d16de6a6ebbc762", + "publicKeyCompressed": "02fbc967eaafc13fa11a2e61ede16ad4380918b20e5ec1b26a9c1914a529b25a7d", + "msg": "54657374", + "sig": { + "r": "0100000000000000000000000000000000000000000000000000000000000000", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 0 + }, + "comment": "R: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 21, + "publicKeyUncompressed": "04586bdd0f625de9944c584b383cf1cfbec2f35e8af62ef2b6b2a17f60206188b34316d70855824ccd5aa78e3feb5447bd292950a9892ad22cb377dff02d43928a", + "publicKeyCompressed": "02586bdd0f625de9944c584b383cf1cfbec2f35e8af62ef2b6b2a17f60206188b3", + "msg": "54657374", + "sig": { + "r": "0080", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 22, + "publicKeyUncompressed": "0434a9d68e44a1b57e05efbe11211a3f4ae08dbdfaa7866aae3f74bdcc9b3959fef1bfd8f3ca011ff72775a9d3750f3edfb2d64d1bc1d20e7a396144567a9a2f70", + "publicKeyCompressed": "0234a9d68e44a1b57e05efbe11211a3f4ae08dbdfaa7866aae3f74bdcc9b3959fe", + "msg": "54657374", + "sig": { + "r": "0080", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 0 + }, + "comment": "R: small x coordinate", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 23, + "publicKeyUncompressed": "04acfaefb43c20c6ff94b9e5907615a006da9b3cbd2907e043a5414f241a34b39325a239f5e22a36c7682b850493ef2633e25814b3f6138906a965976a1b6a249f", + "publicKeyCompressed": "03acfaefb43c20c6ff94b9e5907615a006da9b3cbd2907e043a5414f241a34b393", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 2 + }, + "comment": "R: large x-coordinate (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 24, + "publicKeyUncompressed": "046cd0b0c6853213692a6828f2ae0923b6f3e299d0498f8b94d4fd5ba5090ef8da741cad016be6bff676196f4f5cc7d00c4f01ec6f07bfe276ab61ddcb60ef9f8d", + "publicKeyCompressed": "036cd0b0c6853213692a6828f2ae0923b6f3e299d0498f8b94d4fd5ba5090ef8da", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 2 + }, + "comment": "R: large x-coordinate (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 25, + "publicKeyUncompressed": "0481e106207a350a3f55e0a08e85e7f0bc88eb08f74e79fa283b9c4c1a7c85de8e85845f67feb3892331862e203c857a6d1cfe3f5fb5cc7a857fc91593e507c8d3", + "publicKeyCompressed": "0381e106207a350a3f55e0a08e85e7f0bc88eb08f74e79fa283b9c4c1a7c85de8e", + "msg": "54657374", + "sig": { + "r": "4319055358e8617b0c46353d039cdaac", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 2 + }, + "comment": "R: x-coordinate close to p (Could not recover R)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 26, + "publicKeyUncompressed": "04ce3cbbce1dc37c14ab795f9a65214f69b63a8edbde32bd5dc893672799de865f7cb2c3f9ec411b23197ed32592f152d329cc39925ca4196be5196a687f39fb79", + "publicKeyCompressed": "03ce3cbbce1dc37c14ab795f9a65214f69b63a8edbde32bd5dc893672799de865f", + "msg": "54657374", + "sig": { + "r": "4319055358e8617b0c46353d039cdaac", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 2 + }, + "comment": "R: x-coordinate close to p (Could not recover R)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 27, + "publicKeyUncompressed": "0414c3ec792ac70f5e8431a39016573923540510472ce52172fd1d465a91b444f578192a9c6b93b433cbdbdeb779630150b115a22914463c7e4ee7fb4640d408ab", + "publicKeyCompressed": "0314c3ec792ac70f5e8431a39016573923540510472ce52172fd1d465a91b444f5", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 2 + }, + "comment": "R: x-coordinate < 2**255 (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 28, + "publicKeyUncompressed": "046e13ef62f94695ad11334fa8c80bca17afd173cecb72378d8fd87afb6879450388e21110167402b4d5c67b6aca74dbb3107bbe44af33d4901748ba24bb50cd06", + "publicKeyCompressed": "026e13ef62f94695ad11334fa8c80bca17afd173cecb72378d8fd87afb68794503", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 2 + }, + "comment": "R: x-coordinate < 2**255 (Invalid signature: r too large)", + "valid": false, + "flags": ["special_R"] + }, + { + "tcId": 29, + "publicKeyUncompressed": "04730b70ba330cb1c59ca72ab0e8d7277e9e36d107ff6af494e405c45a0e868ad11b1f58872c2bd6a78256dbd14717644329f65e970e3456b91b0c602c812cc9b6", + "publicKeyCompressed": "02730b70ba330cb1c59ca72ab0e8d7277e9e36d107ff6af494e405c45a0e868ad1", + "msg": "54657374", + "sig": { + "r": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "s": "14f9d5b0aa8902335126115bf781e1fa75e276fbf231fc21655f4698c4f5dc4c", + "id": 0 + }, + "comment": "R: x-coordinate < 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 30, + "publicKeyUncompressed": "044ffa96ae4ffa90f4fa775f91c2d564228b03896229946b9ff7d87ad1f3034effbe998de49a94456c4a1118ea442f0a539767978fc7342d15e723156abdf64ca1", + "publicKeyCompressed": "034ffa96ae4ffa90f4fa775f91c2d564228b03896229946b9ff7d87ad1f3034eff", + "msg": "54657374", + "sig": { + "r": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "s": "0088d6a41c104c10d426cdf01a24bd170b6b70c06b1feb19c1d3a2582361d9db20", + "id": 0 + }, + "comment": "R: x-coordinate < 2**248", + "valid": true, + "flags": ["special_R"] + }, + { + "tcId": 31, + "publicKeyUncompressed": "04ace5d091b0472d05f4b05c42512b82ce733fbefa1683c64823430b9a74d332c97634a917c8ad4f58ebea0c97b7d8d8089d079781c646366109b83db613babafa", + "publicKeyCompressed": "02ace5d091b0472d05f4b05c42512b82ce733fbefa1683c64823430b9a74d332c9", + "msg": "5465737420", + "sig": { + "r": "00adbae1693ae4989561e35d2b0eb498b6cd8a52f1bd514785b00c927275877055", + "s": "58ce68e6a62175931f1d6cd57ea955c01814e2ebf3220c68d8b74d4241dd0e28", + "id": 0 + }, + "comment": "u1 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 32, + "publicKeyUncompressed": "040112218fa9e97fb629b471dc886db5642e2234ec03416a3d18b9ea990a8f7c87424b1cf351bcb221912735baaa521bbfe3ad69b6a4e1a2a3715358a9e1ab3bf4", + "publicKeyCompressed": "020112218fa9e97fb629b471dc886db5642e2234ec03416a3d18b9ea990a8f7c87", + "msg": "5465737420", + "sig": { + "r": "2b011abef4317747417e04ed9c7ba6f6679d4cfdd26985257ed9de78c771caa2", + "s": "2b011abef4317747417e04ed9c7ba6f6679d4cfdd26985257ed9de78c771caa2", + "id": 0 + }, + "comment": "u2 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 33, + "publicKeyUncompressed": "04833923c4b77eb67155e2bb9d9e82b6eb116d79b67d7fb6549e612fb006dfc094a44af5e77b22bcc0ac221c6ab24bb02f7e080de1a2bfab1168d66d4f86ee0adc", + "publicKeyCompressed": "02833923c4b77eb67155e2bb9d9e82b6eb116d79b67d7fb6549e612fb006dfc094", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "0c93c70a2a69f8093b3d6475a14e4e6adc810ee2d0837cdd21b1da14ba7c8bf0", + "id": 0 + }, + "comment": "u1 = u2 = 1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 34, + "publicKeyUncompressed": "04aa5ed8546f94834783a923004a05beb7bd7fb1487f6862bb078ae407995514302cdfb96b371242ce6118e5d0a69a8486398249054e5c1224cf8ca0c10b77a6bb", + "publicKeyCompressed": "03aa5ed8546f94834783a923004a05beb7bd7fb1487f6862bb078ae40799551430", + "msg": "5465737420", + "sig": { + "r": "610c579177b9adf8e8b324b707e039ee393441bbd46e2680e7b2654c25c47842", + "s": "2c6734735310bac98f8eb66abf54aae00c0a7175f99106346c5ba6a120ee8714", + "id": 0 + }, + "comment": "u1 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 35, + "publicKeyUncompressed": "04871955008c263fd677d9a3caa1e19eba50760e3e534d4bac100b2e2bd2d54043c88011aab19d43e38312370cab5a2f6139d4bf07ae5d12ff58b56c90af48aca8", + "publicKeyCompressed": "02871955008c263fd677d9a3caa1e19eba50760e3e534d4bac100b2e2bd2d54043", + "msg": "5465737420", + "sig": { + "r": "05f4fba39a3ce3c53087ab9e63855e844d4e43525cf8e96352310530a5242619", + "s": "0082fa7dd14d1e71e31843d5cf31c2af42051a9f00020843f422f567f9d0c3a5b5", + "id": 0 + }, + "comment": "u2 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 36, + "publicKeyUncompressed": "04b43ddda1c7071d1ae18539dac573e1ae420b1e12c3fd6a88aafdf7ee911b5d1dd0419ed71b5c846a528bd7c16e491e2967d205f0f7f3c9a4935bc9df98256cfd", + "publicKeyCompressed": "03b43ddda1c7071d1ae18539dac573e1ae420b1e12c3fd6a88aafdf7ee911b5d1d", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "00f041982f2c04e24054daba53560b6f9b4a415c338d5c35a63de95f2169df0696", + "id": 0 + }, + "comment": "u1 = u2 = 2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 37, + "publicKeyUncompressed": "04e9f9669c7a4a0d9f7fa2acfad8e6f0fb4aa0d15d43718abb0d267f7e17228bd3296e3f223ed383f709304376c418aebfacdc92b5bc9e464d06967fbee56f6aab", + "publicKeyCompressed": "03e9f9669c7a4a0d9f7fa2acfad8e6f0fb4aa0d15d43718abb0d267f7e17228bd3", + "msg": "5465737420", + "sig": { + "r": "14a322b0cdc51e5a2bd9fad9b72e418aa7da56da78e3c860fcea6af4228886b6", + "s": "72ef784c8cb5d1dc0a5f24472a3871ea9c53f48888bde3a4997b0801bf6abbd3", + "id": 0 + }, + "comment": "u1 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 38, + "publicKeyUncompressed": "046eb9343a38c65742471cb15badbb5fa40248b1a3a6b3648dde9edc1e6c0df8b6e09419a7b75f10c8251dd2ba2eeaacba7748732c4ccf67d5a039e7d222a848c6", + "publicKeyCompressed": "026eb9343a38c65742471cb15badbb5fa40248b1a3a6b3648dde9edc1e6c0df8b6", + "msg": "5465737420", + "sig": { + "r": "63d65adcb02ed08d7e40833d5f68bf620869d4476fa109fb59bc89e706af03f8", + "s": "00cbf21e48e564f02fd4c02bbf1fcd952080bd43363f456d01c0655fceffd1c4de", + "id": 0 + }, + "comment": "u2 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 39, + "publicKeyUncompressed": "04834212ec22a024ac2a8ebeaf9b199fe4fe3539d6005b2f9b6b4ef0f8f97f1d0c65f0e2cb48f93ccf126348f18590062886b74db03ff08ec645429226d719455e", + "publicKeyCompressed": "02834212ec22a024ac2a8ebeaf9b199fe4fe3539d6005b2f9b6b4ef0f8f97f1d0c", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "39040a9a57fe9088a704907ed59cc79318f30c87097648347edb2c5f0847cf1e", + "id": 0 + }, + "comment": "u1 = u2 = 3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 40, + "publicKeyUncompressed": "04bb7c3d96a8c3ee25dd8685077814592a0492822a4dcb04e55c5260e520da73a1c03c631ce3caa0ffae9f7804711abdd0d1d0da74f0104d010ff83ac6d5571da2", + "publicKeyCompressed": "02bb7c3d96a8c3ee25dd8685077814592a0492822a4dcb04e55c5260e520da73a1", + "msg": "5465737420", + "sig": { + "r": "00eb425f91b46b52dc284f4ff789d9d53255b86f4bb8529fee0ce2f2e3631b7dc3", + "s": "00a731971859de8a6de0e2932a8156aa3fa4d217c1b3f5921c1b027d80ba861729", + "id": 0 + }, + "comment": "u1 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 41, + "publicKeyUncompressed": "04def6a876fcbe688786c7c3f2802db801de53afba7c1ac83648e81349bd6d06a4129825769ff3daf08b774d3fb4f11d246375534c0bf25ba83104ed00b38cbbad", + "publicKeyCompressed": "03def6a876fcbe688786c7c3f2802db801de53afba7c1ac83648e81349bd6d06a4", + "msg": "5465737422", + "sig": { + "r": "00f43cb86e087127f5a0ed57a2dc02426b57d29301b87fd697d6812dd4d5fdce1b", + "s": "0bc34790f78ed80b5f12a85d23fdbd94651467abee97c7ed1d389cee26655736", + "id": 0 + }, + "comment": "u2 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 42, + "publicKeyUncompressed": "045e941e6841e748538e70c2cf3479e9fd4c95cf9f21ac126a8ab0f2068045406918870c908afaee0d216bc7209944fe5d0a652977f6d57d183ef607430954f443", + "publicKeyCompressed": "035e941e6841e748538e70c2cf3479e9fd4c95cf9f21ac126a8ab0f20680454069", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "0bc34790f78ed80b5f12a85d23fdbd94651467abee97c7ed1d389cee26655736", + "id": 0 + }, + "comment": "u1 = u2 = n-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 43, + "publicKeyUncompressed": "0451b7b54a85422e89ff74cde0477a33f5026926e9d0d4925c442378744cad2768940fee4f3d515b792e1a499e8c464e6de99939de5a1b303e91ed5cb3031b6979", + "publicKeyCompressed": "0351b7b54a85422e89ff74cde0477a33f5026926e9d0d4925c442378744cad2768", + "msg": "5465737420", + "sig": { + "r": "008b90d9b5d4a037411eb6504d6fefdaf37f306268c2433a7d95cd4a4f4bbbb9c9", + "s": "00d398cb8bacef45377071499540ab551fb0dc8937ad869850875e2421db749e3d", + "id": 0 + }, + "comment": "u1 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 44, + "publicKeyUncompressed": "044e8bc50081d0e1cd868f080a8641bce1a67ba13a219f4fcec6921f9b83310680d22ff8b501929c833fd1d5234f37da70cd84f01751c48b5acce97c0dd1e915f7", + "publicKeyCompressed": "034e8bc50081d0e1cd868f080a8641bce1a67ba13a219f4fcec6921f9b83310680", + "msg": "5465737421", + "sig": { + "r": "38483039642b1c06b139689cf9adeb2ef46a85c0134358bf9e9a84026ba9a171", + "s": "63dbe7e2cdea71fd27634bb183290a68643e3a76c9ea22e2aa8fa360485cc1f0", + "id": 0 + }, + "comment": "u2 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 45, + "publicKeyUncompressed": "045d0f572ee19de4dd8c524143860862a7c30a646b177bcfb73812f232be50e160d16c30cd7c053f89e8f23a57823db5f9d8391fed9d68861b62f27fe0eda4bf90", + "publicKeyCompressed": "025d0f572ee19de4dd8c524143860862a7c30a646b177bcfb73812f232be50e160", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "4cb11cbdabbb38434e52c5a79f92026cb259ad09a90869a3d0ab12db049176fe", + "id": 0 + }, + "comment": "u1 = u2 = n-2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 46, + "publicKeyUncompressed": "04057a4f73e84d4631a2102880feb701edccf18c9b719e9731014fb0821aee98516a253d36071e150eb306cccdce8e776aa5049da4a0256b0baa13250a0bd631fa", + "publicKeyCompressed": "02057a4f73e84d4631a2102880feb701edccf18c9b719e9731014fb0821aee9851", + "msg": "5465737420", + "sig": { + "r": "00811d2839efad8cb1249fdfdc7c276ba904dde1f30e517ab248c9a159d31ffad7", + "s": "008d1087b2734a2e24f5a0dbb8d5c78e15209306251e59bae05a3ec2c13cf8697e", + "id": 0 + }, + "comment": "u1 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 47, + "publicKeyUncompressed": "04e8140a62cfef5fbd1481a83a19116971c9caa3047cf275dcbda648b0809b0b211fb7560ea1e08a48e48b82b26131eab8b52d883ee3b6c227c6145b29e80e4ea6", + "publicKeyCompressed": "02e8140a62cfef5fbd1481a83a19116971c9caa3047cf275dcbda648b0809b0b21", + "msg": "5465737424", + "sig": { + "r": "00c61cbf1237752c7053f06f1bbc9ec093c85043701f185a1e296fff3fcb2e333b", + "s": "00bdf66af8ed839bdb8eafdaf6c1206a7924cc39884764d5d03b3f20586353bee8", + "id": 0 + }, + "comment": "u2 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 48, + "publicKeyUncompressed": "04a53cf2ae328d8c08d5c282d51d694761eab798f27d643e942f7cd0194a36d4edc7c8113bf0f3110122c2f6428878880a45a41b66d4a6431cc7e32593312c44c0", + "publicKeyCompressed": "02a53cf2ae328d8c08d5c282d51d694761eab798f27d643e942f7cd0194a36d4ed", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "00b796f49ecae56108a2684f116e2a323e5f4645c84f3ed77b971ecabc3e5d1f27", + "id": 0 + }, + "comment": "u1 = u2 = n-3", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 49, + "publicKeyUncompressed": "04e51b91aba2f191b4b69efce0ea8811bbdbf5d37994a17d5213d3f4f631876bdbd24b6b4a9e7d0fef169af9f3206a2e7ffc601681bf46fedb334a2bbe308f7453", + "publicKeyCompressed": "03e51b91aba2f191b4b69efce0ea8811bbdbf5d37994a17d5213d3f4f631876bdb", + "msg": "5465737420", + "sig": { + "r": "008f5094c78c560d4373fcc708da15ecaa2d1eb38925b958fab27c6dd27bfe757c", + "s": "2170516b452c8215f9c6ea3bb377bba6542a04c057311d38d233b2b3588137d5", + "id": 0 + }, + "comment": "u1 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 50, + "publicKeyUncompressed": "0448610b1b6f7579bd76d934ce582c7b170ae4ae7e7138b248a59b1c6c058d06a8b75261204ce31eb7dee456f334468be816cc5699b97594395c4cd5b80d4f0025", + "publicKeyCompressed": "0348610b1b6f7579bd76d934ce582c7b170ae4ae7e7138b248a59b1c6c058d06a8", + "msg": "5465737420", + "sig": { + "r": "00cbbae2b8b45ceaeab2b28c092fa53a6d6f64fc1bfde41d85a21b776f437a4894", + "s": "0a74390e0f209dd142a917315cdef45075e6cc83883d80331052dd7724fb5f59", + "id": 0 + }, + "comment": "u2 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 51, + "publicKeyUncompressed": "04cf1c00cca7970879df8f48fb50b5416f1a37950abc81ce529077a728f23c255a112e4f6bf790ea8f82bbe333e763273fbd3bc6790c31263a18a53391536c3639", + "publicKeyCompressed": "03cf1c00cca7970879df8f48fb50b5416f1a37950abc81ce529077a728f23c255a", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "00e426fb85e67293fcfd850f772d71afa51a6731fe92aeb883c1919305af757e3f", + "id": 0 + }, + "comment": "u1 = u2 = n-5", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 52, + "publicKeyUncompressed": "0456da1d3aaba1dc8bb5971976967b409c0bcc445dc7b72eced76a4a43843afb5cd069f859e2773704e9a19652e8b0a92f210a58b170024946245172146de6db4e", + "publicKeyCompressed": "0256da1d3aaba1dc8bb5971976967b409c0bcc445dc7b72eced76a4a43843afb5c", + "msg": "5465737421", + "sig": { + "r": "4612d6670c8bc9e096f1dd491e8dcbfc1c69977ca83ccf37d89476deda88792e", + "s": "00d52491d3ff878c80194a4d3e06cfefc9e881ce8414dcd4e81e8b4af0434450eb", + "id": 0 + }, + "comment": "u1 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 53, + "publicKeyUncompressed": "04db9c5c09539e85c3c323d28254f1d96c3a5340e8e9826d3b94bc6ac5fc922afa2ec89b86883172ab5f378a5f568351548e3afef1fd6fbef4d576a8c0119caa02", + "publicKeyCompressed": "02db9c5c09539e85c3c323d28254f1d96c3a5340e8e9826d3b94bc6ac5fc922afa", + "msg": "5465737423", + "sig": { + "r": "00db493b92e682f8fd85e7564aacc8d3ef66456a2cd16292c678f6597c7555bd3e", + "s": "00e0ac653328366eb8360385f55507e1b8f76f5939892e1bd65028e28ca27b77ff", + "id": 0 + }, + "comment": "u2 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 54, + "publicKeyUncompressed": "04c344d753a587b0913752a2ea6bef68eaad3b3a1f24b46818aaef960c9a302f104c43c55419411e172eb48b95586f2a18534302d9be33f9d6f206bb7b8fdcfd5c", + "publicKeyCompressed": "02c344d753a587b0913752a2ea6bef68eaad3b3a1f24b46818aaef960c9a302f10", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "148aae5ff24d1bbbed7b1e3bb52f30d3b4536e126db7a3741b98773046c84562", + "id": 0 + }, + "comment": "u1 = u2 = n-7", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 55, + "publicKeyUncompressed": "0464df53f92370a92c862b01c384f4b8e14cbec00c54e21205ab44bc36e2ccbb2e8e2691c5c610deb4fee3c55c93acf8a0aa7aa8c794b21815a2501418252fc11e", + "publicKeyCompressed": "0264df53f92370a92c862b01c384f4b8e14cbec00c54e21205ab44bc36e2ccbb2e", + "msg": "5465737423", + "sig": { + "r": "08d2ef445b42cccd60db68b400c80bca45bdd4e37e31560679f723a0d14e1928", + "s": "74c1b653d55e3ceb0b3f53534c091664e6dd401af0e927b8d109ee521a78d3e8", + "id": 0 + }, + "comment": "u1 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 56, + "publicKeyUncompressed": "047ccb293843104ee2884eb188d9fff372a22eb9e19f0a994118ed777cfd09671681ac5fc9ce5bd6912770339be705c0380a867ba1a9e3c0ee865c7840384547b2", + "publicKeyCompressed": "027ccb293843104ee2884eb188d9fff372a22eb9e19f0a994118ed777cfd096716", + "msg": "5465737421", + "sig": { + "r": "0097df10ed96ce9fa49f0a4105333dc1d7dd6961ac2bc82ba25b4f44d80c37c5a3", + "s": "2fbe21dc2d9d3f483e14820a667b83affdebc8aab078b8bfc2e4beed1c0c65f5", + "id": 0 + }, + "comment": "u2 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 57, + "publicKeyUncompressed": "04af3de4e6a380baee15f7a7e5fdbf7cbaf7b6728e3a4d2f90611de0d2618c5f56db16f162bb5933a282f35f975aa2ee3e0011efb5960fdfd267e2a838de5b51ae", + "publicKeyCompressed": "02af3de4e6a380baee15f7a7e5fdbf7cbaf7b6728e3a4d2f90611de0d2618c5f56", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "00e2ec4fa41a54727b4130a45ef3ecbc19d22f3cd21a6060c5f69f4c066418324e", + "id": 0 + }, + "comment": "u1 = u2 = (n+1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 58, + "publicKeyUncompressed": "0477b67429b421fbf53dede6bc32bde7735424e637258baae2366fd62585d3f1279377a789e80cd47feee5b3e76fb1faca8515f5508d6cc7fe52a057aac9c6c682", + "publicKeyCompressed": "0277b67429b421fbf53dede6bc32bde7735424e637258baae2366fd62585d3f127", + "msg": "5465737420", + "sig": { + "r": "00f8fb8360bad30a580fa532ab57462e8552a5fcd3719189d754c8ea658b0a507c", + "s": "4e632e31b3bd14dac1c5265502ad547f8cbd34d5c0d385b3424b303e78a90901", + "id": 0 + }, + "comment": "u1 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 59, + "publicKeyUncompressed": "041078d43db4dd92869c9689ac9423fea7cf5018bce373d03b0933443aa1b8f7ce671ec56f3745c1f1e66612ffb68bed32e5dd87a542fc3ecd13621fb57f21ee82", + "publicKeyCompressed": "021078d43db4dd92869c9689ac9423fea7cf5018bce373d03b0933443aa1b8f7ce", + "msg": "5465737426", + "sig": { + "r": "00b04377c287662ee0b41c63fd288a82dfb34bcd9d0511c8ea079797383bf65e28", + "s": "009f791078f133a24097c73805aeeafa4013365a21440bab35d844671580d98e52", + "id": 0 + }, + "comment": "u2 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 60, + "publicKeyUncompressed": "04b9eb5f4dd6bc9f50e4140d66d837e781668d13af35fb6f7834b1915db9574f2964781cfe12692ddb59df2b59b039264c9e827f38170500576274e584992185fc", + "publicKeyCompressed": "02b9eb5f4dd6bc9f50e4140d66d837e781668d13af35fb6f7834b1915db9574f29", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "00f428a5a982d0f582e4d18c6064ac225b0d43901ef2298465ccbe6fad2c8268bf", + "id": 0 + }, + "comment": "u1 = u2 = (n-1)/2", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 61, + "publicKeyUncompressed": "0445a1e50be77db74c3be5c32c27118f8119c6a9e88b39f5651811a233a0ea211dc0f74d8aa9b6596a4b6b528dee39f45f627857aded2f530693fa6e00524cb231", + "publicKeyCompressed": "0345a1e50be77db74c3be5c32c27118f8119c6a9e88b39f5651811a233a0ea211d", + "msg": "5465737423", + "sig": { + "r": "3ef613a0ab31c00c617f031894d6836e00a0a6d939db05387421aa9d283596d3", + "s": "008a80eac1860776c6c66c90f61dc4cb205dcdd306f40626a58f4c24bce65f02cd", + "id": 0 + }, + "comment": "u1 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 62, + "publicKeyUncompressed": "040b6c9b3f8ec2ab4ac05ce16220c09d17930832e8062bcb8b42fdafec36f157941064d8ab49c6aca687299b4dc43274d9f92dead8418119fee82cb7a9f6c94d14", + "publicKeyCompressed": "020b6c9b3f8ec2ab4ac05ce16220c09d17930832e8062bcb8b42fdafec36f15794", + "msg": "5465737420", + "sig": { + "r": "00a67a61c13bf50258386b51da22d9dc75de5f465ebf15248a93fc2cbaef51e81b", + "s": "19fa538003e0bcfa56706983718c1915e2c47f231313fabf4b05621945616d4e", + "id": 0 + }, + "comment": "u2 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 63, + "publicKeyUncompressed": "041fe02614f4871674df689b00b9fc639b764ef091c7069f68c7fcddcf47f52f49919b4e475fd6e04827b969a93c7c671fa7a60db011dc09c65d834642f69869ec", + "publicKeyCompressed": "021fe02614f4871674df689b00b9fc639b764ef091c7069f68c7fcddcf47f52f49", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "008becc7b7e856649ce5c439493df2b09df7b44d945368ef9b995fc6bce702d7a5", + "id": 0 + }, + "comment": "u1 = u2 = 2**255", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 64, + "publicKeyUncompressed": "042d6e47057bb9a8dce18a2a950d53717d2063032eb45050ee3f278c3c26f97e729e20a02c0905153a8060ec082ff110619938916ef14cb5df0fe7c0c25d521fc0", + "publicKeyCompressed": "022d6e47057bb9a8dce18a2a950d53717d2063032eb45050ee3f278c3c26f97e72", + "msg": "5465737423", + "sig": { + "r": "00faf29c1fbaafc9558dc49206e62af685895b01c409ce8d96f62ea897933b5c4a", + "s": "00b0c2929a8ac455ed16f85d3a586a4410dc19b8b7c80bea5fbe7eb4c4507e602c", + "id": 0 + }, + "comment": "u1 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 65, + "publicKeyUncompressed": "044d52f14fdee8e7f5bb7dde5e63da9ce8511940e25bec4568bb0bde3ca5bc3be14f8abe1b1b369110553282b17fe7ba61f9fdc8084bc2d15fed858df87db45147", + "publicKeyCompressed": "034d52f14fdee8e7f5bb7dde5e63da9ce8511940e25bec4568bb0bde3ca5bc3be1", + "msg": "5465737421", + "sig": { + "r": "009e38032a988b1ff8486a3b0ff743e364d13c494751aac0ba45b0528915432848", + "s": "00e547d8eb18a0b6dae64da57dca05b2764f170c38137bce3b4eb0df8672adce77", + "id": 0 + }, + "comment": "u2 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 66, + "publicKeyUncompressed": "04e84cb6d256d62e3687430079e1d534783da61a35235ed3546f48eb13a3fd1176fe6151c97312b351324decdea70a652f6d4472273a57e0a4d802dd9e3af7b783", + "publicKeyCompressed": "03e84cb6d256d62e3687430079e1d534783da61a35235ed3546f48eb13a3fd1176", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "38fd25c9a5db21a1317c3b0b52316f874da74b4670687e468fcfacad00885b76", + "id": 0 + }, + "comment": "u1 = u2 = 2**255-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 67, + "publicKeyUncompressed": "0491085bf1f0817cd93dbd6fcd62ba1a2202f6b49d590416f504f5a748776f1cfdc97a64281b44be9bbb4963626320021f1c9c5fedd5c4e3a85612095a1f75b031", + "publicKeyCompressed": "0391085bf1f0817cd93dbd6fcd62ba1a2202f6b49d590416f504f5a748776f1cfd", + "msg": "5465737420", + "sig": { + "r": "4493c50f4ee3d3c9c5d4ba4dd8f3edb39c8a462e7b22a6f10494fcc32d139d8c", + "s": "008c0133e78efe2c476944d0c2104f9a14e0723c26d4dc3bb227516760b6856322", + "id": 0 + }, + "comment": "u1 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 68, + "publicKeyUncompressed": "0433180d6ab0a6e7713218f4898d1f00cf95f1a5e83fb13e239a18ea7ab48027b0adedd1ea395023385213def1d7c0230b99c776fcb419f7aaba7cdaef62279213", + "publicKeyCompressed": "0333180d6ab0a6e7713218f4898d1f00cf95f1a5e83fb13e239a18ea7ab48027b0", + "msg": "5465737424", + "sig": { + "r": "254cbd5f57cfe55daa7a4a8ca0f05c9b81030c6f5db5fff09ee3bcd6f440f7e9", + "s": "0088b14831dc03644b9a75bb0d35813e378889c05d8c4cc935877b7ede86584225", + "id": 0 + }, + "comment": "u2 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 69, + "publicKeyUncompressed": "0431e2fde3eee5623a70f62fbaa91ca83acd557c59244bc82d32d8a61fc3514457ba15982d3dbafaf4677b9830cb96d42443b2861fc2bf5d6ee2f678fb93acbc5e", + "publicKeyCompressed": "0231e2fde3eee5623a70f62fbaa91ca83acd557c59244bc82d32d8a61fc3514457", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "3158bd51f7c3f21491ba56ada4e75628df02ee95dbe543219bfeebacb6b9cbe9", + "id": 0 + }, + "comment": "u1 = u2 = 2**254", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 70, + "publicKeyUncompressed": "049663e6262d1dca829affab8ece8e82989f429e205f1550db0f00ba5e483b90489a2965eb0396e9475405bb8f7c34f1861dc6258a0967fc406cb6dbd823b78a64", + "publicKeyCompressed": "029663e6262d1dca829affab8ece8e82989f429e205f1550db0f00ba5e483b9048", + "msg": "5465737421", + "sig": { + "r": "0082996841ff1d88f0d22f9c869ce702e8c60dfb0c9e6980c284505d2fa02e60a2", + "s": "00bca34c4413a3960071ee9a4c6c27ff5190e4d495e5a66277edef47055541cbd6", + "id": 0 + }, + "comment": "u1 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 71, + "publicKeyUncompressed": "0437b62cf4233dfd04c262539973ba6006c8382e465edfd4803094f234a8bce7a0621fc42a8ee5c1961139aede41dc7cd8ea45be48681a0bb251ac8ad670da26cb", + "publicKeyCompressed": "0337b62cf4233dfd04c262539973ba6006c8382e465edfd4803094f234a8bce7a0", + "msg": "5465737421", + "sig": { + "r": "00e8c9af351a80197900758c4f3c05170cdf6ebd142109c0ff60eb562f1ca9ff93", + "s": "00b64e4f15989ce83d8bf5f6ad5c0bf3fe6c4e1bb1a4c70fa9bec0d56dc3b0407e", + "id": 0 + }, + "comment": "u2 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 72, + "publicKeyUncompressed": "045d4b6539234b90eff3f3d3b5ae97ca376300e4acde0b9ff6a2d7da64aafffdf284b574b7702dc55ddc4ec90c160b4fa1abf608507d6d49dc47cdb79334582f53", + "publicKeyCompressed": "035d4b6539234b90eff3f3d3b5ae97ca376300e4acde0b9ff6a2d7da64aafffdf2", + "msg": "5465737422", + "sig": { + "r": "00fa6a79dae583b7e13e0524bd4984bf78a33d9c3d9adfec4b70c05027aacbe682", + "s": "0087f263d7d883c0b55db81f74c7ed5c24a17753dad8a4a8fc30c0a23131e3ee47", + "id": 0 + }, + "comment": "u1 = u2 = 2**254-1", + "valid": true, + "flags": ["special_u12"] + }, + { + "tcId": 73, + "publicKeyUncompressed": "0473fb9afc80872a51863381b2d9169743a06ff4c3c59325d9d93d9e5470ca90ebf006dff8ffa201e0f5a603039ac5686a81651cf7057d89fb93158bf2ec14fea1", + "publicKeyCompressed": "0373fb9afc80872a51863381b2d9169743a06ff4c3c59325d9d93d9e5470ca90eb", + "msg": "5465737420", + "sig": { + "r": "00d7e44235059ff6ff53f4253ddb243eea241e5131a266c7be7e0ffe6048674706", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "A = B", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 74, + "publicKeyUncompressed": "049090b0c613377fbc6014a09ae7e2e61be8de38207bd646ac8824c2131c98b451a40eb555f9c8faf549555f2068cc7b7f8dcd05ded07506484c081a650b9eb0d4", + "publicKeyCompressed": "029090b0c613377fbc6014a09ae7e2e61be8de38207bd646ac8824c2131c98b451", + "msg": "5465737420", + "sig": { + "r": "57d14f5026ecfce0a0fbbbbf858e47cb35198a810edfa2a4245f85ef788b0314", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B: x-coordinate >= 2**255", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 75, + "publicKeyUncompressed": "043bfba85233cccb98776fe5060d3583fee935022a3db4c5a3839acc61f6763321846b4caed1d336e3cadcd9a777f8f34dcdb6041dd95c7caf81c3ff27c393aedb", + "publicKeyCompressed": "033bfba85233cccb98776fe5060d3583fee935022a3db4c5a3839acc61f6763321", + "msg": "5465737420", + "sig": { + "r": "48ae535fcf18f02a1fb64256845ed8e019d11c267cf17c4486f3644b82516f2e", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B: x-coordinate >= 2**248", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 76, + "publicKeyUncompressed": "046e6d9128f2b4e948bb90771d5c59150a289a8ce6dc7fff96dabe94bae0b7bc9fb4789ae4fdc3798cbeb99608e4dbcc63dbf880780423de3a3277fbc26cca38b0", + "publicKeyCompressed": "026e6d9128f2b4e948bb90771d5c59150a289a8ce6dc7fff96dabe94bae0b7bc9f", + "msg": "5465737420", + "sig": { + "r": "00e4403b16fb0674e83ad503c19f63672a166d48ced83c0f78e36e0d6dfad42805", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B: small x coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 77, + "publicKeyUncompressed": "04bfd74aa2d54f7405a48c27a40163c265faee2e54dd7a3bcc95e9b6834263bf2670facf37df5caab1fad1d981a7f96056bf9c891b8c7a8b9527702eed284f9406", + "publicKeyCompressed": "02bfd74aa2d54f7405a48c27a40163c265faee2e54dd7a3bcc95e9b6834263bf26", + "msg": "5465737420", + "sig": { + "r": "5afbf23c7699fecdc6151c421b05c38fac15f74c64d2c872c65e955f969c6e12", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 0 + }, + "comment": "B: small x coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 78, + "publicKeyUncompressed": "040e5e887924f7c7d8aa78e4b9c2e8b18f72cc112804b558828dc47336b1d37c7ae30250a5c7c3c3872c3cd519417bd13a4ac10177eb82b07087625b34dc0fdfa5", + "publicKeyCompressed": "030e5e887924f7c7d8aa78e4b9c2e8b18f72cc112804b558828dc47336b1d37c7a", + "msg": "5465737420", + "sig": { + "r": "00d022d1e94329cd44d7a18377e1d56bde93572f6c11822c2b692f65a1b2b0de33", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 0 + }, + "comment": "B: large x-coordinate", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 79, + "publicKeyUncompressed": "04c2bff6b5bd838ec2081a272005c766374b141f9a1d521ce3774df11d620dc19370e0cec518e8d2000a7a2548f9da4f815a92dcc7b1043cb3c0c59cb928d8cc3f", + "publicKeyCompressed": "03c2bff6b5bd838ec2081a272005c766374b141f9a1d521ce3774df11d620dc193", + "msg": "5465737420", + "sig": { + "r": "00aadf944ce0d6fd6a7967f920babe97da3eb81fd469e7e56136028e3e9eb04fd1", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 0 + }, + "comment": "B: x-coordinate close to p", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 80, + "publicKeyUncompressed": "04c4fe7bf951950b0e0ef8e1f703615bc18e345a631629a9a4b5d4c93eaa005cee696f11c0f1a4fdf263bdb0ba8ea6a51fd6c6d332a0289cae350bf25ca58078ef", + "publicKeyCompressed": "03c4fe7bf951950b0e0ef8e1f703615bc18e345a631629a9a4b5d4c93eaa005cee", + "msg": "5465737420", + "sig": { + "r": "00a3561db55be9206b9483c3c9dc7873c4a6c759f5725e745de6336b5a64dab412", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B: x-coordinate < 2**255", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 81, + "publicKeyUncompressed": "04439e25af2dc187b9de16ca2c68681a72e66917b973029bf7969d16406794c188fba4d43e99ea29e3a37c5490fe296a5d1f2776420651476cc5a0074cb6750ede", + "publicKeyCompressed": "02439e25af2dc187b9de16ca2c68681a72e66917b973029bf7969d16406794c188", + "msg": "5465737420", + "sig": { + "r": "68316a85e59282303651b5af78c37ef60de875524570ed6404008df656382fd0", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 0 + }, + "comment": "B: x-coordinate < 2**248", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 82, + "publicKeyUncompressed": "047d794f5e5bdbdad9b0485e6c36395f4cfa974731c63b11536bcedaad56a6aac6cad083fd27549ca92a4cd4c88a2b69fbad401309cea9a278b6939fad035e90ae", + "publicKeyCompressed": "027d794f5e5bdbdad9b0485e6c36395f4cfa974731c63b11536bcedaad56a6aac6", + "msg": "5465737420", + "sig": { + "r": "00c0184c80542e178ac307eb4a955832952cd7bf7fa08747974be92b617967e5d1", + "s": "58ce68e6a62175931f1d6cd57ea955c01814e2ebf3220c68d8b74d4241dd0e28", + "id": 1 + }, + "comment": "A: g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 83, + "publicKeyUncompressed": "04a4cffddd85254c5696160b65224f7d990ca397b725e5fad7d2f184428c07daa4cc9c55562d7e61ed26544c707f56b9a8302b83e6c2c85c455142e94bcd0ae717", + "publicKeyCompressed": "03a4cffddd85254c5696160b65224f7d990ca397b725e5fad7d2f184428c07daa4", + "msg": "5465737420", + "sig": { + "r": "7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978", + "s": "58ce68e6a62175931f1d6cd57ea955c01814e2ebf3220c68d8b74d4241dd0e28", + "id": 1 + }, + "comment": "A = B: g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 84, + "publicKeyUncompressed": "043ddc4a2d24a120685c6853f33d5d2da6500ac6841619cb92c159de31237ffb6016d013ca3e270a4a0e9a865a15f29f31c9f3d6405a797263e03dbe5f115c9aa3", + "publicKeyCompressed": "033ddc4a2d24a120685c6853f33d5d2da6500ac6841619cb92c159de31237ffb60", + "msg": "5465737420", + "sig": { + "r": "0985cf6e5a90f03e5488693dd74b2907845b5434df5593aeb9912345a7344bcb", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B; g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 85, + "publicKeyUncompressed": "0418b40614da4a2a7a52b175cae4fd474f8ad20d2c4ea7676740cb111dbfef05c4217ac7ab7eedd3d0f688cfc8af02dc88f82c9d8f0c75d73f56c8901b5a21a178", + "publicKeyCompressed": "0218b40614da4a2a7a52b175cae4fd474f8ad20d2c4ea7676740cb111dbfef05c4", + "msg": "5465737420", + "sig": { + "r": "00b2509e6211892906ddf5c8433d39eae66fb59a6b6250d083e8e911db6f3747f2", + "s": "00a731971859de8a6de0e2932a8156aa3fa4d217c1b3f5921c1b027d80ba861729", + "id": 0 + }, + "comment": "A: -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 86, + "publicKeyUncompressed": "04a4cffddd85254c5696160b65224f7d990ca397b725e5fad7d2f184428c07daa4cc9c55562d7e61ed26544c707f56b9a8302b83e6c2c85c455142e94bcd0ae717", + "publicKeyCompressed": "03a4cffddd85254c5696160b65224f7d990ca397b725e5fad7d2f184428c07daa4", + "msg": "5465737420", + "sig": { + "r": "7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978", + "s": "00a731971859de8a6de0e2932a8156aa3fa4d217c1b3f5921c1b027d80ba861729", + "id": 0 + }, + "comment": "A = B: -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 87, + "publicKeyUncompressed": "0409b6882217243e9dfd4392bd72b2f95f89d9c0282a38f02f44f87448edd9d3bde65d6979ea4c5e636235191dae544784ac3e4859cc7973491a610c8d5471f18f", + "publicKeyCompressed": "0309b6882217243e9dfd4392bd72b2f95f89d9c0282a38f02f44f87448edd9d3bd", + "msg": "5465737420", + "sig": { + "r": "00dddd63df54915edab89d853669776af1210f3ae694c8a9dc8ef20a688c3edf86", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B; -g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 88, + "publicKeyUncompressed": "04e9b8caaba6ccb05ceb729b674547942cea80994f9f462530f0a1197294986d1f223eea0d23ce522f47a8ee4070d213d138cdaad8e7404b2ffb42843b2dcb4e04", + "publicKeyCompressed": "02e9b8caaba6ccb05ceb729b674547942cea80994f9f462530f0a1197294986d1f", + "msg": "5465737420", + "sig": { + "r": "6d83b811d0272c3185731bcccb73840f714f19d2c60393ef9b2f7c2aaba0a50d", + "s": "2c6734735310bac98f8eb66abf54aae00c0a7175f99106346c5ba6a120ee8714", + "id": 0 + }, + "comment": "A: 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 89, + "publicKeyUncompressed": "04db75106f1cb243e22d8a5284700fcff97f2ba8fc965c931680be0c930b1045fa8d2de4cbe9ad7417f8c78dabe48739fe8e3700c79d491d82cd2d312784467e87", + "publicKeyCompressed": "03db75106f1cb243e22d8a5284700fcff97f2ba8fc965c931680be0c930b1045fa", + "msg": "5465737420", + "sig": { + "r": "00e2534a3532d08fbba02dde659ee62bd0031fe2db785596ef509302446b030852", + "s": "2c6734735310bac98f8eb66abf54aae00c0a7175f99106346c5ba6a120ee8714", + "id": 0 + }, + "comment": "A = B: 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 90, + "publicKeyUncompressed": "043228ecf198a19930c33edd0240e6c84bc41df78c08c7dc9e4e2289435c40bdfa51cb611bc26457c51a335ac18fa63c1d868423c9fcc9e9a26d3f22a54aff9c7d", + "publicKeyCompressed": "033228ecf198a19930c33edd0240e6c84bc41df78c08c7dc9e4e2289435c40bdfa", + "msg": "5465737420", + "sig": { + "r": "00953c08269f92f17ab80478c2beea2cde894869e1e349c1e32462effeda72a6b6", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 0 + }, + "comment": "B; 2*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 91, + "publicKeyUncompressed": "04fff29080ce1a11e317b4f3316bdacba02a5b79908f6bf5d9bf203d1d7e9c2bb3a43fccc6d923a847ed646f757366ea4ffeaac2c51737c6d90364de3c135e4d36", + "publicKeyCompressed": "02fff29080ce1a11e317b4f3316bdacba02a5b79908f6bf5d9bf203d1d7e9c2bb3", + "msg": "5465737420", + "sig": { + "r": "77bc3055fa00efc35c2fb17316bcaa23fd5ad6f2f052b7721183d4094eee8699", + "s": "16339a39a9885d64c7c75b355faa5570060538bafcc8831a362dd3509077438a", + "id": 0 + }, + "comment": "A: 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 92, + "publicKeyUncompressed": "04c220b08afb6806d4455f907d4e0ebe0efaffd99d8d67933db3d500a49145c44ba2995525428e72feb410768d5e9e14ab6ec7e8edb9ee210a9682bced68b4d989", + "publicKeyCompressed": "03c220b08afb6806d4455f907d4e0ebe0efaffd99d8d67933db3d500a49145c44b", + "msg": "5465737420", + "sig": { + "r": "62d9779dbee9b0534042742d3ab54cadc1d238980fce97dbb4dd9dc1db6fb393", + "s": "16339a39a9885d64c7c75b355faa5570060538bafcc8831a362dd3509077438a", + "id": 0 + }, + "comment": "A = B: 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 93, + "publicKeyUncompressed": "04e1520e52a539f97379d625a6649ef5a3d8684831f685d4ccb0ca80bd05a63681595a7f8d0c0137074f0dc411667c5749726ce9ad279d21d339f7bdef9ac3be29", + "publicKeyCompressed": "03e1520e52a539f97379d625a6649ef5a3d8684831f685d4ccb0ca80bd05a63681", + "msg": "5465737420", + "sig": { + "r": "64d15bdda3c85c6baffc72871949d9633ee5f4555688beac9b33d60242405eea", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B; 4*g", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 94, + "publicKeyUncompressed": "04c6298aca779038f4d974452026a597861c840ff5e5388ccfb33eb3dd80051910caf5a9911c4ac0fe22a67c350a435abec38d91effa4c0f58634d5d06ccc51f72", + "publicKeyCompressed": "02c6298aca779038f4d974452026a597861c840ff5e5388ccfb33eb3dd80051910", + "msg": "5465737420", + "sig": { + "r": "00ed7a264a8502592ea677623a6ac8e751611a528b104950d8b5f5df6a44e035bb", + "s": "4e632e31b3bd14dac1c5265502ad547f8cbd34d5c0d385b3424b303e78a90901", + "id": 1 + }, + "comment": "A: g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 95, + "publicKeyUncompressed": "04cd7089516816e9a0d9cb1900be75f5a1ee7fcb9a70f1d3e65b758c1858443bbe310f09b39ea630eda5e346fa7931f2678af5e7ccf40b5c0d25d50bf9beb5a238", + "publicKeyCompressed": "02cd7089516816e9a0d9cb1900be75f5a1ee7fcb9a70f1d3e65b758c1858443bbe", + "msg": "5465737420", + "sig": { + "r": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "s": "4e632e31b3bd14dac1c5265502ad547f8cbd34d5c0d385b3424b303e78a90901", + "id": 0 + }, + "comment": "A = B: g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 96, + "publicKeyUncompressed": "0477607f49f5435630c4b8b9b3a6acd7354063f2d24629bc52d686b04172d110d073f0312c89302ee772b8651e0b9e4f5035533731faeaf1149fb4ef3269ecaf0e", + "publicKeyCompressed": "0277607f49f5435630c4b8b9b3a6acd7354063f2d24629bc52d686b04172d110d0", + "msg": "5465737420", + "sig": { + "r": "52cdd8d0c6fe33cbd7fd39b2afa4a4163cd8d32b4c4a4d3fb5aedeff7c89845c", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B; g*(n-1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 97, + "publicKeyUncompressed": "044302b569a94a6d380e8ac767610c9e0d7614d13db44be422bfa73c6fca230f754f63dbe7828c0957dd7badcd515c022a678cbc9925fe7c543b72c38729064923", + "publicKeyCompressed": "034302b569a94a6d380e8ac767610c9e0d7614d13db44be422bfa73c6fca230f75", + "msg": "5465737420", + "sig": { + "r": "1096696c9b44f12e2fa18b98fd4f05250643d0a9a7e5ba5267fdbee78b93b597", + "s": "00b19cd1cd4c42eb263e3ad9aafd52ab803029c5d7e64418d1b16e9a8483ba1c50", + "id": 0 + }, + "comment": "A: g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 98, + "publicKeyUncompressed": "04cd7089516816e9a0d9cb1900be75f5a1ee7fcb9a70f1d3e65b758c1858443bbe310f09b39ea630eda5e346fa7931f2678af5e7ccf40b5c0d25d50bf9beb5a238", + "publicKeyCompressed": "02cd7089516816e9a0d9cb1900be75f5a1ee7fcb9a70f1d3e65b758c1858443bbe", + "msg": "5465737420", + "sig": { + "r": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "s": "00b19cd1cd4c42eb263e3ad9aafd52ab803029c5d7e64418d1b16e9a8483ba1c50", + "id": 1 + }, + "comment": "A = B: g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 99, + "publicKeyUncompressed": "042fc50a5e9f9fd7ef0e19d5860d753270cd7c23dda77362d814a397595fea3fbea260c3f8d5e84c16ee884a08d7fdd57b0c8b02aa874a492db09b43606a773629", + "publicKeyCompressed": "032fc50a5e9f9fd7ef0e19d5860d753270cd7c23dda77362d814a397595fea3fbe", + "msg": "5465737420", + "sig": { + "r": "40bfe5cad72e741c7ab53bc449bea32f9b9cbb49fd864ac694e91c6e758f63e1", + "s": "00b734743301ccc9e25b6a7122d56582a6faf6f60346f544ce761ddb61d8e9713b", + "id": 1 + }, + "comment": "B; g*(n+1)/2", + "valid": true, + "flags": ["special_AB"] + }, + { + "tcId": 100, + "publicKeyUncompressed": "04db124047ded5aa8f5df3861d3bb605c55eecce9875d19f1839224221a4121aa39c2b7ad6d21af20dde8196d47a17d23b4062c6a28e8b01c81dc708fac27d9aeb", + "publicKeyCompressed": "03db124047ded5aa8f5df3861d3bb605c55eecce9875d19f1839224221a4121aa3", + "msg": "54657374", + "sig": { + "r": "61c1d7309f79d427e19f7d0df4a86da27a66132cbc68f9994f53d94fd18a8f87", + "s": "00839603a42b9f57947b1a6bc9a36c112ca6977ac6b6d217b1f6dcae4c5aef9ae5", + "id": 0 + }, + "comment": "point at infinity during verify (invalid signature)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 101, + "publicKeyUncompressed": "04b8a9ebb9c99a08182d56e8be145ec130276759ad8da5247587aaee886ed7280d69c8eb06531b9853200d90a4d5280c01fc04ed8516708f5a6ed0a8190775e9a4", + "publicKeyCompressed": "02b8a9ebb9c99a08182d56e8be145ec130276759ad8da5247587aaee886ed7280d", + "msg": "54657374", + "sig": { + "r": "7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc", + "s": "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 102, + "publicKeyUncompressed": "04d1380b449374aef5dd6280436294cb6cf3d95eca661cc1e953f223ce705865cefc341d74676e2cd8fa4c2c6d47fe70f2da5a2709b55b03838a976b43d6f8e8fd", + "publicKeyCompressed": "03d1380b449374aef5dd6280436294cb6cf3d95eca661cc1e953f223ce705865ce", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000000000004319055258e8617b0c46353d039cdaac", + "s": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 103, + "publicKeyUncompressed": "047ca978a78a841d22d89cc315ce15b813c83b5e3ada96601623e38e4c507fa105eb343dc48fa6d4e5654dd10aa891cf8f1bb153d804b6d3fbfcf2051a0afe9299", + "publicKeyCompressed": "037ca978a78a841d22d89cc315ce15b813c83b5e3ada96601623e38e4c507fa105", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000000000004319055258e8617b0c46353d039cdaaf", + "s": "010000000000000000000000000000000000000000000000000000000000000000", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 104, + "publicKeyUncompressed": "048f1a2c70694e4df52a956cb07206f1ca23dae1dca59bc8f4997c3d0329e7bbde52b4b8adc62b61b1900cea56954a21a860e30e1dcc5744fb0f2716d8da1b1a96", + "publicKeyCompressed": "028f1a2c70694e4df52a956cb07206f1ca23dae1dca59bc8f4997c3d0329e7bbde", + "msg": "54657374", + "sig": { + "r": "05", + "s": "01", + "id": 0 + }, + "comment": "point at infinity during verify (invalid signature)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 105, + "publicKeyUncompressed": "04697cd0bc8b99d05185955d958f997546da260fc264f441247c107ca40ae57d02e72b004784b4a466d1e8b5cd4c8627e4821f0b8022f3a166efea2a072004a3b3", + "publicKeyCompressed": "03697cd0bc8b99d05185955d958f997546da260fc264f441247c107ca40ae57d02", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "s": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "id": 2 + }, + "comment": "point at infinity during verify (Invalid signature: r too large)", + "valid": false, + "flags": ["inf during verify"] + }, + { + "tcId": 106, + "publicKeyUncompressed": "044ce60bcd8d6e23b7d1c74094896f79aee8ccae2833859f8fdc1131f4cbad5a728bd8f3bc7436259ca112f4d1f42ede429023c7dab8c355cde63764d336c4bf68", + "publicKeyCompressed": "024ce60bcd8d6e23b7d1c74094896f79aee8ccae2833859f8fdc1131f4cbad5a72", + "msg": "54657374", + "sig": { + "r": "2dab07250e2fe7a26bf8618dfb165c137c75bae1726f3f8734a27655da46be35", + "s": "00ffffffffcd0d63036e5f854968f785ae9b42473d08008b44109e13b90b3f331c", + "id": 0 + }, + "comment": "s too large (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 107, + "publicKeyUncompressed": "042fb045168cbf497dc4fdce9334a9e30c3286b6c4857e0a1836e53bec85a8fd699b37e5343fc0d3f835e91df40f161e2aabd306eeed7a527e7c1e3374fcb06e0e", + "publicKeyCompressed": "022fb045168cbf497dc4fdce9334a9e30c3286b6c4857e0a1836e53bec85a8fd69", + "msg": "54657374", + "sig": { + "r": "2dab07250e2fe7a26bf8618dfb165c137c75bae1726f3f8734a27655da46be35", + "s": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "id": 0 + }, + "comment": "s = n+1 (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 108, + "publicKeyUncompressed": "040540a102f1809eeefd86c59c3f65302589330f3f5d9e7ea5611e1a1136f62753ebfbb90ec37a146b2e3954e6e234d17b10b90f27fd9cc0323f9c570ebff2dcfa", + "publicKeyCompressed": "020540a102f1809eeefd86c59c3f65302589330f3f5d9e7ea5611e1a1136f62753", + "msg": "54657374", + "sig": { + "r": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632556", + "s": "73fdf4a9329d8bca10bbdff59a3a5ad2d9b431344fc218fc40da027b0dfff78a", + "id": 0 + }, + "comment": "r = n+{Rlow[0]} (Could not recover R)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 109, + "publicKeyUncompressed": "0402b1b91e7ba532b5765327357c1145f3aebc5c2a2997b5fa47686a83e2e4041ab602cab3c72afa65ad55c2e850736df4c487ccacee33c5dcda9c4460d120efd0", + "publicKeyCompressed": "0202b1b91e7ba532b5765327357c1145f3aebc5c2a2997b5fa47686a83e2e4041a", + "msg": "54657374", + "sig": { + "r": "2dab07250e2fe7a26bf8618dfb165c137c75bae1726f3f8734a27655da46be35", + "s": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "id": 0 + }, + "comment": "s = 2**256-1 (s not in range)", + "valid": false, + "flags": ["invalid_range"] + }, + { + "tcId": 110, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6ea128df5", + "sig": { + "r": "00d09e22889302de88a9234a98345d93185b7190a97c0479aa2668084df6816c8d", + "s": "1d8a55401b672f8632dfaa8cc034b6b62e01cb265176b32e1dc87f7415e5e521", + "id": 0 + }, + "comment": "special hash:cntany", + "valid": true, + "flags": [] + }, + { + "tcId": 111, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad78c580fa", + "sig": { + "r": "00d6afb0b7b3d5acb7e0f178082eaea5979507fdaa27fb52677022dac59db6745c", + "s": "00b2ea522387f19c1b27ecbcdec71a49800a88cf3b26a97ba2f51bf3c967b21474", + "id": 1 + }, + "comment": "special hash:cntany", + "valid": true, + "flags": [] + }, + { + "tcId": 112, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad4c3b2207", + "sig": { + "r": "7b626bc0972f742ab6dbfef5f0e876cd6f8a770f046995b90a3b34ba9df4c5e3", + "s": "6a55b89ce90fe189e7efee782042a1e908a2b8939506041c229aa8becce6ba33", + "id": 1 + }, + "comment": "special hash:cntz", + "valid": true, + "flags": [] + }, + { + "tcId": 113, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b505a66420", + "sig": { + "r": "073ffc7332d7b4fbb2fb71fde94f7ded5477db96d7698bfe29f408ebd20a32d4", + "s": "6df60c66ce6c15c0a9350139ffe7ea153b5c5134e3ef89c86dfc8e584412529c", + "id": 1 + }, + "comment": "special hash:highcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 114, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a60e419d57", + "sig": { + "r": "00d56831abce80b15c52d9bac011a770bcf5f289020ad499cf90609d853f67e2e4", + "s": "20982e396d7947cb71449e521b18cec5b3f734eb2955849a42fc9f58629d4e12", + "id": 1 + }, + "comment": "special hash:highcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 115, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadf0e16d16", + "sig": { + "r": "00b87f95d8e849567a558bb45bbfedeb72eef6df5b4d950dad9ac99c8358b1ded6", + "s": "00d86ec8c51db5980e2f95d43ab3e76a2c2d008fcc95afc0e4c49793b7a66fde3f", + "id": 1 + }, + "comment": "special hash:highcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 116, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b53a00f714", + "sig": { + "r": "78b6dd5caf5506df295b9a5545cdfd04ddccb22be0ccc1af450f385ae931d2e0", + "s": "00b6d55daba54b7e12e455d610b022e9861b32e4592acbf111679214c35bc16f00", + "id": 0 + }, + "comment": "special hash:lowcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 117, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a66709b065", + "sig": { + "r": "38be530b1f0e0b16533dce380137a54d9221f3e8d156c2545bb6dab7272a0c12", + "s": "00b7b5fac729db943c0a03481a6f99b7dd66fe3c3a6f3a8c281e5f1666d7016f02", + "id": 0 + }, + "comment": "special hash:lowcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 118, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad623b7ec1", + "sig": { + "r": "11b1bcf623f92dfcd6aea24976df828db1786272e6f32d3278ae50bedeff4af6", + "s": "00d40ea943fc8fc34595f5ee09b4a6551e36a581155fac2089be2f8af3e43fb95d", + "id": 0 + }, + "comment": "special hash:lowcnt", + "valid": true, + "flags": [] + }, + { + "tcId": 119, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b52241bf15", + "sig": { + "r": "00f37b8a2793c4ed72de99cdba533c59a82f699b43e60b9032b19d6ff15e0e5d79", + "s": "00a8d7e22cbc06b1fb422326bd2e47d548766e7a3c91bb3b9d8d7d43092dba03e0", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 120, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a61950beb3", + "sig": { + "r": "00ea80026d23622e24ec51c9ad1571fa0e0cdcb2e037530fc6e96460ef432f8499", + "s": "00a6cf6d3349e0a009dad7bc45c98448e988f861c9f0293c321083700e18bdcff5", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 121, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a67a082ef0", + "sig": { + "r": "08003f3ea5b52401f06a9c27df7f4514733f5dbe6ea04017cc6c2e074c4f8d11", + "s": "00dd2b5feceb21a83aa2fa44699e9634b635cba3769b8a464f910b7166a527ad3e", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 122, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6933d5b5d", + "sig": { + "r": "15401eeed5fa32d3e9468ec9a7c8bd4c117af390423becff1e5260ee56a4fc62", + "s": "02776cfebc96afc8d795d41c4ad1a9eef7de76b42441af690bb2455930cdfb95", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 123, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad32bf7072", + "sig": { + "r": "00d54d57434fba28cb060559e42182205fe82ed1fed8fae2316c59458fba6d9f42", + "s": "00dbfd38491912cada0d1eaebaac3e8ea7b0e7aab3773427821f9c6bf3c1f3f376", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 124, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad50912efc", + "sig": { + "r": "00b0777d42065187b2e9afdae7f145c7ff4346e1eaec114bd8ec46703f1efd259e", + "s": "00d668e56de41ae45e9f9a02f200d7592bd6a436f0398b606c621631a875390def", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 125, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad6d4daa23", + "sig": { + "r": "4df79e763ac24a633e8d12ce7b07c01e286017858d840285558bc20ad89ec13c", + "s": "00f07c1dd794f74af664a6b42903f9c3fdd9fb61d84be5d25151773edcc141e2f9", + "id": 1 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 126, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "7a4fb3250aa05393", + "sig": { + "r": "00b4e490e5fa3b38f390902959ac08077adb985ac01deee17012b74861eb2e3ca8", + "s": "709dd84c83de747fe4bb116842c322e66ae625c285812fcfc726d2098958a651", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 127, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "7a4fb3250c91f0d0", + "sig": { + "r": "00d95eabba52b99324a0a0ed6ebe64f56da140065d8138fb5d6eee9e7895667037", + "s": "00cd00f418fb5a16a2d4ba4c1d3c98dcd47d92ff1e875ca3a6bc91e08a50f2af28", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 128, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "a14672e603ab2a8e", + "sig": { + "r": "00e847ddd91ec7c09e93c2bf6c259644fc0ca754f3a19586a477fd0295640c4acb", + "s": "02704ef17b86a3f0657878cd68a1be29f54af075a7453fdae9a4a7e7acc8af54", + "id": 0 + }, + "comment": "special hash:maxt", + "valid": true, + "flags": [] + }, + { + "tcId": 129, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b506e3e5cd", + "sig": { + "r": "008a1cbbc118f507a4644ad8871666b2919829334fc544323b666da7dbaecb49bd", + "s": "21c4292521780154310dfe05f49fae93d5ee01fe93fc9b328e13a7fe9ed4b0d3", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 130, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a604fa6bae", + "sig": { + "r": "23212094541cad664a7610bc0dc017d344ce907ef869f69b53b4ee90b509b8fe", + "s": "38d14022cdcb4ac47eb8426718edcb245c4ec9033dbd116eb494949e198384a2", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 131, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a634f58a08", + "sig": { + "r": "14ba46bdd8663edf1ab19d6009f62d4c970ec773e0e44b525cfab02fcb6e562d", + "s": "00e5535ab4b218547b3b4396ba737119fd30e0416a4e499935a56938077fb5129e", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 132, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a68713bbaf", + "sig": { + "r": "34d9834d49bdc887f39dc88f0d0c74ed94ad10c6a87aee8b773f633c5c4038df", + "s": "030aa6d5126fed3f514d7bc4a54ddb87d5cf6b39f6d1af4c7081f16dd77f73fb", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 133, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6a250a7cf", + "sig": { + "r": "00a5ace4becb364e4d18b93d4c8ed731db7b24f569d0a1df6b332255bba089f6aa", + "s": "00e9712c7bf0170a5d12f77dacf3990a56d66d2fda8500af877b487bbe0dbdeeda", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 134, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6a9287504", + "sig": { + "r": "00b26399592c459c99aa86e7d9f096526e5ca8544a5f10da02f0264beadee256b7", + "s": "2813b07c175e7bf862b5bf68aacd7cffc7a5def4471f54f78f0c2e9feb9a9f8c", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 135, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad0fef680f", + "sig": { + "r": "3ba3ebdd881210d0991c71553458fda94ac8ad884e3ab42bb63eaec4289b7069", + "s": "008dd9f1dd6fc482d70fa9e2c9a4e05cfd018d6ca33f77600f2475941992436245", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 136, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad24322c79", + "sig": { + "r": "46772bed512af56cb11a8dce6f55f05dd2b4af824d96e3b45dd298ac11413624", + "s": "00a88749b724e8a2761c995c407026a4462b5daaaf67d3c59f371ea33f71282100", + "id": 1 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 137, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad3d23fae7", + "sig": { + "r": "285fd0dd2fe2121592d71dacc2661a946342fe180450804af2693ec3fc984d76", + "s": "35c3371cb5559c1e5c7ba6d50fa17fbb1f08252efaa0307611a9b395ef83b409", + "id": 0 + }, + "comment": "special hash:mint", + "valid": true, + "flags": [] + }, + { + "tcId": 138, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b507e674e8", + "sig": { + "r": "6d90cfd7eb5caedea0420da026a660a97149fe6659f13ebf4c53474096fc0b5a", + "s": "00ee4f26a9b922fb3c8a5cc854df086304340fab14937252c18ee45eaf87ec23e0", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 139, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b513eb738a", + "sig": { + "r": "08bb559ddfde1ff37625b6e79e6e32510b1107bcd613858fb87b07be66632d97", + "s": "415e30d5ab5e06afe18a80ae853933203da8d832de5674da00dad892536d2e42", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 140, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b51cc7f01e", + "sig": { + "r": "5b3f9fc0af00fb9a246ad315eb3b3843e41c0ff0c48570189ec29150446b4d59", + "s": "014819cb0ae04ee792150deec7d6935e760ea2170accaa13537bfd18dfc7346e", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 141, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b5204bb2be", + "sig": { + "r": "00dad650dacc7b4ea889face18fcb82c88f2469bbbcc0eac793efc5039faf22aa9", + "s": "00bc008163b8d9bcae25f941b5878cac49a0dab10be67ced6088274e69b034c854", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 142, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b521c74e81", + "sig": { + "r": "0dd4df8dd2fd58cbefcc3edd6dc11ed9c1308251d0b2a81e978f4604b5cc051f", + "s": "00e6734e2df3f96ccfec1774a6ac5179a28fcbda7c65a38eac9bde048b63c28d67", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 143, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b5264518d2", + "sig": { + "r": "00f32af3d418de9948a8fab600b073a7c1a47d23642dd8f13faa29299c399837cb", + "s": "00869137e4e5bfee001c1cda21cc72655631ee0ed4eaa1c059d33a380d5f4926ec", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 144, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b531bec9a3", + "sig": { + "r": "714c2c7fcab5965a05d01e0e479d75e33ea1e5c3f40caf2268da46ce71154e9e", + "s": "00ddbb299317d77f196ec700352e800d523e163c41cdce8cbed640ae234f5223f3", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 145, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b531e54c87", + "sig": { + "r": "00ac454a93adb70f0c517964ed1066cd045ccc9588719e45baa2c83171cf7cf5f4", + "s": "00a0ebcfc10a5ae6a74a9847f8782a75e3322dc536fdd33efb1622bcf7cf9bc48a", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 146, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b534bb16e2", + "sig": { + "r": "044b57c093c7500f9b2fc47049c29a1b60561b0beb3a00150a27a88bc4b07ff9", + "s": "438de99ca6caf7023718811fcc67a93f8c63a125f6deee9d50b7ca93cbb483dd", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 147, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b537a98d3a", + "sig": { + "r": "53b4f390b6f9eed302ab58fd9d220677b5f86daa18c706c3d31c9f9fc96325c1", + "s": "00fbac1b9de630480973cea792d6edabc53c7abf3d7b5611555d10a195bd4107ad", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 148, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "049a27b53a9072fe", + "sig": { + "r": "00dfbba43b4ee6d5d3946815eb0f493b340980f9220036a3aaae78a5b4fbd8b640", + "s": "0d63799b060dc4e53425437a415c68970184232dee81c871c90d8a74634dfcee", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 149, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a607e9597b", + "sig": { + "r": "2e2d3588dd8bc10f136387a97d49d83e501b16d6fc991bfcd9d801944645c873", + "s": "65987003f5e60d38ee996ba180d37424dc3d89547e84afbe75fc3c3f083b03c4", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 150, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a60c3de294", + "sig": { + "r": "00de3bea4aa7dd1c4be29ecf47c07f0aa79000b49edd7f1b4f9c0bda694d669665", + "s": "2e790d1c95d51d40eb7b982de0f0a5b73012eecf33647c08aaafe688e891f779", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 151, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a60f0a7105", + "sig": { + "r": "00a99c4b9468b9d0eae1bbc1e64c94545c4051c0f2937d9ececcbb62e8e6cdd27d", + "s": "00cd621599464003b0a2c523ecd75d20e8192cc6dcbfed4f27cca11f7cd574e8c9", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 152, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a60f40b849", + "sig": { + "r": "0081da48eba1486e471e9cca16be0c88f37f8a2582acc3aeb575a3ae0012847361", + "s": "00b30968e9289cf3278904ead10c85790eec63e979ef239ee449300b3f901ae25b", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 153, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6100fe0fe", + "sig": { + "r": "00e8c2b95e458ccc7c6bb21978d10abdaf0dcbcd57394e6de8f09d8128c86b681f", + "s": "6c78b72eb258b129c5482b78092b37a3a247e3ebaa0a0e4b278be580df59be4e", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 154, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6123d535f", + "sig": { + "r": "00f95bbde8147415a80c5b754ab202f5de0432d51561e1adea2e03ee52490cd53c", + "s": "00a2067a9b718967e173e0be796b50ed9e2500c2c309ec94e0637fce46e901a67e", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 155, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a619d0abca", + "sig": { + "r": "00d7967809979cfe25ca239bf1d58bc3a1cf42aa1feec2629435d1e1661b6cc78c", + "s": "59ba3812c8b93da324d8a4b2b9c1952b3a1faee331f37f8e14c945f9c4352d33", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 156, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a61fb36417", + "sig": { + "r": "5f4f9bfa5d1109dec9a7c182c0ea9347315157e27dfd25889ec5a53742128686", + "s": "590b181b6ed1466e7aa09c7b339447ff22158f5e6cd4067735dd7c4952d95f63", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 157, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a623579acd", + "sig": { + "r": "458a17685267eab51dd7d2cb68db8bdf8f63d2932e075ff1ac0a4af332758649", + "s": "00d7b208239208d49a235d24f683bccf8ea68b26c4802321b66d039586179d2271", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 158, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6251c93d0", + "sig": { + "r": "61640573335fe4a588323f1372a61899ba413684c90427aad3dcfec85c9feed6", + "s": "66fe073a5a815b2a39f172269c72d8b3ad370f1a488696d7057506bcd89caeaf", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 159, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6275790ef", + "sig": { + "r": "6505f51587c096420ad7f5c94a95c813c1ca80fdd2582a00cfadf9e4b599d322", + "s": "4e0b65be3144e1c40b520ee377512ae9e71d88c953db1bf979bb9e2fe7e64e3f", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 160, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a63830e73c", + "sig": { + "r": "68e74fecde21db6884c0f7d1dc157f643c96e60e5b4195af1da900adce5845d5", + "s": "0090542c0a1ca5aaa41d7ff1bfddde41b4d31b6cd1f97580d6ad9b65b35ebe5e64", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 161, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a63fc5544a", + "sig": { + "r": "5d2da591365264fc506d249155bf8196759964b17a4c8dc8a6a806d0ff75db64", + "s": "685170b8f99ba9a4f5d9f9a06205da526c5a061bd1c58195c8d8cf02517961df", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 162, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6421ef200", + "sig": { + "r": "00f5856e4b8e0e7821af240538474ea3010027921c2c1ac6138317ce0916285e03", + "s": "5f8cd9fa9f38839640d654b382307778123eb9a721d6ee2e8f114cba2e95cd65", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 163, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6437fc4ce", + "sig": { + "r": "00e13c5506b2bf6238b9a6fd7c129aea0b0f8e5043eab93bbbb021dc20b8002786", + "s": "00a070d5e7eccf9ef7d9e01945015e73d11780679456c775d5e0d215d108954369", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 164, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a644e295fd", + "sig": { + "r": "00b537867d638ca0651cc40c6ef8f361e2c824034e75b22c33ff5dfaf65f7b590a", + "s": "008f5041f7e386009067f0f6054b56200d6270b7cf3e8a051ef399e9ab990296d8", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 165, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a64587d9df", + "sig": { + "r": "1f8d9118f26bb21e8165f56f7d5d90b094d1958c9dd24e53a3f701a00e81390b", + "s": "008f9254da14ac48d38d4ea6fbccc267f8c59a720596d2993994c04d737ca7dd5b", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 166, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a64b5b7ad9", + "sig": { + "r": "00bd2525ebdad8d863a1520b989ef81b643b15e03c68bf978255866b43a7ec30b4", + "s": "00c784e63f4102b763f60f6c03eb839e412546518f9015e82e5df867a4e475cbc2", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 167, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a64c2f0d77", + "sig": { + "r": "00951a69791190b44a17912f2f27b84d17b13e76653bbdeb65e0e3006cf568afd4", + "s": "42394443fb830ee673706948bc09b6f3beaebd4ea3ee24b56d64a7ed96d70be8", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 168, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6599334cc", + "sig": { + "r": "58065873a58167d7dadf0ea6df0151a3dcef6d9191f2e8298cdbecbc00530a63", + "s": "00a11aecdc9b64d6ca07a05c2b062b7e35c126eadd0b927e8797ab6cc0f4fe659f", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 169, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a661db38ba", + "sig": { + "r": "00a6771b7bd5f3bb063c7786dac950612f3a792ddf27920db05127c772cc88812c", + "s": "0b7476b6918d95d0f6021e867bfa4e599f96aa9d8923ae702c8e8c8798cd62be", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 170, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a665c5aa3d", + "sig": { + "r": "00c5de38499f54e1002856b128de7080a1d95a5b646af720d2b6cc941e13dc35b5", + "s": "008d803f5ed9d2d1617dfbde1aec86e35eed70b1043598758de8d0770762e008e4", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 171, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a66783bdbc", + "sig": { + "r": "00fc1740ac9222eb2e29c75fefd67412fb47ecbc736c741ae4c72e916ff01c8450", + "s": "009499ff88545cfaf5cde18200b8bcd0b85b62ae814373f0306e4224c5ad1d5c65", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 172, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6690cc109", + "sig": { + "r": "24a9534e0eec5bb8903160fcb65d62c87f439992508a356a958274de04d6fd82", + "s": "00ab1d511fbc695e9729f73592f727ac4421fc01e8a50dd456fd7c49dadff6294d", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 173, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a66f5fd90e", + "sig": { + "r": "00b8d7c6572d0a00b5a990c602c8fba79c503e6e04cd60153018fbbe12dfc4e91e", + "s": "00829d71bc1e5f8d48c3af84ef27fa265c50a2870e50481545cecea1e9be24e625", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 174, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a67011c21a", + "sig": { + "r": "00e4e4d92e1803d79b815eef1ec193b9b6d413736d7a327d9ad78d6763f0c3bf9a", + "s": "00d909e8ee5b37ec735559e5553dd6350c06fb427c78e5ee7da4d77a1fa25674a0", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 175, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a670554c70", + "sig": { + "r": "00d82514f7786b8d8e619a3bae9adff969528ef04daa951ee3f6bee0e553306884", + "s": "14bdcc151ae66f955173700d22871ebb2c3773c679c1624fd9951b05d9885837", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 176, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a671a4d73c", + "sig": { + "r": "00b764e47b01fa3c434065e5fd3159922d502935153e2c3f416019bad0461bdad5", + "s": "008a71addd58db01fdc3cd42a2fec93c6e8acc0e5bcec84b80a30aa1e9f28e461e", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 177, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6751c0d43", + "sig": { + "r": "522dfcd8bb524e038ee0a01c35012460db51030237e038b03ccd96cf498b5d94", + "s": "1622f3178f0da1af71eb15207bbb6594709034867d34f485b0ed6e58d30f0fa1", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 178, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6793b55e8", + "sig": { + "r": "009b1a43bd756c507f36976ad4bdc07428b489b924d332b679ba10002a5816a3b7", + "s": "00f2e3fce5fe495714034524b44236996c125605c3f5d211b0ec7405d08aeda472", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 179, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a67a525edb", + "sig": { + "r": "00a5994b0aa2fe4ec5a83cd6f23178b313e6bab1a500ffb20aafefda9b7d628357", + "s": "008ee6f52eedfd332eb2cf950d161263d2645f4f7e41eaaecc16e8b492d34792a0", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 180, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a67c53ae63", + "sig": { + "r": "00a356fe48c864bedd78326eb8042b82c9735258b84dde0e59287486652260bc95", + "s": "5ae95ef40c514d06ecd333cae52ee7695aa3fb54b96764f359a33faec99745c0", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 181, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6846162a5", + "sig": { + "r": "48feef384dfbe2cf1d05e7d4102c9ece127da574cfaac79ffed4146a5433e7db", + "s": "3ec529fad4020e374dcbc9014f19aa393e93564f16f4f252b4d604a94717f544", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 182, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a68d2ac003", + "sig": { + "r": "00af1387628e0cf01fe0f8a8fbaeb7af275d563c2bfcf02c0d7e9d860b9213b7d7", + "s": "46c0127152662daf119b59cc35b59755bd2295cfcc78536688d7f41e2243fe29", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 183, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a69fd3e3be", + "sig": { + "r": "00db43b6ce19767535f1cadba9276513fb2c0c28823fb6486f93585d46ec53bb85", + "s": "00f87f83c7cc85567046dfefa1990971f78af23b0580a8c7c0515539bddf612a25", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 184, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6aae79dc5", + "sig": { + "r": "44de1121df26f3c14311218c181841dca42121d1dbcdedea7e97706fd7441864", + "s": "00e26b260fec9d9593d9d0198c54f697fc1dfa5df17954491914a6f40cb45aba49", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 185, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6cc60ca34", + "sig": { + "r": "5b3ff612beb2aca2fcba44a02066e376cf637af9e230a29b30c799f4a5744bef", + "s": "00a791a5ed74fd41446ccd0b68ffc69e0cbcbb4fd5f39eb89bf141e93cfea5e896", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 186, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6cd6245ff", + "sig": { + "r": "00ac6365cf32c7e29720791510013da1d1449248ff2a13a971eebf2e33bd3eb86a", + "s": "3e2592e32790d323cf621b3f13c048c433f29e2289a1d3ad6af5a5958724da27", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 187, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6d808449a", + "sig": { + "r": "00d93460fc68a51f0236afe541bf309c544714b958ca733359437c439e258286ea", + "s": "30485f6c4923ceec851fe957b7b66a119620a5c6708c10e98add114cd8bf638c", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 188, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6db0af485", + "sig": { + "r": "00d05207d2c7fb6cb043b855188faae9bf1952b906f1efa60268bd3836a04f2b22", + "s": "4f7f32b3a639c03defc85420139572c38e4cd5375432f710bbfd134183e54d02", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 189, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6dda31d79", + "sig": { + "r": "16e96a1f0364d7f63ccb723a90198b62d17b9bb0f1a61126157ffa550309d975", + "s": "009b31c161f0e1cc953be64cce0535687a2ac322d678a618d30c42b07949a6f462", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 190, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6e025e7e6", + "sig": { + "r": "187b45da134675c851d61aa4a2664df87053b57638d15243a8f997b57c76bcbf", + "s": "00f09c744c4833c6e79836cd123ee1263d720560d903318835948575d74079481b", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 191, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6e17464df", + "sig": { + "r": "00cc543111beb45b92868f2bac110fb0f14ce02cdabcb12d303ea3a3864f820cce", + "s": "00fbe6832e9b8adec62c6709ddd45cce8a874ce22dd8d2a1937fa6bf0ed121a3ac", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 192, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6efdd2c01", + "sig": { + "r": "099f129707c0b6ae3e3c7a2636c561ad769d49be99ec79c3a3493f6367bba24a", + "s": "305e5c53290df1c57683e1ea9519608efefa0ce187f40c9f07930bce8e41f07a", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 193, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6f8afb997", + "sig": { + "r": "00a56e4c371b65cbd2f44f54e9868ef6fe4a0a1cc117100aee0b2c32e60d203813", + "s": "00dd745cad075f0d5987d25212d728b9af29596e68dc7e83e39b26b8c881ec9e57", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 194, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "07b3d7a6ff92caca", + "sig": { + "r": "00fba6a2b2221052f51e6d5069b2ac70673f6a0bccc036b70d49c97dc2832e47ae", + "s": "3b4d259c2ec3d65c1f3a39447e51e25f45c077b6afd24e941ce7cd5aaa4b1fec", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 195, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad0113a8df", + "sig": { + "r": "71a1d8a0acc694b21a805b3e54989d4d940a9decac64174d9aab83bc925f5ac0", + "s": "6d049a8cc6f445e491883f263541f3e4e6c262cdb0eea35572a86c549e0ecede", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 196, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad02b68f3b", + "sig": { + "r": "008ff3b70a7acfb4ee40e5f8bfa40c1c495c570f130e84bc073781abe1294344fc", + "s": "00cc0875286be0d7fbd24693419e8a3e0a2d486fdad1c3785cef13fa2606b82f5a", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 197, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad02ec10a3", + "sig": { + "r": "00e2e5a028349e505c0bb30186b921e625bf3156fd39c67d01acd1cd620e179784", + "s": "00c919a7cad13934a10fac268f26f996479389241120e3d565a19118d24b31f133", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 198, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad06945c63", + "sig": { + "r": "2b4a1eaf6ffa8e24515058cac9a9b0e5a8009a89ac12be6ca0b448103ccc6403", + "s": "0e90c58574fa1724cc41b190c9cb70de9e66ec3bf684723659c467559b0654d1", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 199, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad09f9b734", + "sig": { + "r": "142ce051bb90cd635af8c9807426e78f45b1dedd27a7f4919a59aac6c9db5a71", + "s": "00beadc36a652774271e9619d9252212bbb3935f3b8a5545db334e35890babfd35", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 200, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad0b115d03", + "sig": { + "r": "00f9b5229f7d4f74f86d97a3b5de957b47559aeb050383bd897d085b14c56b43f3", + "s": "00efb0dea2abf889d8ab1597354c71dffe5052065f83b218265f4ad09b9b129b94", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 201, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad0b2ca028", + "sig": { + "r": "1e92529dad15e00ffac11323b964edd943fb5fe8736803bb75627a152f67e0ff", + "s": "6c2e79724329250b4bdf78d5a34ee3fe6e1cf7a076567322806e6ad6d59abe09", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 202, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad1a5b39fc", + "sig": { + "r": "008c72e2ab15a68b7b3767efd4660e9aa948bb0a787ee8b1d3f158290f20fa02bb", + "s": "00ffa01e4c0077334c2d2e57f6bd7612d7cd86bcd8c783d1a46ae58996acf49d95", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 203, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad1f772244", + "sig": { + "r": "00d1fd8ece293e82d3ee8964604f3ed26da573c8a2227c8dd5ee2eff0c27dc386a", + "s": "00ab7f782c26334330ad3f606a464d88ca4d03392520609c665c0214958447eff7", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 204, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad214bbd7b", + "sig": { + "r": "1b1abcb5ab90887e63fcbcabe5d53ccbb9cb85349182c0ea3a0fd0a4569e910f", + "s": "00a1061aece9dee319292f954da91b228d0b0568c06e5ec767d5403aedce4d096e", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 205, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad21712346", + "sig": { + "r": "19196ab1deebbe5f1c03cb6df13941c14ecd10e176761eef764f92ef42428f9c", + "s": "0081f84899ae2695f0bc55e75e2b2d4311d45cdeaac0348e4a6aebd2449819d028", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 206, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad25062f89", + "sig": { + "r": "00b0a36af1324f705d545393cd26bbdc959c9e89bffc1a96785b46920a584dd8af", + "s": "00ffb4a2fb1a02392c5e9adb1d284d09e82087a88229d38abb78093fe30d45fa8a", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 207, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad2ac5e021", + "sig": { + "r": "00efeecc81bbd534acf3d10f8a7450636111ef4915ce88aba2d2c1479ddc3b4496", + "s": "00b75cf8dd67d22930ecfe31f61fa03f1a496ab6ebb665f2a90299ba016e36d062", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 208, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad2e8b3198", + "sig": { + "r": "5b205c7bdf4f39dbf892cd945bd91e5d07fe778e7a98dedb88af87c770254408", + "s": "00b45a07e0ffa60e3e04c90fa313443784200242c888b75ea000402a60e58d8be8", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 209, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad31a5f342", + "sig": { + "r": "2dba902841c4a978fb1f1e67647ea382fba3f03371b2b94a326f0622d1b8bb4b", + "s": "00832bd2730cd7fa80d4504e9787e6581f3fbe4fc4c57ccd805664dded968cfd0c", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 210, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad3632d31f", + "sig": { + "r": "39a8beb399d609b2cfb4d1b4ba007b25cbeb006f924afcfc77a8cbc985ca8e0e", + "s": "00f59973bcad3d11f1998f794bf607478720422c72b001f1cdb936d7c3f7743e3c", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 211, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad3d64fd6d", + "sig": { + "r": "15339bf5b9f9ef6947fe8972c7ee9d6850a7fd7addfbd894a7ceea0d687beb67", + "s": "1a6e63fd939f4f8628c605b9a76c3ccf9e2303035922741f1c185c57810c2046", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 212, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad3dd0ba8f", + "sig": { + "r": "1ba3352cb24fcda7f2934bbbab0ef5dc574c6a5054daf9d3d264ed382fb5be49", + "s": "3fe7cdad536d76fe11b73bd9fc7af872f02e83084ece0e7197c7a589f47cf4e1", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 213, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad43852af4", + "sig": { + "r": "00e2a188971d6ffb32217f55d45bd1b91ea777f11100f1d4b099d396bc2eac5940", + "s": "12f58753756576aa340ce26064d8b6d742193d2d2a0b6a9e3a2a506e430b11e3", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 214, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad4de703c2", + "sig": { + "r": "008732a3f17fc975baf9a9aa43241bdd9bbef0de6d57f205739834a34265083df9", + "s": "49e0b54e90d54d034ff398247f0bc08db091c737be33f97112d8294fbdc9d786", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 215, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad4f775bfc", + "sig": { + "r": "00ab221de76587c9530e2bb6fb9d2fd0d27b146cec1b7746db12f60558633e289e", + "s": "00a53cfbb844bf2e4bd6626acb46d94bda011515eb5c5ae2d565e2314b4f08869a", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 216, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad5638b579", + "sig": { + "r": "00b2ad99127759bb8eee245903db0f47bbbec98992949a93f59469e3039f59162a", + "s": "3c4a0f6f8f4f27097d08cb26dc8d32ad16029f2cb9dd7d6e338174ece3f13a80", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 217, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad5829f099", + "sig": { + "r": "5ad52c989aa275d83c3f113121d785959a9f29318f4bc068a459576fee5869e1", + "s": "336f7ddb0ba8ec258ac127ff69e83067ea8f41badd1d6093307707385128e9e9", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 218, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad59da3396", + "sig": { + "r": "212b33ed622c61b8defc9680b255f7b2b7af054f9f6ee723c855ee32a2e03892", + "s": "008e6dd0199e84c5c4887bc5e2fa5cd4ca6cfbd7069e48e20a0842ded68bf13d89", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 219, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad6378ebae", + "sig": { + "r": "00ff8daa5b3fd2faacd5aff93cdda8ae1448f14ef2e1c4c329c8de1a519e286052", + "s": "008a4f87ff6a506ea9468eb5960e3210a09cb4305688da07f22df7c6d325ec60af", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 220, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad663517c7", + "sig": { + "r": "00ae9b3cfd0af6e45194a0ae0204eecd5e0529cd06ddb1821f41f02fdce6516822", + "s": "00a79505fd13d809a549e57939ca2a3e70f891acaf5dac73eb9813be29b0374aca", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 221, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad679e392d", + "sig": { + "r": "0ff7ecad65305a24a8897bc0c01fb6e552d28881e8248020128d973b8d41519f", + "s": "1099d573e3f75623bb72c127fc262a84812dca25cee1ac1a2248b32d76e33bfc", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 222, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad6d1e5152", + "sig": { + "r": "00c9f587d238eb7f0e77258c5d4e8878f63a2db50c385cf0be589dd7703b1da179", + "s": "1f0c6def2842ccc5e6461fc62f09d571d18934cde4286fbbebd8d946c4943f48", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 223, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad6f4ceb32", + "sig": { + "r": "305aca5ee3e5287559127bd7793417a9ab7d3576104b498ee82fd2718c802c77", + "s": "6a2b6f98742a0b8d575565e06da99a7eff230719cc16e070e5ce4bed0b4f0063", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 224, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad7106bfbe", + "sig": { + "r": "009fcd89e234b08064052abeb1a1aad61372be46ae3377c2241eccaba04cfde34e", + "s": "0812756de5c8323f3f646847442fbcc796da23fed23611c2a693bd2f5169ea33", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 225, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad776a3831", + "sig": { + "r": "00c7fa14e07f7202849a0b6a5ebcd5d32e52a9f3399e0bf3b787e088fcbfc2b9ea", + "s": "00952edc8452ddba6afb19b5463396178032583d24c12b67ef5b67ec4ff0269585", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 226, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad7cad23ce", + "sig": { + "r": "00cc377f82bc7daaf918013fbd1b89db78ada0bba28ab4ef860a21a894535c2b3c", + "s": "00af9543ceb7cb5902e04fdab051360319a68c88e74a93b5b56dd5f284227f9ca4", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 227, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad820b64a4", + "sig": { + "r": "009c85c6380cab2f5a5981fe2d28c6848f8f06d9c6029233a20dd24796d045e085", + "s": "00f7570cda29563f1e8bd10913f164fe29a02f39a64ea02775f14cc8cc943fd16c", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 228, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad85978f4e", + "sig": { + "r": "742551d77cf4e7e310bf7bdefba0eef8c5e7bee10403b8bffd1f2e0d32c6387d", + "s": "5bab6b736d264b47af329a8fff95e04b4e1ee933a0e5ae4744d5d845fa6e97ed", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 229, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad8732d356", + "sig": { + "r": "7ba23ff1f779fa1fef577cba2be62b334ca61d030ea50a09c896755d05213738", + "s": "00f8215d966e84a423fcf3f3843587ae196896bff819d1a91f522efccc4125045a", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 230, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad88b66c1a", + "sig": { + "r": "29c281ea85ba9e3c6fb0c8be3fb3fac120b5b75ab1acf6f40e2193dd6b8be30c", + "s": "1f2055c4919521326b15f9d955c3c9b51a27bc1fe0ece341f97b473841ad3e18", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 231, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad8e69901d", + "sig": { + "r": "0fd43fc7a77dce8a598b5e99c57d3cdcb5e02a193dfcf741410b122352575691", + "s": "00f10801b5747f41ce1af6104da2c410527f0ea8b6461da642e73a35f7fc9d8b27", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 232, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad9c99f28d", + "sig": { + "r": "00f88ed193fd6bef6c4ae5113d49a9eaebf9be0ed0d8bdac24fa985b46351d3a97", + "s": "00e2f3f657f0ee49be9eaa9fc564dbe8f64eccccca6241316a5cf1a42b7580d156", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 233, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adad9ff5ce87", + "sig": { + "r": "10c7204af8920a4240d100a5336cb7b8606e141e13f8542b7327b67b9839057f", + "s": "1927bdab1e26270226f5e1f716dbb026a7db485e634562321b32cf0a4308e9c7", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 234, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adada8e1e961", + "sig": { + "r": "008273d286610f6a0eafe999ad58fcb2fed051e9f1253fa7c85db4dd39d5d42106", + "s": "34e91c1f7b8d155cb82c4b62836280e34d17ab828242b9e50771dd7cf4907170", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 235, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadaa1372b4", + "sig": { + "r": "008e730d83573940cae2bc76b94687b59a7bbc99ccaf50397d0303a997a5729a64", + "s": "2726b5b74ab541c343944ca292195292a6f71030741e8f5a11795091cd39f646", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 236, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadaeb3ccf3", + "sig": { + "r": "00d8d464b5b6233f70471047e7c38972654e214ebfaa223fff9d7c42d26a0ad4de", + "s": "6327c351d61489950509829525ee9737e9a2229c290098f6fbc7c513b2835bae", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 237, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadafa2d999", + "sig": { + "r": "00db7337ae37bff115c6b5abdef2c87edb828e0873c2f55d385d71505a5e488060", + "s": "00b7e8a98e18a44622e966c7c067419dd5ee6480ca617e8110225a76151eb00fe5", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 238, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadaff26e48", + "sig": { + "r": "42f2f8e21454ed251060c2c8cc3f02dce57bb198881cc9fdff814eed0ec60292", + "s": "31d50cbd4604a3e10977ef7f01af270a696f6ff377247aaa36698277b90a67b4", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 239, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadb4fe386d", + "sig": { + "r": "7ff5703452e899ece352956d01c010c8d8628d7a2b7ccb6f4e6f7257460d9988", + "s": "5e261fa73f082fc273398a261dcbae4d0f5f9f79fb4153ec407f5fd774e38d34", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 240, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadb802afbf", + "sig": { + "r": "7fb8b65bc4b5298fed6b9efb2ce811eb18dd86359ba53179629db66fc9b61afb", + "s": "6e4e651df1fce814a49a4497e3a4f29cd6a628ce08df56be6313832a46c14d2d", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 241, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadbb02d527", + "sig": { + "r": "009c443c467ac2e2e7b5ec890a984b32322577186d1de1597fb510c4945ad2c5f5", + "s": "00eea789cc5d6ba7bf92c506b95cf8e011d78150f3d67cc2e02cc37f896ff20b55", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 242, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadbbec9eef", + "sig": { + "r": "64d0f6e31ab03790dc9e674d373580b98658d47132009aacae5fd5e5337a8efb", + "s": "257382296568f95fb497e29d2c0c742c532bfd3becbc1b5ef9b73deada89ab1e", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 243, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadbf14261b", + "sig": { + "r": "0096f6f0485aa8b258bada65cb7e9340be1d795d8cbb5129b741b1dc89d39808b7", + "s": "6afe13696a82027b730a53d9eb5e3031e5826a0352b8e6ce2b249a586ac780df", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 244, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadbfca34aa", + "sig": { + "r": "0e8d2cfbfed234a73b37320485b6f69efe203791d666de3e575a8d5e2fc73802", + "s": "00a96407afed45d55146cff4c348396995287a26a529ea4f7e3651dda8fba8ff90", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 245, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadc16365bb", + "sig": { + "r": "6c29dc4ec9028adc39cd4974ab9108c42bdcb221d8a12ae13d3788dd582ba533", + "s": "00c3759b404b85eb6cbe88931120769a11ebcfdc1116c4708b98d851957db1d9b7", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 246, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadcb65063f", + "sig": { + "r": "1f7cd2af494222fad7cf2eaeb4888e7de67c56cfba649f5af374a54298760266", + "s": "3094652abb6b1cba4e69409142d47f3493f25f8b1c3684c08b5cb5919552a8a2", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 247, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadcc5819aa", + "sig": { + "r": "00e8be598f23041bc41fcd7891ad9fd94b93b1a6062f1ef6de8f01ad95204ffb81", + "s": "69cfd8fe72a34a027b4b26612322894fe09091dcc88d348a88e55ef140253cc9", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 248, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadd13f13b6", + "sig": { + "r": "5ea57887d2e177e9cda3286fa07e2d023ff7fa485de21a933b2edc4cc14d1bd2", + "s": "00e0c9f7c77fa4ce20857d3407435aaf2af274988589af0cd3581e591fd3d498ce", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 249, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadd1cbed9d", + "sig": { + "r": "00a5f1d63ae270b885fdbd630aeefc4d185ebf988a43c292597a4c83b7dad6c7f5", + "s": "0097d8b6c8a46d698352cdcf01e1be1f16f0458017bc138c84da679ef029966b93", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 250, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadd2da2518", + "sig": { + "r": "303e0a076026a7c6394072f709bb4e814d1fc776f3d15ce2b0196872f63da39f", + "s": "5b6994ee77e6c19ff290416f6cf8cc4343aa47f3664cce445843fa4bc685794e", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 251, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadd4c1f5ea", + "sig": { + "r": "0790a895a0636088dab59a8f97f8b127be2806cabd2c53ad910e12bdd87fa41c", + "s": "00a9449ae03aa050e6c9237691df51a2c0fce46fa5302b5459416bc5c9110fd1e6", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 252, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adaddf9020f5", + "sig": { + "r": "00a48e7dc2b5f839d2337879a5f0dd167f67de4b69c9db6db895568c968947c6d2", + "s": "741bc53832e211c826e339fdfdb053dc56741a7006e0a51f5ba8c5c89bfefd42", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 253, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adade57bccf2", + "sig": { + "r": "2509b80202f9888fa76463b39508a49b8ccbb83c473c49d515b33676e37fb6d0", + "s": "00cbb8ac99af86794748ff5e5a186fd528ebab05a12e50f0d5ff69dfa669308ce9", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 254, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adade875e79e", + "sig": { + "r": "00de06491694681a9c55c269dbf0bac8a1673524ad997d65fb38067630d94b4b36", + "s": "0c976f8af520b2e98448a65888baacd150e5792298c631dede521b4510aae501", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 255, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adade8f1c621", + "sig": { + "r": "00aef25f5eaae81f0a064afb746b54b688060e59085c3ad2dcf336d2b2b9101b89", + "s": "00d099bb2180869521653f7c3dd1da524e9e5b88a85a481d9cf24c5784245bab50", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 256, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadebabba01", + "sig": { + "r": "4e7cd825c09f623865a4dbe951663744e01373fefffa0b70bf9174180703d557", + "s": "00d887d8662ee195b132f8a982b5b6d554af0fb83730b3b07a9e2e08dc29e40ff0", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 257, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadeda614a1", + "sig": { + "r": "722842c5ffc75c828c11ba6660e7e15b2a3a392a727ce2102762773f0950a828", + "s": "00c68e5bede20df0b351cd6fc6bb9d1ee6926bdcfc1a9e9eea0f941545d950f229", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 258, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadeedd377c", + "sig": { + "r": "74b7b4c2decfe2ff82432426b6186052ef56d68d8275d98b46aed973d5e4556f", + "s": "009529aa6af14da9a70fda6779398f5e46756b5365665f280381ee46d2c0e93633", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 259, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadefa84192", + "sig": { + "r": "00ce019847eb4a7fcb9a46ced582b0c6164170367c007810fc1c0308ba47091def", + "s": "00bf6beaf6d0ed5591abbecf5bda17ed1c286c2f72797cf6bd267732b1406737c6", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 260, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadefff788f", + "sig": { + "r": "14f4b15d2ec16a87084f3c37928f7286bd12be88eb860a7ae7dce5979a2ebe90", + "s": "008c687ef8d6773d2c6db13a88c73d77a396322b0055003cf9e281e2e25ca6b427", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 261, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadf57cce0d", + "sig": { + "r": "5d851c1e55ffc683ce011980b4cba7a0e1657201f466117183ed2101b48a987d", + "s": "37cc93593f506314504c969773be9df60d60c36a600eda97e72709089615fadb", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 262, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "1e58adadfe4eb4aa", + "sig": { + "r": "5a8d82cc8c37ea09cdc50346e8579c935e25647e71598d513ba6ad511af8d8e9", + "s": "78fa0abba53864f35c993a31f85303ddc61aded283f75469126cf7fe53998b19", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 263, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "7a4fb325039369c2", + "sig": { + "r": "00906296ac2c5acf3f77bbf2132bb00f293b722106f3eadf521611c29808d83a79", + "s": "4e730ba1bd3dee81652e36e1bcc965acd158eed627a20a05574f3eb5d4715584", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 264, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "7a4fb3251001fc0e", + "sig": { + "r": "00cf6826875dd928423c24d0bb731753f8f747573549129465354aa7bda0a5df32", + "s": "0095c391162d908372c5ab14997f47cfa69d88d9ec6d8eb88e877183f6d60b3119", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 265, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "7a4fb325107d46fd", + "sig": { + "r": "00bb77d3cd2ad15d27e487f148f8e182bb04147a9c3e3153fdcf08205884441629", + "s": "5818bcbdc1fbc092d2d8b5382910511ab1665e98e5877186e6efe319c9906a11", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 266, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "a14672e602d4137f", + "sig": { + "r": "0cacb5d76765b04fdcde0464aa448c7e24b04736b70a529dd8d30e50eb63ab8b", + "s": "00ad234ab963dd707845ab90326c725fb208660300b123d528679fc9dc246d34fc", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 267, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "a14672e604d55a14", + "sig": { + "r": "00e2e838f8ab8d5f3211414e07b50479f8c7b4323d611ae09558ff3350933aea29", + "s": "008fe8e45c94301a2dc876051a3e50928acb8e0be46b6d8044c8eea906dd2ab5c3", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 268, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "a14672e606f7e881", + "sig": { + "r": "00e85ac2dfb48efe644e4845d208691a7dda8caa034171440e185b1d8da4d1837b", + "s": "406e3868f10b4f81c57bb1bbee0fc982050b033c5b18eaa94eb37bf9b41f7138", + "id": 0 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 269, + "publicKeyUncompressed": "04fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d652e37fc4edcd930541de82b1dd78a7ff436ae949f65b6e3da02c968c92b7718", + "publicKeyCompressed": "02fd3bd15393b992edcf023133fc83d81bb5113054beed84d0d4991067e175247d", + "msg": "a14672e60925a734", + "sig": { + "r": "00b4dfdcc49d14e44e17d8f51a73ee13d8e6e82ffcbdcbb1050fbf16ab0d28826f", + "s": "4b8663a41b88a9d6021942236b8a15913275578c957fb83a470d7a625be587ab", + "id": 1 + }, + "comment": "special hash:pattern", + "valid": true, + "flags": [] + }, + { + "tcId": 270, + "publicKeyUncompressed": "044be2dd3b76d2f432c46e5da308491843a62f55af1a65f344ba02a2ec8e96711004ffa4a3edd0f3d264b406df981ddd3ef7143c1ba4abbcdc4aacdbafeb904291", + "publicKeyCompressed": "034be2dd3b76d2f432c46e5da308491843a62f55af1a65f344ba02a2ec8e967110", + "msg": "68656c6c6f", + "sig": { + "r": "0081bfb55b010b1bdf08b8d9d8590087aa278e28febff3b05632eeff09011c5579", + "s": "3dcb2ddf1be0bcc25bb2f47edf0a575aede76ed5ae5fc6fddc3e0aa1a9dec2f3", + "id": 0 + }, + "comment": "R: x2=0 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 271, + "publicKeyUncompressed": "04a1c994f5ec2270c02404c7f28260190a7f7c8c6c90989e34cf30f76b96784ee2ecbde4d1e20894734755b1bf6efcb70753623e7243b345e748f7c79f6a031947", + "publicKeyCompressed": "03a1c994f5ec2270c02404c7f28260190a7f7c8c6c90989e34cf30f76b96784ee2", + "msg": "68656c6c6f", + "sig": { + "r": "00e3f4bd402343936c2bff08e7430a86ad85b72bedf0ec53f385093a7e1c55d096", + "s": "0088b50c6623297e6dec30c3f330321e187076a001a604781e5bed807f60168bb3", + "id": 0 + }, + "comment": "R: y2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 272, + "publicKeyUncompressed": "0411ddcdcb05d34667247e1dd7e15908f85e01e41c7e16289e0cf4cfc4e601c09383c73bf6e3f76c953187a45c9babc74639ddb12a1f59a78d9f8639506dd7ed97", + "publicKeyCompressed": "0311ddcdcb05d34667247e1dd7e15908f85e01e41c7e16289e0cf4cfc4e601c093", + "msg": "68656c6c6f", + "sig": { + "r": "3477806617481c3944ea395d71a15a7b95daf52825f2b26ca73d89a7f0d63cb8", + "s": "009df4e5550f0032bb7c9be97fc18a0052b46a2b334e72971781036023503e4287", + "id": 0 + }, + "comment": "R: y2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 273, + "publicKeyUncompressed": "0487f5a843ce8219cab458467f60855247c222e77e897c2f7580cee0f406793e3b261038f99a740c75b8d4757aae7bc3a9c7555f6b931019fde3ca7e3cca6888b0", + "publicKeyCompressed": "0287f5a843ce8219cab458467f60855247c222e77e897c2f7580cee0f406793e3b", + "msg": "68656c6c6f", + "sig": { + "r": "45170061e1e3a4aacaecdf24c4943b5e45549b20c00135e6cb34aed92cf8b728", + "s": "00b5398f46743d95b381cc05befd2e6169b2014bb36f192fb198ede5be1d289faf", + "id": 0 + }, + "comment": "R: y2=-1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 274, + "publicKeyUncompressed": "04ee36a1322e4cc939643ce45aa5394abe7f620ae4f8a99758ef239466c08a2927e6dd855f4360572cb511d038722c2c31849910dfe76ced10c51faaae976362ae", + "publicKeyCompressed": "02ee36a1322e4cc939643ce45aa5394abe7f620ae4f8a99758ef239466c08a2927", + "msg": "68656c6c6f", + "sig": { + "r": "00d9ef981511b93f7adc6ebdf36a8f4b823aa6090057ad3738fe18a42e46dfe12c", + "s": "425ad79e2be38053a1071eee99132fd7616b71d39cbcef99e30b3c33bd02b107", + "id": 0 + }, + "comment": "R: y2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 275, + "publicKeyUncompressed": "04cafd124a06f1ffa11834bf07e7e5fa94880b583af8a3393549d7ee8ccde1a725f73df4cc4afc998e997463438c55cb6fd3331bafb9cc1eb0c21c65410519db4f", + "publicKeyCompressed": "03cafd124a06f1ffa11834bf07e7e5fa94880b583af8a3393549d7ee8ccde1a725", + "msg": "68656c6c6f", + "sig": { + "r": "00af8bbdfe8cdd5577acbf345b543d28cf402f4e94d3865b97ea0787f2d3aa5d22", + "s": "41c8a07800fa532f12d20643939612718fd0c62d3ed2a1d3686b688c7678213d", + "id": 0 + }, + "comment": "R: w=3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 276, + "publicKeyUncompressed": "04f5cf72366aa802774275c15552286cd335fb09c57b8407709ca02e2d867062309e5832439c13329184087f4f2571267b86b3c8264797fccb63ff4b4dbcd26a4d", + "publicKeyCompressed": "03f5cf72366aa802774275c15552286cd335fb09c57b8407709ca02e2d86706230", + "msg": "68656c6c6f", + "sig": { + "r": "507442007322aa895340cba4abc2d730bfd0b16c2c79a46815f8780d2c55a2dd", + "s": "00d58c453531ba41744e8bb85e8b9dd32ac23317800dc6c5e7fd8d1db6e4fe3d92", + "id": 0 + }, + "comment": "R: w=3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 277, + "publicKeyUncompressed": "04f1ef59cc7aaa3628d3bdf2e6420f75d555a2c4aa19cc47292df555f40b9b038e1109ba6e6590c5d913f44223b5bde48b15323fa679bc02fe4fb274a25e82ad29", + "publicKeyCompressed": "03f1ef59cc7aaa3628d3bdf2e6420f75d555a2c4aa19cc47292df555f40b9b038e", + "msg": "68656c6c6f", + "sig": { + "r": "00de16fd61a828098877199f6b9691ac16b068ea147264d32ecebf8afb1cee87c6", + "s": "413fd8880c288c6894ddc1c9e98e3221031515428cabf3035e2fc35125653860", + "id": 0 + }, + "comment": "R: b=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 278, + "publicKeyUncompressed": "046fd4567c7c69c62c34db7282452f2d91b2ea7999c9d2e83422ffcaeb7c52f842b9930b0e372d82b18fb4821cfaf925334b74d33e4c58b1a67123b2d5b4b8b814", + "publicKeyCompressed": "026fd4567c7c69c62c34db7282452f2d91b2ea7999c9d2e83422ffcaeb7c52f842", + "msg": "68656c6c6f", + "sig": { + "r": "15802d3d7aec18b1830f8b59148e86a2e59edfda163b8823e320d6c65c8d3386", + "s": "00dfa107b1ffff662369ecc4fd7d26de6e4efac419ac95228462f19c067cf9a0ca", + "id": 0 + }, + "comment": "R: h=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 279, + "publicKeyUncompressed": "04f6a4dd46a4946f2515e8e37f6a93642f8d7758903ceb8cdfcbae94e8ab668ce2408f92b452c672ce438cd1e02c224c89ddf316b46c00c306846b7bdf63c62fd8", + "publicKeyCompressed": "02f6a4dd46a4946f2515e8e37f6a93642f8d7758903ceb8cdfcbae94e8ab668ce2", + "msg": "68656c6c6f", + "sig": { + "r": "00851eb1b8699d1cc01c6b6048139797dab3981c924f9ef81bd1f464c3182c8709", + "s": "0088b2f42516181cc0deeeb02fc5b0f47f81a993386c5bc0623b1f435c9211b82f", + "id": 0 + }, + "comment": "R: h=-1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 280, + "publicKeyUncompressed": "04b47d67496efb4ba0ded89a93b267a70f972a7d29ad8f7dc3bb85848faca0e50fac56e39edda6e55e3c11154a91273130a5669be4713d80de50089784db7c08c7", + "publicKeyCompressed": "03b47d67496efb4ba0ded89a93b267a70f972a7d29ad8f7dc3bb85848faca0e50f", + "msg": "68656c6c6f", + "sig": { + "r": "00be2d2738a9b2ccddbdc0954d6e990d23ee62920b2e6a49d3125bc3002dd07ffd", + "s": "4ad4c3367e11674bd79d5780960c28e9b8bbb301d514055a7483b2a1d322a687", + "id": 0 + }, + "comment": "R: s**2=-3 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 281, + "publicKeyUncompressed": "04819810bf10542a9509742fd900c1bb1cdfc42610fe33e89e1ff8b802d8c2c26ec5e90363f557f4327d48afde31cf5ef2960a0cfa272ec61534f1c8ac3b1fb14e", + "publicKeyCompressed": "02819810bf10542a9509742fd900c1bb1cdfc42610fe33e89e1ff8b802d8c2c26e", + "msg": "68656c6c6f", + "sig": { + "r": "09e78d4ef60d05f750f6636209092bc43cbdd6b47e11a9de20a9feb2a50bb96c", + "s": "00b7dfbe5b859660d27d3fa9ff837edb2b41d0bf1791c61fafdae1bfeb40b18245", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 282, + "publicKeyUncompressed": "04e56c04637391888ca2aef8d32214b081bb78142117c5d1114f4e2ba3b86602093ee699b40e4e20e730e1701f22b8a580b6be96b6cb97e293d8aa207b61162262", + "publicKeyCompressed": "02e56c04637391888ca2aef8d32214b081bb78142117c5d1114f4e2ba3b8660209", + "msg": "68656c6c6f", + "sig": { + "r": "008d0177ebab9c6e9e10db6dd095dbac0d6375e8a97b70f611875d877f0069d2c7", + "s": "00d5d5101866aa8d02c736cf85908c825c1901608cb8b5594189006321db7da0d9", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 283, + "publicKeyUncompressed": "04df8a1e18dcba82d08bcc36c789237eaf15a28939b69a7687fd0d3d6edfb67e0d329cef3552b7a9432a068a5738220501b9d3aa49f01f3de2fdd03e1eb35bf9b0", + "publicKeyCompressed": "02df8a1e18dcba82d08bcc36c789237eaf15a28939b69a7687fd0d3d6edfb67e0d", + "msg": "68656c6c6f", + "sig": { + "r": "6916fac45e568b6b9e2e2ecd611b282e5fcc40a3067d601057f879ce5a8a73cc", + "s": "0089a017384673a6cf1ce7451d0b288814b418b8b6a9358d4ef5d02df93baa6102", + "id": 0 + }, + "comment": "R: s**2=1 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 284, + "publicKeyUncompressed": "0447e63c8d81e8455c7dae806c29a5f2647bc1d01e84442b45a4d2591f9da42f6111964566e1154e77877c79a982ad1b6be6b4ba8f32e9db52188eddbb8e9a312f", + "publicKeyCompressed": "0347e63c8d81e8455c7dae806c29a5f2647bc1d01e84442b45a4d2591f9da42f61", + "msg": "68656c6c6f", + "sig": { + "r": "00e8f28207e8621cc82d634671493877fea23e3ce7fb73b4e0a6be4d6c7d9f3564", + "s": "547af19748840c2b34046351c148869ac88229907f4295116a625763e26e6ede", + "id": 0 + }, + "comment": "R: s**2=2 for m=2 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 285, + "publicKeyUncompressed": "04248752257157ade3bab80ce1b4f5d354124e1592d21d713914435bcf16da8016165c8c7933a8b37241bc9e77c3d0d3f3b7ac21deb30e2497b1057f68e4d00e75", + "publicKeyCompressed": "03248752257157ade3bab80ce1b4f5d354124e1592d21d713914435bcf16da8016", + "msg": "68656c6c6f", + "sig": { + "r": "00f6e0274e045257cc028cfe83df31e1678c2c4c0573371c315dbae73fd412d078", + "s": "6f5f2e621ec79864d050a9de8c663fab5c22d25d1ac68b2b395924cb8b7624b9", + "id": 0 + }, + "comment": "R: x3=-3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 286, + "publicKeyUncompressed": "0429fd5d7ebe6cbb56ce88a8e2196494bb679e96ed76d6a0334eb71d0db82e3d9f2558dfea9f7ee920b57d89fd8a356f934a2b0f289cf59256dff8365ffc84662b", + "publicKeyCompressed": "0329fd5d7ebe6cbb56ce88a8e2196494bb679e96ed76d6a0334eb71d0db82e3d9f", + "msg": "68656c6c6f", + "sig": { + "r": "100121f1a09443851c9aa2ab6ee6440e2ac5e1be648274bd5d26c12fb3ba3f7f", + "s": "00cdfd0be2b5f5d48bd3a358d109fdf511a58774a0374b08191c286cacbc76f119", + "id": 0 + }, + "comment": "R: x3=0 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 287, + "publicKeyUncompressed": "04a0a12970eaf5e7da87f89a21e27d1c55be899c117ccb7c3e7c3128b47a10fc6c4e983acf1c95911f5064847d65c7a51a81605705d62a7dec4a9131d17f4804eb", + "publicKeyCompressed": "03a0a12970eaf5e7da87f89a21e27d1c55be899c117ccb7c3e7c3128b47a10fc6c", + "msg": "68656c6c6f", + "sig": { + "r": "00dca4cf4b841c05e45b3b70f1c6e02a1a03811234c3c044b2928981030bf6d39c", + "s": "009229ec7e2c0f7e01f5f7a43ae71d07333b1901ca81bafada0310797f869649e7", + "id": 0 + }, + "comment": "R: x3=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 288, + "publicKeyUncompressed": "04933d632a97297c829eb989e09e2b46eca60c065206f301f68fe86dd0441c93cae062f5a3dcb9eecd117a3071c453817c53e7af9053e8f1dc1ea9c17eb9f3524f", + "publicKeyCompressed": "03933d632a97297c829eb989e09e2b46eca60c065206f301f68fe86dd0441c93ca", + "msg": "68656c6c6f", + "sig": { + "r": "00d006f2785f3e4d6a3e9fee57dc668cf1c48e4a6a69ee72706d0f54075db6d9eb", + "s": "00f53ef5718cbdac8524402002c84f69ded81443cceafbb08f1b656bc041fc15fd", + "id": 0 + }, + "comment": "R: x3=2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 289, + "publicKeyUncompressed": "04d787dd95c6e36d2c1ce4e3cbf61ae37b1456c4710cb966e2f95b70456e13ac655dbd55cb9cb3113454bba84a9ff7be1624dec25bac3ae440da2936d4f5814302", + "publicKeyCompressed": "02d787dd95c6e36d2c1ce4e3cbf61ae37b1456c4710cb966e2f95b70456e13ac65", + "msg": "68656c6c6f", + "sig": { + "r": "45d3fb3ac7aa271f91b234ad1d18ee96d3d7d7654c5a5a4c3166ab50abbf5b30", + "s": "3a91183134196321ca53593c78ba9b8135ba1acb47f26c543ede50fe80c08eff", + "id": 0 + }, + "comment": "R: x3=3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 290, + "publicKeyUncompressed": "04c9929c3ef663a75256fc5711989991fe201b5875820d17260bcc0bcb34b08e7badd79ec52ea421cffd20e8613fe6099214bba8e86f69a45f61a6b381ceeeba08", + "publicKeyCompressed": "02c9929c3ef663a75256fc5711989991fe201b5875820d17260bcc0bcb34b08e7b", + "msg": "68656c6c6f", + "sig": { + "r": "0092db0aeaaa4ae24b119b2e30f29cb79d836c220e90fbc9031144261ffe75dcd1", + "s": "00d972884a9f3e2f8db44f695b45bbe122f4b0f204740e1c605292ece70f3c7467", + "id": 0 + }, + "comment": "R: z3=-1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 291, + "publicKeyUncompressed": "048e25c65dbc40283b761852b85c7f0c2d4b2a44ce94dfa902ca71a1e71a83a53138610e8d7260ae2640d18c6afe49290768ffd2873c32afb8a03158190b35cccd", + "publicKeyCompressed": "038e25c65dbc40283b761852b85c7f0c2d4b2a44ce94dfa902ca71a1e71a83a531", + "msg": "68656c6c6f", + "sig": { + "r": "00dc64ac26b3cf53362fdac1c0eccd15d50d58bda1a355ad0b732bf99e70532f0c", + "s": "00bf376d61c842edce6e6a774a2445a7191af1bedaef38de9b3a2ea48ec31988ee", + "id": 0 + }, + "comment": "R: u1=-3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 292, + "publicKeyUncompressed": "04e2f2772e9fe850f0a7c3777d282d7b18a2b2792a0e69db2abee5ece10638e466f8f6aece26069aa4e1ed0b53586f312d9b190807b26f9176d34a386ede7465a0", + "publicKeyCompressed": "02e2f2772e9fe850f0a7c3777d282d7b18a2b2792a0e69db2abee5ece10638e466", + "msg": "68656c6c6f", + "sig": { + "r": "1ad9ee1ebfe0a768960e19421ec32322fef50aaf8eba16b7ad65d99ffb243fc6", + "s": "00e78f0d515738428525c162870b45520c4806af883b81fa70f896e8a56c59de35", + "id": 0 + }, + "comment": "R: u1=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 293, + "publicKeyUncompressed": "0472c927800db7870d883e1d543089eb668fbebd02d550b6cdccbbfb09d04de851c9149a87124c0b997d66abdc06e8756d228c397bc3cf26c55627c1327e17e0e6", + "publicKeyCompressed": "0272c927800db7870d883e1d543089eb668fbebd02d550b6cdccbbfb09d04de851", + "msg": "68656c6c6f", + "sig": { + "r": "1b7672ce8a192d8826af545fe544db7d11c8cd5d379187910e5cbff5b010339a", + "s": "78ee9b801e86cb4cea598fe1576226c76243c50de8b2e45f317e025ac1c18e1c", + "id": 0 + }, + "comment": "R: u=-2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 294, + "publicKeyUncompressed": "04114b9c0a724c6626cc3fa16344520237cd8dada750be97a8d1772d2a33514b678538409cb42978081ba20f5d0680b9334dffdb9568171ca887972e492b1a5941", + "publicKeyCompressed": "03114b9c0a724c6626cc3fa16344520237cd8dada750be97a8d1772d2a33514b67", + "msg": "68656c6c6f", + "sig": { + "r": "00e10df2402d508d573d3ab41b0f3717273c54e7c0b509c33350a9f2a6ec5ba85b", + "s": "00bfd951ba080060327f32eb7058a88377e2bc387d3e53e3470cf7c35dc4af1c1a", + "id": 0 + }, + "comment": "R: u=-2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 295, + "publicKeyUncompressed": "049234f3d861010d953a89a3a4f44b30c577699a4e7b4acf3cc20d0c1be9b3801365f540d24a59497821bc5f37c758825483a7e755b4a3b23b0906bda9bfd00b2a", + "publicKeyCompressed": "029234f3d861010d953a89a3a4f44b30c577699a4e7b4acf3cc20d0c1be9b38013", + "msg": "68656c6c6f", + "sig": { + "r": "03a8409c233a9533040ebb555820d443f49813e0f49228e17341ddfd2447e1df", + "s": "32df48c55d9eac3d21221be571433009af16f2ed57df6fb5848d9d926e0068c9", + "id": 0 + }, + "comment": "R: u=2 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 296, + "publicKeyUncompressed": "04219f89c6c3369e3aa3ce1969f94990f1d0cfb62685d5e0ece4d745e802ab661ec2205ff6a75762336c88714d18e46a52941b2703ad529ba0379def43c9edf5ca", + "publicKeyCompressed": "02219f89c6c3369e3aa3ce1969f94990f1d0cfb62685d5e0ece4d745e802ab661e", + "msg": "68656c6c6f", + "sig": { + "r": "008556fdab5268b568871532bb325da41b437caa7e59065f522e31983899870991", + "s": "5e8500098cd43d1b82738d6216bb09907984f678c931d12d53bd67d2122db198", + "id": 0 + }, + "comment": "R: v**2=-3 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 297, + "publicKeyUncompressed": "045b873c367267f6c1bd06da1e5e97b9bb71c1a0e7bcb91ddf37a4791eaa7b47406361cd832230eacf80317fe5c3aede37d36c0b07990cd2ec5fc84f1c6679a45e", + "publicKeyCompressed": "025b873c367267f6c1bd06da1e5e97b9bb71c1a0e7bcb91ddf37a4791eaa7b4740", + "msg": "68656c6c6f", + "sig": { + "r": "594b38e571e1e6bc11306b17d76d3c8b7a8c650d12fed44dad531a1c3e08e9b9", + "s": "009633319b1c05b968ec8915545943b590faa8a83a45b40c5b4b8e59de76b59190", + "id": 0 + }, + "comment": "R: v**2=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 298, + "publicKeyUncompressed": "0457f02ef14a5a4f479610c1f2c98494765ecffcc1b145ee63975542325465ecc38b897637fb7e4b5d78686d5fb076049dd1c0e2b07c1461b77de359714a6bebb2", + "publicKeyCompressed": "0257f02ef14a5a4f479610c1f2c98494765ecffcc1b145ee63975542325465ecc3", + "msg": "68656c6c6f", + "sig": { + "r": "00f3c0b02574fed1d737abe3eaf06cbce1294475024750dd474b1722f815ecde1f", + "s": "1d9c9d4df07d6ef182b360eb43bff014c137fabed95ca7d05785d75358629467", + "id": 0 + }, + "comment": "R: v**2=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 299, + "publicKeyUncompressed": "04bc9fd933536aeb0ca72cd4e20d20a5ee6e30aece40850a11b59e8cd2314f02c9d0f1c0bf4c484e9c4eff95c42410fa12fdd35a6484dde553f0286b96260ec8c8", + "publicKeyCompressed": "02bc9fd933536aeb0ca72cd4e20d20a5ee6e30aece40850a11b59e8cd2314f02c9", + "msg": "68656c6c6f", + "sig": { + "r": "4c52f8345031965608a68c513a9a99c7077e0161bd1a1e0da360b233312a9cdf", + "s": "3d04e23dc4a1ca191f59e3d92bb48a412a58de0a2426dd19dfab16c628d7f0db", + "id": 0 + }, + "comment": "R: v**2=1 for m=3 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 300, + "publicKeyUncompressed": "04744244736024d654cd70d34acc1bcee9a618e696ec4754d3440eb6ad6f78fa759d33d57ebab65e879b3634e43d75c7ead9d1a26c79c4a9d54a9568412d86aecc", + "publicKeyCompressed": "02744244736024d654cd70d34acc1bcee9a618e696ec4754d3440eb6ad6f78fa75", + "msg": "68656c6c6f", + "sig": { + "r": "02495ac9f43e45aae30d3366e351cc08828cf3e11cc3b7209fbd1730c4a14f4e", + "s": "00850d28cd7b3aff7659487a25c16645111c47b3f82b053af1dcd7bcd0fb70f39e", + "id": 0 + }, + "comment": "R: x2=0 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 301, + "publicKeyUncompressed": "04842faf24e7d489669938895bb777b2f6b32b60b9d0a290b816ad03fc9042cf8c98a8c4dce446cce895b4fd7d7ecda0ed5246731b93f9079a20fff3ccc063bf71", + "publicKeyCompressed": "03842faf24e7d489669938895bb777b2f6b32b60b9d0a290b816ad03fc9042cf8c", + "msg": "68656c6c6f", + "sig": { + "r": "009e6c031feed8a8e8eb3d04de0b8d62c268d61131d225aa3420141aa17dd8d135", + "s": "0edb77f4037c295944ccbdbe643b7a1826d2696001580f34b5eef0f2e00baf89", + "id": 0 + }, + "comment": "R: y2=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 302, + "publicKeyUncompressed": "0406b67b420269429761794aa0a9d8edf3f9b585925dca120ffc0f72855ca4f423004ace87addde5de724c28bf04f6cb72fc20ffad17e8664481179f214d435452", + "publicKeyCompressed": "0206b67b420269429761794aa0a9d8edf3f9b585925dca120ffc0f72855ca4f423", + "msg": "68656c6c6f", + "sig": { + "r": "00d3e9423ae5ab78c1c32dc26b6c5c6762fb03859988f18aa8b655055d4e94b182", + "s": "00c6994ca2f61dd99c9054fbf3f6a09fc0df22b88f10e186d2b2a6a6dfa067e0d2", + "id": 0 + }, + "comment": "R: y2=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 303, + "publicKeyUncompressed": "04b99141ca71ba7fc080e9d3b909bae1a4f604da36b92fa2eb09695876e598881d4c4d82762654e17fd3211c726ebbbe59ed668006d93b5f84f048a64ccb1c7d5b", + "publicKeyCompressed": "03b99141ca71ba7fc080e9d3b909bae1a4f604da36b92fa2eb09695876e598881d", + "msg": "68656c6c6f", + "sig": { + "r": "61f127502b1792c64f08ce2fe482b97fb5c96fb27d11bad0c43d6bec71ede3f5", + "s": "15040b885a405082b1cf1fd63807142e844bf6ff925bc73245fdfe6284cea307", + "id": 0 + }, + "comment": "R: y2=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 304, + "publicKeyUncompressed": "04a41d0c52c1b5e127ebc6907329c1e43e2146f05ea5644a26ab7b4317ad8c8c20263bb1d0c60a0812541de1fa6a6a10a4e39bd0f76e0cbc48bb98a17053612750", + "publicKeyCompressed": "02a41d0c52c1b5e127ebc6907329c1e43e2146f05ea5644a26ab7b4317ad8c8c20", + "msg": "68656c6c6f", + "sig": { + "r": "4ccc7675f1f08200ae2b3e96293774621f387720b842f3261df37e6c32a5879b", + "s": "009e853ae6ec5a9d4b14de7c200d99c0a058733ac75158a60f725145643f614e", + "id": 0 + }, + "comment": "R: y2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 305, + "publicKeyUncompressed": "0479f6a8c8c6802f87a0712c92b0b64ce2afbc3e48b6e670f3c7c0a7fde2088399eceb8fb4950b990663fb3bdf1dfd5c61cacfec2100fc8a4d6248f11a87a79239", + "publicKeyCompressed": "0379f6a8c8c6802f87a0712c92b0b64ce2afbc3e48b6e670f3c7c0a7fde2088399", + "msg": "68656c6c6f", + "sig": { + "r": "0096d990ec5473803f3af2c85fa52ceeac3724096d14d5d6afe96148b0f01fa4d3", + "s": "0c3e0bfe98944f2ea6d19f95c8be83765609441beca3f2206de9c700a9c218db", + "id": 0 + }, + "comment": "R: y2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 306, + "publicKeyUncompressed": "043d6d70190eddee89165668691ff0ce44b5374283c26b3f32e52ad0b93e4bc43b80ce5d495267d092c46a8c617c4f675e96a7a6d37efba7a7d97e8d5c4e9bc215", + "publicKeyCompressed": "033d6d70190eddee89165668691ff0ce44b5374283c26b3f32e52ad0b93e4bc43b", + "msg": "68656c6c6f", + "sig": { + "r": "41983b5e4fd04fdd5342c3f6d95edaebf1692eda9463ef48de63a1f4e009768e", + "s": "4d3e700ef582b981bef4cecb53a2412017d0724c048b1f24eeaa581eca142e2a", + "id": 0 + }, + "comment": "R: y2=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 307, + "publicKeyUncompressed": "04e646dc545d0f7c3254b488536b94a510b79756028b368a76881287862a834437e5b36842b7ffd08afafe235347a1c4a70819873895d5ac245dc09a92e12fc132", + "publicKeyCompressed": "02e646dc545d0f7c3254b488536b94a510b79756028b368a76881287862a834437", + "msg": "68656c6c6f", + "sig": { + "r": "00afb102393ce571d0863e6c5053baf9dfd879b7f1a2f97dd6b7651e099a4a407a", + "s": "06fb1d702573b7869f530215f016785c6e07ff4687eb1e3be668d393829b6136", + "id": 0 + }, + "comment": "R: w=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 308, + "publicKeyUncompressed": "042b0386c6f4291a6bd5b97b5e21536bba8b7dcc666a497dbe73d70222fc1479b5e7004afa5e74be1ee8bf2ba3af1aad14af34addb814b701b5044191e2a921d3c", + "publicKeyCompressed": "022b0386c6f4291a6bd5b97b5e21536bba8b7dcc666a497dbe73d70222fc1479b5", + "msg": "68656c6c6f", + "sig": { + "r": "2ac5023330649c40cef0df17091dde7bdc174214f59f5a0bdb7076fc4482d866", + "s": "77940faf88cd3b74c859250328c2d4e841be4a0ac103faf6357e45c131678fd3", + "id": 0 + }, + "comment": "R: w=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 309, + "publicKeyUncompressed": "04ba73635905c1f85621e6d5b30961bfa4ed3ad4e60f63ffb653ef0ce5a7d1ab8f755957e48111e38c9e690760901fdf0fa7b893b305a992426eea8f56d90f15be", + "publicKeyCompressed": "02ba73635905c1f85621e6d5b30961bfa4ed3ad4e60f63ffb653ef0ce5a7d1ab8f", + "msg": "68656c6c6f", + "sig": { + "r": "00a2a027822b7801a45288c10d56e89323025d683780bba99c1769e847d340a984", + "s": "00e41db846840c6419d7f394d728792b321570b2b67928d47fb721f4a065c6694f", + "id": 0 + }, + "comment": "R: w=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 310, + "publicKeyUncompressed": "04ce44f1f169e6bf4efce1b5af14b8dd1e6221cc805de9ef0e3487d3df4c1431406c1fff9ac2f6c093d95c09374fdaf0238db0215222cb7cf825468ac374da08d5", + "publicKeyCompressed": "03ce44f1f169e6bf4efce1b5af14b8dd1e6221cc805de9ef0e3487d3df4c143140", + "msg": "68656c6c6f", + "sig": { + "r": "00abafa2dcef57c183e7ef837d1b0fb3339d7dad0fccc4040ed9f5f31210fc7cea", + "s": "64cfc8814b28593320927a7c735392c5fce4fc885975fae5e07b4cb6ce728d6b", + "id": 0 + }, + "comment": "R: b=-2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 311, + "publicKeyUncompressed": "04b054a85060fb6ecc284fa919564ece6c2bb1c931adbfc176f1857a0e871f89eed80cea751e3e1da7b5166bd431ca7e6ca7e7c7d84a1a60c0669d01605c5073e5", + "publicKeyCompressed": "03b054a85060fb6ecc284fa919564ece6c2bb1c931adbfc176f1857a0e871f89ee", + "msg": "68656c6c6f", + "sig": { + "r": "3c70c74ed8f746cbb70f0b928672e3aa21e799c64e028fdd07a6e05bdbf86d9b", + "s": "38d5bf3b4180bb7053d202d5da690a2c0a500ab8ff552f18f54cc968938f4a58", + "id": 0 + }, + "comment": "R: b=2 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 312, + "publicKeyUncompressed": "04c568e59233185ea262407cea40e1a5dd0303d6242a004814803786f4226c3a2775d8f66d357aea8ec0ed4290ca95c22f033b7fe06a31877ff3123a415890ecec", + "publicKeyCompressed": "02c568e59233185ea262407cea40e1a5dd0303d6242a004814803786f4226c3a27", + "msg": "68656c6c6f", + "sig": { + "r": "0080a997849fd32975698dff60367e6aedc8f34c87c1e13934c9213f7e8ce12de6", + "s": "206a6fb6895ee0e546639526c5079fd9d050e599bd2983ac98510371680b2304", + "id": 0 + }, + "comment": "R: h=-1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 313, + "publicKeyUncompressed": "04131107dfaecff9f45f8881ea11ac7f890ebbc4e905ea0656a39c180142b30c7b3e8b97e665f50e5262987924c8ae3a3af9b650cb6a9445d615a4680c71971f81", + "publicKeyCompressed": "03131107dfaecff9f45f8881ea11ac7f890ebbc4e905ea0656a39c180142b30c7b", + "msg": "68656c6c6f", + "sig": { + "r": "70299e2de1c90bb9f3136dd368a425a8f9e319ee250267895af4f52f5c730077", + "s": "00e40ea69fb3823a27f3bde5b7e3a8f010a66cace5f3fc50b6e47ab501eb7fcade", + "id": 0 + }, + "comment": "R: h=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 314, + "publicKeyUncompressed": "0437b478216ccd727906a7d78354adc1abb87ae00b4d53d7d0b18afeb5391a55d69afaca49bf8ffd9ea4da4f44dfa31bbb2ce3f6fb8a3d63e56fca09ea5002888c", + "publicKeyCompressed": "0237b478216ccd727906a7d78354adc1abb87ae00b4d53d7d0b18afeb5391a55d6", + "msg": "68656c6c6f", + "sig": { + "r": "3a06155ea858f061eed65c9d392aa00f4cb70bece7160b23c4069d4917dd6949", + "s": "5d02850a5ebee20d1e737c1792f959cc7d4341633c76d55207804229c730414c", + "id": 0 + }, + "comment": "R: h=3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 315, + "publicKeyUncompressed": "04394e11d8f000fe02fcf7c6e2d2bbbb66041de3fb8f1edc7072daaf75205465ef6122daf46c848c6ceae3a9d1bed1cb43498bfa0a58834b3f199a2c057435a648", + "publicKeyCompressed": "02394e11d8f000fe02fcf7c6e2d2bbbb66041de3fb8f1edc7072daaf75205465ef", + "msg": "68656c6c6f", + "sig": { + "r": "2dc3896bde982e80023cb97dc35dd727039972475efa9035f00254b38ecaed29", + "s": "00a327f14e302a78590a036a567af766214cd6813ae392a8ca8eb620279c4cf8eb", + "id": 0 + }, + "comment": "R: s**2=-3 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 316, + "publicKeyUncompressed": "04c1c4d3e341bb7c9dd234cf4d56db31998f9c355d70a3be744f4ab8d12619f2e1f20757c8f9034d9bcd0d1fe57963f23b059342b534575062503498eca18ce8e2", + "publicKeyCompressed": "02c1c4d3e341bb7c9dd234cf4d56db31998f9c355d70a3be744f4ab8d12619f2e1", + "msg": "68656c6c6f", + "sig": { + "r": "0087468a3a54d8bb346a050e9745f64477d460953576e738d891ac2be25d922e70", + "s": "00a4cb2a163f6a3a100c7f8ae6eaf15ac29218874f21a05c6d14dad7e86a6dd859", + "id": 0 + }, + "comment": "R: s**2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 317, + "publicKeyUncompressed": "04760fd6b3727c220c61ae73fd4542a1a04e4ccd871c30c4a8af273c2a962b7edd386481c6f9d027f64baabb0672b203408f86fdafa8f82f5e752c99eb995f386e", + "publicKeyCompressed": "02760fd6b3727c220c61ae73fd4542a1a04e4ccd871c30c4a8af273c2a962b7edd", + "msg": "68656c6c6f", + "sig": { + "r": "00e0daf6dea6aed50232f24c4268836abe20f3e014fba530e8f2d892a0c52fe038", + "s": "00a811bb8cf6ad568f9e15a8a8ec2df9d3003313e8c277c15a042865cf51ee7956", + "id": 0 + }, + "comment": "R: s**2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 318, + "publicKeyUncompressed": "0437ffe79174aa0f25b57824dd94b3c5c626bdf2282164883a1749f7b03656023d561a605c2ebefbf9ab0f2af774f059b3068819b369bf71e1dfe7d1bc1f430acc", + "publicKeyCompressed": "0237ffe79174aa0f25b57824dd94b3c5c626bdf2282164883a1749f7b03656023d", + "msg": "68656c6c6f", + "sig": { + "r": "00eebb798553d86d9fb67812eda033fbf2438ea0e3722d041e344c94d16de90641", + "s": "35c75c7b5649fdb0c6e8f124f415384baf57ff4f6e98c53b7fe9d35bc53a17dd", + "id": 0 + }, + "comment": "R: s**2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 319, + "publicKeyUncompressed": "045e917adf94df9e52bb92b0791142a71ec7cf8e3437637f9b289938b007e2e86760295478e35279cf6b018b2bc1af01b791bfc8c29797eb061ba4b6c4854ec906", + "publicKeyCompressed": "025e917adf94df9e52bb92b0791142a71ec7cf8e3437637f9b289938b007e2e867", + "msg": "68656c6c6f", + "sig": { + "r": "00e2eaae70c5ee8e7a7e9d8af7111745309450aa147972ca00ab4d0627dfa02d59", + "s": "00b6d2db739901bb3870f454971e529d9deca3b49c048932e8d5b2217427f0cca9", + "id": 0 + }, + "comment": "R: s**2=1 for m=4 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 320, + "publicKeyUncompressed": "04dd5b0166e5865c19ba9a4d2b8a67e505e2cc5e711b1f6a76e4dff4c33595e5516ba5c73f594f08e8e007aef3c7d0f1a81e735913e870dbec6ff90704b281b57b", + "publicKeyCompressed": "03dd5b0166e5865c19ba9a4d2b8a67e505e2cc5e711b1f6a76e4dff4c33595e551", + "msg": "68656c6c6f", + "sig": { + "r": "00a122dde09dcb45bb9fdd2d09adf28dd4c97b9438ff01731cf98535f34c3ed749", + "s": "00ada5b600b7e7a05b98b3693987bdfa8d14ca5a500df4e372bba234c2a9701c30", + "id": 0 + }, + "comment": "R: x3=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 321, + "publicKeyUncompressed": "0482e6c65f7cdc6b399a3297ad47f1d1468c1dfeab26b2c0663a5c5e64e43396f65f703fa8bef7940af8ff403287d910265923b22120d46ede93028f86a8172502", + "publicKeyCompressed": "0282e6c65f7cdc6b399a3297ad47f1d1468c1dfeab26b2c0663a5c5e64e43396f6", + "msg": "68656c6c6f", + "sig": { + "r": "73ae4017ede4357af4ac31bf724593d396320c2837d855ffd4b1ed5fc98b9729", + "s": "2260d19c467dd93ce078dfa5721ad34d77db38d2c86fab65e44ea850bb8458b4", + "id": 0 + }, + "comment": "R: x3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 322, + "publicKeyUncompressed": "048101f9a2fae339d4d2c56985f5ef46dff6edcac2fed2f9ffe2c934fccfd84591ccd4adb4a49a42525ff476fa097a9e39e1a1669e04e7e302ca019f106f6ee54e", + "publicKeyCompressed": "028101f9a2fae339d4d2c56985f5ef46dff6edcac2fed2f9ffe2c934fccfd84591", + "msg": "68656c6c6f", + "sig": { + "r": "008df110bb5baf68a1e0fe0ce44fc7b14f2dfdf9f63ecbc85b664eb12b702518c4", + "s": "0084c61351606f45d4f768b3b047fc2052bd37398d66e0d12fae69bddc6be80e4a", + "id": 0 + }, + "comment": "R: x3=0 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 323, + "publicKeyUncompressed": "04ae38134684983987c675500777777310db0f758c1afd2f79d2a5fbf2e5ead39db483fdf32c565cfdca10879ae2929b8775e3b050a7e4d2ea466337abf13e84aa", + "publicKeyCompressed": "02ae38134684983987c675500777777310db0f758c1afd2f79d2a5fbf2e5ead39d", + "msg": "68656c6c6f", + "sig": { + "r": "144f69853b3c2763563e48afa941b6e1e3c2830a59760b7e2560505b65245b22", + "s": "00c7eab8e22ceaf173715630edafe899cd791265e4920173c112dc5da3ef8e4479", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 324, + "publicKeyUncompressed": "04185e8e53115ac663e69a91bb03f6bda04c00a347e8bd2161d6b34266199a882fe57b49eca81b5d42f20eca86946bbc3d2159585372cda87a6c6fcb14a4023516", + "publicKeyCompressed": "02185e8e53115ac663e69a91bb03f6bda04c00a347e8bd2161d6b34266199a882f", + "msg": "68656c6c6f", + "sig": { + "r": "57caabb051db60b3b6ac866bd9965b2faea60fc41e182f812219da2455bb5c91", + "s": "00adf197b7b6e2e7f7f33942e9aa2ca95611620b2ad473a96f6ab4d1ec185f14ee", + "id": 0 + }, + "comment": "R: z3=-1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 325, + "publicKeyUncompressed": "0435f6d62099f497b21a6c8611f9b07e189471f34c125f0767e44b93fbd0f1f6a6ffc6e22f6670134cbe36a5355239057509acba36738992b949a2a9d739b87078", + "publicKeyCompressed": "0235f6d62099f497b21a6c8611f9b07e189471f34c125f0767e44b93fbd0f1f6a6", + "msg": "68656c6c6f", + "sig": { + "r": "00a653a2d51e89aa5bf400bcfacf6b6476e7c3d8d9879b31139b195ad4b8bb6d72", + "s": "04832d8f486fc18928b10cc02380f8dceacacaba0bbba5a063b7c289e652753e", + "id": 0 + }, + "comment": "R: z3=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 326, + "publicKeyUncompressed": "047e2c4fb7e9477f5c61dff56cff1bc6fc96f3dd97e0abcdfee6e0e7032d6fd5847de616e0256a54f022736d45e230ca4ffdc77b23bebcc99e2c795afe201e5f95", + "publicKeyCompressed": "037e2c4fb7e9477f5c61dff56cff1bc6fc96f3dd97e0abcdfee6e0e7032d6fd584", + "msg": "68656c6c6f", + "sig": { + "r": "00c05b61b9b8af7b3e937516dcc5820228a845899b1b953419eefc3320b189fc63", + "s": "0093c86e17ee3ee4b463aaa85d7a395ca24662cf8f3d15da45990234ca094420e5", + "id": 0 + }, + "comment": "R: z3=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 327, + "publicKeyUncompressed": "04f138adb0a288b75880463ec335de8408dfbc842d44c680484ca6b644f15771f11768073a362c7e1b0f0711db9c2af1243e0549256556913c123230d1e3439634", + "publicKeyCompressed": "02f138adb0a288b75880463ec335de8408dfbc842d44c680484ca6b644f15771f1", + "msg": "68656c6c6f", + "sig": { + "r": "00dc7d6606ceb858ebcb6d0ee0f1a524a8a43322df57e2b622059df5dd748c54c6", + "s": "617a2db6855e20fd331a69140280d4cb3ea63fa5706b182d6323a54df35572b1", + "id": 0 + }, + "comment": "R: z3=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 328, + "publicKeyUncompressed": "04bac0c36ed68daefafacaf86dac1d70c807381244ab948f5716353ffb2888291785a249f8cb3cdb1266d993d13e0e71b37685d3c9585b07bea74f9f576ba014c6", + "publicKeyCompressed": "02bac0c36ed68daefafacaf86dac1d70c807381244ab948f5716353ffb28882917", + "msg": "68656c6c6f", + "sig": { + "r": "3c7765e478dddd5f2fa0bfcab074bb6db939ecc421eb888fba6e325ca19879c4", + "s": "00e4fcfeb8736a7cd10debd02ecd8826c12c754facfe22adcaa360be5bd36375b8", + "id": 0 + }, + "comment": "R: u1=2 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 329, + "publicKeyUncompressed": "04e29551205b55ff66609f1a5221ade67d355fe0864440a6f7ded7e9670fadc2db27b83f1b95699c99f9925c2903957af61828614cd02a7fc35455e8e9ac126832", + "publicKeyCompressed": "02e29551205b55ff66609f1a5221ade67d355fe0864440a6f7ded7e9670fadc2db", + "msg": "68656c6c6f", + "sig": { + "r": "009004592c20ae8f841db0317b241fa209d312c1f5ef5b94f06d04d09ef87c5e75", + "s": "00ce85c5525a26734baef000550aacf2ad93de93e5884d1e9d57a4711e506e8783", + "id": 0 + }, + "comment": "R: u1=3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 330, + "publicKeyUncompressed": "04f33960f55d864acb9a4823cf6ddd2657d67126eb7708eda923edfd88dce2a6b21ccd9adb4444d2f3c8020baebbd9b463cc03edaf10ec6a660a53e13f220aebbd", + "publicKeyCompressed": "03f33960f55d864acb9a4823cf6ddd2657d67126eb7708eda923edfd88dce2a6b2", + "msg": "68656c6c6f", + "sig": { + "r": "51ff091bd9abe18ebfa9f5797b0d185bf1b9dd3cab6df2fd04b9fac830fe0625", + "s": "00f0b35f9bc58c60f0f08fd4836c3d4b35b7329625951ac9368397fcee4519cb78", + "id": 0 + }, + "comment": "R: u=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 331, + "publicKeyUncompressed": "04538d3bf5914977b6aef973f907698bc1f833baae6e0488a1e1f652f7c6fcc3456ead6b858449871abc6270987bceec5166e530efc36cff3fbc41603ee3ed0566", + "publicKeyCompressed": "02538d3bf5914977b6aef973f907698bc1f833baae6e0488a1e1f652f7c6fcc345", + "msg": "68656c6c6f", + "sig": { + "r": "38467fe82fc695ba460f30d93d635c3b65a2b25824ba575bdaae07285b2a6769", + "s": "00e73d99a797617be853c9c151b8ba1b65663e6cf0806bf8f4e951e842842fab41", + "id": 0 + }, + "comment": "R: u=1 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 332, + "publicKeyUncompressed": "04252364723c8fe2cf61ca282fe6db2e2c84a2e6f46b864b363019834b030486b55d1f240247f7c793082f1cb9c34fdbebb2ca67bcaaa733d2eb93d0d2a838234d", + "publicKeyCompressed": "03252364723c8fe2cf61ca282fe6db2e2c84a2e6f46b864b363019834b030486b5", + "msg": "68656c6c6f", + "sig": { + "r": "00d3c153403a498c04b7571cd63c7f4d9f610602b16d01555a1a9d9273befd226c", + "s": "00d81c370a452d147520b17fa5434aa489b78b9aa404c5b53085e04799b614eb88", + "id": 0 + }, + "comment": "R: u=3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 333, + "publicKeyUncompressed": "04e795567b88325e670b17fd74b3a825ebcbbecfc0900722bcb30b0b7e154230d5f99ad4a440ee6b1f06a7c3f5d6acb7cf0f21c518abe340e1d05cf1275c1d3b14", + "publicKeyCompressed": "02e795567b88325e670b17fd74b3a825ebcbbecfc0900722bcb30b0b7e154230d5", + "msg": "68656c6c6f", + "sig": { + "r": "5755181d433d73ce9c071bb3e755f2bc78fa48a1c016ba5225f66a3887269542", + "s": "7324659637c7fdaedc7a74c132892202b8df420923340fd7d060a62bfcedf090", + "id": 0 + }, + "comment": "R: v**2=-3 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 334, + "publicKeyUncompressed": "04245c2a3b071072c9191b9ef7a861d4d7bc5423779bd486fea3d4d133a5c308d374a0d5d0bd4a97010e7f8861ed84d47e9507d4df43901f7d85ae347586dea170", + "publicKeyCompressed": "02245c2a3b071072c9191b9ef7a861d4d7bc5423779bd486fea3d4d133a5c308d3", + "msg": "68656c6c6f", + "sig": { + "r": "00c03de55f1518a637f71e539ef4989a883c468ad9d0b0c7d8702e89224f02754b", + "s": "4123d0c804081180ff4e1d1e78028b6555ad5daa1730bd7fcac770253b4adb00", + "id": 0 + }, + "comment": "R: v**2=2 for m=5 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 335, + "publicKeyUncompressed": "04d2a7ff422b724a8d545f1b194519f05a928fb69de04df6d7cc1609637d361955ea2a4259d0161e9d5a420ce973ed185ea5ca7785e42780ba38164c328526260c", + "publicKeyCompressed": "02d2a7ff422b724a8d545f1b194519f05a928fb69de04df6d7cc1609637d361955", + "msg": "68656c6c6f", + "sig": { + "r": "00c2ee7bea87fbb8b162ca8dc44448aab0356c95c1ee66198a38ab75868c797d17", + "s": "316b0b6d8adaf01687f356c4dad4f50f0a90ddde57fba165291af3a12b6726e9", + "id": 0 + }, + "comment": "R: x2=0 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 336, + "publicKeyUncompressed": "0477a4293b2791686b9f6e20bc305cd5d442a950a6321d5e2ba6b873da94db7d8f828518ea7b93d5f2bbab9de819215296804c41829251783564aa547756d0814f", + "publicKeyCompressed": "0377a4293b2791686b9f6e20bc305cd5d442a950a6321d5e2ba6b873da94db7d8f", + "msg": "68656c6c6f", + "sig": { + "r": "083fc07aaa8b51ff33669d240dfdaab825daf06eb7e7a19a40f86a019355b633", + "s": "7a5927320e660e1957f743b3c1aff390e17db143f018010761c77bc281762029", + "id": 0 + }, + "comment": "R: y2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 337, + "publicKeyUncompressed": "04e1aff11b3a81b8b744c662b580cd938b0e2137db854d6cbb0bb4592c2d4a1922433bd0f856808ab651d97832a407ddfbecff231e1ac050627f053db5a1b1d84e", + "publicKeyCompressed": "02e1aff11b3a81b8b744c662b580cd938b0e2137db854d6cbb0bb4592c2d4a1922", + "msg": "68656c6c6f", + "sig": { + "r": "00f19f8d708c8074c1ea70351961c9f667754e06e1aa6f83c05a3cf5ec06c2fa8a", + "s": "20230941ad46258a0792c6368447e989370b1dbaae1aae774a6e9bffc49341ab", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 338, + "publicKeyUncompressed": "0445429d603220fefdb36db14898fbb554e806a4d63f99c5e39595ae29ea0da94bdb0d7b41eb02928fbc965ebd351aab710a64fd58cafcc943955b9ff2538cbcb7", + "publicKeyCompressed": "0345429d603220fefdb36db14898fbb554e806a4d63f99c5e39595ae29ea0da94b", + "msg": "68656c6c6f", + "sig": { + "r": "09d8f4cf514e685daa5ebaa5c46eefdbe194e01c4e17659e611950d57fe2b6d7", + "s": "78950af83ce461c7f8351b281473bc41a545502949a8634ecb2ec8efe718b463", + "id": 0 + }, + "comment": "R: w=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 339, + "publicKeyUncompressed": "04b0c55a3b7913b19f3196a20077c1a93347de6bd1ffd247f4dffe8132962f310cc5d02d836235aed19b8593b40c956ec429a00557f6801117206e54c9bd72f985", + "publicKeyCompressed": "03b0c55a3b7913b19f3196a20077c1a93347de6bd1ffd247f4dffe8132962f310c", + "msg": "68656c6c6f", + "sig": { + "r": "00f0dc6573f319ca8d094db16e2e257958c195e31ad4c96dd4b04ab41f2d32a988", + "s": "00d8c253d3e6546dc253f7bd898a17ba2ec7e554d06e962e01279feb3250530c8c", + "id": 0 + }, + "comment": "R: b=3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 340, + "publicKeyUncompressed": "04cb08cb860943a4efe8032bcfd0ddeedc984f88b3f6cc59ed87a7e4c622b578290dff8c5041122d8df472609146de5c0b08afc1297ee1dfbdefb1d6f0a6a7623e", + "publicKeyCompressed": "02cb08cb860943a4efe8032bcfd0ddeedc984f88b3f6cc59ed87a7e4c622b57829", + "msg": "68656c6c6f", + "sig": { + "r": "782b68c39f139a003a930ed98e14168a9c656cf0b1564cde0a2f252f7a927d30", + "s": "00ff64405a2e47f8fe58e20fceb90b0e9f71e97f4c8e1ecf0c68bb935cd85df70d", + "id": 0 + }, + "comment": "R: h=-2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 341, + "publicKeyUncompressed": "045a0156f486f0f6a04b67d84064601510f040a6599844f8d1488505c70d39eb0ec7b2c56e616aa7541ed9ef4963071a54f88cc337ef79824607fde30d8ec6af73", + "publicKeyCompressed": "035a0156f486f0f6a04b67d84064601510f040a6599844f8d1488505c70d39eb0e", + "msg": "68656c6c6f", + "sig": { + "r": "0084c763085295190928266b708bfb9a01296cf2f1f2a058fd64419d4fee3ec0a5", + "s": "009c69d4c5b2c220fbb4bb950f54a2b9fc0dac385d1c86223699772a7e48d93a0d", + "id": 0 + }, + "comment": "R: h=-1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 342, + "publicKeyUncompressed": "04639b96c05fc7aaf0dce1c9a2dde410d13d4872cc90be7f3a91a23658686a4a3a772a690fb40299051039d9a3d69a6b7e4fb24ba937c0fd6753da0207a7f52a98", + "publicKeyCompressed": "02639b96c05fc7aaf0dce1c9a2dde410d13d4872cc90be7f3a91a23658686a4a3a", + "msg": "68656c6c6f", + "sig": { + "r": "2e4124ed0ab49f465ddc25aaeca1e25a949dd79217f5936af9e6a840594b973a", + "s": "32694ce379c3f54bd98a41da7b5c144027922241dfc78e0ebec111091d2a0364", + "id": 0 + }, + "comment": "R: h=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 343, + "publicKeyUncompressed": "0487067a9678ebb1ff392d8198ef1c750a681b466b1b6652e146d1db50428a21ae99e6272da9b493a16c1756055500c120474f0b3b5c01fb2c9a370ea45ce50e16", + "publicKeyCompressed": "0287067a9678ebb1ff392d8198ef1c750a681b466b1b6652e146d1db50428a21ae", + "msg": "68656c6c6f", + "sig": { + "r": "64c275a99b3e10da6d7a866a6b998ca64c31ea5171b6a9a8ce96d001b011b86b", + "s": "00f339d98992a1e1a200cb6789d459c14bfbb19aa883dec0e33e50b7ded6b4df15", + "id": 0 + }, + "comment": "R: h=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 344, + "publicKeyUncompressed": "0492c0dad6e62adb66b7c8dd8b159be9410dc1c40cb0a4c9bf44b290ec873c0dd330a025a4e05a9457ba42175b92614476e89431df5657a4b3dd9d1eecf5ca7438", + "publicKeyCompressed": "0292c0dad6e62adb66b7c8dd8b159be9410dc1c40cb0a4c9bf44b290ec873c0dd3", + "msg": "68656c6c6f", + "sig": { + "r": "00ee67c92d40b499e711a801b58ef1936f4868cd8cb2dcc3a4b1aaf3faddc85882", + "s": "3e09225a0188ac90be581f854b7e075ec0b66e383252cfdc67d470664ba43fce", + "id": 0 + }, + "comment": "R: h=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 345, + "publicKeyUncompressed": "04b12ae1d03733133db84df07d387fd626f112149339aba53e238193fa0705fa8fd27c469637d3fbdd2fb06d3dd6a1fb1e96a2d6269a595eae66d4efc6f2790175", + "publicKeyCompressed": "03b12ae1d03733133db84df07d387fd626f112149339aba53e238193fa0705fa8f", + "msg": "68656c6c6f", + "sig": { + "r": "39e5eb47a9845716415f0d8e925c31049702c9cafa7dcb2ceef5560e0c0297b3", + "s": "7036b89317a8133bb540d318d1735d3a87b897cf106604ff07e958809d097228", + "id": 0 + }, + "comment": "R: h=3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 346, + "publicKeyUncompressed": "0423778b49189f8727c6ffe2c142c19b3bb7e50445687a38dc2e8d587ac2ecfb4bb09e5f1936cd575d4faee5fcebb30af3e14665e451702c5a91e1d542f3633b58", + "publicKeyCompressed": "0223778b49189f8727c6ffe2c142c19b3bb7e50445687a38dc2e8d587ac2ecfb4b", + "msg": "68656c6c6f", + "sig": { + "r": "75ecc48752a8833f9d9de5271c2ec98992725c5e1561e19826e293567a78e808", + "s": "00e964bd4481d42b55ba89d9b8589b4a33a5c826d42571e6d8cf7758020a28d312", + "id": 0 + }, + "comment": "R: h=3 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 347, + "publicKeyUncompressed": "04571b17b00bb028c2dbe44bf9fbb9363838e6afcb7b2a92a718aaf20c64da3fe2a607982d64ad570cca4c82fb550aa225886877c251d9cf0bd6b859ab8abf9256", + "publicKeyCompressed": "02571b17b00bb028c2dbe44bf9fbb9363838e6afcb7b2a92a718aaf20c64da3fe2", + "msg": "68656c6c6f", + "sig": { + "r": "00ac0a86d75b1171904c1de94fcd8805eaf5ffae92becb6b98ae6cc7279eca30da", + "s": "00eaaef19922ef9e88e18897933763c3922b6f6ca2102f8742cbb6a4f72ac2594c", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 348, + "publicKeyUncompressed": "04a17bccadb69519b90f168765094b9c888883889895b34f798b640b33f124ec71d171a7c9943d0e99092d8000f9ee11d0cb0a73829b6b7635de275704a2b63e7b", + "publicKeyCompressed": "03a17bccadb69519b90f168765094b9c888883889895b34f798b640b33f124ec71", + "msg": "68656c6c6f", + "sig": { + "r": "0090ec05a4505ead5aa4d8e629f49e256ec8f9094180972b09151b41a11c2cc0e1", + "s": "00a342aada06a18eb09447ae57b27f0c6f3dfa022231faf3220b15e304f21fe8c6", + "id": 0 + }, + "comment": "R: s**2=1 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 349, + "publicKeyUncompressed": "0478cb93246dc92808890401a9fd36d8257d435abdf50ed2201927d9c51224b54021e245f3fbea0b6168d7c4fa4fc8f554e1f88d0fc142cc065ce82d2fffd29e3a", + "publicKeyCompressed": "0278cb93246dc92808890401a9fd36d8257d435abdf50ed2201927d9c51224b540", + "msg": "68656c6c6f", + "sig": { + "r": "00984046b079d62d28e0237e067a53eea649a463faf5e5ae1331168fbd6454f6a5", + "s": "00998dbd8968ac3ab9a7a15e6fe2dcea20146a3ddbe8042b0e9532e76c2a32a251", + "id": 0 + }, + "comment": "R: s**2=2 for m=6 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 350, + "publicKeyUncompressed": "04c2ba619c40cf65891cb85f4cecc05c390243503ed504e9198e1154df10c1a6758a8c39b992d70d00c2352a16e2e0c5ef2bd72eea8db6ac267ccc424dd9d221bb", + "publicKeyCompressed": "03c2ba619c40cf65891cb85f4cecc05c390243503ed504e9198e1154df10c1a675", + "msg": "68656c6c6f", + "sig": { + "r": "4b8f4cd9c1e2d33a068ae498a7e59bceba571a423efac7dfcb33baee87c72510", + "s": "15b5cf696acabc5eb92da022c675e83548d43e6821ba018fa62ff0150b5032a0", + "id": 0 + }, + "comment": "R: x3=-3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 351, + "publicKeyUncompressed": "04397b291663889f7256cff48386f3cb5aff05e0b42fedd8623451edf80182d41f228136056b128bbf151c45a4aa8fc3f5b7ca5076aad7a6ecc641a589ca36f8ba", + "publicKeyCompressed": "02397b291663889f7256cff48386f3cb5aff05e0b42fedd8623451edf80182d41f", + "msg": "68656c6c6f", + "sig": { + "r": "117921cd569ed3c9cb1e16014ff1972ec5a747753ece69481586543a81dfbc99", + "s": "00cf7ddbfa2778f038def1b869869cb0d33a8573a9f8c33945c9045fc164c1e975", + "id": 0 + }, + "comment": "R: x3=0 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 352, + "publicKeyUncompressed": "04f142654e2282f85bd673957beda0719388503e2a4c8a4c280d9cc41774cdf541908f91a92e702e96f9b06fbf1382069ee06474bc3f650ee6fa0b6ffa47755de1", + "publicKeyCompressed": "03f142654e2282f85bd673957beda0719388503e2a4c8a4c280d9cc41774cdf541", + "msg": "68656c6c6f", + "sig": { + "r": "4919f309d1f8c8f5d38c2759d1430e3a3888faff767ae0ecc6813d0511336b4f", + "s": "00b766c27acdebb3cd4f57dd57043d9020955d640d7e31f83581bf6b6c211da922", + "id": 0 + }, + "comment": "R: x3=2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 353, + "publicKeyUncompressed": "046f6c9f0b575c338385df3c0e6ba016859264a094ba99ca8826658ca367ab29bc044d87324acc67eccf6d270fc8ed82bb2718bc0b2bda85d2d442a411f75ed63d", + "publicKeyCompressed": "036f6c9f0b575c338385df3c0e6ba016859264a094ba99ca8826658ca367ab29bc", + "msg": "68656c6c6f", + "sig": { + "r": "649f43f659fdf648e4de1a75257e311402a95bcb26f2cb242fe98ca85473b8ec", + "s": "00b8acf787e04b4c7fd23bc209847bad333d3581d6796f995c640451cea9310004", + "id": 0 + }, + "comment": "R: z3=-1 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 354, + "publicKeyUncompressed": "04f3ce1790b5103c8b3f4b858ff045703eb2e60facba1999b39f75d00b8ae7651bae954e73fdcfb611e3afe6eee5a80bd2683dfcc7d6bc93ae584a4dbdda8c2e6c", + "publicKeyCompressed": "02f3ce1790b5103c8b3f4b858ff045703eb2e60facba1999b39f75d00b8ae7651b", + "msg": "68656c6c6f", + "sig": { + "r": "00f56503713cb789b2407ca2341f887c93f8d462ae4e9c27689f0a1801c91220fa", + "s": "09352c6bfc3793a90f84ce4d99d10603dbe4ecf61556257bb500855868cd7222", + "id": 0 + }, + "comment": "R: z3=-1 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 355, + "publicKeyUncompressed": "04335346f493f944579a3a4f132a9a833f327692d65944b779ef2256b9e14d2b02796992abf4d145884bdbf74d8996b998a0081f519a37214930bf445150401821", + "publicKeyCompressed": "03335346f493f944579a3a4f132a9a833f327692d65944b779ef2256b9e14d2b02", + "msg": "68656c6c6f", + "sig": { + "r": "2d07ad8cb9cba3ded7512e2ab2a1e3ec4e6203a6893e5e77990ede8e29970a72", + "s": "495fd6bcc02fd9dbc5d9c455baca3f60447ebf02cbe88c48671239a7877fd847", + "id": 0 + }, + "comment": "R: u1=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 356, + "publicKeyUncompressed": "04077350e515720d411528d6132dde28be6faa87f594c783ca98071959a665eff6b26db2b92bc45aa4d25661383201eccda0eb1558b61449fb0702d9e31819a0d8", + "publicKeyCompressed": "02077350e515720d411528d6132dde28be6faa87f594c783ca98071959a665eff6", + "msg": "68656c6c6f", + "sig": { + "r": "00a63e0c6554986bd71b299d17fb2f1b0ab029ba5025de0c40ec976f0d3e4719f0", + "s": "3bd50792c8eead41b31f5bd32bc539c496dfa94ebd78df26e9a59aa93328d0bb", + "id": 0 + }, + "comment": "R: u1=-1 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 357, + "publicKeyUncompressed": "04cd63a7b877c1913b9b298bff41611dc7930d39b6bdd0799e2165d3beed9202c8c12032cb71ffa6b86ad8a0e499d064c89676fac716e3dc708fca57dd96b33b0f", + "publicKeyCompressed": "03cd63a7b877c1913b9b298bff41611dc7930d39b6bdd0799e2165d3beed9202c8", + "msg": "68656c6c6f", + "sig": { + "r": "009d05f09ffc104eb07f4d52ffa285ad1bea383f70dfe8830458f81331c338ea12", + "s": "00b0d995c3b5a48611988c92c7d95f4b63e9ef9ad379d7871c9b02bde4b8224b31", + "id": 0 + }, + "comment": "R: u1=2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 358, + "publicKeyUncompressed": "047904aba0319beceaaa2626eae7bd73765741b3c1958adba9eecb8b991087ccc1b691e65874bd977b7dbff136dc9769544350db040026baf5b4f6f03fd27b41ee", + "publicKeyCompressed": "027904aba0319beceaaa2626eae7bd73765741b3c1958adba9eecb8b991087ccc1", + "msg": "68656c6c6f", + "sig": { + "r": "10d6410ebff86d27bac87ee9532d871a3013637ff179850b556c070842dbe7c6", + "s": "009455253dbd794a673392850bc69660d10b349f017582be2cd54ba2424db714a6", + "id": 0 + }, + "comment": "R: u1=3 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 359, + "publicKeyUncompressed": "04147f9b8a54c861c98c7f4d03adecefaff3b5569fd35cad621808e828e8c8767ca701a06bc7a1543f2c04b424ca8a0f2e1cc0cef43a26e5209630ea2f379db426", + "publicKeyCompressed": "02147f9b8a54c861c98c7f4d03adecefaff3b5569fd35cad621808e828e8c8767c", + "msg": "68656c6c6f", + "sig": { + "r": "6e302d509c7a101aa91be9f50681c9a0fc6e23648ed5e48ebe7193709b838f32", + "s": "0095cb6cb7fbec0ebb2d44dccad1b8a6a276a5b547731bb49decab0207c78ba96f", + "id": 0 + }, + "comment": "R: u=-2 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 360, + "publicKeyUncompressed": "04d3b1601772a36605577b6be1b5e9deb603203eb32a8893793427af5cde0e6b449c4de408ab03f92fea7cc23c2a2100cb4ccdd25edb5ff28b7d6af2da2db7b4cf", + "publicKeyCompressed": "03d3b1601772a36605577b6be1b5e9deb603203eb32a8893793427af5cde0e6b44", + "msg": "68656c6c6f", + "sig": { + "r": "009b085c23103e9ee43f9a63dd7fc0964cc19b4433ecba1838aba6db3a4ae2ea12", + "s": "008db927352e274e964b49c0a5820f95fabb99cd2d55bbd0bf2a1fbdb3c3dca516", + "id": 0 + }, + "comment": "R: u=0 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 361, + "publicKeyUncompressed": "04fc6c955b2cf52989505ce41913897de3aa28ddaab2bfdb5e80a9e939f874541ecfc0d29e3ecd8afa4ce435a0966e1d790f19e7fe063a540faf45cd1dd2872d9f", + "publicKeyCompressed": "03fc6c955b2cf52989505ce41913897de3aa28ddaab2bfdb5e80a9e939f874541e", + "msg": "68656c6c6f", + "sig": { + "r": "4cc5d73de553bb661b4bcf7c2765dda32bd658ff38a1c16d51c75f294769695a", + "s": "505f549a21813ee5b839b579f11e8eeb6aeb0bec6535d4bdc39922b176e3fd44", + "id": 0 + }, + "comment": "R: v**2=1 for m=7 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 362, + "publicKeyUncompressed": "040f9d2d6e6c7feca5128b7cce7b7e40e0f298f590a991c6554d3615a47e2795fcbaed082339059daa157e0e1c745b818a33dddcc3667642004adc86196db2bf4d", + "publicKeyCompressed": "030f9d2d6e6c7feca5128b7cce7b7e40e0f298f590a991c6554d3615a47e2795fc", + "msg": "68656c6c6f", + "sig": { + "r": "41e9d4cfa8efe80b895a8cbcce2568e251db7ecdfd20a7ad710d4a4bf2addc6b", + "s": "574cb597eedba89bc2abf9639aeacd53a54aa84283a6539f9882cf6c6af39c6b", + "id": 0 + }, + "comment": "R: x2=0 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 363, + "publicKeyUncompressed": "043285bb6e35be2cd162db798fb9694ce9c6c43894a8704f0b777c64340fd8e086969b1bd83b5764b7e39c16e837a5eeb5f80f9b2e0c3bc081d9743daa9348a1d5", + "publicKeyCompressed": "033285bb6e35be2cd162db798fb9694ce9c6c43894a8704f0b777c64340fd8e086", + "msg": "68656c6c6f", + "sig": { + "r": "00ec88507f0b351dbcd74bbb91362873511204eb9e2b2675c3a137f96b1584aae3", + "s": "00f44e715bde7c6cd3bf8c3065de087de564f210776e12f8148ce10bee46f535af", + "id": 0 + }, + "comment": "R: y2=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 364, + "publicKeyUncompressed": "04452633ad5e53496a34b2aaa062d47a6dcd3ef7c5aea13c452b5895275e4db3221fb9b84da21e0cc03a4e6bbb30a4a43112608dfee8c5e7921a369ced3bfd7aef", + "publicKeyCompressed": "03452633ad5e53496a34b2aaa062d47a6dcd3ef7c5aea13c452b5895275e4db322", + "msg": "68656c6c6f", + "sig": { + "r": "00ef3eb0332fb3908126a4a56e59f875a38d4c62b28a05ab689f4c89df1192483f", + "s": "63f4d55b3651cd766c748b8d54a5f17d801dfa31b2de2dc2d74d386cad59dfa4", + "id": 0 + }, + "comment": "R: b=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 365, + "publicKeyUncompressed": "04db342153992d4626c0a174e86519b82364c3d3f8265cb02676404998084ec9dbd979f5ed17850ffe4e37c6751b00b564f1eb32d1ba32438ff064572d29d4e389", + "publicKeyCompressed": "03db342153992d4626c0a174e86519b82364c3d3f8265cb02676404998084ec9db", + "msg": "68656c6c6f", + "sig": { + "r": "0780d995655a44c061621a6deb166f53fe76230da60ed2658d57e7a91dc90bd9", + "s": "00ff98703f2b4be9849806262024a033aa8365bd531a8719da9d2cd6a57d016196", + "id": 0 + }, + "comment": "R: b=-1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 366, + "publicKeyUncompressed": "045a8c6b68d43e62e4378caa3b0bf2a3e065e828c198d9b1e588b43cd019b401ebc8807ab37cc12962b8af0b095a72bf1d4fe18448b8bf0a5f0e7f926d6112f24b", + "publicKeyCompressed": "035a8c6b68d43e62e4378caa3b0bf2a3e065e828c198d9b1e588b43cd019b401eb", + "msg": "68656c6c6f", + "sig": { + "r": "2fe268e46c447ff46a1b7a9a17dbba8c846cccf97459e8b47d8c44038ad018fb", + "s": "38a65e4e41d9d633042350412981510d4ee8921100d53a28a336d1d574560ae9", + "id": 0 + }, + "comment": "R: b=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 367, + "publicKeyUncompressed": "04e9f052311288079c847189e9ba34e6596f1f42191a16e7330bfddb17d4b9ba726a8eef80a70a5d332579d61f82296be898ec8f4383d546db7a208fca0c1738bc", + "publicKeyCompressed": "02e9f052311288079c847189e9ba34e6596f1f42191a16e7330bfddb17d4b9ba72", + "msg": "68656c6c6f", + "sig": { + "r": "7cc049629717da3873fcc837d172f7a31bd617e235f2ef30016bf2b7e3dd394a", + "s": "00c35c1554f0b421ca975329d502080e89fc7dc1385b09cd7bcd7fe0029910ea47", + "id": 0 + }, + "comment": "R: b=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 368, + "publicKeyUncompressed": "0471042d83f7c2492dcfababa496001445d1eeb3e557317afb08cc673fbdf72436aec5a4e9c73d94921bb6c1c8ae19174e0ba6c1a8a1004147cc08ee242e0a1bfd", + "publicKeyCompressed": "0371042d83f7c2492dcfababa496001445d1eeb3e557317afb08cc673fbdf72436", + "msg": "68656c6c6f", + "sig": { + "r": "5b763276f00a55ea1fe4ec980a4e25f482f23abbbf36928a043ea64cacb327a0", + "s": "769f9a5d8034ad68dadd9530bd14512e6c1067107dbf53920c2546e84fb50e39", + "id": 0 + }, + "comment": "R: b=3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 369, + "publicKeyUncompressed": "04d08a0aa1f5b1eacb12f0b73deec15daded26f77b9d3a333ecaa285a259e701b3248f4707c0e03428f73f725d730a4e7a96d399fc5437c21ef98c78e5718e1218", + "publicKeyCompressed": "02d08a0aa1f5b1eacb12f0b73deec15daded26f77b9d3a333ecaa285a259e701b3", + "msg": "68656c6c6f", + "sig": { + "r": "2c40539453ecb592eee5771c8c2b7d3b82f13902ce4f96ae11539c42e45b022a", + "s": "5cb0d5b6ecbe62155cdd4a358795b4d5e6754a70216521b98963d456f9237adf", + "id": 0 + }, + "comment": "R: h=-3 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 370, + "publicKeyUncompressed": "04732ba71380b5f35ad1134008d0976fba3710970836380db132ebf7d9a6cd24519d79b13618570f6ec0060b8fd04719fc21e2d89628a3166f1db52e5dc4de4cca", + "publicKeyCompressed": "02732ba71380b5f35ad1134008d0976fba3710970836380db132ebf7d9a6cd2451", + "msg": "68656c6c6f", + "sig": { + "r": "00c42d9f9a1ce6062e1c8c61c189f6dc1996856d400055d77c16517edcff401827", + "s": "2d151333cc02bcdf3a14990dabf0b73e3fa4a8d2952b9ccfb8b2e16bbf76f49f", + "id": 0 + }, + "comment": "R: h=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 371, + "publicKeyUncompressed": "047d86f0547d13c685745e8f4931c8979ac6a5a868593ba4f5feecac0e71b4751c4627b65b102084c5fb3d2c05c4d068ea0dc8351a7e886dfe014031e6fec75090", + "publicKeyCompressed": "027d86f0547d13c685745e8f4931c8979ac6a5a868593ba4f5feecac0e71b4751c", + "msg": "68656c6c6f", + "sig": { + "r": "13744b5595ef9b31162372bb090f5db8be2abe8fc928f0fa3ce3d941c6a129e7", + "s": "0082a988c7fb3c9cbcc52ff556cd276f4064d169ce793778a08554c218f81e6cbe", + "id": 0 + }, + "comment": "R: h=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 372, + "publicKeyUncompressed": "04d3110e35673ddbf12d518a79feeeed898b81df8679f03f4840090f6bade13c511e02e3b825fb3d01dcf2a0bf2a5d4f92e3897387df2c1dcf9dd32060ced6018a", + "publicKeyCompressed": "02d3110e35673ddbf12d518a79feeeed898b81df8679f03f4840090f6bade13c51", + "msg": "68656c6c6f", + "sig": { + "r": "36fef0ce5d5d6306831eecf4db8e8c56dc19753e3b65940d4f009d5e63b82383", + "s": "4b899d7bc9f769328318fdf568e86c8952749945b3f8502ba2341a8f44f0028c", + "id": 0 + }, + "comment": "R: h=-2 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 373, + "publicKeyUncompressed": "04d059b6878df81ddc3050c7820694649acb7a3c744a350c1773ecf0d570f03c4a5fc71da5453009c2654c87ca070af751c8cfba6fb4e8745ff726bad0a1e694a1", + "publicKeyCompressed": "03d059b6878df81ddc3050c7820694649acb7a3c744a350c1773ecf0d570f03c4a", + "msg": "68656c6c6f", + "sig": { + "r": "46b463e34ba3a0b488beaf00c6309d5d913e4dae395e9fae9a2356ed0a3bb86e", + "s": "009b2c6a28852d7969c65e195b7d32fd8d0aa449d6efbbc65a57e1b483ddd9cb99", + "id": 0 + }, + "comment": "R: h=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 374, + "publicKeyUncompressed": "04a796caac44e7e1e8242f6399a2ad7838e4ae5bdf3a6f668a3cab9968323e0cf4efffb7ba9154c21a5af6cffd16b37c546bcc2cdad714ad3c9295301260f4acba", + "publicKeyCompressed": "02a796caac44e7e1e8242f6399a2ad7838e4ae5bdf3a6f668a3cab9968323e0cf4", + "msg": "68656c6c6f", + "sig": { + "r": "7a7c383d359af0d14b69c0de89bc141cf88be73adb6de70da0ac0fe398df86ff", + "s": "00db99d2e847482a076dc08deeed752833a67632ed6323b8aff08363c608168f79", + "id": 0 + }, + "comment": "R: s**2=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 375, + "publicKeyUncompressed": "04a7a5309762cdea5f5ef4fde351d76298509d2a2e89f4806054fa9b55ff2afde1acdd8403705aa5948d9a5a2bf25a1dfc5d19e24bf89b4ece8823ad91cbb0e0f9", + "publicKeyCompressed": "03a7a5309762cdea5f5ef4fde351d76298509d2a2e89f4806054fa9b55ff2afde1", + "msg": "68656c6c6f", + "sig": { + "r": "00a3dfd954239db2c932df89c4031edd3df7ab10ba5069d4024575c76b05f45e09", + "s": "00d3325f93a97a16c12dca480bdf2caed50161a5c14d2d31868d2799e4c83ef0d9", + "id": 0 + }, + "comment": "R: s**2=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 376, + "publicKeyUncompressed": "04be16ef80bbdab5b7854a4c3874e39a0a6df6c581da12d13aacc7ff7c6ab308b55bdb5c9734ec94c789b7ec68edfd93d99be55bc15153d081af3153948c2a4a83", + "publicKeyCompressed": "03be16ef80bbdab5b7854a4c3874e39a0a6df6c581da12d13aacc7ff7c6ab308b5", + "msg": "68656c6c6f", + "sig": { + "r": "00ead6f954fe239dea0a2beb666bdf157f3f70e08fb268cb51fe68053338b9393f", + "s": "00e51632c73cc93cd831a915bd618c63cfc972ea2c98e50ba0b0c69bda34790bd3", + "id": 0 + }, + "comment": "R: s**2=1 for m=8 in scalar mult with projective coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 377, + "publicKeyUncompressed": "04a82d93125609da50d0e0270b67bf00af12abfaa99a3194c1a81cef6fbdc3512056f04266bd42029fcf619993610ab8e5d6285ea097621373662a99acf757828b", + "publicKeyCompressed": "03a82d93125609da50d0e0270b67bf00af12abfaa99a3194c1a81cef6fbdc35120", + "msg": "68656c6c6f", + "sig": { + "r": "6ec0381227a54a91841a0b753a89e332d7117b4f70ab3562881808ae73f3493a", + "s": "008a98dcbd4dc7278a5aed47ac2dc9f8f4799eb6db9ecc2a9040693649d24fc261", + "id": 0 + }, + "comment": "R: x3=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 378, + "publicKeyUncompressed": "04604b35daf0004e61bd27efeff5d8efa98372308e0c20975b9b9f949cd6dee00aba3380a7e9d6674ed8e2452bc19eb824c3fa1c1fd4f2bb596a1cb95eb12a948c", + "publicKeyCompressed": "02604b35daf0004e61bd27efeff5d8efa98372308e0c20975b9b9f949cd6dee00a", + "msg": "68656c6c6f", + "sig": { + "r": "1da05b38dbaf1d74d3e30c322e70168850ccedb36ee765cc15874480e4d66ef2", + "s": "78d5aadec1a4b71539616b69bc500ba03ccab0cb4e6839c62187259a75a454ee", + "id": 0 + }, + "comment": "R: x3=-2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 379, + "publicKeyUncompressed": "0481144124016bf8588d161430598601850efc32601ea0aee15becb9421957252b7db4565f54a1d0c0efe42bccb8915c2bdb35ab36a6cefa74d1fb6b2a151532fa", + "publicKeyCompressed": "0281144124016bf8588d161430598601850efc32601ea0aee15becb9421957252b", + "msg": "68656c6c6f", + "sig": { + "r": "66fd79ea023c047c3d6163406cb8fe2e1482ae34e2197d31c929c46867ff8ee4", + "s": "10143da31f042d58c17cfdf8917703800ec8aa46f24398586799b8a10344a0c6", + "id": 0 + }, + "comment": "R: x3=0 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 380, + "publicKeyUncompressed": "041a47146f3ce212d31831756c6550022169fe9f8b3a59ed990ef658980b0d10316831a49c91aea63ea5cc15adca16c7b85665f2928c15301750276b83bb637ab8", + "publicKeyCompressed": "021a47146f3ce212d31831756c6550022169fe9f8b3a59ed990ef658980b0d1031", + "msg": "68656c6c6f", + "sig": { + "r": "0c3508b28c914471f770529e922dd35bc450316d9065d616ad9f00f3cca04c37", + "s": "00e475e1851266238398f57c71f8695578247db806b2464c93f5ae7c8f5f5522be", + "id": 0 + }, + "comment": "R: x3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 381, + "publicKeyUncompressed": "0481e999ae7b31881b9e9a1af5e655290df84f2b93c45161a58deeeb66829d2df5130f08a19992b5448a155b04b22e7f6ee6d885d3e7fa49151df864475c961d24", + "publicKeyCompressed": "0281e999ae7b31881b9e9a1af5e655290df84f2b93c45161a58deeeb66829d2df5", + "msg": "68656c6c6f", + "sig": { + "r": "00c3d6fc07d2b7fd08882721dfafdcff50909b48fbbed447ae1aa4ee69ff83d53f", + "s": "00f192bf89c780081ba24d3395f4a0d797eae0c10c237d48ebc52b2896ea86a1a9", + "id": 0 + }, + "comment": "R: x3=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 382, + "publicKeyUncompressed": "04d6974716dddc897de670828971b60e4de28fa15f88f649a81361bcf85733ced446236bf7f262c983692f3a3d6cbdca00295af52131a5fa522d0b6bac62f0ad56", + "publicKeyCompressed": "02d6974716dddc897de670828971b60e4de28fa15f88f649a81361bcf85733ced4", + "msg": "68656c6c6f", + "sig": { + "r": "008d8bcd78685b7052718b099d76717b50bd78412d07c84b738144537c53fdda62", + "s": "1f5a44b60331a66546960d12909740589b0dfdecabb20b196834a3b50e27ccec", + "id": 0 + }, + "comment": "R: z3=-1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 383, + "publicKeyUncompressed": "0468ede3afdb8ced8a64fb3aed700d4ec61a6b562e159b03626846b199ccb24d26e0f53d511075aa517152aa57da19d610a9ea597556b66f2619271945316fb056", + "publicKeyCompressed": "0268ede3afdb8ced8a64fb3aed700d4ec61a6b562e159b03626846b199ccb24d26", + "msg": "68656c6c6f", + "sig": { + "r": "2f89f84909c72cbe94fd2bfe82c0120a3555697f55ac8fe68c21b1ae4e180554", + "s": "00aa822787925fabcd3abf32e3694ce5a9ea84c12ffc26da9982bc18edd2fb7275", + "id": 0 + }, + "comment": "R: z3=-1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 384, + "publicKeyUncompressed": "043422d1d7357217630950f0695cd5a08d329c54276c108be347a8bfcebd00c6320d9c791a96ba91537c112966373c25facc4b5f595b245fced0d90ec7d31a5c95", + "publicKeyCompressed": "033422d1d7357217630950f0695cd5a08d329c54276c108be347a8bfcebd00c632", + "msg": "68656c6c6f", + "sig": { + "r": "00cc7bf7ad32379c41b7b28a4993df8668502d7514c4f6e54ff61e66d2e7c25b", + "s": "386e549ee88e8bd10a3144b84b5a3445c4b02b1e1c363447dc2b0336d2b2a545", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 385, + "publicKeyUncompressed": "047448518e9fcad4d6723147043ce3b1b555ee0af68c86ce122a1df66f34f51c2d0464e62298f549d5dff362466ba1f69a8ae7fa99a8e0aa6244044ff5f749f39f", + "publicKeyCompressed": "037448518e9fcad4d6723147043ce3b1b555ee0af68c86ce122a1df66f34f51c2d", + "msg": "68656c6c6f", + "sig": { + "r": "4001af78648bb4cc6c8f895fd66f67fdada7320c26ade81b6c3d61d48c83f532", + "s": "66fa64306a08c71ea703caf3bb2b17e6e3987d1e94ea55235e424b4ba9be946e", + "id": 0 + }, + "comment": "R: z3=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 386, + "publicKeyUncompressed": "04ec74b2bfad98ce0f2dc1f41d682661900dc0fd154ed6e70dfde769857a9f9ca705eeb1afd4be6cdda766bf5c2c286d905fa95cb7c5ac29c86f6a97d5e0d42a36", + "publicKeyCompressed": "02ec74b2bfad98ce0f2dc1f41d682661900dc0fd154ed6e70dfde769857a9f9ca7", + "msg": "68656c6c6f", + "sig": { + "r": "00a90a1bd0a54cc0d80062f53313b8fdafa89efc15126329dd824d452b80555f95", + "s": "7a46dadfb3c18758cdeb83fffe033c2b0d6af46d974936d1288616c8d740d9eb", + "id": 0 + }, + "comment": "R: u1=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 387, + "publicKeyUncompressed": "043596f6f102676bb0961127e65850bff1881401cdf54f16bd47ccc34e4feef8e37b75815a9d032391ca1404b2359af48567ae71bb6a99656e4eeb8e3b750e697f", + "publicKeyCompressed": "033596f6f102676bb0961127e65850bff1881401cdf54f16bd47ccc34e4feef8e3", + "msg": "68656c6c6f", + "sig": { + "r": "00e62f13414fa3f975271e020ecb043e1c5430355e63e3cba69440f4941d5060ad", + "s": "00e385f3ab7d91f75404892b04bbe8df68ae4895782af067ef7e366e6f76e6850a", + "id": 0 + }, + "comment": "R: u1=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 388, + "publicKeyUncompressed": "042f8637a25aed1ba99e7deb2d50ed96a43c69fa8872da52d587678b9e1a30cd8138b6835e4d184c1270fc1d18baebfbf260eb23b680bd523c24761e806f4c81c3", + "publicKeyCompressed": "032f8637a25aed1ba99e7deb2d50ed96a43c69fa8872da52d587678b9e1a30cd81", + "msg": "68656c6c6f", + "sig": { + "r": "00e1f5a8f3524ccc1f31a2bde450187d4f3307376eb109647bc778e15ca646b7a4", + "s": "6d648f7da078722095eed1bdd3d6729991fd9e95490f302d542d5321839f6f0d", + "id": 0 + }, + "comment": "R: u1=-1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 389, + "publicKeyUncompressed": "049e3e5feb35ae799e6bfe7bac7439ca705f27c2cb4249a7016535985af95b1f8507932baa14a3406054e16be79041f243409b9c37d5ea29855bf34e99420a5947", + "publicKeyCompressed": "039e3e5feb35ae799e6bfe7bac7439ca705f27c2cb4249a7016535985af95b1f85", + "msg": "68656c6c6f", + "sig": { + "r": "00caa952ad57d56a21e0d54c35b0cd034256d9cd7bae81246a6cd473c9ba9e0288", + "s": "008f30269f597da7e2c11488695a9045e788c58c4cf9e1aa7622355baff56ac7d3", + "id": 0 + }, + "comment": "R: u1=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 390, + "publicKeyUncompressed": "04b5dd4fc4ec7ae464d519f0f53c8690895413d3e57d5e81c0844b78dd61229dc421b1f79104037f48a6d458e0cd7a5cbe9e3dfa0f3c50ea171d9610a3961620b9", + "publicKeyCompressed": "03b5dd4fc4ec7ae464d519f0f53c8690895413d3e57d5e81c0844b78dd61229dc4", + "msg": "68656c6c6f", + "sig": { + "r": "0087f9d2f48f029188b12fa3b0f2fc76817fdcc63ce2617723a4b25a544f41e18b", + "s": "06a9ab9d7f789b22eaa22a755575d91a7ecdbce80cb1add75513163c40a79de4", + "id": 0 + }, + "comment": "R: u1=3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 391, + "publicKeyUncompressed": "04a6cc3bff133d095abe384311620714077e992192209e9b84b3e4dd9572662f468e31a687bf2f0e4c3373ccee21d322dc14cfe263d941a29b01d41e5641366011", + "publicKeyCompressed": "03a6cc3bff133d095abe384311620714077e992192209e9b84b3e4dd9572662f46", + "msg": "68656c6c6f", + "sig": { + "r": "008c4989c84f34517fe93ea1c77a799615ed9dfc194d93cdca258e9b0e14e435a4", + "s": "00b2d3ec9b16138a6143ff035e409776e129db42521e82e1b6734411d95f8ff5ad", + "id": 0 + }, + "comment": "R: u=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 392, + "publicKeyUncompressed": "047c02fdca7c139d3cb9524e8cf010acb374953050f1202fa37999efb26d5e8a3bb3dabc0696cfb08b40d6470748042401eb79609bb25f0f39e27f5fc8479c8cb2", + "publicKeyCompressed": "027c02fdca7c139d3cb9524e8cf010acb374953050f1202fa37999efb26d5e8a3b", + "msg": "68656c6c6f", + "sig": { + "r": "37d85fef8747cb6625c89f090d609f42bdd30cde9d69fecbdea1c21afbec5609", + "s": "3fa96978329d0c24d9e061e7c8f32d3dcfe281a73ace65f997b1a5bf9a98790d", + "id": 0 + }, + "comment": "R: u=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 393, + "publicKeyUncompressed": "04b3f1bdd4eccfd355b078ca4b882522d1723bdfa8ef87918c88d85c58477fa5434ba84b9713a8197ba59adbdf204155c7a430fbc42af85963baeb5cdca3e7b92c", + "publicKeyCompressed": "02b3f1bdd4eccfd355b078ca4b882522d1723bdfa8ef87918c88d85c58477fa543", + "msg": "68656c6c6f", + "sig": { + "r": "00b9cbbeee86618b5b768176834e6d4a8323b97100024211abcd079df865a6a2d2", + "s": "249dcc3edb824465dc49587b46c17995d31da3b56278c3382152f0d7a62cbc96", + "id": 0 + }, + "comment": "R: v**2=-3 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 394, + "publicKeyUncompressed": "044b0e638ce582ea897a2873c2588c8dea858fb3ab6605a1ded9c83db0c8c69da562b4872ffd292cfc3c14a30db7d21070ab7c14f7fe0c901950332da1f1745218", + "publicKeyCompressed": "024b0e638ce582ea897a2873c2588c8dea858fb3ab6605a1ded9c83db0c8c69da5", + "msg": "68656c6c6f", + "sig": { + "r": "00ed66b0a6171288a6df5fd55deb22c10eaeaca9fdb93b5d59956b51987aeb1942", + "s": "00c0a4079a1059ad0dca4b8f3ec7bc00fb76005e0f3096c4a7ce1f540e29f04aad", + "id": 0 + }, + "comment": "R: v**2=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 395, + "publicKeyUncompressed": "04daa012a03b18d7a4545d6cda4b80bda9dc920c9184c59d200da97fc3778c6ec7624df5582d504151e2e1c2fc5c462b015e33e22dfcf8ce4564e32dba7c20f139", + "publicKeyCompressed": "03daa012a03b18d7a4545d6cda4b80bda9dc920c9184c59d200da97fc3778c6ec7", + "msg": "68656c6c6f", + "sig": { + "r": "00927301ece93ac72c494a5ca120221836d84859b17c67e96d2d9318088e8a9fc2", + "s": "03a2544d1b7c49ff90d1112440228741d6fcfe10002f993188e7530417e43264", + "id": 0 + }, + "comment": "R: v**2=1 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 396, + "publicKeyUncompressed": "0415f234217fc5d2acbaa96c87668b683aa161084b01d6387893a47ef0695d69d3e284e3353f41f629ced232686580d51746a26c1d4efc5cf35925fcc97882ce3c", + "publicKeyCompressed": "0215f234217fc5d2acbaa96c87668b683aa161084b01d6387893a47ef0695d69d3", + "msg": "68656c6c6f", + "sig": { + "r": "7ff6ffbfdc347afbcd0b2d320aac84c0f4ad3f262f47f3e7eb1c65fc340b53b5", + "s": "20ef3d04c71859855b6c21de740befc37f27efe7d6329abefde5c6c103a9191e", + "id": 0 + }, + "comment": "R: v**2=2 for m=9 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 397, + "publicKeyUncompressed": "04e4f3b45b0318b89b84447a80592a732692a3721cd2c6682410d72d3a57526177b5ee74d133dd03af90bd0ec2711b6aeaeda0e3574afe66a41467c760830fdf71", + "publicKeyCompressed": "03e4f3b45b0318b89b84447a80592a732692a3721cd2c6682410d72d3a57526177", + "msg": "68656c6c6f", + "sig": { + "r": "00df302c7721144e7d4a6a06dfbd5f06d63ac7d3610c6170c0b35824aef84be24f", + "s": "00db50d46bc77d3d67e873d514cc1ca73e5f08eee80116647e4fb003155d779397", + "id": 0 + }, + "comment": "R: x2=0 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 398, + "publicKeyUncompressed": "04b4f760c212b960566d58599aec1c9dd6789e8e779c81fc67705c240143174d20b416078dd13dd5067a77da7952451d0f80c8c7344575ab47e1a1f46781dc5b67", + "publicKeyCompressed": "03b4f760c212b960566d58599aec1c9dd6789e8e779c81fc67705c240143174d20", + "msg": "68656c6c6f", + "sig": { + "r": "00810cc9530b007654b603dc10dc6bc707b0d3c827bb838175c38f1be2dc0e1c49", + "s": "67480a4385a934811aa77bdbf2ae44f856b1dc168fb9f1fbe12bf6661a76b5d3", + "id": 0 + }, + "comment": "R: y2=-2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 399, + "publicKeyUncompressed": "045ed854701380fec3c1d3ab3e53803ceff8bcb583bf26c95ad21a45f484ec72464c2cdf34f81cf0b05f80d6cac96f115bcbabcaee4b6667471ffda5f4f6d83178", + "publicKeyCompressed": "025ed854701380fec3c1d3ab3e53803ceff8bcb583bf26c95ad21a45f484ec7246", + "msg": "68656c6c6f", + "sig": { + "r": "00a655cedd14387c223a3a766e5648e7d917c1b51892317c6231b869efd11aed86", + "s": "06daff12d25406c28f2d256782a84b5e1e69bf0bd136ecbbaccd4b73f9268189", + "id": 0 + }, + "comment": "R: y2=3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 400, + "publicKeyUncompressed": "04c07e45f62e07b188ee3d8df52cc0487445edc562effc94b9739045c0bab6b6982580dd67acc7ba184191a5dbea35715d94c9605e538ec93342f758271ad6f15c", + "publicKeyCompressed": "02c07e45f62e07b188ee3d8df52cc0487445edc562effc94b9739045c0bab6b698", + "msg": "68656c6c6f", + "sig": { + "r": "00c6ec18ec85ec79926b1d630f301d1a08ace807cbbbb6b1e74f66a4e34b3c79f9", + "s": "49223f0563b2435695fb83fabc5272e30b4a1838130e8f0788060272a9d601f6", + "id": 0 + }, + "comment": "R: y2=3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 401, + "publicKeyUncompressed": "04f12d9fd8fa8612f993971ee9780b05084e4a07451fd71b28cc5284af06a1071f905083636066c5f7be4cd1116d77afdf16296f237641e46b71511dc251a2e344", + "publicKeyCompressed": "02f12d9fd8fa8612f993971ee9780b05084e4a07451fd71b28cc5284af06a1071f", + "msg": "68656c6c6f", + "sig": { + "r": "4cf2e653839afcd7407d9f807f484a10bb4b2623b57812437126d88f09e33f2c", + "s": "00c5af385e0bd8b9f3194969159b4fedc8952ae44d95c0e909f901cc97d7849971", + "id": 0 + }, + "comment": "R: w=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 402, + "publicKeyUncompressed": "046cb3bb3496335a00a350cc0e8b2e2a16641bef991d8780926cc777c2acb325f73b5c27859964fb122e95ea996ddf1775f00e9c8e4d640ae015eee74e4b978ffa", + "publicKeyCompressed": "026cb3bb3496335a00a350cc0e8b2e2a16641bef991d8780926cc777c2acb325f7", + "msg": "68656c6c6f", + "sig": { + "r": "00dc76e5f5bd796d75523d87449b10ebc5961522cabf56fc66b4b9b9d448747fd3", + "s": "00d2c1460fb3602a75a653ba83a8a05b701e2b3a8c4e5c6ad94f70c8778ceb104d", + "id": 0 + }, + "comment": "R: w=3 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 403, + "publicKeyUncompressed": "0430ca7cc2cd80efdb99cc1e45e3462aa8c9b825611093bf4b13385293c1354892b8ead1d861f7b3ff5bd1807f90e3976f9b839eb6d6bec09074cbda6cab30f4e0", + "publicKeyCompressed": "0230ca7cc2cd80efdb99cc1e45e3462aa8c9b825611093bf4b13385293c1354892", + "msg": "68656c6c6f", + "sig": { + "r": "00a933b332f3805199e1ceb439e3ecdacfe9bc916851a636e54159e97f21f41ead", + "s": "15492e194ded2d5216b402475103734434894a64e827cf994d1fcdfd68102de6", + "id": 0 + }, + "comment": "R: b=-1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 404, + "publicKeyUncompressed": "04e314b26a214b5f1d6841eeed59eeb8663acd2cce69426d5fb04dcb98b60a1a68e27c4facb88011db02d165e05e3c4bed45df6e3c440dbbd7b5670b3ab4e653f4", + "publicKeyCompressed": "02e314b26a214b5f1d6841eeed59eeb8663acd2cce69426d5fb04dcb98b60a1a68", + "msg": "68656c6c6f", + "sig": { + "r": "51aa95a3108b9f9bfcf07788e9bc3a95e4be465e8d175dc635158dd983fc6086", + "s": "64ae9c0d5ec01a653fda62dd3b358b1e6c784649919fb5e683d865caceaf40ae", + "id": 0 + }, + "comment": "R: h=-2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 405, + "publicKeyUncompressed": "040c98d5155757969fd77cc894c6a97e256f2fcae6b27086d16b540987900d083b5d63e31fa3b8187a477a6c312a680cf379f0c1a5574237c6b0d8000fb0f3fb16", + "publicKeyCompressed": "020c98d5155757969fd77cc894c6a97e256f2fcae6b27086d16b540987900d083b", + "msg": "68656c6c6f", + "sig": { + "r": "00ff219ff783c3ea55256663273a5ae39135895cfca3b6771d645977eb779798bd", + "s": "00892f814fbc1ba1a40afb99b58a7c96937a37fc17a699203ef9bb34fdd3792f9a", + "id": 0 + }, + "comment": "R: h=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 406, + "publicKeyUncompressed": "0423c1870507d71ed89dcd27edb270a29b77019fc9404b8e4b1c8d9a8a40980e02055fd892f71370ccbba7523496cfc57b42a181106122ad7ffeea793a2371c876", + "publicKeyCompressed": "0223c1870507d71ed89dcd27edb270a29b77019fc9404b8e4b1c8d9a8a40980e02", + "msg": "68656c6c6f", + "sig": { + "r": "30d33d47c71ac31f1a3a0801c96d35046fa3bce782d3fff0fa1165fc5955dd7b", + "s": "082419148798f92d569a14b5d4b2c977928487612913f2ee0682c8b5c664d831", + "id": 0 + }, + "comment": "R: s**2=1 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + }, + { + "tcId": 407, + "publicKeyUncompressed": "0487f50282d2a44191074a0cb1a7826e6fd6d0732ed3d877aaba388907229dbd4bb8ba77a9e9aaf7058e4ebec7780ad5e4bbf502cf4de47ecd5ab2a8bc3a3642d9", + "publicKeyCompressed": "0387f50282d2a44191074a0cb1a7826e6fd6d0732ed3d877aaba388907229dbd4b", + "msg": "68656c6c6f", + "sig": { + "r": "00b270df208af53772ddaf632480405eaac58f0cbdbfaf3dc58b9ce8aaf8015f79", + "s": "00fc0a90cbc63f6c927427e8533ab2a8d348820e70a98728a9f371db273b05d7a8", + "id": 0 + }, + "comment": "R: s**2=2 for m=10 in scalar mult with Jacobian coordinates", + "valid": true, + "flags": ["edge_case_R"] + } + ] +} \ No newline at end of file diff --git a/packages/crypto/testdata/secp256k1_tests.json b/packages/crypto/testdata/secp256k1_tests.json index 223c6938e1..edb4c15b9a 100644 --- a/packages/crypto/testdata/secp256k1_tests.json +++ b/packages/crypto/testdata/secp256k1_tests.json @@ -119,4 +119,4 @@ "signature": "5c707b6df7667324f950216b933d28e307a0223b24d161bc5887208d7f880b3a4b7bc56586dc51d806ac3ad72807bc62d1d06d0812f121bd91e9770d84885c39", "pubkey": "0436748f1a531e91a40b9e6bfc502488cfd749c3b9529633d4e4dabdb058708b7ac4b0672c9a7105b6dbf63b8054e5d266d43d37cf51241ce289d8f9140fe28996" } -] \ No newline at end of file +] diff --git a/packages/crypto/testdata/secp256r1_tests.json b/packages/crypto/testdata/secp256r1_tests.json new file mode 100644 index 0000000000..37cec7b2e2 --- /dev/null +++ b/packages/crypto/testdata/secp256r1_tests.json @@ -0,0 +1,77 @@ +[ + { + "message": "5905238877c77421f73e43ee3da6f2d9e2ccad5fc942dcec0cbd25482935faaf416983fe165b1a045ee2bcd2e6dca3bdf46c4310a7461f9a37960ca672d3feb5473e253605fb1ddfd28065b53cb5858a8ad28175bf9bd386a5e471ea7a65c17cc934a9d791e91491eb3754d03799790fe2d308d16146d5c9b0d0debd97d79ce8", + "pubkey": "041ccbe91c075fc7f4f033bfa248db8fccd3565de94bbfb12f3c59ff46c271bf83ce4014c68811f9a21a1fdb2c0e6113e06db7ca93b7404e78dc7ccd5ca89a4ca9", + "signature": "f3ac8061b514795b8843e3d6629527ed2afd6b1f6a555a7acabb5e6f79c8c2ac8bf77819ca05a6b2786c76262bf7371cef97b218e96f175a3ccdda2acc058903" + }, + { + "message": "c35e2f092553c55772926bdbe87c9796827d17024dbb9233a545366e2e5987dd344deb72df987144b8c6c43bc41b654b94cc856e16b96d7a821c8ec039b503e3d86728c494a967d83011a0e090b5d54cd47f4e366c0912bc808fbb2ea96efac88fb3ebec9342738e225f7c7c2b011ce375b56621a20642b4d36e060db4524af1", + "pubkey": "04e266ddfdc12668db30d4ca3e8f7749432c416044f2d2b8c10bf3d4012aeffa8abfa86404a2e9ffe67d47c587ef7a97a7f456b863b4d02cfc6928973ab5b1cb39", + "signature": "976d3a4e9d23326dc0baa9fa560b7c4e53f42864f508483a6473b6a11079b2db1b766e9ceb71ba6c01dcd46e0af462cd4cfa652ae5017d4555b8eeefe36e1932" + }, + { + "message": "3c054e333a94259c36af09ab5b4ff9beb3492f8d5b4282d16801daccb29f70fe61a0b37ffef5c04cd1b70e85b1f549a1c4dc672985e50f43ea037efa9964f096b5f62f7ffdf8d6bfb2cc859558f5a393cb949dbd48f269343b5263dcdb9c556eca074f2e98e6d94c2c29a677afaf806edf79b15a3fcd46e7067b7669f83188ee", + "pubkey": "0474ccd8a62fba0e667c50929a53f78c21b8ff0c3c737b0b40b1750b2302b0bde829074e21f3a0ef88b9efdf10d06aa4c295cc1671f758ca0e4cd108803d0f2614", + "signature": "35fb60f5ca0f3ca08542fb3cc641c8263a2cab7a90ee6a5e1583fac2bb6f6bd1ee59d81bc9db1055cc0ed97b159d8784af04e98511d0a9a407b99bb292572e96" + }, + { + "message": "0989122410d522af64ceb07da2c865219046b4c3d9d99b01278c07ff63eaf1039cb787ae9e2dd46436cc0415f280c562bebb83a23e639e476a02ec8cff7ea06cd12c86dcc3adefbf1a9e9a9b6646c7599ec631b0da9a60debeb9b3e19324977f3b4f36892c8a38671c8e1cc8e50fcd50f9e51deaf98272f9266fc702e4e57c30", + "pubkey": "04322f80371bf6e044bc49391d97c1714ab87f990b949bc178cb7c43b7c22d89e13c15d54a5cc6b9f09de8457e873eb3deb1fceb54b0b295da6050294fae7fd999", + "signature": "d7c562370af617b581c84a2468cc8bd50bb1cbf322de41b7887ce07c0e5884cab46d9f2d8c4bf83546ff178f1d78937c008d64e8ecc5cbb825cb21d94d670d89" + }, + { + "message": "dc66e39f9bbfd9865318531ffe9207f934fa615a5b285708a5e9c46b7775150e818d7f24d2a123df3672fff2094e3fd3df6fbe259e3989dd5edfcccbe7d45e26a775a5c4329a084f057c42c13f3248e3fd6f0c76678f890f513c32292dd306eaa84a59abe34b16cb5e38d0e885525d10336ca443e1682aa04a7af832b0eee4e7", + "pubkey": "041bcec4570e1ec2436596b8ded58f60c3b1ebc6a403bc5543040ba829630572448af62a4c683f096b28558320737bf83b9959a46ad2521004ef74cf85e67494e1", + "signature": "18caaf7b663507a8bcd992b836dec9dc5703c080af5e51dfa3a9a7c38718260477c68928ac3b88d985fb43fb615fb7ff45c18ba5c81af796c613dfa98352d29c" + }, + { + "message": "600974e7d8c5508e2c1aab0783ad0d7c4494ab2b4da265c2fe496421c4df238b0be25f25659157c8a225fb03953607f7df996acfd402f147e37aee2f1693e3bf1c35eab3ae360a2bd91d04622ea47f83d863d2dfecb618e8b8bdc39e17d15d672eee03bb4ce2cc5cf6b217e5faf3f336fdd87d972d3a8b8a593ba85955cc9d71", + "pubkey": "04a32e50be3dae2c8ba3f5e4bdae14cf7645420d425ead94036c22dd6c4fc59e00d623bf641160c289d6742c6257ae6ba574446dd1d0e74db3aaa80900b78d4ae9", + "signature": "8524c5024e2d9a73bde8c72d9129f57873bbad0ed05215a372a84fdbc78f2e68d18c2caf3b1072f87064ec5e8953f51301cada03469c640244760328eb5a05cb" + }, + { + "message": "dfa6cb9b39adda6c74cc8b2a8b53a12c499ab9dee01b4123642b4f11af336a91a5c9ce0520eb2395a6190ecbf6169c4cba81941de8e76c9c908eb843b98ce95e0da29c5d4388040264e05e07030a577cc5d176387154eabae2af52a83e85c61c7c61da930c9b19e45d7e34c8516dc3c238fddd6e450a77455d534c48a152010b", + "pubkey": "048bcfe2a721ca6d753968f564ec4315be4857e28bef1908f61a366b1f03c974790f67576a30b8e20d4232d8530b52fb4c89cbc589ede291e499ddd15fe870ab96", + "signature": "c5a186d72df452015480f7f338970bfe825087f05c0088d95305f87aacc9b25484a58f9e9d9e735344b316b1aa1ab5185665b85147dc82d92e969d7bee31ca30" + }, + { + "message": "51d2547cbff92431174aa7fc7302139519d98071c755ff1c92e4694b58587ea560f72f32fc6dd4dee7d22bb7387381d0256e2862d0644cdf2c277c5d740fa089830eb52bf79d1e75b8596ecf0ea58a0b9df61e0c9754bfcd62efab6ea1bd216bf181c5593da79f10135a9bc6e164f1854bc8859734341aad237ba29a81a3fc8b", + "pubkey": "04a88bc8430279c8c0400a77d751f26c0abc93e5de4ad9a4166357952fe041e7672d365a1eef25ead579cc9a069b6abc1b16b81c35f18785ce26a10ba6d1381185", + "signature": "9d0c6afb6df3bced455b459cc21387e14929392664bb8741a3693a1795ca6902d7f9ddd191f1f412869429209ee3814c75c72fa46a9cccf804a2f5cc0b7e739f" + }, + { + "message": "558c2ac13026402bad4a0a83ebc9468e50f7ffab06d6f981e5db1d082098065bcff6f21a7a74558b1e8612914b8b5a0aa28ed5b574c36ac4ea5868432a62bb8ef0695d27c1e3ceaf75c7b251c65ddb268696f07c16d2767973d85beb443f211e6445e7fe5d46f0dce70d58a4cd9fe70688c035688ea8c6baec65a5fc7e2c93e8", + "pubkey": "041bc487570f040dc94196c9befe8ab2b6de77208b1f38bdaae28f9645c4d2bc3aec81602abd8345e71867c8210313737865b8aa186851e1b48eaca140320f5d8f", + "signature": "2f9e2b4e9f747c657f705bffd124ee178bbc5391c86d056717b140c153570fd9f5413bfd85949da8d83de83ab0d19b2986613e224d1901d76919de23ccd03199" + }, + { + "message": "4d55c99ef6bd54621662c3d110c3cb627c03d6311393b264ab97b90a4b15214a5593ba2510a53d63fb34be251facb697c973e11b665cb7920f1684b0031b4dd370cb927ca7168b0bf8ad285e05e9e31e34bc24024739fdc10b78586f29eff94412034e3b606ed850ec2c1900e8e68151fc4aee5adebb066eb6da4eaa5681378e", + "pubkey": "04b8188bd68701fc396dab53125d4d28ea33a91daf6d21485f4770f6ea8c565dde423f058810f277f8fe076f6db56e9285a1bf2c2a1dae145095edd9c04970bc4a", + "signature": "1cc628533d0004b2b20e7f4baad0b8bb5e0673db159bbccf92491aef61fc9620880e0bbf82a8cf818ed46ba03cf0fc6c898e36fca36cc7fdb1d2db7503634430" + }, + { + "message": "f8248ad47d97c18c984f1f5c10950dc1404713c56b6ea397e01e6dd925e903b4fadfe2c9e877169e71ce3c7fe5ce70ee4255d9cdc26f6943bf48687874de64f6cf30a012512e787b88059bbf561162bdcc23a3742c835ac144cc14167b1bd6727e940540a9c99f3cbb41fb1dcb00d76dda04995847c657f4c19d303eb09eb48a", + "pubkey": "0451f99d2d52d4a6e734484a018b7ca2f895c2929b6754a3a03224d07ae61166ce4737da963c6ef7247fb88d19f9b0c667cac7fe12837fdab88c66f10d3c14cad1", + "signature": "9886ae46c1415c3bc959e82b760ad760aab66885a84e620aa339fdf102465c422bf3a80bc04faa35ebecc0f4864ac02d349f6f126e0f988501b8d3075409a26c" + }, + { + "message": "3b6ee2425940b3d240d35b97b6dcd61ed3423d8e71a0ada35d47b322d17b35ea0472f35edd1d252f87b8b65ef4b716669fc9ac28b00d34a9d66ad118c9d94e7f46d0b4f6c2b2d339fd6bcd351241a387cc82609057048c12c4ec3d85c661975c45b300cb96930d89370a327c98b67defaa89497aa8ef994c77f1130f752f94a4", + "pubkey": "048fb287f0202ad57ae841aea35f29b2e1d53e196d0ddd9aec24813d64c0922fb71f6daff1aa2dd2d6d3741623eecb5e7b612997a1039aab2e5cf2de969cfea573", + "signature": "490efd106be11fc365c7467eb89b8d39e15d65175356775deab211163c2504cb644300fc0da4d40fb8c6ead510d14f0bd4e1321a469e9c0a581464c7186b7aa7" + }, + { + "message": "c5204b81ec0a4df5b7e9fda3dc245f98082ae7f4efe81998dcaa286bd4507ca840a53d21b01e904f55e38f78c3757d5a5a4a44b1d5d4e480be3afb5b394a5d2840af42b1b4083d40afbfe22d702f370d32dbfd392e128ea4724d66a3701da41ae2f03bb4d91bb946c7969404cb544f71eb7a49eb4c4ec55799bda1eb545143a7", + "pubkey": "0468229b48c2fe19d3db034e4c15077eb7471a66031f28a980821873915298ba76303e8ee3742a893f78b810991da697083dd8f11128c47651c27a56740a80c24c", + "signature": "e67a9717ccf96841489d6541f4f6adb12d17b59a6bef847b6183b8fcf16a32eb9ae6ba6d637706849a6a9fc388cf0232d85c26ea0d1fe7437adb48de58364333" + }, + { + "message": "72e81fe221fb402148d8b7ab03549f1180bcc03d41ca59d7653801f0ba853add1f6d29edd7f9abc621b2d548f8dbf8979bd16608d2d8fc3260b4ebc0dd42482481d548c7075711b5759649c41f439fad69954956c9326841ea6492956829f9e0dc789f73633b40f6ac77bcae6dfc7930cfe89e526d1684365c5b0be2437fdb01", + "pubkey": "040a7dbb8bf50cb605eb2268b081f26d6b08e012f952c4b70a5a1e6e7d46af98bbf26dd7d799930062480849962ccf5004edcfd307c044f4e8f667c9baa834eeae", + "signature": "b53ce4da1aa7c0dc77a1896ab716b921499aed78df725b1504aba1597ba0c64bd7c246dc7ad0e67700c373edcfdd1c0a0495fc954549ad579df6ed1438840851" + }, + { + "message": "21188c3edd5de088dacc1076b9e1bcecd79de1003c2414c3866173054dc82dde85169baa77993adb20c269f60a5226111828578bcc7c29e6e8d2dae81806152c8ba0c6ada1986a1983ebeec1473a73a04795b6319d48662d40881c1723a706f516fe75300f92408aa1dc6ae4288d2046f23c1aa2e54b7fb6448a0da922bd7f34", + "pubkey": "04105d22d9c626520faca13e7ced382dcbe93498315f00cc0ac39c4821d0d737376c47f3cbbfa97dfcebe16270b8c7d5d3a5900b888c42520d751e8faf3b401ef4", + "signature": "542c40a18140a6266d6f0286e24e9a7bad7650e72ef0e2131e629c076d9626634f7f65305e24a6bbb5cff714ba8f5a2cee5bdc89ba8d75dcbf21966ce38eb66f" + } +] diff --git a/packages/crypto/testdata/wycheproof/README.md b/packages/crypto/testdata/wycheproof/README.md new file mode 100644 index 0000000000..b47782f919 --- /dev/null +++ b/packages/crypto/testdata/wycheproof/README.md @@ -0,0 +1,25 @@ +# Wycheproof test data + +This folder contains test vectors from +[Project Wycheproof](https://github.com/google/wycheproof) to increase the test +coverage of signature verification implementations. + +This test data is used by integration tests in `test/wycheproof_*.rs`. + +## Update + +To ensure integrity of the files and update them to the latest version, run this +from the repo root: + +```sh +(cd packages/crypto/testdata/wycheproof \ + && curl -sSL https://github.com/google/wycheproof/raw/master/testvectors_v1/ecdsa_secp256r1_sha256_test.json > ecdsa_secp256r1_sha256_test.json \ + && curl -sSL https://github.com/google/wycheproof/raw/master/testvectors_v1/ecdsa_secp256r1_sha512_test.json > ecdsa_secp256r1_sha512_test.json \ + && curl -sSL https://github.com/google/wycheproof/raw/master/testvectors_v1/ecdsa_secp256r1_sha3_256_test.json > ecdsa_secp256r1_sha3_256_test.json \ + && curl -sSL https://github.com/google/wycheproof/raw/master/testvectors_v1/ecdsa_secp256r1_sha3_512_test.json > ecdsa_secp256r1_sha3_512_test.json \ + && curl -sSL https://github.com/google/wycheproof/raw/master/testvectors_v1/ecdsa_secp256k1_sha256_test.json > ecdsa_secp256k1_sha256_test.json \ + && curl -sSL https://github.com/google/wycheproof/raw/master/testvectors_v1/ecdsa_secp256k1_sha512_test.json > ecdsa_secp256k1_sha512_test.json \ + && curl -sSL https://github.com/google/wycheproof/raw/master/testvectors_v1/ecdsa_secp256k1_sha3_256_test.json > ecdsa_secp256k1_sha3_256_test.json \ + && curl -sSL https://github.com/google/wycheproof/raw/master/testvectors_v1/ecdsa_secp256k1_sha3_512_test.json > ecdsa_secp256k1_sha3_512_test.json \ + ) +``` diff --git a/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha256_test.json b/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha256_test.json new file mode 100644 index 0000000000..4ef54cef96 --- /dev/null +++ b/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha256_test.json @@ -0,0 +1,6356 @@ +{ + "algorithm" : "ECDSA", + "schema" : "ecdsa_verify_schema.json", + "generatorVersion" : "0.9rc5", + "numberOfTests" : 463, + "header" : [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes" : { + "ArithmeticError" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.", + "cves" : [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature" : { + "bugType" : "BER_ENCODING", + "description" : "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect" : "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves" : [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication" : { + "bugType" : "EDGE_CASE", + "description" : "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding" : { + "bugType" : "CAN_OF_WORMS", + "description" : "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449" + ] + }, + "MissingZero" : { + "bugType" : "LEGACY", + "description" : "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect" : "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "CVE-2019-0865" + ] + }, + "PointDuplication" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves" : [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "2020-13895" + ] + }, + "SpecialCaseHash" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "ValidSignature" : { + "bugType" : "BASIC", + "description" : "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups" : [ + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152", + "wx" : "782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963", + "wy" : "00af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeCyO0X47Kng7VGTzOwllKnHGeOBexR6E\n4rz8Zjo96WOvmstCgLjH98QvTvmrpiRewewXEv04oPqWQY2M1qphUg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 1, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "", + "sig" : "3046022100f80ae4f96cdbc9d853f83d47aae225bf407d51c56b7776cd67d0dc195d99a9dc022100b303e26be1f73465315221f0b331528807a1a9b6eb068ede6eebeaaa49af8a36", + "result" : "valid" + }, + { + "tcId" : 2, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "4d7367", + "sig" : "30450220109cd8ae0374358984a8249c0a843628f2835ffad1df1a9a69aa2fe72355545c022100ac6f00daf53bd8b1e34da329359b6e08019c5b037fed79ee383ae39f85a159c6", + "result" : "valid" + }, + { + "tcId" : 3, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100d035ee1f17fdb0b2681b163e33c359932659990af77dca632012b30b27a057b302201939d9f3b2858bc13e3474cb50e6a82be44faa71940f876c1cba4c3e989202b6", + "result" : "valid" + }, + { + "tcId" : 4, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "0000000000000000000000000000000000000000", + "sig" : "304402204f053f563ad34b74fd8c9934ce59e79c2eb8e6eca0fef5b323ca67d5ac7ed23802204d4b05daa0719e773d8617dce5631c5fd6f59c9bdc748e4b55c970040af01be5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6ff0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9", + "wx" : "00b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6f", + "wy" : "00f0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6ff0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEuDj/ROW8F3vyEYnQdmCC/J2EMiaIf8l2\nA3EQC37iCm/wyddb+6ezGmvKGXRJbutW3jVwcZVdg8Sxutqgshgy6Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 5, + "comment" : "signature malleability", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365022100900e75ad233fcc908509dbff5922647db37c21f4afd3203ae8dc4ae7794b0f87", + "result" : "valid" + }, + { + "tcId" : 6, + "comment" : "Legacy: ASN encoding of r misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "30440220813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 7, + "comment" : "valid", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "valid" + }, + { + "tcId" : 8, + "comment" : "length of sequence [r, s] uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "308145022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 9, + "comment" : "length of sequence [r, s] contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30820045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 10, + "comment" : "length of sequence [r, s] uses 70 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 11, + "comment" : "length of sequence [r, s] uses 68 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 12, + "comment" : "uint32 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30850100000045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 13, + "comment" : "uint64 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3089010000000000000045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 14, + "comment" : "length of sequence [r, s] = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30847fffffff022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 15, + "comment" : "length of sequence [r, s] = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308480000000022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 16, + "comment" : "length of sequence [r, s] = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084ffffffff022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 17, + "comment" : "length of sequence [r, s] = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085ffffffffff022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 18, + "comment" : "length of sequence [r, s] = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3088ffffffffffffffff022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 19, + "comment" : "incorrect length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30ff022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 20, + "comment" : "replaced sequence [r, s] by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 21, + "comment" : "removing sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "", + "result" : "invalid" + }, + { + "tcId" : 22, + "comment" : "lonely sequence tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30", + "result" : "invalid" + }, + { + "tcId" : 23, + "comment" : "appending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000", + "result" : "invalid" + }, + { + "tcId" : 24, + "comment" : "prepending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470000022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 25, + "comment" : "appending unused 0's to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000", + "result" : "invalid" + }, + { + "tcId" : 26, + "comment" : "appending null value to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0500", + "result" : "invalid" + }, + { + "tcId" : 27, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a4981773045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 28, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304925003045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 29, + "comment" : "appending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30473045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 30, + "comment" : "including undefined tags", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304daa00bb00cd003045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 31, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2229aa00bb00cd00022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 32, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323652228aa00bb00cd0002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 33, + "comment" : "truncated length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3081", + "result" : "invalid" + }, + { + "tcId" : 34, + "comment" : "including undefined tags to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304baa02aabb3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 35, + "comment" : "using composition with indefinite length for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30803045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000", + "result" : "invalid" + }, + { + "tcId" : 36, + "comment" : "using composition with wrong tag for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30803145022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000", + "result" : "invalid" + }, + { + "tcId" : 37, + "comment" : "Replacing sequence [r, s] with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "0500", + "result" : "invalid" + }, + { + "tcId" : 38, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2e45022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 39, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2f45022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 40, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3145022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 41, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3245022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 42, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "ff45022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 43, + "comment" : "dropping value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3000", + "result" : "invalid" + }, + { + "tcId" : 44, + "comment" : "using composition for sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304930010230442100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 45, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31", + "result" : "invalid" + }, + { + "tcId" : 46, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30442100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 47, + "comment" : "sequence [r, s] of size 4166 to check for overflows", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30821046022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 48, + "comment" : "indefinite length", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3080022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000", + "result" : "invalid" + }, + { + "tcId" : 49, + "comment" : "indefinite length with truncated delimiter", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba00", + "result" : "invalid" + }, + { + "tcId" : 50, + "comment" : "indefinite length with additional element", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba05000000", + "result" : "invalid" + }, + { + "tcId" : 51, + "comment" : "indefinite length with truncated element", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba060811220000", + "result" : "invalid" + }, + { + "tcId" : 52, + "comment" : "indefinite length with garbage", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000fe02beef", + "result" : "invalid" + }, + { + "tcId" : 53, + "comment" : "indefinite length with nonempty EOC", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0002beef", + "result" : "invalid" + }, + { + "tcId" : 54, + "comment" : "prepend empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30473000022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 55, + "comment" : "append empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba3000", + "result" : "invalid" + }, + { + "tcId" : 56, + "comment" : "append zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba020100", + "result" : "invalid" + }, + { + "tcId" : 57, + "comment" : "append garbage with high tag number", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31babf7f00", + "result" : "invalid" + }, + { + "tcId" : 58, + "comment" : "append null with explicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3049022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31baa0020500", + "result" : "invalid" + }, + { + "tcId" : 59, + "comment" : "append null with implicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31baa000", + "result" : "invalid" + }, + { + "tcId" : 60, + "comment" : "sequence of sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30473045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 61, + "comment" : "truncated sequence: removed last 1 elements", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3023022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365", + "result" : "invalid" + }, + { + "tcId" : 62, + "comment" : "repeating element in sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3067022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 63, + "comment" : "flipped bit 0 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304300813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236402206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 64, + "comment" : "flipped bit 32 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304300813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccac983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 65, + "comment" : "flipped bit 48 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304300813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5133ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 66, + "comment" : "flipped bit 64 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304300813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc08b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 67, + "comment" : "length of r uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304602812100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 68, + "comment" : "length of r contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30470282002100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 69, + "comment" : "length of r uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022200813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 70, + "comment" : "length of r uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022000813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 71, + "comment" : "uint32 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285010000002100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 72, + "comment" : "uint64 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e028901000000000000002100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 73, + "comment" : "length of r = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902847fffffff00813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 74, + "comment" : "length of r = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902848000000000813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 75, + "comment" : "length of r = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284ffffffff00813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 76, + "comment" : "length of r = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285ffffffffff00813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 77, + "comment" : "length of r = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0288ffffffffffffffff00813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 78, + "comment" : "incorrect length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502ff00813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 79, + "comment" : "replaced r by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045028000813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 80, + "comment" : "removing r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302202206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 81, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30230202206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 82, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3024022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502", + "result" : "invalid" + }, + { + "tcId" : 83, + "comment" : "appending 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022300813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365000002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 84, + "comment" : "prepending 0's to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30470223000000813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 85, + "comment" : "appending unused 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365000002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 86, + "comment" : "appending null value to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022300813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365050002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 87, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a2226498177022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 88, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304922252500022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 89, + "comment" : "appending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2223022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650004deadbeef02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 90, + "comment" : "truncated length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3024028102206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 91, + "comment" : "including undefined tags to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b2227aa02aabb022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 92, + "comment" : "using composition with indefinite length for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492280022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365000002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 93, + "comment" : "using composition with wrong tag for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492280032100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365000002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 94, + "comment" : "Replacing r with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3024050002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 95, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045002100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 96, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045012100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 97, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045032100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 98, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045042100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 99, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045ff2100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 100, + "comment" : "dropping value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3024020002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 101, + "comment" : "using composition for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304922250201000220813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 102, + "comment" : "modifying first byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022102813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 103, + "comment" : "modifying last byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323e502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 104, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044022000813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832302206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 105, + "comment" : "r of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308210480282102200813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 106, + "comment" : "leading ff in r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30460222ff00813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 107, + "comment" : "replaced r by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302509018002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 108, + "comment" : "replacing r with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502010002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 109, + "comment" : "flipped bit 0 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323656ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31bb", + "result" : "invalid" + }, + { + "tcId" : 110, + "comment" : "flipped bit 32 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323656ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a456eb31ba", + "result" : "invalid" + }, + { + "tcId" : 111, + "comment" : "flipped bit 48 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323656ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f713a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 112, + "comment" : "flipped bit 64 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323656ff18a52dcc0336f7af62400a6dd9b810732baf1ff758001d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 113, + "comment" : "length of s uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650281206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 114, + "comment" : "length of s contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365028200206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 115, + "comment" : "length of s uses 33 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502216ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 116, + "comment" : "length of s uses 31 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365021f6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 117, + "comment" : "uint32 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365028501000000206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 118, + "comment" : "uint64 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502890100000000000000206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 119, + "comment" : "length of s = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502847fffffff6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 120, + "comment" : "length of s = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650284800000006ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 121, + "comment" : "length of s = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650284ffffffff6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 122, + "comment" : "length of s = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650285ffffffffff6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 123, + "comment" : "length of s = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650288ffffffffffffffff6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 124, + "comment" : "incorrect length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502ff6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 125, + "comment" : "replaced s by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502806ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 126, + "comment" : "appending 0's to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502226ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000", + "result" : "invalid" + }, + { + "tcId" : 127, + "comment" : "prepending 0's to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365022200006ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 128, + "comment" : "appending null value to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502226ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0500", + "result" : "invalid" + }, + { + "tcId" : 129, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365222549817702206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 130, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323652224250002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 131, + "comment" : "appending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365222202206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 132, + "comment" : "truncated length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3025022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650281", + "result" : "invalid" + }, + { + "tcId" : 133, + "comment" : "including undefined tags to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323652226aa02aabb02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 134, + "comment" : "using composition with indefinite length for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365228002206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000", + "result" : "invalid" + }, + { + "tcId" : 135, + "comment" : "using composition with wrong tag for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365228003206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000", + "result" : "invalid" + }, + { + "tcId" : 136, + "comment" : "Replacing s with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650500", + "result" : "invalid" + }, + { + "tcId" : 137, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236500206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 138, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236501206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 139, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236503206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 140, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236504206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 141, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365ff206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 142, + "comment" : "dropping value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3025022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650200", + "result" : "invalid" + }, + { + "tcId" : 143, + "comment" : "using composition for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365222402016f021ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 144, + "comment" : "modifying first byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206df18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 145, + "comment" : "modifying last byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb313a", + "result" : "invalid" + }, + { + "tcId" : 146, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365021f6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31", + "result" : "invalid" + }, + { + "tcId" : 147, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365021ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 148, + "comment" : "s of size 4129 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30821048022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365028210216ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 149, + "comment" : "leading ff in s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc98323650221ff6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 150, + "comment" : "replaced s by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365090180", + "result" : "invalid" + }, + { + "tcId" : 151, + "comment" : "replacing s with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365020100", + "result" : "invalid" + }, + { + "tcId" : 152, + "comment" : "replaced r by r + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3045022101813ef79ccefa9a56f7ba805f0e478583b90deabca4b05c4574e49b5899b964a602206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 153, + "comment" : "replaced r by r - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30440220813ef79ccefa9a56f7ba805f0e47858643b030ef461f1bcdf53fde3ef94ce22402206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 154, + "comment" : "replaced r by r + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304602220100813ef79ccefa9a56f7ba805f0e47843fad3bf4853e07f7c98770c99bffc4646502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 155, + "comment" : "replaced r by -r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221ff7ec10863310565a908457fa0f1b87a7b01a0f22a0a9843f64aedc334367cdc9b02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 156, + "comment" : "replaced r by n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "304402207ec10863310565a908457fa0f1b87a79bc4fcf10b9e0e4320ac021c106b31ddc02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 157, + "comment" : "replaced r by -n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221fe7ec10863310565a908457fa0f1b87a7c46f215435b4fa3ba8b1b64a766469b5a02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 158, + "comment" : "replaced r by r + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "3045022101813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 159, + "comment" : "replaced r by r + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304d0229010000000000000000813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 160, + "comment" : "replaced s by s + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450221016ff18a52dcc0336f7af62400a6dd9b7fc1e197d8aebe203c96c87232272172fb02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 161, + "comment" : "replaced s by s - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450221ff6ff18a52dcc0336f7af62400a6dd9b824c83de0b502cdfc51723b51886b4f07902206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 162, + "comment" : "replaced s by s + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022201006ff18a52dcc0336f7af62400a6dd9a3bb60fa1a14815bbc0a954a0758d2c72ba02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 163, + "comment" : "replaced s by -s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30440220900e75ad233fcc908509dbff5922647ef8cd450e008a7fff2909ec5aa914ce4602206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 164, + "comment" : "replaced s by -n - s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221fe900e75ad233fcc908509dbff592264803e1e68275141dfc369378dcdd8de8d0502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 165, + "comment" : "replaced s by s + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450221016ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 166, + "comment" : "replaced s by s - 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450221ff6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 167, + "comment" : "replaced s by s + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304d02290100000000000000006ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba02206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba", + "result" : "invalid" + }, + { + "tcId" : 168, + "comment" : "Signature with special case values r=0 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020100", + "result" : "invalid" + }, + { + "tcId" : 169, + "comment" : "Signature with special case values r=0 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020101", + "result" : "invalid" + }, + { + "tcId" : 170, + "comment" : "Signature with special case values r=0 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000201ff", + "result" : "invalid" + }, + { + "tcId" : 171, + "comment" : "Signature with special case values r=0 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 172, + "comment" : "Signature with special case values r=0 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 173, + "comment" : "Signature with special case values r=0 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 174, + "comment" : "Signature with special case values r=0 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 175, + "comment" : "Signature with special case values r=0 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 176, + "comment" : "Signature with special case values r=1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020100", + "result" : "invalid" + }, + { + "tcId" : 177, + "comment" : "Signature with special case values r=1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "invalid" + }, + { + "tcId" : 178, + "comment" : "Signature with special case values r=1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010201ff", + "result" : "invalid" + }, + { + "tcId" : 179, + "comment" : "Signature with special case values r=1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 180, + "comment" : "Signature with special case values r=1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 181, + "comment" : "Signature with special case values r=1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 182, + "comment" : "Signature with special case values r=1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 183, + "comment" : "Signature with special case values r=1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 184, + "comment" : "Signature with special case values r=-1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020100", + "result" : "invalid" + }, + { + "tcId" : 185, + "comment" : "Signature with special case values r=-1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020101", + "result" : "invalid" + }, + { + "tcId" : 186, + "comment" : "Signature with special case values r=-1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0201ff", + "result" : "invalid" + }, + { + "tcId" : 187, + "comment" : "Signature with special case values r=-1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 188, + "comment" : "Signature with special case values r=-1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 189, + "comment" : "Signature with special case values r=-1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 190, + "comment" : "Signature with special case values r=-1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 191, + "comment" : "Signature with special case values r=-1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 192, + "comment" : "Signature with special case values r=n and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020100", + "result" : "invalid" + }, + { + "tcId" : 193, + "comment" : "Signature with special case values r=n and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101", + "result" : "invalid" + }, + { + "tcId" : 194, + "comment" : "Signature with special case values r=n and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410201ff", + "result" : "invalid" + }, + { + "tcId" : 195, + "comment" : "Signature with special case values r=n and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 196, + "comment" : "Signature with special case values r=n and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 197, + "comment" : "Signature with special case values r=n and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 198, + "comment" : "Signature with special case values r=n and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 199, + "comment" : "Signature with special case values r=n and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 200, + "comment" : "Signature with special case values r=n - 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140020100", + "result" : "invalid" + }, + { + "tcId" : 201, + "comment" : "Signature with special case values r=n - 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140020101", + "result" : "invalid" + }, + { + "tcId" : 202, + "comment" : "Signature with special case values r=n - 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641400201ff", + "result" : "invalid" + }, + { + "tcId" : 203, + "comment" : "Signature with special case values r=n - 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 204, + "comment" : "Signature with special case values r=n - 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 205, + "comment" : "Signature with special case values r=n - 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 206, + "comment" : "Signature with special case values r=n - 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 207, + "comment" : "Signature with special case values r=n - 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 208, + "comment" : "Signature with special case values r=n + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142020100", + "result" : "invalid" + }, + { + "tcId" : 209, + "comment" : "Signature with special case values r=n + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142020101", + "result" : "invalid" + }, + { + "tcId" : 210, + "comment" : "Signature with special case values r=n + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641420201ff", + "result" : "invalid" + }, + { + "tcId" : 211, + "comment" : "Signature with special case values r=n + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 212, + "comment" : "Signature with special case values r=n + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 213, + "comment" : "Signature with special case values r=n + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 214, + "comment" : "Signature with special case values r=n + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 215, + "comment" : "Signature with special case values r=n + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 216, + "comment" : "Signature with special case values r=p and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f020100", + "result" : "invalid" + }, + { + "tcId" : 217, + "comment" : "Signature with special case values r=p and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f020101", + "result" : "invalid" + }, + { + "tcId" : 218, + "comment" : "Signature with special case values r=p and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0201ff", + "result" : "invalid" + }, + { + "tcId" : 219, + "comment" : "Signature with special case values r=p and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 220, + "comment" : "Signature with special case values r=p and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 221, + "comment" : "Signature with special case values r=p and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 222, + "comment" : "Signature with special case values r=p and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 223, + "comment" : "Signature with special case values r=p and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 224, + "comment" : "Signature with special case values r=p + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30020100", + "result" : "invalid" + }, + { + "tcId" : 225, + "comment" : "Signature with special case values r=p + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30020101", + "result" : "invalid" + }, + { + "tcId" : 226, + "comment" : "Signature with special case values r=p + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc300201ff", + "result" : "invalid" + }, + { + "tcId" : 227, + "comment" : "Signature with special case values r=p + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 228, + "comment" : "Signature with special case values r=p + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 229, + "comment" : "Signature with special case values r=p + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 230, + "comment" : "Signature with special case values r=p + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 231, + "comment" : "Signature with special case values r=p + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 232, + "comment" : "Signature encoding contains incorrect types: r=0, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020100090380fe01", + "result" : "invalid" + }, + { + "tcId" : 233, + "comment" : "Signature encoding contains incorrect types: r=0, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100090142", + "result" : "invalid" + }, + { + "tcId" : 234, + "comment" : "Signature encoding contains incorrect types: r=0, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010101", + "result" : "invalid" + }, + { + "tcId" : 235, + "comment" : "Signature encoding contains incorrect types: r=0, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010100", + "result" : "invalid" + }, + { + "tcId" : 236, + "comment" : "Signature encoding contains incorrect types: r=0, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000500", + "result" : "invalid" + }, + { + "tcId" : 237, + "comment" : "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000c00", + "result" : "invalid" + }, + { + "tcId" : 238, + "comment" : "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000c0130", + "result" : "invalid" + }, + { + "tcId" : 239, + "comment" : "Signature encoding contains incorrect types: r=0, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201003000", + "result" : "invalid" + }, + { + "tcId" : 240, + "comment" : "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201003003020100", + "result" : "invalid" + }, + { + "tcId" : 241, + "comment" : "Signature encoding contains incorrect types: r=1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020101090380fe01", + "result" : "invalid" + }, + { + "tcId" : 242, + "comment" : "Signature encoding contains incorrect types: r=1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101090142", + "result" : "invalid" + }, + { + "tcId" : 243, + "comment" : "Signature encoding contains incorrect types: r=1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010101", + "result" : "invalid" + }, + { + "tcId" : 244, + "comment" : "Signature encoding contains incorrect types: r=1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010100", + "result" : "invalid" + }, + { + "tcId" : 245, + "comment" : "Signature encoding contains incorrect types: r=1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010500", + "result" : "invalid" + }, + { + "tcId" : 246, + "comment" : "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010c00", + "result" : "invalid" + }, + { + "tcId" : 247, + "comment" : "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010c0130", + "result" : "invalid" + }, + { + "tcId" : 248, + "comment" : "Signature encoding contains incorrect types: r=1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201013000", + "result" : "invalid" + }, + { + "tcId" : 249, + "comment" : "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201013003020100", + "result" : "invalid" + }, + { + "tcId" : 250, + "comment" : "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 251, + "comment" : "Signature encoding contains incorrect types: r=-1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff090142", + "result" : "invalid" + }, + { + "tcId" : 252, + "comment" : "Signature encoding contains incorrect types: r=-1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010101", + "result" : "invalid" + }, + { + "tcId" : 253, + "comment" : "Signature encoding contains incorrect types: r=-1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010100", + "result" : "invalid" + }, + { + "tcId" : 254, + "comment" : "Signature encoding contains incorrect types: r=-1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0500", + "result" : "invalid" + }, + { + "tcId" : 255, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0c00", + "result" : "invalid" + }, + { + "tcId" : 256, + "comment" : "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0c0130", + "result" : "invalid" + }, + { + "tcId" : 257, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff3000", + "result" : "invalid" + }, + { + "tcId" : 258, + "comment" : "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff3003020100", + "result" : "invalid" + }, + { + "tcId" : 259, + "comment" : "Signature encoding contains incorrect types: r=n, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141090380fe01", + "result" : "invalid" + }, + { + "tcId" : 260, + "comment" : "Signature encoding contains incorrect types: r=n, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141090142", + "result" : "invalid" + }, + { + "tcId" : 261, + "comment" : "Signature encoding contains incorrect types: r=n, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141010101", + "result" : "invalid" + }, + { + "tcId" : 262, + "comment" : "Signature encoding contains incorrect types: r=n, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141010100", + "result" : "invalid" + }, + { + "tcId" : 263, + "comment" : "Signature encoding contains incorrect types: r=n, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410500", + "result" : "invalid" + }, + { + "tcId" : 264, + "comment" : "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410c00", + "result" : "invalid" + }, + { + "tcId" : 265, + "comment" : "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410c0130", + "result" : "invalid" + }, + { + "tcId" : 266, + "comment" : "Signature encoding contains incorrect types: r=n, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641413000", + "result" : "invalid" + }, + { + "tcId" : 267, + "comment" : "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641413003020100", + "result" : "invalid" + }, + { + "tcId" : 268, + "comment" : "Signature encoding contains incorrect types: r=p, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f090380fe01", + "result" : "invalid" + }, + { + "tcId" : 269, + "comment" : "Signature encoding contains incorrect types: r=p, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f090142", + "result" : "invalid" + }, + { + "tcId" : 270, + "comment" : "Signature encoding contains incorrect types: r=p, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f010101", + "result" : "invalid" + }, + { + "tcId" : 271, + "comment" : "Signature encoding contains incorrect types: r=p, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f010100", + "result" : "invalid" + }, + { + "tcId" : 272, + "comment" : "Signature encoding contains incorrect types: r=p, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0500", + "result" : "invalid" + }, + { + "tcId" : 273, + "comment" : "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0c00", + "result" : "invalid" + }, + { + "tcId" : 274, + "comment" : "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0c0130", + "result" : "invalid" + }, + { + "tcId" : 275, + "comment" : "Signature encoding contains incorrect types: r=p, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3000", + "result" : "invalid" + }, + { + "tcId" : 276, + "comment" : "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3003020100", + "result" : "invalid" + }, + { + "tcId" : 277, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a090380fe01090380fe01", + "result" : "invalid" + }, + { + "tcId" : 278, + "comment" : "Signature encoding contains incorrect types: r=nan, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142090142", + "result" : "invalid" + }, + { + "tcId" : 279, + "comment" : "Signature encoding contains incorrect types: r=True, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101010101", + "result" : "invalid" + }, + { + "tcId" : 280, + "comment" : "Signature encoding contains incorrect types: r=False, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100010100", + "result" : "invalid" + }, + { + "tcId" : 281, + "comment" : "Signature encoding contains incorrect types: r=Null, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300405000500", + "result" : "invalid" + }, + { + "tcId" : 282, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30040c000c00", + "result" : "invalid" + }, + { + "tcId" : 283, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c01300c0130", + "result" : "invalid" + }, + { + "tcId" : 284, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300430003000", + "result" : "invalid" + }, + { + "tcId" : 285, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a30030201003003020100", + "result" : "invalid" + }, + { + "tcId" : 286, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008090380fe01020100", + "result" : "invalid" + }, + { + "tcId" : 287, + "comment" : "Signature encoding contains incorrect types: r=nan, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142020100", + "result" : "invalid" + }, + { + "tcId" : 288, + "comment" : "Signature encoding contains incorrect types: r=True, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101020100", + "result" : "invalid" + }, + { + "tcId" : 289, + "comment" : "Signature encoding contains incorrect types: r=False, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100020100", + "result" : "invalid" + }, + { + "tcId" : 290, + "comment" : "Signature encoding contains incorrect types: r=Null, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050500020100", + "result" : "invalid" + }, + { + "tcId" : 291, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050c00020100", + "result" : "invalid" + }, + { + "tcId" : 292, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c0130020100", + "result" : "invalid" + }, + { + "tcId" : 293, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30053000020100", + "result" : "invalid" + }, + { + "tcId" : 294, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30083003020100020100", + "result" : "invalid" + }, + { + "tcId" : 295, + "comment" : "Edge case for Shamir multiplication", + "flags" : [ + "EdgeCaseShamirMultiplication" + ], + "msg" : "3235353835", + "sig" : "3045022100dd1b7d09a7bd8218961034a39a87fecf5314f00c4d25eb58a07ac85e85eab516022035138c401ef8d3493d65c9002fe62b43aee568731b744548358996d9cc427e06", + "result" : "valid" + }, + { + "tcId" : 296, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343236343739373234", + "sig" : "304502210095c29267d972a043d955224546222bba343fc1d4db0fec262a33ac61305696ae02206edfe96713aed56f8a28a6653f57e0b829712e5eddc67f34682b24f0676b2640", + "result" : "valid" + }, + { + "tcId" : 297, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37313338363834383931", + "sig" : "3045022028f94a894e92024699e345fe66971e3edcd050023386135ab3939d550898fb25022100cd69c1a42be05a6ee1270c821479251e134c21858d800bda6f4e98b37196238e", + "result" : "valid" + }, + { + "tcId" : 298, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130333539333331363638", + "sig" : "3046022100be26b18f9549f89f411a9b52536b15aa270b84548d0e859a1952a27af1a77ac60221008f3e2b05632fc33715572af9124681113f2b84325b80154c044a544dc1a8fa12", + "result" : "valid" + }, + { + "tcId" : 299, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33393439343031323135", + "sig" : "3046022100b1a4b1478e65cc3eafdf225d1298b43f2da19e4bcff7eacc0a2e98cd4b74b114022100e8655ce1cfb33ebd30af8ce8e8ae4d6f7b50cd3e22af51bf69e0a2851760d52b", + "result" : "valid" + }, + { + "tcId" : 300, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333434323933303739", + "sig" : "30440220325332021261f1bd18f2712aa1e2252da23796da8a4b1ff6ea18cafec7e171f2022040b4f5e287ee61fc3c804186982360891eaa35c75f05a43ecd48b35d984a6648", + "result" : "valid" + }, + { + "tcId" : 301, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33373036323131373132", + "sig" : "3046022100a23ad18d8fc66d81af0903890cbd453a554cb04cdc1a8ca7f7f78e5367ed88a0022100dc1c14d31e3fb158b73c764268c8b55579734a7e2a2c9b5ee5d9d0144ef652eb", + "result" : "valid" + }, + { + "tcId" : 302, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333433363838373132", + "sig" : "304502202bdea41cda63a2d14bf47353bd20880a690901de7cd6e3cc6d8ed5ba0cdb1091022100c31599433036064073835b1e3eba8335a650c8fd786f94fe235ad7d41dc94c7a", + "result" : "valid" + }, + { + "tcId" : 303, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333531353330333730", + "sig" : "3046022100d7cd76ec01c1b1079eba9e2aa2a397243c4758c98a1ba0b7404a340b9b00ced6022100ca8affe1e626dd192174c2937b15bc48f77b5bdfe01f073a8aeaf7f24dc6c85b", + "result" : "valid" + }, + { + "tcId" : 304, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36353533323033313236", + "sig" : "3045022100a872c744d936db21a10c361dd5c9063355f84902219652f6fc56dc95a7139d960220400df7575d9756210e9ccc77162c6b593c7746cfb48ac263c42750b421ef4bb9", + "result" : "valid" + }, + { + "tcId" : 305, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353634333436363033", + "sig" : "30460221009fa9afe07752da10b36d3afcd0fe44bfc40244d75203599cf8f5047fa3453854022100af1f583fec4040ae7e68c968d2bb4b494eec3a33edc7c0ccf95f7f75bc2569c7", + "result" : "valid" + }, + { + "tcId" : 306, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343239353339313137", + "sig" : "3045022100885640384d0d910efb177b46be6c3dc5cac81f0b88c3190bb6b5f99c2641f2050220738ed9bff116306d9caa0f8fc608be243e0b567779d8dab03e8e19d553f1dc8e", + "result" : "valid" + }, + { + "tcId" : 307, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130393533323631333531", + "sig" : "304502202d051f91c5a9d440c5676985710483bc4f1a6c611b10c95a2ff0363d90c2a45802210092206b19045a41a797cc2f3ac30de9518165e96d5b86341ecb3bcff231b3fd65", + "result" : "valid" + }, + { + "tcId" : 308, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35393837333530303431", + "sig" : "3045022100f3ac2523967482f53d508522712d583f4379cd824101ff635ea0935117baa54f022027f10812227397e02cea96fb0e680761636dab2b080d1fc5d11685cbe8500cfe", + "result" : "valid" + }, + { + "tcId" : 309, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343633303036383738", + "sig" : "304602210096447cf68c3ab7266ed7447de3ac52fed7cc08cbdfea391c18a9b8ab370bc913022100f0a1878b2c53f16e70fe377a5e9c6e86f18ae480a22bb499f5b32e7109c07385", + "result" : "valid" + }, + { + "tcId" : 310, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39383137333230323837", + "sig" : "30450220530a0832b691da0b5619a0b11de6877f3c0971baaa68ed122758c29caaf46b7202210093761bb0a14ccf9f15b4b9ce73c6ec700bd015b8cb1cfac56837f4463f53074e", + "result" : "valid" + }, + { + "tcId" : 311, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323232303431303436", + "sig" : "30460221009c54c25500bde0b92d72d6ec483dc2482f3654294ca74de796b681255ed58a77022100988bac394a90ad89ce360984c0c149dcbd2684bb64498ace90bcf6b6af1c170e", + "result" : "valid" + }, + { + "tcId" : 312, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36363636333037313034", + "sig" : "3045022100e7909d41439e2f6af29136c7348ca2641a2b070d5b64f91ea9da7070c7a2618b022042d782f132fa1d36c2c88ba27c3d678d80184a5d1eccac7501f0b47e3d205008", + "result" : "valid" + }, + { + "tcId" : 313, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303335393531383938", + "sig" : "304502205924873209593135a4c3da7bb381227f8a4b6aa9f34fe5bb7f8fbc131a039ffe022100e0e44ee4bbe370155bf0bbdec265bf9fe31c0746faab446de62e3631eacd111f", + "result" : "valid" + }, + { + "tcId" : 314, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31383436353937313935", + "sig" : "3045022100eeb692c9b262969b231c38b5a7f60649e0c875cd64df88f33aa571fa3d29ab0e0220218b3a1eb06379c2c18cf51b06430786d1c64cd2d24c9b232b23e5bac7989acd", + "result" : "valid" + }, + { + "tcId" : 315, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313336303436313839", + "sig" : "3045022100a40034177f36091c2b653684a0e3eb5d4bff18e4d09f664c2800e7cafda1daf802203a3ec29853704e52031c58927a800a968353adc3d973beba9172cbbeab4dd149", + "result" : "valid" + }, + { + "tcId" : 316, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32363633373834323534", + "sig" : "3046022100b5d795cc75cea5c434fa4185180cd6bd21223f3d5a86da6670d71d95680dadbf022100ab1b277ef5ffe134460835e3d1402461ba104cb50b16f397fdc7a9abfefef280", + "result" : "valid" + }, + { + "tcId" : 317, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363532313030353234", + "sig" : "3044022007dc2478d43c1232a4595608c64426c35510051a631ae6a5a6eb1161e57e42e102204a59ea0fdb72d12165cea3bf1ca86ba97517bd188db3dbd21a5a157850021984", + "result" : "valid" + }, + { + "tcId" : 318, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35373438303831363936", + "sig" : "3046022100ddd20c4a05596ca868b558839fce9f6511ddd83d1ccb53f82e5269d559a01552022100a46e8cb8d626cf6c00ddedc3b5da7e613ac376445ee260743f06f79054c7d42a", + "result" : "valid" + }, + { + "tcId" : 319, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36333433393133343638", + "sig" : "30450221009cde6e0ede0a003f02fda0a01b59facfe5dec063318f279ce2de7a9b1062f7b702202886a5b8c679bdf8224c66f908fd6205492cb70b0068d46ae4f33a4149b12a52", + "result" : "valid" + }, + { + "tcId" : 320, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353431313033353938", + "sig" : "3046022100c5771016d0dd6357143c89f684cd740423502554c0c59aa8c99584f1ff38f609022100ab4bfa0bb88ab99791b9b3ab9c4b02bd2a57ae8dde50b9064063fcf85315cfe5", + "result" : "valid" + }, + { + "tcId" : 321, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130343738353830313238", + "sig" : "3045022100a24ebc0ec224bd67ae397cbe6fa37b3125adbd34891abe2d7c7356921916dfe6022034f6eb6374731bbbafc4924fb8b0bdcdda49456d724cdae6178d87014cb53d8c", + "result" : "valid" + }, + { + "tcId" : 322, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130353336323835353638", + "sig" : "304502202557d64a7aee2e0931c012e4fea1cd3a2c334edae68cdeb7158caf21b68e5a2402210080f93244956ffdc568c77d12684f7f004fa92da7e60ae94a1b98c422e23eda34", + "result" : "valid" + }, + { + "tcId" : 323, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393533393034313035", + "sig" : "3046022100c4f2eccbb6a24350c8466450b9d61b207ee359e037b3dcedb42a3f2e6dd6aeb5022100cd9c394a65d0aa322e391eb76b2a1a687f8620a88adef3a01eb8e4fb05b6477a", + "result" : "valid" + }, + { + "tcId" : 324, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393738383438303339", + "sig" : "3046022100eff04781c9cbcd162d0a25a6e2ebcca43506c523385cb515d49ea38a1b12fcad022100ea5328ce6b36e56ab87acb0dcfea498bcec1bba86a065268f6eff3c41c4b0c9c", + "result" : "valid" + }, + { + "tcId" : 325, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33363130363732343432", + "sig" : "3046022100f58b4e3110a64bf1b5db97639ee0e5a9c8dfa49dc59b679891f520fdf0584c87022100d32701ae777511624c1f8abbf02b248b04e7a9eb27938f524f3e8828ba40164a", + "result" : "valid" + }, + { + "tcId" : 326, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303534323430373035", + "sig" : "3045022100f8abecaa4f0c502de4bf5903d48417f786bf92e8ad72fec0bd7fcb7800c0bbe302204c7f9e231076a30b7ae36b0cebe69ccef1cd194f7cce93a5588fd6814f437c0e", + "result" : "valid" + }, + { + "tcId" : 327, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35313734343438313937", + "sig" : "304402205d5b38bd37ad498b2227a633268a8cca879a5c7c94a4e416bd0a614d09e606d2022012b8d664ea9991062ecbb834e58400e25c46007af84f6007d7f1685443269afe", + "result" : "valid" + }, + { + "tcId" : 328, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393637353631323531", + "sig" : "304402200c1cd9fe4034f086a2b52d65b9d3834d72aebe7f33dfe8f976da82648177d8e3022013105782e3d0cfe85c2778dec1a848b27ac0ae071aa6da341a9553a946b41e59", + "result" : "valid" + }, + { + "tcId" : 329, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343437323533333433", + "sig" : "3045022100ae7935fb96ff246b7b5d5662870d1ba587b03d6e1360baf47988b5c02ccc1a5b02205f00c323272083782d4a59f2dfd65e49de0693627016900ef7e61428056664b3", + "result" : "valid" + }, + { + "tcId" : 330, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333638323634333138", + "sig" : "3045022000a134b5c6ccbcefd4c882b945baeb4933444172795fa6796aae149067547098022100a991b9efa2db276feae1c115c140770901839d87e60e7ec45a2b81cf3b437be6", + "result" : "valid" + }, + { + "tcId" : 331, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323631313938363038", + "sig" : "304502202e4721363ad3992c139e5a1c26395d2c2d777824aa24fde075e0d7381171309d0221008bf083b6bbe71ecff22baed087d5a77eaeaf726bf14ace2c03fd6e37ba6c26f2", + "result" : "valid" + }, + { + "tcId" : 332, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39363738373831303934", + "sig" : "304502206852e9d3cd9fe373c2d504877967d365ab1456707b6817a042864694e1960ccf022100f9b4d815ebd4cf77847b37952334d05b2045cb398d4c21ba207922a7a4714d84", + "result" : "valid" + }, + { + "tcId" : 333, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34393538383233383233", + "sig" : "30440220188a8c5648dc79eace158cf886c62b5468f05fd95f03a7635c5b4c31f09af4c5022036361a0b571a00c6cd5e686ccbfcfa703c4f97e48938346d0c103fdc76dc5867", + "result" : "valid" + }, + { + "tcId" : 334, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383234363337383337", + "sig" : "3045022100a74f1fb9a8263f62fc4416a5b7d584f4206f3996bb91f6fc8e73b9e92bad0e1302206815032e8c7d76c3ab06a86f33249ce9940148cb36d1f417c2e992e801afa3fa", + "result" : "valid" + }, + { + "tcId" : 335, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131303230383333373736", + "sig" : "3045022007244865b72ff37e62e3146f0dc14682badd7197799135f0b00ade7671742bfe022100f27f3ddc7124b1b58579573a835650e7a8bad5eeb96e9da215cd7bf9a2a039ed", + "result" : "valid" + }, + { + "tcId" : 336, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313333383731363438", + "sig" : "3045022100da7fdd05b5badabd619d805c4ee7d9a84f84ddd5cf9c5bf4d4338140d689ef08022028f1cf4fa1c3c5862cfa149c0013cf5fe6cf5076cae000511063e7de25bb38e5", + "result" : "valid" + }, + { + "tcId" : 337, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333232313434313632", + "sig" : "3046022100d3027c656f6d4fdfd8ede22093e3c303b0133c340d615e7756f6253aea927238022100f6510f9f371b31068d68bfeeaa720eb9bbdc8040145fcf88d4e0b58de0777d2a", + "result" : "valid" + }, + { + "tcId" : 338, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130363836363535353436", + "sig" : "304402200bf6c0188dc9571cd0e21eecac5fbb19d2434988e9cc10244593ef3a98099f6902204864a562661f9221ec88e3dd0bc2f6e27ac128c30cc1a80f79ec670a22b042ee", + "result" : "valid" + }, + { + "tcId" : 339, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3632313535323436", + "sig" : "3045022100ae459640d5d1179be47a47fa538e16d94ddea5585e7a244804a51742c686443a02206c8e30e530a634fae80b3ceb062978b39edbe19777e0a24553b68886181fd897", + "result" : "valid" + }, + { + "tcId" : 340, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37303330383138373734", + "sig" : "304402201cf3517ba3bf2ab8b9ead4ebb6e866cb88a1deacb6a785d3b63b483ca02ac4950220249a798b73606f55f5f1c70de67cb1a0cff95d7dc50b3a617df861bad3c6b1c9", + "result" : "valid" + }, + { + "tcId" : 341, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35393234353233373434", + "sig" : "3045022100e69b5238265ea35d77e4dd172288d8cea19810a10292617d5976519dc5757cb802204b03c5bc47e826bdb27328abd38d3056d77476b2130f3df6ec4891af08ba1e29", + "result" : "valid" + }, + { + "tcId" : 342, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343935353836363231", + "sig" : "304402205f9d7d7c870d085fc1d49fff69e4a275812800d2cf8973e7325866cb40fa2b6f02206d1f5491d9f717a597a15fd540406486d76a44697b3f0d9d6dcef6669f8a0a56", + "result" : "valid" + }, + { + "tcId" : 343, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34303035333134343036", + "sig" : "304402200a7d5b1959f71df9f817146ee49bd5c89b431e7993e2fdecab6858957da685ae02200f8aad2d254690bdc13f34a4fec44a02fd745a422df05ccbb54635a8b86b9609", + "result" : "valid" + }, + { + "tcId" : 344, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303936343537353132", + "sig" : "3044022079e88bf576b74bc07ca142395fda28f03d3d5e640b0b4ff0752c6d94cd553408022032cea05bd2d706c8f6036a507e2ab7766004f0904e2e5c5862749c0073245d6a", + "result" : "valid" + }, + { + "tcId" : 345, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373834303235363230", + "sig" : "30450221009d54e037a00212b377bc8874798b8da080564bbdf7e07591b861285809d01488022018b4e557667a82bd95965f0706f81a29243fbdd86968a7ebeb43069db3b18c7f", + "result" : "valid" + }, + { + "tcId" : 346, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32363138373837343138", + "sig" : "304402202664f1ffa982fedbcc7cab1b8bc6e2cb420218d2a6077ad08e591ba9feab33bd022049f5c7cb515e83872a3d41b4cdb85f242ad9d61a5bfc01debfbb52c6c84ba728", + "result" : "valid" + }, + { + "tcId" : 347, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363432363235323632", + "sig" : "304502205827518344844fd6a7de73cbb0a6befdea7b13d2dee4475317f0f18ffc81524b022100b0a334b1f4b774a5a289f553224d286d239ef8a90929ed2d91423e024eb7fa66", + "result" : "valid" + }, + { + "tcId" : 348, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36383234313839343336", + "sig" : "304602210097ab19bd139cac319325869218b1bce111875d63fb12098a04b0cd59b6fdd3a3022100bce26315c5dbc7b8cfc31425a9b89bccea7aa9477d711a4d377f833dcc28f820", + "result" : "valid" + }, + { + "tcId" : 349, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343834323435343235", + "sig" : "3044022052c683144e44119ae2013749d4964ef67509278f6d38ba869adcfa69970e123d02203479910167408f45bda420a626ec9c4ec711c1274be092198b4187c018b562ca", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0407310f90a9eae149a08402f54194a0f7b4ac427bf8d9bd6c7681071dc47dc36226a6d37ac46d61fd600c0bf1bff87689ed117dda6b0e59318ae010a197a26ca0", + "wx" : "07310f90a9eae149a08402f54194a0f7b4ac427bf8d9bd6c7681071dc47dc362", + "wy" : "26a6d37ac46d61fd600c0bf1bff87689ed117dda6b0e59318ae010a197a26ca0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000407310f90a9eae149a08402f54194a0f7b4ac427bf8d9bd6c7681071dc47dc36226a6d37ac46d61fd600c0bf1bff87689ed117dda6b0e59318ae010a197a26ca0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEBzEPkKnq4UmghAL1QZSg97SsQnv42b1s\ndoEHHcR9w2ImptN6xG1h/WAMC/G/+HaJ7RF92msOWTGK4BChl6JsoA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 350, + "comment" : "k*G has a large x-coordinate", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30360211014551231950b75fc4402da1722fc9baeb022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "valid" + }, + { + "tcId" : 351, + "comment" : "r too large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2c022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04bc97e7585eecad48e16683bc4091708e1a930c683fc47001d4b383594f2c4e22705989cf69daeadd4e4e4b8151ed888dfec20fb01728d89d56b3f38f2ae9c8c5", + "wx" : "00bc97e7585eecad48e16683bc4091708e1a930c683fc47001d4b383594f2c4e22", + "wy" : "705989cf69daeadd4e4e4b8151ed888dfec20fb01728d89d56b3f38f2ae9c8c5" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004bc97e7585eecad48e16683bc4091708e1a930c683fc47001d4b383594f2c4e22705989cf69daeadd4e4e4b8151ed888dfec20fb01728d89d56b3f38f2ae9c8c5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEvJfnWF7srUjhZoO8QJFwjhqTDGg/xHAB\n1LODWU8sTiJwWYnPadrq3U5OS4FR7YiN/sIPsBco2J1Ws/OPKunIxQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 352, + "comment" : "r,s are large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0444ad339afbc21e9abf7b602a5ca535ea378135b6d10d81310bdd8293d1df3252b63ff7d0774770f8fe1d1722fa83acd02f434e4fc110a0cc8f6dddd37d56c463", + "wx" : "44ad339afbc21e9abf7b602a5ca535ea378135b6d10d81310bdd8293d1df3252", + "wy" : "00b63ff7d0774770f8fe1d1722fa83acd02f434e4fc110a0cc8f6dddd37d56c463" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000444ad339afbc21e9abf7b602a5ca535ea378135b6d10d81310bdd8293d1df3252b63ff7d0774770f8fe1d1722fa83acd02f434e4fc110a0cc8f6dddd37d56c463", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAERK0zmvvCHpq/e2AqXKU16jeBNbbRDYEx\nC92Ck9HfMlK2P/fQd0dw+P4dFyL6g6zQL0NOT8EQoMyPbd3TfVbEYw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 353, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02203e9a7582886089c62fb840cf3b83061cd1cff3ae4341808bb5bdee6191174177", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041260c2122c9e244e1af5151bede0c3ae23b54d7c596881d3eebad21f37dd878c5c9a0c1a9ade76737a8811bd6a7f9287c978ee396aa89c11e47229d2ccb552f0", + "wx" : "1260c2122c9e244e1af5151bede0c3ae23b54d7c596881d3eebad21f37dd878c", + "wy" : "5c9a0c1a9ade76737a8811bd6a7f9287c978ee396aa89c11e47229d2ccb552f0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041260c2122c9e244e1af5151bede0c3ae23b54d7c596881d3eebad21f37dd878c5c9a0c1a9ade76737a8811bd6a7f9287c978ee396aa89c11e47229d2ccb552f0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEEmDCEiyeJE4a9RUb7eDDriO1TXxZaIHT\n7rrSHzfdh4xcmgwamt52c3qIEb1qf5KHyXjuOWqonBHkcinSzLVS8A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 354, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022024238e70b431b1a64efdf9032669939d4b77f249503fc6905feb7540dea3e6d2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041877045be25d34a1d0600f9d5c00d0645a2a54379b6ceefad2e6bf5c2a3352ce821a532cc1751ee1d36d41c3d6ab4e9b143e44ec46d73478ea6a79a5c0e54159", + "wx" : "1877045be25d34a1d0600f9d5c00d0645a2a54379b6ceefad2e6bf5c2a3352ce", + "wy" : "00821a532cc1751ee1d36d41c3d6ab4e9b143e44ec46d73478ea6a79a5c0e54159" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041877045be25d34a1d0600f9d5c00d0645a2a54379b6ceefad2e6bf5c2a3352ce821a532cc1751ee1d36d41c3d6ab4e9b143e44ec46d73478ea6a79a5c0e54159", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGHcEW+JdNKHQYA+dXADQZFoqVDebbO76\n0ua/XCozUs6CGlMswXUe4dNtQcPWq06bFD5E7EbXNHjqanmlwOVBWQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 355, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04455439fcc3d2deeceddeaece60e7bd17304f36ebb602adf5a22e0b8f1db46a50aec38fb2baf221e9a8d1887c7bf6222dd1834634e77263315af6d23609d04f77", + "wx" : "455439fcc3d2deeceddeaece60e7bd17304f36ebb602adf5a22e0b8f1db46a50", + "wy" : "00aec38fb2baf221e9a8d1887c7bf6222dd1834634e77263315af6d23609d04f77" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004455439fcc3d2deeceddeaece60e7bd17304f36ebb602adf5a22e0b8f1db46a50aec38fb2baf221e9a8d1887c7bf6222dd1834634e77263315af6d23609d04f77", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAERVQ5/MPS3uzt3q7OYOe9FzBPNuu2Aq31\noi4Ljx20alCuw4+yuvIh6ajRiHx79iIt0YNGNOdyYzFa9tI2CdBPdw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 356, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020102", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042e1f466b024c0c3ace2437de09127fed04b706f94b19a21bb1c2acf35cece7180449ae3523d72534e964972cfd3b38af0bddd9619e5af223e4d1a40f34cf9f1d", + "wx" : "2e1f466b024c0c3ace2437de09127fed04b706f94b19a21bb1c2acf35cece718", + "wy" : "0449ae3523d72534e964972cfd3b38af0bddd9619e5af223e4d1a40f34cf9f1d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042e1f466b024c0c3ace2437de09127fed04b706f94b19a21bb1c2acf35cece7180449ae3523d72534e964972cfd3b38af0bddd9619e5af223e4d1a40f34cf9f1d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAELh9GawJMDDrOJDfeCRJ/7QS3BvlLGaIb\nscKs81zs5xgESa41I9clNOlklyz9OzivC93ZYZ5a8iPk0aQPNM+fHQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 357, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048e7abdbbd18de7452374c1879a1c3b01d13261e7d4571c3b47a1c76c55a2337326ed897cd517a4f5349db809780f6d2f2b9f6299d8b5a89077f1119a718fd7b3", + "wx" : "008e7abdbbd18de7452374c1879a1c3b01d13261e7d4571c3b47a1c76c55a23373", + "wy" : "26ed897cd517a4f5349db809780f6d2f2b9f6299d8b5a89077f1119a718fd7b3" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048e7abdbbd18de7452374c1879a1c3b01d13261e7d4571c3b47a1c76c55a2337326ed897cd517a4f5349db809780f6d2f2b9f6299d8b5a89077f1119a718fd7b3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEjnq9u9GN50UjdMGHmhw7AdEyYefUVxw7\nR6HHbFWiM3Mm7Yl81Rek9TSduAl4D20vK59imdi1qJB38RGacY/Xsw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 358, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047b333d4340d3d718dd3e6aff7de7bbf8b72bfd616c8420056052842376b9af1942117c5afeac755d6f376fc6329a7d76051b87123a4a5d0bc4a539380f03de7b", + "wx" : "7b333d4340d3d718dd3e6aff7de7bbf8b72bfd616c8420056052842376b9af19", + "wy" : "42117c5afeac755d6f376fc6329a7d76051b87123a4a5d0bc4a539380f03de7b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047b333d4340d3d718dd3e6aff7de7bbf8b72bfd616c8420056052842376b9af1942117c5afeac755d6f376fc6329a7d76051b87123a4a5d0bc4a539380f03de7b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEezM9Q0DT1xjdPmr/fee7+Lcr/WFshCAF\nYFKEI3a5rxlCEXxa/qx1XW83b8Yymn12BRuHEjpKXQvEpTk4DwPeew==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 359, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020102", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d30ca4a0ddb6616c851d30ced682c40f83c62758a1f2759988d6763a88f1c0e503a80d5415650d41239784e8e2fb1235e9fe991d112ebb81186cbf0da2de3aff", + "wx" : "00d30ca4a0ddb6616c851d30ced682c40f83c62758a1f2759988d6763a88f1c0e5", + "wy" : "03a80d5415650d41239784e8e2fb1235e9fe991d112ebb81186cbf0da2de3aff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d30ca4a0ddb6616c851d30ced682c40f83c62758a1f2759988d6763a88f1c0e503a80d5415650d41239784e8e2fb1235e9fe991d112ebb81186cbf0da2de3aff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0wykoN22YWyFHTDO1oLED4PGJ1ih8nWZ\niNZ2OojxwOUDqA1UFWUNQSOXhOji+xI16f6ZHREuu4EYbL8Not46/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 360, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020103", + "result" : "valid" + }, + { + "tcId" : 361, + "comment" : "r is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364143020103", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0448969b39991297b332a652d3ee6e01e909b39904e71fa2354a7830c7750baf24b4012d1b830d199ccb1fc972b32bfded55f09cd62d257e5e844e27e57a1594ec", + "wx" : "48969b39991297b332a652d3ee6e01e909b39904e71fa2354a7830c7750baf24", + "wy" : "00b4012d1b830d199ccb1fc972b32bfded55f09cd62d257e5e844e27e57a1594ec" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000448969b39991297b332a652d3ee6e01e909b39904e71fa2354a7830c7750baf24b4012d1b830d199ccb1fc972b32bfded55f09cd62d257e5e844e27e57a1594ec", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESJabOZkSl7MyplLT7m4B6QmzmQTnH6I1\nSngwx3ULryS0AS0bgw0ZnMsfyXKzK/3tVfCc1i0lfl6ETiflehWU7A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 362, + "comment" : "s is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020102022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd04917c8", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0402ef4d6d6cfd5a94f1d7784226e3e2a6c0a436c55839619f38fb4472b5f9ee777eb4acd4eebda5cd72875ffd2a2f26229c2dc6b46500919a432c86739f3ae866", + "wx" : "02ef4d6d6cfd5a94f1d7784226e3e2a6c0a436c55839619f38fb4472b5f9ee77", + "wy" : "7eb4acd4eebda5cd72875ffd2a2f26229c2dc6b46500919a432c86739f3ae866" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000402ef4d6d6cfd5a94f1d7784226e3e2a6c0a436c55839619f38fb4472b5f9ee777eb4acd4eebda5cd72875ffd2a2f26229c2dc6b46500919a432c86739f3ae866", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAu9NbWz9WpTx13hCJuPipsCkNsVYOWGf\nOPtEcrX57nd+tKzU7r2lzXKHX/0qLyYinC3GtGUAkZpDLIZznzroZg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 363, + "comment" : "small r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302702020101022100c58b162c58b162c58b162c58b162c58a1b242973853e16db75c8a1a71da4d39d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04464f4ff715729cae5072ca3bd801d3195b67aec65e9b01aad20a2943dcbcb584b1afd29d31a39a11d570aa1597439b3b2d1971bf2f1abf15432d0207b10d1d08", + "wx" : "464f4ff715729cae5072ca3bd801d3195b67aec65e9b01aad20a2943dcbcb584", + "wy" : "00b1afd29d31a39a11d570aa1597439b3b2d1971bf2f1abf15432d0207b10d1d08" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004464f4ff715729cae5072ca3bd801d3195b67aec65e9b01aad20a2943dcbcb584b1afd29d31a39a11d570aa1597439b3b2d1971bf2f1abf15432d0207b10d1d08", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAERk9P9xVynK5Qcso72AHTGVtnrsZemwGq\n0gopQ9y8tYSxr9KdMaOaEdVwqhWXQ5s7LRlxvy8avxVDLQIHsQ0dCA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 364, + "comment" : "smallish r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302c02072d9b4d347952cc022100fcbc5103d0da267477d1791461cf2aa44bf9d43198f79507bd8779d69a13108e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04157f8fddf373eb5f49cfcf10d8b853cf91cbcd7d665c3522ba7dd738ddb79a4cdeadf1a5c448ea3c9f4191a8999abfcc757ac6d64567ef072c47fec613443b8f", + "wx" : "157f8fddf373eb5f49cfcf10d8b853cf91cbcd7d665c3522ba7dd738ddb79a4c", + "wy" : "00deadf1a5c448ea3c9f4191a8999abfcc757ac6d64567ef072c47fec613443b8f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004157f8fddf373eb5f49cfcf10d8b853cf91cbcd7d665c3522ba7dd738ddb79a4cdeadf1a5c448ea3c9f4191a8999abfcc757ac6d64567ef072c47fec613443b8f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEFX+P3fNz619Jz88Q2LhTz5HLzX1mXDUi\nun3XON23mkzerfGlxEjqPJ9BkaiZmr/MdXrG1kVn7wcsR/7GE0Q7jw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 365, + "comment" : "100-bit r and small s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d1033e67e37b32b445580bf4efc022100906f906f906f906f906f906f906f906ed8e426f7b1968c35a204236a579723d2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040934a537466c07430e2c48feb990bb19fb78cecc9cee424ea4d130291aa237f0d4f92d23b462804b5b68c52558c01c9996dbf727fccabbeedb9621a400535afa", + "wx" : "0934a537466c07430e2c48feb990bb19fb78cecc9cee424ea4d130291aa237f0", + "wy" : "00d4f92d23b462804b5b68c52558c01c9996dbf727fccabbeedb9621a400535afa" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040934a537466c07430e2c48feb990bb19fb78cecc9cee424ea4d130291aa237f0d4f92d23b462804b5b68c52558c01c9996dbf727fccabbeedb9621a400535afa", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAECTSlN0ZsB0MOLEj+uZC7Gft4zsyc7kJO\npNEwKRqiN/DU+S0jtGKAS1toxSVYwByZltv3J/zKu+7bliGkAFNa+g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 366, + "comment" : "small r and 100 bit s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020201010220783266e90f43dafe5cd9b3b0be86de22f9de83677d0f50713a468ec72fcf5d57", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d6ef20be66c893f741a9bf90d9b74675d1c2a31296397acb3ef174fd0b300c654a0c95478ca00399162d7f0f2dc89efdc2b28a30fbabe285857295a4b0c4e265", + "wx" : "00d6ef20be66c893f741a9bf90d9b74675d1c2a31296397acb3ef174fd0b300c65", + "wy" : "4a0c95478ca00399162d7f0f2dc89efdc2b28a30fbabe285857295a4b0c4e265" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d6ef20be66c893f741a9bf90d9b74675d1c2a31296397acb3ef174fd0b300c654a0c95478ca00399162d7f0f2dc89efdc2b28a30fbabe285857295a4b0c4e265", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE1u8gvmbIk/dBqb+Q2bdGddHCoxKWOXrL\nPvF0/QswDGVKDJVHjKADmRYtfw8tyJ79wrKKMPur4oWFcpWksMTiZQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 367, + "comment" : "100-bit r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3031020d062522bbd3ecbe7c39e93e7c260220783266e90f43dafe5cd9b3b0be86de22f9de83677d0f50713a468ec72fcf5d57", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b7291d1404e0c0c07dab9372189f4bd58d2ceaa8d15ede544d9514545ba9ee0629c9a63d5e308769cc30ec276a410e6464a27eeafd9e599db10f053a4fe4a829", + "wx" : "00b7291d1404e0c0c07dab9372189f4bd58d2ceaa8d15ede544d9514545ba9ee06", + "wy" : "29c9a63d5e308769cc30ec276a410e6464a27eeafd9e599db10f053a4fe4a829" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b7291d1404e0c0c07dab9372189f4bd58d2ceaa8d15ede544d9514545ba9ee0629c9a63d5e308769cc30ec276a410e6464a27eeafd9e599db10f053a4fe4a829", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEtykdFATgwMB9q5NyGJ9L1Y0s6qjRXt5U\nTZUUVFup7gYpyaY9XjCHacww7CdqQQ5kZKJ+6v2eWZ2xDwU6T+SoKQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 368, + "comment" : "r and s^-1 are close to n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03640c1022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e28303305d642ccb923b722ea86b2a0bc8e3735ecb26e849b19c9f76b2fdbb8186e80d64d8cab164f5238f5318461bf89d4d96ee6544c816c7566947774e0f6", + "wx" : "6e28303305d642ccb923b722ea86b2a0bc8e3735ecb26e849b19c9f76b2fdbb8", + "wy" : "186e80d64d8cab164f5238f5318461bf89d4d96ee6544c816c7566947774e0f6" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e28303305d642ccb923b722ea86b2a0bc8e3735ecb26e849b19c9f76b2fdbb8186e80d64d8cab164f5238f5318461bf89d4d96ee6544c816c7566947774e0f6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbigwMwXWQsy5I7ci6oayoLyONzXssm6E\nmxnJ92sv27gYboDWTYyrFk9SOPUxhGG/idTZbuZUTIFsdWaUd3Tg9g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 369, + "comment" : "r and s are 64-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30160209009c44febf31c3594d020900839ed28247c2b06b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04375bda93f6af92fb5f8f4b1b5f0534e3bafab34cb7ad9fb9d0b722e4a5c302a9a00b9f387a5a396097aa2162fc5bbcf4a5263372f681c94da51e9799120990fd", + "wx" : "375bda93f6af92fb5f8f4b1b5f0534e3bafab34cb7ad9fb9d0b722e4a5c302a9", + "wy" : "00a00b9f387a5a396097aa2162fc5bbcf4a5263372f681c94da51e9799120990fd" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004375bda93f6af92fb5f8f4b1b5f0534e3bafab34cb7ad9fb9d0b722e4a5c302a9a00b9f387a5a396097aa2162fc5bbcf4a5263372f681c94da51e9799120990fd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEN1vak/avkvtfj0sbXwU047r6s0y3rZ+5\n0Lci5KXDAqmgC584elo5YJeqIWL8W7z0pSYzcvaByU2lHpeZEgmQ/Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 370, + "comment" : "r and s are 100-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "301e020d09df8b682430beef6f5fd7c7cf020d0fd0a62e13778f4222a0d61c8a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d75b68216babe03ae257e94b4e3bf1c52f44e3df266d1524ff8c5ea69da73197da4bff9ed1c53f44917a67d7b978598e89df359e3d5913eaea24f3ae259abc44", + "wx" : "00d75b68216babe03ae257e94b4e3bf1c52f44e3df266d1524ff8c5ea69da73197", + "wy" : "00da4bff9ed1c53f44917a67d7b978598e89df359e3d5913eaea24f3ae259abc44" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d75b68216babe03ae257e94b4e3bf1c52f44e3df266d1524ff8c5ea69da73197da4bff9ed1c53f44917a67d7b978598e89df359e3d5913eaea24f3ae259abc44", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE11toIWur4DriV+lLTjvxxS9E498mbRUk\n/4xepp2nMZfaS/+e0cU/RJF6Z9e5eFmOid81nj1ZE+rqJPOuJZq8RA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 371, + "comment" : "r and s are 128-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30260211008a598e563a89f526c32ebec8de26367a02110084f633e2042630e99dd0f1e16f7a04bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0478bcda140aed23d430cb23c3dc0d01f423db134ee94a3a8cb483f2deac2ac653118114f6f33045d4e9ed9107085007bfbddf8f58fe7a1a2445d66a990045476e", + "wx" : "78bcda140aed23d430cb23c3dc0d01f423db134ee94a3a8cb483f2deac2ac653", + "wy" : "118114f6f33045d4e9ed9107085007bfbddf8f58fe7a1a2445d66a990045476e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000478bcda140aed23d430cb23c3dc0d01f423db134ee94a3a8cb483f2deac2ac653118114f6f33045d4e9ed9107085007bfbddf8f58fe7a1a2445d66a990045476e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeLzaFArtI9QwyyPD3A0B9CPbE07pSjqM\ntIPy3qwqxlMRgRT28zBF1OntkQcIUAe/vd+PWP56GiRF1mqZAEVHbg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 372, + "comment" : "r and s are 160-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04bb79f61857f743bfa1b6e7111ce4094377256969e4e15159123d9548acc3be6c1f9d9f8860dcffd3eb36dd6c31ff2e7226c2009c4c94d8d7d2b5686bf7abd677", + "wx" : "00bb79f61857f743bfa1b6e7111ce4094377256969e4e15159123d9548acc3be6c", + "wy" : "1f9d9f8860dcffd3eb36dd6c31ff2e7226c2009c4c94d8d7d2b5686bf7abd677" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004bb79f61857f743bfa1b6e7111ce4094377256969e4e15159123d9548acc3be6c1f9d9f8860dcffd3eb36dd6c31ff2e7226c2009c4c94d8d7d2b5686bf7abd677", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEu3n2GFf3Q7+htucRHOQJQ3claWnk4VFZ\nEj2VSKzDvmwfnZ+IYNz/0+s23Wwx/y5yJsIAnEyU2NfStWhr96vWdw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 373, + "comment" : "s == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3025022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1020101", + "result" : "valid" + }, + { + "tcId" : 374, + "comment" : "s == 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3025022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1020100", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0493591827d9e6713b4e9faea62c72b28dfefa68e0c05160b5d6aae88fd2e36c36073f5545ad5af410af26afff68654cf72d45e493489311203247347a890f4518", + "wx" : "0093591827d9e6713b4e9faea62c72b28dfefa68e0c05160b5d6aae88fd2e36c36", + "wy" : "073f5545ad5af410af26afff68654cf72d45e493489311203247347a890f4518" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000493591827d9e6713b4e9faea62c72b28dfefa68e0c05160b5d6aae88fd2e36c36073f5545ad5af410af26afff68654cf72d45e493489311203247347a890f4518", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEk1kYJ9nmcTtOn66mLHKyjf76aODAUWC1\n1qroj9LjbDYHP1VFrVr0EK8mr/9oZUz3LUXkk0iTESAyRzR6iQ9FGA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 375, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220419d981c515af8cc82545aac0c85e9e308fbb2eab6acd7ed497e0b4145a18fd9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0431ed3081aefe001eb6402069ee2ccc1862937b85995144dba9503943587bf0dada01b8cc4df34f5ab3b1a359615208946e5ee35f98ee775b8ccecd86ccc1650f", + "wx" : "31ed3081aefe001eb6402069ee2ccc1862937b85995144dba9503943587bf0da", + "wy" : "00da01b8cc4df34f5ab3b1a359615208946e5ee35f98ee775b8ccecd86ccc1650f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000431ed3081aefe001eb6402069ee2ccc1862937b85995144dba9503943587bf0dada01b8cc4df34f5ab3b1a359615208946e5ee35f98ee775b8ccecd86ccc1650f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEMe0wga7+AB62QCBp7izMGGKTe4WZUUTb\nqVA5Q1h78NraAbjMTfNPWrOxo1lhUgiUbl7jX5jud1uMzs2GzMFlDw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 376, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102201b21717ad71d23bbac60a9ad0baf75b063c9fdf52a00ebf99d022172910993c9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047dff66fa98509ff3e2e51045f4390523dccda43a3bc2885e58c248090990eea854c76c2b9adeb6bb571823e07fd7c65c8639cf9d905260064c8e7675ce6d98b4", + "wx" : "7dff66fa98509ff3e2e51045f4390523dccda43a3bc2885e58c248090990eea8", + "wy" : "54c76c2b9adeb6bb571823e07fd7c65c8639cf9d905260064c8e7675ce6d98b4" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047dff66fa98509ff3e2e51045f4390523dccda43a3bc2885e58c248090990eea854c76c2b9adeb6bb571823e07fd7c65c8639cf9d905260064c8e7675ce6d98b4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEff9m+phQn/Pi5RBF9DkFI9zNpDo7wohe\nWMJICQmQ7qhUx2wrmt62u1cYI+B/18ZchjnPnZBSYAZMjnZ1zm2YtA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 377, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102202f588f66018f3dd14db3e28e77996487e32486b521ed8e5a20f06591951777e9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044280509aab64edfc0b4a2967e4cbce849cb544e4a77313c8e6ece579fbd7420a2e89fe5cc1927d554e6a3bb14033ea7c922cd75cba2c7415fdab52f20b1860f1", + "wx" : "4280509aab64edfc0b4a2967e4cbce849cb544e4a77313c8e6ece579fbd7420a", + "wy" : "2e89fe5cc1927d554e6a3bb14033ea7c922cd75cba2c7415fdab52f20b1860f1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044280509aab64edfc0b4a2967e4cbce849cb544e4a77313c8e6ece579fbd7420a2e89fe5cc1927d554e6a3bb14033ea7c922cd75cba2c7415fdab52f20b1860f1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQoBQmqtk7fwLSiln5MvOhJy1ROSncxPI\n5uzlefvXQgouif5cwZJ9VU5qO7FAM+p8kizXXLosdBX9q1LyCxhg8Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 378, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220091a08870ff4daf9123b30c20e8c4fc8505758dcf4074fcaff2170c9bfcf74f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044f8df145194e3c4fc3eea26d43ce75b402d6b17472ddcbb254b8a79b0bf3d9cb2aa20d82844cb266344e71ca78f2ad27a75a09e5bc0fa57e4efd9d465a0888db", + "wx" : "4f8df145194e3c4fc3eea26d43ce75b402d6b17472ddcbb254b8a79b0bf3d9cb", + "wy" : "2aa20d82844cb266344e71ca78f2ad27a75a09e5bc0fa57e4efd9d465a0888db" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044f8df145194e3c4fc3eea26d43ce75b402d6b17472ddcbb254b8a79b0bf3d9cb2aa20d82844cb266344e71ca78f2ad27a75a09e5bc0fa57e4efd9d465a0888db", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAET43xRRlOPE/D7qJtQ851tALWsXRy3cuy\nVLinmwvz2csqog2ChEyyZjROccp48q0np1oJ5bwPpX5O/Z1GWgiI2w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 379, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102207c370dc0ce8c59a8b273cba44a7c1191fc3186dc03cab96b0567312df0d0b250", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049598a57dd67ec3e16b587a338aa3a10a3a3913b41a3af32e3ed3ff01358c6b14122819edf8074bbc521f7d4cdce82fef7a516706affba1d93d9dea9ccae1a207", + "wx" : "009598a57dd67ec3e16b587a338aa3a10a3a3913b41a3af32e3ed3ff01358c6b14", + "wy" : "122819edf8074bbc521f7d4cdce82fef7a516706affba1d93d9dea9ccae1a207" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049598a57dd67ec3e16b587a338aa3a10a3a3913b41a3af32e3ed3ff01358c6b14122819edf8074bbc521f7d4cdce82fef7a516706affba1d93d9dea9ccae1a207", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAElZilfdZ+w+FrWHoziqOhCjo5E7QaOvMu\nPtP/ATWMaxQSKBnt+AdLvFIffUzc6C/velFnBq/7odk9neqcyuGiBw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 380, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022070b59a7d1ee77a2f9e0491c2a7cfcd0ed04df4a35192f6132dcc668c79a6160e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049171fec3ca20806bc084f12f0760911b60990bd80e5b2a71ca03a048b20f837e634fd17863761b2958d2be4e149f8d3d7abbdc18be03f451ab6c17fa0a1f8330", + "wx" : "009171fec3ca20806bc084f12f0760911b60990bd80e5b2a71ca03a048b20f837e", + "wy" : "634fd17863761b2958d2be4e149f8d3d7abbdc18be03f451ab6c17fa0a1f8330" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049171fec3ca20806bc084f12f0760911b60990bd80e5b2a71ca03a048b20f837e634fd17863761b2958d2be4e149f8d3d7abbdc18be03f451ab6c17fa0a1f8330", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEkXH+w8oggGvAhPEvB2CRG2CZC9gOWypx\nygOgSLIPg35jT9F4Y3YbKVjSvk4Un409ervcGL4D9FGrbBf6Ch+DMA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 381, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102202736d76e412246e097148e2bf62915614eb7c428913a58eb5e9cd4674a9423de", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04777c8930b6e1d271100fe68ce93f163fa37612c5fff67f4a62fc3bafaf3d17a9ed73d86f60a51b5ed91353a3b054edc0aa92c9ebcbd0b75d188fdc882791d68d", + "wx" : "777c8930b6e1d271100fe68ce93f163fa37612c5fff67f4a62fc3bafaf3d17a9", + "wy" : "00ed73d86f60a51b5ed91353a3b054edc0aa92c9ebcbd0b75d188fdc882791d68d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004777c8930b6e1d271100fe68ce93f163fa37612c5fff67f4a62fc3bafaf3d17a9ed73d86f60a51b5ed91353a3b054edc0aa92c9ebcbd0b75d188fdc882791d68d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEd3yJMLbh0nEQD+aM6T8WP6N2EsX/9n9K\nYvw7r689F6ntc9hvYKUbXtkTU6OwVO3AqpLJ68vQt10Yj9yIJ5HWjQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 382, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102204a1e12831fbe93627b02d6e7f24bccdd6ef4b2d0f46739eaf3b1eaf0ca117770", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04eabc248f626e0a63e1eb81c43d461a39a1dba881eb6ee2152b07c32d71bcf4700603caa8b9d33db13af44c6efbec8a198ed6124ac9eb17eaafd2824a545ec000", + "wx" : "00eabc248f626e0a63e1eb81c43d461a39a1dba881eb6ee2152b07c32d71bcf470", + "wy" : "0603caa8b9d33db13af44c6efbec8a198ed6124ac9eb17eaafd2824a545ec000" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004eabc248f626e0a63e1eb81c43d461a39a1dba881eb6ee2152b07c32d71bcf4700603caa8b9d33db13af44c6efbec8a198ed6124ac9eb17eaafd2824a545ec000", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE6rwkj2JuCmPh64HEPUYaOaHbqIHrbuIV\nKwfDLXG89HAGA8qoudM9sTr0TG777IoZjtYSSsnrF+qv0oJKVF7AAA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 383, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022006c778d4dfff7dee06ed88bc4e0ed34fc553aad67caf796f2a1c6487c1b2e877", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049f7a13ada158a55f9ddf1a45f044f073d9b80030efdcfc9f9f58418fbceaf001f8ada0175090f80d47227d6713b6740f9a0091d88a837d0a1cd77b58a8f28d73", + "wx" : "009f7a13ada158a55f9ddf1a45f044f073d9b80030efdcfc9f9f58418fbceaf001", + "wy" : "00f8ada0175090f80d47227d6713b6740f9a0091d88a837d0a1cd77b58a8f28d73" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049f7a13ada158a55f9ddf1a45f044f073d9b80030efdcfc9f9f58418fbceaf001f8ada0175090f80d47227d6713b6740f9a0091d88a837d0a1cd77b58a8f28d73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEn3oTraFYpV+d3xpF8ETwc9m4ADDv3Pyf\nn1hBj7zq8AH4raAXUJD4DUcifWcTtnQPmgCR2IqDfQoc13tYqPKNcw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 384, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102204de459ef9159afa057feb3ec40fef01c45b809f4ab296ea48c206d4249a2b451", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0411c4f3e461cd019b5c06ea0cea4c4090c3cc3e3c5d9f3c6d65b436826da9b4dbbbeb7a77e4cbfda207097c43423705f72c80476da3dac40a483b0ab0f2ead1cb", + "wx" : "11c4f3e461cd019b5c06ea0cea4c4090c3cc3e3c5d9f3c6d65b436826da9b4db", + "wy" : "00bbeb7a77e4cbfda207097c43423705f72c80476da3dac40a483b0ab0f2ead1cb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000411c4f3e461cd019b5c06ea0cea4c4090c3cc3e3c5d9f3c6d65b436826da9b4dbbbeb7a77e4cbfda207097c43423705f72c80476da3dac40a483b0ab0f2ead1cb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEEcTz5GHNAZtcBuoM6kxAkMPMPjxdnzxt\nZbQ2gm2ptNu763p35Mv9ogcJfENCNwX3LIBHbaPaxApIOwqw8urRyw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 385, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220745d294978007302033502e1acc48b63ae6500be43adbea1b258d6b423dbb416", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e2e18682d53123aa01a6c5d00b0c623d671b462ea80bddd65227fd5105988aa4161907b3fd25044a949ea41c8e2ea8459dc6f1654856b8b61b31543bb1b45bdb", + "wx" : "00e2e18682d53123aa01a6c5d00b0c623d671b462ea80bddd65227fd5105988aa4", + "wy" : "161907b3fd25044a949ea41c8e2ea8459dc6f1654856b8b61b31543bb1b45bdb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e2e18682d53123aa01a6c5d00b0c623d671b462ea80bddd65227fd5105988aa4161907b3fd25044a949ea41c8e2ea8459dc6f1654856b8b61b31543bb1b45bdb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE4uGGgtUxI6oBpsXQCwxiPWcbRi6oC93W\nUif9UQWYiqQWGQez/SUESpSepByOLqhFncbxZUhWuLYbMVQ7sbRb2w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 386, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102207b2a785e3896f59b2d69da57648e80ad3c133a750a2847fd2098ccd902042b6c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0490f8d4ca73de08a6564aaf005247b6f0ffe978504dce52605f46b7c3e56197dafadbe528eb70d9ee7ea0e70702db54f721514c7b8604ac2cb214f1decb7e383d", + "wx" : "0090f8d4ca73de08a6564aaf005247b6f0ffe978504dce52605f46b7c3e56197da", + "wy" : "00fadbe528eb70d9ee7ea0e70702db54f721514c7b8604ac2cb214f1decb7e383d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000490f8d4ca73de08a6564aaf005247b6f0ffe978504dce52605f46b7c3e56197dafadbe528eb70d9ee7ea0e70702db54f721514c7b8604ac2cb214f1decb7e383d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEkPjUynPeCKZWSq8AUke28P/peFBNzlJg\nX0a3w+Vhl9r62+Uo63DZ7n6g5wcC21T3IVFMe4YErCyyFPHey344PQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 387, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022071ae94a72ca896875e7aa4a4c3d29afdb4b35b6996273e63c47ac519256c5eb1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04824c195c73cffdf038d101bce1687b5c3b6146f395c885976f7753b2376b948e3cdefa6fc347d13e4dcbc63a0b03a165180cd2be1431a0cf74ce1ea25082d2bc", + "wx" : "00824c195c73cffdf038d101bce1687b5c3b6146f395c885976f7753b2376b948e", + "wy" : "3cdefa6fc347d13e4dcbc63a0b03a165180cd2be1431a0cf74ce1ea25082d2bc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004824c195c73cffdf038d101bce1687b5c3b6146f395c885976f7753b2376b948e3cdefa6fc347d13e4dcbc63a0b03a165180cd2be1431a0cf74ce1ea25082d2bc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEgkwZXHPP/fA40QG84Wh7XDthRvOVyIWX\nb3dTsjdrlI483vpvw0fRPk3LxjoLA6FlGAzSvhQxoM90zh6iUILSvA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 388, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102200fa527fa7343c0bc9ec35a6278bfbff4d83301b154fc4bd14aee7eb93445b5f9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042788a52f078eb3f202c4fa73e0d3386faf3df6be856003636f599922d4f5268f30b4f207c919bbdf5e67a8be4265a8174754b3aba8f16e575b77ff4d5a7eb64f", + "wx" : "2788a52f078eb3f202c4fa73e0d3386faf3df6be856003636f599922d4f5268f", + "wy" : "30b4f207c919bbdf5e67a8be4265a8174754b3aba8f16e575b77ff4d5a7eb64f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042788a52f078eb3f202c4fa73e0d3386faf3df6be856003636f599922d4f5268f30b4f207c919bbdf5e67a8be4265a8174754b3aba8f16e575b77ff4d5a7eb64f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJ4ilLweOs/ICxPpz4NM4b6899r6FYANj\nb1mZItT1Jo8wtPIHyRm7315nqL5CZagXR1Szq6jxbldbd/9NWn62Tw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 389, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102206539c0adadd0525ff42622164ce9314348bd0863b4c80e936b23ca0414264671", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d533b789a4af890fa7a82a1fae58c404f9a62a50b49adafab349c513b415087401b4171b803e76b34a9861e10f7bc289a066fd01bd29f84c987a10a5fb18c2d4", + "wx" : "00d533b789a4af890fa7a82a1fae58c404f9a62a50b49adafab349c513b4150874", + "wy" : "01b4171b803e76b34a9861e10f7bc289a066fd01bd29f84c987a10a5fb18c2d4" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d533b789a4af890fa7a82a1fae58c404f9a62a50b49adafab349c513b415087401b4171b803e76b34a9861e10f7bc289a066fd01bd29f84c987a10a5fb18c2d4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE1TO3iaSviQ+nqCofrljEBPmmKlC0mtr6\ns0nFE7QVCHQBtBcbgD52s0qYYeEPe8KJoGb9Ab0p+EyYehCl+xjC1A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 390, + "comment" : "point at infinity during verify", + "flags" : [ + "PointDuplication", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043a3150798c8af69d1e6e981f3a45402ba1d732f4be8330c5164f49e10ec555b4221bd842bc5e4d97eff37165f60e3998a424d72a450cf95ea477c78287d0343a", + "wx" : "3a3150798c8af69d1e6e981f3a45402ba1d732f4be8330c5164f49e10ec555b4", + "wy" : "221bd842bc5e4d97eff37165f60e3998a424d72a450cf95ea477c78287d0343a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043a3150798c8af69d1e6e981f3a45402ba1d732f4be8330c5164f49e10ec555b4221bd842bc5e4d97eff37165f60e3998a424d72a450cf95ea477c78287d0343a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEOjFQeYyK9p0ebpgfOkVAK6HXMvS+gzDF\nFk9J4Q7FVbQiG9hCvF5Nl+/zcWX2DjmYpCTXKkUM+V6kd8eCh9A0Og==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 391, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043b37df5fb347c69a0f17d85c0c7ca83736883a825e13143d0fcfc8101e851e800de3c090b6ca21ba543517330c04b12f948c6badf14a63abffdf4ef8c7537026", + "wx" : "3b37df5fb347c69a0f17d85c0c7ca83736883a825e13143d0fcfc8101e851e80", + "wy" : "0de3c090b6ca21ba543517330c04b12f948c6badf14a63abffdf4ef8c7537026" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043b37df5fb347c69a0f17d85c0c7ca83736883a825e13143d0fcfc8101e851e800de3c090b6ca21ba543517330c04b12f948c6badf14a63abffdf4ef8c7537026", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEOzffX7NHxpoPF9hcDHyoNzaIOoJeExQ9\nD8/IEB6FHoAN48CQtsohulQ1FzMMBLEvlIxrrfFKY6v/3074x1NwJg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 392, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04feb5163b0ece30ff3e03c7d55c4380fa2fa81ee2c0354942ff6f08c99d0cd82ce87de05ee1bda089d3e4e248fa0f721102acfffdf50e654be281433999df897e", + "wx" : "00feb5163b0ece30ff3e03c7d55c4380fa2fa81ee2c0354942ff6f08c99d0cd82c", + "wy" : "00e87de05ee1bda089d3e4e248fa0f721102acfffdf50e654be281433999df897e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004feb5163b0ece30ff3e03c7d55c4380fa2fa81ee2c0354942ff6f08c99d0cd82ce87de05ee1bda089d3e4e248fa0f721102acfffdf50e654be281433999df897e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE/rUWOw7OMP8+A8fVXEOA+i+oHuLANUlC\n/28IyZ0M2CzofeBe4b2gidPk4kj6D3IRAqz//fUOZUvigUM5md+Jfg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 393, + "comment" : "u1 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04238ced001cf22b8853e02edc89cbeca5050ba7e042a7a77f9382cd414922897640683d3094643840f295890aa4c18aa39b41d77dd0fb3bb2700e4f9ec284ffc2", + "wx" : "238ced001cf22b8853e02edc89cbeca5050ba7e042a7a77f9382cd4149228976", + "wy" : "40683d3094643840f295890aa4c18aa39b41d77dd0fb3bb2700e4f9ec284ffc2" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004238ced001cf22b8853e02edc89cbeca5050ba7e042a7a77f9382cd414922897640683d3094643840f295890aa4c18aa39b41d77dd0fb3bb2700e4f9ec284ffc2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEI4ztABzyK4hT4C7cicvspQULp+BCp6d/\nk4LNQUkiiXZAaD0wlGQ4QPKViQqkwYqjm0HXfdD7O7JwDk+ewoT/wg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 394, + "comment" : "u1 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022044a5ad0bd0636d9e12bc9e0a6bdd5e1bba77f523842193b3b82e448e05d5f11e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04961cf64817c06c0e51b3c2736c922fde18bd8c4906fcd7f5ef66c4678508f35ed2c5d18168cfbe70f2f123bd7419232bb92dd69113e2941061889481c5a027bf", + "wx" : "00961cf64817c06c0e51b3c2736c922fde18bd8c4906fcd7f5ef66c4678508f35e", + "wy" : "00d2c5d18168cfbe70f2f123bd7419232bb92dd69113e2941061889481c5a027bf" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004961cf64817c06c0e51b3c2736c922fde18bd8c4906fcd7f5ef66c4678508f35ed2c5d18168cfbe70f2f123bd7419232bb92dd69113e2941061889481c5a027bf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAElhz2SBfAbA5Rs8JzbJIv3hi9jEkG/Nf1\n72bEZ4UI817SxdGBaM++cPLxI710GSMruS3WkRPilBBhiJSBxaAnvw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 395, + "comment" : "u2 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0413681eae168cd4ea7cf2e2a45d052742d10a9f64e796867dbdcb829fe0b1028816528760d177376c09df79de39557c329cc1753517acffe8fa2ec298026b8384", + "wx" : "13681eae168cd4ea7cf2e2a45d052742d10a9f64e796867dbdcb829fe0b10288", + "wy" : "16528760d177376c09df79de39557c329cc1753517acffe8fa2ec298026b8384" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000413681eae168cd4ea7cf2e2a45d052742d10a9f64e796867dbdcb829fe0b1028816528760d177376c09df79de39557c329cc1753517acffe8fa2ec298026b8384", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEE2gerhaM1Op88uKkXQUnQtEKn2TnloZ9\nvcuCn+CxAogWUodg0Xc3bAnfed45VXwynMF1NRes/+j6LsKYAmuDhA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 396, + "comment" : "u2 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0242b89", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "045aa7abfdb6b4086d543325e5d79c6e95ce42f866d2bb84909633a04bb1aa31c291c80088794905e1da33336d874e2f91ccf45cc59185bede5dd6f3f7acaae18b", + "wx" : "5aa7abfdb6b4086d543325e5d79c6e95ce42f866d2bb84909633a04bb1aa31c2", + "wy" : "0091c80088794905e1da33336d874e2f91ccf45cc59185bede5dd6f3f7acaae18b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200045aa7abfdb6b4086d543325e5d79c6e95ce42f866d2bb84909633a04bb1aa31c291c80088794905e1da33336d874e2f91ccf45cc59185bede5dd6f3f7acaae18b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEWqer/ba0CG1UMyXl15xulc5C+GbSu4SQ\nljOgS7GqMcKRyACIeUkF4dozM22HTi+RzPRcxZGFvt5d1vP3rKrhiw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 397, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100e91e1ba6ba898620a46bcb51dc0b8b4ad1dc35dad892c4552d1847b2ce444637", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0400277791b305a45b2b39590b2f05d3392a6c8182cef4eb540120e0f5c206c3e464108233fb0b8c3ac892d79ef8e0fbf92ed133addb4554270132584dc52eef41", + "wx" : "277791b305a45b2b39590b2f05d3392a6c8182cef4eb540120e0f5c206c3e4", + "wy" : "64108233fb0b8c3ac892d79ef8e0fbf92ed133addb4554270132584dc52eef41" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000400277791b305a45b2b39590b2f05d3392a6c8182cef4eb540120e0f5c206c3e464108233fb0b8c3ac892d79ef8e0fbf92ed133addb4554270132584dc52eef41", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEACd3kbMFpFsrOVkLLwXTOSpsgYLO9OtU\nASDg9cIGw+RkEIIz+wuMOsiS15744Pv5LtEzrdtFVCcBMlhNxS7vQQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 398, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100e36bf0cec06d9b841da81332812f74f30bbaec9f202319206c6f0b8a0a400ff7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046efa092b68de9460f0bcc919005a5f6e80e19de98968be3cd2c770a9949bfb1ac75e6e5087d6550d5f9beb1e79e5029307bc255235e2d5dc99241ac3ab886c49", + "wx" : "6efa092b68de9460f0bcc919005a5f6e80e19de98968be3cd2c770a9949bfb1a", + "wy" : "00c75e6e5087d6550d5f9beb1e79e5029307bc255235e2d5dc99241ac3ab886c49" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046efa092b68de9460f0bcc919005a5f6e80e19de98968be3cd2c770a9949bfb1ac75e6e5087d6550d5f9beb1e79e5029307bc255235e2d5dc99241ac3ab886c49", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbvoJK2jelGDwvMkZAFpfboDhnemJaL48\n0sdwqZSb+xrHXm5Qh9ZVDV+b6x555QKTB7wlUjXi1dyZJBrDq4hsSQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 399, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100ea26b57af884b6c06e348efe139c1e4e9ec9518d60c340f6bac7d278ca08d8a6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0472d4a19c4f9d2cf5848ea40445b70d4696b5f02d632c0c654cc7d7eeb0c6d058e8c4cd9943e459174c7ac01fa742198e47e6c19a6bdb0c4f6c237831c1b3f942", + "wx" : "72d4a19c4f9d2cf5848ea40445b70d4696b5f02d632c0c654cc7d7eeb0c6d058", + "wy" : "00e8c4cd9943e459174c7ac01fa742198e47e6c19a6bdb0c4f6c237831c1b3f942" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000472d4a19c4f9d2cf5848ea40445b70d4696b5f02d632c0c654cc7d7eeb0c6d058e8c4cd9943e459174c7ac01fa742198e47e6c19a6bdb0c4f6c237831c1b3f942", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEctShnE+dLPWEjqQERbcNRpa18C1jLAxl\nTMfX7rDG0FjoxM2ZQ+RZF0x6wB+nQhmOR+bBmmvbDE9sI3gxwbP5Qg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 400, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02205b1d27a7694c146244a5ad0bd0636d9d9ef3b9fb58385418d9c982105077d1b7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042a8ea2f50dcced0c217575bdfa7cd47d1c6f100041ec0e35512794c1be7e740258f8c17122ed303fda7143eb58bede70295b653266013b0b0ebd3f053137f6ec", + "wx" : "2a8ea2f50dcced0c217575bdfa7cd47d1c6f100041ec0e35512794c1be7e7402", + "wy" : "58f8c17122ed303fda7143eb58bede70295b653266013b0b0ebd3f053137f6ec" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042a8ea2f50dcced0c217575bdfa7cd47d1c6f100041ec0e35512794c1be7e740258f8c17122ed303fda7143eb58bede70295b653266013b0b0ebd3f053137f6ec", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEKo6i9Q3M7QwhdXW9+nzUfRxvEABB7A41\nUSeUwb5+dAJY+MFxIu0wP9pxQ+tYvt5wKVtlMmYBOwsOvT8FMTf27A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 401, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100d27a7694c146244a5ad0bd0636d9e12abe687897e8e9998ddbd4e59a78520d0f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0488de689ce9af1e94be6a2089c8a8b1253ffdbb6c8e9c86249ba220001a4ad3b80c4998e54842f413b9edb1825acbb6335e81e4d184b2b01c8bebdc85d1f28946", + "wx" : "0088de689ce9af1e94be6a2089c8a8b1253ffdbb6c8e9c86249ba220001a4ad3b8", + "wy" : "0c4998e54842f413b9edb1825acbb6335e81e4d184b2b01c8bebdc85d1f28946" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000488de689ce9af1e94be6a2089c8a8b1253ffdbb6c8e9c86249ba220001a4ad3b80c4998e54842f413b9edb1825acbb6335e81e4d184b2b01c8bebdc85d1f28946", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEiN5onOmvHpS+aiCJyKixJT/9u2yOnIYk\nm6IgABpK07gMSZjlSEL0E7ntsYJay7YzXoHk0YSysByL69yF0fKJRg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 402, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100a4f4ed29828c4894b5a17a0c6db3c256c2221449228a92dff7d76ca8206dd8dd", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04fea2d31f70f90d5fb3e00e186ac42ab3c1615cee714e0b4e1131b3d4d8225bf7b037a18df2ac15343f30f74067ddf29e817d5f77f8dce05714da59c094f0cda9", + "wx" : "00fea2d31f70f90d5fb3e00e186ac42ab3c1615cee714e0b4e1131b3d4d8225bf7", + "wy" : "00b037a18df2ac15343f30f74067ddf29e817d5f77f8dce05714da59c094f0cda9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004fea2d31f70f90d5fb3e00e186ac42ab3c1615cee714e0b4e1131b3d4d8225bf7b037a18df2ac15343f30f74067ddf29e817d5f77f8dce05714da59c094f0cda9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE/qLTH3D5DV+z4A4YasQqs8FhXO5xTgtO\nETGz1NgiW/ewN6GN8qwVND8w90Bn3fKegX1fd/jc4FcU2lnAlPDNqQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 403, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220694c146244a5ad0bd0636d9e12bc9e09e60e68b90d0b5e6c5dddd0cb694d8799", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047258911e3d423349166479dbe0b8341af7fbd03d0a7e10edccb36b6ceea5a3db17ac2b8992791128fa3b96dc2fbd4ca3bfa782ef2832fc6656943db18e7346b0", + "wx" : "7258911e3d423349166479dbe0b8341af7fbd03d0a7e10edccb36b6ceea5a3db", + "wy" : "17ac2b8992791128fa3b96dc2fbd4ca3bfa782ef2832fc6656943db18e7346b0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047258911e3d423349166479dbe0b8341af7fbd03d0a7e10edccb36b6ceea5a3db17ac2b8992791128fa3b96dc2fbd4ca3bfa782ef2832fc6656943db18e7346b0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEcliRHj1CM0kWZHnb4Lg0Gvf70D0KfhDt\nzLNrbO6lo9sXrCuJknkRKPo7ltwvvUyjv6eC7ygy/GZWlD2xjnNGsA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 404, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02203d7f487c07bfc5f30846938a3dcef696444707cf9677254a92b06c63ab867d22", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044f28461dea64474d6bb34d1499c97d37b9e95633df1ceeeaacd45016c98b3914c8818810b8cc06ddb40e8a1261c528faa589455d5a6df93b77bc5e0e493c7470", + "wx" : "4f28461dea64474d6bb34d1499c97d37b9e95633df1ceeeaacd45016c98b3914", + "wy" : "00c8818810b8cc06ddb40e8a1261c528faa589455d5a6df93b77bc5e0e493c7470" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044f28461dea64474d6bb34d1499c97d37b9e95633df1ceeeaacd45016c98b3914c8818810b8cc06ddb40e8a1261c528faa589455d5a6df93b77bc5e0e493c7470", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAETyhGHepkR01rs00Umcl9N7npVjPfHO7q\nrNRQFsmLORTIgYgQuMwG3bQOihJhxSj6pYlFXVpt+Tt3vF4OSTx0cA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 405, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02206c7648fc0fbf8a06adb8b839f97b4ff7a800f11b1e37c593b261394599792ba4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0474f2a814fb5d8eca91a69b5e60712732b3937de32829be974ed7b68c5c2f5d66eff0f07c56f987a657f42196205f588c0f1d96fd8a63a5f238b48f478788fe3b", + "wx" : "74f2a814fb5d8eca91a69b5e60712732b3937de32829be974ed7b68c5c2f5d66", + "wy" : "00eff0f07c56f987a657f42196205f588c0f1d96fd8a63a5f238b48f478788fe3b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000474f2a814fb5d8eca91a69b5e60712732b3937de32829be974ed7b68c5c2f5d66eff0f07c56f987a657f42196205f588c0f1d96fd8a63a5f238b48f478788fe3b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEdPKoFPtdjsqRppteYHEnMrOTfeMoKb6X\nTte2jFwvXWbv8PB8VvmHplf0IZYgX1iMDx2W/YpjpfI4tI9Hh4j+Ow==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 406, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0221009be363a286f23f6322c205449d320baad417953ecb70f6214e90d49d7d1f26a8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04195b51a7cc4a21b8274a70a90de779814c3c8ca358328208c09a29f336b82d6ab2416b7c92fffdc29c3b1282dd2a77a4d04df7f7452047393d849989c5cee9ad", + "wx" : "195b51a7cc4a21b8274a70a90de779814c3c8ca358328208c09a29f336b82d6a", + "wy" : "00b2416b7c92fffdc29c3b1282dd2a77a4d04df7f7452047393d849989c5cee9ad" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004195b51a7cc4a21b8274a70a90de779814c3c8ca358328208c09a29f336b82d6ab2416b7c92fffdc29c3b1282dd2a77a4d04df7f7452047393d849989c5cee9ad", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGVtRp8xKIbgnSnCpDed5gUw8jKNYMoII\nwJop8za4LWqyQWt8kv/9wpw7EoLdKnek0E3390UgRzk9hJmJxc7prQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 407, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022029798c5c45bdf58b4a7b2fdc2c46ab4af1218c7eeb9f0f27a88f1267674de3b0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04622fc74732034bec2ddf3bc16d34b3d1f7a327dd2a8c19bab4bb4fe3a24b58aa736b2f2fae76f4dfaecc9096333b01328d51eb3fda9c9227e90d0b449983c4f0", + "wx" : "622fc74732034bec2ddf3bc16d34b3d1f7a327dd2a8c19bab4bb4fe3a24b58aa", + "wy" : "736b2f2fae76f4dfaecc9096333b01328d51eb3fda9c9227e90d0b449983c4f0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004622fc74732034bec2ddf3bc16d34b3d1f7a327dd2a8c19bab4bb4fe3a24b58aa736b2f2fae76f4dfaecc9096333b01328d51eb3fda9c9227e90d0b449983c4f0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEYi/HRzIDS+wt3zvBbTSz0fejJ90qjBm6\ntLtP46JLWKpzay8vrnb0367MkJYzOwEyjVHrP9qckifpDQtEmYPE8A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 408, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02200b70f22ca2bb3cefadca1a5711fa3a59f4695385eb5aedf3495d0b6d00f8fd85", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041f7f85caf2d7550e7af9b65023ebb4dce3450311692309db269969b834b611c70827f45b78020ecbbaf484fdd5bfaae6870f1184c21581baf6ef82bd7b530f93", + "wx" : "1f7f85caf2d7550e7af9b65023ebb4dce3450311692309db269969b834b611c7", + "wy" : "0827f45b78020ecbbaf484fdd5bfaae6870f1184c21581baf6ef82bd7b530f93" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041f7f85caf2d7550e7af9b65023ebb4dce3450311692309db269969b834b611c70827f45b78020ecbbaf484fdd5bfaae6870f1184c21581baf6ef82bd7b530f93", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEH3+FyvLXVQ56+bZQI+u03ONFAxFpIwnb\nJplpuDS2EccIJ/RbeAIOy7r0hP3Vv6rmhw8RhMIVgbr274K9e1MPkw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 409, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022016e1e459457679df5b9434ae23f474b3e8d2a70bd6b5dbe692ba16da01f1fb0a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0449c197dc80ad1da47a4342b93893e8e1fb0bb94fc33a83e783c00b24c781377aefc20da92bac762951f72474becc734d4cc22ba81b895e282fdac4df7af0f37d", + "wx" : "49c197dc80ad1da47a4342b93893e8e1fb0bb94fc33a83e783c00b24c781377a", + "wy" : "00efc20da92bac762951f72474becc734d4cc22ba81b895e282fdac4df7af0f37d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000449c197dc80ad1da47a4342b93893e8e1fb0bb94fc33a83e783c00b24c781377aefc20da92bac762951f72474becc734d4cc22ba81b895e282fdac4df7af0f37d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEScGX3ICtHaR6Q0K5OJPo4fsLuU/DOoPn\ng8ALJMeBN3rvwg2pK6x2KVH3JHS+zHNNTMIrqBuJXigv2sTfevDzfQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 410, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202252d685e831b6cf095e4f0535eeaf0ddd3bfa91c210c9d9dc17224702eaf88f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d8cb68517b616a56400aa3868635e54b6f699598a2f6167757654980baf6acbe7ec8cf449c849aa03461a30efada41453c57c6e6fbc93bbc6fa49ada6dc0555c", + "wx" : "00d8cb68517b616a56400aa3868635e54b6f699598a2f6167757654980baf6acbe", + "wy" : "7ec8cf449c849aa03461a30efada41453c57c6e6fbc93bbc6fa49ada6dc0555c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d8cb68517b616a56400aa3868635e54b6f699598a2f6167757654980baf6acbe7ec8cf449c849aa03461a30efada41453c57c6e6fbc93bbc6fa49ada6dc0555c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE2MtoUXthalZACqOGhjXlS29plZii9hZ3\nV2VJgLr2rL5+yM9EnISaoDRhow762kFFPFfG5vvJO7xvpJrabcBVXA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 411, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022075135abd7c425b60371a477f09ce0f274f64a8c6b061a07b5d63e93c65046c53", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04030713fb63f2aa6fe2cadf1b20efc259c77445dafa87dac398b84065ca347df3b227818de1a39b589cb071d83e5317cccdc2338e51e312fe31d8dc34a4801750", + "wx" : "030713fb63f2aa6fe2cadf1b20efc259c77445dafa87dac398b84065ca347df3", + "wy" : "00b227818de1a39b589cb071d83e5317cccdc2338e51e312fe31d8dc34a4801750" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004030713fb63f2aa6fe2cadf1b20efc259c77445dafa87dac398b84065ca347df3b227818de1a39b589cb071d83e5317cccdc2338e51e312fe31d8dc34a4801750", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAwcT+2Pyqm/iyt8bIO/CWcd0Rdr6h9rD\nmLhAZco0ffOyJ4GN4aObWJywcdg+UxfMzcIzjlHjEv4x2Nw0pIAXUA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 412, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100d55555555555555555555555555555547c74934474db157d2a8c3f088aced62a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04babb3677b0955802d8e929a41355640eaf1ea1353f8a771331c4946e3480afa7252f196c87ed3d2a59d3b1b559137fed0013fecefc19fb5a92682b9bca51b950", + "wx" : "00babb3677b0955802d8e929a41355640eaf1ea1353f8a771331c4946e3480afa7", + "wy" : "252f196c87ed3d2a59d3b1b559137fed0013fecefc19fb5a92682b9bca51b950" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004babb3677b0955802d8e929a41355640eaf1ea1353f8a771331c4946e3480afa7252f196c87ed3d2a59d3b1b559137fed0013fecefc19fb5a92682b9bca51b950", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEurs2d7CVWALY6SmkE1VkDq8eoTU/incT\nMcSUbjSAr6clLxlsh+09KlnTsbVZE3/tABP+zvwZ+1qSaCubylG5UA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 413, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100c1777c8853938e536213c02464a936000ba1e21c0fc62075d46c624e23b52f31", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041aab2018793471111a8a0e9b143fde02fc95920796d3a63de329b424396fba60bbe4130705174792441b318d3aa31dfe8577821e9b446ec573d272e036c4ebe9", + "wx" : "1aab2018793471111a8a0e9b143fde02fc95920796d3a63de329b424396fba60", + "wy" : "00bbe4130705174792441b318d3aa31dfe8577821e9b446ec573d272e036c4ebe9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041aab2018793471111a8a0e9b143fde02fc95920796d3a63de329b424396fba60bbe4130705174792441b318d3aa31dfe8577821e9b446ec573d272e036c4ebe9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGqsgGHk0cREaig6bFD/eAvyVkgeW06Y9\n4ym0JDlvumC75BMHBRdHkkQbMY06ox3+hXeCHptEbsVz0nLgNsTr6Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 414, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022030bbb794db588363b40679f6c182a50d3ce9679acdd3ffbe36d7813dacbdc818", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048cb0b909499c83ea806cd885b1dd467a0119f06a88a0276eb0cfda274535a8ff47b5428833bc3f2c8bf9d9041158cf33718a69961cd01729bc0011d1e586ab75", + "wx" : "008cb0b909499c83ea806cd885b1dd467a0119f06a88a0276eb0cfda274535a8ff", + "wy" : "47b5428833bc3f2c8bf9d9041158cf33718a69961cd01729bc0011d1e586ab75" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048cb0b909499c83ea806cd885b1dd467a0119f06a88a0276eb0cfda274535a8ff47b5428833bc3f2c8bf9d9041158cf33718a69961cd01729bc0011d1e586ab75", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEjLC5CUmcg+qAbNiFsd1GegEZ8GqIoCdu\nsM/aJ0U1qP9HtUKIM7w/LIv52QQRWM8zcYpplhzQFym8ABHR5YardQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 415, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202c37fd995622c4fb7fffffffffffffffc7cee745110cb45ab558ed7c90c15a2f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048f03cf1a42272bb1532723093f72e6feeac85e1700e9fbe9a6a2dd642d74bf5d3b89a7189dad8cf75fc22f6f158aa27f9c2ca00daca785be3358f2bda3862ca0", + "wx" : "008f03cf1a42272bb1532723093f72e6feeac85e1700e9fbe9a6a2dd642d74bf5d", + "wy" : "3b89a7189dad8cf75fc22f6f158aa27f9c2ca00daca785be3358f2bda3862ca0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048f03cf1a42272bb1532723093f72e6feeac85e1700e9fbe9a6a2dd642d74bf5d3b89a7189dad8cf75fc22f6f158aa27f9c2ca00daca785be3358f2bda3862ca0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEjwPPGkInK7FTJyMJP3Lm/urIXhcA6fvp\npqLdZC10v107iacYna2M91/CL28ViqJ/nCygDaynhb4zWPK9o4YsoA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 416, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02207fd995622c4fb7ffffffffffffffffff5d883ffab5b32652ccdcaa290fccb97d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0444de3b9c7a57a8c9e820952753421e7d987bb3d79f71f013805c897e018f8acea2460758c8f98d3fdce121a943659e372c326fff2e5fc2ae7fa3f79daae13c12", + "wx" : "44de3b9c7a57a8c9e820952753421e7d987bb3d79f71f013805c897e018f8ace", + "wy" : "00a2460758c8f98d3fdce121a943659e372c326fff2e5fc2ae7fa3f79daae13c12" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000444de3b9c7a57a8c9e820952753421e7d987bb3d79f71f013805c897e018f8acea2460758c8f98d3fdce121a943659e372c326fff2e5fc2ae7fa3f79daae13c12", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAERN47nHpXqMnoIJUnU0IefZh7s9efcfAT\ngFyJfgGPis6iRgdYyPmNP9zhIalDZZ43LDJv/y5fwq5/o/edquE8Eg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 417, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100ffb32ac4589f6ffffffffffffffffffebb107ff56b664ca599b954521f9972fa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046fb8b2b48e33031268ad6a517484dc8839ea90f6669ea0c7ac3233e2ac31394a0ac8bbe7f73c2ff4df9978727ac1dfc2fd58647d20f31f99105316b64671f204", + "wx" : "6fb8b2b48e33031268ad6a517484dc8839ea90f6669ea0c7ac3233e2ac31394a", + "wy" : "0ac8bbe7f73c2ff4df9978727ac1dfc2fd58647d20f31f99105316b64671f204" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046fb8b2b48e33031268ad6a517484dc8839ea90f6669ea0c7ac3233e2ac31394a0ac8bbe7f73c2ff4df9978727ac1dfc2fd58647d20f31f99105316b64671f204", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEb7iytI4zAxJorWpRdITciDnqkPZmnqDH\nrDIz4qwxOUoKyLvn9zwv9N+ZeHJ6wd/C/VhkfSDzH5kQUxa2RnHyBA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 418, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02205622c4fb7fffffffffffffffffffffff928a8f1c7ac7bec1808b9f61c01ec327", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04bea71122a048693e905ff602b3cf9dd18af69b9fc9d8431d2b1dd26b942c95e6f43c7b8b95eb62082c12db9dbda7fe38e45cbe4a4886907fb81bdb0c5ea9246c", + "wx" : "00bea71122a048693e905ff602b3cf9dd18af69b9fc9d8431d2b1dd26b942c95e6", + "wy" : "00f43c7b8b95eb62082c12db9dbda7fe38e45cbe4a4886907fb81bdb0c5ea9246c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004bea71122a048693e905ff602b3cf9dd18af69b9fc9d8431d2b1dd26b942c95e6f43c7b8b95eb62082c12db9dbda7fe38e45cbe4a4886907fb81bdb0c5ea9246c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEvqcRIqBIaT6QX/YCs8+d0Yr2m5/J2EMd\nKx3Sa5Qsleb0PHuLletiCCwS2529p/445Fy+SkiGkH+4G9sMXqkkbA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 419, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022044104104104104104104104104104103b87853fd3b7d3f8e175125b4382f25ed", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04da918c731ba06a20cb94ef33b778e981a404a305f1941fe33666b45b03353156e2bb2694f575b45183be78e5c9b5210bf3bf488fd4c8294516d89572ca4f5391", + "wx" : "00da918c731ba06a20cb94ef33b778e981a404a305f1941fe33666b45b03353156", + "wy" : "00e2bb2694f575b45183be78e5c9b5210bf3bf488fd4c8294516d89572ca4f5391" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004da918c731ba06a20cb94ef33b778e981a404a305f1941fe33666b45b03353156e2bb2694f575b45183be78e5c9b5210bf3bf488fd4c8294516d89572ca4f5391", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE2pGMcxugaiDLlO8zt3jpgaQEowXxlB/j\nNma0WwM1MVbiuyaU9XW0UYO+eOXJtSEL879Ij9TIKUUW2JVyyk9TkQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 420, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202739ce739ce739ce739ce739ce739ce705560298d1f2f08dc419ac273a5b54d9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043007e92c3937dade7964dfa35b0eff031f7eb02aed0a0314411106cdeb70fe3d5a7546fc0552997b20e3d6f413e75e2cb66e116322697114b79bac734bfc4dc5", + "wx" : "3007e92c3937dade7964dfa35b0eff031f7eb02aed0a0314411106cdeb70fe3d", + "wy" : "5a7546fc0552997b20e3d6f413e75e2cb66e116322697114b79bac734bfc4dc5" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043007e92c3937dade7964dfa35b0eff031f7eb02aed0a0314411106cdeb70fe3d5a7546fc0552997b20e3d6f413e75e2cb66e116322697114b79bac734bfc4dc5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEMAfpLDk32t55ZN+jWw7/Ax9+sCrtCgMU\nQREGzetw/j1adUb8BVKZeyDj1vQT514stm4RYyJpcRS3m6xzS/xNxQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 421, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100b777777777777777777777777777777688e6a1fe808a97a348671222ff16b863", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0460e734ef5624d3cbf0ddd375011bd663d6d6aebc644eb599fdf98dbdcd18ce9bd2d90b3ac31f139af832cccf6ccbbb2c6ea11fa97370dc9906da474d7d8a7567", + "wx" : "60e734ef5624d3cbf0ddd375011bd663d6d6aebc644eb599fdf98dbdcd18ce9b", + "wy" : "00d2d90b3ac31f139af832cccf6ccbbb2c6ea11fa97370dc9906da474d7d8a7567" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000460e734ef5624d3cbf0ddd375011bd663d6d6aebc644eb599fdf98dbdcd18ce9bd2d90b3ac31f139af832cccf6ccbbb2c6ea11fa97370dc9906da474d7d8a7567", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEYOc071Yk08vw3dN1ARvWY9bWrrxkTrWZ\n/fmNvc0YzpvS2Qs6wx8TmvgyzM9sy7ssbqEfqXNw3JkG2kdNfYp1Zw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 422, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02206492492492492492492492492492492406dd3a19b8d5fb875235963c593bd2d3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0485a900e97858f693c0b7dfa261e380dad6ea046d1f65ddeeedd5f7d8af0ba33769744d15add4f6c0bc3b0da2aec93b34cb8c65f9340ddf74e7b0009eeeccce3c", + "wx" : "0085a900e97858f693c0b7dfa261e380dad6ea046d1f65ddeeedd5f7d8af0ba337", + "wy" : "69744d15add4f6c0bc3b0da2aec93b34cb8c65f9340ddf74e7b0009eeeccce3c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000485a900e97858f693c0b7dfa261e380dad6ea046d1f65ddeeedd5f7d8af0ba33769744d15add4f6c0bc3b0da2aec93b34cb8c65f9340ddf74e7b0009eeeccce3c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEhakA6XhY9pPAt9+iYeOA2tbqBG0fZd3u\n7dX32K8LozdpdE0VrdT2wLw7DaKuyTs0y4xl+TQN33TnsACe7szOPA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 423, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100955555555555555555555555555555547c74934474db157d2a8c3f088aced62c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0438066f75d88efc4c93de36f49e037b234cc18b1de5608750a62cab0345401046a3e84bed8cfcb819ef4d550444f2ce4b651766b69e2e2901f88836ff90034fed", + "wx" : "38066f75d88efc4c93de36f49e037b234cc18b1de5608750a62cab0345401046", + "wy" : "00a3e84bed8cfcb819ef4d550444f2ce4b651766b69e2e2901f88836ff90034fed" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000438066f75d88efc4c93de36f49e037b234cc18b1de5608750a62cab0345401046a3e84bed8cfcb819ef4d550444f2ce4b651766b69e2e2901f88836ff90034fed", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEOAZvddiO/EyT3jb0ngN7I0zBix3lYIdQ\npiyrA0VAEEaj6EvtjPy4Ge9NVQRE8s5LZRdmtp4uKQH4iDb/kANP7Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 424, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3e3a49a23a6d8abe95461f8445676b17", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0498f68177dc95c1b4cbfa5245488ca523a7d5629470d035d621a443c72f39aabfa33d29546fa1c648f2c7d5ccf70cf1ce4ab79b5db1ac059dbecd068dbdff1b89", + "wx" : "0098f68177dc95c1b4cbfa5245488ca523a7d5629470d035d621a443c72f39aabf", + "wy" : "00a33d29546fa1c648f2c7d5ccf70cf1ce4ab79b5db1ac059dbecd068dbdff1b89" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000498f68177dc95c1b4cbfa5245488ca523a7d5629470d035d621a443c72f39aabfa33d29546fa1c648f2c7d5ccf70cf1ce4ab79b5db1ac059dbecd068dbdff1b89", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEmPaBd9yVwbTL+lJFSIylI6fVYpRw0DXW\nIaRDxy85qr+jPSlUb6HGSPLH1cz3DPHOSrebXbGsBZ2+zQaNvf8biQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 425, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100bffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364143", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "045c2bbfa23c9b9ad07f038aa89b4930bf267d9401e4255de9e8da0a5078ec8277e3e882a31d5e6a379e0793983ccded39b95c4353ab2ff01ea5369ba47b0c3191", + "wx" : "5c2bbfa23c9b9ad07f038aa89b4930bf267d9401e4255de9e8da0a5078ec8277", + "wy" : "00e3e882a31d5e6a379e0793983ccded39b95c4353ab2ff01ea5369ba47b0c3191" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200045c2bbfa23c9b9ad07f038aa89b4930bf267d9401e4255de9e8da0a5078ec8277e3e882a31d5e6a379e0793983ccded39b95c4353ab2ff01ea5369ba47b0c3191", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEXCu/ojybmtB/A4qom0kwvyZ9lAHkJV3p\n6NoKUHjsgnfj6IKjHV5qN54Hk5g8ze05uVxDU6sv8B6lNpukewwxkQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 426, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220185ddbca6dac41b1da033cfb60c152869e74b3cd66e9ffdf1b6bc09ed65ee40c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042ea7133432339c69d27f9b267281bd2ddd5f19d6338d400a05cd3647b157a3853547808298448edb5e701ade84cd5fb1ac9567ba5e8fb68a6b933ec4b5cc84cc", + "wx" : "2ea7133432339c69d27f9b267281bd2ddd5f19d6338d400a05cd3647b157a385", + "wy" : "3547808298448edb5e701ade84cd5fb1ac9567ba5e8fb68a6b933ec4b5cc84cc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042ea7133432339c69d27f9b267281bd2ddd5f19d6338d400a05cd3647b157a3853547808298448edb5e701ade84cd5fb1ac9567ba5e8fb68a6b933ec4b5cc84cc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAELqcTNDIznGnSf5smcoG9Ld1fGdYzjUAK\nBc02R7FXo4U1R4CCmESO215wGt6EzV+xrJVnul6Ptoprkz7EtcyEzA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 427, + "comment" : "point duplication during verification", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022032b0d10d8d0e04bc8d4d064d270699e87cffc9b49c5c20730e1c26f6105ddcda022100d612c2984c2afa416aa7f2882a486d4a8426cb6cfc91ed5b737278f9fca8be68", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042ea7133432339c69d27f9b267281bd2ddd5f19d6338d400a05cd3647b157a385cab87f7d67bb7124a18fe5217b32a04e536a9845a1704975946cc13a4a337763", + "wx" : "2ea7133432339c69d27f9b267281bd2ddd5f19d6338d400a05cd3647b157a385", + "wy" : "00cab87f7d67bb7124a18fe5217b32a04e536a9845a1704975946cc13a4a337763" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042ea7133432339c69d27f9b267281bd2ddd5f19d6338d400a05cd3647b157a385cab87f7d67bb7124a18fe5217b32a04e536a9845a1704975946cc13a4a337763", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAELqcTNDIznGnSf5smcoG9Ld1fGdYzjUAK\nBc02R7FXo4XKuH99Z7txJKGP5SF7MqBOU2qYRaFwSXWUbME6SjN3Yw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 428, + "comment" : "duplication bug", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022032b0d10d8d0e04bc8d4d064d270699e87cffc9b49c5c20730e1c26f6105ddcda022100d612c2984c2afa416aa7f2882a486d4a8426cb6cfc91ed5b737278f9fca8be68", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048aa2c64fa9c6437563abfbcbd00b2048d48c18c152a2a6f49036de7647ebe82e1ce64387995c68a060fa3bc0399b05cc06eec7d598f75041a4917e692b7f51ff", + "wx" : "008aa2c64fa9c6437563abfbcbd00b2048d48c18c152a2a6f49036de7647ebe82e", + "wy" : "1ce64387995c68a060fa3bc0399b05cc06eec7d598f75041a4917e692b7f51ff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048aa2c64fa9c6437563abfbcbd00b2048d48c18c152a2a6f49036de7647ebe82e1ce64387995c68a060fa3bc0399b05cc06eec7d598f75041a4917e692b7f51ff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEiqLGT6nGQ3Vjq/vL0AsgSNSMGMFSoqb0\nkDbedkfr6C4c5kOHmVxooGD6O8A5mwXMBu7H1Zj3UEGkkX5pK39R/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 429, + "comment" : "comparison with point at infinity ", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0022033333333333333333333333333333332f222f8faefdb533f265d461c29a47373", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04391427ff7ee78013c14aec7d96a8a062209298a783835e94fd6549d502fff71fdd6624ec343ad9fcf4d9872181e59f842f9ba4cccae09a6c0972fb6ac6b4c6bd", + "wx" : "391427ff7ee78013c14aec7d96a8a062209298a783835e94fd6549d502fff71f", + "wy" : "00dd6624ec343ad9fcf4d9872181e59f842f9ba4cccae09a6c0972fb6ac6b4c6bd" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004391427ff7ee78013c14aec7d96a8a062209298a783835e94fd6549d502fff71fdd6624ec343ad9fcf4d9872181e59f842f9ba4cccae09a6c0972fb6ac6b4c6bd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEORQn/37ngBPBSux9lqigYiCSmKeDg16U\n/WVJ1QL/9x/dZiTsNDrZ/PTZhyGB5Z+EL5ukzMrgmmwJcvtqxrTGvQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 430, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e762b8a219b4f180219cc7a9059245e4961bd191c03899789c7a34b89e8c138ec1533ef0419bb7376e0bfde9319d10a06968791d9ea0eed9c1ce6345aed9759e", + "wx" : "00e762b8a219b4f180219cc7a9059245e4961bd191c03899789c7a34b89e8c138e", + "wy" : "00c1533ef0419bb7376e0bfde9319d10a06968791d9ea0eed9c1ce6345aed9759e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e762b8a219b4f180219cc7a9059245e4961bd191c03899789c7a34b89e8c138ec1533ef0419bb7376e0bfde9319d10a06968791d9ea0eed9c1ce6345aed9759e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE52K4ohm08YAhnMepBZJF5JYb0ZHAOJl4\nnHo0uJ6ME47BUz7wQZu3N24L/ekxnRCgaWh5HZ6g7tnBzmNFrtl1ng==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 431, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022100b6db6db6db6db6db6db6db6db6db6db5f30f30127d33e02aad96438927022e9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049aedb0d281db164e130000c5697fae0f305ef848be6fffb43ac593fbb950e952fa6f633359bdcd82b56b0b9f965b037789d46b9a8141b791b2aefa713f96c175", + "wx" : "009aedb0d281db164e130000c5697fae0f305ef848be6fffb43ac593fbb950e952", + "wy" : "00fa6f633359bdcd82b56b0b9f965b037789d46b9a8141b791b2aefa713f96c175" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049aedb0d281db164e130000c5697fae0f305ef848be6fffb43ac593fbb950e952fa6f633359bdcd82b56b0b9f965b037789d46b9a8141b791b2aefa713f96c175", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEmu2w0oHbFk4TAADFaX+uDzBe+Ei+b/+0\nOsWT+7lQ6VL6b2MzWb3NgrVrC5+WWwN3idRrmoFBt5GyrvpxP5bBdQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 432, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee502210099999999999999999999999999999998d668eaf0cf91f9bd7317d2547ced5a5a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048ad445db62816260e4e687fd1884e48b9fc0636d031547d63315e792e19bfaee1de64f99d5f1cd8b6ec9cb0f787a654ae86993ba3db1008ef43cff0684cb22bd", + "wx" : "008ad445db62816260e4e687fd1884e48b9fc0636d031547d63315e792e19bfaee", + "wy" : "1de64f99d5f1cd8b6ec9cb0f787a654ae86993ba3db1008ef43cff0684cb22bd" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048ad445db62816260e4e687fd1884e48b9fc0636d031547d63315e792e19bfaee1de64f99d5f1cd8b6ec9cb0f787a654ae86993ba3db1008ef43cff0684cb22bd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEitRF22KBYmDk5of9GITki5/AY20DFUfW\nMxXnkuGb+u4d5k+Z1fHNi27Jyw94emVK6GmTuj2xAI70PP8GhMsivQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 433, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022066666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041f5799c95be89063b24f26e40cb928c1a868a76fb0094607e8043db409c91c32e75724e813a4191e3a839007f08e2e897388b06d4a00de6de60e536d91fab566", + "wx" : "1f5799c95be89063b24f26e40cb928c1a868a76fb0094607e8043db409c91c32", + "wy" : "00e75724e813a4191e3a839007f08e2e897388b06d4a00de6de60e536d91fab566" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041f5799c95be89063b24f26e40cb928c1a868a76fb0094607e8043db409c91c32e75724e813a4191e3a839007f08e2e897388b06d4a00de6de60e536d91fab566", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEH1eZyVvokGOyTybkDLkowahop2+wCUYH\n6AQ9tAnJHDLnVyToE6QZHjqDkAfwji6Jc4iwbUoA3m3mDlNtkfq1Zg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 434, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022049249249249249249249249249249248c79facd43214c011123c1b03a93412a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a3331a4e1b4223ec2c027edd482c928a14ed358d93f1d4217d39abf69fcb5ccc28d684d2aaabcd6383775caa6239de26d4c6937bb603ecb4196082f4cffd509d", + "wx" : "00a3331a4e1b4223ec2c027edd482c928a14ed358d93f1d4217d39abf69fcb5ccc", + "wy" : "28d684d2aaabcd6383775caa6239de26d4c6937bb603ecb4196082f4cffd509d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a3331a4e1b4223ec2c027edd482c928a14ed358d93f1d4217d39abf69fcb5ccc28d684d2aaabcd6383775caa6239de26d4c6937bb603ecb4196082f4cffd509d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEozMaThtCI+wsAn7dSCySihTtNY2T8dQh\nfTmr9p/LXMwo1oTSqqvNY4N3XKpiOd4m1MaTe7YD7LQZYIL0z/1QnQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 435, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee502200eb10e5ab95f2f275348d82ad2e4d7949c8193800d8c9c75df58e343f0ebba7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043f3952199774c7cf39b38b66cb1042a6260d8680803845e4d433adba3bb248185ea495b68cbc7ed4173ee63c9042dc502625c7eb7e21fb02ca9a9114e0a3a18d", + "wx" : "3f3952199774c7cf39b38b66cb1042a6260d8680803845e4d433adba3bb24818", + "wy" : "5ea495b68cbc7ed4173ee63c9042dc502625c7eb7e21fb02ca9a9114e0a3a18d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043f3952199774c7cf39b38b66cb1042a6260d8680803845e4d433adba3bb248185ea495b68cbc7ed4173ee63c9042dc502625c7eb7e21fb02ca9a9114e0a3a18d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEPzlSGZd0x885s4tmyxBCpiYNhoCAOEXk\n1DOtujuySBhepJW2jLx+1Bc+5jyQQtxQJiXH634h+wLKmpEU4KOhjQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 436, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04cdfb8c0f422e144e137c2412c86c171f5fe3fa3f5bbb544e9076288f3ced786e054fd0721b77c11c79beacb3c94211b0a19bda08652efeaf92513a3b0a163698", + "wx" : "00cdfb8c0f422e144e137c2412c86c171f5fe3fa3f5bbb544e9076288f3ced786e", + "wy" : "054fd0721b77c11c79beacb3c94211b0a19bda08652efeaf92513a3b0a163698" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004cdfb8c0f422e144e137c2412c86c171f5fe3fa3f5bbb544e9076288f3ced786e054fd0721b77c11c79beacb3c94211b0a19bda08652efeaf92513a3b0a163698", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEzfuMD0IuFE4TfCQSyGwXH1/j+j9bu1RO\nkHYojzzteG4FT9ByG3fBHHm+rLPJQhGwoZvaCGUu/q+SUTo7ChY2mA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 437, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022100b6db6db6db6db6db6db6db6db6db6db5f30f30127d33e02aad96438927022e9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0473598a6a1c68278fa6bfd0ce4064e68235bc1c0f6b20a928108be336730f87e3cbae612519b5032ecc85aed811271a95fe7939d5d3460140ba318f4d14aba31d", + "wx" : "73598a6a1c68278fa6bfd0ce4064e68235bc1c0f6b20a928108be336730f87e3", + "wy" : "00cbae612519b5032ecc85aed811271a95fe7939d5d3460140ba318f4d14aba31d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000473598a6a1c68278fa6bfd0ce4064e68235bc1c0f6b20a928108be336730f87e3cbae612519b5032ecc85aed811271a95fe7939d5d3460140ba318f4d14aba31d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEc1mKahxoJ4+mv9DOQGTmgjW8HA9rIKko\nEIvjNnMPh+PLrmElGbUDLsyFrtgRJxqV/nk51dNGAUC6MY9NFKujHQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 438, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802210099999999999999999999999999999998d668eaf0cf91f9bd7317d2547ced5a5a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0458debd9a7ee2c9d59132478a5440ae4d5d7ed437308369f92ea86c82183f10a16773e76f5edbf4da0e4f1bdffac0f57257e1dfa465842931309a24245fda6a5d", + "wx" : "58debd9a7ee2c9d59132478a5440ae4d5d7ed437308369f92ea86c82183f10a1", + "wy" : "6773e76f5edbf4da0e4f1bdffac0f57257e1dfa465842931309a24245fda6a5d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000458debd9a7ee2c9d59132478a5440ae4d5d7ed437308369f92ea86c82183f10a16773e76f5edbf4da0e4f1bdffac0f57257e1dfa465842931309a24245fda6a5d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEWN69mn7iydWRMkeKVECuTV1+1Dcwg2n5\nLqhsghg/EKFnc+dvXtv02g5PG9/6wPVyV+HfpGWEKTEwmiQkX9pqXQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 439, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022066666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048b904de47967340c5f8c3572a720924ef7578637feab1949acb241a5a6ac3f5b950904496f9824b1d63f3313bae21b89fae89afdfc811b5ece03fd5aa301864f", + "wx" : "008b904de47967340c5f8c3572a720924ef7578637feab1949acb241a5a6ac3f5b", + "wy" : "00950904496f9824b1d63f3313bae21b89fae89afdfc811b5ece03fd5aa301864f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048b904de47967340c5f8c3572a720924ef7578637feab1949acb241a5a6ac3f5b950904496f9824b1d63f3313bae21b89fae89afdfc811b5ece03fd5aa301864f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEi5BN5HlnNAxfjDVypyCSTvdXhjf+qxlJ\nrLJBpaasP1uVCQRJb5gksdY/MxO64huJ+uia/fyBG17OA/1aowGGTw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 440, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022049249249249249249249249249249248c79facd43214c011123c1b03a93412a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f4892b6d525c771e035f2a252708f3784e48238604b4f94dc56eaa1e546d941a346b1aa0bce68b1c50e5b52f509fb5522e5c25e028bc8f863402edb7bcad8b1b", + "wx" : "00f4892b6d525c771e035f2a252708f3784e48238604b4f94dc56eaa1e546d941a", + "wy" : "346b1aa0bce68b1c50e5b52f509fb5522e5c25e028bc8f863402edb7bcad8b1b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f4892b6d525c771e035f2a252708f3784e48238604b4f94dc56eaa1e546d941a346b1aa0bce68b1c50e5b52f509fb5522e5c25e028bc8f863402edb7bcad8b1b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE9IkrbVJcdx4DXyolJwjzeE5II4YEtPlN\nxW6qHlRtlBo0axqgvOaLHFDltS9Qn7VSLlwl4Ci8j4Y0Au23vK2LGw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 441, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802200eb10e5ab95f2f275348d82ad2e4d7949c8193800d8c9c75df58e343f0ebba7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + "wx" : "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "wy" : "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeb5mfvncu6xVoGKVzocLBwKb/NstzijZ\nWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 442, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca60502302202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + }, + { + "tcId" : 443, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022044a5ad0bd0636d9e12bc9e0a6bdd5e1bba77f523842193b3b82e448e05d5f11e02202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777", + "wx" : "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "wy" : "00b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeb5mfvncu6xVoGKVzocLBwKb/NstzijZ\nWfKBWxb4F5i3xSWI2Vw7mqJbBAPx7vdXAuhLt1l6q+ZjuC9vBO8ndw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 444, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca60502302202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + }, + { + "tcId" : 445, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022044a5ad0bd0636d9e12bc9e0a6bdd5e1bba77f523842193b3b82e448e05d5f11e02202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff00000001060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1", + "wx" : "6e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff", + "wy" : "01060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff00000001060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEboI1VUUpFAmRgsaywdbwtdKNUMzQBa8s\n4bulQapAyv8AAAABBgSS1aVnPg8l2NUPt+WMSdhtRtQhaVXgqj1A4Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 446, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402206d6a4f556ccce154e7fb9f19e76c3deca13d59cc2aeb4ecad968aab2ded45965022053b9fa74803ede0fc4441bf683d56c564d3e274e09ccf47390badd1471c05fb7", + "result" : "valid" + }, + { + "tcId" : 447, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100aad503de9b9fd66b948e9acf596f0a0e65e700b28b26ec56e6e45e846489b3c4022100fff223c5d0765447e8447a3f9d31fd0696e89d244422022ff61a110b2a8c2f04", + "result" : "valid" + }, + { + "tcId" : 448, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30460221009182cebd3bb8ab572e167174397209ef4b1d439af3b200cdf003620089e43225022100abb88367d15fe62d1efffb6803da03109ee22e90bc9c78e8b4ed23630b82ea9d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40cafffffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e", + "wx" : "6e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff", + "wy" : "00fffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40cafffffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEboI1VUUpFAmRgsaywdbwtdKNUMzQBa8s\n4bulQapAyv/////++fttKlqYwfDaJyrwSBpztieSuSvelqoeVcK7Tg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 449, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502203854a3998aebdf2dbc28adac4181462ccac7873907ab7f212c42db0e69b56ed8022100c12c09475c772fd0c1b2060d5163e42bf71d727e4ae7c03eeba954bf50b43bb3", + "result" : "valid" + }, + { + "tcId" : 450, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100e94dbdc38795fe5c904d8f16d969d3b587f0a25d2de90b6d8c5c53ff887e3607022100856b8c963e9b68dade44750bf97ec4d11b1a0a3804f4cb79aa27bdea78ac14e4", + "result" : "valid" + }, + { + "tcId" : 451, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022049fc102a08ca47b60e0858cd0284d22cddd7233f94aaffbb2db1dd2cf08425e102205b16fca5a12cdb39701697ad8e39ffd6bdec0024298afaa2326aea09200b14d6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04000000013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d", + "wx" : "013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0", + "wy" : "00f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004000000013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAAAAAT/SIkjWTZX3PCm0irSGMYUL5QP9\nAPhGi18PcOD27nqkO8LG/SWx2CaSQcvdnbsNrJbcliMfQwcF+DhxfQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 452, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022041efa7d3f05a0010675fcb918a45c693da4b348df21a59d6f9cd73e0d831d67a022100bbab52596c1a1d9484296cdc92cbf07e665259a13791a8fe8845e2c07cf3fc67", + "result" : "valid" + }, + { + "tcId" : 453, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100b615698c358b35920dd883eca625a6c5f7563970cdfc378f8fe0cee17092144c022100da0b84cd94a41e049ef477aeac157b2a9bfa6b7ac8de06ed3858c5eede6ddd6d", + "result" : "valid" + }, + { + "tcId" : 454, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304602210087cf8c0eb82d44f69c60a2ff5457d3aaa322e7ec61ae5aecfd678ae1c1932b0e022100c522c4eea7eafb82914cbf5c1ff76760109f55ddddcf58274d41c9bc4311e06e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0425afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dfffffffffa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35", + "wx" : "25afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dffffffff", + "wy" : "00fa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000425afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dfffffffffa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJa/WiayrrtZ8Hylt5ZQG+MVQ9XFGoLTs\nLJeHbf/////6RqduUgMi37xJHsTwzBl0IPxOpYg9j23VPDVLxPZ8NQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 455, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022062f48ef71ace27bf5a01834de1f7e3f948b9dce1ca1e911d5e13d3b104471d82022100a1570cc0f388768d3ba7df7f212564caa256ff825df997f21f72f5280d53011f", + "result" : "valid" + }, + { + "tcId" : 456, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100f6b0e2f6fe020cf7c0c20137434344ed7add6c4be51861e2d14cbda472a6ffb40221009be93722c1a3ad7d4cf91723700cb5486de5479d8c1b38ae4e8e5ba1638e9732", + "result" : "valid" + }, + { + "tcId" : 457, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100db09d8460f05eff23bc7e436b67da563fa4b4edb58ac24ce201fa8a358125057022046da116754602940c8999c8d665f786c50f5772c0a3cdbda075e77eabc64df16", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb93f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff", + "wx" : "00d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb9", + "wy" : "3f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb93f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0S5sZrZ3NMPITSYBz1013Al+J2N/CspK\nT9t0tqrdO7k/W9/4i9VzbfiY5pkAbtdQ8RzwfFhmzXrXDHEh/////w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 458, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450220592c41e16517f12fcabd98267674f974b588e9f35d35406c1a7bb2ed1d19b7b8022100c19a5f942607c3551484ff0dc97281f0cdc82bc48e2205a0645c0cf3d7f59da0", + "result" : "valid" + }, + { + "tcId" : 459, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100be0d70887d5e40821a61b68047de4ea03debfdf51cdf4d4b195558b959a032b20221008266b4d270e24414ecacb14c091a233134b918d37320c6557d60ad0a63544ac4", + "result" : "valid" + }, + { + "tcId" : 460, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100fae92dfcb2ee392d270af3a5739faa26d4f97bfd39ed3cbee4d29e26af3b206a02210093645c80605595e02c09a0dc4b17ac2a51846a728b3e8d60442ed6449fd3342b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb", + "wx" : "6d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000", + "wy" : "00e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbUp/YNR3Sk8KqLve25U8fup5CUB+MWR1\nVmS8KAAAAADmWdNOTfONnoyeqt+6NmEsdpGVvobHeqw/NueLU4aA+w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 461, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450220176a2557566ffa518b11226694eb9802ed2098bfe278e5570fe1d5d7af18a943022100ed6e2095f12a03f2eaf6718f430ec5fe2829fd1646ab648701656fd31221b97d", + "result" : "valid" + }, + { + "tcId" : 462, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022060be20c3dbc162dd34d26780621c104bbe5dace630171b2daef0d826409ee5c2022100bd8081b27762ab6e8f425956bf604e332fa066a99b59f87e27dc1198b26f5caa", + "result" : "valid" + }, + { + "tcId" : 463, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100edf03cf63f658883289a1a593d1007895b9f236d27c9c1f1313089aaed6b16ae022100e5b22903f7eb23adc2e01057e39b0408d495f694c83f306f1216c9bf87506074", + "result" : "valid" + } + ] + } + ] +} diff --git a/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha3_256_test.json b/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha3_256_test.json new file mode 100644 index 0000000000..cc3fda062e --- /dev/null +++ b/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha3_256_test.json @@ -0,0 +1,6436 @@ +{ + "algorithm" : "ECDSA", + "schema" : "ecdsa_verify_schema.json", + "generatorVersion" : "0.9rc5", + "numberOfTests" : 471, + "header" : [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes" : { + "ArithmeticError" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.", + "cves" : [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature" : { + "bugType" : "BER_ENCODING", + "description" : "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect" : "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves" : [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication" : { + "bugType" : "EDGE_CASE", + "description" : "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding" : { + "bugType" : "CAN_OF_WORMS", + "description" : "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449" + ] + }, + "MissingZero" : { + "bugType" : "LEGACY", + "description" : "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect" : "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "CVE-2019-0865" + ] + }, + "PointDuplication" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves" : [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "2020-13895" + ] + }, + "SpecialCaseHash" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "ValidSignature" : { + "bugType" : "BASIC", + "description" : "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups" : [ + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152", + "wx" : "782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963", + "wy" : "00af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeCyO0X47Kng7VGTzOwllKnHGeOBexR6E\n4rz8Zjo96WOvmstCgLjH98QvTvmrpiRewewXEv04oPqWQY2M1qphUg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 1, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "", + "sig" : "3046022100fc0f737a79d525eefe3c940c162173cc6fd9a6d5cc5017754026c4113d0f15cc022100894d6fb59cc79199b89cf12b556ba49f8623b66da8c11a55e267e3318497688c", + "result" : "valid" + }, + { + "tcId" : 2, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "4d7367", + "sig" : "3043022076bae33ffa376b496bde93c7748d50a3a8b73bac045e54c40c7fcd344a10fa83021f3e25a20716a902d524d656ead090b7bbe1ac25ff71269d7038d4b08db5b1d7", + "result" : "valid" + }, + { + "tcId" : 3, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "30450220016e2dfac600c8c994c0bb815b1072bb5bb680774121d342f93fe0a994f72c09022100c378944de05aaca70c71ed9a7fe4eed2b36ab3ddb4b32d09d53eebd91f2f9217", + "result" : "valid" + }, + { + "tcId" : 4, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "0000000000000000000000000000000000000000", + "sig" : "3045022100a33c4acb033f3d0d50d244249a1277448b6a52f524e30f4b73d595fb955e924702207f31b50c698a971c8fab98521ef3a1d6fa483a676230467c8af3018452bf1de1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6ff0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9", + "wx" : "00b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6f", + "wy" : "00f0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6ff0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEuDj/ROW8F3vyEYnQdmCC/J2EMiaIf8l2\nA3EQC37iCm/wyddb+6ezGmvKGXRJbutW3jVwcZVdg8Sxutqgshgy6Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 5, + "comment" : "signature malleability", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022100bbdbc26e1099b2713ada34df9cfa8edaf905a4a6d2a1f449f05de03df8c2a696", + "result" : "valid" + }, + { + "tcId" : 6, + "comment" : "Legacy: ASN encoding of r misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "30440220eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 7, + "comment" : "valid", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "valid" + }, + { + "tcId" : 8, + "comment" : "length of sequence [r, s] uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "308145022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 9, + "comment" : "length of sequence [r, s] contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30820045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 10, + "comment" : "length of sequence [r, s] uses 70 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 11, + "comment" : "length of sequence [r, s] uses 68 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 12, + "comment" : "uint32 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30850100000045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 13, + "comment" : "uint64 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3089010000000000000045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 14, + "comment" : "length of sequence [r, s] = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30847fffffff022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 15, + "comment" : "length of sequence [r, s] = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308480000000022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 16, + "comment" : "length of sequence [r, s] = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084ffffffff022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 17, + "comment" : "length of sequence [r, s] = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085ffffffffff022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 18, + "comment" : "length of sequence [r, s] = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3088ffffffffffffffff022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 19, + "comment" : "incorrect length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30ff022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 20, + "comment" : "replaced sequence [r, s] by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 21, + "comment" : "removing sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "", + "result" : "invalid" + }, + { + "tcId" : 22, + "comment" : "lonely sequence tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30", + "result" : "invalid" + }, + { + "tcId" : 23, + "comment" : "appending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000", + "result" : "invalid" + }, + { + "tcId" : 24, + "comment" : "prepending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470000022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 25, + "comment" : "appending unused 0's to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000", + "result" : "invalid" + }, + { + "tcId" : 26, + "comment" : "appending null value to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0500", + "result" : "invalid" + }, + { + "tcId" : 27, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a4981773045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 28, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304925003045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 29, + "comment" : "appending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30473045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 30, + "comment" : "including undefined tags", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304daa00bb00cd003045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 31, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2229aa00bb00cd00022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 32, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2512228aa00bb00cd00022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 33, + "comment" : "truncated length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3081", + "result" : "invalid" + }, + { + "tcId" : 34, + "comment" : "including undefined tags to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304baa02aabb3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 35, + "comment" : "using composition with indefinite length for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30803045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000", + "result" : "invalid" + }, + { + "tcId" : 36, + "comment" : "using composition with wrong tag for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30803145022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000", + "result" : "invalid" + }, + { + "tcId" : 37, + "comment" : "Replacing sequence [r, s] with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "0500", + "result" : "invalid" + }, + { + "tcId" : 38, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2e45022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 39, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2f45022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 40, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3145022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 41, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3245022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 42, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "ff45022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 43, + "comment" : "dropping value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3000", + "result" : "invalid" + }, + { + "tcId" : 44, + "comment" : "using composition for sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304930010230442100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 45, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739a", + "result" : "invalid" + }, + { + "tcId" : 46, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30442100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 47, + "comment" : "sequence [r, s] of size 4166 to check for overflows", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30821046022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 48, + "comment" : "indefinite length", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3080022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000", + "result" : "invalid" + }, + { + "tcId" : 49, + "comment" : "indefinite length with truncated delimiter", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab00", + "result" : "invalid" + }, + { + "tcId" : 50, + "comment" : "indefinite length with additional element", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab05000000", + "result" : "invalid" + }, + { + "tcId" : 51, + "comment" : "indefinite length with truncated element", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab060811220000", + "result" : "invalid" + }, + { + "tcId" : 52, + "comment" : "indefinite length with garbage", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000fe02beef", + "result" : "invalid" + }, + { + "tcId" : 53, + "comment" : "indefinite length with nonempty EOC", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0002beef", + "result" : "invalid" + }, + { + "tcId" : 54, + "comment" : "prepend empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30473000022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 55, + "comment" : "append empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab3000", + "result" : "invalid" + }, + { + "tcId" : 56, + "comment" : "append zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab020100", + "result" : "invalid" + }, + { + "tcId" : 57, + "comment" : "append garbage with high tag number", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aabbf7f00", + "result" : "invalid" + }, + { + "tcId" : 58, + "comment" : "append null with explicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3049022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aaba0020500", + "result" : "invalid" + }, + { + "tcId" : 59, + "comment" : "append null with implicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aaba000", + "result" : "invalid" + }, + { + "tcId" : 60, + "comment" : "sequence of sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30473045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 61, + "comment" : "truncated sequence: removed last 1 elements", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3023022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251", + "result" : "invalid" + }, + { + "tcId" : 62, + "comment" : "repeating element in sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3067022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 63, + "comment" : "flipped bit 0 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304300eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe250022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 64, + "comment" : "flipped bit 32 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304300eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e457534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 65, + "comment" : "flipped bit 48 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304300eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e0e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 66, + "comment" : "flipped bit 64 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304300eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73784e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 67, + "comment" : "length of r uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304602812100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 68, + "comment" : "length of r contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30470282002100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 69, + "comment" : "length of r uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022200eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 70, + "comment" : "length of r uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022000eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 71, + "comment" : "uint32 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285010000002100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 72, + "comment" : "uint64 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e028901000000000000002100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 73, + "comment" : "length of r = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902847fffffff00eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 74, + "comment" : "length of r = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902848000000000eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 75, + "comment" : "length of r = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284ffffffff00eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 76, + "comment" : "length of r = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285ffffffffff00eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 77, + "comment" : "length of r = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0288ffffffffffffffff00eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 78, + "comment" : "incorrect length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502ff00eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 79, + "comment" : "replaced r by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045028000eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 80, + "comment" : "removing r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3022022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 81, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302302022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 82, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3024022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25102", + "result" : "invalid" + }, + { + "tcId" : 83, + "comment" : "appending 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022300eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510000022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 84, + "comment" : "prepending 0's to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30470223000000eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 85, + "comment" : "appending unused 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510000022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 86, + "comment" : "appending null value to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022300eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510500022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 87, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a2226498177022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 88, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304922252500022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 89, + "comment" : "appending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2223022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510004deadbeef022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 90, + "comment" : "truncated length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30240281022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 91, + "comment" : "including undefined tags to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b2227aa02aabb022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 92, + "comment" : "using composition with indefinite length for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492280022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510000022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 93, + "comment" : "using composition with wrong tag for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492280032100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510000022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 94, + "comment" : "Replacing r with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30240500022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 95, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045002100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 96, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045012100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 97, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045032100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 98, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045042100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 99, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045ff2100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 100, + "comment" : "dropping value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30240200022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 101, + "comment" : "using composition for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304922250201000220eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 102, + "comment" : "modifying first byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022102eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 103, + "comment" : "modifying last byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2d1022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 104, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044022000eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 105, + "comment" : "r of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308210480282102200eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 106, + "comment" : "leading ff in r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30460222ff00eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 107, + "comment" : "replaced r by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3025090180022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 108, + "comment" : "replacing r with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3025020100022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 109, + "comment" : "flipped bit 0 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25144243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aaa", + "result" : "invalid" + }, + { + "tcId" : 110, + "comment" : "flipped bit 32 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25144243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4fd7739aab", + "result" : "invalid" + }, + { + "tcId" : 111, + "comment" : "flipped bit 48 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25144243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf757e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 112, + "comment" : "flipped bit 64 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25144243d91ef664d8ec525cb2063057123c1a9383fdca6abf0cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 113, + "comment" : "length of s uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25102812044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 114, + "comment" : "length of s contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510282002044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 115, + "comment" : "length of s uses 33 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022144243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 116, + "comment" : "length of s uses 31 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251021f44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 117, + "comment" : "uint32 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510285010000002044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 118, + "comment" : "uint64 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251028901000000000000002044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 119, + "comment" : "length of s = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25102847fffffff44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 120, + "comment" : "length of s = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25102848000000044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 121, + "comment" : "length of s = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510284ffffffff44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 122, + "comment" : "length of s = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510285ffffffffff44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 123, + "comment" : "length of s = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510288ffffffffffffffff44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 124, + "comment" : "incorrect length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25102ff44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 125, + "comment" : "replaced s by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251028044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 126, + "comment" : "appending 0's to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022244243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000", + "result" : "invalid" + }, + { + "tcId" : 127, + "comment" : "prepending 0's to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510222000044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 128, + "comment" : "appending null value to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022244243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0500", + "result" : "invalid" + }, + { + "tcId" : 129, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2512225498177022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 130, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe25122242500022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 131, + "comment" : "appending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2512222022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 132, + "comment" : "truncated length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3025022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510281", + "result" : "invalid" + }, + { + "tcId" : 133, + "comment" : "including undefined tags to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2512226aa02aabb022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 134, + "comment" : "using composition with indefinite length for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2512280022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000", + "result" : "invalid" + }, + { + "tcId" : 135, + "comment" : "using composition with wrong tag for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2512280032044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000", + "result" : "invalid" + }, + { + "tcId" : 136, + "comment" : "Replacing s with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510500", + "result" : "invalid" + }, + { + "tcId" : 137, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251002044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 138, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251012044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 139, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251032044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 140, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251042044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 141, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251ff2044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 142, + "comment" : "dropping value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3025022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510200", + "result" : "invalid" + }, + { + "tcId" : 143, + "comment" : "using composition for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2512224020144021f243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 144, + "comment" : "modifying first byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022046243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 145, + "comment" : "modifying last byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739a2b", + "result" : "invalid" + }, + { + "tcId" : 146, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251021f44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739a", + "result" : "invalid" + }, + { + "tcId" : 147, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251021f243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 148, + "comment" : "s of size 4129 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30821048022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510282102144243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 149, + "comment" : "leading ff in s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe2510221ff44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 150, + "comment" : "replaced s by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251090180", + "result" : "invalid" + }, + { + "tcId" : 151, + "comment" : "replacing s with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251020100", + "result" : "invalid" + }, + { + "tcId" : 152, + "comment" : "replaced r by r + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3045022101eb044a2e719d94a33837717ce9bc5ff94062cf047015777244b442e323862392022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 153, + "comment" : "replaced r by r - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30440220eb044a2e719d94a33837717ce9bc5ffbcb051537118436fac50f85c98319a110022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 154, + "comment" : "replaced r by r + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304602220100eb044a2e719d94a33837717ce9bc5eb53490d8cd096d12f65740712689912351022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 155, + "comment" : "replaced r by -r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221ff14fbb5d18e626b5cc7c88e831643a0057a4c0de23f3328c97b1e1ba9acb01daf022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 156, + "comment" : "replaced r by n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "3044022014fbb5d18e626b5cc7c88e831643a00434faeac8ee7bc9053af07a367ce65ef0022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 157, + "comment" : "replaced r by -n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221fe14fbb5d18e626b5cc7c88e831643a006bf9d30fb8fea888dbb4bbd1cdc79dc6e022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 158, + "comment" : "replaced r by r + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "3045022101eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 159, + "comment" : "replaced r by r + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304d0229010000000000000000eb044a2e719d94a33837717ce9bc5ffa85b3f21dc0ccd73684e1e456534fe251022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 160, + "comment" : "replaced s by s + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304502210144243d91ef664d8ec525cb20630571227c5815268bef4c2d8f46dcdba7a9dbec022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 161, + "comment" : "replaced s by s - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450221ff44243d91ef664d8ec525cb206305712506fa5b592d5e0bb60fa21fc2073d596a022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 162, + "comment" : "replaced s by s + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460222010044243d91ef664d8ec525cb2063056fde70861eef2546e7b1a1d30b1f0db4dbab022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 163, + "comment" : "replaced s by -s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30440220bbdbc26e1099b2713ada34df9cfa8edc3e56c7c02359540e308b81b1288c6555022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 164, + "comment" : "replaced s by -n - s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221febbdbc26e1099b2713ada34df9cfa8edd83a7ead97410b3d270b9232458562414022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 165, + "comment" : "replaced s by s + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304502210144243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 166, + "comment" : "replaced s by s - 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450221ff44243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 167, + "comment" : "replaced s by s + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304d022901000000000000000044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab022044243d91ef664d8ec525cb2063057123c1a9383fdca6abf1cf747e4ed7739aab", + "result" : "invalid" + }, + { + "tcId" : 168, + "comment" : "Signature with special case values r=0 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020100", + "result" : "invalid" + }, + { + "tcId" : 169, + "comment" : "Signature with special case values r=0 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020101", + "result" : "invalid" + }, + { + "tcId" : 170, + "comment" : "Signature with special case values r=0 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000201ff", + "result" : "invalid" + }, + { + "tcId" : 171, + "comment" : "Signature with special case values r=0 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 172, + "comment" : "Signature with special case values r=0 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 173, + "comment" : "Signature with special case values r=0 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 174, + "comment" : "Signature with special case values r=0 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 175, + "comment" : "Signature with special case values r=0 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 176, + "comment" : "Signature with special case values r=1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020100", + "result" : "invalid" + }, + { + "tcId" : 177, + "comment" : "Signature with special case values r=1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "invalid" + }, + { + "tcId" : 178, + "comment" : "Signature with special case values r=1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010201ff", + "result" : "invalid" + }, + { + "tcId" : 179, + "comment" : "Signature with special case values r=1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 180, + "comment" : "Signature with special case values r=1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 181, + "comment" : "Signature with special case values r=1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 182, + "comment" : "Signature with special case values r=1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 183, + "comment" : "Signature with special case values r=1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 184, + "comment" : "Signature with special case values r=-1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020100", + "result" : "invalid" + }, + { + "tcId" : 185, + "comment" : "Signature with special case values r=-1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020101", + "result" : "invalid" + }, + { + "tcId" : 186, + "comment" : "Signature with special case values r=-1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0201ff", + "result" : "invalid" + }, + { + "tcId" : 187, + "comment" : "Signature with special case values r=-1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 188, + "comment" : "Signature with special case values r=-1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 189, + "comment" : "Signature with special case values r=-1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 190, + "comment" : "Signature with special case values r=-1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 191, + "comment" : "Signature with special case values r=-1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 192, + "comment" : "Signature with special case values r=n and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020100", + "result" : "invalid" + }, + { + "tcId" : 193, + "comment" : "Signature with special case values r=n and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101", + "result" : "invalid" + }, + { + "tcId" : 194, + "comment" : "Signature with special case values r=n and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410201ff", + "result" : "invalid" + }, + { + "tcId" : 195, + "comment" : "Signature with special case values r=n and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 196, + "comment" : "Signature with special case values r=n and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 197, + "comment" : "Signature with special case values r=n and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 198, + "comment" : "Signature with special case values r=n and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 199, + "comment" : "Signature with special case values r=n and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 200, + "comment" : "Signature with special case values r=n - 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140020100", + "result" : "invalid" + }, + { + "tcId" : 201, + "comment" : "Signature with special case values r=n - 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140020101", + "result" : "invalid" + }, + { + "tcId" : 202, + "comment" : "Signature with special case values r=n - 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641400201ff", + "result" : "invalid" + }, + { + "tcId" : 203, + "comment" : "Signature with special case values r=n - 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 204, + "comment" : "Signature with special case values r=n - 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 205, + "comment" : "Signature with special case values r=n - 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 206, + "comment" : "Signature with special case values r=n - 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 207, + "comment" : "Signature with special case values r=n - 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 208, + "comment" : "Signature with special case values r=n + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142020100", + "result" : "invalid" + }, + { + "tcId" : 209, + "comment" : "Signature with special case values r=n + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142020101", + "result" : "invalid" + }, + { + "tcId" : 210, + "comment" : "Signature with special case values r=n + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641420201ff", + "result" : "invalid" + }, + { + "tcId" : 211, + "comment" : "Signature with special case values r=n + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 212, + "comment" : "Signature with special case values r=n + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 213, + "comment" : "Signature with special case values r=n + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 214, + "comment" : "Signature with special case values r=n + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 215, + "comment" : "Signature with special case values r=n + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 216, + "comment" : "Signature with special case values r=p and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f020100", + "result" : "invalid" + }, + { + "tcId" : 217, + "comment" : "Signature with special case values r=p and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f020101", + "result" : "invalid" + }, + { + "tcId" : 218, + "comment" : "Signature with special case values r=p and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0201ff", + "result" : "invalid" + }, + { + "tcId" : 219, + "comment" : "Signature with special case values r=p and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 220, + "comment" : "Signature with special case values r=p and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 221, + "comment" : "Signature with special case values r=p and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 222, + "comment" : "Signature with special case values r=p and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 223, + "comment" : "Signature with special case values r=p and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 224, + "comment" : "Signature with special case values r=p + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30020100", + "result" : "invalid" + }, + { + "tcId" : 225, + "comment" : "Signature with special case values r=p + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30020101", + "result" : "invalid" + }, + { + "tcId" : 226, + "comment" : "Signature with special case values r=p + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc300201ff", + "result" : "invalid" + }, + { + "tcId" : 227, + "comment" : "Signature with special case values r=p + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 228, + "comment" : "Signature with special case values r=p + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 229, + "comment" : "Signature with special case values r=p + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 230, + "comment" : "Signature with special case values r=p + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 231, + "comment" : "Signature with special case values r=p + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 232, + "comment" : "Signature encoding contains incorrect types: r=0, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020100090380fe01", + "result" : "invalid" + }, + { + "tcId" : 233, + "comment" : "Signature encoding contains incorrect types: r=0, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100090142", + "result" : "invalid" + }, + { + "tcId" : 234, + "comment" : "Signature encoding contains incorrect types: r=0, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010101", + "result" : "invalid" + }, + { + "tcId" : 235, + "comment" : "Signature encoding contains incorrect types: r=0, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010100", + "result" : "invalid" + }, + { + "tcId" : 236, + "comment" : "Signature encoding contains incorrect types: r=0, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000500", + "result" : "invalid" + }, + { + "tcId" : 237, + "comment" : "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000c00", + "result" : "invalid" + }, + { + "tcId" : 238, + "comment" : "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000c0130", + "result" : "invalid" + }, + { + "tcId" : 239, + "comment" : "Signature encoding contains incorrect types: r=0, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201003000", + "result" : "invalid" + }, + { + "tcId" : 240, + "comment" : "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201003003020100", + "result" : "invalid" + }, + { + "tcId" : 241, + "comment" : "Signature encoding contains incorrect types: r=1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020101090380fe01", + "result" : "invalid" + }, + { + "tcId" : 242, + "comment" : "Signature encoding contains incorrect types: r=1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101090142", + "result" : "invalid" + }, + { + "tcId" : 243, + "comment" : "Signature encoding contains incorrect types: r=1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010101", + "result" : "invalid" + }, + { + "tcId" : 244, + "comment" : "Signature encoding contains incorrect types: r=1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010100", + "result" : "invalid" + }, + { + "tcId" : 245, + "comment" : "Signature encoding contains incorrect types: r=1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010500", + "result" : "invalid" + }, + { + "tcId" : 246, + "comment" : "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010c00", + "result" : "invalid" + }, + { + "tcId" : 247, + "comment" : "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010c0130", + "result" : "invalid" + }, + { + "tcId" : 248, + "comment" : "Signature encoding contains incorrect types: r=1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201013000", + "result" : "invalid" + }, + { + "tcId" : 249, + "comment" : "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201013003020100", + "result" : "invalid" + }, + { + "tcId" : 250, + "comment" : "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 251, + "comment" : "Signature encoding contains incorrect types: r=-1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff090142", + "result" : "invalid" + }, + { + "tcId" : 252, + "comment" : "Signature encoding contains incorrect types: r=-1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010101", + "result" : "invalid" + }, + { + "tcId" : 253, + "comment" : "Signature encoding contains incorrect types: r=-1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010100", + "result" : "invalid" + }, + { + "tcId" : 254, + "comment" : "Signature encoding contains incorrect types: r=-1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0500", + "result" : "invalid" + }, + { + "tcId" : 255, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0c00", + "result" : "invalid" + }, + { + "tcId" : 256, + "comment" : "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0c0130", + "result" : "invalid" + }, + { + "tcId" : 257, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff3000", + "result" : "invalid" + }, + { + "tcId" : 258, + "comment" : "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff3003020100", + "result" : "invalid" + }, + { + "tcId" : 259, + "comment" : "Signature encoding contains incorrect types: r=n, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141090380fe01", + "result" : "invalid" + }, + { + "tcId" : 260, + "comment" : "Signature encoding contains incorrect types: r=n, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141090142", + "result" : "invalid" + }, + { + "tcId" : 261, + "comment" : "Signature encoding contains incorrect types: r=n, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141010101", + "result" : "invalid" + }, + { + "tcId" : 262, + "comment" : "Signature encoding contains incorrect types: r=n, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141010100", + "result" : "invalid" + }, + { + "tcId" : 263, + "comment" : "Signature encoding contains incorrect types: r=n, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410500", + "result" : "invalid" + }, + { + "tcId" : 264, + "comment" : "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410c00", + "result" : "invalid" + }, + { + "tcId" : 265, + "comment" : "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410c0130", + "result" : "invalid" + }, + { + "tcId" : 266, + "comment" : "Signature encoding contains incorrect types: r=n, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641413000", + "result" : "invalid" + }, + { + "tcId" : 267, + "comment" : "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641413003020100", + "result" : "invalid" + }, + { + "tcId" : 268, + "comment" : "Signature encoding contains incorrect types: r=p, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f090380fe01", + "result" : "invalid" + }, + { + "tcId" : 269, + "comment" : "Signature encoding contains incorrect types: r=p, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f090142", + "result" : "invalid" + }, + { + "tcId" : 270, + "comment" : "Signature encoding contains incorrect types: r=p, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f010101", + "result" : "invalid" + }, + { + "tcId" : 271, + "comment" : "Signature encoding contains incorrect types: r=p, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f010100", + "result" : "invalid" + }, + { + "tcId" : 272, + "comment" : "Signature encoding contains incorrect types: r=p, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0500", + "result" : "invalid" + }, + { + "tcId" : 273, + "comment" : "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0c00", + "result" : "invalid" + }, + { + "tcId" : 274, + "comment" : "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0c0130", + "result" : "invalid" + }, + { + "tcId" : 275, + "comment" : "Signature encoding contains incorrect types: r=p, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3000", + "result" : "invalid" + }, + { + "tcId" : 276, + "comment" : "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3003020100", + "result" : "invalid" + }, + { + "tcId" : 277, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a090380fe01090380fe01", + "result" : "invalid" + }, + { + "tcId" : 278, + "comment" : "Signature encoding contains incorrect types: r=nan, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142090142", + "result" : "invalid" + }, + { + "tcId" : 279, + "comment" : "Signature encoding contains incorrect types: r=True, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101010101", + "result" : "invalid" + }, + { + "tcId" : 280, + "comment" : "Signature encoding contains incorrect types: r=False, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100010100", + "result" : "invalid" + }, + { + "tcId" : 281, + "comment" : "Signature encoding contains incorrect types: r=Null, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300405000500", + "result" : "invalid" + }, + { + "tcId" : 282, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30040c000c00", + "result" : "invalid" + }, + { + "tcId" : 283, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c01300c0130", + "result" : "invalid" + }, + { + "tcId" : 284, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300430003000", + "result" : "invalid" + }, + { + "tcId" : 285, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a30030201003003020100", + "result" : "invalid" + }, + { + "tcId" : 286, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008090380fe01020100", + "result" : "invalid" + }, + { + "tcId" : 287, + "comment" : "Signature encoding contains incorrect types: r=nan, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142020100", + "result" : "invalid" + }, + { + "tcId" : 288, + "comment" : "Signature encoding contains incorrect types: r=True, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101020100", + "result" : "invalid" + }, + { + "tcId" : 289, + "comment" : "Signature encoding contains incorrect types: r=False, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100020100", + "result" : "invalid" + }, + { + "tcId" : 290, + "comment" : "Signature encoding contains incorrect types: r=Null, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050500020100", + "result" : "invalid" + }, + { + "tcId" : 291, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050c00020100", + "result" : "invalid" + }, + { + "tcId" : 292, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c0130020100", + "result" : "invalid" + }, + { + "tcId" : 293, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30053000020100", + "result" : "invalid" + }, + { + "tcId" : 294, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30083003020100020100", + "result" : "invalid" + }, + { + "tcId" : 295, + "comment" : "Edge case for Shamir multiplication", + "flags" : [ + "EdgeCaseShamirMultiplication" + ], + "msg" : "3232333836", + "sig" : "3046022100dd1b7d09a7bd8218961034a39a87fecf5314f00c4d25eb58a07ac85e85eab516022100b98c5232f0100d55db14eb0fe9e943fb45d8f192bbdd38147850f4d950f16a91", + "result" : "valid" + }, + { + "tcId" : 296, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313930393433323838", + "sig" : "3046022100840a6cd819f21a2a3c3be7461bf516f5191c32d059eea09699ac4132f794881902210094c53906a1595cf9fe14831b5298b4e297219afb895c18a19f4508fa4f6e0394", + "result" : "valid" + }, + { + "tcId" : 297, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383433343734313535", + "sig" : "304502205928b7eeb84242914d4d5b871feb3b0d789455e44a41e3b60e0e43856a4a7a39022100d650930d76eb2444713b63b501a8e8b39615784306f1f2fa90915066e4f60192", + "result" : "valid" + }, + { + "tcId" : 298, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353732363936383239", + "sig" : "304502202ff05b06077811e7bf8a1b8804fa6bb7db793b0a8927745f5b543998dab306b3022100c9e7da07e2b2d28f169924bab22d90a107ca97f5022eac08d0a4577f30d89988", + "result" : "valid" + }, + { + "tcId" : 299, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353931383333343239", + "sig" : "3045022019c5e74fd3ab3847d1ba8ec6ff682b184ed2ae466622890deb4206385c31b0a5022100c959ebce99b3446aacee56eecdbae1898fc71a6bacb4464a6a4b0276821b32e7", + "result" : "valid" + }, + { + "tcId" : 300, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3832353330383232353839", + "sig" : "3045022054bb584a67c79e19d3f9627cc1eadacce8075e3f5c03e45c807b46d505ca73ab022100ab37fbc790a0400debbbde06b9771b63732d79de6a56e87275a968e0d4aaefbf", + "result" : "valid" + }, + { + "tcId" : 301, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3133373334383238313432", + "sig" : "30450220699d4d68c233f44bf1d3f70001a9acac7be906e09ac440c8d16044364696b94d0221009990c2cd8d7c6a227dce6a94900bc7b69a8ee6cf0ba062767c09d9e5b12e413c", + "result" : "valid" + }, + { + "tcId" : 302, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313733383135363430", + "sig" : "3046022100e779c882a97701293daa1413f9fe49ab97bd8f742331461d0e3b93333c1db5bb022100ad3fd904ab463ec8bc7ff988c142acdbc5dd73d8dce919b458987c1f32ba3e9b", + "result" : "valid" + }, + { + "tcId" : 303, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353533343636353034", + "sig" : "3046022100d121d4639e90e4741919d9cb3888d69c46d6fdc84980b5ecc249fa01cae19be5022100ac0559aa580e535e401ea9e2710f067a375ec69dc49fba668d7a14d8bde42d0d", + "result" : "valid" + }, + { + "tcId" : 304, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32313833303339313937", + "sig" : "3046022100de04d387ddd0189ef2ec494594ed056675788d6cac25f9826e50fec66f47be6f022100a55cbc3e87809b4dcc634cea32fc23cf7ac70f71ef1731de41414c0a71891cb5", + "result" : "valid" + }, + { + "tcId" : 305, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130353236313736353435", + "sig" : "304502205a8d2d504831a047c7277d9c13f7f456fd9569a311c5be93cbfa9a3122534ff3022100d0f9586630564236e9b133a7b53202b29d3a3caeb28f5d2360adfea238f41529", + "result" : "valid" + }, + { + "tcId" : 306, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353031353339393836", + "sig" : "304502200e2dc3e0b7c51be950c814b4cd74b8707753bc5a7543d6589ae1464c93227bf70221009cea04df1218bb7a0c851da9fef4069cfca9fc00ef08c37976adfc4ec7b5e2b2", + "result" : "valid" + }, + { + "tcId" : 307, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134393533313634363139", + "sig" : "304502200c93646c509040bac868258bf3f2d13d26e98993e8680f0da846c1712be95109022100c65386f8b0a12fef25791cd93a045140af9c24fe3d3d700e02d23b1ce2da05f3", + "result" : "valid" + }, + { + "tcId" : 308, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303633383532393036", + "sig" : "30450221009906860d728638f6a260e13495f2c6099838e5c2f94828f10caf2c58970d3bf802204853235fd511b8db3956bd25b772fab54bad3867d1c637a9984016f785fdc6cf", + "result" : "valid" + }, + { + "tcId" : 309, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37383339373634393932", + "sig" : "3045022100c6d609fc861a35134b4dc180a3b2a7b13ad8477358e80286f90499c58bd37dd302200978e0b21055dcc81844d297d6bbecbd074f09717b46c695ae60799d564a1f9f", + "result" : "valid" + }, + { + "tcId" : 310, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32313239323634343639", + "sig" : "304502201496fd7a5023faf78b0e1008b054f25c509d34713d4594cfabf24c1b2229643d022100f660ac1daa7700a55189d6710a373b350ea2446ae76fc8a3522df3e01a2bc2f1", + "result" : "valid" + }, + { + "tcId" : 311, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34383332303432363833", + "sig" : "3044022031007f0306f171eb56c9bc7f7c0cd7d776acd86be680f600d3729aedc03aa9ef022059f529aecb6c8e7469830daea5065e6da8c349688ab4fa0ebec364035a68e58a", + "result" : "valid" + }, + { + "tcId" : 312, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333635323231383136", + "sig" : "3046022100fbe1a139e3c74cef01d21d9c5a47a783080dbd9b86a202e933872a71a4b53838022100fe3164ad51c080ddd4126f42979e6b519075b2ec96060e02f9dd6fb6f9f3bfdf", + "result" : "valid" + }, + { + "tcId" : 313, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3234393137313236393635", + "sig" : "3044022004518c6be6586ceb5559014ff40311fe7e6d0ffcdfc655b6a06bbe203a185ed602201e0b927e43125aa196329bb0f09bf75d0481dba924f91e3e39e3e0878a972a83", + "result" : "valid" + }, + { + "tcId" : 314, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32363232373930373738", + "sig" : "3046022100ad67c0270ea088a9daa805788b6aa5161c6e7e12d237515518914ab66d1dcb66022100c5fa3b243e9148e1dcfc27abd9991a2c0c2d25bde9822ce26f344bc9e03f9ee7", + "result" : "valid" + }, + { + "tcId" : 315, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313031323537373238393237", + "sig" : "3045022100edd7e3fb8581ded7c0961f7365a1a39c6fa301d9728000aeb84c41d918c17dbb022025cfb4fdade11816359ccfd2001cc2b0e509de9cca0c1aa7eaae719637e11156", + "result" : "valid" + }, + { + "tcId" : 316, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303530383732323032", + "sig" : "304402204ca5021a99c50916f997009a2f6addc6cb2a57cada7b1eb72821f66ec353516d022043d471d4043f8fbb0765c059d1b5386b49a530a626d26d2bed4323c0aea5d24a", + "result" : "valid" + }, + { + "tcId" : 317, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353037373237303332", + "sig" : "3045022100eb3a1a9165de050206fa045882f7f3bd06bd02c2e825740d72d8cb2a07f45cfb0220394fa8625004c62cb1c8eea02c3411e6a036b4afe14727d497b31d7251d4a20c", + "result" : "valid" + }, + { + "tcId" : 318, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373139333435393339", + "sig" : "304502207921badf49f2beba3bc6d696494e7f6c74edc3b722247adbc9cf54d02527ef30022100a45ef9b623bad9a24433afc7e4e2b25270cf07ab20e29ee822255b6ee8da233d", + "result" : "valid" + }, + { + "tcId" : 319, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363337333035373633", + "sig" : "304402203e2c342f84cb36f986b72bd19867c359ad195046ef30ca7549df842d33a51ccb02205b8bfcfc785ff44ccc2651b893b5dfbc12739cc3973988dbb209cd60f4c1b4e2", + "result" : "valid" + }, + { + "tcId" : 320, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34323431323733373133", + "sig" : "3046022100919eb36b4949e319427b2113927fd40f767c11d2c6a991c558438790959c00710221009e4bfd8bcca87632071bdc109cd47e45c90f7cbbff3ff05a1591585b2f0f6537", + "result" : "valid" + }, + { + "tcId" : 321, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343735363134373337", + "sig" : "3045022100e36e3c1918e378f12ccaefe24954c4fb77d8a227f7a234a045c2fa69ec0184c4022065f7b5def112fd96d3c3ddf3aa5bce418ae5cb7322387b18b5b15e2caa78f209", + "result" : "valid" + }, + { + "tcId" : 322, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37313632333237373334", + "sig" : "304602210089674f75b7440869f9de0cdde21ef47003309be9f0ff7f858c6f43a3b9067096022100d37781ff993210da5470ba8ce3c16a088e58e79d7fd0f5e2d2336443d9b1aeb8", + "result" : "valid" + }, + { + "tcId" : 323, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31323232343034313239", + "sig" : "30440220584c05af98b487e9a0b5dd5e0154d124aeefa55eb48a274721365e597549ec98022047b4127c6c09077615a921be38942baa053a88b73884dfadd6a745cc9c6fa096", + "result" : "valid" + }, + { + "tcId" : 324, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353234353833333638", + "sig" : "304402205f21b554fd91ca9cdd5109a00ab3ecb2d8b5137b4fd05c254c3faaa377b3da0602205d036a7dbebf9351c88d3bbe03991690cb7b67d3b5ca4266eb25029e3a1f75e6", + "result" : "valid" + }, + { + "tcId" : 325, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3331363334333936", + "sig" : "304402206a309780826539059b3b2c9d4315bbb83b4c3afc218d440acf2d01ec0a5cdf8302205d3ea569a5ad21db62e4bc0b60251e5f65b01158f2c8821973ee6c47cd15fc34", + "result" : "valid" + }, + { + "tcId" : 326, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36353332353938343339", + "sig" : "3045022041d51f04d6fdcc5f5cacf88e50e418ef0067f8d854dc991615003f1e49927a53022100c6f7c10cad03b89460a9794a171f2e10d84982c462cbf075b06738b3f904cc5c", + "result" : "valid" + }, + { + "tcId" : 327, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373338353138353034", + "sig" : "3046022100da8e729ac23689e868129854fbbde5c9130ebad0e555047f6c4ffccdb0d75fde022100b693c1a3ccd93e2989f84e77e0ea5983b758f4c1a2a8c4b6219b6b006e9ba1e5", + "result" : "valid" + }, + { + "tcId" : 328, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343635323636353739", + "sig" : "304502200793b70b17c7db1ee4f84a0fcc27115355bca4036e33830bddb58aaaf21db1e9022100b884dc3329f826a3cc1766ab7f67cd31ad17b4d48e81b8641d6cf70400c80649", + "result" : "valid" + }, + { + "tcId" : 329, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303334383839343934", + "sig" : "304402203ee201732af7f4fb862991d162a11f79fae57233ff964782db1b35b2dee67f60022078e00f30babf2d483c9e9729c50ac07df9abe878ff8edd3cd7ea3cecc30b724e", + "result" : "valid" + }, + { + "tcId" : 330, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343730383836373835", + "sig" : "30460221008f2c4f9daeae645deb8237f2598485a7c3ac3b0e0b945641e4f24f59ffe7845a022100a7f781e40a73cc4f49159ed982ffb264097c5f34382314ba0128a52c9144fd33", + "result" : "valid" + }, + { + "tcId" : 331, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353537363430343436", + "sig" : "30450220750dad3a83d3c3621a78dcd92f7da948c6fc68d7f0d9603835b2488515c539ae022100a0736c57503c76c2342e3f13e55f6dfb6637b1fb6ba5caf00b9e540daa7f70c6", + "result" : "valid" + }, + { + "tcId" : 332, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36333434393536363038", + "sig" : "3046022100b3d14a7f7dd693c7fd62d073cb6bc77504431d8a992cc64af774703a981db0a1022100ab8a35acce773242850c086013869631e99cf9c5378d39d0fe10ca7b504c0cf9", + "result" : "valid" + }, + { + "tcId" : 333, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34393432383039303331", + "sig" : "3046022100ff35621d420e7a8343d222f18acb46ae5a5a29320f88e2f0977acfd96d7014410221009fc29bfd8a80a24959bd4494de1b3c0a3366131aefef4fe9d33f1f91d118bb27", + "result" : "valid" + }, + { + "tcId" : 334, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323636353831393339", + "sig" : "30450220051291f27408436b4c56cc8993b3891c5c3a4bf3747041b4d915fdccc1c67a59022100f8d6971a948332617564b4c9581850f8992752f1afe30370a4d36af72376672f", + "result" : "valid" + }, + { + "tcId" : 335, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33333332323134313134", + "sig" : "3046022100b820f2163d1a902e847c69392da7124bc31f56ecad5f73c3db142c9c8220cc6502210089c527e55e559aa5efb263860fbac04f1ce556f82bcccb49991bc2c575808aa7", + "result" : "valid" + }, + { + "tcId" : 336, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363136353237373135", + "sig" : "304402200180c08e97d4fe407c0eab2eb7d17bae60e8ca9ad459e57cdf48389ed9ed953602207d5eaeffffba65afbf1ba9ca9bc0fe1181da76e5e41ade8687799b09e9104597", + "result" : "valid" + }, + { + "tcId" : 337, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333539393535383133", + "sig" : "3046022100985f15f0eecc62112817bc234784d60404804ea7dba48f8c09cc02401c4e13ae022100c73d1bed7077734492c700ede8e6800e048523ef9bcffb53cc79945805ff711e", + "result" : "valid" + }, + { + "tcId" : 338, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323931333631393538", + "sig" : "3046022100d9a5ae9012bcacfc12fa3db623d2099657d4f321460d0135bc731a70478b79bc022100a5d882aa5cf390737839443ab059d68282064d3d827bfef52fc176d0de60ed46", + "result" : "valid" + }, + { + "tcId" : 339, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363230393033333936", + "sig" : "3046022100f070e1285c47106a1ad23a774756a3d3453a48d245401604ef59a96b9a1910c2022100b43cf52041613dbf8d3a136a0d0f6bce87cd74262224e620f355ddeced20e5bd", + "result" : "valid" + }, + { + "tcId" : 340, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33333633313032383432", + "sig" : "3046022100963a3ae4b0a7ae86047e47f375c7e42de035f28fb430c408d0d815caebefa344022100a1edd8c2d39f04f99e05a793b7970dfa76f4b1fc0663d308edee9d3ecd077d66", + "result" : "valid" + }, + { + "tcId" : 341, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363237373433343931", + "sig" : "3046022100e6adb9139cf47dae0890006732629c8e095c13df370717a42a8bc6e8936678ef022100a8df8acc7ee7551cf0409e8c1c2fd0df6e7e9b3827e95727fa492c274e4668fc", + "result" : "valid" + }, + { + "tcId" : 342, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33383536373938313437", + "sig" : "3044022007662a36a2bb779a276145e78543c360c7d0a22a1749f69ead2788c75750d24802207c0a4dba499b27cc249a705ba7bbf512a7484b93f9a83ca9305dd49cde6a302b", + "result" : "valid" + }, + { + "tcId" : 343, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383831313830363430", + "sig" : "3045022036df003efdbec3bf53a2a45248c1e96e60c9bcf10b4f5dfb220744d2da51fc8e022100e5f103b3a74fa1d0a78e74d604f31889e6637cff2acbb31a70726e72f392d4ba", + "result" : "valid" + }, + { + "tcId" : 344, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130393537333934363738", + "sig" : "30440220712dc3233f462b0a37f020ec559bb1a19d879ae36210c75efcb9c071915116e1022006a981761249cc1929f5c18d6f2a76eef487bbda0c4470bb098b87b91328083f", + "result" : "valid" + }, + { + "tcId" : 345, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353432373131393834", + "sig" : "3044022010e373d1cb4c05295b63ce7103817b7c0fd096d7c63f65f56d950a61e455c1cb022044cb5c8270c069ac408a6c9f31ace9229ab6078a36adc465107f0a3d6ddfea66", + "result" : "valid" + }, + { + "tcId" : 346, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313530303334333235", + "sig" : "3045022100cd1274f4c89ab194203ccb5c39e7d0bc364537b84b9dd48d922e43e79e4258c2022042e1fcf72eb65d76b13128d3065daa31312bf9c110f18b4799dce8eccae52d67", + "result" : "valid" + }, + { + "tcId" : 347, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393939383231333931", + "sig" : "30450220516c983fe6567ac700f93028da6affc598dfa95391896c544c8f73c96314a0a0022100bfa56a1833668acfd14899e8cc160b79c5e92a30055dd7c700484f6bfce42cfd", + "result" : "valid" + }, + { + "tcId" : 348, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393731323039323631", + "sig" : "3045022052279b3df58e2aa7ddaee1e5de155cb75d4f00ec7db74ae913a6ed33dea896d4022100ef5823ff9977fa492483bcbfc1d0bd765fd6dfa78cc11e658b4984b543e0e79e", + "result" : "valid" + }, + { + "tcId" : 349, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353731383338383537", + "sig" : "3045022001c2a04eef5827e7e04eb51802cc3859af6d84fe35aee4da4bc1b0ee154b7ef3022100dc57a107da6bb12624313660233cbdcc55ff7147ecb3a328af3e86225c89be53", + "result" : "valid" + }, + { + "tcId" : 350, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38363832323639383935", + "sig" : "304502201ce1bb1fc78a38d4af211b5fceebd01126c10ceab1de6401e1df1dc495dbf5b5022100c9b564a0a5b9675eece3cbe33498634e7943893fe16c61ef894bd4be349a6874", + "result" : "valid" + }, + { + "tcId" : 351, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353438383536303331", + "sig" : "3045022100b7ae42b36f060c15c6745ea4d8bd91ae2eafe0e196c52cfac4e16ab74d3048b60220421bc2dcd0854dd4e69a3e930b2cb646557bd68c800c5a2ca7bbb3ddd32370aa", + "result" : "valid" + }, + { + "tcId" : 352, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34393935373031333139", + "sig" : "3045022100d51dc206df9cfb7198e22b957c644357542264badf5aede3f7474534da0d5b220220266d172a6d6775963f9ed4fb59065c8f1948c48a51463fe79bbf1b45df7e57b9", + "result" : "valid" + }, + { + "tcId" : 353, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343536363831373835", + "sig" : "3045022100f881b3e21684fbf899f762c8fc7c7423a2ad2c276257c99eae86b66ee39e4ae1022027207d5ccff773b26bf0d282d884b3c3a6724ba06a1671c9f9be8cbe6e3589e4", + "result" : "valid" + }, + { + "tcId" : 354, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34313835333731323336", + "sig" : "304402202455ebf62b50f958781792fdc705755923a30c0eb7d515a0988c1a14de62caad022010bd68c881416205bd95a5f2765d69726e0bce5b2a0ec525aeb1bba7d35d8e4a", + "result" : "valid" + }, + { + "tcId" : 355, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373237383439303034", + "sig" : "30450221009119d7949d9e4c55e4c712d257c4ba3ab9d657c7e0aa7840091cb2acfb4fc25a022042524fd0c4ae8b50644cba34f86c21a42ee045ce7c15b4eb817affc78d20fdb3", + "result" : "valid" + }, + { + "tcId" : 356, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353632383139333138", + "sig" : "30450220191e716669d84631a04cc085f03b2f1a4f55810f70bebbaf5ee13d68f2598ffb02210090f208a9f1c27911b5fb8d867bdf123dd601639c2dfa1f6a61fd2f82cadb1361", + "result" : "valid" + }, + { + "tcId" : 357, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3231383739393238333836", + "sig" : "30460221008cc2cab9f257928181c4d3685d544bec0b88b95cbbdb8ad1b0543b46b24144730221009d1d158dab8e91c68b372ade107aac5c22f8be64463b0c23340dfc828d7b7df3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0427504e893fd62d0bfdeaa073106b16e8f8d2726a9762529764cfe8fe8a38460e21bb0ddff040b7aff8f08a60d5ae1a59472f394846ae4f58c4be0cc8a2a36501", + "wx" : "27504e893fd62d0bfdeaa073106b16e8f8d2726a9762529764cfe8fe8a38460e", + "wy" : "21bb0ddff040b7aff8f08a60d5ae1a59472f394846ae4f58c4be0cc8a2a36501" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000427504e893fd62d0bfdeaa073106b16e8f8d2726a9762529764cfe8fe8a38460e21bb0ddff040b7aff8f08a60d5ae1a59472f394846ae4f58c4be0cc8a2a36501", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJ1BOiT/WLQv96qBzEGsW6PjScmqXYlKX\nZM/o/oo4Rg4huw3f8EC3r/jwimDVrhpZRy85SEauT1jEvgzIoqNlAQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 358, + "comment" : "k*G has a large x-coordinate", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30360211014551231950b75fc4402da1722fc9baeb022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "valid" + }, + { + "tcId" : 359, + "comment" : "r too large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2c022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f131f6dddde59bae7b0090a47bafbb33c157ac6da439324a6681bf67f575f90beccc2fb2c0be318fda9335bb83488bcafd33be82c38318bcf845fd0e5017c248", + "wx" : "00f131f6dddde59bae7b0090a47bafbb33c157ac6da439324a6681bf67f575f90b", + "wy" : "00eccc2fb2c0be318fda9335bb83488bcafd33be82c38318bcf845fd0e5017c248" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f131f6dddde59bae7b0090a47bafbb33c157ac6da439324a6681bf67f575f90beccc2fb2c0be318fda9335bb83488bcafd33be82c38318bcf845fd0e5017c248", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE8TH23d3lm657AJCke6+7M8FXrG2kOTJK\nZoG/Z/V1+QvszC+ywL4xj9qTNbuDSIvK/TO+gsODGLz4Rf0OUBfCSA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 360, + "comment" : "r,s are large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041101c496d5f8910a7749efff9dc46f68a7fd02d6975fdf15bf90efb70463cb4ede199e46e67d463aa8c752cac8a342b8fe0e9a5ba9a67416c8865c45e478007e", + "wx" : "1101c496d5f8910a7749efff9dc46f68a7fd02d6975fdf15bf90efb70463cb4e", + "wy" : "00de199e46e67d463aa8c752cac8a342b8fe0e9a5ba9a67416c8865c45e478007e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041101c496d5f8910a7749efff9dc46f68a7fd02d6975fdf15bf90efb70463cb4ede199e46e67d463aa8c752cac8a342b8fe0e9a5ba9a67416c8865c45e478007e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEEQHEltX4kQp3Se//ncRvaKf9AtaXX98V\nv5DvtwRjy07eGZ5G5n1GOqjHUsrIo0K4/g6aW6mmdBbIhlxF5HgAfg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 361, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02203e9a7582886089c62fb840cf3b83061cd1cff3ae4341808bb5bdee6191174177", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e43a5c63ad0bc8d178a745192671c06500f0dbd757c3f2eae65089aaf0d648982954ff60c3460a27748445525c6cd30701725e1697891cb7f32feed128a3ae7", + "wx" : "6e43a5c63ad0bc8d178a745192671c06500f0dbd757c3f2eae65089aaf0d6489", + "wy" : "0082954ff60c3460a27748445525c6cd30701725e1697891cb7f32feed128a3ae7" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e43a5c63ad0bc8d178a745192671c06500f0dbd757c3f2eae65089aaf0d648982954ff60c3460a27748445525c6cd30701725e1697891cb7f32feed128a3ae7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbkOlxjrQvI0XinRRkmccBlAPDb11fD8u\nrmUImq8NZImClU/2DDRgondIRFUlxs0wcBcl4Wl4kct/Mv7tEoo65w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 362, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022024238e70b431b1a64efdf9032669939d4b77f249503fc6905feb7540dea3e6d2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ef4e8b5732f51a4b2547c6581381ccf750bb6d30a07cb758865414d9a45017fbf10247bcaa4ca73d5c9ad4c8a03a60a7f5cfa07fb57437b5a6f0a9bd381d78a5", + "wx" : "00ef4e8b5732f51a4b2547c6581381ccf750bb6d30a07cb758865414d9a45017fb", + "wy" : "00f10247bcaa4ca73d5c9ad4c8a03a60a7f5cfa07fb57437b5a6f0a9bd381d78a5" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ef4e8b5732f51a4b2547c6581381ccf750bb6d30a07cb758865414d9a45017fbf10247bcaa4ca73d5c9ad4c8a03a60a7f5cfa07fb57437b5a6f0a9bd381d78a5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE706LVzL1GkslR8ZYE4HM91C7bTCgfLdY\nhlQU2aRQF/vxAke8qkynPVya1MigOmCn9c+gf7V0N7Wm8Km9OB14pQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 363, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a973c15a44d2dcd50558e033d242155a29808b87491576566a83821b650e6f2dfc5ecd5482fa591f578308b09f2e704116a375ba1e2837912bae2972d340414d", + "wx" : "00a973c15a44d2dcd50558e033d242155a29808b87491576566a83821b650e6f2d", + "wy" : "00fc5ecd5482fa591f578308b09f2e704116a375ba1e2837912bae2972d340414d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a973c15a44d2dcd50558e033d242155a29808b87491576566a83821b650e6f2dfc5ecd5482fa591f578308b09f2e704116a375ba1e2837912bae2972d340414d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEqXPBWkTS3NUFWOAz0kIVWimAi4dJFXZW\naoOCG2UOby38Xs1UgvpZH1eDCLCfLnBBFqN1uh4oN5Errily00BBTQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 364, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020102", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048cd31f1656b21ec27276a533c35bf51d95490bfec57868a9b94433eda4579d61bb2c8e80c45d949bcaf6f0bbc76bc27c95939945052ad1a11014756556c6f978", + "wx" : "008cd31f1656b21ec27276a533c35bf51d95490bfec57868a9b94433eda4579d61", + "wy" : "00bb2c8e80c45d949bcaf6f0bbc76bc27c95939945052ad1a11014756556c6f978" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048cd31f1656b21ec27276a533c35bf51d95490bfec57868a9b94433eda4579d61bb2c8e80c45d949bcaf6f0bbc76bc27c95939945052ad1a11014756556c6f978", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEjNMfFlayHsJydqUzw1v1HZVJC/7FeGip\nuUQz7aRXnWG7LI6AxF2Um8r28LvHa8J8lZOZRQUq0aEQFHVlVsb5eA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 365, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047f70598f1e6a18c55fa199a858cf3a825792ed14b856a5b9b8435890cd1275b559c12d120bf363568ceb79941d793f200a7bc4262bf40264a7a05dae0ab92093", + "wx" : "7f70598f1e6a18c55fa199a858cf3a825792ed14b856a5b9b8435890cd1275b5", + "wy" : "59c12d120bf363568ceb79941d793f200a7bc4262bf40264a7a05dae0ab92093" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047f70598f1e6a18c55fa199a858cf3a825792ed14b856a5b9b8435890cd1275b559c12d120bf363568ceb79941d793f200a7bc4262bf40264a7a05dae0ab92093", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEf3BZjx5qGMVfoZmoWM86gleS7RS4VqW5\nuENYkM0SdbVZwS0SC/NjVozreZQdeT8gCnvEJiv0AmSnoF2uCrkgkw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 366, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04df0005c3f4290809c6fc7c924cd389b44980d4b127db6f0d85a9e65b1f54a931a51e735ca524d208a684575630fd09f090562c8985756480cb6b0a86313b9147", + "wx" : "00df0005c3f4290809c6fc7c924cd389b44980d4b127db6f0d85a9e65b1f54a931", + "wy" : "00a51e735ca524d208a684575630fd09f090562c8985756480cb6b0a86313b9147" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004df0005c3f4290809c6fc7c924cd389b44980d4b127db6f0d85a9e65b1f54a931a51e735ca524d208a684575630fd09f090562c8985756480cb6b0a86313b9147", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE3wAFw/QpCAnG/HySTNOJtEmA1LEn228N\nhanmWx9UqTGlHnNcpSTSCKaEV1Yw/QnwkFYsiYV1ZIDLawqGMTuRRw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 367, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020102", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "045ab9318981cb3e597dd819205d9392e8ec750c517054ceeaf103b3e0f0ba8a365f330cc411e8b3821f4e1d5a17ee2fe7b8b1cacc36fed324d9837df7b4080b20", + "wx" : "5ab9318981cb3e597dd819205d9392e8ec750c517054ceeaf103b3e0f0ba8a36", + "wy" : "5f330cc411e8b3821f4e1d5a17ee2fe7b8b1cacc36fed324d9837df7b4080b20" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200045ab9318981cb3e597dd819205d9392e8ec750c517054ceeaf103b3e0f0ba8a365f330cc411e8b3821f4e1d5a17ee2fe7b8b1cacc36fed324d9837df7b4080b20", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEWrkxiYHLPll92BkgXZOS6Ox1DFFwVM7q\n8QOz4PC6ijZfMwzEEeizgh9OHVoX7i/nuLHKzDb+0yTZg333tAgLIA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 368, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020103", + "result" : "valid" + }, + { + "tcId" : 369, + "comment" : "r is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364143020103", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0446e91a1e5fd2f2e2175dd6d86d0f63329b56a4b89af1a1689879c7b372afbbf07ef4e53c35856995f1964c59dca422b2b16c34e7c248d8bf1396e65361a7091c", + "wx" : "46e91a1e5fd2f2e2175dd6d86d0f63329b56a4b89af1a1689879c7b372afbbf0", + "wy" : "7ef4e53c35856995f1964c59dca422b2b16c34e7c248d8bf1396e65361a7091c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000446e91a1e5fd2f2e2175dd6d86d0f63329b56a4b89af1a1689879c7b372afbbf07ef4e53c35856995f1964c59dca422b2b16c34e7c248d8bf1396e65361a7091c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAERukaHl/S8uIXXdbYbQ9jMptWpLia8aFo\nmHnHs3Kvu/B+9OU8NYVplfGWTFncpCKysWw058JI2L8TluZTYacJHA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 370, + "comment" : "s is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020102022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd04917c8", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046d4f41c9c4c15f02a199264a51266ed793952a7cea79125dcded805ed7a54c1350314fa927966b90b6c4e57cb521666fce4cb81b7e4d3550d729fe6dd6bbe5ab", + "wx" : "6d4f41c9c4c15f02a199264a51266ed793952a7cea79125dcded805ed7a54c13", + "wy" : "50314fa927966b90b6c4e57cb521666fce4cb81b7e4d3550d729fe6dd6bbe5ab" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046d4f41c9c4c15f02a199264a51266ed793952a7cea79125dcded805ed7a54c1350314fa927966b90b6c4e57cb521666fce4cb81b7e4d3550d729fe6dd6bbe5ab", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbU9BycTBXwKhmSZKUSZu15OVKnzqeRJd\nze2AXtelTBNQMU+pJ5ZrkLbE5Xy1IWZvzky4G35NNVDXKf5t1rvlqw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 371, + "comment" : "small r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302702020101022100c58b162c58b162c58b162c58b162c58a1b242973853e16db75c8a1a71da4d39d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043bd4a602119bc50cfd05aa395c3c9f753b383bdd9539d27a1a143033fcfcaaa892d75438eba5af693196d4b7953184e2d649a0845d11af3c7d39e3b1f5449c19", + "wx" : "3bd4a602119bc50cfd05aa395c3c9f753b383bdd9539d27a1a143033fcfcaaa8", + "wy" : "0092d75438eba5af693196d4b7953184e2d649a0845d11af3c7d39e3b1f5449c19" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043bd4a602119bc50cfd05aa395c3c9f753b383bdd9539d27a1a143033fcfcaaa892d75438eba5af693196d4b7953184e2d649a0845d11af3c7d39e3b1f5449c19", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEO9SmAhGbxQz9Bao5XDyfdTs4O92VOdJ6\nGhQwM/z8qqiS11Q466WvaTGW1LeVMYTi1kmghF0Rrzx9OeOx9UScGQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 372, + "comment" : "smallish r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302c02072d9b4d347952cc022100fcbc5103d0da267477d1791461cf2aa44bf9d43198f79507bd8779d69a13108e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047c981d6870575725427fc84ce6b5f706af6e8c62b4b5f7f72c3ee2860836996d29f07476cbf3f93a34e73f737658070642c66d0e34f5d56c715a26b099078413", + "wx" : "7c981d6870575725427fc84ce6b5f706af6e8c62b4b5f7f72c3ee2860836996d", + "wy" : "29f07476cbf3f93a34e73f737658070642c66d0e34f5d56c715a26b099078413" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047c981d6870575725427fc84ce6b5f706af6e8c62b4b5f7f72c3ee2860836996d29f07476cbf3f93a34e73f737658070642c66d0e34f5d56c715a26b099078413", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEfJgdaHBXVyVCf8hM5rX3Bq9ujGK0tff3\nLD7ihgg2mW0p8HR2y/P5OjTnP3N2WAcGQsZtDjT11WxxWiawmQeEEw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 373, + "comment" : "100-bit r and small s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d1033e67e37b32b445580bf4efc022100906f906f906f906f906f906f906f906ed8e426f7b1968c35a204236a579723d2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d75a78cf296b58aeb52faee6a9348385bcdc61f980da8ad6f28654d86fe516e20ce9952182f5f06cba50db8c65aa6f8cf1a32f2a46599c0a2abb4c1402cef467", + "wx" : "00d75a78cf296b58aeb52faee6a9348385bcdc61f980da8ad6f28654d86fe516e2", + "wy" : "0ce9952182f5f06cba50db8c65aa6f8cf1a32f2a46599c0a2abb4c1402cef467" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d75a78cf296b58aeb52faee6a9348385bcdc61f980da8ad6f28654d86fe516e20ce9952182f5f06cba50db8c65aa6f8cf1a32f2a46599c0a2abb4c1402cef467", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE11p4zylrWK61L67mqTSDhbzcYfmA2orW\n8oZU2G/lFuIM6ZUhgvXwbLpQ24xlqm+M8aMvKkZZnAoqu0wUAs70Zw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 374, + "comment" : "small r and 100 bit s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020201010220783266e90f43dafe5cd9b3b0be86de22f9de83677d0f50713a468ec72fcf5d57", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040a35a42fb4057e11e332442d73729cdc684e7e0a7875ec933337e74ab1e17de62152e3a6558865d7f30a950c64e9f2e9d2f06c2703d2a1984a79445d3870a1cf", + "wx" : "0a35a42fb4057e11e332442d73729cdc684e7e0a7875ec933337e74ab1e17de6", + "wy" : "2152e3a6558865d7f30a950c64e9f2e9d2f06c2703d2a1984a79445d3870a1cf" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040a35a42fb4057e11e332442d73729cdc684e7e0a7875ec933337e74ab1e17de62152e3a6558865d7f30a950c64e9f2e9d2f06c2703d2a1984a79445d3870a1cf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAECjWkL7QFfhHjMkQtc3Kc3GhOfgp4deyT\nMzfnSrHhfeYhUuOmVYhl1/MKlQxk6fLp0vBsJwPSoZhKeURdOHChzw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 375, + "comment" : "100-bit r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3031020d062522bbd3ecbe7c39e93e7c260220783266e90f43dafe5cd9b3b0be86de22f9de83677d0f50713a468ec72fcf5d57", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04705e0c3ea1ca443a0105896e7af2b891a08243cca510cb5fffaebdd86ec6fc8c25d116fcf912e8246a64d5878436dfc958b59d4662a4b227a006876b5042fa58", + "wx" : "705e0c3ea1ca443a0105896e7af2b891a08243cca510cb5fffaebdd86ec6fc8c", + "wy" : "25d116fcf912e8246a64d5878436dfc958b59d4662a4b227a006876b5042fa58" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004705e0c3ea1ca443a0105896e7af2b891a08243cca510cb5fffaebdd86ec6fc8c25d116fcf912e8246a64d5878436dfc958b59d4662a4b227a006876b5042fa58", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEcF4MPqHKRDoBBYluevK4kaCCQ8ylEMtf\n/6692G7G/Iwl0Rb8+RLoJGpk1YeENt/JWLWdRmKksiegBodrUEL6WA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 376, + "comment" : "r and s^-1 are close to n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03640c1022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04fce5ea1fb9571f170fd246c0eaf46e987d1fd3cd1dac1dc80828fb57e7b400f9610daa982627a64cff6cba23ba753de757dd772fb8055d33dfd6a5f4173f76ea", + "wx" : "00fce5ea1fb9571f170fd246c0eaf46e987d1fd3cd1dac1dc80828fb57e7b400f9", + "wy" : "610daa982627a64cff6cba23ba753de757dd772fb8055d33dfd6a5f4173f76ea" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004fce5ea1fb9571f170fd246c0eaf46e987d1fd3cd1dac1dc80828fb57e7b400f9610daa982627a64cff6cba23ba753de757dd772fb8055d33dfd6a5f4173f76ea", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE/OXqH7lXHxcP0kbA6vRumH0f080drB3I\nCCj7V+e0APlhDaqYJiemTP9suiO6dT3nV913L7gFXTPf1qX0Fz926g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 377, + "comment" : "r and s are 64-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30160209009c44febf31c3594d020900839ed28247c2b06b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a49b1e3904315d7b9eccdb36fad8160ed6274ee4cf0c7effcb00d7ebcba5f1987a7f70c69a7bb789ad3cb33d5953f93eda39011490d1754c898f12f5a6b5c65b", + "wx" : "00a49b1e3904315d7b9eccdb36fad8160ed6274ee4cf0c7effcb00d7ebcba5f198", + "wy" : "7a7f70c69a7bb789ad3cb33d5953f93eda39011490d1754c898f12f5a6b5c65b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a49b1e3904315d7b9eccdb36fad8160ed6274ee4cf0c7effcb00d7ebcba5f1987a7f70c69a7bb789ad3cb33d5953f93eda39011490d1754c898f12f5a6b5c65b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEpJseOQQxXXuezNs2+tgWDtYnTuTPDH7/\nywDX68ul8Zh6f3DGmnu3ia08sz1ZU/k+2jkBFJDRdUyJjxL1prXGWw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 378, + "comment" : "r and s are 100-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "301e020d09df8b682430beef6f5fd7c7cf020d0fd0a62e13778f4222a0d61c8a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0418e9a2cc13f31868988806d92026684bd6a6c18a4c5ddad4a03de692fe7302b8cfcc5578f705ee864035bef8c5ea2d2d766f63b2b3bb45b0d4b73902d241c3ae", + "wx" : "18e9a2cc13f31868988806d92026684bd6a6c18a4c5ddad4a03de692fe7302b8", + "wy" : "00cfcc5578f705ee864035bef8c5ea2d2d766f63b2b3bb45b0d4b73902d241c3ae" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000418e9a2cc13f31868988806d92026684bd6a6c18a4c5ddad4a03de692fe7302b8cfcc5578f705ee864035bef8c5ea2d2d766f63b2b3bb45b0d4b73902d241c3ae", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGOmizBPzGGiYiAbZICZoS9amwYpMXdrU\noD3mkv5zArjPzFV49wXuhkA1vvjF6i0tdm9jsrO7RbDUtzkC0kHDrg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 379, + "comment" : "r and s are 128-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30260211008a598e563a89f526c32ebec8de26367a02110084f633e2042630e99dd0f1e16f7a04bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046fcfda69628fe333e4dbb6237fd420a7d91965591d761bd2c1595e8029c4b194750d82e9f366db1304472248240549b3c95d2ddcb0e7944b1ba217c432c7d064", + "wx" : "6fcfda69628fe333e4dbb6237fd420a7d91965591d761bd2c1595e8029c4b194", + "wy" : "750d82e9f366db1304472248240549b3c95d2ddcb0e7944b1ba217c432c7d064" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046fcfda69628fe333e4dbb6237fd420a7d91965591d761bd2c1595e8029c4b194750d82e9f366db1304472248240549b3c95d2ddcb0e7944b1ba217c432c7d064", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEb8/aaWKP4zPk27Yjf9Qgp9kZZVkddhvS\nwVlegCnEsZR1DYLp82bbEwRHIkgkBUmzyV0t3LDnlEsbohfEMsfQZA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 380, + "comment" : "r and s are 160-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e322c7aad4a70024c4f80ea373e7e85f23dcbd11f186d55d5a744cd0f459f6db71d54db09ec66eeadbedbacfe2255bb87d0c1a737b3d3b1c7b76ce78d6342d7c", + "wx" : "00e322c7aad4a70024c4f80ea373e7e85f23dcbd11f186d55d5a744cd0f459f6db", + "wy" : "71d54db09ec66eeadbedbacfe2255bb87d0c1a737b3d3b1c7b76ce78d6342d7c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e322c7aad4a70024c4f80ea373e7e85f23dcbd11f186d55d5a744cd0f459f6db71d54db09ec66eeadbedbacfe2255bb87d0c1a737b3d3b1c7b76ce78d6342d7c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE4yLHqtSnACTE+A6jc+foXyPcvRHxhtVd\nWnRM0PRZ9ttx1U2wnsZu6tvtus/iJVu4fQwac3s9Oxx7ds541jQtfA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 381, + "comment" : "s == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3025022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1020101", + "result" : "valid" + }, + { + "tcId" : 382, + "comment" : "s == 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3025022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1020100", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040d41fafcb0d752323bb2f5baae661dca8564a82bb685faf7869a1944bf1f9c6e5c5639c7a3018b84cfd509cbac7bd1913d8adf7e4d4d416ba9e8f0fed6bf20d8", + "wx" : "0d41fafcb0d752323bb2f5baae661dca8564a82bb685faf7869a1944bf1f9c6e", + "wy" : "5c5639c7a3018b84cfd509cbac7bd1913d8adf7e4d4d416ba9e8f0fed6bf20d8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040d41fafcb0d752323bb2f5baae661dca8564a82bb685faf7869a1944bf1f9c6e5c5639c7a3018b84cfd509cbac7bd1913d8adf7e4d4d416ba9e8f0fed6bf20d8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEDUH6/LDXUjI7svW6rmYdyoVkqCu2hfr3\nhpoZRL8fnG5cVjnHowGLhM/VCcuse9GRPYrffk1NQWup6PD+1r8g2A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 383, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220419d981c515af8cc82545aac0c85e9e308fbb2eab6acd7ed497e0b4145a18fd9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04dc1fec92e7b225ada1677018b6362c614ea5c5a670f836ac485ce893d376ab24bd06303b42c4e6b568e8fb8a37e603f805bc4b2cc9e0e9daa635db16cdae9e79", + "wx" : "00dc1fec92e7b225ada1677018b6362c614ea5c5a670f836ac485ce893d376ab24", + "wy" : "00bd06303b42c4e6b568e8fb8a37e603f805bc4b2cc9e0e9daa635db16cdae9e79" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004dc1fec92e7b225ada1677018b6362c614ea5c5a670f836ac485ce893d376ab24bd06303b42c4e6b568e8fb8a37e603f805bc4b2cc9e0e9daa635db16cdae9e79", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE3B/skueyJa2hZ3AYtjYsYU6lxaZw+Das\nSFzok9N2qyS9BjA7QsTmtWjo+4o35gP4BbxLLMng6dqmNdsWza6eeQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 384, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102201b21717ad71d23bbac60a9ad0baf75b063c9fdf52a00ebf99d022172910993c9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0478fc8e5b816f37ee0d0fee4fa449b0dfacfbb9667a850bf2e62f6582606a8a0d4176387e658fbb0794b08659e984131fbdf2c855439232e0b2485fa2734b8092", + "wx" : "78fc8e5b816f37ee0d0fee4fa449b0dfacfbb9667a850bf2e62f6582606a8a0d", + "wy" : "4176387e658fbb0794b08659e984131fbdf2c855439232e0b2485fa2734b8092" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000478fc8e5b816f37ee0d0fee4fa449b0dfacfbb9667a850bf2e62f6582606a8a0d4176387e658fbb0794b08659e984131fbdf2c855439232e0b2485fa2734b8092", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEePyOW4FvN+4ND+5PpEmw36z7uWZ6hQvy\n5i9lgmBqig1Bdjh+ZY+7B5SwhlnphBMfvfLIVUOSMuCySF+ic0uAkg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 385, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102202f588f66018f3dd14db3e28e77996487e32486b521ed8e5a20f06591951777e9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040a17ab990fe429a96a0d6a6d297795128f66e4ecc3e83913d1846a0c0bfb4daeb90a3909bb40d9d61d9c0419dd6f01788621a3cbb036db2cc4b21a35680d733d", + "wx" : "0a17ab990fe429a96a0d6a6d297795128f66e4ecc3e83913d1846a0c0bfb4dae", + "wy" : "00b90a3909bb40d9d61d9c0419dd6f01788621a3cbb036db2cc4b21a35680d733d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040a17ab990fe429a96a0d6a6d297795128f66e4ecc3e83913d1846a0c0bfb4daeb90a3909bb40d9d61d9c0419dd6f01788621a3cbb036db2cc4b21a35680d733d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEChermQ/kKalqDWptKXeVEo9m5OzD6DkT\n0YRqDAv7Ta65CjkJu0DZ1h2cBBndbwF4hiGjy7A22yzEsho1aA1zPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 386, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220091a08870ff4daf9123b30c20e8c4fc8505758dcf4074fcaff2170c9bfcf74f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0439a08df231316804509067d6f25523c055726326df3e3efa94c419e288d377bf0e06e100b23d85472fb0788007e2e1bb7f60db6ecd832f276e0739ae5bbe7830", + "wx" : "39a08df231316804509067d6f25523c055726326df3e3efa94c419e288d377bf", + "wy" : "0e06e100b23d85472fb0788007e2e1bb7f60db6ecd832f276e0739ae5bbe7830" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000439a08df231316804509067d6f25523c055726326df3e3efa94c419e288d377bf0e06e100b23d85472fb0788007e2e1bb7f60db6ecd832f276e0739ae5bbe7830", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEOaCN8jExaARQkGfW8lUjwFVyYybfPj76\nlMQZ4ojTd78OBuEAsj2FRy+weIAH4uG7f2Dbbs2DLyduBzmuW754MA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 387, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102207c370dc0ce8c59a8b273cba44a7c1191fc3186dc03cab96b0567312df0d0b250", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479071e08d1bace014c34b92e6c29ccbe1dcfc7e80f16c3d92855e7cefe669eca5d3a11a4e45e54377cfb3ea394db876c354e1e90d35382799fbf95ae491cf935", + "wx" : "79071e08d1bace014c34b92e6c29ccbe1dcfc7e80f16c3d92855e7cefe669eca", + "wy" : "5d3a11a4e45e54377cfb3ea394db876c354e1e90d35382799fbf95ae491cf935" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479071e08d1bace014c34b92e6c29ccbe1dcfc7e80f16c3d92855e7cefe669eca5d3a11a4e45e54377cfb3ea394db876c354e1e90d35382799fbf95ae491cf935", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeQceCNG6zgFMNLkubCnMvh3Px+gPFsPZ\nKFXnzv5mnspdOhGk5F5UN3z7PqOU24dsNU4ekNNTgnmfv5WuSRz5NQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 388, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022070b59a7d1ee77a2f9e0491c2a7cfcd0ed04df4a35192f6132dcc668c79a6160e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0490d871670e972d948d86e0833b12935697a38cc17c96f4c6f11861c4967231adad5ec81f335e44d269956a0a36ec30e391d84f6147c945e50336d1158017ba06", + "wx" : "0090d871670e972d948d86e0833b12935697a38cc17c96f4c6f11861c4967231ad", + "wy" : "00ad5ec81f335e44d269956a0a36ec30e391d84f6147c945e50336d1158017ba06" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000490d871670e972d948d86e0833b12935697a38cc17c96f4c6f11861c4967231adad5ec81f335e44d269956a0a36ec30e391d84f6147c945e50336d1158017ba06", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEkNhxZw6XLZSNhuCDOxKTVpejjMF8lvTG\n8RhhxJZyMa2tXsgfM15E0mmVago27DDjkdhPYUfJReUDNtEVgBe6Bg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 389, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102202736d76e412246e097148e2bf62915614eb7c428913a58eb5e9cd4674a9423de", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0482914065bdb591606c6e4b4c430231155a55ac14fdd776d3ddb5460a5ab257e1a6b739fc234dba288922b9797ade8f87912784632348c5326708133247a43209", + "wx" : "0082914065bdb591606c6e4b4c430231155a55ac14fdd776d3ddb5460a5ab257e1", + "wy" : "00a6b739fc234dba288922b9797ade8f87912784632348c5326708133247a43209" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000482914065bdb591606c6e4b4c430231155a55ac14fdd776d3ddb5460a5ab257e1a6b739fc234dba288922b9797ade8f87912784632348c5326708133247a43209", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEgpFAZb21kWBsbktMQwIxFVpVrBT913bT\n3bVGClqyV+Gmtzn8I026KIkiuXl63o+HkSeEYyNIxTJnCBMyR6QyCQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 390, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102204a1e12831fbe93627b02d6e7f24bccdd6ef4b2d0f46739eaf3b1eaf0ca117770", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04be0ae560e37ac967a77da53d0aed473242c7eebeeaf8d9e423d3e7f3f36ac5ed9a5123407ea4cde90bfa2b7697dfabbee4fd8641f1e4a4b51ae5c8cf5a05006c", + "wx" : "00be0ae560e37ac967a77da53d0aed473242c7eebeeaf8d9e423d3e7f3f36ac5ed", + "wy" : "009a5123407ea4cde90bfa2b7697dfabbee4fd8641f1e4a4b51ae5c8cf5a05006c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004be0ae560e37ac967a77da53d0aed473242c7eebeeaf8d9e423d3e7f3f36ac5ed9a5123407ea4cde90bfa2b7697dfabbee4fd8641f1e4a4b51ae5c8cf5a05006c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEvgrlYON6yWenfaU9Cu1HMkLH7r7q+Nnk\nI9Pn8/Nqxe2aUSNAfqTN6Qv6K3aX36u+5P2GQfHkpLUa5cjPWgUAbA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 391, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022006c778d4dfff7dee06ed88bc4e0ed34fc553aad67caf796f2a1c6487c1b2e877", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048cfd6bf55f472fb38463580e07fca982248759ec780e2899a9395d57256c6fa2916c93ec5410f0403471fbd6385c83aa7d051cb18bf49453b030b16f814e50c2", + "wx" : "008cfd6bf55f472fb38463580e07fca982248759ec780e2899a9395d57256c6fa2", + "wy" : "00916c93ec5410f0403471fbd6385c83aa7d051cb18bf49453b030b16f814e50c2" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048cfd6bf55f472fb38463580e07fca982248759ec780e2899a9395d57256c6fa2916c93ec5410f0403471fbd6385c83aa7d051cb18bf49453b030b16f814e50c2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEjP1r9V9HL7OEY1gOB/ypgiSHWex4DiiZ\nqTldVyVsb6KRbJPsVBDwQDRx+9Y4XIOqfQUcsYv0lFOwMLFvgU5Qwg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 392, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102204de459ef9159afa057feb3ec40fef01c45b809f4ab296ea48c206d4249a2b451", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04db40ec05765b314b30d6d3856a7b60fb19ce16e0f79943aecb454c0e67d58956a0c608b9c60dbb59fe04dc0d33e8a884ec922a1ed3a35f6055949e7c9563a99d", + "wx" : "00db40ec05765b314b30d6d3856a7b60fb19ce16e0f79943aecb454c0e67d58956", + "wy" : "00a0c608b9c60dbb59fe04dc0d33e8a884ec922a1ed3a35f6055949e7c9563a99d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004db40ec05765b314b30d6d3856a7b60fb19ce16e0f79943aecb454c0e67d58956a0c608b9c60dbb59fe04dc0d33e8a884ec922a1ed3a35f6055949e7c9563a99d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE20DsBXZbMUsw1tOFantg+xnOFuD3mUOu\ny0VMDmfViVagxgi5xg27Wf4E3A0z6KiE7JIqHtOjX2BVlJ58lWOpnQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 393, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220745d294978007302033502e1acc48b63ae6500be43adbea1b258d6b423dbb416", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043301d39ed85ef80f592718086252f897e4db67f3e1d6edb2cf9ad936b1f0f8976f5fc066c02ddf19634e8e9ba2f62e2874f4157af3342348cdf082979ef2d6ac", + "wx" : "3301d39ed85ef80f592718086252f897e4db67f3e1d6edb2cf9ad936b1f0f897", + "wy" : "6f5fc066c02ddf19634e8e9ba2f62e2874f4157af3342348cdf082979ef2d6ac" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043301d39ed85ef80f592718086252f897e4db67f3e1d6edb2cf9ad936b1f0f8976f5fc066c02ddf19634e8e9ba2f62e2874f4157af3342348cdf082979ef2d6ac", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEMwHTnthe+A9ZJxgIYlL4l+TbZ/Ph1u2y\nz5rZNrHw+JdvX8BmwC3fGWNOjpui9i4odPQVevM0I0jN8IKXnvLWrA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 394, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102207b2a785e3896f59b2d69da57648e80ad3c133a750a2847fd2098ccd902042b6c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b2545a3088538196d9c37af2ba1fa243380c78fb68a68b11f16dbdf6dbf53892017edaf2d350277e5ecbb595e4facfc38dfdb8a61ff1c1dd349ca00842d208ff", + "wx" : "00b2545a3088538196d9c37af2ba1fa243380c78fb68a68b11f16dbdf6dbf53892", + "wy" : "017edaf2d350277e5ecbb595e4facfc38dfdb8a61ff1c1dd349ca00842d208ff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b2545a3088538196d9c37af2ba1fa243380c78fb68a68b11f16dbdf6dbf53892017edaf2d350277e5ecbb595e4facfc38dfdb8a61ff1c1dd349ca00842d208ff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEslRaMIhTgZbZw3ryuh+iQzgMePtoposR\n8W299tv1OJIBftry01Anfl7LtZXk+s/Djf24ph/xwd00nKAIQtII/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 395, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022071ae94a72ca896875e7aa4a4c3d29afdb4b35b6996273e63c47ac519256c5eb1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0493147e90217bd5a82bf39d7687dbd0c37f6e076629cb65f7d5d1328641ef1f38f4c81dd74368522382c1d566aac6d5ac71e4082bc7376df5d2b9aa5257ef3959", + "wx" : "0093147e90217bd5a82bf39d7687dbd0c37f6e076629cb65f7d5d1328641ef1f38", + "wy" : "00f4c81dd74368522382c1d566aac6d5ac71e4082bc7376df5d2b9aa5257ef3959" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000493147e90217bd5a82bf39d7687dbd0c37f6e076629cb65f7d5d1328641ef1f38f4c81dd74368522382c1d566aac6d5ac71e4082bc7376df5d2b9aa5257ef3959", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEkxR+kCF71agr8512h9vQw39uB2Ypy2X3\n1dEyhkHvHzj0yB3XQ2hSI4LB1WaqxtWsceQIK8c3bfXSuapSV+85WQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 396, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102200fa527fa7343c0bc9ec35a6278bfbff4d83301b154fc4bd14aee7eb93445b5f9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043f7dcde1421597eb180d5c5ca1a9d68683ed7818b3c3d4b04b6fc913c48506085cb4f64eb20d31fea8408e66f714dce4351e04c7d299ad1b21c8dfc781b528c3", + "wx" : "3f7dcde1421597eb180d5c5ca1a9d68683ed7818b3c3d4b04b6fc913c4850608", + "wy" : "5cb4f64eb20d31fea8408e66f714dce4351e04c7d299ad1b21c8dfc781b528c3" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043f7dcde1421597eb180d5c5ca1a9d68683ed7818b3c3d4b04b6fc913c48506085cb4f64eb20d31fea8408e66f714dce4351e04c7d299ad1b21c8dfc781b528c3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEP33N4UIVl+sYDVxcoanWhoPteBizw9Sw\nS2/JE8SFBghctPZOsg0x/qhAjmb3FNzkNR4Ex9KZrRshyN/HgbUoww==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 397, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102206539c0adadd0525ff42622164ce9314348bd0863b4c80e936b23ca0414264671", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044b242ee4a0a37835c590f6abe1af6668476c9c12c15b8aff776c7e7a8a452319b720cffae6423cf47aa375fe3b84346a83b09e0efa245eb89d99b2585451603d", + "wx" : "4b242ee4a0a37835c590f6abe1af6668476c9c12c15b8aff776c7e7a8a452319", + "wy" : "00b720cffae6423cf47aa375fe3b84346a83b09e0efa245eb89d99b2585451603d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044b242ee4a0a37835c590f6abe1af6668476c9c12c15b8aff776c7e7a8a452319b720cffae6423cf47aa375fe3b84346a83b09e0efa245eb89d99b2585451603d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESyQu5KCjeDXFkPar4a9maEdsnBLBW4r/\nd2x+eopFIxm3IM/65kI89Hqjdf47hDRqg7CeDvokXridmbJYVFFgPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 398, + "comment" : "point at infinity during verify", + "flags" : [ + "PointDuplication", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f9532aa189138b5e203f8f3a9acf03affa80794f37b647ac289267e8293ededc61ac8ac734bc4c7676bbbf57ead50b4981d9bceee0172e947c22c05f4424c9b2", + "wx" : "00f9532aa189138b5e203f8f3a9acf03affa80794f37b647ac289267e8293ededc", + "wy" : "61ac8ac734bc4c7676bbbf57ead50b4981d9bceee0172e947c22c05f4424c9b2" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f9532aa189138b5e203f8f3a9acf03affa80794f37b647ac289267e8293ededc61ac8ac734bc4c7676bbbf57ead50b4981d9bceee0172e947c22c05f4424c9b2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE+VMqoYkTi14gP486ms8Dr/qAeU83tkes\nKJJn6Ck+3txhrIrHNLxMdna7v1fq1QtJgdm87uAXLpR8IsBfRCTJsg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 399, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040f2256392bbc44714d5fd698b611b7140c3031845f14f8660baea5ec830088f5d5650dc0f784bd907f41b13936a2d13d0e05deb103efb069f8a771b527322155", + "wx" : "0f2256392bbc44714d5fd698b611b7140c3031845f14f8660baea5ec830088f5", + "wy" : "00d5650dc0f784bd907f41b13936a2d13d0e05deb103efb069f8a771b527322155" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040f2256392bbc44714d5fd698b611b7140c3031845f14f8660baea5ec830088f5d5650dc0f784bd907f41b13936a2d13d0e05deb103efb069f8a771b527322155", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEDyJWOSu8RHFNX9aYthG3FAwwMYRfFPhm\nC66l7IMAiPXVZQ3A94S9kH9BsTk2otE9DgXesQPvsGn4p3G1JzIhVQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 400, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04260b66d47b3a3be44364f1fbdd576b824893ce43c78e474db3c1b25106fb486503620b6068877f8b9018efe98191b24cf667053c09ca94da7bcf854bf6924332", + "wx" : "260b66d47b3a3be44364f1fbdd576b824893ce43c78e474db3c1b25106fb4865", + "wy" : "03620b6068877f8b9018efe98191b24cf667053c09ca94da7bcf854bf6924332" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004260b66d47b3a3be44364f1fbdd576b824893ce43c78e474db3c1b25106fb486503620b6068877f8b9018efe98191b24cf667053c09ca94da7bcf854bf6924332", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJgtm1Hs6O+RDZPH73VdrgkiTzkPHjkdN\ns8GyUQb7SGUDYgtgaId/i5AY7+mBkbJM9mcFPAnKlNp7z4VL9pJDMg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 401, + "comment" : "u1 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b802205731b7c4bd04cb9efb836935ff2e547bf2909f86824af4d8df78acf76d7b3d4e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0430549bef5174962c5650944bbd7833220338e2e31f27775666f7d124d8ed7783f43ee6599a8458c9d786dd50cc676babf489757ade3e267d87bf2654a34adb20", + "wx" : "30549bef5174962c5650944bbd7833220338e2e31f27775666f7d124d8ed7783", + "wy" : "00f43ee6599a8458c9d786dd50cc676babf489757ade3e267d87bf2654a34adb20" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000430549bef5174962c5650944bbd7833220338e2e31f27775666f7d124d8ed7783f43ee6599a8458c9d786dd50cc676babf489757ade3e267d87bf2654a34adb20", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEMFSb71F0lixWUJRLvXgzIgM44uMfJ3dW\nZvfRJNjtd4P0PuZZmoRYydeG3VDMZ2ur9Il1et4+Jn2HvyZUo0rbIA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 402, + "comment" : "u1 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022100a8ce483b42fb3461047c96ca00d1ab82c81e3d602cfdab62e059b19562bb03f3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0422283ca6f055439e8540454f63ff02e2e1141d10e34a54737599fae66266636dc8fef97c98fa1160f829b7c1326a069e0bb442428f1503e8cfbb616cd8118832", + "wx" : "22283ca6f055439e8540454f63ff02e2e1141d10e34a54737599fae66266636d", + "wy" : "00c8fef97c98fa1160f829b7c1326a069e0bb442428f1503e8cfbb616cd8118832" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000422283ca6f055439e8540454f63ff02e2e1141d10e34a54737599fae66266636dc8fef97c98fa1160f829b7c1326a069e0bb442428f1503e8cfbb616cd8118832", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEIig8pvBVQ56FQEVPY/8C4uEUHRDjSlRz\ndZn65mJmY23I/vl8mPoRYPgpt8EyagaeC7RCQo8VA+jPu2Fs2BGIMg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 403, + "comment" : "u2 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04068f523d44cbb14a249394861c4f417c19dba72f74e1b123b4cbb89c74541b4144cd654d2b5871942e8d181f9e38f3946b3a73755a20e68ba555d56de6e290f4", + "wx" : "068f523d44cbb14a249394861c4f417c19dba72f74e1b123b4cbb89c74541b41", + "wy" : "44cd654d2b5871942e8d181f9e38f3946b3a73755a20e68ba555d56de6e290f4" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004068f523d44cbb14a249394861c4f417c19dba72f74e1b123b4cbb89c74541b4144cd654d2b5871942e8d181f9e38f3946b3a73755a20e68ba555d56de6e290f4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEBo9SPUTLsUokk5SGHE9BfBnbpy904bEj\ntMu4nHRUG0FEzWVNK1hxlC6NGB+eOPOUazpzdVog5oulVdVt5uKQ9A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 404, + "comment" : "u2 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0242b89", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04123670ccceb86a9d5fce24f070de8dfab093ee66047b17c1d7cca4734820daed76495f92804999f894c0184f72235b2db0a7d8ad077427b346d41f24eb2210a1", + "wx" : "123670ccceb86a9d5fce24f070de8dfab093ee66047b17c1d7cca4734820daed", + "wy" : "76495f92804999f894c0184f72235b2db0a7d8ad077427b346d41f24eb2210a1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004123670ccceb86a9d5fce24f070de8dfab093ee66047b17c1d7cca4734820daed76495f92804999f894c0184f72235b2db0a7d8ad077427b346d41f24eb2210a1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEEjZwzM64ap1fziTwcN6N+rCT7mYEexfB\n18ykc0gg2u12SV+SgEmZ+JTAGE9yI1stsKfYrQd0J7NG1B8k6yIQoQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 405, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02201d109296e9ac43dfa92bcdbcaa64c6d3fb858a822b6e519d9fd2e45279d3bf1a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f5ab53b565f170a3a83e61dc8cb5bb3a217398f0880db80c41da746d533993973d113d69a23e02aeb2e335b28b85490ace7df18279e2f4a7bd6f69c656fe6763", + "wx" : "00f5ab53b565f170a3a83e61dc8cb5bb3a217398f0880db80c41da746d53399397", + "wy" : "3d113d69a23e02aeb2e335b28b85490ace7df18279e2f4a7bd6f69c656fe6763" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f5ab53b565f170a3a83e61dc8cb5bb3a217398f0880db80c41da746d533993973d113d69a23e02aeb2e335b28b85490ace7df18279e2f4a7bd6f69c656fe6763", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE9atTtWXxcKOoPmHcjLW7OiFzmPCIDbgM\nQdp0bVM5k5c9ET1poj4CrrLjNbKLhUkKzn3xgnni9Ke9b2nGVv5nYw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 406, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02203a8a53a9b98a2111e0c5e758a61f57822ead6ac1b9489d7b1bae29dc1dda7a87", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d0abcee886b680233390f1e6d5ce27056cbfec35ba9231725849a3714b06e8285bb11395652a85301cf5110d75d404a1f449ab2ac4767013fd586a9b58114006", + "wx" : "00d0abcee886b680233390f1e6d5ce27056cbfec35ba9231725849a3714b06e828", + "wy" : "5bb11395652a85301cf5110d75d404a1f449ab2ac4767013fd586a9b58114006" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d0abcee886b680233390f1e6d5ce27056cbfec35ba9231725849a3714b06e8285bb11395652a85301cf5110d75d404a1f449ab2ac4767013fd586a9b58114006", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0KvO6Ia2gCMzkPHm1c4nBWy/7DW6kjFy\nWEmjcUsG6ChbsROVZSqFMBz1EQ111ASh9EmrKsR2cBP9WGqbWBFABg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 407, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100ac2416840b83e89e188d94463bd19cdc296fb2f891782dbd736b7241d371e890", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040f82392f4912bad8f4fcb151b290003174526a8cb27091d38c2aed163040698cdc34e9542d264ecffcd6339963804d68fc8a7376312b8a590d836e1ce1a9e637", + "wx" : "0f82392f4912bad8f4fcb151b290003174526a8cb27091d38c2aed163040698c", + "wy" : "00dc34e9542d264ecffcd6339963804d68fc8a7376312b8a590d836e1ce1a9e637" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040f82392f4912bad8f4fcb151b290003174526a8cb27091d38c2aed163040698cdc34e9542d264ecffcd6339963804d68fc8a7376312b8a590d836e1ce1a9e637", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAED4I5L0kSutj0/LFRspAAMXRSaoyycJHT\njCrtFjBAaYzcNOlULSZOz/zWM5ljgE1o/IpzdjErilkNg24c4anmNw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 408, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202ec9288261d8fbcda8ce483b42fb3460c908624c8869161e6b15d76e66ec5dff", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043b8497a00342aa0ca81408f40de05e938a151e6207a912bc35a13ab8ce8682d475d9d40f07fa88a7418e10d0f92bd10f646016be181c04af65e9ac1858f8e145", + "wx" : "3b8497a00342aa0ca81408f40de05e938a151e6207a912bc35a13ab8ce8682d4", + "wy" : "75d9d40f07fa88a7418e10d0f92bd10f646016be181c04af65e9ac1858f8e145" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043b8497a00342aa0ca81408f40de05e938a151e6207a912bc35a13ab8ce8682d475d9d40f07fa88a7418e10d0f92bd10f646016be181c04af65e9ac1858f8e145", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEO4SXoANCqgyoFAj0DeBek4oVHmIHqRK8\nNaE6uM6GgtR12dQPB/qIp0GOEND5K9EPZGAWvhgcBK9l6awYWPjhRQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 409, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0221009288261d8fbcda8ce483b42fb34610470f37567e692db81ce2caa2fe67594614", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e95914e5d692f4c30724c50a232d432a09664e1d485ecfc3a8299b7007b990b501a21060c529f3776a1df1b3828157dbcd432e84d3ac229585bc9234341788a8", + "wx" : "00e95914e5d692f4c30724c50a232d432a09664e1d485ecfc3a8299b7007b990b5", + "wy" : "01a21060c529f3776a1df1b3828157dbcd432e84d3ac229585bc9234341788a8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e95914e5d692f4c30724c50a232d432a09664e1d485ecfc3a8299b7007b990b501a21060c529f3776a1df1b3828157dbcd432e84d3ac229585bc9234341788a8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE6VkU5daS9MMHJMUKIy1DKglmTh1IXs/D\nqCmbcAe5kLUBohBgxSnzd2od8bOCgVfbzUMuhNOsIpWFvJI0NBeIqA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 410, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022025104c3b1f79b519c907685f668c208f63bfd0162312cffe05c2e76ffe7c4ae7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04af3e088449e97df3df478c59536965a18598122efc5bb20d23b9f5e41bc84e8a403177e836fa23bb3ba2b8fe6005c8d79e1392dc3b726dca4eca14e88c00fdfd", + "wx" : "00af3e088449e97df3df478c59536965a18598122efc5bb20d23b9f5e41bc84e8a", + "wy" : "403177e836fa23bb3ba2b8fe6005c8d79e1392dc3b726dca4eca14e88c00fdfd" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004af3e088449e97df3df478c59536965a18598122efc5bb20d23b9f5e41bc84e8a403177e836fa23bb3ba2b8fe6005c8d79e1392dc3b726dca4eca14e88c00fdfd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAErz4IhEnpffPfR4xZU2lloYWYEi78W7IN\nI7n15BvITopAMXfoNvojuzuiuP5gBcjXnhOS3DtybcpOyhTojAD9/Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 411, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022061d8fbcda8ce483b42fb3461047c96c9847a30c583c9b9f495591fa1e037b4fe", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04acaf208d26995e464ebcc54a683b04985c7be74448927e5c15332852886e6d748b182e2468f86cae75d045dc426383d2da3c7e3ab515580f3ff6523f03ce40dc", + "wx" : "00acaf208d26995e464ebcc54a683b04985c7be74448927e5c15332852886e6d74", + "wy" : "008b182e2468f86cae75d045dc426383d2da3c7e3ab515580f3ff6523f03ce40dc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004acaf208d26995e464ebcc54a683b04985c7be74448927e5c15332852886e6d748b182e2468f86cae75d045dc426383d2da3c7e3ab515580f3ff6523f03ce40dc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAErK8gjSaZXkZOvMVKaDsEmFx750RIkn5c\nFTMoUohubXSLGC4kaPhsrnXQRdxCY4PS2jx+OrUVWA8/9lI/A85A3A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 412, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100856739764fc50a930e4201325d77815bcf9b7681ed11213a053e816c5df8e6c6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047821e20d3938bbb48240ff48096e928e404ed91eefa37ea7cb2c8f339347b6ee6f7ada5c814f0f06eae9516a7848361cc3ac2eb4450a4455743d363f84f0dd1d", + "wx" : "7821e20d3938bbb48240ff48096e928e404ed91eefa37ea7cb2c8f339347b6ee", + "wy" : "6f7ada5c814f0f06eae9516a7848361cc3ac2eb4450a4455743d363f84f0dd1d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047821e20d3938bbb48240ff48096e928e404ed91eefa37ea7cb2c8f339347b6ee6f7ada5c814f0f06eae9516a7848361cc3ac2eb4450a4455743d363f84f0dd1d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeCHiDTk4u7SCQP9ICW6SjkBO2R7vo36n\nyyyPM5NHtu5vetpcgU8PBurpUWp4SDYcw6wutEUKRFV0PTY/hPDdHQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 413, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220512c9e1178d280d8464412f2bdf2dd9a7e8065b7ba9216f700779794c9a849bd", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049b0ef17c0bd3dea11be2c3358058a1e10b0283108bf79aaae34355c2329e84a0955f5cf7cb593ee756cf4c9f2f0a488a2993aeba923320bfab98c6f72e079d73", + "wx" : "009b0ef17c0bd3dea11be2c3358058a1e10b0283108bf79aaae34355c2329e84a0", + "wy" : "00955f5cf7cb593ee756cf4c9f2f0a488a2993aeba923320bfab98c6f72e079d73" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049b0ef17c0bd3dea11be2c3358058a1e10b0283108bf79aaae34355c2329e84a0955f5cf7cb593ee756cf4c9f2f0a488a2993aeba923320bfab98c6f72e079d73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEmw7xfAvT3qEb4sM1gFih4QsCgxCL95qq\n40NVwjKehKCVX1z3y1k+51bPTJ8vCkiKKZOuupIzIL+rmMb3Lgedcw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 414, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100c9e4be241bd52c69a2486b6d22291f502f64efab87e244d33cacce68672fd44b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044ba97363a7e14ce09480bd3b88491a7a501b5d4871b470498abc9a698c0699558ce9e198c1d48ec6650d59c15f9e1fb40dc0adccdea6329613e3a9a4decc80f8", + "wx" : "4ba97363a7e14ce09480bd3b88491a7a501b5d4871b470498abc9a698c069955", + "wy" : "008ce9e198c1d48ec6650d59c15f9e1fb40dc0adccdea6329613e3a9a4decc80f8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044ba97363a7e14ce09480bd3b88491a7a501b5d4871b470498abc9a698c0699558ce9e198c1d48ec6650d59c15f9e1fb40dc0adccdea6329613e3a9a4decc80f8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAES6lzY6fhTOCUgL07iEkaelAbXUhxtHBJ\niryaaYwGmVWM6eGYwdSOxmUNWcFfnh+0DcCtzN6mMpYT46mk3syA+A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 415, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100b0a10528cded5f2b80520ac549338c3f61bbb6f69877aa1b2fe9129c0ce717f2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040bad8d9f015770ed8ac654528717734214fff813809b5eb886f87c46d1bac68fc9134ebed0d79a82321cec4c77d5b91c1c7e3c34f6a69cc10140127421b87b92", + "wx" : "0bad8d9f015770ed8ac654528717734214fff813809b5eb886f87c46d1bac68f", + "wy" : "00c9134ebed0d79a82321cec4c77d5b91c1c7e3c34f6a69cc10140127421b87b92" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040bad8d9f015770ed8ac654528717734214fff813809b5eb886f87c46d1bac68fc9134ebed0d79a82321cec4c77d5b91c1c7e3c34f6a69cc10140127421b87b92", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEC62NnwFXcO2KxlRShxdzQhT/+BOAm164\nhvh8RtG6xo/JE06+0NeagjIc7Ex31bkcHH48NPamnMEBQBJ0Ibh7kg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 416, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100f177b6b48b29de102b6a1921aacd9c94bcec17a59991776cefe8ec63934c61b4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ab53f0d664c621138893fc5ee2b26ad2d686bbbb67eda1ee0dfb9609a3f5777afcf2d72bbd357bea8a1545fd4f162f3faf43bf74666cf23914c7e3d8dde79e97", + "wx" : "00ab53f0d664c621138893fc5ee2b26ad2d686bbbb67eda1ee0dfb9609a3f5777a", + "wy" : "00fcf2d72bbd357bea8a1545fd4f162f3faf43bf74666cf23914c7e3d8dde79e97" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ab53f0d664c621138893fc5ee2b26ad2d686bbbb67eda1ee0dfb9609a3f5777afcf2d72bbd357bea8a1545fd4f162f3faf43bf74666cf23914c7e3d8dde79e97", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEq1Pw1mTGIROIk/xe4rJq0taGu7tn7aHu\nDfuWCaP1d3r88tcrvTV76ooVRf1PFi8/r0O/dGZs8jkUx+PY3eeelw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 417, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100e2ef6d691653bc2056d43243559b392abf29526483da4e9e1fff7a3a56628227", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04418698cfe9d564e0e5d04a901c062042d864091573f2820f4592d40027dcfe2634909e2b92b3cbc595203553121ca46efdda2c23ca990e1e56137365c5a5b795", + "wx" : "418698cfe9d564e0e5d04a901c062042d864091573f2820f4592d40027dcfe26", + "wy" : "34909e2b92b3cbc595203553121ca46efdda2c23ca990e1e56137365c5a5b795" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004418698cfe9d564e0e5d04a901c062042d864091573f2820f4592d40027dcfe2634909e2b92b3cbc595203553121ca46efdda2c23ca990e1e56137365c5a5b795", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQYaYz+nVZODl0EqQHAYgQthkCRVz8oIP\nRZLUACfc/iY0kJ4rkrPLxZUgNVMSHKRu/dosI8qZDh5WE3NlxaW3lQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 418, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100d467241da17d9a30823e4b650068d5c0c1668d236e2325cf501608111978a29a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04dc0515e400e3527d2785e4a21d105af4cae862b31e07de117f11c9cd8dc9bc9b034eef9d96a56c0e74efa10a9f75e2a44d1337e8008175fbb40fe1c700144601", + "wx" : "00dc0515e400e3527d2785e4a21d105af4cae862b31e07de117f11c9cd8dc9bc9b", + "wy" : "034eef9d96a56c0e74efa10a9f75e2a44d1337e8008175fbb40fe1c700144601" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004dc0515e400e3527d2785e4a21d105af4cae862b31e07de117f11c9cd8dc9bc9b034eef9d96a56c0e74efa10a9f75e2a44d1337e8008175fbb40fe1c700144601", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE3AUV5ADjUn0nheSiHRBa9MroYrMeB94R\nfxHJzY3JvJsDTu+dlqVsDnTvoQqfdeKkTRM36ACBdfu0D+HHABRGAQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 419, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022056120b4205c1f44f0c46ca231de8ce6e14b7d97c48bc16deb9b5b920e9b8f448", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0453ff623b312669b48cc8a120b76a811e48a930548de8476d2c4607a5524ce592477ae28b239f626067a1d3dee97d769d37b41b184bae95009e401e443e930ef7", + "wx" : "53ff623b312669b48cc8a120b76a811e48a930548de8476d2c4607a5524ce592", + "wy" : "477ae28b239f626067a1d3dee97d769d37b41b184bae95009e401e443e930ef7" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000453ff623b312669b48cc8a120b76a811e48a930548de8476d2c4607a5524ce592477ae28b239f626067a1d3dee97d769d37b41b184bae95009e401e443e930ef7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEU/9iOzEmabSMyKEgt2qBHkipMFSN6Edt\nLEYHpVJM5ZJHeuKLI59iYGeh097pfXadN7QbGEuulQCeQB5EPpMO9w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 420, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100d55555555555555555555555555555547c74934474db157d2a8c3f088aced62a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d2d5348db9d837537c90e930ce35d4cd90e7d7a3460b1384790b632281b98ce843cc7b9a20c8734ac2c62a7d207105f5b2d85c2418939d35e3886f3893cb21b4", + "wx" : "00d2d5348db9d837537c90e930ce35d4cd90e7d7a3460b1384790b632281b98ce8", + "wy" : "43cc7b9a20c8734ac2c62a7d207105f5b2d85c2418939d35e3886f3893cb21b4" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d2d5348db9d837537c90e930ce35d4cd90e7d7a3460b1384790b632281b98ce843cc7b9a20c8734ac2c62a7d207105f5b2d85c2418939d35e3886f3893cb21b4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0tU0jbnYN1N8kOkwzjXUzZDn16NGCxOE\neQtjIoG5jOhDzHuaIMhzSsLGKn0gcQX1sthcJBiTnTXjiG84k8shtA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 421, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100c1777c8853938e536213c02464a936000ba1e21c0fc62075d46c624e23b52f31", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04c5fe4159e0b606879fc2a11088d658030ed7fef2e6711aab04869612fd09c3daac9dc7e198495afc0f43f4de434b8da233d8492cda28db460e8480aecb0a88f5", + "wx" : "00c5fe4159e0b606879fc2a11088d658030ed7fef2e6711aab04869612fd09c3da", + "wy" : "00ac9dc7e198495afc0f43f4de434b8da233d8492cda28db460e8480aecb0a88f5" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004c5fe4159e0b606879fc2a11088d658030ed7fef2e6711aab04869612fd09c3daac9dc7e198495afc0f43f4de434b8da233d8492cda28db460e8480aecb0a88f5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAExf5BWeC2BoefwqEQiNZYAw7X/vLmcRqr\nBIaWEv0Jw9qsncfhmEla/A9D9N5DS42iM9hJLNoo20YOhICuywqI9Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 422, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022030bbb794db588363b40679f6c182a50d3ce9679acdd3ffbe36d7813dacbdc818", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049a72b785c90a695b8e355f5d8fc151046c360d739136241c7fd1e77a0e8b8545a470b4b9a54d1d42956ac43b9c9f2f0f5489da16130b7ba1da38516c912009bc", + "wx" : "009a72b785c90a695b8e355f5d8fc151046c360d739136241c7fd1e77a0e8b8545", + "wy" : "00a470b4b9a54d1d42956ac43b9c9f2f0f5489da16130b7ba1da38516c912009bc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049a72b785c90a695b8e355f5d8fc151046c360d739136241c7fd1e77a0e8b8545a470b4b9a54d1d42956ac43b9c9f2f0f5489da16130b7ba1da38516c912009bc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEmnK3hckKaVuONV9dj8FRBGw2DXORNiQc\nf9Hneg6LhUWkcLS5pU0dQpVqxDucny8PVInaFhMLe6HaOFFskSAJvA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 423, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202c37fd995622c4fb7fffffffffffffffc7cee745110cb45ab558ed7c90c15a2f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0481e427bc8f0509b19a14c16e8883b12641d1d68e070c36ab49d1690e5decd061a993d77e9bc0f2b66edc6cd7ca8e32becf32596405622ea2756006deb3e8ac5f", + "wx" : "0081e427bc8f0509b19a14c16e8883b12641d1d68e070c36ab49d1690e5decd061", + "wy" : "00a993d77e9bc0f2b66edc6cd7ca8e32becf32596405622ea2756006deb3e8ac5f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000481e427bc8f0509b19a14c16e8883b12641d1d68e070c36ab49d1690e5decd061a993d77e9bc0f2b66edc6cd7ca8e32becf32596405622ea2756006deb3e8ac5f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEgeQnvI8FCbGaFMFuiIOxJkHR1o4HDDar\nSdFpDl3s0GGpk9d+m8Dytm7cbNfKjjK+zzJZZAViLqJ1YAbes+isXw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 424, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02207fd995622c4fb7ffffffffffffffffff5d883ffab5b32652ccdcaa290fccb97d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04756279b4827c83372130d4feab66a4397ed4463ac9ee1dc8adcaddcfcec59269b6323337d89af4208ad8818b67e26f9b8080316bc43fab53d1b3b7cea5db9947", + "wx" : "756279b4827c83372130d4feab66a4397ed4463ac9ee1dc8adcaddcfcec59269", + "wy" : "00b6323337d89af4208ad8818b67e26f9b8080316bc43fab53d1b3b7cea5db9947" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004756279b4827c83372130d4feab66a4397ed4463ac9ee1dc8adcaddcfcec59269b6323337d89af4208ad8818b67e26f9b8080316bc43fab53d1b3b7cea5db9947", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEdWJ5tIJ8gzchMNT+q2akOX7URjrJ7h3I\nrcrdz87Fkmm2MjM32Jr0IIrYgYtn4m+bgIAxa8Q/q1PRs7fOpduZRw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 425, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100ffb32ac4589f6ffffffffffffffffffebb107ff56b664ca599b954521f9972fa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04cf9345e850417aa81b01a941a02c5546950c27830841a435f4f3654927c6926d1ec53d04954a47f37915dddb48272fe733322d8250783991709b37d87fa296ef", + "wx" : "00cf9345e850417aa81b01a941a02c5546950c27830841a435f4f3654927c6926d", + "wy" : "1ec53d04954a47f37915dddb48272fe733322d8250783991709b37d87fa296ef" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004cf9345e850417aa81b01a941a02c5546950c27830841a435f4f3654927c6926d1ec53d04954a47f37915dddb48272fe733322d8250783991709b37d87fa296ef", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEz5NF6FBBeqgbAalBoCxVRpUMJ4MIQaQ1\n9PNlSSfGkm0exT0ElUpH83kV3dtIJy/nMzItglB4OZFwmzfYf6KW7w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 426, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02205622c4fb7fffffffffffffffffffffff928a8f1c7ac7bec1808b9f61c01ec327", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f95f625795e6cc17b4c28b1ec643c36a34989084aa6a513812c3aa9bec0730312b22ce0eeeee9d45cee863c1b1d05381ac8b2c896a2cb17d3e9070d41d68bbea", + "wx" : "00f95f625795e6cc17b4c28b1ec643c36a34989084aa6a513812c3aa9bec073031", + "wy" : "2b22ce0eeeee9d45cee863c1b1d05381ac8b2c896a2cb17d3e9070d41d68bbea" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f95f625795e6cc17b4c28b1ec643c36a34989084aa6a513812c3aa9bec0730312b22ce0eeeee9d45cee863c1b1d05381ac8b2c896a2cb17d3e9070d41d68bbea", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE+V9iV5XmzBe0wosexkPDajSYkISqalE4\nEsOqm+wHMDErIs4O7u6dRc7oY8Gx0FOBrIssiWossX0+kHDUHWi76g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 427, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022044104104104104104104104104104103b87853fd3b7d3f8e175125b4382f25ed", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04c3f0aadef8675dc8832a29b397488d6a4fb54780e5967e8b43449498c16ad4bdcb391b545464668d4d0a80b8e283132448a3c0be0abed304cf0839b5920f3867", + "wx" : "00c3f0aadef8675dc8832a29b397488d6a4fb54780e5967e8b43449498c16ad4bd", + "wy" : "00cb391b545464668d4d0a80b8e283132448a3c0be0abed304cf0839b5920f3867" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004c3f0aadef8675dc8832a29b397488d6a4fb54780e5967e8b43449498c16ad4bdcb391b545464668d4d0a80b8e283132448a3c0be0abed304cf0839b5920f3867", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEw/Cq3vhnXciDKimzl0iNak+1R4Dlln6L\nQ0SUmMFq1L3LORtUVGRmjU0KgLjigxMkSKPAvgq+0wTPCDm1kg84Zw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 428, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202739ce739ce739ce739ce739ce739ce705560298d1f2f08dc419ac273a5b54d9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0476b920709a9e5dc54a91bd4772ab2593a76f38841dae2880f547c3bb753ae7c15f01e6779d5e3aba75997bcf7e3f320868ba8f0bc1210ab80b42760a6a701206", + "wx" : "76b920709a9e5dc54a91bd4772ab2593a76f38841dae2880f547c3bb753ae7c1", + "wy" : "5f01e6779d5e3aba75997bcf7e3f320868ba8f0bc1210ab80b42760a6a701206" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000476b920709a9e5dc54a91bd4772ab2593a76f38841dae2880f547c3bb753ae7c15f01e6779d5e3aba75997bcf7e3f320868ba8f0bc1210ab80b42760a6a701206", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEdrkgcJqeXcVKkb1Hcqslk6dvOIQdriiA\n9UfDu3U658FfAeZ3nV46unWZe89+PzIIaLqPC8EhCrgLQnYKanASBg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 429, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100b777777777777777777777777777777688e6a1fe808a97a348671222ff16b863", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e3895147f4e36a13c3483ac00c88a78a8ffa42478afc2e9d8386205b0b1df8b2b4156b56ba217b1ca08bd77f819abb52d742f6b2f7d61353e4cc5663da487317", + "wx" : "00e3895147f4e36a13c3483ac00c88a78a8ffa42478afc2e9d8386205b0b1df8b2", + "wy" : "00b4156b56ba217b1ca08bd77f819abb52d742f6b2f7d61353e4cc5663da487317" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e3895147f4e36a13c3483ac00c88a78a8ffa42478afc2e9d8386205b0b1df8b2b4156b56ba217b1ca08bd77f819abb52d742f6b2f7d61353e4cc5663da487317", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE44lRR/TjahPDSDrADIinio/6QkeK/C6d\ng4YgWwsd+LK0FWtWuiF7HKCL13+BmrtS10L2svfWE1PkzFZj2khzFw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 430, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02206492492492492492492492492492492406dd3a19b8d5fb875235963c593bd2d3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e733999ce348cf7b363dcf931953cf1c247c3a887408c064b9791c178ad350290b0849329da7008e6a2d00142883f8041b9917528fcc4c5bd3f795accff28eb6", + "wx" : "00e733999ce348cf7b363dcf931953cf1c247c3a887408c064b9791c178ad35029", + "wy" : "0b0849329da7008e6a2d00142883f8041b9917528fcc4c5bd3f795accff28eb6" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e733999ce348cf7b363dcf931953cf1c247c3a887408c064b9791c178ad350290b0849329da7008e6a2d00142883f8041b9917528fcc4c5bd3f795accff28eb6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE5zOZnONIz3s2Pc+TGVPPHCR8Ooh0CMBk\nuXkcF4rTUCkLCEkynacAjmotABQog/gEG5kXUo/MTFvT95Wsz/KOtg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 431, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100955555555555555555555555555555547c74934474db157d2a8c3f088aced62c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04069b66f716902cbd51dadff61644ac74c6a35e8c776ea22c9c3492d1d3faa2ece4905cc480bc967ce389b82c8e6692b159d3fe9a268bfc12010993934d7e24dd", + "wx" : "069b66f716902cbd51dadff61644ac74c6a35e8c776ea22c9c3492d1d3faa2ec", + "wy" : "00e4905cc480bc967ce389b82c8e6692b159d3fe9a268bfc12010993934d7e24dd" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004069b66f716902cbd51dadff61644ac74c6a35e8c776ea22c9c3492d1d3faa2ece4905cc480bc967ce389b82c8e6692b159d3fe9a268bfc12010993934d7e24dd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEBptm9xaQLL1R2t/2FkSsdMajXox3bqIs\nnDSS0dP6ouzkkFzEgLyWfOOJuCyOZpKxWdP+miaL/BIBCZOTTX4k3Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 432, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3e3a49a23a6d8abe95461f8445676b17", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049543bfd3a0b678654fc65458e3e62269b30bbd2a40282d92058c3311a61bd885333d78221d9aa0a9663a5df5123d95c3ff4a02606278666179e33c94fe1e0cd1", + "wx" : "009543bfd3a0b678654fc65458e3e62269b30bbd2a40282d92058c3311a61bd885", + "wy" : "333d78221d9aa0a9663a5df5123d95c3ff4a02606278666179e33c94fe1e0cd1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049543bfd3a0b678654fc65458e3e62269b30bbd2a40282d92058c3311a61bd885333d78221d9aa0a9663a5df5123d95c3ff4a02606278666179e33c94fe1e0cd1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAElUO/06C2eGVPxlRY4+YiabMLvSpAKC2S\nBYwzEaYb2IUzPXgiHZqgqWY6XfUSPZXD/0oCYGJ4ZmF54zyU/h4M0Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 433, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100bffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364143", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a6884e6218642518a211f67b03aef6a84d3b32d18eea445b31913e8a1a00f4c531a318166cfcbce34307572eb823edc5d0334c5e5373af4e832e730047996aca", + "wx" : "00a6884e6218642518a211f67b03aef6a84d3b32d18eea445b31913e8a1a00f4c5", + "wy" : "31a318166cfcbce34307572eb823edc5d0334c5e5373af4e832e730047996aca" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a6884e6218642518a211f67b03aef6a84d3b32d18eea445b31913e8a1a00f4c531a318166cfcbce34307572eb823edc5d0334c5e5373af4e832e730047996aca", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEpohOYhhkJRiiEfZ7A672qE07MtGO6kRb\nMZE+ihoA9MUxoxgWbPy840MHVy64I+3F0DNMXlNzr06DLnMAR5lqyg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 434, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220185ddbca6dac41b1da033cfb60c152869e74b3cd66e9ffdf1b6bc09ed65ee40c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04bd4c6f9ab363a204fd1abe0f7158b84417cca2e0d355277ddc17cac22abdbc2dc66469bb8e8e04186e81a2b693cc2121ef22cb61803a2b4ebe1a3e0d367b295d", + "wx" : "00bd4c6f9ab363a204fd1abe0f7158b84417cca2e0d355277ddc17cac22abdbc2d", + "wy" : "00c66469bb8e8e04186e81a2b693cc2121ef22cb61803a2b4ebe1a3e0d367b295d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004bd4c6f9ab363a204fd1abe0f7158b84417cca2e0d355277ddc17cac22abdbc2dc66469bb8e8e04186e81a2b693cc2121ef22cb61803a2b4ebe1a3e0d367b295d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEvUxvmrNjogT9Gr4PcVi4RBfMouDTVSd9\n3BfKwiq9vC3GZGm7jo4EGG6BoraTzCEh7yLLYYA6K06+Gj4NNnspXQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 435, + "comment" : "point duplication during verification", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022032b0d10d8d0e04bc8d4d064d270699e87cffc9b49c5c20730e1c26f6105ddcda022100eaafe4ce77ccd9137f39edc5370d26b73f4dc6ceadfb40a488b2dc6c93f1993c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04bd4c6f9ab363a204fd1abe0f7158b84417cca2e0d355277ddc17cac22abdbc2d399b96447171fbe7917e5d496c33dede10dd349e7fc5d4b141e5c1f1c984d2d2", + "wx" : "00bd4c6f9ab363a204fd1abe0f7158b84417cca2e0d355277ddc17cac22abdbc2d", + "wy" : "399b96447171fbe7917e5d496c33dede10dd349e7fc5d4b141e5c1f1c984d2d2" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004bd4c6f9ab363a204fd1abe0f7158b84417cca2e0d355277ddc17cac22abdbc2d399b96447171fbe7917e5d496c33dede10dd349e7fc5d4b141e5c1f1c984d2d2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEvUxvmrNjogT9Gr4PcVi4RBfMouDTVSd9\n3BfKwiq9vC05m5ZEcXH755F+XUlsM97eEN00nn/F1LFB5cHxyYTS0g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 436, + "comment" : "duplication bug", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022032b0d10d8d0e04bc8d4d064d270699e87cffc9b49c5c20730e1c26f6105ddcda022100eaafe4ce77ccd9137f39edc5370d26b73f4dc6ceadfb40a488b2dc6c93f1993c", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e1815bb1653b8146a2e9160fb0e946112b8994b9d90ef8a36a8ef2ba187b705d11b344caed87db94b9c9eab8a5e3277a9aa46b31768cee5406c3cbcffce0a945", + "wx" : "00e1815bb1653b8146a2e9160fb0e946112b8994b9d90ef8a36a8ef2ba187b705d", + "wy" : "11b344caed87db94b9c9eab8a5e3277a9aa46b31768cee5406c3cbcffce0a945" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e1815bb1653b8146a2e9160fb0e946112b8994b9d90ef8a36a8ef2ba187b705d11b344caed87db94b9c9eab8a5e3277a9aa46b31768cee5406c3cbcffce0a945", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE4YFbsWU7gUai6RYPsOlGESuJlLnZDvij\nao7yuhh7cF0Rs0TK7YfblLnJ6ril4yd6mqRrMXaM7lQGw8vP/OCpRQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 437, + "comment" : "comparison with point at infinity ", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0022033333333333333333333333333333332f222f8faefdb533f265d461c29a47373", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042be9265c148fc61379ca147e651e7f0a1c602cdd66f70b4b6ada2e83f56c1a71f5e1ede0139baa93af588cc7ec1b479b91d230c811575cb143af12c631d16a61", + "wx" : "2be9265c148fc61379ca147e651e7f0a1c602cdd66f70b4b6ada2e83f56c1a71", + "wy" : "00f5e1ede0139baa93af588cc7ec1b479b91d230c811575cb143af12c631d16a61" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042be9265c148fc61379ca147e651e7f0a1c602cdd66f70b4b6ada2e83f56c1a71f5e1ede0139baa93af588cc7ec1b479b91d230c811575cb143af12c631d16a61", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEK+kmXBSPxhN5yhR+ZR5/ChxgLN1m9wtL\natoug/VsGnH14e3gE5uqk69YjMfsG0ebkdIwyBFXXLFDrxLGMdFqYQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 438, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04af3b3f73a409ffa51b10f3cdfa272d9b42358ca9aed2840bfaf5bd67e61fd1c49d07371ca919a069e46c473e6e45b2f2cd019fa21f84d0abfa285be5513781fb", + "wx" : "00af3b3f73a409ffa51b10f3cdfa272d9b42358ca9aed2840bfaf5bd67e61fd1c4", + "wy" : "009d07371ca919a069e46c473e6e45b2f2cd019fa21f84d0abfa285be5513781fb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004af3b3f73a409ffa51b10f3cdfa272d9b42358ca9aed2840bfaf5bd67e61fd1c49d07371ca919a069e46c473e6e45b2f2cd019fa21f84d0abfa285be5513781fb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAErzs/c6QJ/6UbEPPN+ictm0I1jKmu0oQL\n+vW9Z+Yf0cSdBzccqRmgaeRsRz5uRbLyzQGfoh+E0Kv6KFvlUTeB+w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 439, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022100b6db6db6db6db6db6db6db6db6db6db5f30f30127d33e02aad96438927022e9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e155240c3be314924ed787354325fdc3dcfe46d603798f2491152448e0e413b6ce1124313eb0048292f6edf9f248ff9624936e41be6c93dce2df9ab7997289fc", + "wx" : "00e155240c3be314924ed787354325fdc3dcfe46d603798f2491152448e0e413b6", + "wy" : "00ce1124313eb0048292f6edf9f248ff9624936e41be6c93dce2df9ab7997289fc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e155240c3be314924ed787354325fdc3dcfe46d603798f2491152448e0e413b6ce1124313eb0048292f6edf9f248ff9624936e41be6c93dce2df9ab7997289fc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE4VUkDDvjFJJO14c1QyX9w9z+RtYDeY8k\nkRUkSODkE7bOESQxPrAEgpL27fnySP+WJJNuQb5sk9zi35q3mXKJ/A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 440, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee502210099999999999999999999999999999998d668eaf0cf91f9bd7317d2547ced5a5a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0487d4de4ed890da42d7e11a95e56070c95901500c53dd55b62952679884d2598ddf8a37ce6d8f86f4e8b3580d6e6a448520cb740888a3b0eac92bc9a2f1589b4e", + "wx" : "0087d4de4ed890da42d7e11a95e56070c95901500c53dd55b62952679884d2598d", + "wy" : "00df8a37ce6d8f86f4e8b3580d6e6a448520cb740888a3b0eac92bc9a2f1589b4e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000487d4de4ed890da42d7e11a95e56070c95901500c53dd55b62952679884d2598ddf8a37ce6d8f86f4e8b3580d6e6a448520cb740888a3b0eac92bc9a2f1589b4e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEh9TeTtiQ2kLX4RqV5WBwyVkBUAxT3VW2\nKVJnmITSWY3fijfObY+G9OizWA1uakSFIMt0CIijsOrJK8mi8VibTg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 441, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022066666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048c03d72664214f3bdaa6a2e1003b14864000e5993b41b71b68cdebc4a08f628a4a490efc9172983bec203e6096dd9778bec26f6e443e1dde67060dac18ca2440", + "wx" : "008c03d72664214f3bdaa6a2e1003b14864000e5993b41b71b68cdebc4a08f628a", + "wy" : "4a490efc9172983bec203e6096dd9778bec26f6e443e1dde67060dac18ca2440" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048c03d72664214f3bdaa6a2e1003b14864000e5993b41b71b68cdebc4a08f628a4a490efc9172983bec203e6096dd9778bec26f6e443e1dde67060dac18ca2440", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEjAPXJmQhTzvapqLhADsUhkAA5Zk7Qbcb\naM3rxKCPYopKSQ78kXKYO+wgPmCW3Zd4vsJvbkQ+Hd5nBg2sGMokQA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 442, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022049249249249249249249249249249248c79facd43214c011123c1b03a93412a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041ae8bf7b21b3ae00fd01d19b4f72ae6b47bf752edf476cc5cdfa1c2345588e7154dc306165f4f907802478ed2aed41ec54ddf870bc62c2c373971194308411f0", + "wx" : "1ae8bf7b21b3ae00fd01d19b4f72ae6b47bf752edf476cc5cdfa1c2345588e71", + "wy" : "54dc306165f4f907802478ed2aed41ec54ddf870bc62c2c373971194308411f0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041ae8bf7b21b3ae00fd01d19b4f72ae6b47bf752edf476cc5cdfa1c2345588e7154dc306165f4f907802478ed2aed41ec54ddf870bc62c2c373971194308411f0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGui/eyGzrgD9AdGbT3Kua0e/dS7fR2zF\nzfocI0VYjnFU3DBhZfT5B4AkeO0q7UHsVN34cLxiwsNzlxGUMIQR8A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 443, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee502200eb10e5ab95f2f275348d82ad2e4d7949c8193800d8c9c75df58e343f0ebba7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04c5dad21249273cd72ad06943b4e3be0822595bf9fa0459223d27354dea24179b97340abb326afd1eb6de5e525a23aad4929f8a09244c972841a0cb76680ff060", + "wx" : "00c5dad21249273cd72ad06943b4e3be0822595bf9fa0459223d27354dea24179b", + "wy" : "0097340abb326afd1eb6de5e525a23aad4929f8a09244c972841a0cb76680ff060" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004c5dad21249273cd72ad06943b4e3be0822595bf9fa0459223d27354dea24179b97340abb326afd1eb6de5e525a23aad4929f8a09244c972841a0cb76680ff060", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAExdrSEkknPNcq0GlDtOO+CCJZW/n6BFki\nPSc1TeokF5uXNAq7Mmr9HrbeXlJaI6rUkp+KCSRMlyhBoMt2aA/wYA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 444, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f2c6643bf373a0812f993cd616993551d7bc7826d3d6bed0918ed4998b74e837d7160a452dd2c8d3e5f4f80a1efbc33793c35d6e243e9dfe9a39e26dfb7a1b9f", + "wx" : "00f2c6643bf373a0812f993cd616993551d7bc7826d3d6bed0918ed4998b74e837", + "wy" : "00d7160a452dd2c8d3e5f4f80a1efbc33793c35d6e243e9dfe9a39e26dfb7a1b9f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f2c6643bf373a0812f993cd616993551d7bc7826d3d6bed0918ed4998b74e837d7160a452dd2c8d3e5f4f80a1efbc33793c35d6e243e9dfe9a39e26dfb7a1b9f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE8sZkO/NzoIEvmTzWFpk1Ude8eCbT1r7Q\nkY7UmYt06DfXFgpFLdLI0+X0+Aoe+8M3k8NdbiQ+nf6aOeJt+3obnw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 445, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022100b6db6db6db6db6db6db6db6db6db6db5f30f30127d33e02aad96438927022e9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043a1bd608d3187c684d8d461a5406e2b86b09eedc5d2dd28fcc341bd2d483a6d85e3ab9d9e79ecb7e43135782ae60b12ff69b3349c1819b4ab27b738c7f803595", + "wx" : "3a1bd608d3187c684d8d461a5406e2b86b09eedc5d2dd28fcc341bd2d483a6d8", + "wy" : "5e3ab9d9e79ecb7e43135782ae60b12ff69b3349c1819b4ab27b738c7f803595" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043a1bd608d3187c684d8d461a5406e2b86b09eedc5d2dd28fcc341bd2d483a6d85e3ab9d9e79ecb7e43135782ae60b12ff69b3349c1819b4ab27b738c7f803595", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEOhvWCNMYfGhNjUYaVAbiuGsJ7txdLdKP\nzDQb0tSDptheOrnZ557LfkMTV4KuYLEv9pszScGBm0qye3OMf4A1lQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 446, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802210099999999999999999999999999999998d668eaf0cf91f9bd7317d2547ced5a5a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04aee2e5aa96d31bde8b0ec1e71d79e721c5fb094eba49d61dfba6e636a77b215aaf3534fa210143ce3cecc5bfe1e0b136ab6811d662376637efe1eddd212b6ff0", + "wx" : "00aee2e5aa96d31bde8b0ec1e71d79e721c5fb094eba49d61dfba6e636a77b215a", + "wy" : "00af3534fa210143ce3cecc5bfe1e0b136ab6811d662376637efe1eddd212b6ff0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004aee2e5aa96d31bde8b0ec1e71d79e721c5fb094eba49d61dfba6e636a77b215aaf3534fa210143ce3cecc5bfe1e0b136ab6811d662376637efe1eddd212b6ff0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEruLlqpbTG96LDsHnHXnnIcX7CU66SdYd\n+6bmNqd7IVqvNTT6IQFDzjzsxb/h4LE2q2gR1mI3Zjfv4e3dIStv8A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 447, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022066666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04db0dc63f6dfff9b2564498a2423449cc5d894222ddda86eabd6d2bb2549d28d75b5bc20153ef6a2649dc6f116e6ca5c916740a9a645618003a5a448eee928fcc", + "wx" : "00db0dc63f6dfff9b2564498a2423449cc5d894222ddda86eabd6d2bb2549d28d7", + "wy" : "5b5bc20153ef6a2649dc6f116e6ca5c916740a9a645618003a5a448eee928fcc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004db0dc63f6dfff9b2564498a2423449cc5d894222ddda86eabd6d2bb2549d28d75b5bc20153ef6a2649dc6f116e6ca5c916740a9a645618003a5a448eee928fcc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE2w3GP23/+bJWRJiiQjRJzF2JQiLd2obq\nvW0rslSdKNdbW8IBU+9qJkncbxFubKXJFnQKmmRWGAA6WkSO7pKPzA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 448, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022049249249249249249249249249249248c79facd43214c011123c1b03a93412a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0482a004a2ff4aa7c2fd4c71bc88a4ee16d75c11f5ad8599a6eb41ea73e49f80bcf360abc795b4b21b46584a1bebc41720df51a25044880f287c5e5d83f83c1d20", + "wx" : "0082a004a2ff4aa7c2fd4c71bc88a4ee16d75c11f5ad8599a6eb41ea73e49f80bc", + "wy" : "00f360abc795b4b21b46584a1bebc41720df51a25044880f287c5e5d83f83c1d20" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000482a004a2ff4aa7c2fd4c71bc88a4ee16d75c11f5ad8599a6eb41ea73e49f80bcf360abc795b4b21b46584a1bebc41720df51a25044880f287c5e5d83f83c1d20", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEgqAEov9Kp8L9THG8iKTuFtdcEfWthZmm\n60Hqc+SfgLzzYKvHlbSyG0ZYShvrxBcg31GiUESIDyh8Xl2D+DwdIA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 449, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802200eb10e5ab95f2f275348d82ad2e4d7949c8193800d8c9c75df58e343f0ebba7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + "wx" : "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "wy" : "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeb5mfvncu6xVoGKVzocLBwKb/NstzijZ\nWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 450, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304402205731b7c4bd04cb9efb836935ff2e547bf2909f86824af4d8df78acf76d7b3d4e02202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + }, + { + "tcId" : 451, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100a8ce483b42fb3461047c96ca00d1ab82c81e3d602cfdab62e059b19562bb03f302202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777", + "wx" : "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "wy" : "00b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeb5mfvncu6xVoGKVzocLBwKb/NstzijZ\nWfKBWxb4F5i3xSWI2Vw7mqJbBAPx7vdXAuhLt1l6q+ZjuC9vBO8ndw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 452, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304402205731b7c4bd04cb9efb836935ff2e547bf2909f86824af4d8df78acf76d7b3d4e02202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + }, + { + "tcId" : 453, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100a8ce483b42fb3461047c96ca00d1ab82c81e3d602cfdab62e059b19562bb03f302202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff00000001060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1", + "wx" : "6e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff", + "wy" : "01060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff00000001060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEboI1VUUpFAmRgsaywdbwtdKNUMzQBa8s\n4bulQapAyv8AAAABBgSS1aVnPg8l2NUPt+WMSdhtRtQhaVXgqj1A4Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 454, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450220091bc829be861c20c4bb877f0da205b3911584708ddeef580ae46691b245b99d022100c03bb5e77a8fad94736775f31ae381015a93973954b2f3e541457fcb05bccb5f", + "result" : "valid" + }, + { + "tcId" : 455, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100fd6a7eec40d1062b9a4a7af4817b3ea8cd21596d6dc228b287a21b647caab29f022100ab861672dfe3b428c26e08f2f7ca464ad3e966bbf62931408ed1ce2735bab62b", + "result" : "valid" + }, + { + "tcId" : 456, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022053ebb6debd028f195c039ef4e04276adfa2d9551a6e02d2c4143907ec889e6d0022100fa01a27240dd63aff235cd9778c90a7c25c993791cda584fdcca1a979f5faf54", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40cafffffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e", + "wx" : "6e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff", + "wy" : "00fffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40cafffffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEboI1VUUpFAmRgsaywdbwtdKNUMzQBa8s\n4bulQapAyv/////++fttKlqYwfDaJyrwSBpztieSuSvelqoeVcK7Tg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 457, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022060ec4f23f1b2c0b5acae075bbf09be76ffc978aa4d354d309746047a69c43ddd0220798c3df3ada3c91845272b9573e70e683d4e49d90a51f6ad047e24da19355d3b", + "result" : "valid" + }, + { + "tcId" : 458, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502204457c32fe6bf74ee82ff8a38b8076b48323769f3b7970f419352283984dde081022100c6380b3ed90ddba62394c19e02a3b8690d1615dd1120c0fe67b86e7961b8e7d5", + "result" : "valid" + }, + { + "tcId" : 459, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022024820a985bc72c8817ffdec275db7406ed5b897fff0b713d98a721a42bb4c6d402210094f1397d1e577fd47cfed7ac01f2aead6888863a3f8ff21f00c34c41e840af99", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04000000013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d", + "wx" : "013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0", + "wy" : "00f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004000000013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAAAAAT/SIkjWTZX3PCm0irSGMYUL5QP9\nAPhGi18PcOD27nqkO8LG/SWx2CaSQcvdnbsNrJbcliMfQwcF+DhxfQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 460, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402201ed4e5132e4b11268ad55b9a4b7a54ad3e028976bbe85fef2e8cd0a3e4362c7002201d1ce94fd8ffda6df3c307150a98719f276381b0c9d261fba7feba37b402394b", + "result" : "valid" + }, + { + "tcId" : 461, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402204f030196e9a558b5af5557c7347d132b1308b3a1ce88a6bc6bf566ed22b5da780220392ddc6e83f995a0030856ecd0822449d8dac2bead6d269ef4b307d535dce238", + "result" : "valid" + }, + { + "tcId" : 462, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450221009eaa256762ee3d5d3ed269a2907c4a836c92073918be335469e25743ea9ba0e102202c70e1dbee671e9bbd6b68695ae40d58d11ce82592cf9824914a1d8d9e429fcc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0425afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dfffffffffa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35", + "wx" : "25afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dffffffff", + "wy" : "00fa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000425afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dfffffffffa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJa/WiayrrtZ8Hylt5ZQG+MVQ9XFGoLTs\nLJeHbf/////6RqduUgMi37xJHsTwzBl0IPxOpYg9j23VPDVLxPZ8NQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 463, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100db965e2d0d25c84c30ae8a3e31f12b55b8784b90f91d443a70f2c7cb4828f5bf022100aabb284a7715095cb11714ec76779c08ad5496d8870e2109467a21093f0b8bca", + "result" : "valid" + }, + { + "tcId" : 464, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022058675835add3dd65f25c76b02545176c37a840748fb64a16b8bb113e361cf55d02203b1e25552a5c35732f33735f4dc6f50f947bbecb734599a987f1ffbf86b2842d", + "result" : "valid" + }, + { + "tcId" : 465, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220786a687776da9c185afa16f90a596f5ddce3c2d3caece0344101be24581b86e1022075b13da23be046d551c68b54e72a990288dd73099800705e1a854366662b950e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb93f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff", + "wx" : "00d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb9", + "wy" : "3f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb93f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0S5sZrZ3NMPITSYBz1013Al+J2N/CspK\nT9t0tqrdO7k/W9/4i9VzbfiY5pkAbtdQ8RzwfFhmzXrXDHEh/////w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 466, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100cfce7188667568bd7d5269a75bef42aa360705db5232d189adcf2323036852bb02205d06871c28d89198870f94264ae11744d254682e06f154332f976b803da8a1a2", + "result" : "valid" + }, + { + "tcId" : 467, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100b21cc81843c74779fc5ba9fe1b0d5e7173f696c6e91398cf83a31bc735b6050b0221008945e8711789093c80fe6cec3947cc9c36ffe2505f1ef721bb507e05c9c07bd2", + "result" : "valid" + }, + { + "tcId" : 468, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100fbc5087d1e6bbc32dae22a837d03151028ac69ad71e66e5fc841de0548c06dce022100e2dfa5e56de28d72d0e770e7666033c42431bcae1fc6cffd9593d54cbcfcfa7c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb", + "wx" : "6d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000", + "wy" : "00e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbUp/YNR3Sk8KqLve25U8fup5CUB+MWR1\nVmS8KAAAAADmWdNOTfONnoyeqt+6NmEsdpGVvobHeqw/NueLU4aA+w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 469, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502205ea780b73ce027c03ff81e1b26e61076c8944a835d349cd757ece0c4ddf1da24022100bd9b87db26158d5b9132bb0f3df54a2ab6c9ae9a4e0b8496a539ab4ab588ccba", + "result" : "valid" + }, + { + "tcId" : 470, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402204618f1a11cf8cbc1966416785c3149f75a71ae256d445deb31008d51ba6088c20220408087725dd6ce18bfb7493a5460b54022245e5dbd731ed6d35db88a51d2ba6e", + "result" : "valid" + }, + { + "tcId" : 471, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450221009d9cdb94e5e9a66bf8eedfdf9f1af43713bb05d880dec89aec21631958970de60220732932649bea35f11dfe0926618e4f091c1b264ca128a9eef14e6d94d7c9f207", + "result" : "valid" + } + ] + } + ] +} diff --git a/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha3_512_test.json b/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha3_512_test.json new file mode 100644 index 0000000000..abbdf2eca3 --- /dev/null +++ b/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha3_512_test.json @@ -0,0 +1,7100 @@ +{ + "algorithm" : "ECDSA", + "schema" : "ecdsa_verify_schema.json", + "generatorVersion" : "0.9rc5", + "numberOfTests" : 537, + "header" : [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes" : { + "ArithmeticError" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.", + "cves" : [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature" : { + "bugType" : "BER_ENCODING", + "description" : "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect" : "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves" : [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication" : { + "bugType" : "EDGE_CASE", + "description" : "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding" : { + "bugType" : "CAN_OF_WORMS", + "description" : "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449" + ] + }, + "MissingZero" : { + "bugType" : "LEGACY", + "description" : "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect" : "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "CVE-2019-0865" + ] + }, + "PointDuplication" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves" : [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "2020-13895" + ] + }, + "SpecialCaseHash" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "Untruncatedhash" : { + "bugType" : "MISSING_STEP", + "description" : "If the size of the digest is longer than the size of the underlying order of the multiplicative subgroup then the hash digest must be truncated during signature generation and verification. This test vector contains a signature where this step has been omitted." + }, + "ValidSignature" : { + "bugType" : "BASIC", + "description" : "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups" : [ + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152", + "wx" : "782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963", + "wy" : "00af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeCyO0X47Kng7VGTzOwllKnHGeOBexR6E\n4rz8Zjo96WOvmstCgLjH98QvTvmrpiRewewXEv04oPqWQY2M1qphUg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 1, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "", + "sig" : "3044022022bb0000e9648a0ee659f9b6a9ab6513dc90ab968ec49d3953f64c82bddc852002204aa0dfd047b0786e118231eff7e86311487ec9d1bc84aaef1f736f4178c288f9", + "result" : "valid" + }, + { + "tcId" : 2, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "4d7367", + "sig" : "3046022100855b60549e0d84ed3959ab2800eee0cbc9a2cecae2e510ed51e9f27975cdcc4e022100c60dcc80a3dcce9911cb9cfba123b6a6f85d20ab695a9ee7d46e0bd9eeb337f9", + "result" : "valid" + }, + { + "tcId" : 3, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304502205cd73aa58188658ea513f8ecf0d9e2da9eb5d6bcc7cbadcd6a4a8e0cba5176de022100a9f090bb5d3fcf5b7fa7e16d287718773f5f4ba0973b329a3788cd45b4bd3765", + "result" : "valid" + }, + { + "tcId" : 4, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "0000000000000000000000000000000000000000", + "sig" : "304502207f9eebad2a323f8346445d1e2fcde47aba4c96ad4686172bebcffaa604e8dbe3022100ec09d731e58e3a337ea03ab72612b1f801b88eac571bd3a031250ac6f2e34fda", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6ff0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9", + "wx" : "00b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6f", + "wy" : "00f0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6ff0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEuDj/ROW8F3vyEYnQdmCC/J2EMiaIf8l2\nA3EQC37iCm/wyddb+6ezGmvKGXRJbutW3jVwcZVdg8Sxutqgshgy6Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 5, + "comment" : "signature malleability", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304402207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022059f100a7e4a774cf8f04577ebd9ab9ab2f09cfc5a6be10ffd0338524e6c26caa", + "result" : "valid" + }, + { + "tcId" : 6, + "comment" : "Legacy: ASN encoding of s misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "304402207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60220a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 7, + "comment" : "valid", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "valid" + }, + { + "tcId" : 8, + "comment" : "length of sequence [r, s] uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30814502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 9, + "comment" : "length of sequence [r, s] contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3082004502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 10, + "comment" : "length of sequence [r, s] uses 70 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304602207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 11, + "comment" : "length of sequence [r, s] uses 68 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304402207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 12, + "comment" : "uint32 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085010000004502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 13, + "comment" : "uint64 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308901000000000000004502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 14, + "comment" : "length of sequence [r, s] = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30847fffffff02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 15, + "comment" : "length of sequence [r, s] = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30848000000002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 16, + "comment" : "length of sequence [r, s] = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084ffffffff02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 17, + "comment" : "length of sequence [r, s] = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085ffffffffff02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 18, + "comment" : "length of sequence [r, s] = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3088ffffffffffffffff02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 19, + "comment" : "incorrect length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30ff02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 20, + "comment" : "replaced sequence [r, s] by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 21, + "comment" : "removing sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "", + "result" : "invalid" + }, + { + "tcId" : 22, + "comment" : "lonely sequence tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30", + "result" : "invalid" + }, + { + "tcId" : 23, + "comment" : "appending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000", + "result" : "invalid" + }, + { + "tcId" : 24, + "comment" : "prepending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047000002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 25, + "comment" : "appending unused 0's to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000", + "result" : "invalid" + }, + { + "tcId" : 26, + "comment" : "appending null value to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970500", + "result" : "invalid" + }, + { + "tcId" : 27, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a498177304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 28, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492500304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 29, + "comment" : "appending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 30, + "comment" : "including undefined tags", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304daa00bb00cd00304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 31, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2228aa00bb00cd0002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 32, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe62229aa00bb00cd00022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 33, + "comment" : "truncated length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3081", + "result" : "invalid" + }, + { + "tcId" : 34, + "comment" : "including undefined tags to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304baa02aabb304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 35, + "comment" : "using composition with indefinite length for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000", + "result" : "invalid" + }, + { + "tcId" : 36, + "comment" : "using composition with wrong tag for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080314502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000", + "result" : "invalid" + }, + { + "tcId" : 37, + "comment" : "Replacing sequence [r, s] with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "0500", + "result" : "invalid" + }, + { + "tcId" : 38, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2e4502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 39, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2f4502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 40, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "314502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 41, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "324502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 42, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "ff4502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 43, + "comment" : "dropping value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3000", + "result" : "invalid" + }, + { + "tcId" : 44, + "comment" : "using composition for sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30493001023044207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 45, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304402207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4", + "result" : "invalid" + }, + { + "tcId" : 46, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 47, + "comment" : "sequence [r, s] of size 4166 to check for overflows", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3082104602207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 48, + "comment" : "indefinite length", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "308002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000", + "result" : "invalid" + }, + { + "tcId" : 49, + "comment" : "indefinite length with truncated delimiter", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d49700", + "result" : "invalid" + }, + { + "tcId" : 50, + "comment" : "indefinite length with additional element", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d49705000000", + "result" : "invalid" + }, + { + "tcId" : 51, + "comment" : "indefinite length with truncated element", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497060811220000", + "result" : "invalid" + }, + { + "tcId" : 52, + "comment" : "indefinite length with garbage", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000fe02beef", + "result" : "invalid" + }, + { + "tcId" : 53, + "comment" : "indefinite length with nonempty EOC", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970002beef", + "result" : "invalid" + }, + { + "tcId" : 54, + "comment" : "prepend empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047300002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 55, + "comment" : "append empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4973000", + "result" : "invalid" + }, + { + "tcId" : 56, + "comment" : "append zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304802207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497020100", + "result" : "invalid" + }, + { + "tcId" : 57, + "comment" : "append garbage with high tag number", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304802207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497bf7f00", + "result" : "invalid" + }, + { + "tcId" : 58, + "comment" : "append null with explicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304902207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497a0020500", + "result" : "invalid" + }, + { + "tcId" : 59, + "comment" : "append null with implicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497a000", + "result" : "invalid" + }, + { + "tcId" : 60, + "comment" : "sequence of sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 61, + "comment" : "truncated sequence: removed last 1 elements", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302202207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6", + "result" : "invalid" + }, + { + "tcId" : 62, + "comment" : "repeating element in sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "306802207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 63, + "comment" : "flipped bit 0 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30437d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe7022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 64, + "comment" : "flipped bit 32 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30437d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccc4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 65, + "comment" : "flipped bit 48 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30437d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577462ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 66, + "comment" : "flipped bit 64 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30437d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd477472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 67, + "comment" : "length of r uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30460281207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 68, + "comment" : "length of r contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3047028200207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 69, + "comment" : "length of r uses 33 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502217d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 70, + "comment" : "length of r uses 31 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045021f7d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 71, + "comment" : "uint32 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a028501000000207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 72, + "comment" : "uint64 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e02890100000000000000207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 73, + "comment" : "length of r = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902847fffffff7d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 74, + "comment" : "length of r = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284800000007d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 75, + "comment" : "length of r = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284ffffffff7d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 76, + "comment" : "length of r = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285ffffffffff7d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 77, + "comment" : "length of r = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0288ffffffffffffffff7d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 78, + "comment" : "incorrect length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502ff7d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 79, + "comment" : "replaced r by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502807d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 80, + "comment" : "removing r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3023022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 81, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 82, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302302207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe602", + "result" : "invalid" + }, + { + "tcId" : 83, + "comment" : "appending 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702227d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60000022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 84, + "comment" : "prepending 0's to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047022200007d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 85, + "comment" : "appending unused 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60000022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 86, + "comment" : "appending null value to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702227d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60500022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 87, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a222549817702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 88, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492224250002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 89, + "comment" : "appending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d222202207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60004deadbeef022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 90, + "comment" : "truncated length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250281022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 91, + "comment" : "including undefined tags to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b2226aa02aabb02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 92, + "comment" : "using composition with indefinite length for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049228002207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60000022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 93, + "comment" : "using composition with wrong tag for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049228003207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60000022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 94, + "comment" : "Replacing r with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30250500022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 95, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304500207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 96, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304501207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 97, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304503207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 98, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304504207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 99, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045ff207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 100, + "comment" : "dropping value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250200022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 101, + "comment" : "using composition for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049222402017d021f68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 102, + "comment" : "modifying first byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502207f68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 103, + "comment" : "modifying last byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32ab66022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 104, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044021f7d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32ab022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 105, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044021f68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 106, + "comment" : "r of size 4129 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30821048028210217d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 107, + "comment" : "leading ff in r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30460221ff7d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 108, + "comment" : "replaced r by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026090180022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 109, + "comment" : "replacing r with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 110, + "comment" : "flipped bit 0 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe600a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d496", + "result" : "invalid" + }, + { + "tcId" : 111, + "comment" : "flipped bit 32 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe600a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed966e973d497", + "result" : "invalid" + }, + { + "tcId" : 112, + "comment" : "flipped bit 48 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe600a60eff581b588b3070fba881426546538ba50d21088a8f3bef9fd967e973d497", + "result" : "invalid" + }, + { + "tcId" : 113, + "comment" : "flipped bit 64 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe600a60eff581b588b3070fba881426546538ba50d21088a8f3aef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 114, + "comment" : "length of s uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304602207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe602812100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 115, + "comment" : "length of s contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60282002100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 116, + "comment" : "length of s uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022200a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 117, + "comment" : "length of s uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022000a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 118, + "comment" : "uint32 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60285010000002100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 119, + "comment" : "uint64 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6028901000000000000002100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 120, + "comment" : "length of s = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe602847fffffff00a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 121, + "comment" : "length of s = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe602848000000000a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 122, + "comment" : "length of s = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60284ffffffff00a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 123, + "comment" : "length of s = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60285ffffffffff00a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 124, + "comment" : "length of s = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60288ffffffffffffffff00a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 125, + "comment" : "incorrect length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe602ff00a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 126, + "comment" : "replaced s by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6028000a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 127, + "comment" : "appending 0's to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022300a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000", + "result" : "invalid" + }, + { + "tcId" : 128, + "comment" : "prepending 0's to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60223000000a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 129, + "comment" : "appending null value to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022300a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970500", + "result" : "invalid" + }, + { + "tcId" : 130, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe62226498177022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 131, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe622252500022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 132, + "comment" : "appending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe62223022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 133, + "comment" : "truncated length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60281", + "result" : "invalid" + }, + { + "tcId" : 134, + "comment" : "including undefined tags to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b02207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe62227aa02aabb022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 135, + "comment" : "using composition with indefinite length for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe62280022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000", + "result" : "invalid" + }, + { + "tcId" : 136, + "comment" : "using composition with wrong tag for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe62280032100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000", + "result" : "invalid" + }, + { + "tcId" : 137, + "comment" : "Replacing s with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302402207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60500", + "result" : "invalid" + }, + { + "tcId" : 138, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6002100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 139, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6012100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 140, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6032100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 141, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6042100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 142, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6ff2100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 143, + "comment" : "dropping value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60200", + "result" : "invalid" + }, + { + "tcId" : 144, + "comment" : "using composition for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe622250201000220a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 145, + "comment" : "modifying first byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022102a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 146, + "comment" : "modifying last byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d417", + "result" : "invalid" + }, + { + "tcId" : 147, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304402207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022000a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4", + "result" : "invalid" + }, + { + "tcId" : 148, + "comment" : "s of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3082104802207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60282102200a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d4970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 149, + "comment" : "leading ff in s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304602207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe60222ff00a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 150, + "comment" : "replaced s by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6090180", + "result" : "invalid" + }, + { + "tcId" : 151, + "comment" : "replacing s with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502207d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6020100", + "result" : "invalid" + }, + { + "tcId" : 152, + "comment" : "replaced r by r + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460221017d68757ac197624ae5c77dfa1b3bdda5c3a93710ad3a9c1137198b5a1f68ed27022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 153, + "comment" : "replaced r by r - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460221ff7d68757ac197624ae5c77dfa1b3bdda84e4b7d434ea95b99b774ce407efc6aa5022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 154, + "comment" : "replaced r by r + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3047022201007d68757ac197624ae5c77dfa1b3bdc61b7d740d94692379549a5b99d8573ece6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 155, + "comment" : "replaced r by -r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "3045022082978a853e689db51a388205e4c42258f705a5d6020e042a88b8d332b0cd541a022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 156, + "comment" : "replaced r by n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "304602210082978a853e689db51a388205e4c42257b1b482bcb156a466488b31bf8103955b022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 157, + "comment" : "replaced r by -n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fe82978a853e689db51a388205e4c4225a3c56c8ef52c563eec8e674a5e09712d9022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 158, + "comment" : "replaced r by r + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30460221017d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 159, + "comment" : "replaced r by r + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e02290100000000000000007d68757ac197624ae5c77dfa1b3bdda708fa5a29fdf1fbd577472ccd4f32abe6022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 160, + "comment" : "replaced s by s + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022101a60eff581b588b3070fba881426546524653ea07b7d32f77af7137f4b9aa15d8022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 161, + "comment" : "replaced s by s - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450220a60eff581b588b3070fba88142654654d0f6303a5941ef002fcc7adb193d9356022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 162, + "comment" : "replaced s by s + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304702220100a60eff581b588b3070fba8814265450e3a81f3d0512acafbc1fd66381fb51597022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 163, + "comment" : "replaced s by -s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221ff59f100a7e4a774cf8f04577ebd9ab9ac745af2def77570c410612698168c2b69022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 164, + "comment" : "replaced s by -n - s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fe59f100a7e4a774cf8f04577ebd9ab9adb9ac15f8482cd088508ec80b4655ea28022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 165, + "comment" : "replaced s by s + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "3046022101a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 166, + "comment" : "replaced s by s - 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450220a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 167, + "comment" : "replaced s by s + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e0229010000000000000000a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497022100a60eff581b588b3070fba881426546538ba50d21088a8f3bef9ed967e973d497", + "result" : "invalid" + }, + { + "tcId" : 168, + "comment" : "Signature with special case values r=0 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020100", + "result" : "invalid" + }, + { + "tcId" : 169, + "comment" : "Signature with special case values r=0 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020101", + "result" : "invalid" + }, + { + "tcId" : 170, + "comment" : "Signature with special case values r=0 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000201ff", + "result" : "invalid" + }, + { + "tcId" : 171, + "comment" : "Signature with special case values r=0 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 172, + "comment" : "Signature with special case values r=0 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 173, + "comment" : "Signature with special case values r=0 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 174, + "comment" : "Signature with special case values r=0 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 175, + "comment" : "Signature with special case values r=0 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 176, + "comment" : "Signature with special case values r=1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020100", + "result" : "invalid" + }, + { + "tcId" : 177, + "comment" : "Signature with special case values r=1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "invalid" + }, + { + "tcId" : 178, + "comment" : "Signature with special case values r=1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010201ff", + "result" : "invalid" + }, + { + "tcId" : 179, + "comment" : "Signature with special case values r=1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 180, + "comment" : "Signature with special case values r=1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 181, + "comment" : "Signature with special case values r=1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 182, + "comment" : "Signature with special case values r=1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 183, + "comment" : "Signature with special case values r=1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 184, + "comment" : "Signature with special case values r=-1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020100", + "result" : "invalid" + }, + { + "tcId" : 185, + "comment" : "Signature with special case values r=-1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020101", + "result" : "invalid" + }, + { + "tcId" : 186, + "comment" : "Signature with special case values r=-1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0201ff", + "result" : "invalid" + }, + { + "tcId" : 187, + "comment" : "Signature with special case values r=-1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 188, + "comment" : "Signature with special case values r=-1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 189, + "comment" : "Signature with special case values r=-1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 190, + "comment" : "Signature with special case values r=-1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 191, + "comment" : "Signature with special case values r=-1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 192, + "comment" : "Signature with special case values r=n and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020100", + "result" : "invalid" + }, + { + "tcId" : 193, + "comment" : "Signature with special case values r=n and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101", + "result" : "invalid" + }, + { + "tcId" : 194, + "comment" : "Signature with special case values r=n and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410201ff", + "result" : "invalid" + }, + { + "tcId" : 195, + "comment" : "Signature with special case values r=n and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 196, + "comment" : "Signature with special case values r=n and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 197, + "comment" : "Signature with special case values r=n and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 198, + "comment" : "Signature with special case values r=n and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 199, + "comment" : "Signature with special case values r=n and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 200, + "comment" : "Signature with special case values r=n - 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140020100", + "result" : "invalid" + }, + { + "tcId" : 201, + "comment" : "Signature with special case values r=n - 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140020101", + "result" : "invalid" + }, + { + "tcId" : 202, + "comment" : "Signature with special case values r=n - 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641400201ff", + "result" : "invalid" + }, + { + "tcId" : 203, + "comment" : "Signature with special case values r=n - 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 204, + "comment" : "Signature with special case values r=n - 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 205, + "comment" : "Signature with special case values r=n - 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 206, + "comment" : "Signature with special case values r=n - 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 207, + "comment" : "Signature with special case values r=n - 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 208, + "comment" : "Signature with special case values r=n + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142020100", + "result" : "invalid" + }, + { + "tcId" : 209, + "comment" : "Signature with special case values r=n + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142020101", + "result" : "invalid" + }, + { + "tcId" : 210, + "comment" : "Signature with special case values r=n + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641420201ff", + "result" : "invalid" + }, + { + "tcId" : 211, + "comment" : "Signature with special case values r=n + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 212, + "comment" : "Signature with special case values r=n + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 213, + "comment" : "Signature with special case values r=n + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 214, + "comment" : "Signature with special case values r=n + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 215, + "comment" : "Signature with special case values r=n + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 216, + "comment" : "Signature with special case values r=p and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f020100", + "result" : "invalid" + }, + { + "tcId" : 217, + "comment" : "Signature with special case values r=p and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f020101", + "result" : "invalid" + }, + { + "tcId" : 218, + "comment" : "Signature with special case values r=p and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0201ff", + "result" : "invalid" + }, + { + "tcId" : 219, + "comment" : "Signature with special case values r=p and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 220, + "comment" : "Signature with special case values r=p and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 221, + "comment" : "Signature with special case values r=p and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 222, + "comment" : "Signature with special case values r=p and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 223, + "comment" : "Signature with special case values r=p and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 224, + "comment" : "Signature with special case values r=p + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30020100", + "result" : "invalid" + }, + { + "tcId" : 225, + "comment" : "Signature with special case values r=p + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30020101", + "result" : "invalid" + }, + { + "tcId" : 226, + "comment" : "Signature with special case values r=p + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc300201ff", + "result" : "invalid" + }, + { + "tcId" : 227, + "comment" : "Signature with special case values r=p + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 228, + "comment" : "Signature with special case values r=p + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 229, + "comment" : "Signature with special case values r=p + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 230, + "comment" : "Signature with special case values r=p + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 231, + "comment" : "Signature with special case values r=p + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 232, + "comment" : "Signature encoding contains incorrect types: r=0, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020100090380fe01", + "result" : "invalid" + }, + { + "tcId" : 233, + "comment" : "Signature encoding contains incorrect types: r=0, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100090142", + "result" : "invalid" + }, + { + "tcId" : 234, + "comment" : "Signature encoding contains incorrect types: r=0, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010101", + "result" : "invalid" + }, + { + "tcId" : 235, + "comment" : "Signature encoding contains incorrect types: r=0, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010100", + "result" : "invalid" + }, + { + "tcId" : 236, + "comment" : "Signature encoding contains incorrect types: r=0, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000500", + "result" : "invalid" + }, + { + "tcId" : 237, + "comment" : "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000c00", + "result" : "invalid" + }, + { + "tcId" : 238, + "comment" : "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000c0130", + "result" : "invalid" + }, + { + "tcId" : 239, + "comment" : "Signature encoding contains incorrect types: r=0, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201003000", + "result" : "invalid" + }, + { + "tcId" : 240, + "comment" : "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201003003020100", + "result" : "invalid" + }, + { + "tcId" : 241, + "comment" : "Signature encoding contains incorrect types: r=1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020101090380fe01", + "result" : "invalid" + }, + { + "tcId" : 242, + "comment" : "Signature encoding contains incorrect types: r=1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101090142", + "result" : "invalid" + }, + { + "tcId" : 243, + "comment" : "Signature encoding contains incorrect types: r=1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010101", + "result" : "invalid" + }, + { + "tcId" : 244, + "comment" : "Signature encoding contains incorrect types: r=1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010100", + "result" : "invalid" + }, + { + "tcId" : 245, + "comment" : "Signature encoding contains incorrect types: r=1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010500", + "result" : "invalid" + }, + { + "tcId" : 246, + "comment" : "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010c00", + "result" : "invalid" + }, + { + "tcId" : 247, + "comment" : "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010c0130", + "result" : "invalid" + }, + { + "tcId" : 248, + "comment" : "Signature encoding contains incorrect types: r=1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201013000", + "result" : "invalid" + }, + { + "tcId" : 249, + "comment" : "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201013003020100", + "result" : "invalid" + }, + { + "tcId" : 250, + "comment" : "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 251, + "comment" : "Signature encoding contains incorrect types: r=-1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff090142", + "result" : "invalid" + }, + { + "tcId" : 252, + "comment" : "Signature encoding contains incorrect types: r=-1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010101", + "result" : "invalid" + }, + { + "tcId" : 253, + "comment" : "Signature encoding contains incorrect types: r=-1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010100", + "result" : "invalid" + }, + { + "tcId" : 254, + "comment" : "Signature encoding contains incorrect types: r=-1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0500", + "result" : "invalid" + }, + { + "tcId" : 255, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0c00", + "result" : "invalid" + }, + { + "tcId" : 256, + "comment" : "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0c0130", + "result" : "invalid" + }, + { + "tcId" : 257, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff3000", + "result" : "invalid" + }, + { + "tcId" : 258, + "comment" : "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff3003020100", + "result" : "invalid" + }, + { + "tcId" : 259, + "comment" : "Signature encoding contains incorrect types: r=n, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141090380fe01", + "result" : "invalid" + }, + { + "tcId" : 260, + "comment" : "Signature encoding contains incorrect types: r=n, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141090142", + "result" : "invalid" + }, + { + "tcId" : 261, + "comment" : "Signature encoding contains incorrect types: r=n, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141010101", + "result" : "invalid" + }, + { + "tcId" : 262, + "comment" : "Signature encoding contains incorrect types: r=n, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141010100", + "result" : "invalid" + }, + { + "tcId" : 263, + "comment" : "Signature encoding contains incorrect types: r=n, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410500", + "result" : "invalid" + }, + { + "tcId" : 264, + "comment" : "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410c00", + "result" : "invalid" + }, + { + "tcId" : 265, + "comment" : "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410c0130", + "result" : "invalid" + }, + { + "tcId" : 266, + "comment" : "Signature encoding contains incorrect types: r=n, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641413000", + "result" : "invalid" + }, + { + "tcId" : 267, + "comment" : "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641413003020100", + "result" : "invalid" + }, + { + "tcId" : 268, + "comment" : "Signature encoding contains incorrect types: r=p, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f090380fe01", + "result" : "invalid" + }, + { + "tcId" : 269, + "comment" : "Signature encoding contains incorrect types: r=p, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f090142", + "result" : "invalid" + }, + { + "tcId" : 270, + "comment" : "Signature encoding contains incorrect types: r=p, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f010101", + "result" : "invalid" + }, + { + "tcId" : 271, + "comment" : "Signature encoding contains incorrect types: r=p, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f010100", + "result" : "invalid" + }, + { + "tcId" : 272, + "comment" : "Signature encoding contains incorrect types: r=p, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0500", + "result" : "invalid" + }, + { + "tcId" : 273, + "comment" : "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0c00", + "result" : "invalid" + }, + { + "tcId" : 274, + "comment" : "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0c0130", + "result" : "invalid" + }, + { + "tcId" : 275, + "comment" : "Signature encoding contains incorrect types: r=p, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3000", + "result" : "invalid" + }, + { + "tcId" : 276, + "comment" : "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3003020100", + "result" : "invalid" + }, + { + "tcId" : 277, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a090380fe01090380fe01", + "result" : "invalid" + }, + { + "tcId" : 278, + "comment" : "Signature encoding contains incorrect types: r=nan, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142090142", + "result" : "invalid" + }, + { + "tcId" : 279, + "comment" : "Signature encoding contains incorrect types: r=True, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101010101", + "result" : "invalid" + }, + { + "tcId" : 280, + "comment" : "Signature encoding contains incorrect types: r=False, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100010100", + "result" : "invalid" + }, + { + "tcId" : 281, + "comment" : "Signature encoding contains incorrect types: r=Null, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300405000500", + "result" : "invalid" + }, + { + "tcId" : 282, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30040c000c00", + "result" : "invalid" + }, + { + "tcId" : 283, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c01300c0130", + "result" : "invalid" + }, + { + "tcId" : 284, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300430003000", + "result" : "invalid" + }, + { + "tcId" : 285, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a30030201003003020100", + "result" : "invalid" + }, + { + "tcId" : 286, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008090380fe01020100", + "result" : "invalid" + }, + { + "tcId" : 287, + "comment" : "Signature encoding contains incorrect types: r=nan, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142020100", + "result" : "invalid" + }, + { + "tcId" : 288, + "comment" : "Signature encoding contains incorrect types: r=True, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101020100", + "result" : "invalid" + }, + { + "tcId" : 289, + "comment" : "Signature encoding contains incorrect types: r=False, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100020100", + "result" : "invalid" + }, + { + "tcId" : 290, + "comment" : "Signature encoding contains incorrect types: r=Null, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050500020100", + "result" : "invalid" + }, + { + "tcId" : 291, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050c00020100", + "result" : "invalid" + }, + { + "tcId" : 292, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c0130020100", + "result" : "invalid" + }, + { + "tcId" : 293, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30053000020100", + "result" : "invalid" + }, + { + "tcId" : 294, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30083003020100020100", + "result" : "invalid" + }, + { + "tcId" : 295, + "comment" : "Edge case for Shamir multiplication", + "flags" : [ + "EdgeCaseShamirMultiplication" + ], + "msg" : "37363338", + "sig" : "3046022100dd1b7d09a7bd8218961034a39a87fecf5314f00c4d25eb58a07ac85e85eab516022100f5133b41774a185247720d2aa5d8826b6ec5af4c076936c8eaa52ed6cdf59408", + "result" : "valid" + }, + { + "tcId" : 296, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373239373236343137", + "sig" : "3046022100904b2bb6e9de8f73243fa7ecc19a5a9fe034acad2b75b97c8cc84a79c5f3577402210081452342987040d43f50c72f2a5246430aa7559bee6c56663fd12029507a915f", + "result" : "valid" + }, + { + "tcId" : 297, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343331343737363137", + "sig" : "3045022100b08122f027076f924cd1dc877c93659ecf942410772fba58881c9109311bca5302200287a0033df7c069fbfab7faefffddd7121908fdef76c04a1a402d599f04942e", + "result" : "valid" + }, + { + "tcId" : 298, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36363033343338303333", + "sig" : "3044022048c044b94de8809898184e376a8a0903707679350e37ce290f858c8beef78c6d02206ccd83394e8abf4df2a40afb001ca4284d913d6b9caf6ef225d66bdddf9eb45d", + "result" : "valid" + }, + { + "tcId" : 299, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383239363231343535", + "sig" : "3044022005535fc39278260eb2b8cfba00226cb3155d75c0cf6b418ac56df63b7c0b1e9b022031aebd43e848874347b38ad64ef172fa315fda09645c8752c0e010152e43418b", + "result" : "valid" + }, + { + "tcId" : 300, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34333131383231373336", + "sig" : "3044022078957c4f5a000af05fc477cc813cc6dcd9445438215b1c493780b6ccbd39a965022067023127ccde416b92cb3a7560436950ab643bbf08383ec9f4f6862cdb302095", + "result" : "valid" + }, + { + "tcId" : 301, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131373730373734313735", + "sig" : "3045022100ea1b7fd5ba10eeb70a456c149d494fa3757a209093c4dfcf03730d1cd54829e502203cd204bb84656435e3656fa5e76edc4df3ee79615f7f1adfaf388a7eec4f8172", + "result" : "valid" + }, + { + "tcId" : 302, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353938353135353635", + "sig" : "3046022100c9611952ab603753d0601e0c97de91a6d2927d38afeb1b2b622ea384968cbbe8022100dc32c42ce627f286f7d14aa4b037588abfc202b916a7bf9051c3d0527c66dca4", + "result" : "valid" + }, + { + "tcId" : 303, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383831313031363138", + "sig" : "3044022012c960e3fcfee173335123fe15cd7f8c8bc55f6f84a071e440b0e418cc9c0c2c02203f494246c0889b4213150ce77b6f5f2957476d3faf898135d56c145fd3af35ef", + "result" : "valid" + }, + { + "tcId" : 304, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303034373833333332", + "sig" : "3045022100dc921912a76a225819d4956a7ff0660bcdf695bdf286288858ccd5a26001277102206bc5879138b207c3e4e692d4412c9a3fdff91ac58a669ec830b68b1cd562e556", + "result" : "valid" + }, + { + "tcId" : 305, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39353030323437373837", + "sig" : "3046022100e31a34cb647ddc65b03f9bd05aa3e5e62a800c6fb56794843b606f1f08890524022100e7f2e4ff291bd309b0617478da0fdba92535376a69dc43061783b3ef928113ad", + "result" : "valid" + }, + { + "tcId" : 306, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323039353030303630", + "sig" : "3044022047b825bdd67cb5d91f017d52ea77f59b1de1e05be48a469978fc88ca577dba2c022053ee369d5b89bf58b3c76218b7cecf12de68127152917c58ee155ee85dc664f2", + "result" : "valid" + }, + { + "tcId" : 307, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38313933373839323237", + "sig" : "304502210085b2d5faa65cd162e666df35beb535c797e7a2a20836d351ebcff798c343309b0220196a837aabc19fa4522c5fac4c8e63e7cf3a5819c97fcec10e80f33e41f266a2", + "result" : "valid" + }, + { + "tcId" : 308, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33363530363033323938", + "sig" : "3045022100de538dcaf220334aca9fbc11d1576643662c66585e268bc0eb331608ad9523ed02201b1d32790d46c6925ab909408170839f83e6a03a7632ec8877a0c191fffbee79", + "result" : "valid" + }, + { + "tcId" : 309, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3136333833393533353233", + "sig" : "3046022100b5d45e7fe1196bf5e076fd76742c1e12eefa7934de826d7395646c94a8013fbc022100f5475abab65d9ef64616fde95b3ca6b75fa864758950015441a4414acdd0c894", + "result" : "valid" + }, + { + "tcId" : 310, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303931373638323035", + "sig" : "3046022100d973f8f20c33772413f214d1b8709cceaad159c9211ccf337e7477da197d49530221008d4c39ee66532e2ceea2f0861ee02781ba0339eefb30bc06218f4a63fd86c11a", + "result" : "valid" + }, + { + "tcId" : 311, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39333634373032383235", + "sig" : "3046022100c487ab066b8bdac12b5c728586a61e42d0a1bea16fb544d3bd56fede77bb3db9022100d27022a17957dc23bd760d0f00e93f10189c67d32a9ec5489514f140e49272d3", + "result" : "valid" + }, + { + "tcId" : 312, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393236383638373931", + "sig" : "3045022100f7777648b15af89af40cf9ea0a3c875aa0d9d736eca529af4eb6238f78a562d202203b70d46e1439bc5d941bdae8507625971c1c64dcf4c51bcdb43b1ca3ae0373d4", + "result" : "valid" + }, + { + "tcId" : 313, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35313738313334383231", + "sig" : "304402207bb4646c887062a6c3e680b1491854c4b26a4728e5f2b2c1cc3087c780dab7b3022062900f55b885617f9b3c7ef34c67ecc37bf78e11a04cd6b9052eb80f9756559c", + "result" : "valid" + }, + { + "tcId" : 314, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373335303130373531", + "sig" : "304502204a96ed67d0950d97a8675c302f6102215ce0ec837ff53fbf06b57b010526b5740221008deb5f7a7c8cbeff01c3443700b8da129088771c8c2bf4ceca2a5fa81138a534", + "result" : "valid" + }, + { + "tcId" : 315, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134333533393131363839", + "sig" : "3046022100d9c3938a4b91d0660f6ddae8540a7bbeae2b0d717bde1f33e6904280197471930221009b022d6547abf9bef980bf8fd67c366e234eff3aebee58a7ee56d335df807a29", + "result" : "valid" + }, + { + "tcId" : 316, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333834353439323034", + "sig" : "3045022100f855a2d237016b1e0ec307672a793668b611d2b6d4e5acfe2b2088aadd6296a7022013c60acb5e6fa51f03ee8cbe3a220f3ac1ce527daee05e9d7430343030dea7e7", + "result" : "valid" + }, + { + "tcId" : 317, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373632313932373839", + "sig" : "3045022100b8ddb1ed6e80056fb9cea2590b1b63cfd1e8098c27547ec8c6cacd78e6ebfddb02207514ac6644955744946fcb5617f8b067850a3ecf829d821f18435a5e11a4a58b", + "result" : "valid" + }, + { + "tcId" : 318, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31383331363534333331", + "sig" : "3046022100e903b7ead454ff8de871fdf67b6bae4ddc88254c35b333a98ba3a2f6562678a5022100f713e10293aec60e63c2a79b189129e54919a74cda6a204a2727c13bb63a25ba", + "result" : "valid" + }, + { + "tcId" : 319, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343336383939303330", + "sig" : "30450220615208d06b392c418fba55c752fef7b9ab8ed47d98f40776d86ff4bfa3e95464022100f403d5984d446acb203eba58a5468372267f9004f263aaa1eaa208652297db5b", + "result" : "valid" + }, + { + "tcId" : 320, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323034303431323232", + "sig" : "304502200eb65a5bc338cd920a174648dd84ed5443f37417d8d730ceab0dd3fb9a2046f3022100c7a86d7e09f5e142fc6d45a136b4581e081f66a26fe0255f012b812d7cf90189", + "result" : "valid" + }, + { + "tcId" : 321, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33333337313139393735", + "sig" : "30440220226464501f1ccc32f1e1482fff4624f4949343c79a820d4b9df637b493ab5b2302204eb47d0fd14db448cedd611e1dae972bdf27ce0fcfc19d9ec5bda9683081598d", + "result" : "valid" + }, + { + "tcId" : 322, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36363935363230363738", + "sig" : "3045022100bc0d706b5fdf102805cf83f66ce17a97aebd5e3b6e7d5c008cd51164750af1080220651388d190da29748df343dc61e23c248c753013a5688652ca43d222edd1bfb4", + "result" : "valid" + }, + { + "tcId" : 323, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303933303137373437", + "sig" : "3045022039a1d9927356d6849b7e96cd34a5828bad112687198637e7b84900ed92fad0b70221009b5c753e2e10619e1993b8d8171a7aa4c4813a8721aca1f79bef06c0fa858462", + "result" : "valid" + }, + { + "tcId" : 324, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313233343137393136", + "sig" : "3045022100d57adda8926a6b75a5c994a0b8abc75534e68bd79b02b8eaeb1a7add4c5c423202203b349431e37740c60f92c55dcc8a9f55e70e27b9f73d82e37d728ba7266cddf6", + "result" : "valid" + }, + { + "tcId" : 325, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373634333530363837", + "sig" : "304402207d5b4c29599e97085686534f843d71d25f22b96d89c70b4030abcbe6abd73559022028797ed87120c4bf50e37b0704d2d3b4e0b1b98c27e618eb99568b08123a1be9", + "result" : "valid" + }, + { + "tcId" : 326, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131343137323431343431", + "sig" : "304402200db6c547a1e7bbb715b48b7974104b6d7618f1dfed77019daa29bd59b273c087022057f054587cdd5628772c14dde0a77dc5c1bad06828410c5c63b9c1b35fe04410", + "result" : "valid" + }, + { + "tcId" : 327, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323638323436343933", + "sig" : "30440220094a1e172012d9367852f228f49c382bbdf19a6b354b8511807e585cd46e907f02200e50740da30419a987ccd56746b8737aa74a1292892eef99a34025aebb6dd209", + "result" : "valid" + }, + { + "tcId" : 328, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373234373936373737", + "sig" : "3045022073a5445895e0796686dc28c3e4cd5bc1f85368b3264b455d470a7cbeb7592d910221008a9ffabf9f65921734934d65053a00bfa3c353ac81cc9b6f60271635026cd0e1", + "result" : "valid" + }, + { + "tcId" : 329, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393733333935313139", + "sig" : "304402200630f2c6277e9e0414b7e8da64311850b6f3912193970fd6e2f4df79df720c7c02206ccdaf47a44ee1043b76ef62b3de3aee876c26f4efe492cb3649423e599753d0", + "result" : "valid" + }, + { + "tcId" : 330, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353037303032373036", + "sig" : "304502201e1b75a3495bb5ceb2adb84b80f117672b79c5bc71e953d1a274b11dc4238729022100dcf48d930d89c0d301e97f9083487e63cb39127310b0f5e3c8769e98e5b2605d", + "result" : "valid" + }, + { + "tcId" : 331, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33373433353638373832", + "sig" : "3045022100eb92e1a80ad7f440d8a2e9d88ac765c5cbf724bd367f414c9d91cc1904afe497022074fe0ec7cc0122eea4e63c4d16c89edf6a57823178c3747b01e7aff3df710007", + "result" : "valid" + }, + { + "tcId" : 332, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393437363731323438", + "sig" : "304402207c99e1ae6941f4bcf54ea65491cafca180eee1605a2ed908c476ee67cbdd737302201f94f03ed47cc9674abb294cfe7e7b10ad67101b8cb245a8b5fb883a21a06dd9", + "result" : "valid" + }, + { + "tcId" : 333, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373235343434333234", + "sig" : "3044022029bd14a9dafbe562e0c4c0d4aecb6491bbd37f707133f78fc5cb3313365377b702202ea1d86246d8edad31132f3dbe642cac488690849bdd7438d5c626cf8c973970", + "result" : "valid" + }, + { + "tcId" : 334, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35353334303231323139", + "sig" : "3046022100cf7219dcc18e22bd487b6f59c6494f637c5f0ccb18192e9e60178621220b49fc022100a05d5abbe25a610c8e3615cf7d01c69563ddbfe76d7235fda45f046af03e50ff", + "result" : "valid" + }, + { + "tcId" : 335, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3132333031383133373933", + "sig" : "304402201589de61cd315ba0bf7f0e577f00589d28f72131f4c7af41c6bb31ae8ba271da02202ff82a9a1f52901c4c6f8b8a41c0f6e760f160da266d788da5bdc945084dff8d", + "result" : "valid" + }, + { + "tcId" : 336, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39313135333137363130", + "sig" : "3046022100a8c59942907039886bc374c17ff452b604385c3537b9b6c6113c1b19d72e68a9022100d376bc866cc82d78ca17b461edf16faea44e577659b1fef02cec0f41bd2e747c", + "result" : "valid" + }, + { + "tcId" : 337, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383934333937393632", + "sig" : "304602210099cc652412dcdfc574b6fc2525615e6711caaf7d558cc781a3a11cf371f40f71022100866dd4ab6b58b5d6379f0b431f9a251399defd5516bf6bb5495511e05b24f801", + "result" : "valid" + }, + { + "tcId" : 338, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31323333353833303333", + "sig" : "3045022100b47cad5c88161e29620957061e24cdf46f3fff97c266b1635fcf2e9cb4d92879022013549f3b1b639eeb33f40cb338ecd089b9094d9625b76734f3803e9d40a1eb26", + "result" : "valid" + }, + { + "tcId" : 339, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323131323639323536", + "sig" : "3045022100f4f3a043b5bdc56bd471876e2df15ea80ccb189b25486e6ab9007cffe121acfc022078e8e3b3589580dac1ce299a18f5704901104cd21205317608c330adc8d35272", + "result" : "valid" + }, + { + "tcId" : 340, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303035343833383634", + "sig" : "304502205df45e90f9413908b47f7cbb05d6c43a81eb62375ab961d2b065c6118023c018022100d720a2a23c34ece3acc1a516070bde6bfcad28fd89c482d72b69d8113b1903f6", + "result" : "valid" + }, + { + "tcId" : 341, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38333536373632373235", + "sig" : "30440220780bb93f52d53752a9a877dab0578c7702d1ea889960e1682e84f82740b1be5d022008e366ffe8f72d041426aee57aeffce7822b209c34b28255a5de67190870ce42", + "result" : "valid" + }, + { + "tcId" : 342, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38333239353030373630", + "sig" : "3045022100f743a77c86dce094cc265a87b2e053c8cc773370851dbc7ba1a52c58df24d55402202516e4614dd7ccd36a23cbbb1b58c29f900d4da2113e7b9ac956bf8879907680", + "result" : "valid" + }, + { + "tcId" : 343, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393237303834313635", + "sig" : "304502200b77b2ab21a5c92cb0e3f2f5b8594edcc0dd6c70dbeea9d9d363a3718c64dfb402210091c2d6515ff6f2977fd0a150cb04c600102f0ae07a9061993244783e62f2337a", + "result" : "valid" + }, + { + "tcId" : 344, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37333032333538323838", + "sig" : "3045022041f0a220d11a014dfe43f89ab647abea430cf5a9703088f28c1222abb77e8857022100f811c584c10a25fba6216113698e5a2dc52d8ea340d92ce7a11d356f6d5a1382", + "result" : "valid" + }, + { + "tcId" : 345, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3133343733373337333833", + "sig" : "3045022100ed707e3cac8bd56a4f0a3118558e8402dd477be7dcaa1a7ff448b0bcbfc0fac102203d9933e01d7e9439059973fa499c37b896213b04346bb292f867ff3a58c3d07a", + "result" : "valid" + }, + { + "tcId" : 346, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353031353533363839", + "sig" : "30460221008035d10dfd533e01718fa9d0a1773e55b424770415e570aef766ea2cbe577c27022100815b0f14d6f7f4ca45191428d98c9b414871ffecdac3d0717d285a473e5ddb06", + "result" : "valid" + }, + { + "tcId" : 347, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353335303430303239", + "sig" : "3045022100fbc3576a648ebd633152fc896ae6b4827c55824fb0c96fdd217fb2cfe3bbe63602200b37a95b15589663db322e1f089aa8132965ed6490362d243ef749c6094527f2", + "result" : "valid" + }, + { + "tcId" : 348, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343230333537323930", + "sig" : "3045022100de08cc84004d3fb30521b8e0ade66b6d52734ccd182cace8a34ba0e390fea89302202c1e3deb79d16117ed84c8982276d43709c5963d57bd2b10a530ebf161da1a3d", + "result" : "valid" + }, + { + "tcId" : 349, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393035313735303638", + "sig" : "304502204eef795dc7b17efde95dc52062e3b60ab360d37704800fc915785e7739b834d9022100c68356eacc3509bf4d2b62412b2472f22383d18fa8851527294b1fad194c7bcf", + "result" : "valid" + }, + { + "tcId" : 350, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363133373734323935", + "sig" : "3045022100cb845b9fcfa07e88e9011f0311cae9f3f740516e7d16d9819b7d0f6fc764dac702203d7f3ba5173e130937b02bb7b8da25c506ace6182b8f9ae4ed891f7d216c0378", + "result" : "valid" + }, + { + "tcId" : 351, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383733363733343931", + "sig" : "304502207d19ff3efc71258f747e74d76f091107b1fa47c87c638720b55178c0655dcbcc022100b8a653e31931dbd2ffc4e957675c68c28719b8118ec3ed3778c57ce3eff1613f", + "result" : "valid" + }, + { + "tcId" : 352, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34333535313036343035", + "sig" : "3045022010d465e03829dad77e8246ad11caf8c6aa8aa918c2bef5a9a9e601c5a919f68f022100f365a7a7540dcb642de90e6d6ccf0c74094a8005deaed4062e394e1cf2bcd8fb", + "result" : "valid" + }, + { + "tcId" : 353, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34353339353735383736", + "sig" : "30450220674330ea5a5d45d71fca1f3ba031494dee9a8623e0d9e9adbb2822794acb4f12022100ae4d3830157c820bc23fa792188b94bb559c3a6212768d7ac59dcf36f74402f6", + "result" : "valid" + }, + { + "tcId" : 354, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383933363633323031", + "sig" : "3046022100a632c676f667669bda1b0ecf5f33fa67aaaf8aee46bc9e9f2bd5bd10c36cbb95022100a99352cacd6bd42b78a93908008c23eec2d36e5e4fd0aa349d5634fc543199c5", + "result" : "valid" + }, + { + "tcId" : 355, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33383036303638303338", + "sig" : "304502200c9d2e8935f855e69dccd877d95248303e1b6daf8f61da500150185f5565fa97022100e4ce328f00e218aa13d496d85b73b5b891cf0b7c66ebefe5e6b92b1da7f837a9", + "result" : "valid" + }, + { + "tcId" : 356, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323332383137343937", + "sig" : "304402204748c00f44a6b3a8726f604d7b933303d98cd458b850ff2d7cb90c11d5950ac70220766df7aa4c8b3f8b03b0eb8aec653fb70eab7433a84e7ef2d57f368a051b704d", + "result" : "valid" + }, + { + "tcId" : 357, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34303734333232353538", + "sig" : "304402204e4fee37b0b93d7d6dbee89b47dab0c065186ee81caf2227bb26e85149bbf9ef02203eb83850edda9a1b1011118feccd03e47b3e1ec815837bb7f8867288ad8df831", + "result" : "valid" + }, + { + "tcId" : 358, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363130363735383237", + "sig" : "30460221009e8520c5e8296935fe93da2dad55963b9f1f88187f76810fff53c0a6e95b0c07022100d185de4f682a97d28fc3067d56a3d24f743f32d47a6f390068b2ceb71678fadf", + "result" : "valid" + }, + { + "tcId" : 359, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3137343138373339323133", + "sig" : "304402203cacb67364a3fc1a379557f7e6f5d0f501977fd4822666956c9356146b7d922f0220686e27be6217045a5010c88003dd3956a864798c8ae687714fc8b7277f7b520f", + "result" : "valid" + }, + { + "tcId" : 360, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35313237383432323837", + "sig" : "304502205df702c77d4638a4302d21a9fdd70bbe31a4a4a79c7d531d4f4c8283970f664a022100f72d799abce3cd22985c5cfc68f7afc8f96f4e7dce8485ed5c595edc1e1f1d4b", + "result" : "valid" + }, + { + "tcId" : 361, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35303338363930383739", + "sig" : "30450220243a857dfd167b938492c421bd657659d101944736fa79b903cf91ec1c49e8e3022100bab3f04f130d737993ec8f45503376abe816c2b8e5ab3decb0dbca4f5e181d08", + "result" : "valid" + }, + { + "tcId" : 362, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33383737303432333937", + "sig" : "3045022067a7996b7680e958480ac2f97084f2055194b38e0ecf82246dc87918ee1954a8022100de187dfbeefce383dcea1a7fd71362385d09c6d25aacdfa34ea270a91ec97cf5", + "result" : "valid" + }, + { + "tcId" : 363, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333231373038313738", + "sig" : "3045022100ab6cf003aa7865cf8010ea01944fa0d2f825ac6a997a427f8a4e791e797ac6f6022028a7a6c80582ba8f888d2008fbd696799561e92d9a51922cc602aec2135f08aa", + "result" : "valid" + }, + { + "tcId" : 364, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37363637303434323730", + "sig" : "30460221009f9f0be992fdd3e069167599dc55e331c9f189d2c230ae15d1b5b441d3843c74022100f8e5b4ed8ead0352e032f79b5f0475f0975e3738d784d895e9e4002b26762b79", + "result" : "valid" + }, + { + "tcId" : 365, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31313034373435303432", + "sig" : "30440220373b8587777d2b4ff461fddf521abd8fc5d3a1caca847f4a5461dab6ba242d83022051a98da2628724018dff804c26a9671f7df3e24490392a2d1a91fdc7f50deab2", + "result" : "valid" + }, + { + "tcId" : 366, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313533383730313534", + "sig" : "304502210090a6286a271d8ffa72ddb55e8c924793e03b2af73ce10f2deae857961cb07070022028df2b6379501110c12ac167189f9ea8873e1d62ffc76e6ada83f2cf412ea5d3", + "result" : "valid" + }, + { + "tcId" : 367, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323631333835303439", + "sig" : "30450220107434a824ec05568d52219ab3e847046f01493f1db57a82fabe754555838292022100d1c2f7c1ecb5afbc9b0e63e20fcf34cfc16bb260b0748343eb86c44012449b8f", + "result" : "valid" + }, + { + "tcId" : 368, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37353538373437363632", + "sig" : "304502204b737fb724c97348fb67a994e88816b1091951b77234f1904717ec7ef1aa951d022100ff722b669bd4342e6b856232b5a5c03d2cf16f09b3d3842d0a87fc19d910acd4", + "result" : "valid" + }, + { + "tcId" : 369, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343939333634313832", + "sig" : "3046022100abe804f6c76fa3f1470c0f244a7ed96807ddffff4031926cfad9a2c9f73ed773022100e48352653ccc46f5f5a76d7eb3997dfd412001fb1692312788f7c297ef792fa7", + "result" : "valid" + }, + { + "tcId" : 370, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333639323733393835", + "sig" : "304402207d55a5da3201de5343703ff8ee363b7ddbcb3d786afca8f157b25e7c90d09de802203dfcb55acd7def4218abd3f989e901f824cc2d4ed3a37b8794117975103ff004", + "result" : "valid" + }, + { + "tcId" : 371, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343933383339353635", + "sig" : "3044022025d2c88f0b79f2289f92d3ecb6de119fab764fb43ab5286391f9a282c82ac1980220105f44fa27afe4dc9800e6a16528314de01b17737e9741862f93ed0cc33b30f3", + "result" : "valid" + }, + { + "tcId" : 372, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353334333739393337", + "sig" : "3045022100d725c2731a6db8d623027a926a665e9dba0f95e90a5fe6807a84b200111f04ec0220346140bffb84731f0f1cf857193dea25a2f721463dc3b85a8e72c73ff72bda94", + "result" : "valid" + }, + { + "tcId" : 373, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383334383031353938", + "sig" : "304402204fa9704d3eaa5760da0b97abc0de1f872840e58bfdb1a8f9d8be3f96f950ca7d02206ae15b572c7d1a49c99e1aa54de5fb2bbe055d45686770f579c08ee79924ede9", + "result" : "valid" + }, + { + "tcId" : 374, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343131303537343836", + "sig" : "30450220343353c8be35ca222a38771b19ff3550abe41b91f2ffdea9c9f4887d70b02782022100c285e3761c6645b3db4ff99a7ac40803286f28475ba28b9cd55cacdefb330984", + "result" : "valid" + }, + { + "tcId" : 375, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373836343638363335", + "sig" : "30450220529b121d5b3cccb426189d7343d571adf05cfaee843669da6722f728c192bb8202210086490a7686215fb29b18a166bc22c1b8a982fd7d57ab593318adf8355684b45f", + "result" : "valid" + }, + { + "tcId" : 376, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303534373733373638", + "sig" : "3045022100ff65707177bb9aa135c5fd774bf72eb3058e80afc7d8bdea8f7fd18040ea995902200d4ed13f9e01bab8aaaa40d7f5c923a78470888375b4690e1164a83fdf136201", + "result" : "valid" + }, + { + "tcId" : 377, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393237303137373338", + "sig" : "30450220471ebfcc45de07bd4118f94b0284f0c5848dd93149a217b56b49e20baf583ced022100ad498b79d6151bf64e003f502fca8fb7b05b2106a96ca1b977ee002c73bc721b", + "result" : "valid" + }, + { + "tcId" : 378, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303531333235363334", + "sig" : "304402201e279add50ce6148dd4a3d311bad896745a169364ef68b94e6360fc48e949b9f02207230fbe4007fb7d6a4274c396081f37a1c9b2559b526db1efe435ead15e4b74e", + "result" : "valid" + }, + { + "tcId" : 379, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34303139383636363832", + "sig" : "3044022052dfbabbcb99651021c025a308530b9cd04732f43463bbc51160cd542d9028df02200ebef4f6870bce1ca302e7120560e5170067c0fb3dc8668448b89dd4821b53fb", + "result" : "valid" + }, + { + "tcId" : 380, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130343530323537333530", + "sig" : "3046022100dabd19aeb87fd56119a3354c468f4429fc14421c54e8be9e9b927941579ae55e022100b10a7396c973e052af2944d37247e9016682d4da7cab2d5428618ce120a21056", + "result" : "valid" + }, + { + "tcId" : 381, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333236393538353830", + "sig" : "304402202b9950c4005dea8e603ffe0fd9b3f66b7c0f07509e50913bb825ef7ddf2e6e77022062c9fcdf79026f60f830e7cae4af814db2cb58b5a948562772da130613bbef94", + "result" : "valid" + }, + { + "tcId" : 382, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303734363533323431", + "sig" : "3045022009d881e300448b9eac33c67f10c061c2c985c415a414d09c891847e3eec88598022100e75455a508493506f8746074f8bb3698d4362f98a9daa20fa916f6c4023764ae", + "result" : "valid" + }, + { + "tcId" : 383, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37373134363833343830", + "sig" : "304402202db5a6d9b16c61c888a5de064f621e45227ab63efba61ef210fe4ef81c93e00f022004b8e57a7373b3642e58db0cc652d6da541d6d25c7b32c1ed2b408c9e3c39719", + "result" : "valid" + }, + { + "tcId" : 384, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373933333831333230", + "sig" : "304502207bd46dbe132d95aff854bebf1c0dd1e90303328fd84d381e93217723d1a4bc18022100f795a0c68d6c318c038dc37bd22d36bce8083096637e8912c3d01cbabd3feec7", + "result" : "valid" + }, + { + "tcId" : 385, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34383830363235353636", + "sig" : "304502200ca03beb6d348d3d36d2e9f6773e5882ded66fe6026c9c27b847e34523c77c2c0221008770b6f0b6aa7c982e84235f1840a6172386a41ae75fd9affac7916cbd19f8c3", + "result" : "valid" + }, + { + "tcId" : 386, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3439343337363438383537", + "sig" : "304502203f1a74c1dab6bfc319da38cde7a812695b530c60b36d2ae3fa11a7206b2031d5022100f07f8eb5825b2d5642443185d6afd2264e98996dc392519f812883dbe0e247fc", + "result" : "valid" + }, + { + "tcId" : 387, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373038363839373836", + "sig" : "304402201ae1c3ec96f8591a3a235de7c6f739201104381eebeab5fb5ee523f577b6c7fa022007ac1a9348fc8946964fbef0af11dc8b2da6feb3eee8cf475c4926ca9cd571a3", + "result" : "valid" + }, + { + "tcId" : 388, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303239383732393531", + "sig" : "3046022100c6ef5423c69541caa3bb8f361f4fa9caeca30fb329a0da806ea956270e0a9928022100c045de5205eb8bc861bc159522b41c0d66e62fac0f58730861000cdf9e27bd96", + "result" : "valid" + }, + { + "tcId" : 389, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303137313930333835", + "sig" : "304402203097d229239b4085e3fb3188106d5da53456752976d2c4ba82dcff6ab96d1909022056f60ab76d33bc94ebae3042a1d56a731429f1bed162bf3ef7269d912aaeea71", + "result" : "valid" + }, + { + "tcId" : 390, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393536333633393339", + "sig" : "304402206c9ecb8dd5b8badd49ea1b26ae3ae2af7236cbe1c626aa6b27029ef1d6d05901022006c9bf356441f84215b006c721a00697cede6941a18fbc0f9c5b3c267eeaa371", + "result" : "valid" + }, + { + "tcId" : 391, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35333030373634333530", + "sig" : "3045022043ae5619f91b711a61be076581f91d382c39fe53d500b136f81be639bea76add022100824594f08185479731ed095367c04def2ff196229c5b136b3835eb8bb819c56d", + "result" : "valid" + }, + { + "tcId" : 392, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393334363634383434", + "sig" : "3045022013e8dc460a0d2af2305a6abfeac834737d4441576b194fe83147b7d7d1247479022100c590a7b7fd6de8c2d658aa2bde97de84505985e2979ab2a527658122cafaf61e", + "result" : "valid" + }, + { + "tcId" : 393, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3335353435303535393632", + "sig" : "3045022027feb06a4c5bb046162467e523b4b62c2c8dabf26ded997eb0737d3eafd16c8a0221009ce87c4cd6b93d1ec3b3c5d29fa415cf918edd24e0febd7b200d6c82c91e5f78", + "result" : "valid" + }, + { + "tcId" : 394, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333031373232313038", + "sig" : "30450221009d76a05d5803a2da17dc2782ec469c8024b1d293a38c23ac4eeb3058595a24a70220226595b192ea8336faa44670fef5e808ff9911ccda85a1765c19ec44671b0505", + "result" : "valid" + }, + { + "tcId" : 395, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35363137363931363932", + "sig" : "30440220791088736561f41932cd86f066cca6d63d4473aebb869bcc70c923ef80a7fd95022033402973e7a824602712a5abf7030bad2f183e6b4fa40c66399a14ae48e288e3", + "result" : "valid" + }, + { + "tcId" : 396, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353831393332353334", + "sig" : "3044022052685eef5f2168598c294870188c043dff0496638037170763ef5778b7b6fc1f022079a88d3e7b2c3a44be4b3b3305e4bad5fcfe07d179136f5ac926315ff9d4787a", + "result" : "valid" + }, + { + "tcId" : 397, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3135373136363738373434", + "sig" : "304502205db883b5a3766a2a14ab26a25ec598f7bd1f97585fe0b55341e7da251a62ec1e022100bf63c66e992c91fde513abdbd59b4f9f542881cfdc2be3fbf3e772b97e505b3d", + "result" : "valid" + }, + { + "tcId" : 398, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313939373833333630", + "sig" : "304502207e2f80300a4c81543e324e9c8973bbb6f16599c3d337ee82aed816624843f37002210080a807e920deaebaf3c3247010cb3c91cfce21b0d5ad695177d934ee5a7f7cbe", + "result" : "valid" + }, + { + "tcId" : 399, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373430343735303832", + "sig" : "3046022100de12eb33b717fd887fd684a64af9439a27ee83b28ac5751772249e600856b59e0221008dca367bd7bc83709f25b0fc4e1f4a0e7e747be0b8a2977aabd25750a0ba60c2", + "result" : "valid" + }, + { + "tcId" : 400, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343137343336353339", + "sig" : "3045022100dee112ed7000c0776ba4fab09f439a844addb86c5046223397498ad72d059de402207039b715851e4b386ea15e9bb0899ca21a4e6f4ecbbce4f706d29274806400b6", + "result" : "valid" + }, + { + "tcId" : 401, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31323335363538383839", + "sig" : "30450221009d01032d95cac596e7df6c75965c3669f29cb8e58cc9a933bc5d60c1a97e946e02201cf2ce39df73cc734bb4180ef09de883bad7c8d82ab1a5861d265b48aa195bb6", + "result" : "valid" + }, + { + "tcId" : 402, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343239323535343034", + "sig" : "304502206f1513d12e2112ec4f396ef4ea38324102ec3c7fb63ee49f485cb421a07dce57022100a78fbd65b2582a4031c34c7a8c28f03f16ef2ba18e2da41ef173ee5a85af1fe3", + "result" : "valid" + }, + { + "tcId" : 403, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3531383033303235343636", + "sig" : "3046022100c3fb59671cb8c6db48bd51a667060428f75124b5e990af1e997fd636335072d5022100c797e7245cfc8d98bca3ae1f4239b88684cadeda2c628f09ae61053eeb683771", + "result" : "valid" + }, + { + "tcId" : 404, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343736333938323030", + "sig" : "3046022100e8b5b3f3443d59d7521d093884486e7a6732e275ec13313bd4d178f28128e075022100d299b062928e5f058c705acc3c62f24128ec703c28288b0d294216370cad69b0", + "result" : "valid" + }, + { + "tcId" : 405, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39303630303335323132", + "sig" : "3045022100ce43218d44e113ec38d5cbcf402f3dbfa87d58826a760f0bf2c88f11981f77190220648f3ed0d1b76dec5437cb685dda7a1512ef07f4eb078dc50e418efeb1af8849", + "result" : "valid" + }, + { + "tcId" : 406, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373536303533303938", + "sig" : "3046022100fdc99047865eeffcb69f8b8728a008e31f9f6ba78f698fae62b71cce79501888022100f06612f593873a13459695a5c4cb504acc2a8c56179b68553e60f2319c905b4e", + "result" : "valid" + }, + { + "tcId" : 407, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34393830383630303338", + "sig" : "30450220256e5c4f4cd121e2dee1987be7b241b6e91f90d483210aab9a4b367db5613174022100f75060db4bd6cd52bb8e6aa94f7ab68488a638873515787ec0d7e61bad58ab7f", + "result" : "valid" + }, + { + "tcId" : 408, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33363231383735333335", + "sig" : "3046022100c7a269986b6ad540dd30e620d1606e3267935c7fd5551b3311fd4e840510c2480221008db7c8c464109cf0edb89357e663de6e882b6f5906adde6d58575ce0a2cce257", + "result" : "valid" + }, + { + "tcId" : 409, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36363433333334373231", + "sig" : "304502200bea324758ea80ed4a0a56f7d836fc73bf196e43fbc59d953f0ce34abba57b22022100f04027248e83bd48fb1571291ca1a5f088eb3e89f00904d71b9ea8d6677f7893", + "result" : "valid" + }, + { + "tcId" : 410, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343534393432373832", + "sig" : "304402205b53c96d7a195f02cfac2d155aa7e132fbc35d59afb080f649dc13056248addf02202b157db2154bd5dc0ef2fc6eecd867fabdc633d2ca683a48f3f9095745351aa6", + "result" : "valid" + }, + { + "tcId" : 411, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3230313834343032", + "sig" : "3044022024174a81d221a4bfd8978f312acec4dacc4f08f8f8cdf29b2024bad2177758df022073fc1bf3388009e3219cf4c7e62e4aeaffc1b9614b2831405a01403c86936452", + "result" : "valid" + }, + { + "tcId" : 412, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3538313332313733", + "sig" : "304502205de7e80ce3137f5705d23397197c86e7749e5e682104f13beb5a6365a63780ea022100f3da2bfd6442638da60201be68fe2ad206365af9e40c4c1531cd3a05db1ad3c6", + "result" : "valid" + }, + { + "tcId" : 413, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31313833383631383131", + "sig" : "3045022100dcdc28f81ff5ed91fa15f15fc4f1d38f9cddfc3df65bb2d3a55582faf7c0910d0220515b7759a130d667eff7ff3167c305cca101be3a07945fd7cb6a1359c16db678", + "result" : "valid" + }, + { + "tcId" : 414, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393232363032393036", + "sig" : "304502207407261c978018cc6e92a340de80edd3044a6e7116eb9fa9b022a2aeb318c65e022100bb5826953e0b85ad69745249f69507765a93f82198bca1e4475fd5de7dfb15ca", + "result" : "valid" + }, + { + "tcId" : 415, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393735313433323037", + "sig" : "304402203962520ea2ef01cba7d5135117a7fcb5ab120b28baf6e31de2e6ec9993d8d5bc02202583659fbdf83399309bddc89ea5f39fe22187671f3149d94f96fa234a6013db", + "result" : "valid" + }, + { + "tcId" : 416, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38333135313136333833", + "sig" : "3046022100bec3ea35844452bb739d92b20882e5b672dc6eff323cd31d1a2db37db93791e80221008ef77b3c709d60b9d5d998f81d3f72c466fd7bb99c681ae8bc9c580db1f7c213", + "result" : "valid" + }, + { + "tcId" : 417, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333236333136383132", + "sig" : "3045022100b8fbdfedee5376cfc9177d96c45e003f90b7367aa40cf37d63e483bfaa4be95102204dcacdfbe41df7899382607489bb75422f3eb67822890ea3bbfd80cd456fc127", + "result" : "valid" + }, + { + "tcId" : 418, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34303239363837313336", + "sig" : "3045022100df228c1a8bb3684b7ffa2e3f777643c369e1bc2299d66a66c8ed27a4ed59b783022047314aaf3629a0de02313df06c0cb363e4e019aafd20ec06be63b7b4c21538ed", + "result" : "valid" + }, + { + "tcId" : 419, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36333230383831313931", + "sig" : "30440220528746b280d8a0e54851cb99894afc01ce24cff7edd60116e3d8dae42adb496102204eb264629e5cf4aba77e05c54774bd0cf20b057142a1ac2103099d664c2c5dee", + "result" : "valid" + }, + { + "tcId" : 420, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35323235333930373830", + "sig" : "3045022044c391f82cf5eeb80f87c347a5bfe461c49fd8779311e237abc05b19f6aed093022100866853619339b716092df4466aa0cc9e6256fb7e18a79854b60ccc534bb6df10", + "result" : "valid" + }, + { + "tcId" : 421, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333439333933363934", + "sig" : "3045022003d127a6f72465bd1c02109f9605202b246763097c756235d8f8a26848eb609c02210083d551427f31b9572b61180cf18bc85c20306c0de2c39d00430b3fc91dc50c6b", + "result" : "valid" + }, + { + "tcId" : 422, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130333937393630373631", + "sig" : "304502205044ef2362c8e6c32fc14584b0751eda8e8e8901d9382354040d2615d9cc07c1022100dd16765911dce7a7ae5f3b64b3ce3a5e12e548784597dc0a379f7bb8f4fca879", + "result" : "valid" + }, + { + "tcId" : 423, + "comment" : "Signature generated without truncating the hash", + "flags" : [ + "Untruncatedhash" + ], + "msg" : "313233343030", + "sig" : "3045022100ce645f0f1ccb63844e54bd7603a4280ea065e3c147d26e73cfbe58c6116b0cf1022040ccc23188aa20453d7f95d33868f247b3d77c516b70e4c351b48ca2ebef0027", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040fa36769835d1d215f156d5e82bed2fa76aab134bdb1d3bd40975faf5ac19cc6e67d675a8f0dc4760b3f8fbe0f0853a80b58af8dd2c4a41afbf9cb0c72d016ca", + "wx" : "0fa36769835d1d215f156d5e82bed2fa76aab134bdb1d3bd40975faf5ac19cc6", + "wy" : "00e67d675a8f0dc4760b3f8fbe0f0853a80b58af8dd2c4a41afbf9cb0c72d016ca" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040fa36769835d1d215f156d5e82bed2fa76aab134bdb1d3bd40975faf5ac19cc6e67d675a8f0dc4760b3f8fbe0f0853a80b58af8dd2c4a41afbf9cb0c72d016ca", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAED6NnaYNdHSFfFW1egr7S+naqsTS9sdO9\nQJdfr1rBnMbmfWdajw3Edgs/j74PCFOoC1ivjdLEpBr7+csMctAWyg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 424, + "comment" : "k*G has a large x-coordinate", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30360211014551231950b75fc4402da1722fc9baeb022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "valid" + }, + { + "tcId" : 425, + "comment" : "r too large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2c022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042f1db0895a8d615779a38ddcbeacad9458f35688b587abeeda1cb5a891e954a5b591478e3b81f5881dd71f93b811130a67ea697f452faccd5c5117fac15f5f93", + "wx" : "2f1db0895a8d615779a38ddcbeacad9458f35688b587abeeda1cb5a891e954a5", + "wy" : "00b591478e3b81f5881dd71f93b811130a67ea697f452faccd5c5117fac15f5f93" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042f1db0895a8d615779a38ddcbeacad9458f35688b587abeeda1cb5a891e954a5b591478e3b81f5881dd71f93b811130a67ea697f452faccd5c5117fac15f5f93", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAELx2wiVqNYVd5o43cvqytlFjzVoi1h6vu\n2hy1qJHpVKW1kUeOO4H1iB3XH5O4ERMKZ+ppf0UvrM1cURf6wV9fkw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 426, + "comment" : "r,s are large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04462155174b64dd050601b6d7c2297251815d413e26c9b91d123536e76fd3fb135f0a20f86528dff246ecc71d5d005b2935e4d8e0b076fd6792d4a2b3fd2b7bb9", + "wx" : "462155174b64dd050601b6d7c2297251815d413e26c9b91d123536e76fd3fb13", + "wy" : "5f0a20f86528dff246ecc71d5d005b2935e4d8e0b076fd6792d4a2b3fd2b7bb9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004462155174b64dd050601b6d7c2297251815d413e26c9b91d123536e76fd3fb135f0a20f86528dff246ecc71d5d005b2935e4d8e0b076fd6792d4a2b3fd2b7bb9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAERiFVF0tk3QUGAbbXwilyUYFdQT4mybkd\nEjU252/T+xNfCiD4ZSjf8kbsxx1dAFspNeTY4LB2/WeS1KKz/St7uQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 427, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02203e9a7582886089c62fb840cf3b83061cd1cff3ae4341808bb5bdee6191174177", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048e89e0fff2d768c7c139b22b90aa66b24b3b1ced4345c469e439b2c80d6fed084eb9ca1486ff3411db46590f78008d6d6a0a9cf9cf36b2bef833407af5bc883e", + "wx" : "008e89e0fff2d768c7c139b22b90aa66b24b3b1ced4345c469e439b2c80d6fed08", + "wy" : "4eb9ca1486ff3411db46590f78008d6d6a0a9cf9cf36b2bef833407af5bc883e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048e89e0fff2d768c7c139b22b90aa66b24b3b1ced4345c469e439b2c80d6fed084eb9ca1486ff3411db46590f78008d6d6a0a9cf9cf36b2bef833407af5bc883e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEjong//LXaMfBObIrkKpmsks7HO1DRcRp\n5DmyyA1v7QhOucoUhv80EdtGWQ94AI1tagqc+c82sr74M0B69byIPg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 428, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022024238e70b431b1a64efdf9032669939d4b77f249503fc6905feb7540dea3e6d2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f4c2d7df7ca616bce49212e47ed112106445f47cf114782626740d37e1c596df1088b19bcaf0d10609a46bbdfd626a83d13e62d405775ae3941755b278a443c0", + "wx" : "00f4c2d7df7ca616bce49212e47ed112106445f47cf114782626740d37e1c596df", + "wy" : "1088b19bcaf0d10609a46bbdfd626a83d13e62d405775ae3941755b278a443c0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f4c2d7df7ca616bce49212e47ed112106445f47cf114782626740d37e1c596df1088b19bcaf0d10609a46bbdfd626a83d13e62d405775ae3941755b278a443c0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE9MLX33ymFrzkkhLkftESEGRF9HzxFHgm\nJnQNN+HFlt8QiLGbyvDRBgmka739YmqD0T5i1AV3WuOUF1WyeKRDwA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 429, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0443053fa57436a0b26f0f887b2403ccd9d18f14b7866e1da593835e93cd103a156039d7ccf6c355ac94ed59225aab8a5aa190c89c422f80e71246b998818ecd54", + "wx" : "43053fa57436a0b26f0f887b2403ccd9d18f14b7866e1da593835e93cd103a15", + "wy" : "6039d7ccf6c355ac94ed59225aab8a5aa190c89c422f80e71246b998818ecd54" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000443053fa57436a0b26f0f887b2403ccd9d18f14b7866e1da593835e93cd103a156039d7ccf6c355ac94ed59225aab8a5aa190c89c422f80e71246b998818ecd54", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQwU/pXQ2oLJvD4h7JAPM2dGPFLeGbh2l\nk4Nek80QOhVgOdfM9sNVrJTtWSJaq4paoZDInEIvgOcSRrmYgY7NVA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 430, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020102", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049b27e4409c49abe9d8d1b90edc64367daedb43d68a41c501032dba5d73ef10210cd42cc8488eb0588680b94e934ff744f4e6cb079737beb5eeabbe56fd11a7bb", + "wx" : "009b27e4409c49abe9d8d1b90edc64367daedb43d68a41c501032dba5d73ef1021", + "wy" : "0cd42cc8488eb0588680b94e934ff744f4e6cb079737beb5eeabbe56fd11a7bb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049b27e4409c49abe9d8d1b90edc64367daedb43d68a41c501032dba5d73ef10210cd42cc8488eb0588680b94e934ff744f4e6cb079737beb5eeabbe56fd11a7bb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEmyfkQJxJq+nY0bkO3GQ2fa7bQ9aKQcUB\nAy26XXPvECEM1CzISI6wWIaAuU6TT/dE9ObLB5c3vrXuq75W/RGnuw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 431, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ef2c0193d262327fbe06d3a6edeada676b0aeac94f43b5cff5d819e853f637dd7917a8ace976df5ca947daba44607d623d65b7a29a59297723b66cd6fe060345", + "wx" : "00ef2c0193d262327fbe06d3a6edeada676b0aeac94f43b5cff5d819e853f637dd", + "wy" : "7917a8ace976df5ca947daba44607d623d65b7a29a59297723b66cd6fe060345" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ef2c0193d262327fbe06d3a6edeada676b0aeac94f43b5cff5d819e853f637dd7917a8ace976df5ca947daba44607d623d65b7a29a59297723b66cd6fe060345", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE7ywBk9JiMn++BtOm7eraZ2sK6slPQ7XP\n9dgZ6FP2N915F6is6XbfXKlH2rpEYH1iPWW3oppZKXcjtmzW/gYDRQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 432, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04bce72b0e7d13fc61fb298d7e799c31eb7561ca022c00f7cc66848110295055a8526a501171c1007be07d433f9cb4659a26d1cb910aed64e1b2cce73fb3ceee2b", + "wx" : "00bce72b0e7d13fc61fb298d7e799c31eb7561ca022c00f7cc66848110295055a8", + "wy" : "526a501171c1007be07d433f9cb4659a26d1cb910aed64e1b2cce73fb3ceee2b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004bce72b0e7d13fc61fb298d7e799c31eb7561ca022c00f7cc66848110295055a8526a501171c1007be07d433f9cb4659a26d1cb910aed64e1b2cce73fb3ceee2b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEvOcrDn0T/GH7KY1+eZwx63VhygIsAPfM\nZoSBEClQVahSalARccEAe+B9Qz+ctGWaJtHLkQrtZOGyzOc/s87uKw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 433, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020102", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048afb5d6db0101d97bed729ad568856639c73d39f19353ed60d7c9515c3e33378a0587fb9aca4ffd17787f3ae81cd871218eacf2c32bdd9ed5ee5e4d15cb779f1", + "wx" : "008afb5d6db0101d97bed729ad568856639c73d39f19353ed60d7c9515c3e33378", + "wy" : "00a0587fb9aca4ffd17787f3ae81cd871218eacf2c32bdd9ed5ee5e4d15cb779f1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048afb5d6db0101d97bed729ad568856639c73d39f19353ed60d7c9515c3e33378a0587fb9aca4ffd17787f3ae81cd871218eacf2c32bdd9ed5ee5e4d15cb779f1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEivtdbbAQHZe+1ymtVohWY5xz058ZNT7W\nDXyVFcPjM3igWH+5rKT/0XeH866BzYcSGOrPLDK92e1e5eTRXLd58Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 434, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020103", + "result" : "valid" + }, + { + "tcId" : 435, + "comment" : "r is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364143020103", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04358a4f5840da0d9344a4f62e090d75870948f57714be0eb331f7fc956e77e9fc84245dcf34ac6ace334c1b6cea82082fe4ccddd2f780b4eb737bc8f4648ef98e", + "wx" : "358a4f5840da0d9344a4f62e090d75870948f57714be0eb331f7fc956e77e9fc", + "wy" : "0084245dcf34ac6ace334c1b6cea82082fe4ccddd2f780b4eb737bc8f4648ef98e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004358a4f5840da0d9344a4f62e090d75870948f57714be0eb331f7fc956e77e9fc84245dcf34ac6ace334c1b6cea82082fe4ccddd2f780b4eb737bc8f4648ef98e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAENYpPWEDaDZNEpPYuCQ11hwlI9XcUvg6z\nMff8lW536fyEJF3PNKxqzjNMG2zqgggv5Mzd0veAtOtze8j0ZI75jg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 436, + "comment" : "s is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020102022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd04917c8", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0406b2c1b72f12846bbcceda68183372d3f05ec591c43569361646f5916a00a7202282d15b70f19db914c6fdd8faf15ab90ced3bd4c3f59a247be41610497594c6", + "wx" : "06b2c1b72f12846bbcceda68183372d3f05ec591c43569361646f5916a00a720", + "wy" : "2282d15b70f19db914c6fdd8faf15ab90ced3bd4c3f59a247be41610497594c6" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000406b2c1b72f12846bbcceda68183372d3f05ec591c43569361646f5916a00a7202282d15b70f19db914c6fdd8faf15ab90ced3bd4c3f59a247be41610497594c6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEBrLBty8ShGu8ztpoGDNy0/BexZHENWk2\nFkb1kWoApyAigtFbcPGduRTG/dj68Vq5DO071MP1miR75BYQSXWUxg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 437, + "comment" : "small r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302702020101022100c58b162c58b162c58b162c58b162c58a1b242973853e16db75c8a1a71da4d39d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044e61226e0b1c1e5a40767956c7b530eace83d550038e32bd14c5258c48c939fd57d069215ea210b386820a2d426fc711862bcfb34c7deaaed404d17692892cc4", + "wx" : "4e61226e0b1c1e5a40767956c7b530eace83d550038e32bd14c5258c48c939fd", + "wy" : "57d069215ea210b386820a2d426fc711862bcfb34c7deaaed404d17692892cc4" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044e61226e0b1c1e5a40767956c7b530eace83d550038e32bd14c5258c48c939fd57d069215ea210b386820a2d426fc711862bcfb34c7deaaed404d17692892cc4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAETmEibgscHlpAdnlWx7Uw6s6D1VADjjK9\nFMUljEjJOf1X0GkhXqIQs4aCCi1Cb8cRhivPs0x96q7UBNF2koksxA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 438, + "comment" : "smallish r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302c02072d9b4d347952cc022100fcbc5103d0da267477d1791461cf2aa44bf9d43198f79507bd8779d69a13108e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04cf259a52f769eecab5071c0b4676bc4cc474474b74675fe8bd1660df5b70ce1b722f774a601a61f2e8e364477b0ccea457b76977ab300139c4ee0e1fbb7fe8f9", + "wx" : "00cf259a52f769eecab5071c0b4676bc4cc474474b74675fe8bd1660df5b70ce1b", + "wy" : "722f774a601a61f2e8e364477b0ccea457b76977ab300139c4ee0e1fbb7fe8f9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004cf259a52f769eecab5071c0b4676bc4cc474474b74675fe8bd1660df5b70ce1b722f774a601a61f2e8e364477b0ccea457b76977ab300139c4ee0e1fbb7fe8f9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEzyWaUvdp7sq1BxwLRna8TMR0R0t0Z1/o\nvRZg31twzhtyL3dKYBph8ujjZEd7DM6kV7dpd6swATnE7g4fu3/o+Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 439, + "comment" : "100-bit r and small s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d1033e67e37b32b445580bf4efc022100906f906f906f906f906f906f906f906ed8e426f7b1968c35a204236a579723d2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0467ba78328cffa6eb3f7119096adf17e3fca6b2da966c03bc66174c2984a1d5539abdde7989d6f5083187261393a6e162eb508ae62749e41caf55b2be14d9a960", + "wx" : "67ba78328cffa6eb3f7119096adf17e3fca6b2da966c03bc66174c2984a1d553", + "wy" : "009abdde7989d6f5083187261393a6e162eb508ae62749e41caf55b2be14d9a960" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000467ba78328cffa6eb3f7119096adf17e3fca6b2da966c03bc66174c2984a1d5539abdde7989d6f5083187261393a6e162eb508ae62749e41caf55b2be14d9a960", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEZ7p4Moz/pus/cRkJat8X4/ymstqWbAO8\nZhdMKYSh1VOavd55idb1CDGHJhOTpuFi61CK5idJ5ByvVbK+FNmpYA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 440, + "comment" : "small r and 100 bit s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020201010220783266e90f43dafe5cd9b3b0be86de22f9de83677d0f50713a468ec72fcf5d57", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048f8c5fdf711aff7ddc807c4308a132b1099e3e95dabf803ca29283dd41b090558f60c71b4a813e7b4364b0a7260765042d3696a9580548f585be12633ac3b824", + "wx" : "008f8c5fdf711aff7ddc807c4308a132b1099e3e95dabf803ca29283dd41b09055", + "wy" : "008f60c71b4a813e7b4364b0a7260765042d3696a9580548f585be12633ac3b824" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048f8c5fdf711aff7ddc807c4308a132b1099e3e95dabf803ca29283dd41b090558f60c71b4a813e7b4364b0a7260765042d3696a9580548f585be12633ac3b824", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEj4xf33Ea/33cgHxDCKEysQmePpXav4A8\nopKD3UGwkFWPYMcbSoE+e0NksKcmB2UELTaWqVgFSPWFvhJjOsO4JA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 441, + "comment" : "100-bit r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3031020d062522bbd3ecbe7c39e93e7c260220783266e90f43dafe5cd9b3b0be86de22f9de83677d0f50713a468ec72fcf5d57", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04fb78c45f16de9b4e098ddc9ef6eb340b055a6a49c438b87bf7969dc24f7967dd2af9ebaba55b6713e06e9df9e42b79ea9364405ebab1199ea230ae38ec83b91a", + "wx" : "00fb78c45f16de9b4e098ddc9ef6eb340b055a6a49c438b87bf7969dc24f7967dd", + "wy" : "2af9ebaba55b6713e06e9df9e42b79ea9364405ebab1199ea230ae38ec83b91a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004fb78c45f16de9b4e098ddc9ef6eb340b055a6a49c438b87bf7969dc24f7967dd2af9ebaba55b6713e06e9df9e42b79ea9364405ebab1199ea230ae38ec83b91a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE+3jEXxbem04Jjdye9us0CwVaaknEOLh7\n95adwk95Z90q+eurpVtnE+BunfnkK3nqk2RAXrqxGZ6iMK447IO5Gg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 442, + "comment" : "r and s^-1 are close to n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03640c1022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0448d5a8e42195b4e9ccd4dceb80bf1b730777de266b34a3c7e88ef9befe4fac2e261525ba6f1145f51b35936502c421e208d3646ff7b92703afb7663d0c786cb0", + "wx" : "48d5a8e42195b4e9ccd4dceb80bf1b730777de266b34a3c7e88ef9befe4fac2e", + "wy" : "261525ba6f1145f51b35936502c421e208d3646ff7b92703afb7663d0c786cb0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000448d5a8e42195b4e9ccd4dceb80bf1b730777de266b34a3c7e88ef9befe4fac2e261525ba6f1145f51b35936502c421e208d3646ff7b92703afb7663d0c786cb0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESNWo5CGVtOnM1NzrgL8bcwd33iZrNKPH\n6I75vv5PrC4mFSW6bxFF9Rs1k2UCxCHiCNNkb/e5JwOvt2Y9DHhssA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 443, + "comment" : "r and s are 64-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30160209009c44febf31c3594d020900839ed28247c2b06b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04166112b56939449167ae713e3f7dbe4225e82321ee84fbbfea10d4f7b035a7c5b8c96bd3bb190f8bbae83aa4210b315d650b536860e21621dce0d751dfa471a1", + "wx" : "166112b56939449167ae713e3f7dbe4225e82321ee84fbbfea10d4f7b035a7c5", + "wy" : "00b8c96bd3bb190f8bbae83aa4210b315d650b536860e21621dce0d751dfa471a1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004166112b56939449167ae713e3f7dbe4225e82321ee84fbbfea10d4f7b035a7c5b8c96bd3bb190f8bbae83aa4210b315d650b536860e21621dce0d751dfa471a1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEFmEStWk5RJFnrnE+P32+QiXoIyHuhPu/\n6hDU97A1p8W4yWvTuxkPi7roOqQhCzFdZQtTaGDiFiHc4NdR36RxoQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 444, + "comment" : "r and s are 100-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "301e020d09df8b682430beef6f5fd7c7cf020d0fd0a62e13778f4222a0d61c8a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04cfc9b4068550c2b847fd3f2d993b75161aeda903b156bd5e9a06b9fec14393386a02aad5b6bb8b63b4669c5f8b31ad669ea5461c348f9d2775b537eb43f9175c", + "wx" : "00cfc9b4068550c2b847fd3f2d993b75161aeda903b156bd5e9a06b9fec1439338", + "wy" : "6a02aad5b6bb8b63b4669c5f8b31ad669ea5461c348f9d2775b537eb43f9175c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004cfc9b4068550c2b847fd3f2d993b75161aeda903b156bd5e9a06b9fec14393386a02aad5b6bb8b63b4669c5f8b31ad669ea5461c348f9d2775b537eb43f9175c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEz8m0BoVQwrhH/T8tmTt1FhrtqQOxVr1e\nmga5/sFDkzhqAqrVtruLY7RmnF+LMa1mnqVGHDSPnSd1tTfrQ/kXXA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 445, + "comment" : "r and s are 128-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30260211008a598e563a89f526c32ebec8de26367a02110084f633e2042630e99dd0f1e16f7a04bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ddf6e65f686360b9487530ae2d6f717f86070fbd5333cbbd8c08576ba976cf5872b1edc23ace294715798912e007d59761b6f63dd29f14a0d65c076bd6aad2cf", + "wx" : "00ddf6e65f686360b9487530ae2d6f717f86070fbd5333cbbd8c08576ba976cf58", + "wy" : "72b1edc23ace294715798912e007d59761b6f63dd29f14a0d65c076bd6aad2cf" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ddf6e65f686360b9487530ae2d6f717f86070fbd5333cbbd8c08576ba976cf5872b1edc23ace294715798912e007d59761b6f63dd29f14a0d65c076bd6aad2cf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE3fbmX2hjYLlIdTCuLW9xf4YHD71TM8u9\njAhXa6l2z1hyse3COs4pRxV5iRLgB9WXYbb2PdKfFKDWXAdr1qrSzw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 446, + "comment" : "r and s are 160-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b7b91538786272e70a603cfc80c52f87f057a369149848dbc865a8d2f445ec26bd90ba8844f58db6744b5f31a470e59ebfee1891be36ee65b18ba172e5eaf943", + "wx" : "00b7b91538786272e70a603cfc80c52f87f057a369149848dbc865a8d2f445ec26", + "wy" : "00bd90ba8844f58db6744b5f31a470e59ebfee1891be36ee65b18ba172e5eaf943" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b7b91538786272e70a603cfc80c52f87f057a369149848dbc865a8d2f445ec26bd90ba8844f58db6744b5f31a470e59ebfee1891be36ee65b18ba172e5eaf943", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEt7kVOHhicucKYDz8gMUvh/BXo2kUmEjb\nyGWo0vRF7Ca9kLqIRPWNtnRLXzGkcOWev+4Ykb427mWxi6Fy5er5Qw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 447, + "comment" : "s == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3025022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1020101", + "result" : "valid" + }, + { + "tcId" : 448, + "comment" : "s == 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3025022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1020100", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ae56d3389670bc30043e0ec892e01842fde6612b32e84fc8b09e013492fd47a9420e10582476634678b200368868730d3b38b4d53a854de259e0431564837e39", + "wx" : "00ae56d3389670bc30043e0ec892e01842fde6612b32e84fc8b09e013492fd47a9", + "wy" : "420e10582476634678b200368868730d3b38b4d53a854de259e0431564837e39" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ae56d3389670bc30043e0ec892e01842fde6612b32e84fc8b09e013492fd47a9420e10582476634678b200368868730d3b38b4d53a854de259e0431564837e39", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAErlbTOJZwvDAEPg7IkuAYQv3mYSsy6E/I\nsJ4BNJL9R6lCDhBYJHZjRniyADaIaHMNOzi01TqFTeJZ4EMVZIN+OQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 449, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220419d981c515af8cc82545aac0c85e9e308fbb2eab6acd7ed497e0b4145a18fd9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04aaf6fe07d1022e52b605a88f3a7e569571cace4b8c0bb0ab70b4160dc6926c6e20e90e7d0ab15b87d432a293ce039b77f64978f1a7da23c7a1b1129e0ba9a4b4", + "wx" : "00aaf6fe07d1022e52b605a88f3a7e569571cace4b8c0bb0ab70b4160dc6926c6e", + "wy" : "20e90e7d0ab15b87d432a293ce039b77f64978f1a7da23c7a1b1129e0ba9a4b4" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004aaf6fe07d1022e52b605a88f3a7e569571cace4b8c0bb0ab70b4160dc6926c6e20e90e7d0ab15b87d432a293ce039b77f64978f1a7da23c7a1b1129e0ba9a4b4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEqvb+B9ECLlK2BaiPOn5WlXHKzkuMC7Cr\ncLQWDcaSbG4g6Q59CrFbh9QyopPOA5t39kl48afaI8ehsRKeC6mktA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 450, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102201b21717ad71d23bbac60a9ad0baf75b063c9fdf52a00ebf99d022172910993c9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04810f37f1426b0e59292171e8a493450496733c5114b95b35b185239e58b5b7adff7e4a8fc5ad14a0136075c88ca77659b6bca409e8cf0705b0b8c00d3bef5bfc", + "wx" : "00810f37f1426b0e59292171e8a493450496733c5114b95b35b185239e58b5b7ad", + "wy" : "00ff7e4a8fc5ad14a0136075c88ca77659b6bca409e8cf0705b0b8c00d3bef5bfc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004810f37f1426b0e59292171e8a493450496733c5114b95b35b185239e58b5b7adff7e4a8fc5ad14a0136075c88ca77659b6bca409e8cf0705b0b8c00d3bef5bfc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEgQ838UJrDlkpIXHopJNFBJZzPFEUuVs1\nsYUjnli1t63/fkqPxa0UoBNgdciMp3ZZtrykCejPBwWwuMANO+9b/A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 451, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102202f588f66018f3dd14db3e28e77996487e32486b521ed8e5a20f06591951777e9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0493ae05a499eecf676fa6ca2cc4fc0c2bcecabdba28e2a626a10066d3748fa472b543a33c9e7930daed518f5920ef883175a3af764a7eaa57acf988dabf2288b3", + "wx" : "0093ae05a499eecf676fa6ca2cc4fc0c2bcecabdba28e2a626a10066d3748fa472", + "wy" : "00b543a33c9e7930daed518f5920ef883175a3af764a7eaa57acf988dabf2288b3" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000493ae05a499eecf676fa6ca2cc4fc0c2bcecabdba28e2a626a10066d3748fa472b543a33c9e7930daed518f5920ef883175a3af764a7eaa57acf988dabf2288b3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEk64FpJnuz2dvpsosxPwMK87Kvboo4qYm\noQBm03SPpHK1Q6M8nnkw2u1Rj1kg74gxdaOvdkp+qles+YjavyKIsw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 452, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220091a08870ff4daf9123b30c20e8c4fc8505758dcf4074fcaff2170c9bfcf74f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a4e5a3f71b8de9d50d82cc0020dd73a9d53df41951cf33b97cf655d7d90d95dceadec6f6e1a5bb374b367bc4aa977ea7014c52898754156f8510c990235f184b", + "wx" : "00a4e5a3f71b8de9d50d82cc0020dd73a9d53df41951cf33b97cf655d7d90d95dc", + "wy" : "00eadec6f6e1a5bb374b367bc4aa977ea7014c52898754156f8510c990235f184b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a4e5a3f71b8de9d50d82cc0020dd73a9d53df41951cf33b97cf655d7d90d95dceadec6f6e1a5bb374b367bc4aa977ea7014c52898754156f8510c990235f184b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEpOWj9xuN6dUNgswAIN1zqdU99BlRzzO5\nfPZV19kNldzq3sb24aW7N0s2e8Sql36nAUxSiYdUFW+FEMmQI18YSw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 453, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102207c370dc0ce8c59a8b273cba44a7c1191fc3186dc03cab96b0567312df0d0b250", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0401645fd8c249d6c1c9a42d49c1bf8ae8c069e415d6c5f01e54dfcc0370e108f92d1e8cef9f160e5272c618e80d6a288f37215f9625e9b65de5090aa10a02d548", + "wx" : "01645fd8c249d6c1c9a42d49c1bf8ae8c069e415d6c5f01e54dfcc0370e108f9", + "wy" : "2d1e8cef9f160e5272c618e80d6a288f37215f9625e9b65de5090aa10a02d548" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000401645fd8c249d6c1c9a42d49c1bf8ae8c069e415d6c5f01e54dfcc0370e108f92d1e8cef9f160e5272c618e80d6a288f37215f9625e9b65de5090aa10a02d548", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAWRf2MJJ1sHJpC1Jwb+K6MBp5BXWxfAe\nVN/MA3DhCPktHozvnxYOUnLGGOgNaiiPNyFfliXptl3lCQqhCgLVSA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 454, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022070b59a7d1ee77a2f9e0491c2a7cfcd0ed04df4a35192f6132dcc668c79a6160e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04fd1ac8422519c2b37bb07c995e005431740a61fc6b7908e9b029ceac9f4c3a56bf605dc4fd7fa8dc6195ba61ec11278382156ff2394751524e80f3c718553212", + "wx" : "00fd1ac8422519c2b37bb07c995e005431740a61fc6b7908e9b029ceac9f4c3a56", + "wy" : "00bf605dc4fd7fa8dc6195ba61ec11278382156ff2394751524e80f3c718553212" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004fd1ac8422519c2b37bb07c995e005431740a61fc6b7908e9b029ceac9f4c3a56bf605dc4fd7fa8dc6195ba61ec11278382156ff2394751524e80f3c718553212", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE/RrIQiUZwrN7sHyZXgBUMXQKYfxreQjp\nsCnOrJ9MOla/YF3E/X+o3GGVumHsESeDghVv8jlHUVJOgPPHGFUyEg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 455, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102202736d76e412246e097148e2bf62915614eb7c428913a58eb5e9cd4674a9423de", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044e773d65966770b64d2e0e76b44fe3f75ffe0db6f12c207f382f78afacd52f2bf53bbe2709374374e644a5f35844b82d7a1504134eb82099ea901941566a184a", + "wx" : "4e773d65966770b64d2e0e76b44fe3f75ffe0db6f12c207f382f78afacd52f2b", + "wy" : "00f53bbe2709374374e644a5f35844b82d7a1504134eb82099ea901941566a184a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044e773d65966770b64d2e0e76b44fe3f75ffe0db6f12c207f382f78afacd52f2bf53bbe2709374374e644a5f35844b82d7a1504134eb82099ea901941566a184a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAETnc9ZZZncLZNLg52tE/j91/+DbbxLCB/\nOC94r6zVLyv1O74nCTdDdOZEpfNYRLgtehUEE064IJnqkBlBVmoYSg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 456, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102204a1e12831fbe93627b02d6e7f24bccdd6ef4b2d0f46739eaf3b1eaf0ca117770", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044ce8f39f857b80325713262b0816823dea62a5b73aa9d0724e9f750156706147fd7e1688e6b0f6a8ba20a8df5cc8cdf585f2c6cb90e76ca7e10dd54a9f469332", + "wx" : "4ce8f39f857b80325713262b0816823dea62a5b73aa9d0724e9f750156706147", + "wy" : "00fd7e1688e6b0f6a8ba20a8df5cc8cdf585f2c6cb90e76ca7e10dd54a9f469332" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044ce8f39f857b80325713262b0816823dea62a5b73aa9d0724e9f750156706147fd7e1688e6b0f6a8ba20a8df5cc8cdf585f2c6cb90e76ca7e10dd54a9f469332", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAETOjzn4V7gDJXEyYrCBaCPepipbc6qdBy\nTp91AVZwYUf9fhaI5rD2qLogqN9cyM31hfLGy5DnbKfhDdVKn0aTMg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 457, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022006c778d4dfff7dee06ed88bc4e0ed34fc553aad67caf796f2a1c6487c1b2e877", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049ad2fdb05c2377d28b1905ad02e2c2a117cd1cdb5bc0db4c1796d27c1ab5b56220ca038df4b0c06f3afc08fa9cf25a2e28ade3da63510ef7405487abbfb96262", + "wx" : "009ad2fdb05c2377d28b1905ad02e2c2a117cd1cdb5bc0db4c1796d27c1ab5b562", + "wy" : "20ca038df4b0c06f3afc08fa9cf25a2e28ade3da63510ef7405487abbfb96262" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049ad2fdb05c2377d28b1905ad02e2c2a117cd1cdb5bc0db4c1796d27c1ab5b56220ca038df4b0c06f3afc08fa9cf25a2e28ade3da63510ef7405487abbfb96262", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEmtL9sFwjd9KLGQWtAuLCoRfNHNtbwNtM\nF5bSfBq1tWIgygON9LDAbzr8CPqc8louKK3j2mNRDvdAVIerv7liYg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 458, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102204de459ef9159afa057feb3ec40fef01c45b809f4ab296ea48c206d4249a2b451", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0493db0e5fbfda983ba543821c7bc0a4fd5f98287d18575e8b815bf36f2d18cd3dfdb192a8912b317f95a9f1756aa9e73e12be45e39c764fb23b108197ac3ea8af", + "wx" : "0093db0e5fbfda983ba543821c7bc0a4fd5f98287d18575e8b815bf36f2d18cd3d", + "wy" : "00fdb192a8912b317f95a9f1756aa9e73e12be45e39c764fb23b108197ac3ea8af" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000493db0e5fbfda983ba543821c7bc0a4fd5f98287d18575e8b815bf36f2d18cd3dfdb192a8912b317f95a9f1756aa9e73e12be45e39c764fb23b108197ac3ea8af", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEk9sOX7/amDulQ4Ice8Ck/V+YKH0YV16L\ngVvzby0YzT39sZKokSsxf5Wp8XVqqec+Er5F45x2T7I7EIGXrD6orw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 459, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220745d294978007302033502e1acc48b63ae6500be43adbea1b258d6b423dbb416", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049389f01b62417b372ec1f18c61b11cb500af39a9ac94a2c89735deb2b527cc230122435f6058f32b3e5defa25d7fe7c5bc757749da40df426a4fc1e7ef005c17", + "wx" : "009389f01b62417b372ec1f18c61b11cb500af39a9ac94a2c89735deb2b527cc23", + "wy" : "0122435f6058f32b3e5defa25d7fe7c5bc757749da40df426a4fc1e7ef005c17" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049389f01b62417b372ec1f18c61b11cb500af39a9ac94a2c89735deb2b527cc230122435f6058f32b3e5defa25d7fe7c5bc757749da40df426a4fc1e7ef005c17", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEk4nwG2JBezcuwfGMYbEctQCvOamslKLI\nlzXesrUnzCMBIkNfYFjzKz5d76Jdf+fFvHV3SdpA30JqT8Hn7wBcFw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 460, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102207b2a785e3896f59b2d69da57648e80ad3c133a750a2847fd2098ccd902042b6c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04339050b9f8039f925f105ca80ef12fbf2480c4a95827395584e59212ec2045338657db3296a8b7629243c149012b5d64f40df5f104c7629f65f51ad25a9dc1d5", + "wx" : "339050b9f8039f925f105ca80ef12fbf2480c4a95827395584e59212ec204533", + "wy" : "008657db3296a8b7629243c149012b5d64f40df5f104c7629f65f51ad25a9dc1d5" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004339050b9f8039f925f105ca80ef12fbf2480c4a95827395584e59212ec2045338657db3296a8b7629243c149012b5d64f40df5f104c7629f65f51ad25a9dc1d5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEM5BQufgDn5JfEFyoDvEvvySAxKlYJzlV\nhOWSEuwgRTOGV9sylqi3YpJDwUkBK11k9A318QTHYp9l9RrSWp3B1Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 461, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022071ae94a72ca896875e7aa4a4c3d29afdb4b35b6996273e63c47ac519256c5eb1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0458850b0841339746b06decc9ca47ffda18cb8e5289a97574bb62604ace0dfaf4d0e10766024bb042cb04bd61d282a006b59139a8623c9443652894b2f1255af6", + "wx" : "58850b0841339746b06decc9ca47ffda18cb8e5289a97574bb62604ace0dfaf4", + "wy" : "00d0e10766024bb042cb04bd61d282a006b59139a8623c9443652894b2f1255af6" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000458850b0841339746b06decc9ca47ffda18cb8e5289a97574bb62604ace0dfaf4d0e10766024bb042cb04bd61d282a006b59139a8623c9443652894b2f1255af6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEWIULCEEzl0awbezJykf/2hjLjlKJqXV0\nu2JgSs4N+vTQ4QdmAkuwQssEvWHSgqAGtZE5qGI8lENlKJSy8SVa9g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 462, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102200fa527fa7343c0bc9ec35a6278bfbff4d83301b154fc4bd14aee7eb93445b5f9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04cecffaa16b57999d3fe95627a312a06b0554f2641ff6f781e366283c9fc24a9e5588700c6a4ebea111151d1f5c96265c62d5f905e5b2590c202cfcd3c1848fc3", + "wx" : "00cecffaa16b57999d3fe95627a312a06b0554f2641ff6f781e366283c9fc24a9e", + "wy" : "5588700c6a4ebea111151d1f5c96265c62d5f905e5b2590c202cfcd3c1848fc3" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004cecffaa16b57999d3fe95627a312a06b0554f2641ff6f781e366283c9fc24a9e5588700c6a4ebea111151d1f5c96265c62d5f905e5b2590c202cfcd3c1848fc3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEzs/6oWtXmZ0/6VYnoxKgawVU8mQf9veB\n42YoPJ/CSp5ViHAMak6+oREVHR9cliZcYtX5BeWyWQwgLPzTwYSPww==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 463, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102206539c0adadd0525ff42622164ce9314348bd0863b4c80e936b23ca0414264671", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049c0c462658f6493295775ed99348db5895ae8471c819a1ed9ae1b5180397f08ff386d14d6e56758d1dafa50755af4fe079233c139436abf61a9208f8b7f893af", + "wx" : "009c0c462658f6493295775ed99348db5895ae8471c819a1ed9ae1b5180397f08f", + "wy" : "00f386d14d6e56758d1dafa50755af4fe079233c139436abf61a9208f8b7f893af" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049c0c462658f6493295775ed99348db5895ae8471c819a1ed9ae1b5180397f08ff386d14d6e56758d1dafa50755af4fe079233c139436abf61a9208f8b7f893af", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEnAxGJlj2STKVd17Zk0jbWJWuhHHIGaHt\nmuG1GAOX8I/zhtFNblZ1jR2vpQdVr0/geSM8E5Q2q/Yakgj4t/iTrw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 464, + "comment" : "point at infinity during verify", + "flags" : [ + "PointDuplication", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0489e63127c97dd4cb19fb802f22229decd0d852639b3d982b2589817a7e520049e1fd70b15e5e5d3ea4ab748903ca891ab3964ff4d7bf48b17c6007957a5e2021", + "wx" : "0089e63127c97dd4cb19fb802f22229decd0d852639b3d982b2589817a7e520049", + "wy" : "00e1fd70b15e5e5d3ea4ab748903ca891ab3964ff4d7bf48b17c6007957a5e2021" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000489e63127c97dd4cb19fb802f22229decd0d852639b3d982b2589817a7e520049e1fd70b15e5e5d3ea4ab748903ca891ab3964ff4d7bf48b17c6007957a5e2021", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEieYxJ8l91MsZ+4AvIiKd7NDYUmObPZgr\nJYmBen5SAEnh/XCxXl5dPqSrdIkDyokas5ZP9Ne/SLF8YAeVel4gIQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 465, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04eb89c838542537c3f530b6e8bc62d1e6284ed4e9b8c6aea96e82970d8abdefff58cae0df61874d30c2afa05c8a703800ac80564397688b19a5149f65054b138f", + "wx" : "00eb89c838542537c3f530b6e8bc62d1e6284ed4e9b8c6aea96e82970d8abdefff", + "wy" : "58cae0df61874d30c2afa05c8a703800ac80564397688b19a5149f65054b138f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004eb89c838542537c3f530b6e8bc62d1e6284ed4e9b8c6aea96e82970d8abdefff58cae0df61874d30c2afa05c8a703800ac80564397688b19a5149f65054b138f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE64nIOFQlN8P1MLbovGLR5ihO1Om4xq6p\nboKXDYq97/9YyuDfYYdNMMKvoFyKcDgArIBWQ5doixmlFJ9lBUsTjw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 466, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0472bdb42d379cd807e8dcdd597e5c68c464ecb4211ee885f7210e55ff52e9368834231f3921839c8a3a2cc7ff5964f1f79c77f2c8813e2659684ee1d8bf7125c0", + "wx" : "72bdb42d379cd807e8dcdd597e5c68c464ecb4211ee885f7210e55ff52e93688", + "wy" : "34231f3921839c8a3a2cc7ff5964f1f79c77f2c8813e2659684ee1d8bf7125c0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000472bdb42d379cd807e8dcdd597e5c68c464ecb4211ee885f7210e55ff52e9368834231f3921839c8a3a2cc7ff5964f1f79c77f2c8813e2659684ee1d8bf7125c0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEcr20LTec2Afo3N1ZflxoxGTstCEe6IX3\nIQ5V/1LpNog0Ix85IYOcijosx/9ZZPH3nHfyyIE+JlloTuHYv3ElwA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 467, + "comment" : "u1 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b80220342dae751a63a3ca8189cf342b3b34eaaa2565e2c7e26121c1bfd5435447f1c3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0457cf2c69876d8a9822a6b796492aa889c39fa1371fc730c5a15532ac4aa197b38c936d0041821e1ca81df3f1fd0a495c0c8974a81fb41cec4622cc1bfcccf3d2", + "wx" : "57cf2c69876d8a9822a6b796492aa889c39fa1371fc730c5a15532ac4aa197b3", + "wy" : "008c936d0041821e1ca81df3f1fd0a495c0c8974a81fb41cec4622cc1bfcccf3d2" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000457cf2c69876d8a9822a6b796492aa889c39fa1371fc730c5a15532ac4aa197b38c936d0041821e1ca81df3f1fd0a495c0c8974a81fb41cec4622cc1bfcccf3d2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEV88saYdtipgipreWSSqoicOfoTcfxzDF\noVUyrEqhl7OMk20AQYIeHKgd8/H9CklcDIl0qB+0HOxGIswb/Mzz0g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 468, + "comment" : "u1 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022100cbd2518ae59c5c357e7630cbd4c4cb1410897703e7663f19fe1289497bee4f7e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040a7413800a6571b03100d9f327c68a89aaaef2e7ff922b0a0aa95e39a082c4fb37466eb04ed38187bedfd767de7c45416577bca4bd961de3d8890bea3409f697", + "wx" : "0a7413800a6571b03100d9f327c68a89aaaef2e7ff922b0a0aa95e39a082c4fb", + "wy" : "37466eb04ed38187bedfd767de7c45416577bca4bd961de3d8890bea3409f697" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040a7413800a6571b03100d9f327c68a89aaaef2e7ff922b0a0aa95e39a082c4fb37466eb04ed38187bedfd767de7c45416577bca4bd961de3d8890bea3409f697", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAECnQTgAplcbAxANnzJ8aKiaqu8uf/kisK\nCqleOaCCxPs3Rm6wTtOBh77f12fefEVBZXe8pL2WHePYiQvqNAn2lw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 469, + "comment" : "u2 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047e27893adb379d40a61668ad660edc256004bbfc12d55889fbd5121eac56a06e9a36f42598db7d643842a72562fe6d86ddc38623830e42a17d444d44a2472b5f", + "wx" : "7e27893adb379d40a61668ad660edc256004bbfc12d55889fbd5121eac56a06e", + "wy" : "009a36f42598db7d643842a72562fe6d86ddc38623830e42a17d444d44a2472b5f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047e27893adb379d40a61668ad660edc256004bbfc12d55889fbd5121eac56a06e9a36f42598db7d643842a72562fe6d86ddc38623830e42a17d444d44a2472b5f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEfieJOts3nUCmFmitZg7cJWAEu/wS1ViJ\n+9USHqxWoG6aNvQlmNt9ZDhCpyVi/m2G3cOGI4MOQqF9RE1EokcrXw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 470, + "comment" : "u2 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0242b89", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043b65f40a248d91a7e6377bfb5989f47d562bdaaf364ea982830f61b71957bda5e42108c5d388f2e173210f867633167eb0f5cbc693aa7bb9223ae8f1aaa26983", + "wx" : "3b65f40a248d91a7e6377bfb5989f47d562bdaaf364ea982830f61b71957bda5", + "wy" : "00e42108c5d388f2e173210f867633167eb0f5cbc693aa7bb9223ae8f1aaa26983" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043b65f40a248d91a7e6377bfb5989f47d562bdaaf364ea982830f61b71957bda5e42108c5d388f2e173210f867633167eb0f5cbc693aa7bb9223ae8f1aaa26983", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEO2X0CiSNkafmN3v7WYn0fVYr2q82TqmC\ngw9htxlXvaXkIQjF04jy4XMhD4Z2MxZ+sPXLxpOqe7kiOujxqqJpgw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 471, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100bc0f3a2708cbe1438083451163be66f80a810a900cd135ddc076db7451917c17", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040585249ff4a3acbb996eed6f17a70a7b83a6dfe96e80edc0cd4cc7594e806d59b7576508dbb4eab123e0ed688a9e6625d056c7ad8134776252728dcae375cd84", + "wx" : "0585249ff4a3acbb996eed6f17a70a7b83a6dfe96e80edc0cd4cc7594e806d59", + "wy" : "00b7576508dbb4eab123e0ed688a9e6625d056c7ad8134776252728dcae375cd84" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040585249ff4a3acbb996eed6f17a70a7b83a6dfe96e80edc0cd4cc7594e806d59b7576508dbb4eab123e0ed688a9e6625d056c7ad8134776252728dcae375cd84", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEBYUkn/SjrLuZbu1vF6cKe4Om3+lugO3A\nzUzHWU6AbVm3V2UI27TqsSPg7WiKnmYl0FbHrYE0d2JSco3K43XNhA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 472, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022062bf43ba34e73cc3c8922f26d64e3bf882f12dcc06e0b30c8363efa6badcff55", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04dd6ba66855e37b7fc91ad160bc4a7c5089f8633ac0e12298a6aba34db680e16b798f5573bd93756e39dd635d9c5f8e876364445a1c9a43f2918beb9137ba3b92", + "wx" : "00dd6ba66855e37b7fc91ad160bc4a7c5089f8633ac0e12298a6aba34db680e16b", + "wy" : "798f5573bd93756e39dd635d9c5f8e876364445a1c9a43f2918beb9137ba3b92" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004dd6ba66855e37b7fc91ad160bc4a7c5089f8633ac0e12298a6aba34db680e16b798f5573bd93756e39dd635d9c5f8e876364445a1c9a43f2918beb9137ba3b92", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE3WumaFXje3/JGtFgvEp8UIn4YzrA4SKY\npqujTbaA4Wt5j1VzvZN1bjndY12cX46HY2REWhyaQ/KRi+uRN7o7kg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 473, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022039422623a4386033ccfa96ad4f8228fb88ac9364ae8b3cd0715ee188c467572c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ce2d8a8432670515b2133689d96e7369decfe994c87e39a28e5636897a360f2aba43f7fa77feba76de9634b6adfde47fb16f70b790bc9a1a5065ef16f6fd2467", + "wx" : "00ce2d8a8432670515b2133689d96e7369decfe994c87e39a28e5636897a360f2a", + "wy" : "00ba43f7fa77feba76de9634b6adfde47fb16f70b790bc9a1a5065ef16f6fd2467" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ce2d8a8432670515b2133689d96e7369decfe994c87e39a28e5636897a360f2aba43f7fa77feba76de9634b6adfde47fb16f70b790bc9a1a5065ef16f6fd2467", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEzi2KhDJnBRWyEzaJ2W5zad7P6ZTIfjmi\njlY2iXo2Dyq6Q/f6d/66dt6WNLat/eR/sW9wt5C8mhpQZe8W9v0kZw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 474, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02206233bcf8558bae02cbd2518ae59c5c3501ab620efcbd7b40d8dd1f7288ff5dac", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046cefd89c949069c4ef5fefd20512a6fde92e08a2dfc408694a05d2a974bd0284ae4769496c219a59383a7fd6dc1e0690c25506264b0088e0362897e0da59103a", + "wx" : "6cefd89c949069c4ef5fefd20512a6fde92e08a2dfc408694a05d2a974bd0284", + "wy" : "00ae4769496c219a59383a7fd6dc1e0690c25506264b0088e0362897e0da59103a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046cefd89c949069c4ef5fefd20512a6fde92e08a2dfc408694a05d2a974bd0284ae4769496c219a59383a7fd6dc1e0690c25506264b0088e0362897e0da59103a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbO/YnJSQacTvX+/SBRKm/ekuCKLfxAhp\nSgXSqXS9AoSuR2lJbCGaWTg6f9bcHgaQwlUGJksAiOA2KJfg2lkQOg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 475, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02203bcf8558bae02cbd2518ae59c5c357e7170b54262d04bee3a9fcee6e38e84e1d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0433a6ee1a121ccab25b00fbecc860be15641a5baa4b4beb35d9a6dad35a1691fa36ba2323e463d684219a1bd15c5eb304878d82d1da113c52c7663cfae3f5751a", + "wx" : "33a6ee1a121ccab25b00fbecc860be15641a5baa4b4beb35d9a6dad35a1691fa", + "wy" : "36ba2323e463d684219a1bd15c5eb304878d82d1da113c52c7663cfae3f5751a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000433a6ee1a121ccab25b00fbecc860be15641a5baa4b4beb35d9a6dad35a1691fa36ba2323e463d684219a1bd15c5eb304878d82d1da113c52c7663cfae3f5751a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEM6buGhIcyrJbAPvsyGC+FWQaW6pLS+s1\n2aba01oWkfo2uiMj5GPWhCGaG9FcXrMEh42C0doRPFLHZjz64/V1Gg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 476, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220779f0ab175c0597a4a315cb38b86afce2e16a84c5a097dc753f9dcdc71d09c3a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a2d2e9810bf8f988af6cdf111f2f15062900d2ce06bb72c9c1dd1ca90d69c58c36c24fbc1323359ffc3d7cfdd66451dd3e950ad97cc7f1ddedf30e3aa4425c0f", + "wx" : "00a2d2e9810bf8f988af6cdf111f2f15062900d2ce06bb72c9c1dd1ca90d69c58c", + "wy" : "36c24fbc1323359ffc3d7cfdd66451dd3e950ad97cc7f1ddedf30e3aa4425c0f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a2d2e9810bf8f988af6cdf111f2f15062900d2ce06bb72c9c1dd1ca90d69c58c36c24fbc1323359ffc3d7cfdd66451dd3e950ad97cc7f1ddedf30e3aa4425c0f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEotLpgQv4+YivbN8RHy8VBikA0s4Gu3LJ\nwd0cqQ1pxYw2wk+8EyM1n/w9fP3WZFHdPpUK2XzH8d3t8w46pEJcDw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 477, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220558bae02cbd2518ae59c5c357e7630cb680f5a3ee98045977a021c9091920d08", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e93d658ec3a9418daed0ee219d18180d0684fd676ed24f693bcdeb7e358ec44d6914850bd227eeb22bf22a02c3bfd628c769b0f0e50040b50fd3aaa324a1d4ce", + "wx" : "00e93d658ec3a9418daed0ee219d18180d0684fd676ed24f693bcdeb7e358ec44d", + "wy" : "6914850bd227eeb22bf22a02c3bfd628c769b0f0e50040b50fd3aaa324a1d4ce" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e93d658ec3a9418daed0ee219d18180d0684fd676ed24f693bcdeb7e358ec44d6914850bd227eeb22bf22a02c3bfd628c769b0f0e50040b50fd3aaa324a1d4ce", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE6T1ljsOpQY2u0O4hnRgYDQaE/Wdu0k9p\nO83rfjWOxE1pFIUL0ifusivyKgLDv9Yox2mw8OUAQLUP06qjJKHUzg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 478, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022019ffa32fd51fb796c6154167347b7773d9058ddb148fdaef8c287fef848f2f7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ebe7e1278636290cb09c7d4554c71c117337d2ed40c77789433c27eaf4d4bc3273025752ca492238b622884c9fe287ce3723ae04ebfaa53505e14b8e86c5dbac", + "wx" : "00ebe7e1278636290cb09c7d4554c71c117337d2ed40c77789433c27eaf4d4bc32", + "wy" : "73025752ca492238b622884c9fe287ce3723ae04ebfaa53505e14b8e86c5dbac" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ebe7e1278636290cb09c7d4554c71c117337d2ed40c77789433c27eaf4d4bc3273025752ca492238b622884c9fe287ce3723ae04ebfaa53505e14b8e86c5dbac", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE6+fhJ4Y2KQywnH1FVMccEXM30u1Ax3eJ\nQzwn6vTUvDJzAldSykkiOLYiiEyf4ofONyOuBOv6pTUF4UuOhsXbrA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 479, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02203d180992c1a38ddfd49ecf3d1813b0b195c69b06bbd41cf101fe40dac9c9e6ba", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d1150530bac21e35524ff9e1b7d00731401072d591e696a17bb388b4d7e5ca19bcc66bce3fc176d2da4a2cb954c836bf9b81f1913230ba99ea6e5054073ddf6f", + "wx" : "00d1150530bac21e35524ff9e1b7d00731401072d591e696a17bb388b4d7e5ca19", + "wy" : "00bcc66bce3fc176d2da4a2cb954c836bf9b81f1913230ba99ea6e5054073ddf6f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d1150530bac21e35524ff9e1b7d00731401072d591e696a17bb388b4d7e5ca19bcc66bce3fc176d2da4a2cb954c836bf9b81f1913230ba99ea6e5054073ddf6f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0RUFMLrCHjVST/nht9AHMUAQctWR5pah\ne7OItNflyhm8xmvOP8F20tpKLLlUyDa/m4HxkTIwupnqblBUBz3fbw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 480, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100d39813c8e58536460cbfac4b0fa028e60d5d45c13612d79f9964a58cb33be185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "045233a1deddbbdc29c0994fd43ceda3b020b35c465e02d1c12fd29017306be87bc31db5c0e32fbd3f045664acf088014a1116eb3379f24886b3a13f009628df42", + "wx" : "5233a1deddbbdc29c0994fd43ceda3b020b35c465e02d1c12fd29017306be87b", + "wy" : "00c31db5c0e32fbd3f045664acf088014a1116eb3379f24886b3a13f009628df42" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200045233a1deddbbdc29c0994fd43ceda3b020b35c465e02d1c12fd29017306be87bc31db5c0e32fbd3f045664acf088014a1116eb3379f24886b3a13f009628df42", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEUjOh3t273CnAmU/UPO2jsCCzXEZeAtHB\nL9KQFzBr6HvDHbXA4y+9PwRWZKzwiAFKERbrM3nySIazoT8AlijfQg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 481, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100e9fcbcae7e1d744cf6bf4ca0d8573312a131fcb3b90eb26bed6c7f6ba908ab53", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a160ab41fd3fe7d088ee874c8b82d8ae97c8ed99467579d01b97bade23ec46a6ae709a088bcbc72342996efeed0e913f8a5dd8c8878b1caec5c9e057e35d5cfe", + "wx" : "00a160ab41fd3fe7d088ee874c8b82d8ae97c8ed99467579d01b97bade23ec46a6", + "wy" : "00ae709a088bcbc72342996efeed0e913f8a5dd8c8878b1caec5c9e057e35d5cfe" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a160ab41fd3fe7d088ee874c8b82d8ae97c8ed99467579d01b97bade23ec46a6ae709a088bcbc72342996efeed0e913f8a5dd8c8878b1caec5c9e057e35d5cfe", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEoWCrQf0/59CI7odMi4LYrpfI7ZlGdXnQ\nG5e63iPsRqaucJoIi8vHI0KZbv7tDpE/il3YyIeLHK7FyeBX411c/g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 482, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022021f862ec7b9a0f5e3fbe5d774e20cc835816e92b513bb52effadc18c3f526295", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041d915ecbbf4c25bbc0d2216db6d1a3da8f80058653a24885494aff88fe1599fc8816898d958fa5431bb557d17b6b1b520c3fbdab6bc5984109d1468b6cc141f0", + "wx" : "1d915ecbbf4c25bbc0d2216db6d1a3da8f80058653a24885494aff88fe1599fc", + "wy" : "008816898d958fa5431bb557d17b6b1b520c3fbdab6bc5984109d1468b6cc141f0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041d915ecbbf4c25bbc0d2216db6d1a3da8f80058653a24885494aff88fe1599fc8816898d958fa5431bb557d17b6b1b520c3fbdab6bc5984109d1468b6cc141f0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEHZFey79MJbvA0iFtttGj2o+ABYZTokiF\nSUr/iP4VmfyIFomNlY+lQxu1V9F7axtSDD+9q2vFmEEJ0UaLbMFB8A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 483, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022043f0c5d8f7341ebc7f7cbaee9c419906b02dd256a2776a5dff5b83187ea4c52a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049598101f8704e2dd0e889ecab9ffe7a5e7536f3ee60d5f05111ce6f5a4ca0405c4c39bbca34c6a687c46a6ddff65e81d0a9a78a8c104f91ea6636a7c8ea6819a", + "wx" : "009598101f8704e2dd0e889ecab9ffe7a5e7536f3ee60d5f05111ce6f5a4ca0405", + "wy" : "00c4c39bbca34c6a687c46a6ddff65e81d0a9a78a8c104f91ea6636a7c8ea6819a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049598101f8704e2dd0e889ecab9ffe7a5e7536f3ee60d5f05111ce6f5a4ca0405c4c39bbca34c6a687c46a6ddff65e81d0a9a78a8c104f91ea6636a7c8ea6819a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAElZgQH4cE4t0OiJ7Kuf/npedTbz7mDV8F\nERzm9aTKBAXEw5u8o0xqaHxGpt3/ZegdCpp4qMEE+R6mY2p8jqaBmg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 484, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022065e928c572ce2e1abf3b1865ea62658a0844bb81f3b31f8cff0944a4bdf727bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0459ee9e0a000baefbe3fb59ea61d7370df77c58dee9d829b6c5e89faae019951bbf61a756c7a30d049bd37010b7b1c25670d4ddb6ceb8f1d7c7d449e393465959", + "wx" : "59ee9e0a000baefbe3fb59ea61d7370df77c58dee9d829b6c5e89faae019951b", + "wy" : "00bf61a756c7a30d049bd37010b7b1c25670d4ddb6ceb8f1d7c7d449e393465959" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000459ee9e0a000baefbe3fb59ea61d7370df77c58dee9d829b6c5e89faae019951bbf61a756c7a30d049bd37010b7b1c25670d4ddb6ceb8f1d7c7d449e393465959", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEWe6eCgALrvvj+1nqYdc3Dfd8WN7p2Cm2\nxeifquAZlRu/YadWx6MNBJvTcBC3scJWcNTdts648dfH1Enjk0ZZWQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 485, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02201ca11311d21c3019e67d4b56a7c1147dc45649b257459e6838af70c46233ab96", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d1f1ddd12c710d7c35617a0ed2fc35f4d09888f17034a47fe0a78415858e66a25fcda6abedc3a58ffc55bc5d9f320c60eb6b4c9a22833e13511b2e140ef14057", + "wx" : "00d1f1ddd12c710d7c35617a0ed2fc35f4d09888f17034a47fe0a78415858e66a2", + "wy" : "5fcda6abedc3a58ffc55bc5d9f320c60eb6b4c9a22833e13511b2e140ef14057" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d1f1ddd12c710d7c35617a0ed2fc35f4d09888f17034a47fe0a78415858e66a25fcda6abedc3a58ffc55bc5d9f320c60eb6b4c9a22833e13511b2e140ef14057", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0fHd0SxxDXw1YXoO0vw19NCYiPFwNKR/\n4KeEFYWOZqJfzaar7cOlj/xVvF2fMgxg62tMmiKDPhNRGy4UDvFAVw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 486, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100d55555555555555555555555555555547c74934474db157d2a8c3f088aced62a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043c9a5007f19ec624a73ce75fb61ab3e16736d519ee36381497f24bfd3bb691b534b42b0134e17222eff05f3b5477323a3224310b108c4a8fc9b17833128cb822", + "wx" : "3c9a5007f19ec624a73ce75fb61ab3e16736d519ee36381497f24bfd3bb691b5", + "wy" : "34b42b0134e17222eff05f3b5477323a3224310b108c4a8fc9b17833128cb822" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043c9a5007f19ec624a73ce75fb61ab3e16736d519ee36381497f24bfd3bb691b534b42b0134e17222eff05f3b5477323a3224310b108c4a8fc9b17833128cb822", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEPJpQB/GexiSnPOdfthqz4Wc21RnuNjgU\nl/JL/Tu2kbU0tCsBNOFyIu/wXztUdzI6MiQxCxCMSo/JsXgzEoy4Ig==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 487, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100c1777c8853938e536213c02464a936000ba1e21c0fc62075d46c624e23b52f31", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f7a2f1027241c8514b2be7097a3eb5b208e8ffd09a700e5d72fc3af6964b3bbf08318a9043d959a8fc8bafa5d403d3490e4e45d9b1e156ff3e2aee38ece66e88", + "wx" : "00f7a2f1027241c8514b2be7097a3eb5b208e8ffd09a700e5d72fc3af6964b3bbf", + "wy" : "08318a9043d959a8fc8bafa5d403d3490e4e45d9b1e156ff3e2aee38ece66e88" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f7a2f1027241c8514b2be7097a3eb5b208e8ffd09a700e5d72fc3af6964b3bbf08318a9043d959a8fc8bafa5d403d3490e4e45d9b1e156ff3e2aee38ece66e88", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE96LxAnJByFFLK+cJej61sgjo/9CacA5d\ncvw69pZLO78IMYqQQ9lZqPyLr6XUA9NJDk5F2bHhVv8+Ku447OZuiA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 488, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022030bbb794db588363b40679f6c182a50d3ce9679acdd3ffbe36d7813dacbdc818", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e58d8aba787d54ffcbe530c5ba5955f54e286d31f1a7558dce8924000d7a1b96f5acbdf479b313380325edbbadbc6287e08e98cc86e2ba8339873724437ce813", + "wx" : "00e58d8aba787d54ffcbe530c5ba5955f54e286d31f1a7558dce8924000d7a1b96", + "wy" : "00f5acbdf479b313380325edbbadbc6287e08e98cc86e2ba8339873724437ce813" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e58d8aba787d54ffcbe530c5ba5955f54e286d31f1a7558dce8924000d7a1b96f5acbdf479b313380325edbbadbc6287e08e98cc86e2ba8339873724437ce813", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE5Y2Kunh9VP/L5TDFullV9U4obTHxp1WN\nzokkAA16G5b1rL30ebMTOAMl7butvGKH4I6YzIbiuoM5hzckQ3zoEw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 489, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202c37fd995622c4fb7fffffffffffffffc7cee745110cb45ab558ed7c90c15a2f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04167df009cec2efd44991a523dc2fd4a13e4de3e76390382d4c1088593f33da65838f62138f2ed73fbc7be316ba5b6a79a4768fd1f4ea07df9eb0eeeef988ab73", + "wx" : "167df009cec2efd44991a523dc2fd4a13e4de3e76390382d4c1088593f33da65", + "wy" : "00838f62138f2ed73fbc7be316ba5b6a79a4768fd1f4ea07df9eb0eeeef988ab73" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004167df009cec2efd44991a523dc2fd4a13e4de3e76390382d4c1088593f33da65838f62138f2ed73fbc7be316ba5b6a79a4768fd1f4ea07df9eb0eeeef988ab73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEFn3wCc7C79RJkaUj3C/UoT5N4+djkDgt\nTBCIWT8z2mWDj2ITjy7XP7x74xa6W2p5pHaP0fTqB9+esO7u+Yircw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 490, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02207fd995622c4fb7ffffffffffffffffff5d883ffab5b32652ccdcaa290fccb97d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0401a3a8df8aee278aa306844d60d9c5113e596d66cc92a3566ab0797cd01638250062494573ddc9a21706030fd795708b3fe0d0f224ac01e5957ad0d11d6ee265", + "wx" : "01a3a8df8aee278aa306844d60d9c5113e596d66cc92a3566ab0797cd0163825", + "wy" : "62494573ddc9a21706030fd795708b3fe0d0f224ac01e5957ad0d11d6ee265" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000401a3a8df8aee278aa306844d60d9c5113e596d66cc92a3566ab0797cd01638250062494573ddc9a21706030fd795708b3fe0d0f224ac01e5957ad0d11d6ee265", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAaOo34ruJ4qjBoRNYNnFET5ZbWbMkqNW\narB5fNAWOCUAYklFc93JohcGAw/XlXCLP+DQ8iSsAeWVetDRHW7iZQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 491, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100ffb32ac4589f6ffffffffffffffffffebb107ff56b664ca599b954521f9972fa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d6d0f45dbfa12ab4ea5b29a848c71923d1ecb57b148ec1c969b43662a18d00f988c2728d21508a421af6b612a4433c4b7c97f55dc12b24db2cf6cb7fada43f15", + "wx" : "00d6d0f45dbfa12ab4ea5b29a848c71923d1ecb57b148ec1c969b43662a18d00f9", + "wy" : "0088c2728d21508a421af6b612a4433c4b7c97f55dc12b24db2cf6cb7fada43f15" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d6d0f45dbfa12ab4ea5b29a848c71923d1ecb57b148ec1c969b43662a18d00f988c2728d21508a421af6b612a4433c4b7c97f55dc12b24db2cf6cb7fada43f15", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE1tD0Xb+hKrTqWymoSMcZI9HstXsUjsHJ\nabQ2YqGNAPmIwnKNIVCKQhr2thKkQzxLfJf1XcErJNss9st/raQ/FQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 492, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02205622c4fb7fffffffffffffffffffffff928a8f1c7ac7bec1808b9f61c01ec327", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0469214198388da2a0d1a0c9464c6eb3731ad44e27287c17cd24bf73c3ada67c2a48dfabbfa5d9127fec9fb7986fb386cb5c7ebe3f609d95e71a70ad7f83334584", + "wx" : "69214198388da2a0d1a0c9464c6eb3731ad44e27287c17cd24bf73c3ada67c2a", + "wy" : "48dfabbfa5d9127fec9fb7986fb386cb5c7ebe3f609d95e71a70ad7f83334584" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000469214198388da2a0d1a0c9464c6eb3731ad44e27287c17cd24bf73c3ada67c2a48dfabbfa5d9127fec9fb7986fb386cb5c7ebe3f609d95e71a70ad7f83334584", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEaSFBmDiNoqDRoMlGTG6zcxrUTicofBfN\nJL9zw62mfCpI36u/pdkSf+yft5hvs4bLXH6+P2CdlecacK1/gzNFhA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 493, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022044104104104104104104104104104103b87853fd3b7d3f8e175125b4382f25ed", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0484672e2de042df2668775733c9b0cc716edd7d7534eb859279316ec5186d7733badc81e933abf3d4ce75fae00d1a47b30d69de8754666a294b4c925807dc3ecc", + "wx" : "0084672e2de042df2668775733c9b0cc716edd7d7534eb859279316ec5186d7733", + "wy" : "00badc81e933abf3d4ce75fae00d1a47b30d69de8754666a294b4c925807dc3ecc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000484672e2de042df2668775733c9b0cc716edd7d7534eb859279316ec5186d7733badc81e933abf3d4ce75fae00d1a47b30d69de8754666a294b4c925807dc3ecc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEhGcuLeBC3yZod1czybDMcW7dfXU064WS\neTFuxRhtdzO63IHpM6vz1M51+uANGkezDWneh1RmailLTJJYB9w+zA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 494, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202739ce739ce739ce739ce739ce739ce705560298d1f2f08dc419ac273a5b54d9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04c9be9c1906a73789a9af1a677f60dd4163c5fa06c7f45c0993a63051aa0c0f303205debee5dc413e4abb3e1f6af550ac64c41b97e425cc2efa2a833c2ee72221", + "wx" : "00c9be9c1906a73789a9af1a677f60dd4163c5fa06c7f45c0993a63051aa0c0f30", + "wy" : "3205debee5dc413e4abb3e1f6af550ac64c41b97e425cc2efa2a833c2ee72221" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004c9be9c1906a73789a9af1a677f60dd4163c5fa06c7f45c0993a63051aa0c0f303205debee5dc413e4abb3e1f6af550ac64c41b97e425cc2efa2a833c2ee72221", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEyb6cGQanN4mprxpnf2DdQWPF+gbH9FwJ\nk6YwUaoMDzAyBd6+5dxBPkq7Ph9q9VCsZMQbl+QlzC76KoM8LuciIQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 495, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100b777777777777777777777777777777688e6a1fe808a97a348671222ff16b863", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04026794f7b5a84849f41141c68d3248f9c90c4de7edad4fb8f446e3076ffb7962c98e7b67192296efe04379c6a40280b4f113876981b44b73bb676a881f398790", + "wx" : "026794f7b5a84849f41141c68d3248f9c90c4de7edad4fb8f446e3076ffb7962", + "wy" : "00c98e7b67192296efe04379c6a40280b4f113876981b44b73bb676a881f398790" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004026794f7b5a84849f41141c68d3248f9c90c4de7edad4fb8f446e3076ffb7962c98e7b67192296efe04379c6a40280b4f113876981b44b73bb676a881f398790", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAmeU97WoSEn0EUHGjTJI+ckMTeftrU+4\n9EbjB2/7eWLJjntnGSKW7+BDecakAoC08ROHaYG0S3O7Z2qIHzmHkA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 496, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02206492492492492492492492492492492406dd3a19b8d5fb875235963c593bd2d3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0418bd65dd46f8c0e326553be55e5e234bb43188ac1fddb37003d12f091aa7a1b9e9c00a03e4d5452ba9a607951d4e4d8a7391a952109d96599266d1e2d9ab2199", + "wx" : "18bd65dd46f8c0e326553be55e5e234bb43188ac1fddb37003d12f091aa7a1b9", + "wy" : "00e9c00a03e4d5452ba9a607951d4e4d8a7391a952109d96599266d1e2d9ab2199" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000418bd65dd46f8c0e326553be55e5e234bb43188ac1fddb37003d12f091aa7a1b9e9c00a03e4d5452ba9a607951d4e4d8a7391a952109d96599266d1e2d9ab2199", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGL1l3Ub4wOMmVTvlXl4jS7QxiKwf3bNw\nA9EvCRqnobnpwAoD5NVFK6mmB5UdTk2Kc5GpUhCdllmSZtHi2ashmQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 497, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100955555555555555555555555555555547c74934474db157d2a8c3f088aced62c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b86ae764f2f95eb9331af538fa516fd78435794ebb244c090c6d6b286750f94cf3712f767495a10f2e81350662af3ba09defa2e0e6f27eceea35513032dafb61", + "wx" : "00b86ae764f2f95eb9331af538fa516fd78435794ebb244c090c6d6b286750f94c", + "wy" : "00f3712f767495a10f2e81350662af3ba09defa2e0e6f27eceea35513032dafb61" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b86ae764f2f95eb9331af538fa516fd78435794ebb244c090c6d6b286750f94cf3712f767495a10f2e81350662af3ba09defa2e0e6f27eceea35513032dafb61", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEuGrnZPL5XrkzGvU4+lFv14Q1eU67JEwJ\nDG1rKGdQ+UzzcS92dJWhDy6BNQZirzugne+i4Obyfs7qNVEwMtr7YQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 498, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3e3a49a23a6d8abe95461f8445676b17", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e045cc5a9414e45e63f1b08648e20e229a9950ab56ec304e1b907989e81af2bf21e52db489853dc470713aaecd6aadc7bfd8504a9c82d0243f6e774600b5ea0a", + "wx" : "00e045cc5a9414e45e63f1b08648e20e229a9950ab56ec304e1b907989e81af2bf", + "wy" : "21e52db489853dc470713aaecd6aadc7bfd8504a9c82d0243f6e774600b5ea0a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e045cc5a9414e45e63f1b08648e20e229a9950ab56ec304e1b907989e81af2bf21e52db489853dc470713aaecd6aadc7bfd8504a9c82d0243f6e774600b5ea0a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE4EXMWpQU5F5j8bCGSOIOIpqZUKtW7DBO\nG5B5iega8r8h5S20iYU9xHBxOq7Naq3Hv9hQSpyC0CQ/bndGALXqCg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 499, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100bffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364143", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0437e377faea8a867f494bb402032c70c12af6fd57feb3866bfc5a5fc1d0a909f008dcbc53fd41b67073a4e71a81f3fe578da4d5add0d698041a9b7f38a9a19bff", + "wx" : "37e377faea8a867f494bb402032c70c12af6fd57feb3866bfc5a5fc1d0a909f0", + "wy" : "08dcbc53fd41b67073a4e71a81f3fe578da4d5add0d698041a9b7f38a9a19bff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000437e377faea8a867f494bb402032c70c12af6fd57feb3866bfc5a5fc1d0a909f008dcbc53fd41b67073a4e71a81f3fe578da4d5add0d698041a9b7f38a9a19bff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEN+N3+uqKhn9JS7QCAyxwwSr2/Vf+s4Zr\n/FpfwdCpCfAI3LxT/UG2cHOk5xqB8/5XjaTVrdDWmAQam384qaGb/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 500, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220185ddbca6dac41b1da033cfb60c152869e74b3cd66e9ffdf1b6bc09ed65ee40c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0409a33110676e4a4f8a977150a7be291e0a269cae9678710b1d87f8068b0fe961043a6f64e86278a656a39e4468b3472597afb2dcd930ccba1b1ea2c988c13450", + "wx" : "09a33110676e4a4f8a977150a7be291e0a269cae9678710b1d87f8068b0fe961", + "wy" : "043a6f64e86278a656a39e4468b3472597afb2dcd930ccba1b1ea2c988c13450" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000409a33110676e4a4f8a977150a7be291e0a269cae9678710b1d87f8068b0fe961043a6f64e86278a656a39e4468b3472597afb2dcd930ccba1b1ea2c988c13450", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAECaMxEGduSk+Kl3FQp74pHgomnK6WeHEL\nHYf4BosP6WEEOm9k6GJ4plajnkRos0cll6+y3NkwzLobHqLJiME0UA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 501, + "comment" : "point duplication during verification", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022032b0d10d8d0e04bc8d4d064d270699e87cffc9b49c5c20730e1c26f6105ddcda022100c55205f423611c7e96615bcc20141945fde24bbce956d49cd43e14ab4cef3659", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0409a33110676e4a4f8a977150a7be291e0a269cae9678710b1d87f8068b0fe961fbc5909b179d8759a95c61bb974cb8da68504d2326cf3345e4e15d35773ec7df", + "wx" : "09a33110676e4a4f8a977150a7be291e0a269cae9678710b1d87f8068b0fe961", + "wy" : "00fbc5909b179d8759a95c61bb974cb8da68504d2326cf3345e4e15d35773ec7df" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000409a33110676e4a4f8a977150a7be291e0a269cae9678710b1d87f8068b0fe961fbc5909b179d8759a95c61bb974cb8da68504d2326cf3345e4e15d35773ec7df", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAECaMxEGduSk+Kl3FQp74pHgomnK6WeHEL\nHYf4BosP6WH7xZCbF52HWalcYbuXTLjaaFBNIybPM0Xk4V01dz7H3w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 502, + "comment" : "duplication bug", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022032b0d10d8d0e04bc8d4d064d270699e87cffc9b49c5c20730e1c26f6105ddcda022100c55205f423611c7e96615bcc20141945fde24bbce956d49cd43e14ab4cef3659", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b7021faebf4081a63094d8ea78ca2004d02a303bbf363470ea4a649b08c1995bde5efba25c9d2f490f181e16795d5c75f83b5c11c81d67ede2ea8df81d970cef", + "wx" : "00b7021faebf4081a63094d8ea78ca2004d02a303bbf363470ea4a649b08c1995b", + "wy" : "00de5efba25c9d2f490f181e16795d5c75f83b5c11c81d67ede2ea8df81d970cef" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b7021faebf4081a63094d8ea78ca2004d02a303bbf363470ea4a649b08c1995bde5efba25c9d2f490f181e16795d5c75f83b5c11c81d67ede2ea8df81d970cef", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEtwIfrr9AgaYwlNjqeMogBNAqMDu/NjRw\n6kpkmwjBmVveXvuiXJ0vSQ8YHhZ5XVx1+DtcEcgdZ+3i6o34HZcM7w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 503, + "comment" : "comparison with point at infinity ", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0022033333333333333333333333333333332f222f8faefdb533f265d461c29a47373", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044de024ff2abe7af94fb5e9f53c87d4b4bf1c5447c7c39a9280839f12e52e38d83ce6941fc329978e794abf91a25e83463f8eabcf106d76d4dcd92c0ae05493f3", + "wx" : "4de024ff2abe7af94fb5e9f53c87d4b4bf1c5447c7c39a9280839f12e52e38d8", + "wy" : "3ce6941fc329978e794abf91a25e83463f8eabcf106d76d4dcd92c0ae05493f3" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044de024ff2abe7af94fb5e9f53c87d4b4bf1c5447c7c39a9280839f12e52e38d83ce6941fc329978e794abf91a25e83463f8eabcf106d76d4dcd92c0ae05493f3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAETeAk/yq+evlPten1PIfUtL8cVEfHw5qS\ngIOfEuUuONg85pQfwymXjnlKv5GiXoNGP46rzxBtdtTc2SwK4FST8w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 504, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04425e137c5fe08e842c3bcc4efbb6c4bca89edda8d6beb130e14899de2f20b74bb1af66ef5baead32e7892160deddcb57f43503104dbc331fa20a8de376e5bd17", + "wx" : "425e137c5fe08e842c3bcc4efbb6c4bca89edda8d6beb130e14899de2f20b74b", + "wy" : "00b1af66ef5baead32e7892160deddcb57f43503104dbc331fa20a8de376e5bd17" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004425e137c5fe08e842c3bcc4efbb6c4bca89edda8d6beb130e14899de2f20b74bb1af66ef5baead32e7892160deddcb57f43503104dbc331fa20a8de376e5bd17", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQl4TfF/gjoQsO8xO+7bEvKie3ajWvrEw\n4UiZ3i8gt0uxr2bvW66tMueJIWDe3ctX9DUDEE28Mx+iCo3jduW9Fw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 505, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022100b6db6db6db6db6db6db6db6db6db6db5f30f30127d33e02aad96438927022e9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046c63d82f22bbeb1bd1c8eba4c680ae17dc2b4d196a0da0e191dc79fefd85e367a883018fb8d160ca01d17234fa0b060a619215ccb9dfea629d6bf92cfd8ed34b", + "wx" : "6c63d82f22bbeb1bd1c8eba4c680ae17dc2b4d196a0da0e191dc79fefd85e367", + "wy" : "00a883018fb8d160ca01d17234fa0b060a619215ccb9dfea629d6bf92cfd8ed34b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046c63d82f22bbeb1bd1c8eba4c680ae17dc2b4d196a0da0e191dc79fefd85e367a883018fb8d160ca01d17234fa0b060a619215ccb9dfea629d6bf92cfd8ed34b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbGPYLyK76xvRyOukxoCuF9wrTRlqDaDh\nkdx5/v2F42eogwGPuNFgygHRcjT6CwYKYZIVzLnf6mKda/ks/Y7TSw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 506, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee502210099999999999999999999999999999998d668eaf0cf91f9bd7317d2547ced5a5a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04dbf77c566f7483d7407f0095b8b468efdf85b7476e614b8658bcf5e71e6fd588413b50407df0def01b8fcba5621028a6cb0972831c893e3d3c20065b75a8e8e6", + "wx" : "00dbf77c566f7483d7407f0095b8b468efdf85b7476e614b8658bcf5e71e6fd588", + "wy" : "413b50407df0def01b8fcba5621028a6cb0972831c893e3d3c20065b75a8e8e6" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004dbf77c566f7483d7407f0095b8b468efdf85b7476e614b8658bcf5e71e6fd588413b50407df0def01b8fcba5621028a6cb0972831c893e3d3c20065b75a8e8e6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE2/d8Vm90g9dAfwCVuLRo79+Ft0duYUuG\nWLz15x5v1YhBO1BAffDe8BuPy6ViECimywlygxyJPj08IAZbdajo5g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 507, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022066666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a7967bfb54cfbd8d13492b9ac421d967d7c4b0a3b18efb6408a424914789c8ef90969628e6553898c978ba48eb852714f9e220e5e93cada91478ce1af8948fd8", + "wx" : "00a7967bfb54cfbd8d13492b9ac421d967d7c4b0a3b18efb6408a424914789c8ef", + "wy" : "0090969628e6553898c978ba48eb852714f9e220e5e93cada91478ce1af8948fd8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a7967bfb54cfbd8d13492b9ac421d967d7c4b0a3b18efb6408a424914789c8ef90969628e6553898c978ba48eb852714f9e220e5e93cada91478ce1af8948fd8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEp5Z7+1TPvY0TSSuaxCHZZ9fEsKOxjvtk\nCKQkkUeJyO+QlpYo5lU4mMl4ukjrhScU+eIg5ek8rakUeM4a+JSP2A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 508, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022049249249249249249249249249249248c79facd43214c011123c1b03a93412a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04325fd7ab7bc8cd7d859687937a90083f1b46776c2b8fdf4ce2bd9e2e808c68b1bb0d689ca6f542c094c99c71918f5455c7608514149148470494e05aa4ff6110", + "wx" : "325fd7ab7bc8cd7d859687937a90083f1b46776c2b8fdf4ce2bd9e2e808c68b1", + "wy" : "00bb0d689ca6f542c094c99c71918f5455c7608514149148470494e05aa4ff6110" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004325fd7ab7bc8cd7d859687937a90083f1b46776c2b8fdf4ce2bd9e2e808c68b1bb0d689ca6f542c094c99c71918f5455c7608514149148470494e05aa4ff6110", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEMl/Xq3vIzX2FloeTepAIPxtGd2wrj99M\n4r2eLoCMaLG7DWicpvVCwJTJnHGRj1RVx2CFFBSRSEcElOBapP9hEA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 509, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee502200eb10e5ab95f2f275348d82ad2e4d7949c8193800d8c9c75df58e343f0ebba7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d637dc3c63060a0b21b80d6dc8a97ab6a543c21c18cb5e5c63ad80c3b86050fb1d68bb9b9c36ade49ddd84c7fa3ae5c70f45549592ee03a23a490a891cc70ebb", + "wx" : "00d637dc3c63060a0b21b80d6dc8a97ab6a543c21c18cb5e5c63ad80c3b86050fb", + "wy" : "1d68bb9b9c36ade49ddd84c7fa3ae5c70f45549592ee03a23a490a891cc70ebb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d637dc3c63060a0b21b80d6dc8a97ab6a543c21c18cb5e5c63ad80c3b86050fb1d68bb9b9c36ade49ddd84c7fa3ae5c70f45549592ee03a23a490a891cc70ebb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE1jfcPGMGCgshuA1tyKl6tqVDwhwYy15c\nY62Aw7hgUPsdaLubnDat5J3dhMf6OuXHD0VUlZLuA6I6SQqJHMcOuw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 510, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046bc87ce6047a3164be15ad781ef32d12bad8caaef7707ac3e15a53ed75efc90c8eee286e2ac0c8f9f6f0350b8bba94b6c5bfade87ba211adc0cad5f3818091e0", + "wx" : "6bc87ce6047a3164be15ad781ef32d12bad8caaef7707ac3e15a53ed75efc90c", + "wy" : "008eee286e2ac0c8f9f6f0350b8bba94b6c5bfade87ba211adc0cad5f3818091e0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046bc87ce6047a3164be15ad781ef32d12bad8caaef7707ac3e15a53ed75efc90c8eee286e2ac0c8f9f6f0350b8bba94b6c5bfade87ba211adc0cad5f3818091e0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEa8h85gR6MWS+Fa14HvMtErrYyq73cHrD\n4VpT7XXvyQyO7ihuKsDI+fbwNQuLupS2xb+t6HuiEa3AytXzgYCR4A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 511, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022100b6db6db6db6db6db6db6db6db6db6db5f30f30127d33e02aad96438927022e9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04dac247040488bec28dc3ec9a81a990701f45c0ba4bb6e22573da400efaa65e2e7de375486e1757b6c7b4269bee423edb84c7f4b333c1557b5ddfba0dd983ccf3", + "wx" : "00dac247040488bec28dc3ec9a81a990701f45c0ba4bb6e22573da400efaa65e2e", + "wy" : "7de375486e1757b6c7b4269bee423edb84c7f4b333c1557b5ddfba0dd983ccf3" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004dac247040488bec28dc3ec9a81a990701f45c0ba4bb6e22573da400efaa65e2e7de375486e1757b6c7b4269bee423edb84c7f4b333c1557b5ddfba0dd983ccf3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE2sJHBASIvsKNw+yagamQcB9FwLpLtuIl\nc9pADvqmXi5943VIbhdXtse0JpvuQj7bhMf0szPBVXtd37oN2YPM8w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 512, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802210099999999999999999999999999999998d668eaf0cf91f9bd7317d2547ced5a5a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041d4d073190b327ab4e4f5ace8d8c8b68e100fd2565a1a4c4610bca309fe6a9c3e274a19b41e496b0832e9e42f5229fc000706c966d2557f3441d323d8faca129", + "wx" : "1d4d073190b327ab4e4f5ace8d8c8b68e100fd2565a1a4c4610bca309fe6a9c3", + "wy" : "00e274a19b41e496b0832e9e42f5229fc000706c966d2557f3441d323d8faca129" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041d4d073190b327ab4e4f5ace8d8c8b68e100fd2565a1a4c4610bca309fe6a9c3e274a19b41e496b0832e9e42f5229fc000706c966d2557f3441d323d8faca129", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEHU0HMZCzJ6tOT1rOjYyLaOEA/SVloaTE\nYQvKMJ/mqcPidKGbQeSWsIMunkL1Ip/AAHBslm0lV/NEHTI9j6yhKQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 513, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022066666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04274ba8da21e4ed44e218320daa103f0d4227bb351b67d84ad2628629b82fa8274c90d1dcfe55fe7ee66571ff4526c755cac8c8ed16b01c4db830b7dd9deae749", + "wx" : "274ba8da21e4ed44e218320daa103f0d4227bb351b67d84ad2628629b82fa827", + "wy" : "4c90d1dcfe55fe7ee66571ff4526c755cac8c8ed16b01c4db830b7dd9deae749" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004274ba8da21e4ed44e218320daa103f0d4227bb351b67d84ad2628629b82fa8274c90d1dcfe55fe7ee66571ff4526c755cac8c8ed16b01c4db830b7dd9deae749", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJ0uo2iHk7UTiGDINqhA/DUInuzUbZ9hK\n0mKGKbgvqCdMkNHc/lX+fuZlcf9FJsdVysjI7RawHE24MLfdnernSQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 514, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022049249249249249249249249249249248c79facd43214c011123c1b03a93412a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b45406f951d31975e953ac11c25c238046a7975dd2fbb38d890913c1c8b451cbcae0be688e6e400a9265bd9a59ba1047e164306ef6cd358bc0ff00e9e027e957", + "wx" : "00b45406f951d31975e953ac11c25c238046a7975dd2fbb38d890913c1c8b451cb", + "wy" : "00cae0be688e6e400a9265bd9a59ba1047e164306ef6cd358bc0ff00e9e027e957" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b45406f951d31975e953ac11c25c238046a7975dd2fbb38d890913c1c8b451cbcae0be688e6e400a9265bd9a59ba1047e164306ef6cd358bc0ff00e9e027e957", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEtFQG+VHTGXXpU6wRwlwjgEanl13S+7ON\niQkTwci0UcvK4L5ojm5ACpJlvZpZuhBH4WQwbvbNNYvA/wDp4CfpVw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 515, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802200eb10e5ab95f2f275348d82ad2e4d7949c8193800d8c9c75df58e343f0ebba7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + "wx" : "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "wy" : "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeb5mfvncu6xVoGKVzocLBwKb/NstzijZ\nWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 516, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "30440220342dae751a63a3ca8189cf342b3b34eaaa2565e2c7e26121c1bfd5435447f1c302202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + }, + { + "tcId" : 517, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100cbd2518ae59c5c357e7630cbd4c4cb1410897703e7663f19fe1289497bee4f7e02202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777", + "wx" : "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "wy" : "00b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeb5mfvncu6xVoGKVzocLBwKb/NstzijZ\nWfKBWxb4F5i3xSWI2Vw7mqJbBAPx7vdXAuhLt1l6q+ZjuC9vBO8ndw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 518, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "30440220342dae751a63a3ca8189cf342b3b34eaaa2565e2c7e26121c1bfd5435447f1c302202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + }, + { + "tcId" : 519, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100cbd2518ae59c5c357e7630cbd4c4cb1410897703e7663f19fe1289497bee4f7e02202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff00000001060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1", + "wx" : "6e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff", + "wy" : "01060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff00000001060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEboI1VUUpFAmRgsaywdbwtdKNUMzQBa8s\n4bulQapAyv8AAAABBgSS1aVnPg8l2NUPt+WMSdhtRtQhaVXgqj1A4Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 520, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100c28ad156fe809ed36dc80812ae2f32d84dbbfbb9400123305c332551c4f10d39022100fc5b95b0c7fbc2e7cc4ec1bf01020f8050260ce2ca45c3bf5b64a7b2aeeface9", + "result" : "valid" + }, + { + "tcId" : 521, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100a36bfde0f5e23f6e3b3d6cc80ede3d9e4ea1c2cb9337221388f70aa52dec5e53022100c27e1db10d29720a120c2625c7e0756790200b2d9bcceb170a1356e1d5477e3c", + "result" : "valid" + }, + { + "tcId" : 522, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100818dee9730f01b3f525daa9cc0d5423b0c4af0414c647b6e0bc88546db9c0d75022061c16a90de1dbb1ab1e3c7917e891632f557f493b4106f225517ef186abc0ff9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40cafffffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e", + "wx" : "6e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff", + "wy" : "00fffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40cafffffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEboI1VUUpFAmRgsaywdbwtdKNUMzQBa8s\n4bulQapAyv/////++fttKlqYwfDaJyrwSBpztieSuSvelqoeVcK7Tg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 523, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022053cc0edfc688e3d264ed4755f9cf006418e16e24dc978453a6ef14fbecff617f022024694c00d38c13259973aa6db88adf7cc49b5673e628b3c65e7fe06f2665db86", + "result" : "valid" + }, + { + "tcId" : 524, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100cacd14406211ed85d8de1b50e167f59dec688574524c6fc1762c9268214e3bba0220289cf8949f717626c25833a0a159d63d77d022b48e161007464f59f5072df8a7", + "result" : "valid" + }, + { + "tcId" : 525, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100c1a4c9d1feef48045813d911f6abb188502e06d26b34194f2deaa356e578a76902204063d3367b2bab52bf9fbc4cd3f670667569ccb1cfb05a7c7c156622ba593d45", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04000000013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d", + "wx" : "013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0", + "wy" : "00f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004000000013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAAAAAT/SIkjWTZX3PCm0irSGMYUL5QP9\nAPhGi18PcOD27nqkO8LG/SWx2CaSQcvdnbsNrJbcliMfQwcF+DhxfQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 526, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402205af5683467b4cb3d68bd168c5fe229a07b7eb1de2f92b8a9743fb46c3691872a02204cbe35cbe66805729e907462169c13b5c4feb497aab658774bec1ecd7bd8863c", + "result" : "valid" + }, + { + "tcId" : 527, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220051e5f825a5c29f92a108a3ddcdcbf7ffce37ab32915985978512e89a2a83b0c02206340ac187077a7fb4373537b4595a39299ad0ba351db23bcae9176125c61eded", + "result" : "valid" + }, + { + "tcId" : 528, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022034e28decbf74abd30f55155ee2ff96f621066001a853acef916cdb39a7d07b4002210087561a96167016fb7dd6f3c7259f8c563f2144332ebb9a48e93b9512d3bf5392", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0425afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dfffffffffa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35", + "wx" : "25afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dffffffff", + "wy" : "00fa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000425afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dfffffffffa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJa/WiayrrtZ8Hylt5ZQG+MVQ9XFGoLTs\nLJeHbf/////6RqduUgMi37xJHsTwzBl0IPxOpYg9j23VPDVLxPZ8NQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 529, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100cafded1bc98a4bdfe76e1df9ab75342a7fed16b0c1688a2e744d871b9404be14022100a11fcb57d1212068afed86a37e7291aa02061e75b883e9b9a7af3a52e81f5033", + "result" : "valid" + }, + { + "tcId" : 530, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220254f9541aebd4fca9ce7136fa8e6ed6367778afedf36201779b0ea6a61a82f3b022038668103eebca5e786e05dfffd8b9f1d87d4a1558b1cdfc0eeb98a606ab654c6", + "result" : "valid" + }, + { + "tcId" : 531, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100f998e8322b2a1101bbdf9b8b80bc147e5225632cdb6b1a8c4c4c25c29cd3319d022100ee6b3e7b59621fd62b3253ef646ad7cd4a4d53dd11372038b0b314ced0e2e5a9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb93f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff", + "wx" : "00d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb9", + "wy" : "3f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb93f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0S5sZrZ3NMPITSYBz1013Al+J2N/CspK\nT9t0tqrdO7k/W9/4i9VzbfiY5pkAbtdQ8RzwfFhmzXrXDHEh/////w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 532, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402200c426a3f25f5d0250928ac4e5ea03cf949d34444283ac18a49ec638a2a6ea4c5022009f0df2fe78f8ce301057c734cf3c2505d7219775fb778758461360b168e2c8e", + "result" : "valid" + }, + { + "tcId" : 533, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402201309ba742999ad66aef104cc140246bc576bd14acc6bb0be728577e49f4f8ed5022031e29fedcab5999d66b27a4f4ffc950dcc8066fb7cdbad9a6362270c066a500a", + "result" : "valid" + }, + { + "tcId" : 534, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100cb565ebfd48044d17d2e241b7cd5fec6089e3d0bee83516b710f68d583ccd1c6022026d6d5a1f12ae063528e7e4b1a6a9c5c760af38f2828db9407c439484f2ae9c1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb", + "wx" : "6d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000", + "wy" : "00e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbUp/YNR3Sk8KqLve25U8fup5CUB+MWR1\nVmS8KAAAAADmWdNOTfONnoyeqt+6NmEsdpGVvobHeqw/NueLU4aA+w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 535, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100a6c419f478007ce4eb07cd8deb248b8d9d11e16c02364e18391ab934c6f3e91d0220363ab461b8d40c864998a6dfa9c9c77419930b9336f0cd471b74786b09aba27b", + "result" : "valid" + }, + { + "tcId" : 536, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100e22ab46f883c6ea58de97f982ffd3ef581749fe5568f8121761566509145b0c8022100fc4a53daf4122aa10b98a4d18c2e4920b37744447f0d843ff9ed1d79d482d73c", + "result" : "valid" + }, + { + "tcId" : 537, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100921a16ea241e69c9d4f3bde6ba2cc7e10a27c9dfd8b92076d0a4a6d9f8ae0ab3022039b66ee2afd7db1099fee2cd8c69c9f1ea29047efacc1c6e8ee92e5a2244a40b", + "result" : "valid" + } + ] + } + ] +} diff --git a/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha512_test.json b/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha512_test.json new file mode 100644 index 0000000000..4eb93d6ff5 --- /dev/null +++ b/packages/crypto/testdata/wycheproof/ecdsa_secp256k1_sha512_test.json @@ -0,0 +1,7060 @@ +{ + "algorithm" : "ECDSA", + "schema" : "ecdsa_verify_schema.json", + "generatorVersion" : "0.9rc5", + "numberOfTests" : 533, + "header" : [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes" : { + "ArithmeticError" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.", + "cves" : [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature" : { + "bugType" : "BER_ENCODING", + "description" : "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect" : "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves" : [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication" : { + "bugType" : "EDGE_CASE", + "description" : "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding" : { + "bugType" : "CAN_OF_WORMS", + "description" : "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449" + ] + }, + "MissingZero" : { + "bugType" : "LEGACY", + "description" : "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect" : "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "CVE-2019-0865" + ] + }, + "PointDuplication" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves" : [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "2020-13895" + ] + }, + "SpecialCaseHash" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "Untruncatedhash" : { + "bugType" : "MISSING_STEP", + "description" : "If the size of the digest is longer than the size of the underlying order of the multiplicative subgroup then the hash digest must be truncated during signature generation and verification. This test vector contains a signature where this step has been omitted." + }, + "ValidSignature" : { + "bugType" : "BASIC", + "description" : "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups" : [ + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152", + "wx" : "782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963", + "wy" : "00af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004782c8ed17e3b2a783b5464f33b09652a71c678e05ec51e84e2bcfc663a3de963af9acb4280b8c7f7c42f4ef9aba6245ec1ec1712fd38a0fa96418d8cd6aa6152", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeCyO0X47Kng7VGTzOwllKnHGeOBexR6E\n4rz8Zjo96WOvmstCgLjH98QvTvmrpiRewewXEv04oPqWQY2M1qphUg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 1, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "", + "sig" : "304502206632473c909425b6fa37095398e2538daab8552440320f9fe190dba8f672796b022100a8c3aacce9ffe4bc17c0530738f1386f9d9579f029ff3a7791b16e98422265e3", + "result" : "valid" + }, + { + "tcId" : 2, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "4d7367", + "sig" : "30430220465b0fb05c14cd4ddef23e13acbe5f2337c45ea3816536670cfa7f2ab9090619021f5e525e837c406cf8944383e20bcee32112d8da5b42b40f88415098f722aa89", + "result" : "valid" + }, + { + "tcId" : 3, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304502207b1553e4d650c71fd49aa36ceed56f0438b0065e1b234445134bf7c83231ca9d022100e369a20fa6434bd138b092885a89e53a3f0b6bdcc5d2653e136c54070081dc5a", + "result" : "valid" + }, + { + "tcId" : 4, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "0000000000000000000000000000000000000000", + "sig" : "3045022100c7ba1c73bdc4364f6c7c61ab1fecc0547f8d6fcbeb251f734964407536353f3202207b3a6fb2fe60f8861e9e0955663f5703a17f5ecc3a5b5140eb87eaf35a3a5090", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6ff0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9", + "wx" : "00b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6f", + "wy" : "00f0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b838ff44e5bc177bf21189d0766082fc9d843226887fc9760371100b7ee20a6ff0c9d75bfba7b31a6bca1974496eeb56de357071955d83c4b1badaa0b21832e9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEuDj/ROW8F3vyEYnQdmCC/J2EMiaIf8l2\nA3EQC37iCm/wyddb+6ezGmvKGXRJbutW3jVwcZVdg8Sxutqgshgy6Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 5, + "comment" : "signature malleability", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304402206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022034d2f1a567d7e647b178552dec35875a2cc61df3ce8ae2c1357ea8c5ff505561", + "result" : "valid" + }, + { + "tcId" : 6, + "comment" : "Legacy: ASN encoding of s misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "304402206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90220cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 7, + "comment" : "valid", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "valid" + }, + { + "tcId" : 8, + "comment" : "length of sequence [r, s] uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30814502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 9, + "comment" : "length of sequence [r, s] contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3082004502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 10, + "comment" : "length of sequence [r, s] uses 70 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304602206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 11, + "comment" : "length of sequence [r, s] uses 68 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304402206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 12, + "comment" : "uint32 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085010000004502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 13, + "comment" : "uint64 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308901000000000000004502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 14, + "comment" : "length of sequence [r, s] = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30847fffffff02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 15, + "comment" : "length of sequence [r, s] = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30848000000002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 16, + "comment" : "length of sequence [r, s] = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084ffffffff02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 17, + "comment" : "length of sequence [r, s] = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085ffffffffff02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 18, + "comment" : "length of sequence [r, s] = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3088ffffffffffffffff02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 19, + "comment" : "incorrect length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30ff02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 20, + "comment" : "replaced sequence [r, s] by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 21, + "comment" : "removing sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "", + "result" : "invalid" + }, + { + "tcId" : 22, + "comment" : "lonely sequence tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30", + "result" : "invalid" + }, + { + "tcId" : 23, + "comment" : "appending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000", + "result" : "invalid" + }, + { + "tcId" : 24, + "comment" : "prepending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047000002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 25, + "comment" : "appending unused 0's to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000", + "result" : "invalid" + }, + { + "tcId" : 26, + "comment" : "appending null value to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00500", + "result" : "invalid" + }, + { + "tcId" : 27, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a498177304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 28, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492500304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 29, + "comment" : "appending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 30, + "comment" : "including undefined tags", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304daa00bb00cd00304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 31, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2228aa00bb00cd0002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 32, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e92229aa00bb00cd00022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 33, + "comment" : "truncated length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3081", + "result" : "invalid" + }, + { + "tcId" : 34, + "comment" : "including undefined tags to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304baa02aabb304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 35, + "comment" : "using composition with indefinite length for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000", + "result" : "invalid" + }, + { + "tcId" : 36, + "comment" : "using composition with wrong tag for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080314502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000", + "result" : "invalid" + }, + { + "tcId" : 37, + "comment" : "Replacing sequence [r, s] with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "0500", + "result" : "invalid" + }, + { + "tcId" : 38, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2e4502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 39, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2f4502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 40, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "314502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 41, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "324502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 42, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "ff4502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 43, + "comment" : "dropping value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3000", + "result" : "invalid" + }, + { + "tcId" : 44, + "comment" : "using composition for sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30493001023044206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 45, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304402206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5eb", + "result" : "invalid" + }, + { + "tcId" : 46, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 47, + "comment" : "sequence [r, s] of size 4166 to check for overflows", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3082104602206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 48, + "comment" : "indefinite length", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "308002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000", + "result" : "invalid" + }, + { + "tcId" : 49, + "comment" : "indefinite length with truncated delimiter", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe000", + "result" : "invalid" + }, + { + "tcId" : 50, + "comment" : "indefinite length with additional element", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe005000000", + "result" : "invalid" + }, + { + "tcId" : 51, + "comment" : "indefinite length with truncated element", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0060811220000", + "result" : "invalid" + }, + { + "tcId" : 52, + "comment" : "indefinite length with garbage", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000fe02beef", + "result" : "invalid" + }, + { + "tcId" : 53, + "comment" : "indefinite length with nonempty EOC", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00002beef", + "result" : "invalid" + }, + { + "tcId" : 54, + "comment" : "prepend empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047300002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 55, + "comment" : "append empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe03000", + "result" : "invalid" + }, + { + "tcId" : 56, + "comment" : "append zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304802206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0020100", + "result" : "invalid" + }, + { + "tcId" : 57, + "comment" : "append garbage with high tag number", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304802206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0bf7f00", + "result" : "invalid" + }, + { + "tcId" : 58, + "comment" : "append null with explicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304902206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0a0020500", + "result" : "invalid" + }, + { + "tcId" : 59, + "comment" : "append null with implicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0a000", + "result" : "invalid" + }, + { + "tcId" : 60, + "comment" : "sequence of sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 61, + "comment" : "truncated sequence: removed last 1 elements", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302202206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9", + "result" : "invalid" + }, + { + "tcId" : 62, + "comment" : "repeating element in sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "306802206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 63, + "comment" : "flipped bit 0 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30436cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e8022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 64, + "comment" : "flipped bit 32 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30436cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f19b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 65, + "comment" : "flipped bit 48 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30436cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561220f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 66, + "comment" : "flipped bit 64 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30436cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236461230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 67, + "comment" : "length of r uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30460281206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 68, + "comment" : "length of r contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3047028200206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 69, + "comment" : "length of r uses 33 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502216cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 70, + "comment" : "length of r uses 31 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045021f6cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 71, + "comment" : "uint32 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a028501000000206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 72, + "comment" : "uint64 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e02890100000000000000206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 73, + "comment" : "length of r = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902847fffffff6cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 74, + "comment" : "length of r = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284800000006cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 75, + "comment" : "length of r = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284ffffffff6cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 76, + "comment" : "length of r = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285ffffffffff6cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 77, + "comment" : "length of r = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0288ffffffffffffffff6cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 78, + "comment" : "incorrect length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502ff6cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 79, + "comment" : "replaced r by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502806cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 80, + "comment" : "removing r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3023022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 81, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 82, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302302206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e902", + "result" : "invalid" + }, + { + "tcId" : 83, + "comment" : "appending 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702226cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90000022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 84, + "comment" : "prepending 0's to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047022200006cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 85, + "comment" : "appending unused 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90000022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 86, + "comment" : "appending null value to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702226cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90500022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 87, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a222549817702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 88, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492224250002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 89, + "comment" : "appending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d222202206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90004deadbeef022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 90, + "comment" : "truncated length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250281022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 91, + "comment" : "including undefined tags to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b2226aa02aabb02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 92, + "comment" : "using composition with indefinite length for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049228002206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90000022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 93, + "comment" : "using composition with wrong tag for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049228003206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90000022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 94, + "comment" : "Replacing r with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30250500022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 95, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304500206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 96, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304501206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 97, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304503206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 98, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304504206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 99, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045ff206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 100, + "comment" : "dropping value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250200022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 101, + "comment" : "using composition for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049222402016c021fb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 102, + "comment" : "modifying first byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502206eb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 103, + "comment" : "modifying last byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a169022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 104, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044021f6cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 105, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044021fb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 106, + "comment" : "r of size 4129 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30821048028210216cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 107, + "comment" : "leading ff in r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30460221ff6cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 108, + "comment" : "replaced r by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026090180022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 109, + "comment" : "replacing r with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 110, + "comment" : "flipped bit 0 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e900cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe1", + "result" : "invalid" + }, + { + "tcId" : 111, + "comment" : "flipped bit 32 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e900cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c7d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 112, + "comment" : "flipped bit 48 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e900cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a52b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 113, + "comment" : "flipped bit 64 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e900cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7b8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 114, + "comment" : "length of s uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304602206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e902812100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 115, + "comment" : "length of s contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90282002100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 116, + "comment" : "length of s uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022200cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 117, + "comment" : "length of s uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022000cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 118, + "comment" : "uint32 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90285010000002100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 119, + "comment" : "uint64 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9028901000000000000002100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 120, + "comment" : "length of s = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e902847fffffff00cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 121, + "comment" : "length of s = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e902848000000000cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 122, + "comment" : "length of s = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90284ffffffff00cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 123, + "comment" : "length of s = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90285ffffffffff00cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 124, + "comment" : "length of s = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90288ffffffffffffffff00cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 125, + "comment" : "incorrect length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e902ff00cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 126, + "comment" : "replaced s by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9028000cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 127, + "comment" : "appending 0's to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022300cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000", + "result" : "invalid" + }, + { + "tcId" : 128, + "comment" : "prepending 0's to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90223000000cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 129, + "comment" : "appending null value to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022300cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00500", + "result" : "invalid" + }, + { + "tcId" : 130, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e92226498177022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 131, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e922252500022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 132, + "comment" : "appending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e92223022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 133, + "comment" : "truncated length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90281", + "result" : "invalid" + }, + { + "tcId" : 134, + "comment" : "including undefined tags to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b02206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e92227aa02aabb022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 135, + "comment" : "using composition with indefinite length for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e92280022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000", + "result" : "invalid" + }, + { + "tcId" : 136, + "comment" : "using composition with wrong tag for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e92280032100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000", + "result" : "invalid" + }, + { + "tcId" : 137, + "comment" : "Replacing s with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302402206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90500", + "result" : "invalid" + }, + { + "tcId" : 138, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9002100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 139, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9012100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 140, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9032100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 141, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9042100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 142, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9ff2100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 143, + "comment" : "dropping value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90200", + "result" : "invalid" + }, + { + "tcId" : 144, + "comment" : "using composition for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e922250201000220cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 145, + "comment" : "modifying first byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022102cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 146, + "comment" : "modifying last byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5eb60", + "result" : "invalid" + }, + { + "tcId" : 147, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304402206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022000cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5eb", + "result" : "invalid" + }, + { + "tcId" : 148, + "comment" : "s of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3082104802206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90282102200cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 149, + "comment" : "leading ff in s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304602206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e90222ff00cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 150, + "comment" : "replaced s by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9090180", + "result" : "invalid" + }, + { + "tcId" : 151, + "comment" : "replacing s with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502206cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9020100", + "result" : "invalid" + }, + { + "tcId" : 152, + "comment" : "replaced r by r + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460221016cb914246e1c92050a03d9b0b4f05dde199ab6bf23cec3a120f56da5843de32a022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 153, + "comment" : "replaced r by r - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460221ff6cb914246e1c92050a03d9b0b4f05de0a43cfcf1c53d8329a150b08be3d160a8022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 154, + "comment" : "replaced r by r + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3047022201006cb914246e1c92050a03d9b0b4f05c9a0dc8c087bd265f2533819be8ea48e2e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 155, + "comment" : "replaced r by -r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "304502209346ebdb91e36dfaf5fc264f4b0fa220a11426278b79dc9a9edcf0e74bf85e17022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 156, + "comment" : "replaced r by n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221009346ebdb91e36dfaf5fc264f4b0fa21f5bc3030e3ac27cd65eaf4f741c2e9f58022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 157, + "comment" : "replaced r by -n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fe9346ebdb91e36dfaf5fc264f4b0fa221e6654940dc313c5edf0a925a7bc21cd6022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 158, + "comment" : "replaced r by r + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30460221016cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 159, + "comment" : "replaced r by r + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e02290100000000000000006cb914246e1c92050a03d9b0b4f05ddf5eebd9d87486236561230f18b407a1e9022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 160, + "comment" : "replaced s by s + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022101cb2d0e5a982819b84e87aad213ca78a348979bd990065db64a261453a11c2d21022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 161, + "comment" : "replaced s by s - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450220cb2d0e5a982819b84e87aad213ca78a5d339e20c31751d3eca81573a00afaa9f022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 162, + "comment" : "replaced s by s + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304702220100cb2d0e5a982819b84e87aad213ca775f3cc5a5a2295df93a5cb2429707272ce0022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 163, + "comment" : "replaced s by -s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221ff34d2f1a567d7e647b178552dec35875b7217410d1f42428575ac4a392f1a1420022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 164, + "comment" : "replaced s by -n - s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fe34d2f1a567d7e647b178552dec35875cb76864266ff9a249b5d9ebac5ee3d2df022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 165, + "comment" : "replaced s by s + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "3046022101cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 166, + "comment" : "replaced s by s - 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450220cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 167, + "comment" : "replaced s by s + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e0229010000000000000000cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0022100cb2d0e5a982819b84e87aad213ca78a48de8bef2e0bdbd7a8a53b5c6d0e5ebe0", + "result" : "invalid" + }, + { + "tcId" : 168, + "comment" : "Signature with special case values r=0 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020100", + "result" : "invalid" + }, + { + "tcId" : 169, + "comment" : "Signature with special case values r=0 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020101", + "result" : "invalid" + }, + { + "tcId" : 170, + "comment" : "Signature with special case values r=0 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000201ff", + "result" : "invalid" + }, + { + "tcId" : 171, + "comment" : "Signature with special case values r=0 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 172, + "comment" : "Signature with special case values r=0 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 173, + "comment" : "Signature with special case values r=0 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 174, + "comment" : "Signature with special case values r=0 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 175, + "comment" : "Signature with special case values r=0 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 176, + "comment" : "Signature with special case values r=1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020100", + "result" : "invalid" + }, + { + "tcId" : 177, + "comment" : "Signature with special case values r=1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "invalid" + }, + { + "tcId" : 178, + "comment" : "Signature with special case values r=1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010201ff", + "result" : "invalid" + }, + { + "tcId" : 179, + "comment" : "Signature with special case values r=1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 180, + "comment" : "Signature with special case values r=1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 181, + "comment" : "Signature with special case values r=1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 182, + "comment" : "Signature with special case values r=1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 183, + "comment" : "Signature with special case values r=1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 184, + "comment" : "Signature with special case values r=-1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020100", + "result" : "invalid" + }, + { + "tcId" : 185, + "comment" : "Signature with special case values r=-1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020101", + "result" : "invalid" + }, + { + "tcId" : 186, + "comment" : "Signature with special case values r=-1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0201ff", + "result" : "invalid" + }, + { + "tcId" : 187, + "comment" : "Signature with special case values r=-1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 188, + "comment" : "Signature with special case values r=-1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 189, + "comment" : "Signature with special case values r=-1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 190, + "comment" : "Signature with special case values r=-1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 191, + "comment" : "Signature with special case values r=-1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 192, + "comment" : "Signature with special case values r=n and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020100", + "result" : "invalid" + }, + { + "tcId" : 193, + "comment" : "Signature with special case values r=n and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101", + "result" : "invalid" + }, + { + "tcId" : 194, + "comment" : "Signature with special case values r=n and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410201ff", + "result" : "invalid" + }, + { + "tcId" : 195, + "comment" : "Signature with special case values r=n and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 196, + "comment" : "Signature with special case values r=n and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 197, + "comment" : "Signature with special case values r=n and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 198, + "comment" : "Signature with special case values r=n and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 199, + "comment" : "Signature with special case values r=n and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 200, + "comment" : "Signature with special case values r=n - 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140020100", + "result" : "invalid" + }, + { + "tcId" : 201, + "comment" : "Signature with special case values r=n - 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140020101", + "result" : "invalid" + }, + { + "tcId" : 202, + "comment" : "Signature with special case values r=n - 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641400201ff", + "result" : "invalid" + }, + { + "tcId" : 203, + "comment" : "Signature with special case values r=n - 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 204, + "comment" : "Signature with special case values r=n - 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 205, + "comment" : "Signature with special case values r=n - 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 206, + "comment" : "Signature with special case values r=n - 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 207, + "comment" : "Signature with special case values r=n - 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 208, + "comment" : "Signature with special case values r=n + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142020100", + "result" : "invalid" + }, + { + "tcId" : 209, + "comment" : "Signature with special case values r=n + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142020101", + "result" : "invalid" + }, + { + "tcId" : 210, + "comment" : "Signature with special case values r=n + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641420201ff", + "result" : "invalid" + }, + { + "tcId" : 211, + "comment" : "Signature with special case values r=n + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 212, + "comment" : "Signature with special case values r=n + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 213, + "comment" : "Signature with special case values r=n + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 214, + "comment" : "Signature with special case values r=n + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 215, + "comment" : "Signature with special case values r=n + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 216, + "comment" : "Signature with special case values r=p and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f020100", + "result" : "invalid" + }, + { + "tcId" : 217, + "comment" : "Signature with special case values r=p and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f020101", + "result" : "invalid" + }, + { + "tcId" : 218, + "comment" : "Signature with special case values r=p and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0201ff", + "result" : "invalid" + }, + { + "tcId" : 219, + "comment" : "Signature with special case values r=p and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 220, + "comment" : "Signature with special case values r=p and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 221, + "comment" : "Signature with special case values r=p and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 222, + "comment" : "Signature with special case values r=p and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 223, + "comment" : "Signature with special case values r=p and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 224, + "comment" : "Signature with special case values r=p + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30020100", + "result" : "invalid" + }, + { + "tcId" : 225, + "comment" : "Signature with special case values r=p + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30020101", + "result" : "invalid" + }, + { + "tcId" : 226, + "comment" : "Signature with special case values r=p + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc300201ff", + "result" : "invalid" + }, + { + "tcId" : 227, + "comment" : "Signature with special case values r=p + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "result" : "invalid" + }, + { + "tcId" : 228, + "comment" : "Signature with special case values r=p + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", + "result" : "invalid" + }, + { + "tcId" : 229, + "comment" : "Signature with special case values r=p + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142", + "result" : "invalid" + }, + { + "tcId" : 230, + "comment" : "Signature with special case values r=p + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + "result" : "invalid" + }, + { + "tcId" : 231, + "comment" : "Signature with special case values r=p + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc30", + "result" : "invalid" + }, + { + "tcId" : 232, + "comment" : "Signature encoding contains incorrect types: r=0, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020100090380fe01", + "result" : "invalid" + }, + { + "tcId" : 233, + "comment" : "Signature encoding contains incorrect types: r=0, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100090142", + "result" : "invalid" + }, + { + "tcId" : 234, + "comment" : "Signature encoding contains incorrect types: r=0, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010101", + "result" : "invalid" + }, + { + "tcId" : 235, + "comment" : "Signature encoding contains incorrect types: r=0, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010100", + "result" : "invalid" + }, + { + "tcId" : 236, + "comment" : "Signature encoding contains incorrect types: r=0, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000500", + "result" : "invalid" + }, + { + "tcId" : 237, + "comment" : "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000c00", + "result" : "invalid" + }, + { + "tcId" : 238, + "comment" : "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000c0130", + "result" : "invalid" + }, + { + "tcId" : 239, + "comment" : "Signature encoding contains incorrect types: r=0, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201003000", + "result" : "invalid" + }, + { + "tcId" : 240, + "comment" : "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201003003020100", + "result" : "invalid" + }, + { + "tcId" : 241, + "comment" : "Signature encoding contains incorrect types: r=1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020101090380fe01", + "result" : "invalid" + }, + { + "tcId" : 242, + "comment" : "Signature encoding contains incorrect types: r=1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101090142", + "result" : "invalid" + }, + { + "tcId" : 243, + "comment" : "Signature encoding contains incorrect types: r=1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010101", + "result" : "invalid" + }, + { + "tcId" : 244, + "comment" : "Signature encoding contains incorrect types: r=1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010100", + "result" : "invalid" + }, + { + "tcId" : 245, + "comment" : "Signature encoding contains incorrect types: r=1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010500", + "result" : "invalid" + }, + { + "tcId" : 246, + "comment" : "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010c00", + "result" : "invalid" + }, + { + "tcId" : 247, + "comment" : "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010c0130", + "result" : "invalid" + }, + { + "tcId" : 248, + "comment" : "Signature encoding contains incorrect types: r=1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201013000", + "result" : "invalid" + }, + { + "tcId" : 249, + "comment" : "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201013003020100", + "result" : "invalid" + }, + { + "tcId" : 250, + "comment" : "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 251, + "comment" : "Signature encoding contains incorrect types: r=-1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff090142", + "result" : "invalid" + }, + { + "tcId" : 252, + "comment" : "Signature encoding contains incorrect types: r=-1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010101", + "result" : "invalid" + }, + { + "tcId" : 253, + "comment" : "Signature encoding contains incorrect types: r=-1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010100", + "result" : "invalid" + }, + { + "tcId" : 254, + "comment" : "Signature encoding contains incorrect types: r=-1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0500", + "result" : "invalid" + }, + { + "tcId" : 255, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0c00", + "result" : "invalid" + }, + { + "tcId" : 256, + "comment" : "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0c0130", + "result" : "invalid" + }, + { + "tcId" : 257, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff3000", + "result" : "invalid" + }, + { + "tcId" : 258, + "comment" : "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff3003020100", + "result" : "invalid" + }, + { + "tcId" : 259, + "comment" : "Signature encoding contains incorrect types: r=n, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141090380fe01", + "result" : "invalid" + }, + { + "tcId" : 260, + "comment" : "Signature encoding contains incorrect types: r=n, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141090142", + "result" : "invalid" + }, + { + "tcId" : 261, + "comment" : "Signature encoding contains incorrect types: r=n, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141010101", + "result" : "invalid" + }, + { + "tcId" : 262, + "comment" : "Signature encoding contains incorrect types: r=n, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141010100", + "result" : "invalid" + }, + { + "tcId" : 263, + "comment" : "Signature encoding contains incorrect types: r=n, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410500", + "result" : "invalid" + }, + { + "tcId" : 264, + "comment" : "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410c00", + "result" : "invalid" + }, + { + "tcId" : 265, + "comment" : "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410c0130", + "result" : "invalid" + }, + { + "tcId" : 266, + "comment" : "Signature encoding contains incorrect types: r=n, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641413000", + "result" : "invalid" + }, + { + "tcId" : 267, + "comment" : "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641413003020100", + "result" : "invalid" + }, + { + "tcId" : 268, + "comment" : "Signature encoding contains incorrect types: r=p, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f090380fe01", + "result" : "invalid" + }, + { + "tcId" : 269, + "comment" : "Signature encoding contains incorrect types: r=p, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f090142", + "result" : "invalid" + }, + { + "tcId" : 270, + "comment" : "Signature encoding contains incorrect types: r=p, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f010101", + "result" : "invalid" + }, + { + "tcId" : 271, + "comment" : "Signature encoding contains incorrect types: r=p, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f010100", + "result" : "invalid" + }, + { + "tcId" : 272, + "comment" : "Signature encoding contains incorrect types: r=p, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0500", + "result" : "invalid" + }, + { + "tcId" : 273, + "comment" : "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0c00", + "result" : "invalid" + }, + { + "tcId" : 274, + "comment" : "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0c0130", + "result" : "invalid" + }, + { + "tcId" : 275, + "comment" : "Signature encoding contains incorrect types: r=p, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3000", + "result" : "invalid" + }, + { + "tcId" : 276, + "comment" : "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3003020100", + "result" : "invalid" + }, + { + "tcId" : 277, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a090380fe01090380fe01", + "result" : "invalid" + }, + { + "tcId" : 278, + "comment" : "Signature encoding contains incorrect types: r=nan, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142090142", + "result" : "invalid" + }, + { + "tcId" : 279, + "comment" : "Signature encoding contains incorrect types: r=True, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101010101", + "result" : "invalid" + }, + { + "tcId" : 280, + "comment" : "Signature encoding contains incorrect types: r=False, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100010100", + "result" : "invalid" + }, + { + "tcId" : 281, + "comment" : "Signature encoding contains incorrect types: r=Null, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300405000500", + "result" : "invalid" + }, + { + "tcId" : 282, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30040c000c00", + "result" : "invalid" + }, + { + "tcId" : 283, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c01300c0130", + "result" : "invalid" + }, + { + "tcId" : 284, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300430003000", + "result" : "invalid" + }, + { + "tcId" : 285, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a30030201003003020100", + "result" : "invalid" + }, + { + "tcId" : 286, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008090380fe01020100", + "result" : "invalid" + }, + { + "tcId" : 287, + "comment" : "Signature encoding contains incorrect types: r=nan, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142020100", + "result" : "invalid" + }, + { + "tcId" : 288, + "comment" : "Signature encoding contains incorrect types: r=True, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101020100", + "result" : "invalid" + }, + { + "tcId" : 289, + "comment" : "Signature encoding contains incorrect types: r=False, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100020100", + "result" : "invalid" + }, + { + "tcId" : 290, + "comment" : "Signature encoding contains incorrect types: r=Null, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050500020100", + "result" : "invalid" + }, + { + "tcId" : 291, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050c00020100", + "result" : "invalid" + }, + { + "tcId" : 292, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c0130020100", + "result" : "invalid" + }, + { + "tcId" : 293, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30053000020100", + "result" : "invalid" + }, + { + "tcId" : 294, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30083003020100020100", + "result" : "invalid" + }, + { + "tcId" : 295, + "comment" : "Edge case for Shamir multiplication", + "flags" : [ + "EdgeCaseShamirMultiplication" + ], + "msg" : "313236373939", + "sig" : "3045022100dd1b7d09a7bd8218961034a39a87fecf5314f00c4d25eb58a07ac85e85eab51602202c8a79b49cae4ec15d293575a5a1af5b4d6efb74ef5c2c1be34e33cdeb7113cc", + "result" : "valid" + }, + { + "tcId" : 296, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33393439313934313732", + "sig" : "3045022100d743c5d76e1193a57438f1b43b1b0e33d0d1ab15bd3d57a5cf6aebb370d46ce002207df27cb730b33dfe01e34a0067e548a98c56846d9a4cd64a930c96bfd917cf08", + "result" : "valid" + }, + { + "tcId" : 297, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35333637363431383737", + "sig" : "3045022100ba30f4ddf3348f26835e9c50f6a2d5023a9a1f5fe2e9cf14b3270015dac283fe02201d1616abb204f615fbe99860d89158c3264182d617ac9f1560fa8291b349d579", + "result" : "valid" + }, + { + "tcId" : 298, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35363731343831303935", + "sig" : "30450220551d72e63f7b27283c4107f7d851f387b60f3f4713a5d35c21fa332fbeed449402210080914cc37a3fe13a74db7fcc5226388d95034a50a89a9b2fe9bf42ea29e5714d", + "result" : "valid" + }, + { + "tcId" : 299, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131323037313732393039", + "sig" : "304602210080cead3d165ce05c7cf8469f1c35c5a3a641696c843bef0f022a6c68133dc49e022100ea8409d743a4ad5e136207736c3ad79c8cfc7b57ebd1bd9b8a596670ad12d41c", + "result" : "valid" + }, + { + "tcId" : 300, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131323938303334323336", + "sig" : "3046022100bbc0e8b7721065a51bac9c3aad64168998cc0efa23298340d436867cc86ba847022100ae3baa131a83153cb31de2f758e45139f62fe6cc9ce3941c6b1789dc1010f3e2", + "result" : "valid" + }, + { + "tcId" : 301, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39383736303239363833", + "sig" : "304402203a5ba93917b954617b40e1d866860d1522b0d310cac2457636e54e2ffdea888e02203eac6fe762aee127837c2c65fd9c1f65b404b2c31bb945e75d6166503fb5c8bd", + "result" : "valid" + }, + { + "tcId" : 302, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3230323034323936353139", + "sig" : "30440220647f2b4bef6d1ea7908ac5f3dfd705494c2587456557805fe64a703b2b17503c022020e164bbb505c6df56455908008cf9626df320f48aa3fc9d0cc8ad8bcf078cb2", + "result" : "valid" + }, + { + "tcId" : 303, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343531363639313830", + "sig" : "30460221008aa653cfa001798c471eea3199dc975a4dea4f7c1ede47453409e606d05ceb51022100cab20967a056c0ea7fe9cdf8e1980f55b1597a2dad80c9223a0fab15c314fe6d", + "result" : "valid" + }, + { + "tcId" : 304, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303933363835393531", + "sig" : "3045022100842e421f33be241d27f12f875355902a25819f210b3685ad536e23594012d9d002204fb894ae0e9c24b6ed280e224ab0811469296a9837d1e95b5d9d661d21a1c255", + "result" : "valid" + }, + { + "tcId" : 305, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36323139353630323031", + "sig" : "304402200b703fd75bdd8dce4820fe130a0b0af17aad4e4681b0254864d5d6f8931ff5730220404521acf84e72ff22c2ee05d14a4bc7b70e69adc78caf81350e01379694c3e8", + "result" : "valid" + }, + { + "tcId" : 306, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35363832343734333033", + "sig" : "3045022062f0df1650560a5800fa670377a4317a604d6475c490066ce15638f8d1330b63022100963edf905197096818368a993fbffe32908a57153e6a1612bae6ee9ee8a8a719", + "result" : "valid" + }, + { + "tcId" : 307, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33373336353331373836", + "sig" : "304502202901ade694d4b9c376b3244018e57bcde7057e8e11dd0f7d07080cdd1a39194b022100ee65a4c2baa70f8e236ceba9eed400d899f75276f94e4b7997b2b01ac008bbbc", + "result" : "valid" + }, + { + "tcId" : 308, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373935393033373932", + "sig" : "3046022100aa9c8e5311b232b4ce9db03892f26eb77d655c6ff09a599424abbd4b11e750be022100c1034c44b02e2fdf05e1ba5eebdf954c5a01794600059e05e5c73d542da3ee38", + "result" : "valid" + }, + { + "tcId" : 309, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39333939363131303037", + "sig" : "304502202febea016e55059e91e157b988f86048db57c37fd122f5cc60169ff4fcb4863c022100eb19cbc35b3061e1ac4b59b92d1f732cea3212dcbe943ccad82d32740bc22c33", + "result" : "valid" + }, + { + "tcId" : 310, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303837343931313835", + "sig" : "304502202be463ff06af2096dd62f0326e1af51c585f18ca8f8aa361dedcf55d543e6b7d022100f56afd59dad42530d94f11c59a6408c54826b7a9ef83f4d020f209d71f9b74c5", + "result" : "valid" + }, + { + "tcId" : 311, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323336363738353030", + "sig" : "3046022100f61f64defc45abe284b39161b49585f21edef1e88d06389e5b5aacbb394ce4dc022100a5a27e17df10aedace97eb2c48659f69b58cfe76a1f1ac30fea3043655bde515", + "result" : "valid" + }, + { + "tcId" : 312, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343438393937373033", + "sig" : "30440220052134eae13c1dec5ac5aa46186391786f5b60591cb0dd30bfc61e89486abfe2022009cdaa279c4f0d3d5ae00e0d74e733a260b8b120a1bda7e5a90194ec442e592d", + "result" : "valid" + }, + { + "tcId" : 313, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35373134363332383037", + "sig" : "3044022024824614686b80f3b738970a27816f58cf103c4a93c2d6b0f5f6de65a65501e30220180e5801a593063e75b83cd7ab8e52575a013a1be5cdeeb05b30e3ac9dc4ed82", + "result" : "valid" + }, + { + "tcId" : 314, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323236343837343932", + "sig" : "304402202ff7a5ab2f1a3323651a0d17c4263672ee4d2c560cda94e7d52ee755138bb0450220542ce83d8d9d441357e24b618b5695164d4391791cff62eeb01609d1d7cb1c0a", + "result" : "valid" + }, + { + "tcId" : 315, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35333533343439343739", + "sig" : "3045022100ae446d1a81766d21dd7fc515d0a956605d0cde26d6086a76f8ffc81a6dfbea4602204fccef9f75e94abc7eb3f2bdcafdc5d97d61b9d950a06010ab4c54e3da7fd4e0", + "result" : "valid" + }, + { + "tcId" : 316, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373837333033383830", + "sig" : "304402203957cff4a75fc6039c0b0c2e47eb9b07ff6ec5dc8a3c3316590a7ec9a1d7d99302204e578ee6594a00cb80c640cb9589d616dbd1cecda2d15dcc0062f30686d6073b", + "result" : "valid" + }, + { + "tcId" : 317, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323332313935383233", + "sig" : "30450220437c36031737a3140dc30eed281adac8e9074187aad41502a3b9a3bfd4ef252c022100da13f88f633202b9b9517b93a6c08a7b8e6858734e8894b1a64c6ec08f1d0423", + "result" : "valid" + }, + { + "tcId" : 318, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130373339333931393137", + "sig" : "3045022100828c12fd9fe31f91bd8f58aac72ee6485e34ceddf91927cf3a09b63363b9d8e902200e889664a8c98619cab572687064edb4f0500f8324a5df0bfb5a431a3cb1ca39", + "result" : "valid" + }, + { + "tcId" : 319, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31383831303237333135", + "sig" : "3045022100807cb34aa6ea48b175f41f3afdf70a109d2b746ae48e08677cdafc33d916b2da022041980e6f7ad19944d278851f98e0a6220ae888964ae81a667a63fec21449334d", + "result" : "valid" + }, + { + "tcId" : 320, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36303631363933393037", + "sig" : "3046022100a998f9f0daf02f717f5292142dca447c722d2394dae0c84910433754669716ac022100826fc37269539cf8a98997f8a0268bfffe888d6c23bc68ad7c759db47f65a925", + "result" : "valid" + }, + { + "tcId" : 321, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38383935323237303934", + "sig" : "3045022100f151b614afe5bc9d511d0c34a7eb44283921272e91b3e5d02821cf7a43a92bc50220097aa33dc50ebf8fea036cd7e224a4d38aa20773e5a78ddb83a2f3b579b2ef6c", + "result" : "valid" + }, + { + "tcId" : 322, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353830323334303934", + "sig" : "304502205f21585381f5f42e9f76be3f61f4cfd6476ecc6f06cd4fbcf13e08c27f42614802210095d5b2deabf19891edd41ac52d9072fadebb2f0145bec9b916f68fd1fbcfb3cf", + "result" : "valid" + }, + { + "tcId" : 323, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33393635393931353132", + "sig" : "3045022100bdc361e68984482d7b169bc5e6ccf82d2263871be749d67a44f548d32bcaf5f10220375614fa4134d5055ac117a6ea948b74269b8063e39259d494a7544afb6291ab", + "result" : "valid" + }, + { + "tcId" : 324, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323838373332313938", + "sig" : "304502205773b016dffac865ab008abe8a06353d197b4dff32403d7ce98ada4d20ea8a00022100d60de9c98cf50eff0515b962dffd6aac8a1b72bc9cfaf6bda12b99f63eb976d2", + "result" : "valid" + }, + { + "tcId" : 325, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323330383837333139", + "sig" : "3044022057b747d21fc898472a888b88693a989eabaf143396e4cb2de4af19386fba384f02207c99f63904191a4464d0d23ca560d5558895cdcff93af4b00c1c66ca2d974393", + "result" : "valid" + }, + { + "tcId" : 326, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313239303536393337", + "sig" : "3046022100854be2bf302a2d6db437eb9e78703673c1c7371399e68caa8625bb13c7aa0fec0221008fd22607e0169eb2e2e00c4af898fd2a609dc57a9fa94a7f93372098fa675649", + "result" : "valid" + }, + { + "tcId" : 327, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373438363536343338", + "sig" : "3046022100ebb3359de3b13a518545a86b7fdd92f4793225b8ca4555a6bd4182922b0452be02210083faa7dff1aa0eed89a7ddcdaa5d716ba6253c5c21f7122c2755eb78b28884c4", + "result" : "valid" + }, + { + "tcId" : 328, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37353833353032363034", + "sig" : "30460221008bc91cfcfc85ba8aa171b703a330e398df4460d22602e73e327423ebf98bf632022100ec7569072aa73ff19f183daf433abff142d7d5edceb25b771d853acf0fbd68b6", + "result" : "valid" + }, + { + "tcId" : 329, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333237373534323739", + "sig" : "3046022100895b07c0450ed6f4941633a053c978128c46e5225c00eb009c3c6cee5eb2b842022100c982818b260f1650e03eba8f9db1a2ca79c3f804dbe7d172233260e1a9c10640", + "result" : "valid" + }, + { + "tcId" : 330, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373735353038353834", + "sig" : "3045022100d5e152ec304090d764fd7ae61abeeadff2fee8df3dccd8fb44d2af5a8dbee0bc022072518dc1ecc993faadffc3426594fe2024c7c84ba101a9274d88009393103ff6", + "result" : "valid" + }, + { + "tcId" : 331, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3137393832363438333832", + "sig" : "304502201298b131ce97a528e5dae05d92b286e2447b17ec002267b9e8f03784d4074bd1022100edf223ad9c308aef22e1e0c24a20268f966cc2b9ca4d941945bbca057db92d4c", + "result" : "valid" + }, + { + "tcId" : 332, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333936373737333635", + "sig" : "304502201e79b3921d23d290a57d08958d3ad8305ec444efe1281c98fda44e8af7648f49022100f4c7610ad1ba9339178c50e7979b5aa9af07d8143e59d13a2e84f98f37101e3b", + "result" : "valid" + }, + { + "tcId" : 333, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35393938313035383031", + "sig" : "3045022100e455f464e0edff9c959f84f081828896149a330361ff2d16d5a2448c9d6836840220351cfa2f29a1318ebb3a46f0a36df8954043949b8d7cea94eacf99108b4d3fa0", + "result" : "valid" + }, + { + "tcId" : 334, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3136363737383237303537", + "sig" : "3046022100a885770c9ffef33f0c11245064936e3dd165ea2633575a6a155368670351f726022100de31e6a58626a41fd029cf766ef44b8273b88558e2452e893978fbdda1e321d1", + "result" : "valid" + }, + { + "tcId" : 335, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323036323134333632", + "sig" : "304502204b6b451478ba253ae3c75ca5b18b70ccd3cca408ed245cb2af3369548dd2e507022100fe479b631a3431b42772925cbfe8e789f9c55fb2fd1d7ab51664cc2fa571ad93", + "result" : "valid" + }, + { + "tcId" : 336, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36383432343936303435", + "sig" : "304502207ca70376547ad6d18f8e539f09dc269ebaa06854c1adacd58fdc735ed3cf0c16022100f47654f4c0ac1b0e65b712300e3bb472983b116db5206520eabd886dc706b266", + "result" : "valid" + }, + { + "tcId" : 337, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323639383937333231", + "sig" : "30450220388514d147664fbb37271cb8693e47459c0627d6b1dd52dff1d3947dfc9cabec02210099d3d40814aa177be99e4819696996bc75073f4518955587cd56b5ad8bbc2c58", + "result" : "valid" + }, + { + "tcId" : 338, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333837333234363932", + "sig" : "3044022044d3ac50d9b65601d79b47d6c5d98394cef155211ff37d4bac15e0d4890809b802203ea03829afb0545e088361a8cf952aec17bab7637fddd6db35f039803523c921", + "result" : "valid" + }, + { + "tcId" : 339, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34313138383837353336", + "sig" : "3046022100a33004a2cd50a4f70447fd382e7fdc9257c4d9be7b16e686c5082a231ee7b010022100d87b96ed3beea54652607017702cfce5d4e7fcec1fdd28f41681ab80a5c5b63c", + "result" : "valid" + }, + { + "tcId" : 340, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393838363036353435", + "sig" : "30450220668ad18cc22c1d1498cc8e5a11e2bfc4c1e1fcf0a7350a5806c5533ae332f0b1022100f58b49369771bd20bb08b63d4a9212e2dc71da9257ed3710d9eaef9bee469eb2", + "result" : "valid" + }, + { + "tcId" : 341, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343739313135383435", + "sig" : "3046022100f7cdcb0281c70786cc3653820d1756a78395a9eeeab2a4d164e260f64ebfd6a8022100d966c74499cac97ca8ee67400df01b14793b6d7d07668fc202a9918f3c046e9b", + "result" : "valid" + }, + { + "tcId" : 342, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35303736383837333637", + "sig" : "3045022100de0e781d9e3e7f73021458fc1201fc021e5c54f1fe40b1b10db8fcf16ef7e54a02207d9db92321b5e5bb105990145390979390d32394116f4e78af34b85105dee8e9", + "result" : "valid" + }, + { + "tcId" : 343, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393838353036393637", + "sig" : "30440220011dac8ea37f7bc6a530a42d0e3bec8c845694f73bec6950081a6f999ccdfbc60220153e57ee45e0a379839f3b8f6faf86de7a626b210f4c1007e431f842e39bf7d5", + "result" : "valid" + }, + { + "tcId" : 344, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373231333036313331", + "sig" : "3044022063f9c43a8cab49f518685a120bd73a4e5956f9f167a78d4661fc795d41be2ae102206aaf4f3384f1489ef026cb29e97ea1b5562fe8ceb9978d506fb7064f427b9f31", + "result" : "valid" + }, + { + "tcId" : 345, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323034313031363535", + "sig" : "304402207f0fd3736166195ba810d5a2dfb5e1f03aece2170510c8aa4cc4a0c974a7c5d60220370c8772a75d32e8c9cc103004e75e6d30a8ac8611b84b89c41c65542171bc5b", + "result" : "valid" + }, + { + "tcId" : 346, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313530363830393530", + "sig" : "3045022100f975196086d10f683f4aa1a3c2d5fe13fd0f52ee72aa3f785006aa024c75873502206a66364156ef21b5dfdcee60cce8fb09c12019bc576848ff73db49856af74681", + "result" : "valid" + }, + { + "tcId" : 347, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373237343630313033", + "sig" : "3045022035fe6d9bf9f7d47612c3f5be6a4e9a0fb0c14854d1a377adfb5485d6e3835c6f022100f96587fc460e7d07396f9f2d060693dae632721259e77c90b8314002a5235dd0", + "result" : "valid" + }, + { + "tcId" : 348, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134353731343631323235", + "sig" : "30450220210c7c9b231293c8ec09b0f610d31724a045f6a33f84423fdd541ac11ff78962022100e5a40e6b80da99cfc49ce969f1f59146835183e61001b4513f927b71ec3b2a13", + "result" : "valid" + }, + { + "tcId" : 349, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34313739353136303930", + "sig" : "3044022009b7dcfad2c84b89825cf3aaaffed51664faccc0d171a43387a6ff98aa128a040220272b00e6e0917afe4fbe782604428e09fd91c38125d51c3ba06ce3198e6bf736", + "result" : "valid" + }, + { + "tcId" : 350, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35383932373133303534", + "sig" : "3045022009c7c99681c9159b22c0a467999559a31e279075d37ef872a88ae13565f6149b022100b0ff953be1940d2cf548663c1b4db7b416521db289467733b9a76629f8ab261f", + "result" : "valid" + }, + { + "tcId" : 351, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33383936313832323937", + "sig" : "304502202bfaae0ea6d8baab3e02ad7fa3dda3ce0725d11533e3666477f54d697e2ca9bc0221009289d5da443395bca18fe9d1a4afbe04a32b4ecd258eca6c1772acff2d0b9a89", + "result" : "valid" + }, + { + "tcId" : 352, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38323833333436373332", + "sig" : "30440220368846edc677ae8fc237069cda719af3d7f17cc136fe443b2af614ccfb4844ab02205ebe6c1d3e88bc4e291841ea97c836bdcf67d9eabe926346c5f42105f7b38f67", + "result" : "valid" + }, + { + "tcId" : 353, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33333636393734383931", + "sig" : "3046022100f336da82bea2a111bddef6a25de4ab87d7c95aa80d21838f3a4efa3d9346555d022100da5ab612b327aa0fe95d1caf85f3b6698c23a47212006c5667cfa92aa3ef4dad", + "result" : "valid" + }, + { + "tcId" : 354, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32313939313533323239", + "sig" : "304602210097c2fb9865f9e76f8d54ce957120b68ccb04cd3183dae7130f73139cd56655cf022100fb63e38176ffac37d0ec1e49c2e2efeff04dffdad5a75f3576f8276cccee9851", + "result" : "valid" + }, + { + "tcId" : 355, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35363030333136383232", + "sig" : "304402207393e0207e07bd73b674d3667dfbc9c30022574d63079a040a23c0cd7e1b6aa602202994b3468432fecd0a32134171179d2809244d586bd971129cdba73fd3dc8876", + "result" : "valid" + }, + { + "tcId" : 356, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383639363531363935", + "sig" : "3044022021e1943d7d396a8c46658bede4ce155c9a06f929cf6ad292d32c91cf8f493887022030783c682cebfffec5787d762bd725bafc9c4075ad8eb1582188f4c05dd5169d", + "result" : "valid" + }, + { + "tcId" : 357, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36353833393236333732", + "sig" : "304502205a269eb44e910bfe8a2656dee47556cb908a417917e2068e20d201721f44f9b1022100e69d463204dce77c249439f22f77cc4c88134012a286b36a9559f694203766c6", + "result" : "valid" + }, + { + "tcId" : 358, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3133323035303135373235", + "sig" : "3045022100cb8c146fb3d58846e5748c48742af2f1b77805f6cd1e4eb98d8c66cbdf5d6455022017ac992e10251e334467f8e57e2e1c269db8b19469321c74b443972a80f38b2d", + "result" : "valid" + }, + { + "tcId" : 359, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35303835333330373931", + "sig" : "30440220212d84a153db81cea5212fa7dee31d59bdca1307277a01b5936c3aead31bf1e40220520305dbef2bda6526fa2cfca789a1c9aca5c2ad4c0027cc8cf3881813da8a72", + "result" : "valid" + }, + { + "tcId" : 360, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37383636383133313139", + "sig" : "30450220310c82892f571134a36725f4a31c5cba8bc46e65002d73b11364084433d8da4a0221009ca552aca84b96cc9461e2b65a64975118ea78b8b355a0ebcc1a61de37877d13", + "result" : "valid" + }, + { + "tcId" : 361, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303832353339343239", + "sig" : "30440220489deda580c62533783df9fe62de34c2e2cab91d676709beeff13afac8e90db9022032a85a9c56f308b7a794dcce614a5ed7e0857030b8429fe3b4e07ad533a5a00a", + "result" : "valid" + }, + { + "tcId" : 362, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130303635393536363937", + "sig" : "3046022100e8897c1cad1fc870a7d364676a9d7f7cd3ac951f3bc3a9ef1f7231466c3493d7022100dd2128e876d62da82cfc5fc508d33bf66b71c0a84d0a9b7e47dfc620f5846bc6", + "result" : "valid" + }, + { + "tcId" : 363, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303234313831363034", + "sig" : "3046022100b4d771d19fffb1fe5ead25ef5dbf6b53d4d3dad284641108ad84b2541ad435a4022100843ecdc2641b33a3ae9ae15d559f6229d7304ee5ecabe00db73bf2b6b5c6c21f", + "result" : "valid" + }, + { + "tcId" : 364, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37373637383532383734", + "sig" : "304502205ab5fb3136fabdbd22009642df03685935819895d675fc284e8b8112db522d08022100d87ec88173e823ed70438fb1088b00689352542fabad5e9fd6d4c3c58f722f86", + "result" : "valid" + }, + { + "tcId" : 365, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353434313939393734", + "sig" : "3045022100be310120169f8d488c6e5ec5b5e588ab8a65040169d9efd3062e0d05fd7d58df022045033f291fa21a85cc08f78fec2dbd94135520de261360728b8743b558ed16f8", + "result" : "valid" + }, + { + "tcId" : 366, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35383433343830333931", + "sig" : "3045022100cd7fb3f2c25dfab6f9ee83fcbb08698680e9d1f3d47815bc772d717a764f99970220287dd85b976d7f56d23ae7837398c118932aadc982f675f94103036729a47c7c", + "result" : "valid" + }, + { + "tcId" : 367, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373138383932363239", + "sig" : "3045022069f18c064ad2683cc1b6d8b79020aacd186b6ad1999e6e55bf28bb1dac33f339022100ef66e66001fcc219c9a927d7f0b84863483bfd1ffa6086c06921905310c793e1", + "result" : "valid" + }, + { + "tcId" : 368, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373433323233343433", + "sig" : "3043021f547c6bb40f52d207fff796a29f6dbe62058e50fb73bde6b9c6ca11346fd8e802202bc82bd3efc9febe8578acdbc3148bb46c41a39be9ae1994ad52d8bf13195d09", + "result" : "valid" + }, + { + "tcId" : 369, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343036303035393336", + "sig" : "3045022100a80496adce42e7971ebe91300710cf4f535fad266668d76d72c95fffe4d4257002200d4338ca32857e14e0ea8026bc194227b910b98509c8c9307b0d8d93d47b191b", + "result" : "valid" + }, + { + "tcId" : 370, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363134303336393838", + "sig" : "304502203de40634d11a7a6b67023b84650420673ce6dbadb1159768cc0fd55f3784ec88022100a455fb08e51b8493177d88fca43aeff306e1490d7f6d24d6a910970a3d8619de", + "result" : "valid" + }, + { + "tcId" : 371, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303935343235363835", + "sig" : "3046022100c1f229c0557d4c47962593781bc96cf745f3bd629ad85434dc2eee456ddb30310221008638f6c01c15d23db24bb851f6c63c763c1f040976f3f2b32c4bb1b9506c1c12", + "result" : "valid" + }, + { + "tcId" : 372, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303038303938393833", + "sig" : "3045022035dd4957b352e8b1bbc80d1deb21f9b0989188ade3fbe46f75106da1684e1d6d0221008b508e2ed7a51efea0dfaf377f6bd5d4ae133cc4c93650600be545af5d3acd75", + "result" : "valid" + }, + { + "tcId" : 373, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353734313437393237", + "sig" : "30450220410aa9c943e663082c6f76b84469c9845e0d439ba7ffc7cac0418eea0e20e638022100c873ab5c21c9f0ce0bf78484028796b77451e1187250ee33535dacfb3cee5f61", + "result" : "valid" + }, + { + "tcId" : 374, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383636373731353232", + "sig" : "30460221008191db069b571cd40f2676348433430d3a65155c233c46a42a4299e6f5be806c022100f3679ef8af0b1b3a3aeaa7bcee51ce960441622e9ff2dcb22a8ec8de724e0a0c", + "result" : "valid" + }, + { + "tcId" : 375, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363934323830373837", + "sig" : "3046022100889c44edbf3825b18d933aecd5ef70d12ebb00bf79550451205fd6f5ba7f372b022100ecb67194bed2b8176077622d58c9ab4fe4ca34601decc09f9386b8c4445c7224", + "result" : "valid" + }, + { + "tcId" : 376, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39393231363932353638", + "sig" : "3045022100aa87113aff2e1ad6461191241f90a23b91242d0066779daaa9506a4188abc427022033dbaac5ac443fb4d9529f83247f94c0ad1360d4d0ba8e162a377946c6ab9ae2", + "result" : "valid" + }, + { + "tcId" : 377, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131363039343339373938", + "sig" : "304402200e13f66a8ffd0da1c4b67f4d805941e90f98ce386540c48019c1ac105407568302200cb489e8d5acfca5245d9292f59c6ede52425157af77b8beef38d23b6e6ade13", + "result" : "valid" + }, + { + "tcId" : 378, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37313836313632313030", + "sig" : "304402206c1813f660c78bda956c1685bc924f69d1bbac5fadf3e4b027ab049bc82ad134022020de89ee005d7646f070bdac794ccce24d661b390a78851d35fe6fb5b25b3eba", + "result" : "valid" + }, + { + "tcId" : 379, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323934333437313737", + "sig" : "3045022048dc830b6326ec218144391b658d52045ef86ef918a8d41c59131912b1a46fb1022100a431916cb7cf79129b90f09842b3f2164a6cf603db88f2d99944142c00b42559", + "result" : "valid" + }, + { + "tcId" : 380, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3138353134343535313230", + "sig" : "304502204d45782be145a27ae9ecb6cac1b9e30be87c0d13b7d6ada9f795ff051351ac70022100cf71d1eb15e88446ddb900f20d1e0739da499de9963fe99ded00a62da6462d62", + "result" : "valid" + }, + { + "tcId" : 381, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343736303433393330", + "sig" : "3044022011acd8b8d736e7f00476495803fbd20ad351321e800cfbddbd6a7dd610c5ab8c0220734027aabcca9487773dc3ab069b802c00f5b6e5520e7761496ac1e7c78ced91", + "result" : "valid" + }, + { + "tcId" : 382, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353637333738373431", + "sig" : "3045022041be8b3bf41a4c507de12f098f7d409a1f941fef84d93794c497f7242a7c382c02210081f7e7243116f24b84b0321e93eed35e2bdc32b00aa8eb9583be3e9b7a09a4f3", + "result" : "valid" + }, + { + "tcId" : 383, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35373339393334393935", + "sig" : "3046022100ea032ff41b061e93e456a5f0a9cdef36c0732df4d55ab4d3867484b0fc49d9eb022100ab298dd811826a6a9319c3632a96253c31c14f75baef536a645420442bab4d43", + "result" : "valid" + }, + { + "tcId" : 384, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343738333636313339", + "sig" : "30460221008b1ff140c65adca22e5596ffb95a5121c356d2d4055f14606445249a5725686f022100ef8c16ff228114a7e33b35ad465f957577dea405fbdf3faf077a878754e58bef", + "result" : "valid" + }, + { + "tcId" : 385, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363439303532363032", + "sig" : "304402203a40e8dc3ebe9e19dcd0d4d1b698ab2a4934a146def5427b3a6a8fbfbf347846022054f65e36088d2d4543011c94b1e5371697202d488b342dd6f77a69944128223d", + "result" : "valid" + }, + { + "tcId" : 386, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373633383837343936", + "sig" : "3044022015fecd439137df74820727f71218405cbe525d403c574471d8a36fa4b1f592ab022018ec290971ed0a227ec47f1e2142f3b8fe5b17336350c5515d4a87eb3382fcb6", + "result" : "valid" + }, + { + "tcId" : 387, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353739303230303830", + "sig" : "3046022100e676e84a299f481a207cde6a4271c87d73e29d1e49216393292323bcdc238844022100b8a98c769bf81429644758c8f803ddbedf81634e53099c43ad0ca42f4207ba16", + "result" : "valid" + }, + { + "tcId" : 388, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35333434373837383438", + "sig" : "304402205116f8f0af12b47bd025aa6eaec5007d4e3c5a3a72cb4c331f569581adb01bfb02206962251da7ba9ac951cfbd2051bcb7d953005cb9599ae0ad9c5f5139baacb976", + "result" : "valid" + }, + { + "tcId" : 389, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3139323636343130393230", + "sig" : "3046022100b83f3918b6c5506d648ba3dba36762db593ad4b791456babcc3c1a4966317ae60221008cd0166047cec89963e9c8ca43b556ac17d0d62177a9bda35e61d0bb16dd471d", + "result" : "valid" + }, + { + "tcId" : 390, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33373033393135373035", + "sig" : "30440220077858a840230ca21385c4ab4c36cbd3ffaf85656202fba58f1ea995f52ebc4c0220543e5e32a6d2f5c08664ed72175adaa25cdb5d6a754b0cb184e6994ede66c5b9", + "result" : "valid" + }, + { + "tcId" : 391, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3831353435373730", + "sig" : "30440220538ad8797a397414ac82287c9216e41915c9e3dadbd493a0bbef5cb0dc7935ec02202c94cfdae7bf76f90b3cc7d19feea4005b387e312ad4116654d63cfbecf2ae1a", + "result" : "valid" + }, + { + "tcId" : 392, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313935353330333737", + "sig" : "3046022100ff8bbd1b6441388cb8d562c28ce29fbe51de11502fc825773ded3f0df225b2360221008eccca0148b82fdfb370cdd073aa0634b39cc70d0d5244a7319e4b13791e2c2a", + "result" : "valid" + }, + { + "tcId" : 393, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31323637383130393033", + "sig" : "304402207c179a010f51d66ec82fe5d5d45bd867b4b236a27be882e627506f7286ed7baa02205e38c048fb0fbd81c40df3dc16087d9aabeb51a193107499d29d8cf99c388a21", + "result" : "valid" + }, + { + "tcId" : 394, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131313830373230383135", + "sig" : "304502207e0810885b405d54ceb2eb18cae08de2062f61b7ed94ab67eb15e87b64e730ef022100f511a7919e6e4d70c8d61b831e383f58dea5878a6c8c5f0436ee058dd80a7668", + "result" : "valid" + }, + { + "tcId" : 395, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38333831383639323930", + "sig" : "3045022100c665d558dd638ef27a28557c3deb8a2f54abf9bd0bfa032c7ec9a514da9a9e9e022065c9efc355981f91778227eefacf1bb2fedb98657e6cd8674fdd42ae00d619ed", + "result" : "valid" + }, + { + "tcId" : 396, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313331323837323737", + "sig" : "304402204f06b82aa0d070a004a7fd1135bc3a0bc36fcaeeca35e3edf00f5895394d59ab022065f71dd7406a17bf19e434a4635479340204dd862a9f2c4653e2fa39b178286c", + "result" : "valid" + }, + { + "tcId" : 397, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134333331393236353338", + "sig" : "30450220539c8fe5715c3dc893815ec2f00e203b4cd4f8fd36cc5742cc81ced266e02e3b022100a5964b2d5157624cf42b6726ae23a7d5ef83a5d1f1460bd573d5a15316be5bf2", + "result" : "valid" + }, + { + "tcId" : 398, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333434393038323336", + "sig" : "3045022025f337273591f276849cd855b03d07cbcb205924cda4f62a079591602cc10a8c022100d7b82c8fb38bbd503d92e5ae9303e8673c6dd0e9389f5af53366bbab851f0470", + "result" : "valid" + }, + { + "tcId" : 399, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36383239383335393239", + "sig" : "3045022100f36018945d24c89678ce2c8cf3cb4f93c38bdad3589891a5baa293744d4daa20022019ef05878dfc636a4662fd5dd127c908d7948991a324840323c8aef4fc2ff8ac", + "result" : "valid" + }, + { + "tcId" : 400, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343435313538303233", + "sig" : "3045022043203c89ad43a2bb1910e70ea104347e84764599535d46dabbe547395b1463f4022100ed3d29c7c506ecc988614b368b38dd5b4f1e330c1b861efca8152a704b9146e5", + "result" : "valid" + }, + { + "tcId" : 401, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3132363937393837363434", + "sig" : "3046022100c2740bfb3f387df1b564e3ff48835b9e380104716f58c5a43e97bb2c2d84d04a022100e760ee5d0950b512f6c271cd1a87619b830df83fd40d44b9283539b3aa380019", + "result" : "valid" + }, + { + "tcId" : 402, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333939323432353533", + "sig" : "3046022100ec07ec5378ed131b2dea7ae9776ba536daef2afc38e2556a70b89b9752eb1f71022100fea25b9e50b1cfa2cf475dbb2245761d5f4585fbbc438d97226c64ff74bff19e", + "result" : "valid" + }, + { + "tcId" : 403, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363031393737393737", + "sig" : "3046022100e438303ccbbee359c865997e46112b0afd7a647c593429291398f0c432dfb9f00221008487e07a53da18793f8b527069e620e44587e420245d6ec827bb35cccfae7a47", + "result" : "valid" + }, + { + "tcId" : 404, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130383738373535313435", + "sig" : "3045022100fc09fa30e89a2ba3d0c4d9d9350e717168c21253371359c0f3cb8c8807bdab5602205d6c4766bca462cf95b4aeb8f5886b52fc3286642ffee8d0bd7ffd4af7badb4a", + "result" : "valid" + }, + { + "tcId" : 405, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37303034323532393939", + "sig" : "304402204f184fba2be39078385290acb4cc4b3f39b099c3300c762df205c605c6b30e1a0220506481d2018b3a4c0ad558f029c82e0625c833cbbee978bee7b589742ee1e377", + "result" : "valid" + }, + { + "tcId" : 406, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353635333235323833", + "sig" : "3045022100e9a27533a50eafb09561dc335d67f8e5e53b4fc16b3013f062e581ad027e110e02207e4150def368f969ace0fc28cac7a3312d6b9af538c412048be1763ea81f3f44", + "result" : "valid" + }, + { + "tcId" : 407, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3233383236333432333530", + "sig" : "3046022100fac24d54387202bff01a91f5504f778c183a0a7930c02af0b618ee64d1b1e438022100f3a53cb6f96feea45ccadcdf9ac78cd735ec3342163e573d2125caa0d8d507bb", + "result" : "valid" + }, + { + "tcId" : 408, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343437383437303635", + "sig" : "304502203544590a0f9fa5d43ad4e0a003a8d7db58b8570951657aab3bab732727d1bbc2022100f257beac10d53e8012ecd236793d280026c5cf1c04aae522019b87e003500ec5", + "result" : "valid" + }, + { + "tcId" : 409, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134323630323035353434", + "sig" : "3045022100bc0726386497c85da8f4055a727b1938e96786b009e6847a080a8aae571b0753022054b1b15fc7886f09b121af6520d0f4336d259d734713fc3e973cf28368830eff", + "result" : "valid" + }, + { + "tcId" : 410, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393933383335323835", + "sig" : "30450220216f8051f9ceed5b5cc1085f83efd871128cb44b260ac12c486c0ea06c71aa55022100df90346cb028245a72ac7d8094497f0efb83a7c44ba3b258873127355e3b2edf", + "result" : "valid" + }, + { + "tcId" : 411, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34323932313533353233", + "sig" : "3045022100cb76652e19d6e7a72c9cac35c2ae46178d8c0ff59b06b0cb97c31aad39ec1b0902205c47b889a29c781540b8783ca24e2acc340178685d7331017e29b4efe92d9fbd", + "result" : "valid" + }, + { + "tcId" : 412, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343539393031343936", + "sig" : "3045022100edfc03190c839528ba2aa0ba3a23b596fcfec1bf2bbf4467f1fd88398cab8ad2022045b41fa49e0fa7f060ac1ba38ab4d2d5ab5b9fa54ca59285aee09ceedd9865a3", + "result" : "valid" + }, + { + "tcId" : 413, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333933393731313731", + "sig" : "3046022100e7631f03d9dfddc64cfd2a971523def68cb9f8a64e07eb2235c7250adc36480b022100a004cbac3e04056c7e65fdb48be051e9a52ab427c826c84e2cb2229252983663", + "result" : "valid" + }, + { + "tcId" : 414, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333930363936343935", + "sig" : "3045022015e36a42515118021f6f5372ecbff90755d8ae77f9dd683972d2f26aa67164510221008d1cd988ba0a1bd919d2f9b5c8a3517eb59ef776caecdf2b5ac2f7a721858315", + "result" : "valid" + }, + { + "tcId" : 415, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131343436303536323634", + "sig" : "304502206daacbc1125cb3690e43e16b414077c0dd274b96ed61892bad5a519274f01b23022100d044965811b4050c7a85021e8827635cf9f46260fc33bb7cb56b1b37180c4220", + "result" : "valid" + }, + { + "tcId" : 416, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363835303034373530", + "sig" : "3044022037e50775ee06024d596ed49824b1e6a49efae25c7dce8181de33f93ce34ac3ce0220616a3e9d1fed086138f6feef6532647c02bd324ba4a8bfea20640d22f5494429", + "result" : "valid" + }, + { + "tcId" : 417, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3232323035333630363139", + "sig" : "3046022100d5b64cdf82e354ba6a01772f7d38e8d46a729b808aaed73616ed41a9afc83db7022100b5c456c91254e57013228c9724bb7f97aaf18e1bfd4c99d3ca9eaa8214382a10", + "result" : "valid" + }, + { + "tcId" : 418, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36323135363635313234", + "sig" : "3045022100915779b90ae6f6c1fb82c198c9f0719ce2ea37be0f261e36585ec89adaedd2b602207d05e7794ac57578790808c0ac52ca3a51d1399f1a4c7173a7ed19867732b3d9", + "result" : "valid" + }, + { + "tcId" : 419, + "comment" : "Signature generated without truncating the hash", + "flags" : [ + "Untruncatedhash" + ], + "msg" : "313233343030", + "sig" : "30440220097a04ee03a13c511d939e8bbe1471c57a71020e168e2689c69a5625686e24ad022040d24d52f3701ac8da959560c36ed0750a1cf031b728a9134e2b71ed3ddef889", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0412c90a5debd88d42686b84227dbc755351b78e7c6cb86c0b22536f394603646ed03d965851bc41bb089499c51987b899a8353d997e040fdd35290a2627f0a3ab", + "wx" : "12c90a5debd88d42686b84227dbc755351b78e7c6cb86c0b22536f394603646e", + "wy" : "00d03d965851bc41bb089499c51987b899a8353d997e040fdd35290a2627f0a3ab" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000412c90a5debd88d42686b84227dbc755351b78e7c6cb86c0b22536f394603646ed03d965851bc41bb089499c51987b899a8353d997e040fdd35290a2627f0a3ab", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEEskKXevYjUJoa4Qifbx1U1G3jnxsuGwL\nIlNvOUYDZG7QPZZYUbxBuwiUmcUZh7iZqDU9mX4ED901KQomJ/Cjqw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 420, + "comment" : "k*G has a large x-coordinate", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30360211014551231950b75fc4402da1722fc9baeb022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "valid" + }, + { + "tcId" : 421, + "comment" : "r too large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2c022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04913ed043022ee590f59e44f519e5cfd9d6f1b84a50fb417e9ad06683c6afa194b68fb80d6ef261b5a63b57f871d2ea7224319f5fa3ed3dd77f1012dba19d0395", + "wx" : "00913ed043022ee590f59e44f519e5cfd9d6f1b84a50fb417e9ad06683c6afa194", + "wy" : "00b68fb80d6ef261b5a63b57f871d2ea7224319f5fa3ed3dd77f1012dba19d0395" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004913ed043022ee590f59e44f519e5cfd9d6f1b84a50fb417e9ad06683c6afa194b68fb80d6ef261b5a63b57f871d2ea7224319f5fa3ed3dd77f1012dba19d0395", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEkT7QQwIu5ZD1nkT1GeXP2dbxuEpQ+0F+\nmtBmg8avoZS2j7gNbvJhtaY7V/hx0upyJDGfX6PtPdd/EBLboZ0DlQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 422, + "comment" : "r,s are large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04644cc54e84467213fafe2a4451dba550f3ea76ea9970bd6251fc7783a420d8b51cd9439155ec45d5634677c281154bbdf99fe44051dcec322053ca69ea88297c", + "wx" : "644cc54e84467213fafe2a4451dba550f3ea76ea9970bd6251fc7783a420d8b5", + "wy" : "1cd9439155ec45d5634677c281154bbdf99fe44051dcec322053ca69ea88297c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004644cc54e84467213fafe2a4451dba550f3ea76ea9970bd6251fc7783a420d8b51cd9439155ec45d5634677c281154bbdf99fe44051dcec322053ca69ea88297c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEZEzFToRGchP6/ipEUdulUPPqduqZcL1i\nUfx3g6Qg2LUc2UORVexF1WNGd8KBFUu9+Z/kQFHc7DIgU8pp6ogpfA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 423, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02203e9a7582886089c62fb840cf3b83061cd1cff3ae4341808bb5bdee6191174177", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040a11d42154bd2de10ca92321fb6b3e638ee8b5a7fb4fb5f501b44515cf60e8c906ccaab8748cd38ece73ddc975bc307e7de172357e14cd96a94bb3461d32d50e", + "wx" : "0a11d42154bd2de10ca92321fb6b3e638ee8b5a7fb4fb5f501b44515cf60e8c9", + "wy" : "06ccaab8748cd38ece73ddc975bc307e7de172357e14cd96a94bb3461d32d50e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040a11d42154bd2de10ca92321fb6b3e638ee8b5a7fb4fb5f501b44515cf60e8c906ccaab8748cd38ece73ddc975bc307e7de172357e14cd96a94bb3461d32d50e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEChHUIVS9LeEMqSMh+2s+Y47otaf7T7X1\nAbRFFc9g6MkGzKq4dIzTjs5z3cl1vDB+feFyNX4UzZapS7NGHTLVDg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 424, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022024238e70b431b1a64efdf9032669939d4b77f249503fc6905feb7540dea3e6d2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049fa2c32bb349846acb5af14e1c67acfdd8963ed251c4b5783cad4bcdd0fd505d6f724937217d1e5483920405cf1b20200797521c464a2355fdde5306f2a9e448", + "wx" : "009fa2c32bb349846acb5af14e1c67acfdd8963ed251c4b5783cad4bcdd0fd505d", + "wy" : "6f724937217d1e5483920405cf1b20200797521c464a2355fdde5306f2a9e448" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049fa2c32bb349846acb5af14e1c67acfdd8963ed251c4b5783cad4bcdd0fd505d6f724937217d1e5483920405cf1b20200797521c464a2355fdde5306f2a9e448", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEn6LDK7NJhGrLWvFOHGes/diWPtJRxLV4\nPK1LzdD9UF1vckk3IX0eVIOSBAXPGyAgB5dSHEZKI1X93lMG8qnkSA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 425, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0460eace95001201cf4c83b580fb698bb6abf446e5c56ff945eb5769b1a477b55069f5354a77fe2d601528f126c9a6858deeddb9e5ec408356d05ed5c80d62b8e1", + "wx" : "60eace95001201cf4c83b580fb698bb6abf446e5c56ff945eb5769b1a477b550", + "wy" : "69f5354a77fe2d601528f126c9a6858deeddb9e5ec408356d05ed5c80d62b8e1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000460eace95001201cf4c83b580fb698bb6abf446e5c56ff945eb5769b1a477b55069f5354a77fe2d601528f126c9a6858deeddb9e5ec408356d05ed5c80d62b8e1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEYOrOlQASAc9Mg7WA+2mLtqv0RuXFb/lF\n61dpsaR3tVBp9TVKd/4tYBUo8SbJpoWN7t255exAg1bQXtXIDWK44Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 426, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020102", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f1a57d9346842310975ed356672a48a06a70b5efbc0c23287c9b9952ec955b330091aee1224ecd69791856c521b12df172b45a5ce247e6dcaca7349684278f23", + "wx" : "00f1a57d9346842310975ed356672a48a06a70b5efbc0c23287c9b9952ec955b33", + "wy" : "0091aee1224ecd69791856c521b12df172b45a5ce247e6dcaca7349684278f23" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f1a57d9346842310975ed356672a48a06a70b5efbc0c23287c9b9952ec955b330091aee1224ecd69791856c521b12df172b45a5ce247e6dcaca7349684278f23", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE8aV9k0aEIxCXXtNWZypIoGpwte+8DCMo\nfJuZUuyVWzMAka7hIk7NaXkYVsUhsS3xcrRaXOJH5tyspzSWhCePIw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 427, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020101020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "045f051894500a061da63c3558e1469cdffb8a57e260633d630e16c44149d914732f3881bf8954fffce9308e3792413910614341831f9a35b58d1ad0dde4f90cc4", + "wx" : "5f051894500a061da63c3558e1469cdffb8a57e260633d630e16c44149d91473", + "wy" : "2f3881bf8954fffce9308e3792413910614341831f9a35b58d1ad0dde4f90cc4" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200045f051894500a061da63c3558e1469cdffb8a57e260633d630e16c44149d914732f3881bf8954fffce9308e3792413910614341831f9a35b58d1ad0dde4f90cc4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEXwUYlFAKBh2mPDVY4Uac3/uKV+JgYz1j\nDhbEQUnZFHMvOIG/iVT//OkwjjeSQTkQYUNBgx+aNbWNGtDd5PkMxA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 428, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042b934479af23d6b8db0693538e9e15eae8436fe56e3c8c9580955a755103ebb2fd81cdb809b4f839856fa6c051c0df65e4fd8a5d01b297c7797e718c5121b416", + "wx" : "2b934479af23d6b8db0693538e9e15eae8436fe56e3c8c9580955a755103ebb2", + "wy" : "00fd81cdb809b4f839856fa6c051c0df65e4fd8a5d01b297c7797e718c5121b416" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042b934479af23d6b8db0693538e9e15eae8436fe56e3c8c9580955a755103ebb2fd81cdb809b4f839856fa6c051c0df65e4fd8a5d01b297c7797e718c5121b416", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEK5NEea8j1rjbBpNTjp4V6uhDb+VuPIyV\ngJVadVED67L9gc24CbT4OYVvpsBRwN9l5P2KXQGyl8d5fnGMUSG0Fg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 429, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020102", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0409f5de48a08164e8032f79e4ca19ab5930ae6d85a914b5a000048471fc9f66c21ff3560f3345c9ccbdf49835eb6648c70f5777e41f5a2e010dbc25e1eb0ff1f4", + "wx" : "09f5de48a08164e8032f79e4ca19ab5930ae6d85a914b5a000048471fc9f66c2", + "wy" : "1ff3560f3345c9ccbdf49835eb6648c70f5777e41f5a2e010dbc25e1eb0ff1f4" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000409f5de48a08164e8032f79e4ca19ab5930ae6d85a914b5a000048471fc9f66c21ff3560f3345c9ccbdf49835eb6648c70f5777e41f5a2e010dbc25e1eb0ff1f4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAECfXeSKCBZOgDL3nkyhmrWTCubYWpFLWg\nAASEcfyfZsIf81YPM0XJzL30mDXrZkjHD1d35B9aLgENvCXh6w/x9A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 430, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020102020103", + "result" : "valid" + }, + { + "tcId" : 431, + "comment" : "r is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364143020103", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0419697f0b44b285f337dfb49eef051e8861097468d9e9e3cff149bb6add90a1dc774eba64f207bdea048381bc48fa7ac64eb8dc49e5cdd6ce007350e7a0e508ae", + "wx" : "19697f0b44b285f337dfb49eef051e8861097468d9e9e3cff149bb6add90a1dc", + "wy" : "774eba64f207bdea048381bc48fa7ac64eb8dc49e5cdd6ce007350e7a0e508ae" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000419697f0b44b285f337dfb49eef051e8861097468d9e9e3cff149bb6add90a1dc774eba64f207bdea048381bc48fa7ac64eb8dc49e5cdd6ce007350e7a0e508ae", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGWl/C0SyhfM337Se7wUeiGEJdGjZ6ePP\n8Um7at2Qodx3Trpk8ge96gSDgbxI+nrGTrjcSeXN1s4Ac1DnoOUIrg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 432, + "comment" : "s is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020102022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd04917c8", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b3c7fbdf1d7472f7bd578757762c8ebc922ff063b0ae9c3aa9cd81600abea76c038eeb3852b836c0649fd82fe5d1d02c3d0dbb30fbcd7fe41866ebc3bd927c69", + "wx" : "00b3c7fbdf1d7472f7bd578757762c8ebc922ff063b0ae9c3aa9cd81600abea76c", + "wy" : "038eeb3852b836c0649fd82fe5d1d02c3d0dbb30fbcd7fe41866ebc3bd927c69" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b3c7fbdf1d7472f7bd578757762c8ebc922ff063b0ae9c3aa9cd81600abea76c038eeb3852b836c0649fd82fe5d1d02c3d0dbb30fbcd7fe41866ebc3bd927c69", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEs8f73x10cve9V4dXdiyOvJIv8GOwrpw6\nqc2BYAq+p2wDjus4Urg2wGSf2C/l0dAsPQ27MPvNf+QYZuvDvZJ8aQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 433, + "comment" : "small r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302702020101022100c58b162c58b162c58b162c58b162c58a1b242973853e16db75c8a1a71da4d39d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04759fdd1a64c000188b87eb0ddd291a50358fca2b0a5b92f027573845dc40b27a12ec1b2892ef46700f13cff8eb88f40076cc811478b008f5aabee4a74b4546f1", + "wx" : "759fdd1a64c000188b87eb0ddd291a50358fca2b0a5b92f027573845dc40b27a", + "wy" : "12ec1b2892ef46700f13cff8eb88f40076cc811478b008f5aabee4a74b4546f1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004759fdd1a64c000188b87eb0ddd291a50358fca2b0a5b92f027573845dc40b27a12ec1b2892ef46700f13cff8eb88f40076cc811478b008f5aabee4a74b4546f1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEdZ/dGmTAABiLh+sN3SkaUDWPyisKW5Lw\nJ1c4RdxAsnoS7Bsoku9GcA8Tz/jriPQAdsyBFHiwCPWqvuSnS0VG8Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 434, + "comment" : "smallish r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302c02072d9b4d347952cc022100fcbc5103d0da267477d1791461cf2aa44bf9d43198f79507bd8779d69a13108e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044882825a892d30267264e300e868ab5d4b0ffc9ef3c2cb6e90d61d238daed856e4c8248a189eb36d83740f5928cb802fb9c50b5a18c9196344a0c2cb74416423", + "wx" : "4882825a892d30267264e300e868ab5d4b0ffc9ef3c2cb6e90d61d238daed856", + "wy" : "00e4c8248a189eb36d83740f5928cb802fb9c50b5a18c9196344a0c2cb74416423" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044882825a892d30267264e300e868ab5d4b0ffc9ef3c2cb6e90d61d238daed856e4c8248a189eb36d83740f5928cb802fb9c50b5a18c9196344a0c2cb74416423", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESIKCWoktMCZyZOMA6GirXUsP/J7zwstu\nkNYdI42u2FbkyCSKGJ6zbYN0D1koy4AvucULWhjJGWNEoMLLdEFkIw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 435, + "comment" : "100-bit r and small s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d1033e67e37b32b445580bf4efc022100906f906f906f906f906f906f906f906ed8e426f7b1968c35a204236a579723d2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04c4d1b1fdf274cf83f3395a70a36c94f7c51f1a31e99514b4ef10ba1304756caf4eaf435b20dd76d6ef447869503da9b28f0ea08edf287424d44aa04b254c1736", + "wx" : "00c4d1b1fdf274cf83f3395a70a36c94f7c51f1a31e99514b4ef10ba1304756caf", + "wy" : "4eaf435b20dd76d6ef447869503da9b28f0ea08edf287424d44aa04b254c1736" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004c4d1b1fdf274cf83f3395a70a36c94f7c51f1a31e99514b4ef10ba1304756caf4eaf435b20dd76d6ef447869503da9b28f0ea08edf287424d44aa04b254c1736", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAExNGx/fJ0z4PzOVpwo2yU98UfGjHplRS0\n7xC6EwR1bK9Or0NbIN121u9EeGlQPamyjw6gjt8odCTUSqBLJUwXNg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 436, + "comment" : "small r and 100 bit s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020201010220783266e90f43dafe5cd9b3b0be86de22f9de83677d0f50713a468ec72fcf5d57", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043376df7376d5e651d45b8ec2e5ff9d891c6fdd6dbbb52b046e6b5ac4c9facedf76cf27f9fcb65403b1f585a2dafe26b43ebd622baccde699d81c9be98df9f4df", + "wx" : "3376df7376d5e651d45b8ec2e5ff9d891c6fdd6dbbb52b046e6b5ac4c9facedf", + "wy" : "76cf27f9fcb65403b1f585a2dafe26b43ebd622baccde699d81c9be98df9f4df" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043376df7376d5e651d45b8ec2e5ff9d891c6fdd6dbbb52b046e6b5ac4c9facedf76cf27f9fcb65403b1f585a2dafe26b43ebd622baccde699d81c9be98df9f4df", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEM3bfc3bV5lHUW47C5f+diRxv3W27tSsE\nbmtaxMn6zt92zyf5/LZUA7H1haLa/ia0Pr1iK6zN5pnYHJvpjfn03w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 437, + "comment" : "100-bit r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3031020d062522bbd3ecbe7c39e93e7c260220783266e90f43dafe5cd9b3b0be86de22f9de83677d0f50713a468ec72fcf5d57", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "045077fdd202fdb4194b05491b6c053fff8760697531fc5227879e9cbec3309585d0b5cffb3e0fdfb1c06e6d11a1182752730cfe439f7a4f8a49b9c2924f49ec14", + "wx" : "5077fdd202fdb4194b05491b6c053fff8760697531fc5227879e9cbec3309585", + "wy" : "00d0b5cffb3e0fdfb1c06e6d11a1182752730cfe439f7a4f8a49b9c2924f49ec14" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200045077fdd202fdb4194b05491b6c053fff8760697531fc5227879e9cbec3309585d0b5cffb3e0fdfb1c06e6d11a1182752730cfe439f7a4f8a49b9c2924f49ec14", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEUHf90gL9tBlLBUkbbAU//4dgaXUx/FIn\nh56cvsMwlYXQtc/7Pg/fscBubRGhGCdScwz+Q596T4pJucKST0nsFA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 438, + "comment" : "r and s^-1 are close to n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03640c1022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a218a180d55c05040417fa4d6881e8dbcf4952d427e4d5cbaf297e17848c49ae85b4c0e345073b0ad301fc9269d7df1cf328ca245910d9398ebbfa48782a70ff", + "wx" : "00a218a180d55c05040417fa4d6881e8dbcf4952d427e4d5cbaf297e17848c49ae", + "wy" : "0085b4c0e345073b0ad301fc9269d7df1cf328ca245910d9398ebbfa48782a70ff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a218a180d55c05040417fa4d6881e8dbcf4952d427e4d5cbaf297e17848c49ae85b4c0e345073b0ad301fc9269d7df1cf328ca245910d9398ebbfa48782a70ff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEohihgNVcBQQEF/pNaIHo289JUtQn5NXL\nryl+F4SMSa6FtMDjRQc7CtMB/JJp198c8yjKJFkQ2TmOu/pIeCpw/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 439, + "comment" : "r and s are 64-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30160209009c44febf31c3594d020900839ed28247c2b06b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049b7e703d3c0224fb5fca71fab833a35fbea230453ae25ce3e3afbb646c587a5a9dd1e4b0c75250fc7845d4013a8f10988ed0875f8cbbdb6ab216bced9b8c3cb7", + "wx" : "009b7e703d3c0224fb5fca71fab833a35fbea230453ae25ce3e3afbb646c587a5a", + "wy" : "009dd1e4b0c75250fc7845d4013a8f10988ed0875f8cbbdb6ab216bced9b8c3cb7" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049b7e703d3c0224fb5fca71fab833a35fbea230453ae25ce3e3afbb646c587a5a9dd1e4b0c75250fc7845d4013a8f10988ed0875f8cbbdb6ab216bced9b8c3cb7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEm35wPTwCJPtfynH6uDOjX76iMEU64lzj\n46+7ZGxYelqd0eSwx1JQ/HhF1AE6jxCYjtCHX4y722qyFrztm4w8tw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 440, + "comment" : "r and s are 100-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "301e020d09df8b682430beef6f5fd7c7cf020d0fd0a62e13778f4222a0d61c8a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0482e6ec5429071f4a4571ff510a5cfea7f493492b7d4dcef0404563eebdf79f7af4d87d7e0da88f73c882dddab8d0b1edf9678a92b08d340a312900df34d860ac", + "wx" : "0082e6ec5429071f4a4571ff510a5cfea7f493492b7d4dcef0404563eebdf79f7a", + "wy" : "00f4d87d7e0da88f73c882dddab8d0b1edf9678a92b08d340a312900df34d860ac" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000482e6ec5429071f4a4571ff510a5cfea7f493492b7d4dcef0404563eebdf79f7af4d87d7e0da88f73c882dddab8d0b1edf9678a92b08d340a312900df34d860ac", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEgubsVCkHH0pFcf9RClz+p/STSSt9Tc7w\nQEVj7r33n3r02H1+DaiPc8iC3dq40LHt+WeKkrCNNAoxKQDfNNhgrA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 441, + "comment" : "r and s are 128-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30260211008a598e563a89f526c32ebec8de26367a02110084f633e2042630e99dd0f1e16f7a04bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047937c7f3fbac0301f1e3b73f85cb97bab657c20ec493744c1c3ba692d999038de6b09c5471a987b685b8ff1e5fe9b4e20d59e0ff1299537069897c9ae2bd63ea", + "wx" : "7937c7f3fbac0301f1e3b73f85cb97bab657c20ec493744c1c3ba692d999038d", + "wy" : "00e6b09c5471a987b685b8ff1e5fe9b4e20d59e0ff1299537069897c9ae2bd63ea" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047937c7f3fbac0301f1e3b73f85cb97bab657c20ec493744c1c3ba692d999038de6b09c5471a987b685b8ff1e5fe9b4e20d59e0ff1299537069897c9ae2bd63ea", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeTfH8/usAwHx47c/hcuXurZXwg7Ek3RM\nHDumktmZA43msJxUcamHtoW4/x5f6bTiDVng/xKZU3BpiXya4r1j6g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 442, + "comment" : "r and s are 160-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041b1f773b472dac5e1adf94e69d865b404d2cc92cff7bb66cf2197978f6c45d08a9725791c5f33787977a9ddfa69296be998a968c51ec7f1c5447793bc56286b3", + "wx" : "1b1f773b472dac5e1adf94e69d865b404d2cc92cff7bb66cf2197978f6c45d08", + "wy" : "00a9725791c5f33787977a9ddfa69296be998a968c51ec7f1c5447793bc56286b3" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041b1f773b472dac5e1adf94e69d865b404d2cc92cff7bb66cf2197978f6c45d08a9725791c5f33787977a9ddfa69296be998a968c51ec7f1c5447793bc56286b3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEGx93O0ctrF4a35TmnYZbQE0sySz/e7Zs\n8hl5ePbEXQipcleRxfM3h5d6nd+mkpa+mYqWjFHsfxxUR3k7xWKGsw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 443, + "comment" : "s == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3025022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1020101", + "result" : "valid" + }, + { + "tcId" : 444, + "comment" : "s == 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3025022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1020100", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04fab77f79e004a6890126e793df13464607eca844f29e645f16a0aa1a3ab9f7b39ef2a99df25c2f51cdab3e75810ef5fe36331e36a519ae5ebefefab5a55bfc6a", + "wx" : "00fab77f79e004a6890126e793df13464607eca844f29e645f16a0aa1a3ab9f7b3", + "wy" : "009ef2a99df25c2f51cdab3e75810ef5fe36331e36a519ae5ebefefab5a55bfc6a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004fab77f79e004a6890126e793df13464607eca844f29e645f16a0aa1a3ab9f7b39ef2a99df25c2f51cdab3e75810ef5fe36331e36a519ae5ebefefab5a55bfc6a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE+rd/eeAEpokBJueT3xNGRgfsqETynmRf\nFqCqGjq597Oe8qmd8lwvUc2rPnWBDvX+NjMeNqUZrl6+/vq1pVv8ag==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 445, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220419d981c515af8cc82545aac0c85e9e308fbb2eab6acd7ed497e0b4145a18fd9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040afc55541d6cf8bd16289c8954ce899805e39c41ba0d4b83deaef2baed94b2daa5a3a5f79deb3245a51e436c137ea60ddd152d09da5f6e121020ba560eede8b8", + "wx" : "0afc55541d6cf8bd16289c8954ce899805e39c41ba0d4b83deaef2baed94b2da", + "wy" : "00a5a3a5f79deb3245a51e436c137ea60ddd152d09da5f6e121020ba560eede8b8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040afc55541d6cf8bd16289c8954ce899805e39c41ba0d4b83deaef2baed94b2daa5a3a5f79deb3245a51e436c137ea60ddd152d09da5f6e121020ba560eede8b8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAECvxVVB1s+L0WKJyJVM6JmAXjnEG6DUuD\n3q7yuu2Ustqlo6X3nesyRaUeQ2wTfqYN3RUtCdpfbhIQILpWDu3ouA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 446, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102201b21717ad71d23bbac60a9ad0baf75b063c9fdf52a00ebf99d022172910993c9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b50c72e9b03e5ad9f12cd2f69fc442138d3a8917e800fa138795a24ed0aeada51e09f5ef6efa9aa866e763d5a90c62052ea682a217eba654c6b250962308f6de", + "wx" : "00b50c72e9b03e5ad9f12cd2f69fc442138d3a8917e800fa138795a24ed0aeada5", + "wy" : "1e09f5ef6efa9aa866e763d5a90c62052ea682a217eba654c6b250962308f6de" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b50c72e9b03e5ad9f12cd2f69fc442138d3a8917e800fa138795a24ed0aeada51e09f5ef6efa9aa866e763d5a90c62052ea682a217eba654c6b250962308f6de", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEtQxy6bA+WtnxLNL2n8RCE406iRfoAPoT\nh5WiTtCuraUeCfXvbvqaqGbnY9WpDGIFLqaCohfrplTGslCWIwj23g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 447, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102202f588f66018f3dd14db3e28e77996487e32486b521ed8e5a20f06591951777e9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046c60df5622465b2c8bd6a22fc20483c450505687e3a832f94545de17c321872a8f6d60c5f3b8e064662562ccd6703cf7418d0f8fbdf55728e4ef69e8a20406a8", + "wx" : "6c60df5622465b2c8bd6a22fc20483c450505687e3a832f94545de17c321872a", + "wy" : "008f6d60c5f3b8e064662562ccd6703cf7418d0f8fbdf55728e4ef69e8a20406a8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046c60df5622465b2c8bd6a22fc20483c450505687e3a832f94545de17c321872a8f6d60c5f3b8e064662562ccd6703cf7418d0f8fbdf55728e4ef69e8a20406a8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbGDfViJGWyyL1qIvwgSDxFBQVofjqDL5\nRUXeF8MhhyqPbWDF87jgZGYlYszWcDz3QY0Pj731Vyjk72noogQGqA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 448, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220091a08870ff4daf9123b30c20e8c4fc8505758dcf4074fcaff2170c9bfcf74f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049326f5033bd0fc2a5108a4ba8872c3ff2d6125db90a0d4af7720d9b7cfe580b7d9d649c6090e76ba1d19ece34b3b3dc7b485df93f888017039eee2e92ebaf64f", + "wx" : "009326f5033bd0fc2a5108a4ba8872c3ff2d6125db90a0d4af7720d9b7cfe580b7", + "wy" : "00d9d649c6090e76ba1d19ece34b3b3dc7b485df93f888017039eee2e92ebaf64f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049326f5033bd0fc2a5108a4ba8872c3ff2d6125db90a0d4af7720d9b7cfe580b7d9d649c6090e76ba1d19ece34b3b3dc7b485df93f888017039eee2e92ebaf64f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEkyb1AzvQ/CpRCKS6iHLD/y1hJduQoNSv\ndyDZt8/lgLfZ1knGCQ52uh0Z7ONLOz3HtIXfk/iIAXA57uLpLrr2Tw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 449, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102207c370dc0ce8c59a8b273cba44a7c1191fc3186dc03cab96b0567312df0d0b250", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048217f17c61e97b578e2586fb03274567099d6b329f4205827b0493d589b6d6cbf5259ef680d96395fde4da8a6a96095bbeb72fc1b616b40de3d91571bd4100a8", + "wx" : "008217f17c61e97b578e2586fb03274567099d6b329f4205827b0493d589b6d6cb", + "wy" : "00f5259ef680d96395fde4da8a6a96095bbeb72fc1b616b40de3d91571bd4100a8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048217f17c61e97b578e2586fb03274567099d6b329f4205827b0493d589b6d6cbf5259ef680d96395fde4da8a6a96095bbeb72fc1b616b40de3d91571bd4100a8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEghfxfGHpe1eOJYb7AydFZwmdazKfQgWC\newST1Ym21sv1JZ72gNljlf3k2opqlglbvrcvwbYWtA3j2RVxvUEAqA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 450, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022070b59a7d1ee77a2f9e0491c2a7cfcd0ed04df4a35192f6132dcc668c79a6160e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04367b67eb9ece04b532c9925b30595fd733e9f1fa52ca1d05d630c7a877b5162c99219249dc0ec6e92bcbfe6e46b7d500278b01f66397e7d9ce4236b5fb1a70a0", + "wx" : "367b67eb9ece04b532c9925b30595fd733e9f1fa52ca1d05d630c7a877b5162c", + "wy" : "0099219249dc0ec6e92bcbfe6e46b7d500278b01f66397e7d9ce4236b5fb1a70a0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004367b67eb9ece04b532c9925b30595fd733e9f1fa52ca1d05d630c7a877b5162c99219249dc0ec6e92bcbfe6e46b7d500278b01f66397e7d9ce4236b5fb1a70a0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAENntn657OBLUyyZJbMFlf1zPp8fpSyh0F\n1jDHqHe1FiyZIZJJ3A7G6SvL/m5Gt9UAJ4sB9mOX59nOQja1+xpwoA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 451, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102202736d76e412246e097148e2bf62915614eb7c428913a58eb5e9cd4674a9423de", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046700d5c4ba0f6fad92f0deb2055b988fec6a427b689cd779b8e4f1606d22f7dff1f3ea8ed23eba61b5c90d66cf4820e4b1c51c9d23b062552f087a162a8c7b0c", + "wx" : "6700d5c4ba0f6fad92f0deb2055b988fec6a427b689cd779b8e4f1606d22f7df", + "wy" : "00f1f3ea8ed23eba61b5c90d66cf4820e4b1c51c9d23b062552f087a162a8c7b0c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046700d5c4ba0f6fad92f0deb2055b988fec6a427b689cd779b8e4f1606d22f7dff1f3ea8ed23eba61b5c90d66cf4820e4b1c51c9d23b062552f087a162a8c7b0c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEZwDVxLoPb62S8N6yBVuYj+xqQntonNd5\nuOTxYG0i99/x8+qO0j66YbXJDWbPSCDkscUcnSOwYlUvCHoWKox7DA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 452, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102204a1e12831fbe93627b02d6e7f24bccdd6ef4b2d0f46739eaf3b1eaf0ca117770", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b0478cb90c29140cefdfbcb50ca2740c48a97df67ae9672e1e11cb827c1cede51d2824a9265a32d9d2221d453ea40bf64999d2c20e268d0bc061cf6ae2051cf2", + "wx" : "00b0478cb90c29140cefdfbcb50ca2740c48a97df67ae9672e1e11cb827c1cede5", + "wy" : "1d2824a9265a32d9d2221d453ea40bf64999d2c20e268d0bc061cf6ae2051cf2" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b0478cb90c29140cefdfbcb50ca2740c48a97df67ae9672e1e11cb827c1cede51d2824a9265a32d9d2221d453ea40bf64999d2c20e268d0bc061cf6ae2051cf2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEsEeMuQwpFAzv37y1DKJ0DEipffZ66Wcu\nHhHLgnwc7eUdKCSpJloy2dIiHUU+pAv2SZnSwg4mjQvAYc9q4gUc8g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 453, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022006c778d4dfff7dee06ed88bc4e0ed34fc553aad67caf796f2a1c6487c1b2e877", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04940e51450409cd15529adc38e730a662916bc93ae10c0facf41580a75a0c598655c6b4c9b8fdc7d932fb4a0a6847e0d878a8bdbe9390567f0b8ed92eb86267fa", + "wx" : "00940e51450409cd15529adc38e730a662916bc93ae10c0facf41580a75a0c5986", + "wy" : "55c6b4c9b8fdc7d932fb4a0a6847e0d878a8bdbe9390567f0b8ed92eb86267fa" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004940e51450409cd15529adc38e730a662916bc93ae10c0facf41580a75a0c598655c6b4c9b8fdc7d932fb4a0a6847e0d878a8bdbe9390567f0b8ed92eb86267fa", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAElA5RRQQJzRVSmtw45zCmYpFryTrhDA+s\n9BWAp1oMWYZVxrTJuP3H2TL7SgpoR+DYeKi9vpOQVn8LjtkuuGJn+g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 454, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102204de459ef9159afa057feb3ec40fef01c45b809f4ab296ea48c206d4249a2b451", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040b0beeaed3b2586106e814824a0803b19fe7085ec923e0865a3c803bd46760d1e2741cd27b03f78381957bf81d42f5d61124c001418e591d14480bb8e789d1e5", + "wx" : "0b0beeaed3b2586106e814824a0803b19fe7085ec923e0865a3c803bd46760d1", + "wy" : "00e2741cd27b03f78381957bf81d42f5d61124c001418e591d14480bb8e789d1e5" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040b0beeaed3b2586106e814824a0803b19fe7085ec923e0865a3c803bd46760d1e2741cd27b03f78381957bf81d42f5d61124c001418e591d14480bb8e789d1e5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAECwvurtOyWGEG6BSCSggDsZ/nCF7JI+CG\nWjyAO9RnYNHidBzSewP3g4GVe/gdQvXWESTAAUGOWR0USAu454nR5Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 455, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c10220745d294978007302033502e1acc48b63ae6500be43adbea1b258d6b423dbb416", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046d56bb0e13f31470316914085214ee218039df7a2ea062878e1d769e47f7e39295a122a009a17683f079c2da61cff3032e88347c525592edf0877bb5338bcedd", + "wx" : "6d56bb0e13f31470316914085214ee218039df7a2ea062878e1d769e47f7e392", + "wy" : "0095a122a009a17683f079c2da61cff3032e88347c525592edf0877bb5338bcedd" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046d56bb0e13f31470316914085214ee218039df7a2ea062878e1d769e47f7e39295a122a009a17683f079c2da61cff3032e88347c525592edf0877bb5338bcedd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbVa7DhPzFHAxaRQIUhTuIYA533ouoGKH\njh12nkf345KVoSKgCaF2g/B5wtphz/MDLog0fFJVku3wh3u1M4vO3Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 456, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102207b2a785e3896f59b2d69da57648e80ad3c133a750a2847fd2098ccd902042b6c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049e38cd7f3aefb648b90dc9e3562737bda57cf73113cb110568af698392992d53bdaf4fe8760647abdbd91f14b4b32a21de6737629dd62e9f38f76e12bb4649ae", + "wx" : "009e38cd7f3aefb648b90dc9e3562737bda57cf73113cb110568af698392992d53", + "wy" : "00bdaf4fe8760647abdbd91f14b4b32a21de6737629dd62e9f38f76e12bb4649ae" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049e38cd7f3aefb648b90dc9e3562737bda57cf73113cb110568af698392992d53bdaf4fe8760647abdbd91f14b4b32a21de6737629dd62e9f38f76e12bb4649ae", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEnjjNfzrvtki5DcnjVic3vaV89zETyxEF\naK9pg5KZLVO9r0/odgZHq9vZHxS0syoh3mc3Yp3WLp84924Su0ZJrg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 457, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c1022071ae94a72ca896875e7aa4a4c3d29afdb4b35b6996273e63c47ac519256c5eb1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e1c989fd3b9e87020a508b72b6cd8da14f15b9c12125b4b2ed402e1257abed82aa6074e0a4ea09ffc24a36d61bd37e0ea642a06d4d58ebd51b2d172bacd5e525", + "wx" : "00e1c989fd3b9e87020a508b72b6cd8da14f15b9c12125b4b2ed402e1257abed82", + "wy" : "00aa6074e0a4ea09ffc24a36d61bd37e0ea642a06d4d58ebd51b2d172bacd5e525" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e1c989fd3b9e87020a508b72b6cd8da14f15b9c12125b4b2ed402e1257abed82aa6074e0a4ea09ffc24a36d61bd37e0ea642a06d4d58ebd51b2d172bacd5e525", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE4cmJ/TuehwIKUItyts2NoU8VucEhJbSy\n7UAuEler7YKqYHTgpOoJ/8JKNtYb034OpkKgbU1Y69UbLRcrrNXlJQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 458, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102200fa527fa7343c0bc9ec35a6278bfbff4d83301b154fc4bd14aee7eb93445b5f9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0411119d9ac0b4e2adf1bb1db84324fff3c93c76f46999a453b5492151677b8dcebf16cb2f94bae17949c17714a6b0d87fe3cce99d9c149562df76ab035cf0c671", + "wx" : "11119d9ac0b4e2adf1bb1db84324fff3c93c76f46999a453b5492151677b8dce", + "wy" : "00bf16cb2f94bae17949c17714a6b0d87fe3cce99d9c149562df76ab035cf0c671" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000411119d9ac0b4e2adf1bb1db84324fff3c93c76f46999a453b5492151677b8dcebf16cb2f94bae17949c17714a6b0d87fe3cce99d9c149562df76ab035cf0c671", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEERGdmsC04q3xux24QyT/88k8dvRpmaRT\ntUkhUWd7jc6/FssvlLrheUnBdxSmsNh/48zpnZwUlWLfdqsDXPDGcQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 459, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c102206539c0adadd0525ff42622164ce9314348bd0863b4c80e936b23ca0414264671", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "042f20bc2232b4ba9d75fea6a92bc827d91c5a8f5c887f4e304d76656ba15999ea5f83242efbd57dd16dbd3de0915bdb2ddec201d2f749b13fc22c223a2644dcdc", + "wx" : "2f20bc2232b4ba9d75fea6a92bc827d91c5a8f5c887f4e304d76656ba15999ea", + "wy" : "5f83242efbd57dd16dbd3de0915bdb2ddec201d2f749b13fc22c223a2644dcdc" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200042f20bc2232b4ba9d75fea6a92bc827d91c5a8f5c887f4e304d76656ba15999ea5f83242efbd57dd16dbd3de0915bdb2ddec201d2f749b13fc22c223a2644dcdc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAELyC8IjK0up11/qapK8gn2Rxaj1yIf04w\nTXZla6FZmepfgyQu+9V90W29PeCRW9st3sIB0vdJsT/CLCI6JkTc3A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 460, + "comment" : "point at infinity during verify", + "flags" : [ + "PointDuplication", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "049e009cd0a1a7d0c51765169c468e62e56fc4f3ff02e8666c55483419a2560032cd36d713acd504598ff3b4f58046a4690f550bd60ef4c823c5c581c6b899315e", + "wx" : "009e009cd0a1a7d0c51765169c468e62e56fc4f3ff02e8666c55483419a2560032", + "wy" : "00cd36d713acd504598ff3b4f58046a4690f550bd60ef4c823c5c581c6b899315e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200049e009cd0a1a7d0c51765169c468e62e56fc4f3ff02e8666c55483419a2560032cd36d713acd504598ff3b4f58046a4690f550bd60ef4c823c5c581c6b899315e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEngCc0KGn0MUXZRacRo5i5W/E8/8C6GZs\nVUg0GaJWADLNNtcTrNUEWY/ztPWARqRpD1UL1g70yCPFxYHGuJkxXg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 461, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04af58a6ecc8254b9b831ae0441c13990802c3d68c301d43634c71f1974c09e704d920612d82f32fca436c5c5097505271494875402731d03dba942b355306c783", + "wx" : "00af58a6ecc8254b9b831ae0441c13990802c3d68c301d43634c71f1974c09e704", + "wy" : "00d920612d82f32fca436c5c5097505271494875402731d03dba942b355306c783" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004af58a6ecc8254b9b831ae0441c13990802c3d68c301d43634c71f1974c09e704d920612d82f32fca436c5c5097505271494875402731d03dba942b355306c783", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEr1im7MglS5uDGuBEHBOZCALD1owwHUNj\nTHHxl0wJ5wTZIGEtgvMvykNsXFCXUFJxSUh1QCcx0D26lCs1UwbHgw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 462, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a002207fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044a7217cabc95b496f3f4e12d54e9def7651b866be69d3695cd77ad2e3a3f13d1d0fa71bf21d2c00b1ff4cc76b53a9c5c2a8a8b6b4c2ec88b99ee537ac6262b3d", + "wx" : "4a7217cabc95b496f3f4e12d54e9def7651b866be69d3695cd77ad2e3a3f13d1", + "wy" : "00d0fa71bf21d2c00b1ff4cc76b53a9c5c2a8a8b6b4c2ec88b99ee537ac6262b3d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044a7217cabc95b496f3f4e12d54e9def7651b866be69d3695cd77ad2e3a3f13d1d0fa71bf21d2c00b1ff4cc76b53a9c5c2a8a8b6b4c2ec88b99ee537ac6262b3d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESnIXyryVtJbz9OEtVOne92UbhmvmnTaV\nzXetLjo/E9HQ+nG/IdLACx/0zHa1OpxcKoqLa0wuyIuZ7lN6xiYrPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 463, + "comment" : "u1 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022043f800fbeaf9238c58af795bcdad04bc49cd850c394d3382953356b023210281", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0400a42e277ce657fb3dd07e135a3cb9b0a75a30bd8b64911606ee68371e56124467cf22e26a7009045b73ff19cd79851cceaad9ae72ef2d043d75365245befa06", + "wx" : "00a42e277ce657fb3dd07e135a3cb9b0a75a30bd8b64911606ee68371e561244", + "wy" : "67cf22e26a7009045b73ff19cd79851cceaad9ae72ef2d043d75365245befa06" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000400a42e277ce657fb3dd07e135a3cb9b0a75a30bd8b64911606ee68371e56124467cf22e26a7009045b73ff19cd79851cceaad9ae72ef2d043d75365245befa06", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAKQuJ3zmV/s90H4TWjy5sKdaML2LZJEW\nBu5oNx5WEkRnzyLianAJBFtz/xnNeYUczqrZrnLvLQQ9dTZSRb76Bg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 464, + "comment" : "u1 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022100bc07ff041506dc73a75086a43252fb4270e157da75fb6cb92a9f07dcad153ec0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048520b9502f9a5ed753f09a5282cad721f5ebfb3db4142d667c6279869e76bcf1678e9bbd04a51460afc40a3e0cb7b0f8b8add89b2979758a5a1ffeb4584ee49e", + "wx" : "008520b9502f9a5ed753f09a5282cad721f5ebfb3db4142d667c6279869e76bcf1", + "wy" : "678e9bbd04a51460afc40a3e0cb7b0f8b8add89b2979758a5a1ffeb4584ee49e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048520b9502f9a5ed753f09a5282cad721f5ebfb3db4142d667c6279869e76bcf1678e9bbd04a51460afc40a3e0cb7b0f8b8add89b2979758a5a1ffeb4584ee49e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEhSC5UC+aXtdT8JpSgsrXIfXr+z20FC1m\nfGJ5hp52vPFnjpu9BKUUYK/ECj4Mt7D4uK3Ymyl5dYpaH/60WE7kng==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 465, + "comment" : "u2 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b5deca0fe0296905aac27e3604a95a0a2ecbee9fc453d2e1164632964454d0c94f9e4e85a143ee677d40919c71014e8cabf4d9db7442fe4b96298f99f90ca67f", + "wx" : "00b5deca0fe0296905aac27e3604a95a0a2ecbee9fc453d2e1164632964454d0c9", + "wy" : "4f9e4e85a143ee677d40919c71014e8cabf4d9db7442fe4b96298f99f90ca67f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b5deca0fe0296905aac27e3604a95a0a2ecbee9fc453d2e1164632964454d0c94f9e4e85a143ee677d40919c71014e8cabf4d9db7442fe4b96298f99f90ca67f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEtd7KD+ApaQWqwn42BKlaCi7L7p/EU9Lh\nFkYylkRU0MlPnk6FoUPuZ31AkZxxAU6Mq/TZ23RC/kuWKY+Z+Qymfw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 466, + "comment" : "u2 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215b8022100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9d1c9e899ca306ad27fe1945de0242b89", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "045dcb2767dc851e20911ed7be39dd87ba81c7a6d10255dfb825f241486f98ae10f8a9ef736b3e11d7d54a0e086902fb477246ec8c57de65d336570b65f65e0d83", + "wx" : "5dcb2767dc851e20911ed7be39dd87ba81c7a6d10255dfb825f241486f98ae10", + "wy" : "00f8a9ef736b3e11d7d54a0e086902fb477246ec8c57de65d336570b65f65e0d83" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200045dcb2767dc851e20911ed7be39dd87ba81c7a6d10255dfb825f241486f98ae10f8a9ef736b3e11d7d54a0e086902fb477246ec8c57de65d336570b65f65e0d83", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEXcsnZ9yFHiCRHte+Od2HuoHHptECVd+4\nJfJBSG+YrhD4qe9zaz4R19VKDghpAvtHckbsjFfeZdM2Vwtl9l4Ngw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 467, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02206bfd55a94e530bd972e52873ef39ac3e56d420a64d874694c701e714511d1696", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04c8e144c853a7e1a6f5bbabe7ef91ef5b152113210d44fd58d3cb6185184e168aac40fb3618882193fc6d113760e476465df49067480a0a7cffe686515b3391a8", + "wx" : "00c8e144c853a7e1a6f5bbabe7ef91ef5b152113210d44fd58d3cb6185184e168a", + "wy" : "00ac40fb3618882193fc6d113760e476465df49067480a0a7cffe686515b3391a8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004c8e144c853a7e1a6f5bbabe7ef91ef5b152113210d44fd58d3cb6185184e168aac40fb3618882193fc6d113760e476465df49067480a0a7cffe686515b3391a8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEyOFEyFOn4ab1u6vn75HvWxUhEyENRP1Y\n08thhRhOFoqsQPs2GIghk/xtETdg5HZGXfSQZ0gKCnz/5oZRWzORqA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 468, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100b494bd67c209a5adb1c9a09337e2629b03f8a924be53c542478e5864ed2622ad", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047ffe185a23eb5b736704387e6357628a65984985773b4473cf9ef560b3fa50514740cb1217f1ad2b5910d7f74906602b1f9550b3d11cff705b358c3bcbf72c3d", + "wx" : "7ffe185a23eb5b736704387e6357628a65984985773b4473cf9ef560b3fa5051", + "wy" : "4740cb1217f1ad2b5910d7f74906602b1f9550b3d11cff705b358c3bcbf72c3d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047ffe185a23eb5b736704387e6357628a65984985773b4473cf9ef560b3fa50514740cb1217f1ad2b5910d7f74906602b1f9550b3d11cff705b358c3bcbf72c3d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEf/4YWiPrW3NnBDh+Y1diimWYSYV3O0Rz\nz571YLP6UFFHQMsSF/GtK1kQ1/dJBmArH5VQs9Ec/3BbNYw7y/csPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 469, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100aad4e2b69a9f378dae7873b40f7c15cb4565fcc8cbc0ec55b0bd3fe9d8626b2c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048a858226155e34dbb7e5dac7f13127c81c6ce8c9d891918c67c8738d7e4b46e96c1386e84c612312de53e9e4af34d9bd57f93d9a06b855b6e0b06ad4137ff57c", + "wx" : "008a858226155e34dbb7e5dac7f13127c81c6ce8c9d891918c67c8738d7e4b46e9", + "wy" : "6c1386e84c612312de53e9e4af34d9bd57f93d9a06b855b6e0b06ad4137ff57c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048a858226155e34dbb7e5dac7f13127c81c6ce8c9d891918c67c8738d7e4b46e96c1386e84c612312de53e9e4af34d9bd57f93d9a06b855b6e0b06ad4137ff57c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEioWCJhVeNNu35drH8TEnyBxs6MnYkZGM\nZ8hzjX5LRulsE4boTGEjEt5T6eSvNNm9V/k9mga4VbbgsGrUE3/1fA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 470, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022073fec4995e9d3140bc07ff041506dc7313e95389fb599d22f24039392a4014d3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04aec0be729b02f266c542d139a3e04110c933e8eca1008e8dba38d75e7f8fab532cd688d924b456848bd5c651444c67a9399fdfb5b5b9693162c1728bfadc1046", + "wx" : "00aec0be729b02f266c542d139a3e04110c933e8eca1008e8dba38d75e7f8fab53", + "wy" : "2cd688d924b456848bd5c651444c67a9399fdfb5b5b9693162c1728bfadc1046" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004aec0be729b02f266c542d139a3e04110c933e8eca1008e8dba38d75e7f8fab532cd688d924b456848bd5c651444c67a9399fdfb5b5b9693162c1728bfadc1046", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAErsC+cpsC8mbFQtE5o+BBEMkz6OyhAI6N\nujjXXn+Pq1Ms1ojZJLRWhIvVxlFETGepOZ/ftbW5aTFiwXKL+twQRg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 471, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100ec4995e9d3140bc07ff041506dc73a73dc25f4257a911e310e38744b482a5a01", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0401ed4b5f941f443b31a7e2583ea165551d1815b54740deb12e9fdeff32e2306184385ca448cc5dd71139bda3ab42d0b6e44d719e52fff64d971876efa9109fb2", + "wx" : "01ed4b5f941f443b31a7e2583ea165551d1815b54740deb12e9fdeff32e23061", + "wy" : "0084385ca448cc5dd71139bda3ab42d0b6e44d719e52fff64d971876efa9109fb2" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000401ed4b5f941f443b31a7e2583ea165551d1815b54740deb12e9fdeff32e2306184385ca448cc5dd71139bda3ab42d0b6e44d719e52fff64d971876efa9109fb2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAe1LX5QfRDsxp+JYPqFlVR0YFbVHQN6x\nLp/e/zLiMGGEOFykSMxd1xE5vaOrQtC25E1xnlL/9k2XGHbvqRCfsg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 472, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100d8932bd3a6281780ffe082a0db8e74e8fd9d0b6445d99c265c9e8a09c01e72c1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0459c427cb6525eab511a06e03e00cf2aab4abc587c2601534338a50bc25701a703e4eb388b453cbaea594d6b5c14a519ac3fda770c53580beefc68f09200d55ff", + "wx" : "59c427cb6525eab511a06e03e00cf2aab4abc587c2601534338a50bc25701a70", + "wy" : "3e4eb388b453cbaea594d6b5c14a519ac3fda770c53580beefc68f09200d55ff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000459c427cb6525eab511a06e03e00cf2aab4abc587c2601534338a50bc25701a703e4eb388b453cbaea594d6b5c14a519ac3fda770c53580beefc68f09200d55ff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEWcQny2Ul6rURoG4D4AzyqrSrxYfCYBU0\nM4pQvCVwGnA+TrOItFPLrqWU1rXBSlGaw/2ncMU1gL7vxo8JIA1V/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 473, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02205e9d3140bc07ff041506dc73a75086a3ba176f06c2b6e37363e2ce1c141f3c27", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0404acbbcd23cf2ec819fd297ab2cb5407ede6319518651a391e941cc8003568331206dd00df23bc8ce0b85a018c4b34e9c3b41b4ef59c71492fa62d134772f97e", + "wx" : "04acbbcd23cf2ec819fd297ab2cb5407ede6319518651a391e941cc800356833", + "wy" : "1206dd00df23bc8ce0b85a018c4b34e9c3b41b4ef59c71492fa62d134772f97e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000404acbbcd23cf2ec819fd297ab2cb5407ede6319518651a391e941cc8003568331206dd00df23bc8ce0b85a018c4b34e9c3b41b4ef59c71492fa62d134772f97e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEBKy7zSPPLsgZ/Sl6sstUB+3mMZUYZRo5\nHpQcyAA1aDMSBt0A3yO8jOC4WgGMSzTpw7QbTvWccUkvpi0TR3L5fg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 474, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100fd6dc71a71f1d50d1bbd976af4357be4dd2fe850707c431fd376e53d176c6b62", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ccacbc626fd6ea31175815cff958ca1637323877d3bdf09896b527bf4e255e8571f8a27e6309bd9b9b15d78d5270012ad2ed15a7fffe024fc0eca63fb6ac2f8d", + "wx" : "00ccacbc626fd6ea31175815cff958ca1637323877d3bdf09896b527bf4e255e85", + "wy" : "71f8a27e6309bd9b9b15d78d5270012ad2ed15a7fffe024fc0eca63fb6ac2f8d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ccacbc626fd6ea31175815cff958ca1637323877d3bdf09896b527bf4e255e8571f8a27e6309bd9b9b15d78d5270012ad2ed15a7fffe024fc0eca63fb6ac2f8d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEzKy8Ym/W6jEXWBXP+VjKFjcyOHfTvfCY\nlrUnv04lXoVx+KJ+Ywm9m5sV141ScAEq0u0Vp//+Ak/A7KY/tqwvjQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 475, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02207ee75ad2a5801c54722eb7d95ba67febcfc399b956b7b682fe89638de3690bf1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ccc30b65cad3dd1d793b6db80f57b2e1237973e4264c3d9bbc2551ec68a0b7be75ff6d1f4f535a131aa573f6e2d6912c397154933750417d28e46524392592de", + "wx" : "00ccc30b65cad3dd1d793b6db80f57b2e1237973e4264c3d9bbc2551ec68a0b7be", + "wy" : "75ff6d1f4f535a131aa573f6e2d6912c397154933750417d28e46524392592de" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ccc30b65cad3dd1d793b6db80f57b2e1237973e4264c3d9bbc2551ec68a0b7be75ff6d1f4f535a131aa573f6e2d6912c397154933750417d28e46524392592de", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEzMMLZcrT3R15O224D1ey4SN5c+QmTD2b\nvCVR7Gigt751/20fT1NaExqlc/bi1pEsOXFUkzdQQX0o5GUkOSWS3g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 476, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100f533776f11c47ed0a7b5e25ace7a3b921866733c7454b2c678b8943dfb4cf232", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04cc9349aca0cbd0b2df0deecd88ed39e6d8c7c3d7b422fd5d92431baf7225fcc0ed494be698d6f3850be277c268792400f396025cfa95cf56018bcbc243e512eb", + "wx" : "00cc9349aca0cbd0b2df0deecd88ed39e6d8c7c3d7b422fd5d92431baf7225fcc0", + "wy" : "00ed494be698d6f3850be277c268792400f396025cfa95cf56018bcbc243e512eb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004cc9349aca0cbd0b2df0deecd88ed39e6d8c7c3d7b422fd5d92431baf7225fcc0ed494be698d6f3850be277c268792400f396025cfa95cf56018bcbc243e512eb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEzJNJrKDL0LLfDe7NiO055tjHw9e0Iv1d\nkkMbr3Il/MDtSUvmmNbzhQvid8JoeSQA85YCXPqVz1YBi8vCQ+US6w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 477, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100e8dbffee01807d75f9aa52c295e15b15f138439e7a195a40709b1abf511dbc6a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04000e7c30d2f259f7c13f194320e43905d0ead7277e283e8918437c10f9d052b02b39b66dbba2b1cf5dac1b41d2dec6f1fb08bdd14d420d703986f63aedeb5c47", + "wx" : "0e7c30d2f259f7c13f194320e43905d0ead7277e283e8918437c10f9d052b0", + "wy" : "2b39b66dbba2b1cf5dac1b41d2dec6f1fb08bdd14d420d703986f63aedeb5c47" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004000e7c30d2f259f7c13f194320e43905d0ead7277e283e8918437c10f9d052b02b39b66dbba2b1cf5dac1b41d2dec6f1fb08bdd14d420d703986f63aedeb5c47", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAA58MNLyWffBPxlDIOQ5BdDq1yd+KD6J\nGEN8EPnQUrArObZtu6Kxz12sG0HS3sbx+wi90U1CDXA5hvY67etcRw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 478, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100ca01552b58d67a13468d6bc6086329df8f44cc938884fcf15c516b02a7a7b5f6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048fa298c00ac93f7c36892c5299005a0f6843f9cf0669fdbb7d6d81e0341803ed4cab33cc2821b2da849f90ef20dc1eb896fc67161440b3c52c0b1e88627e508c", + "wx" : "008fa298c00ac93f7c36892c5299005a0f6843f9cf0669fdbb7d6d81e0341803ed", + "wy" : "4cab33cc2821b2da849f90ef20dc1eb896fc67161440b3c52c0b1e88627e508c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048fa298c00ac93f7c36892c5299005a0f6843f9cf0669fdbb7d6d81e0341803ed4cab33cc2821b2da849f90ef20dc1eb896fc67161440b3c52c0b1e88627e508c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEj6KYwArJP3w2iSxSmQBaD2hD+c8Gaf27\nfW2B4DQYA+1MqzPMKCGy2oSfkO8g3B64lvxnFhRAs8UsCx6IYn5QjA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 479, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0221009402aa56b1acf4268d1ad78c10c653c063dabc4061c159a6f8d077787f192aab", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046fbf608a83e37ec26b37da033e069816680b770ba766fb8c44fce003960562f1045f268ccc5e0949213f7f2f1fa57cfead04625ec3ccfc9c333596e487b2056f", + "wx" : "6fbf608a83e37ec26b37da033e069816680b770ba766fb8c44fce003960562f1", + "wy" : "045f268ccc5e0949213f7f2f1fa57cfead04625ec3ccfc9c333596e487b2056f" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046fbf608a83e37ec26b37da033e069816680b770ba766fb8c44fce003960562f1045f268ccc5e0949213f7f2f1fa57cfead04625ec3ccfc9c333596e487b2056f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEb79gioPjfsJrN9oDPgaYFmgLdwunZvuM\nRPzgA5YFYvEEXyaMzF4JSSE/fy8fpXz+rQRiXsPM/JwzNZbkh7IFbw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 480, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02205e03ff820a836e39d3a8435219297da13870abed3afdb65c954f83ee568a9f60", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04c4dd547ad750174179bac8b8ce27481c58b81347776220a1b52ada13d65c8124f9c2ef3b5b4957cf69d3a139891682363c040610f200f4c318e59aa68f298af0", + "wx" : "00c4dd547ad750174179bac8b8ce27481c58b81347776220a1b52ada13d65c8124", + "wy" : "00f9c2ef3b5b4957cf69d3a139891682363c040610f200f4c318e59aa68f298af0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004c4dd547ad750174179bac8b8ce27481c58b81347776220a1b52ada13d65c8124f9c2ef3b5b4957cf69d3a139891682363c040610f200f4c318e59aa68f298af0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAExN1UetdQF0F5usi4zidIHFi4E0d3YiCh\ntSraE9ZcgST5wu87W0lXz2nToTmJFoI2PAQGEPIA9MMY5ZqmjymK8A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 481, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220556a715b4d4f9bc6d73c39da07be0ae5a2b2fe6465e0762ad85e9ff4ec313596", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0400055d79fb26286bb6289a7983a2b23bf5c30cc3d70363b559adf5548af991f8cae8b1b0ace32fd74a86ee1a671cc36c052a4796eae323be32e02ce9a0fb6227", + "wx" : "055d79fb26286bb6289a7983a2b23bf5c30cc3d70363b559adf5548af991f8", + "wy" : "00cae8b1b0ace32fd74a86ee1a671cc36c052a4796eae323be32e02ce9a0fb6227" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000400055d79fb26286bb6289a7983a2b23bf5c30cc3d70363b559adf5548af991f8cae8b1b0ace32fd74a86ee1a671cc36c052a4796eae323be32e02ce9a0fb6227", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAAVdefsmKGu2KJp5g6KyO/XDDMPXA2O1\nWa31VIr5kfjK6LGwrOMv10qG7hpnHMNsBSpHlurjI74y4CzpoPtiJw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 482, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100d55555555555555555555555555555547c74934474db157d2a8c3f088aced62a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040db51c74d34e41baba67c13a60af404ee82d8f1b0386b09696ee1e6ea1327b86413886c4623fc222a6950c3c3a09f3fd867a566bfd345e06b09ec6c5c2e4a192", + "wx" : "0db51c74d34e41baba67c13a60af404ee82d8f1b0386b09696ee1e6ea1327b86", + "wy" : "413886c4623fc222a6950c3c3a09f3fd867a566bfd345e06b09ec6c5c2e4a192" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040db51c74d34e41baba67c13a60af404ee82d8f1b0386b09696ee1e6ea1327b86413886c4623fc222a6950c3c3a09f3fd867a566bfd345e06b09ec6c5c2e4a192", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEDbUcdNNOQbq6Z8E6YK9ATugtjxsDhrCW\nlu4ebqEye4ZBOIbEYj/CIqaVDDw6CfP9hnpWa/00XgawnsbFwuShkg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 483, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100c1777c8853938e536213c02464a936000ba1e21c0fc62075d46c624e23b52f31", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04bc2f7bc74cb3bc7e797b06cc3e649bf3407d1a55b4eaaddd28d3dcfaff2c3737a23bb364e16ac79398c013ce29a22e762c0d6067aaefda958474aad194a92e8a", + "wx" : "00bc2f7bc74cb3bc7e797b06cc3e649bf3407d1a55b4eaaddd28d3dcfaff2c3737", + "wy" : "00a23bb364e16ac79398c013ce29a22e762c0d6067aaefda958474aad194a92e8a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004bc2f7bc74cb3bc7e797b06cc3e649bf3407d1a55b4eaaddd28d3dcfaff2c3737a23bb364e16ac79398c013ce29a22e762c0d6067aaefda958474aad194a92e8a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEvC97x0yzvH55ewbMPmSb80B9GlW06q3d\nKNPc+v8sNzeiO7Nk4WrHk5jAE84poi52LA1gZ6rv2pWEdKrRlKkuig==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 484, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022030bbb794db588363b40679f6c182a50d3ce9679acdd3ffbe36d7813dacbdc818", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d7edc7c645efff6af8821aea5b7f969f56ef6e615862b08fba3eaf0111c06f67e47fd0da61682adcc405f329148bf1c35b89cb5ec5a9ed0d98a410e261a6b41a", + "wx" : "00d7edc7c645efff6af8821aea5b7f969f56ef6e615862b08fba3eaf0111c06f67", + "wy" : "00e47fd0da61682adcc405f329148bf1c35b89cb5ec5a9ed0d98a410e261a6b41a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d7edc7c645efff6af8821aea5b7f969f56ef6e615862b08fba3eaf0111c06f67e47fd0da61682adcc405f329148bf1c35b89cb5ec5a9ed0d98a410e261a6b41a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE1+3HxkXv/2r4ghrqW3+Wn1bvbmFYYrCP\nuj6vARHAb2fkf9DaYWgq3MQF8ykUi/HDW4nLXsWp7Q2YpBDiYaa0Gg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 485, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202c37fd995622c4fb7fffffffffffffffc7cee745110cb45ab558ed7c90c15a2f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046bfd7ad01b5dcfb04de464083d3ca7ef5054506111df92ef02ff7690d9a6ec9306c469fe4c5a1e04f114e193b4bb197de2c8e35089037e5a20275bcf67d9bf73", + "wx" : "6bfd7ad01b5dcfb04de464083d3ca7ef5054506111df92ef02ff7690d9a6ec93", + "wy" : "06c469fe4c5a1e04f114e193b4bb197de2c8e35089037e5a20275bcf67d9bf73" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046bfd7ad01b5dcfb04de464083d3ca7ef5054506111df92ef02ff7690d9a6ec9306c469fe4c5a1e04f114e193b4bb197de2c8e35089037e5a20275bcf67d9bf73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEa/160Btdz7BN5GQIPTyn71BUUGER35Lv\nAv92kNmm7JMGxGn+TFoeBPEU4ZO0uxl94sjjUIkDflogJ1vPZ9m/cw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 486, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02207fd995622c4fb7ffffffffffffffffff5d883ffab5b32652ccdcaa290fccb97d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "048a9076c923021d5c5ef85894176ebb5c3a74aba75b3944c96f17debc2173ba99e5601d115bf08d37ae115c4d186bc21127bbfb21d0629bde27a16e9ed721b740", + "wx" : "008a9076c923021d5c5ef85894176ebb5c3a74aba75b3944c96f17debc2173ba99", + "wy" : "00e5601d115bf08d37ae115c4d186bc21127bbfb21d0629bde27a16e9ed721b740" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200048a9076c923021d5c5ef85894176ebb5c3a74aba75b3944c96f17debc2173ba99e5601d115bf08d37ae115c4d186bc21127bbfb21d0629bde27a16e9ed721b740", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEipB2ySMCHVxe+FiUF267XDp0q6dbOUTJ\nbxfevCFzupnlYB0RW/CNN64RXE0Ya8IRJ7v7IdBim94noW6e1yG3QA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 487, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100ffb32ac4589f6ffffffffffffffffffebb107ff56b664ca599b954521f9972fa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "040fec6a85e077ef4240b98c62ab3b93e2cebcad0ae9617f7b0471504db1f45a65245a5fd0ad7a6d854125ed76d4787f77cc1983eca8c6ba8c019523a088c4d0f3", + "wx" : "0fec6a85e077ef4240b98c62ab3b93e2cebcad0ae9617f7b0471504db1f45a65", + "wy" : "245a5fd0ad7a6d854125ed76d4787f77cc1983eca8c6ba8c019523a088c4d0f3" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200040fec6a85e077ef4240b98c62ab3b93e2cebcad0ae9617f7b0471504db1f45a65245a5fd0ad7a6d854125ed76d4787f77cc1983eca8c6ba8c019523a088c4d0f3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAED+xqheB370JAuYxiqzuT4s68rQrpYX97\nBHFQTbH0WmUkWl/QrXpthUEl7XbUeH93zBmD7KjGuowBlSOgiMTQ8w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 488, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02205622c4fb7fffffffffffffffffffffff928a8f1c7ac7bec1808b9f61c01ec327", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d3ab94d8704fb51774dcc3838ad9703071e0851de9b2d6ca74ccd79b855581914e4979b67f377419e5a9d4f03012b7e75656556f23756d4dbee145834c8279ef", + "wx" : "00d3ab94d8704fb51774dcc3838ad9703071e0851de9b2d6ca74ccd79b85558191", + "wy" : "4e4979b67f377419e5a9d4f03012b7e75656556f23756d4dbee145834c8279ef" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d3ab94d8704fb51774dcc3838ad9703071e0851de9b2d6ca74ccd79b855581914e4979b67f377419e5a9d4f03012b7e75656556f23756d4dbee145834c8279ef", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE06uU2HBPtRd03MODitlwMHHghR3pstbK\ndMzXm4VVgZFOSXm2fzd0GeWp1PAwErfnVlZVbyN1bU2+4UWDTIJ57w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 489, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022044104104104104104104104104104103b87853fd3b7d3f8e175125b4382f25ed", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0449e13cd44c8b8350a5eaca2181bf96db120b768bde8800f379f43e9198333c75030ad9fb4b0b233bdc10ca0dc4c2134b18b691e46c7151e3573aa2b62891e69d", + "wx" : "49e13cd44c8b8350a5eaca2181bf96db120b768bde8800f379f43e9198333c75", + "wy" : "030ad9fb4b0b233bdc10ca0dc4c2134b18b691e46c7151e3573aa2b62891e69d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000449e13cd44c8b8350a5eaca2181bf96db120b768bde8800f379f43e9198333c75030ad9fb4b0b233bdc10ca0dc4c2134b18b691e46c7151e3573aa2b62891e69d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESeE81EyLg1Cl6sohgb+W2xILdoveiADz\nefQ+kZgzPHUDCtn7SwsjO9wQyg3EwhNLGLaR5GxxUeNXOqK2KJHmnQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 490, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202739ce739ce739ce739ce739ce739ce705560298d1f2f08dc419ac273a5b54d9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044574fd94ad03828588cb0bc2d434842ee093efe639015cc107d1ea3710f2112d1786d6ef1d411cbd1af5b5ee8845993e738fb64519b4329d04be21f7902a1c1d", + "wx" : "4574fd94ad03828588cb0bc2d434842ee093efe639015cc107d1ea3710f2112d", + "wy" : "1786d6ef1d411cbd1af5b5ee8845993e738fb64519b4329d04be21f7902a1c1d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044574fd94ad03828588cb0bc2d434842ee093efe639015cc107d1ea3710f2112d1786d6ef1d411cbd1af5b5ee8845993e738fb64519b4329d04be21f7902a1c1d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAERXT9lK0DgoWIywvC1DSELuCT7+Y5AVzB\nB9HqNxDyES0XhtbvHUEcvRr1te6IRZk+c4+2RRm0Mp0EviH3kCocHQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 491, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100b777777777777777777777777777777688e6a1fe808a97a348671222ff16b863", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04ee824d818768f13fa0eb908e396ea1c56b11774ce69d01e563aa36bb41d6371c990291ce2abc55bb6682d502ae0129e7c57e146e96d44757daaa1f94c93e0b17", + "wx" : "00ee824d818768f13fa0eb908e396ea1c56b11774ce69d01e563aa36bb41d6371c", + "wy" : "00990291ce2abc55bb6682d502ae0129e7c57e146e96d44757daaa1f94c93e0b17" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004ee824d818768f13fa0eb908e396ea1c56b11774ce69d01e563aa36bb41d6371c990291ce2abc55bb6682d502ae0129e7c57e146e96d44757daaa1f94c93e0b17", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE7oJNgYdo8T+g65COOW6hxWsRd0zmnQHl\nY6o2u0HWNxyZApHOKrxVu2aC1QKuASnnxX4UbpbUR1faqh+UyT4LFw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 492, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02206492492492492492492492492492492406dd3a19b8d5fb875235963c593bd2d3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "044825ee46b2d21564726a32a922f5e3f2da6098f780e1f15c6bf1640669c41fe7292c066a24f0f450c2603f1837210898f8e80fa384aaf077eb5c7e87c6b26976", + "wx" : "4825ee46b2d21564726a32a922f5e3f2da6098f780e1f15c6bf1640669c41fe7", + "wy" : "292c066a24f0f450c2603f1837210898f8e80fa384aaf077eb5c7e87c6b26976" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200044825ee46b2d21564726a32a922f5e3f2da6098f780e1f15c6bf1640669c41fe7292c066a24f0f450c2603f1837210898f8e80fa384aaf077eb5c7e87c6b26976", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESCXuRrLSFWRyajKpIvXj8tpgmPeA4fFc\na/FkBmnEH+cpLAZqJPD0UMJgPxg3IQiY+OgPo4Sq8HfrXH6HxrJpdg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 493, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100955555555555555555555555555555547c74934474db157d2a8c3f088aced62c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0441348e7ac18eb1f4852801467bb0a0e36209321a8af4b410fd06f070a81f5de603b5594f1a5a79d23089e49e3e379f2a6cb14f92301c6999e510b8c8dc37fb4b", + "wx" : "41348e7ac18eb1f4852801467bb0a0e36209321a8af4b410fd06f070a81f5de6", + "wy" : "03b5594f1a5a79d23089e49e3e379f2a6cb14f92301c6999e510b8c8dc37fb4b" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000441348e7ac18eb1f4852801467bb0a0e36209321a8af4b410fd06f070a81f5de603b5594f1a5a79d23089e49e3e379f2a6cb14f92301c6999e510b8c8dc37fb4b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQTSOesGOsfSFKAFGe7Cg42IJMhqK9LQQ\n/QbwcKgfXeYDtVlPGlp50jCJ5J4+N58qbLFPkjAcaZnlELjI3Df7Sw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 494, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc02202aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3e3a49a23a6d8abe95461f8445676b17", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04753c74e5a36e1a4b61be7787202c98e05841fea2b0392b6ab69ee2e8a747e2b618971da1c85825c1d8141886115d27cb2add86545e6971bb835a2f452cde1e52", + "wx" : "753c74e5a36e1a4b61be7787202c98e05841fea2b0392b6ab69ee2e8a747e2b6", + "wy" : "18971da1c85825c1d8141886115d27cb2add86545e6971bb835a2f452cde1e52" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004753c74e5a36e1a4b61be7787202c98e05841fea2b0392b6ab69ee2e8a747e2b618971da1c85825c1d8141886115d27cb2add86545e6971bb835a2f452cde1e52", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEdTx05aNuGkthvneHICyY4FhB/qKwOStq\ntp7i6KdH4rYYlx2hyFglwdgUGIYRXSfLKt2GVF5pcbuDWi9FLN4eUg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 495, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc022100bffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364143", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0449c0254724576b0949827ce46240d90cb4075cd1978a416495a455f06a895504df7d64c35853353bd4d905da6adb88f26e62a5f20b3cd6382adf2c5a42d85053", + "wx" : "49c0254724576b0949827ce46240d90cb4075cd1978a416495a455f06a895504", + "wy" : "00df7d64c35853353bd4d905da6adb88f26e62a5f20b3cd6382adf2c5a42d85053" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000449c0254724576b0949827ce46240d90cb4075cd1978a416495a455f06a895504df7d64c35853353bd4d905da6adb88f26e62a5f20b3cd6382adf2c5a42d85053", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEScAlRyRXawlJgnzkYkDZDLQHXNGXikFk\nlaRV8GqJVQTffWTDWFM1O9TZBdpq24jybmKl8gs81jgq3yxaQthQUw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 496, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0220185ddbca6dac41b1da033cfb60c152869e74b3cd66e9ffdf1b6bc09ed65ee40c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b05e98e84e2c19743c1dcf4e0ddf0bb1f32854033de63fcf3e605fbb2ed94cb1871d7415d5f6c57c840678f7e1a1c1e323519a4647fb3f6f52abb4647b9b6d70", + "wx" : "00b05e98e84e2c19743c1dcf4e0ddf0bb1f32854033de63fcf3e605fbb2ed94cb1", + "wy" : "00871d7415d5f6c57c840678f7e1a1c1e323519a4647fb3f6f52abb4647b9b6d70" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b05e98e84e2c19743c1dcf4e0ddf0bb1f32854033de63fcf3e605fbb2ed94cb1871d7415d5f6c57c840678f7e1a1c1e323519a4647fb3f6f52abb4647b9b6d70", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEsF6Y6E4sGXQ8Hc9ODd8LsfMoVAM95j/P\nPmBfuy7ZTLGHHXQV1fbFfIQGePfhocHjI1GaRkf7P29Sq7Rke5ttcA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 497, + "comment" : "point duplication during verification", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022032b0d10d8d0e04bc8d4d064d270699e87cffc9b49c5c20730e1c26f6105ddcda02206fd848306e968e3ac1f6e443577c47a3c20bf0d01a5dc39c78c2c69d681850f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04b05e98e84e2c19743c1dcf4e0ddf0bb1f32854033de63fcf3e605fbb2ed94cb178e28bea2a093a837bf987081e5e3e1cdcae65b9b804c090ad544b9a84648ebf", + "wx" : "00b05e98e84e2c19743c1dcf4e0ddf0bb1f32854033de63fcf3e605fbb2ed94cb1", + "wy" : "78e28bea2a093a837bf987081e5e3e1cdcae65b9b804c090ad544b9a84648ebf" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004b05e98e84e2c19743c1dcf4e0ddf0bb1f32854033de63fcf3e605fbb2ed94cb178e28bea2a093a837bf987081e5e3e1cdcae65b9b804c090ad544b9a84648ebf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEsF6Y6E4sGXQ8Hc9ODd8LsfMoVAM95j/P\nPmBfuy7ZTLF44ovqKgk6g3v5hwgeXj4c3K5lubgEwJCtVEuahGSOvw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 498, + "comment" : "duplication bug", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022032b0d10d8d0e04bc8d4d064d270699e87cffc9b49c5c20730e1c26f6105ddcda02206fd848306e968e3ac1f6e443577c47a3c20bf0d01a5dc39c78c2c69d681850f4", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04a49f9ebc082c064d61c0eab5f8bf23207b06e3a689dfc4fa2896ed114d1a88ab55783a6baf9401977d117ccb748c0d5c24a5d3bd2133d62c74de2be7cc7d9d40", + "wx" : "00a49f9ebc082c064d61c0eab5f8bf23207b06e3a689dfc4fa2896ed114d1a88ab", + "wy" : "55783a6baf9401977d117ccb748c0d5c24a5d3bd2133d62c74de2be7cc7d9d40" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004a49f9ebc082c064d61c0eab5f8bf23207b06e3a689dfc4fa2896ed114d1a88ab55783a6baf9401977d117ccb748c0d5c24a5d3bd2133d62c74de2be7cc7d9d40", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEpJ+evAgsBk1hwOq1+L8jIHsG46aJ38T6\nKJbtEU0aiKtVeDprr5QBl30RfMt0jA1cJKXTvSEz1ix03ivnzH2dQA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 499, + "comment" : "comparison with point at infinity ", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0022033333333333333333333333333333332f222f8faefdb533f265d461c29a47373", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f9567a431b716388428510393b37feefd3afcfc6dc3881f623c0a0995e461ec3fba2f910ced19f8e789b158390a295e636c588c622d54f8feffbd2852e2911a9", + "wx" : "00f9567a431b716388428510393b37feefd3afcfc6dc3881f623c0a0995e461ec3", + "wy" : "00fba2f910ced19f8e789b158390a295e636c588c622d54f8feffbd2852e2911a9" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f9567a431b716388428510393b37feefd3afcfc6dc3881f623c0a0995e461ec3fba2f910ced19f8e789b158390a295e636c588c622d54f8feffbd2852e2911a9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE+VZ6QxtxY4hChRA5Ozf+79Ovz8bcOIH2\nI8CgmV5GHsP7ovkQztGfjnibFYOQopXmNsWIxiLVT4/v+9KFLikRqQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 500, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0426095ef93b10bf50fe283f4c99136fb81fa297814f09977e8e38a3bfb837f61baf8d7cfc46c1928624f201ed14a70701bc5531bff4e2e578d5c92dabddbc7580", + "wx" : "26095ef93b10bf50fe283f4c99136fb81fa297814f09977e8e38a3bfb837f61b", + "wy" : "00af8d7cfc46c1928624f201ed14a70701bc5531bff4e2e578d5c92dabddbc7580" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000426095ef93b10bf50fe283f4c99136fb81fa297814f09977e8e38a3bfb837f61baf8d7cfc46c1928624f201ed14a70701bc5531bff4e2e578d5c92dabddbc7580", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJgle+TsQv1D+KD9MmRNvuB+il4FPCZd+\njjijv7g39huvjXz8RsGShiTyAe0UpwcBvFUxv/Ti5XjVyS2r3bx1gA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 501, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022100b6db6db6db6db6db6db6db6db6db6db5f30f30127d33e02aad96438927022e9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "047a4b58ee76d461a1c3cde68400a0bbeeab346ee69315bed63f1700c66cf5e6cca642ae4078bb6bbbb76028977882e9c8374f267a2ced131029ae89560ce29825", + "wx" : "7a4b58ee76d461a1c3cde68400a0bbeeab346ee69315bed63f1700c66cf5e6cc", + "wy" : "00a642ae4078bb6bbbb76028977882e9c8374f267a2ced131029ae89560ce29825" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200047a4b58ee76d461a1c3cde68400a0bbeeab346ee69315bed63f1700c66cf5e6cca642ae4078bb6bbbb76028977882e9c8374f267a2ced131029ae89560ce29825", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEektY7nbUYaHDzeaEAKC77qs0buaTFb7W\nPxcAxmz15symQq5AeLtru7dgKJd4gunIN08meiztExAprolWDOKYJQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 502, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee502210099999999999999999999999999999998d668eaf0cf91f9bd7317d2547ced5a5a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04f2a111eb24c9d280d9a66e4ff18681d222dd6a1828ebc4528f2bebe3e25228a1a0699bcec507fd0ec83da541a5a6143e2e68e4af72fcdcc8a2aea2b17478cc8a", + "wx" : "00f2a111eb24c9d280d9a66e4ff18681d222dd6a1828ebc4528f2bebe3e25228a1", + "wy" : "00a0699bcec507fd0ec83da541a5a6143e2e68e4af72fcdcc8a2aea2b17478cc8a" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004f2a111eb24c9d280d9a66e4ff18681d222dd6a1828ebc4528f2bebe3e25228a1a0699bcec507fd0ec83da541a5a6143e2e68e4af72fcdcc8a2aea2b17478cc8a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE8qER6yTJ0oDZpm5P8YaB0iLdahgo68RS\njyvr4+JSKKGgaZvOxQf9Dsg9pUGlphQ+Lmjkr3L83MiirqKxdHjMig==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 503, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022066666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04e50054b3e4a4d1fef988e5a5e830155abc293fea3598af4c5ddaa10acd111274eb710d1834568cb379a1d1f3d691a8c0dc19f901fe3225c2b6691df5ef5333fe", + "wx" : "00e50054b3e4a4d1fef988e5a5e830155abc293fea3598af4c5ddaa10acd111274", + "wy" : "00eb710d1834568cb379a1d1f3d691a8c0dc19f901fe3225c2b6691df5ef5333fe" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004e50054b3e4a4d1fef988e5a5e830155abc293fea3598af4c5ddaa10acd111274eb710d1834568cb379a1d1f3d691a8c0dc19f901fe3225c2b6691df5ef5333fe", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE5QBUs+Sk0f75iOWl6DAVWrwpP+o1mK9M\nXdqhCs0REnTrcQ0YNFaMs3mh0fPWkajA3Bn5Af4yJcK2aR3171Mz/g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 504, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5022049249249249249249249249249249248c79facd43214c011123c1b03a93412a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04edc17cd4ca6f9988fda5af4042e3f9eb42d0f7b6a1c0156e1a2af566b78103548a5d357777b306e96405f12e2617c1b29e8d574e5f6d66d1bc8ff7ea7c4b683c", + "wx" : "00edc17cd4ca6f9988fda5af4042e3f9eb42d0f7b6a1c0156e1a2af566b7810354", + "wy" : "008a5d357777b306e96405f12e2617c1b29e8d574e5f6d66d1bc8ff7ea7c4b683c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004edc17cd4ca6f9988fda5af4042e3f9eb42d0f7b6a1c0156e1a2af566b78103548a5d357777b306e96405f12e2617c1b29e8d574e5f6d66d1bc8ff7ea7c4b683c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE7cF81MpvmYj9pa9AQuP560LQ97ahwBVu\nGir1ZreBA1SKXTV3d7MG6WQF8S4mF8Gyno1XTl9tZtG8j/fqfEtoPA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 505, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee502200eb10e5ab95f2f275348d82ad2e4d7949c8193800d8c9c75df58e343f0ebba7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046d267c10d2315b42dbaf34c97c3c0d331fabacaf6021df4dc85b3e9e63dc0798ed154b11fa3a5ed952c14d8a2dd242de2b6cce3c22df42cd97de30054a19555e", + "wx" : "6d267c10d2315b42dbaf34c97c3c0d331fabacaf6021df4dc85b3e9e63dc0798", + "wy" : "00ed154b11fa3a5ed952c14d8a2dd242de2b6cce3c22df42cd97de30054a19555e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046d267c10d2315b42dbaf34c97c3c0d331fabacaf6021df4dc85b3e9e63dc0798ed154b11fa3a5ed952c14d8a2dd242de2b6cce3c22df42cd97de30054a19555e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbSZ8ENIxW0LbrzTJfDwNMx+rrK9gId9N\nyFs+nmPcB5jtFUsR+jpe2VLBTYot0kLeK2zOPCLfQs2X3jAFShlVXg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 506, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022055555555555555555555555555555554e8e4f44ce51835693ff0ca2ef01215c0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04c24bf7a984c96ece10077a9def38cbd0d898abd555f1668e06c27cabc00f6f679f69b238e1f95e99e5b558e0036273ebd6c36d12b4515348b85a21f6283f5016", + "wx" : "00c24bf7a984c96ece10077a9def38cbd0d898abd555f1668e06c27cabc00f6f67", + "wy" : "009f69b238e1f95e99e5b558e0036273ebd6c36d12b4515348b85a21f6283f5016" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004c24bf7a984c96ece10077a9def38cbd0d898abd555f1668e06c27cabc00f6f679f69b238e1f95e99e5b558e0036273ebd6c36d12b4515348b85a21f6283f5016", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEwkv3qYTJbs4QB3qd7zjL0NiYq9VV8WaO\nBsJ8q8APb2efabI44flemeW1WOADYnPr1sNtErRRU0i4WiH2KD9QFg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 507, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022100b6db6db6db6db6db6db6db6db6db6db5f30f30127d33e02aad96438927022e9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "041cd26d668807c815ed3f532c1db81ac473fb368f0f7ef1aff2592ea6fa6c4624a229b9ab5746cfbc47280c019a4248545354ca20880ff41cac2e252bc9b49704", + "wx" : "1cd26d668807c815ed3f532c1db81ac473fb368f0f7ef1aff2592ea6fa6c4624", + "wy" : "00a229b9ab5746cfbc47280c019a4248545354ca20880ff41cac2e252bc9b49704" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200041cd26d668807c815ed3f532c1db81ac473fb368f0f7ef1aff2592ea6fa6c4624a229b9ab5746cfbc47280c019a4248545354ca20880ff41cac2e252bc9b49704", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEHNJtZogHyBXtP1MsHbgaxHP7No8PfvGv\n8lkupvpsRiSiKbmrV0bPvEcoDAGaQkhUU1TKIIgP9BysLiUrybSXBA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 508, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802210099999999999999999999999999999998d668eaf0cf91f9bd7317d2547ced5a5a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04fc780777a3289af663fa02b1c262a8373b84614e659c1ab46942f1e058926ff82196c6bcae0b2798298d463be5c87924343d7f103a27131e0c7f4d60d2b5da8c", + "wx" : "00fc780777a3289af663fa02b1c262a8373b84614e659c1ab46942f1e058926ff8", + "wy" : "2196c6bcae0b2798298d463be5c87924343d7f103a27131e0c7f4d60d2b5da8c" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004fc780777a3289af663fa02b1c262a8373b84614e659c1ab46942f1e058926ff82196c6bcae0b2798298d463be5c87924343d7f103a27131e0c7f4d60d2b5da8c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE/HgHd6MomvZj+gKxwmKoNzuEYU5lnBq0\naULx4FiSb/ghlsa8rgsnmCmNRjvlyHkkND1/EDonEx4Mf01g0rXajA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 509, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022066666666666666666666666666666665e445f1f5dfb6a67e4cba8c385348e6e7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "045e25e2ee8af5ef8a3e0908341f9884501fb58a2fd234b1db6f22d561025524f4491d97a7793c9d9a1f35bb35f12121b9dbe075d8501cbd4db6697e3e0ad98bc0", + "wx" : "5e25e2ee8af5ef8a3e0908341f9884501fb58a2fd234b1db6f22d561025524f4", + "wy" : "491d97a7793c9d9a1f35bb35f12121b9dbe075d8501cbd4db6697e3e0ad98bc0" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200045e25e2ee8af5ef8a3e0908341f9884501fb58a2fd234b1db6f22d561025524f4491d97a7793c9d9a1f35bb35f12121b9dbe075d8501cbd4db6697e3e0ad98bc0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEXiXi7or174o+CQg0H5iEUB+1ii/SNLHb\nbyLVYQJVJPRJHZeneTydmh81uzXxISG52+B12FAcvU22aX4+CtmLwA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 510, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798022049249249249249249249249249249248c79facd43214c011123c1b03a93412a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "043ddf2920607df596da90123ea5674958054c8ed7758661b813f1aa30f19778b0707243e1a7bcc264b54289832e950c27563856241b79c243d0fc54f7ad24bc25", + "wx" : "3ddf2920607df596da90123ea5674958054c8ed7758661b813f1aa30f19778b0", + "wy" : "707243e1a7bcc264b54289832e950c27563856241b79c243d0fc54f7ad24bc25" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200043ddf2920607df596da90123ea5674958054c8ed7758661b813f1aa30f19778b0707243e1a7bcc264b54289832e950c27563856241b79c243d0fc54f7ad24bc25", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEPd8pIGB99ZbakBI+pWdJWAVMjtd1hmG4\nE/GqMPGXeLBwckPhp7zCZLVCiYMulQwnVjhWJBt5wkPQ/FT3rSS8JQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 511, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3044022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802200eb10e5ab95f2f275348d82ad2e4d7949c8193800d8c9c75df58e343f0ebba7b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + "wx" : "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "wy" : "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeb5mfvncu6xVoGKVzocLBwKb/NstzijZ\nWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 512, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022043f800fbeaf9238c58af795bcdad04bc49cd850c394d3382953356b02321028102202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + }, + { + "tcId" : 513, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100bc07ff041506dc73a75086a43252fb4270e157da75fb6cb92a9f07dcad153ec002202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777", + "wx" : "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "wy" : "00b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b7c52588d95c3b9aa25b0403f1eef75702e84bb7597aabe663b82f6f04ef2777", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeb5mfvncu6xVoGKVzocLBwKb/NstzijZ\nWfKBWxb4F5i3xSWI2Vw7mqJbBAPx7vdXAuhLt1l6q+ZjuC9vBO8ndw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 514, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022043f800fbeaf9238c58af795bcdad04bc49cd850c394d3382953356b02321028102202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + }, + { + "tcId" : 515, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100bc07ff041506dc73a75086a43252fb4270e157da75fb6cb92a9f07dcad153ec002202492492492492492492492492492492463cfd66a190a6008891e0d81d49a0952", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff00000001060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1", + "wx" : "6e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff", + "wy" : "01060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff00000001060492d5a5673e0f25d8d50fb7e58c49d86d46d4216955e0aa3d40e1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEboI1VUUpFAmRgsaywdbwtdKNUMzQBa8s\n4bulQapAyv8AAAABBgSS1aVnPg8l2NUPt+WMSdhtRtQhaVXgqj1A4Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 516, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402202b9c9f85596fed708b3af80393b27edfd0b5ae2f0074270a56362f5f9f62b4e102202fae837503ba2c1d4c945e0913949ef094ce0b8086359bbb5dba4a12707c5600", + "result" : "valid" + }, + { + "tcId" : 517, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402205cd765209021d8c1a8aef4ff61d6fa6e7993bf9fea0b93609eea130de536fccc02204f10c7989587fe3019e36d85aa024bf20db6737c4f28900c1c9662f2782143e0", + "result" : "valid" + }, + { + "tcId" : 518, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502204c1a59b1e578d76f1595e13b557057559f26ab559ec1df3f45ec98b90fa526ce022100c6872f094bdb3f82e31f93ad65357e2daafe66f304af197089ef0dc94ff90624", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40cafffffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e", + "wx" : "6e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40caff", + "wy" : "00fffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046e823555452914099182c6b2c1d6f0b5d28d50ccd005af2ce1bba541aa40cafffffffffef9fb6d2a5a98c1f0da272af0481a73b62792b92bde96aa1e55c2bb4e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEboI1VUUpFAmRgsaywdbwtdKNUMzQBa8s\n4bulQapAyv/////++fttKlqYwfDaJyrwSBpztieSuSvelqoeVcK7Tg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 519, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100a35d1400d4cc7a8f617b721faee7118a74103c4630dec5aa47e097951dafc1a7022100958221023024e97ef6df35a22e820c7bc5e16299f3f12e9d9b1b727c46d795e6", + "result" : "valid" + }, + { + "tcId" : 520, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402207fb733ed73c72fc4f4cf065e370c730301316ff4e9c6a8a701170f604c2d70b702207ca9ca985d3df48978b3a2f9c0bb8a58b216c795e687f74623a3321448bfa73c", + "result" : "valid" + }, + { + "tcId" : 521, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502210095ae4df2fba8524e1151cb9a9c5c1ec1357a663722a18329303d86a58e7047540220591ea644b1dc6f4c7cd5d7d939397f84d9e077100760f0816ae5b22ae6a74203", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04000000013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d", + "wx" : "013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0", + "wy" : "00f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004000000013fd22248d64d95f73c29b48ab48631850be503fd00f8468b5f0f70e0f6ee7aa43bc2c6fd25b1d8269241cbdd9dbb0dac96dc96231f430705f838717d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEAAAAAT/SIkjWTZX3PCm0irSGMYUL5QP9\nAPhGi18PcOD27nqkO8LG/SWx2CaSQcvdnbsNrJbcliMfQwcF+DhxfQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 522, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220717925f0dd5cf45e746e87f79c9ea97d11eb01444052c270aeccef56c2e958280220785787b664137080383d2fc500459fa713258205fdae97b3240fb64bb638a657", + "result" : "valid" + }, + { + "tcId" : 523, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30460221008adfdeae3b586315d06183610d271fc423cc789908b8f5dc563253a3c782510a0221008137bedbb4e60da26041b351f72a6bc3b7741f745743f0733b40b7fc56febd04", + "result" : "valid" + }, + { + "tcId" : 524, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502210092ded14e19b94d17c79b063a034b122ce3b93a2502f2f223fad3461abf631632022052ff8ad14ba3657242e29440d01cab36ebb6033ee36021dc8d9b38f0808a90bc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "0425afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dfffffffffa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35", + "wx" : "25afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dffffffff", + "wy" : "00fa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a0342000425afd689acabaed67c1f296de59406f8c550f57146a0b4ec2c97876dfffffffffa46a76e520322dfbc491ec4f0cc197420fc4ea5883d8f6dd53c354bc4f67c35", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEJa/WiayrrtZ8Hylt5ZQG+MVQ9XFGoLTs\nLJeHbf/////6RqduUgMi37xJHsTwzBl0IPxOpYg9j23VPDVLxPZ8NQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 525, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100d48373483e0fa2f11cfdfaea6f1de59e6861e9e87c4f6446602ba0125ab7de460221009d753bba3a7be08aab456e93a6500d4781795ed59af8bd6d6133129abef1ad98", + "result" : "valid" + }, + { + "tcId" : 526, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100f11473117b66e5d84a2ecd0f8b7ec4a2cc2aee89ae022020235777305142f498022100fe5ce43ced28f3f69f65e810678afefd2bdeefb051280ad2880157fda28b2ab1", + "result" : "valid" + }, + { + "tcId" : 527, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502203c9f5bdde7310b5696c93c86203fc97e11a70739e20c71c9e722308d45a59e6c022100c09efb9a045a47cce799b768890bb17833a0210d869a36be1da33f2585477c32", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "04d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb93f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff", + "wx" : "00d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb9", + "wy" : "3f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a03420004d12e6c66b67734c3c84d2601cf5d35dc097e27637f0aca4a4fdb74b6aadd3bb93f5bdff88bd5736df898e699006ed750f11cf07c5866cd7ad70c7121ffffffff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE0S5sZrZ3NMPITSYBz1013Al+J2N/CspK\nT9t0tqrdO7k/W9/4i9VzbfiY5pkAbtdQ8RzwfFhmzXrXDHEh/////w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 528, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402206953442c487f240487d2af81f9825c894b1fc2534321fa012db8248be20a4b06022056927395d64ce4d690caa98944c2ddebc312f57f439d37236ea63cc1de098718", + "result" : "valid" + }, + { + "tcId" : 529, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100fb39aa5f36ceca6e68d1932e811598c412892734dade389fd9e8ba94c5c7a251022100fdddf0c3db66c7c46608ac98431f0ee8ebb1e27ba501937789ebcd0f7ac26ecc", + "result" : "valid" + }, + { + "tcId" : 530, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022044fef6017638fd5bda17dfce346b0311b5e369bfb68aa85d5e970786b8e6644b0220720b3a52fe44be6028759f0f1a6fd7020ff6792cd4ece98dffd0d97d3b726091", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256k1", + "keySize" : 256, + "uncompressed" : "046d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb", + "wx" : "6d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000", + "wy" : "00e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb" + }, + "publicKeyDer" : "3056301006072a8648ce3d020106052b8104000a034200046d4a7f60d4774a4f0aa8bbdedb953c7eea7909407e3164755664bc2800000000e659d34e4df38d9e8c9eaadfba36612c769195be86c77aac3f36e78b538680fb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEbUp/YNR3Sk8KqLve25U8fup5CUB+MWR1\nVmS8KAAAAADmWdNOTfONnoyeqt+6NmEsdpGVvobHeqw/NueLU4aA+w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 531, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30430220304babc41346e6205cf03e2d0b26e4b222dce8227402d001ba233efa69c91234021f65add3279f51b2417fb0a13b0f06404199caac3430385513ee49f67d8e8cdf", + "result" : "valid" + }, + { + "tcId" : 532, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022023868700b71fbafcaa73960faf922ee0458ef69e01fb060b2f9a80d992fe114c02206ec1526bd56f6eebf10463bd9210d62510b95166365e10a7b7abfc4d584ca338", + "result" : "valid" + }, + { + "tcId" : 533, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100dd60d7cf83a08208637212b65d079fb658d8ef1b8438d9c58f4122b0cd14ac49022100f1d762516f4d6c3e6a98dd31dc3869dc7cf35944f33b35c6a17fe632d2b18cd5", + "result" : "valid" + } + ] + } + ] +} diff --git a/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha256_test.json b/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha256_test.json new file mode 100644 index 0000000000..684042f6f4 --- /dev/null +++ b/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha256_test.json @@ -0,0 +1,6502 @@ +{ + "algorithm" : "ECDSA", + "schema" : "ecdsa_verify_schema.json", + "generatorVersion" : "0.9rc5", + "numberOfTests" : 471, + "header" : [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes" : { + "ArithmeticError" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.", + "cves" : [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature" : { + "bugType" : "BER_ENCODING", + "description" : "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect" : "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves" : [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication" : { + "bugType" : "EDGE_CASE", + "description" : "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding" : { + "bugType" : "CAN_OF_WORMS", + "description" : "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449" + ] + }, + "MissingZero" : { + "bugType" : "LEGACY", + "description" : "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect" : "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "CVE-2019-0865" + ] + }, + "PointDuplication" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves" : [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "2020-13895" + ] + }, + "SpecialCaseHash" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "ValidSignature" : { + "bugType" : "BASIC", + "description" : "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups" : [ + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "wx" : "04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5", + "wy" : "0087d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBKrsc2NXJvIT+4qeZNo7hjLkFJWp\nRNAEW1IuunJA+tWH2TFXmKqjpboBd1eHztBeqve04J/IHW0apUboNl1SXQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 1, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "", + "sig" : "3045022100b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a02200177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2", + "result" : "valid" + }, + { + "tcId" : 2, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "4d7367", + "sig" : "30450220530bd6b0c9af2d69ba897f6b5fb59695cfbf33afe66dbadcf5b8d2a2a6538e23022100d85e489cb7a161fd55ededcedbf4cc0c0987e3e3f0f242cae934c72caa3f43e9", + "result" : "valid" + }, + { + "tcId" : 3, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100a8ea150cb80125d7381c4c1f1da8e9de2711f9917060406a73d7904519e51388022100f3ab9fa68bd47973a73b2d40480c2ba50c22c9d76ec217257288293285449b86", + "result" : "valid" + }, + { + "tcId" : 4, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "0000000000000000000000000000000000000000", + "sig" : "3045022100986e65933ef2ed4ee5aada139f52b70539aaf63f00a91f29c69178490d57fb7102203dafedfb8da6189d372308cbf1489bbbdabf0c0217d1c0ff0f701aaa7a694b9c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "wx" : "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838", + "wy" : "00c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKSexBRK64+3c/kZ4KBKLrSkDJpkZ\n9whgacjE32xzKDjHeHlk6qwA5ZIfsUmKYPRgZ2az2WhQAVWNGpdOc0FRPg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 5, + "comment" : "signature malleability", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802204cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76", + "result" : "valid" + }, + { + "tcId" : 6, + "comment" : "Legacy: ASN encoding of s misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180220b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 7, + "comment" : "valid", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "valid" + }, + { + "tcId" : 8, + "comment" : "length of sequence [r, s] uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30814502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 9, + "comment" : "length of sequence [r, s] contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3082004502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 10, + "comment" : "length of sequence [r, s] uses 70 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304602202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 11, + "comment" : "length of sequence [r, s] uses 68 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 12, + "comment" : "uint32 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085010000004502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 13, + "comment" : "uint64 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308901000000000000004502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 14, + "comment" : "length of sequence [r, s] = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30847fffffff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 15, + "comment" : "length of sequence [r, s] = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30848000000002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 16, + "comment" : "length of sequence [r, s] = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084ffffffff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 17, + "comment" : "length of sequence [r, s] = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085ffffffffff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 18, + "comment" : "length of sequence [r, s] = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3088ffffffffffffffff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 19, + "comment" : "incorrect length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30ff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 20, + "comment" : "replaced sequence [r, s] by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 21, + "comment" : "removing sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "", + "result" : "invalid" + }, + { + "tcId" : 22, + "comment" : "lonely sequence tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30", + "result" : "invalid" + }, + { + "tcId" : 23, + "comment" : "appending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result" : "invalid" + }, + { + "tcId" : 24, + "comment" : "prepending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047000002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 25, + "comment" : "appending unused 0's to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result" : "invalid" + }, + { + "tcId" : 26, + "comment" : "appending null value to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0500", + "result" : "invalid" + }, + { + "tcId" : 27, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a498177304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 28, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492500304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 29, + "comment" : "appending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 30, + "comment" : "including undefined tags", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304daa00bb00cd00304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 31, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2228aa00bb00cd0002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 32, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182229aa00bb00cd00022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 33, + "comment" : "truncated length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3081", + "result" : "invalid" + }, + { + "tcId" : 34, + "comment" : "including undefined tags to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304baa02aabb304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 35, + "comment" : "using composition with indefinite length for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result" : "invalid" + }, + { + "tcId" : 36, + "comment" : "using composition with wrong tag for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080314502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result" : "invalid" + }, + { + "tcId" : 37, + "comment" : "Replacing sequence [r, s] with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "0500", + "result" : "invalid" + }, + { + "tcId" : 38, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2e4502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 39, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2f4502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 40, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "314502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 41, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "324502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 42, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "ff4502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 43, + "comment" : "dropping value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3000", + "result" : "invalid" + }, + { + "tcId" : 44, + "comment" : "using composition for sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30493001023044202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 45, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847", + "result" : "invalid" + }, + { + "tcId" : 46, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 47, + "comment" : "sequence [r, s] of size 4166 to check for overflows", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3082104602202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 48, + "comment" : "indefinite length", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result" : "invalid" + }, + { + "tcId" : 49, + "comment" : "indefinite length with truncated delimiter", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db00", + "result" : "invalid" + }, + { + "tcId" : 50, + "comment" : "indefinite length with additional element", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db05000000", + "result" : "invalid" + }, + { + "tcId" : 51, + "comment" : "indefinite length with truncated element", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db060811220000", + "result" : "invalid" + }, + { + "tcId" : 52, + "comment" : "indefinite length with garbage", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000fe02beef", + "result" : "invalid" + }, + { + "tcId" : 53, + "comment" : "indefinite length with nonempty EOC", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0002beef", + "result" : "invalid" + }, + { + "tcId" : 54, + "comment" : "prepend empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047300002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 55, + "comment" : "append empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db3000", + "result" : "invalid" + }, + { + "tcId" : 56, + "comment" : "append zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304802202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db020100", + "result" : "invalid" + }, + { + "tcId" : 57, + "comment" : "append garbage with high tag number", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304802202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847dbbf7f00", + "result" : "invalid" + }, + { + "tcId" : 58, + "comment" : "append null with explicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847dba0020500", + "result" : "invalid" + }, + { + "tcId" : 59, + "comment" : "append null with implicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847dba000", + "result" : "invalid" + }, + { + "tcId" : 60, + "comment" : "sequence of sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 61, + "comment" : "truncated sequence: removed last 1 elements", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302202202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18", + "result" : "invalid" + }, + { + "tcId" : 62, + "comment" : "repeating element in sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "306802202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 63, + "comment" : "flipped bit 0 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30432ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e19022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 64, + "comment" : "flipped bit 32 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30432ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af8bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 65, + "comment" : "flipped bit 48 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30432ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cd6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 66, + "comment" : "flipped bit 64 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30432ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee858b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 67, + "comment" : "length of r uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30460281202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 68, + "comment" : "length of r contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3047028200202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 69, + "comment" : "length of r uses 33 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502212ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 70, + "comment" : "length of r uses 31 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045021f2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 71, + "comment" : "uint32 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a028501000000202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 72, + "comment" : "uint64 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e02890100000000000000202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 73, + "comment" : "length of r = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902847fffffff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 74, + "comment" : "length of r = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284800000002ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 75, + "comment" : "length of r = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284ffffffff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 76, + "comment" : "length of r = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285ffffffffff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 77, + "comment" : "length of r = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0288ffffffffffffffff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 78, + "comment" : "incorrect length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502ff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 79, + "comment" : "replaced r by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502802ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 80, + "comment" : "removing r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3023022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 81, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 82, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802", + "result" : "invalid" + }, + { + "tcId" : 83, + "comment" : "appending 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702222ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 84, + "comment" : "prepending 0's to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047022200002ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 85, + "comment" : "appending unused 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 86, + "comment" : "appending null value to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702222ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180500022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 87, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a222549817702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 88, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492224250002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 89, + "comment" : "appending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d222202202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180004deadbeef022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 90, + "comment" : "truncated length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250281022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 91, + "comment" : "including undefined tags to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b2226aa02aabb02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 92, + "comment" : "using composition with indefinite length for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049228002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 93, + "comment" : "using composition with wrong tag for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049228003202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 94, + "comment" : "Replacing r with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30250500022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 95, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304500202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 96, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304501202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 97, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304503202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 98, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304504202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 99, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045ff202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 100, + "comment" : "dropping value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250200022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 101, + "comment" : "using composition for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049222402012b021fa3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 102, + "comment" : "modifying first byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022029a3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 103, + "comment" : "modifying last byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e98022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 104, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044021f2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 105, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044021fa3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 106, + "comment" : "r of size 4129 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30821048028210212ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 107, + "comment" : "leading ff in r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30460221ff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 108, + "comment" : "replaced r by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026090180022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 109, + "comment" : "replacing r with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 110, + "comment" : "flipped bit 0 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1800b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847da", + "result" : "invalid" + }, + { + "tcId" : 111, + "comment" : "flipped bit 32 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1800b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b48156847db", + "result" : "invalid" + }, + { + "tcId" : 112, + "comment" : "flipped bit 48 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1800b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c124b49156847db", + "result" : "invalid" + }, + { + "tcId" : 113, + "comment" : "flipped bit 64 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1800b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4097c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 114, + "comment" : "length of s uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304602202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802812100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 115, + "comment" : "length of s contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180282002100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 116, + "comment" : "length of s uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022200b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 117, + "comment" : "length of s uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 118, + "comment" : "uint32 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180285010000002100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 119, + "comment" : "uint64 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18028901000000000000002100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 120, + "comment" : "length of s = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802847fffffff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 121, + "comment" : "length of s = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802848000000000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 122, + "comment" : "length of s = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180284ffffffff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 123, + "comment" : "length of s = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180285ffffffffff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 124, + "comment" : "length of s = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180288ffffffffffffffff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 125, + "comment" : "incorrect length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802ff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 126, + "comment" : "replaced s by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18028000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 127, + "comment" : "appending 0's to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022300b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result" : "invalid" + }, + { + "tcId" : 128, + "comment" : "prepending 0's to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180223000000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 129, + "comment" : "appending null value to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022300b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0500", + "result" : "invalid" + }, + { + "tcId" : 130, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182226498177022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 131, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1822252500022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 132, + "comment" : "appending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182223022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 133, + "comment" : "truncated length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180281", + "result" : "invalid" + }, + { + "tcId" : 134, + "comment" : "including undefined tags to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182227aa02aabb022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 135, + "comment" : "using composition with indefinite length for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182280022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result" : "invalid" + }, + { + "tcId" : 136, + "comment" : "using composition with wrong tag for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182280032100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result" : "invalid" + }, + { + "tcId" : 137, + "comment" : "Replacing s with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180500", + "result" : "invalid" + }, + { + "tcId" : 138, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18002100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 139, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18012100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 140, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18032100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 141, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18042100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 142, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18ff2100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 143, + "comment" : "dropping value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180200", + "result" : "invalid" + }, + { + "tcId" : 144, + "comment" : "using composition for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1822250201000220b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 145, + "comment" : "modifying first byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022102b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 146, + "comment" : "modifying last byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b491568475b", + "result" : "invalid" + }, + { + "tcId" : 147, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847", + "result" : "invalid" + }, + { + "tcId" : 148, + "comment" : "s of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3082104802202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180282102200b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 149, + "comment" : "leading ff in s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304602202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180222ff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 150, + "comment" : "replaced s by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18090180", + "result" : "invalid" + }, + { + "tcId" : 151, + "comment" : "replacing s with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18020100", + "result" : "invalid" + }, + { + "tcId" : 152, + "comment" : "replaced r by r + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460221012ba3a8bd6b94d5ed80a6d9d1190a436ebccc0833490686deac8635bcb9bf5369022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 153, + "comment" : "replaced r by r - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460221ff2ba3a8bf6b94d5eb80a6d9d1190a436f42fe12d7fad749d4c512a036c0f908c7022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 154, + "comment" : "replaced r by r + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3047022201002ba3a7be6b94d6ec80a6d9d1190a432be6dfbb2cb98d6d4d72972df620817f18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 155, + "comment" : "replaced r by -r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450220d45c5741946b2a137f59262ee6f5bc91001af27a5e1117a64733950642a3d1e8022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 156, + "comment" : "replaced r by n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "3046022100d45c5740946b2a147f59262ee6f5bc90bd01ed280528b62b3aed5fc93f06f739022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 157, + "comment" : "replaced r by -n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fed45c5742946b2a127f59262ee6f5bc914333f7ccb6f979215379ca434640ac97022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 158, + "comment" : "replaced r by r + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30460221012ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 159, + "comment" : "replaced r by r + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e02290100000000000000002ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 160, + "comment" : "replaced s by s + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022101b329f478a2bbd0a6c384ee1493b1f518276e0e4a5375928d6fcd160c11cb6d2c022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 161, + "comment" : "replaced s by s - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450220b329f47aa2bbd0a4c384ee1493b1f518ada018ef05465583885980861905228a022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 162, + "comment" : "replaced s by s + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304702220100b329f379a2bbd1a5c384ee1493b1f4d55181c143c3fc78fc35de0e45788d98db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 163, + "comment" : "replaced s by -s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221ff4cd60b865d442f5a3c7b11eb6c4e0ae79578ec6353a20bf783ecb4b6ea97b825022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 164, + "comment" : "replaced s by -n - s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fe4cd60b875d442f593c7b11eb6c4e0ae7d891f1b5ac8a6d729032e9f3ee3492d4022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 165, + "comment" : "replaced s by s + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "3046022101b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 166, + "comment" : "replaced s by s - 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450220b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 167, + "comment" : "replaced s by s + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e0229010000000000000000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result" : "invalid" + }, + { + "tcId" : 168, + "comment" : "Signature with special case values r=0 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020100", + "result" : "invalid" + }, + { + "tcId" : 169, + "comment" : "Signature with special case values r=0 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020101", + "result" : "invalid" + }, + { + "tcId" : 170, + "comment" : "Signature with special case values r=0 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000201ff", + "result" : "invalid" + }, + { + "tcId" : 171, + "comment" : "Signature with special case values r=0 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 172, + "comment" : "Signature with special case values r=0 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 173, + "comment" : "Signature with special case values r=0 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 174, + "comment" : "Signature with special case values r=0 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 175, + "comment" : "Signature with special case values r=0 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 176, + "comment" : "Signature with special case values r=1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020100", + "result" : "invalid" + }, + { + "tcId" : 177, + "comment" : "Signature with special case values r=1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "invalid" + }, + { + "tcId" : 178, + "comment" : "Signature with special case values r=1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010201ff", + "result" : "invalid" + }, + { + "tcId" : 179, + "comment" : "Signature with special case values r=1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 180, + "comment" : "Signature with special case values r=1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 181, + "comment" : "Signature with special case values r=1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 182, + "comment" : "Signature with special case values r=1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 183, + "comment" : "Signature with special case values r=1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 184, + "comment" : "Signature with special case values r=-1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020100", + "result" : "invalid" + }, + { + "tcId" : 185, + "comment" : "Signature with special case values r=-1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020101", + "result" : "invalid" + }, + { + "tcId" : 186, + "comment" : "Signature with special case values r=-1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0201ff", + "result" : "invalid" + }, + { + "tcId" : 187, + "comment" : "Signature with special case values r=-1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 188, + "comment" : "Signature with special case values r=-1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 189, + "comment" : "Signature with special case values r=-1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 190, + "comment" : "Signature with special case values r=-1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 191, + "comment" : "Signature with special case values r=-1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 192, + "comment" : "Signature with special case values r=n and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020100", + "result" : "invalid" + }, + { + "tcId" : 193, + "comment" : "Signature with special case values r=n and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020101", + "result" : "invalid" + }, + { + "tcId" : 194, + "comment" : "Signature with special case values r=n and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510201ff", + "result" : "invalid" + }, + { + "tcId" : 195, + "comment" : "Signature with special case values r=n and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 196, + "comment" : "Signature with special case values r=n and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 197, + "comment" : "Signature with special case values r=n and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 198, + "comment" : "Signature with special case values r=n and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 199, + "comment" : "Signature with special case values r=n and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 200, + "comment" : "Signature with special case values r=n - 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020100", + "result" : "invalid" + }, + { + "tcId" : 201, + "comment" : "Signature with special case values r=n - 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020101", + "result" : "invalid" + }, + { + "tcId" : 202, + "comment" : "Signature with special case values r=n - 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325500201ff", + "result" : "invalid" + }, + { + "tcId" : 203, + "comment" : "Signature with special case values r=n - 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 204, + "comment" : "Signature with special case values r=n - 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 205, + "comment" : "Signature with special case values r=n - 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 206, + "comment" : "Signature with special case values r=n - 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 207, + "comment" : "Signature with special case values r=n - 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 208, + "comment" : "Signature with special case values r=n + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020100", + "result" : "invalid" + }, + { + "tcId" : 209, + "comment" : "Signature with special case values r=n + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020101", + "result" : "invalid" + }, + { + "tcId" : 210, + "comment" : "Signature with special case values r=n + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325520201ff", + "result" : "invalid" + }, + { + "tcId" : 211, + "comment" : "Signature with special case values r=n + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 212, + "comment" : "Signature with special case values r=n + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 213, + "comment" : "Signature with special case values r=n + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 214, + "comment" : "Signature with special case values r=n + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 215, + "comment" : "Signature with special case values r=n + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 216, + "comment" : "Signature with special case values r=p and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020100", + "result" : "invalid" + }, + { + "tcId" : 217, + "comment" : "Signature with special case values r=p and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020101", + "result" : "invalid" + }, + { + "tcId" : 218, + "comment" : "Signature with special case values r=p and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0201ff", + "result" : "invalid" + }, + { + "tcId" : 219, + "comment" : "Signature with special case values r=p and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 220, + "comment" : "Signature with special case values r=p and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 221, + "comment" : "Signature with special case values r=p and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 222, + "comment" : "Signature with special case values r=p and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 223, + "comment" : "Signature with special case values r=p and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 224, + "comment" : "Signature with special case values r=p + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020100", + "result" : "invalid" + }, + { + "tcId" : 225, + "comment" : "Signature with special case values r=p + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020101", + "result" : "invalid" + }, + { + "tcId" : 226, + "comment" : "Signature with special case values r=p + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff000000010000000000000000000000010000000000000000000000000201ff", + "result" : "invalid" + }, + { + "tcId" : 227, + "comment" : "Signature with special case values r=p + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 228, + "comment" : "Signature with special case values r=p + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 229, + "comment" : "Signature with special case values r=p + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 230, + "comment" : "Signature with special case values r=p + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 231, + "comment" : "Signature with special case values r=p + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 232, + "comment" : "Signature encoding contains incorrect types: r=0, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020100090380fe01", + "result" : "invalid" + }, + { + "tcId" : 233, + "comment" : "Signature encoding contains incorrect types: r=0, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100090142", + "result" : "invalid" + }, + { + "tcId" : 234, + "comment" : "Signature encoding contains incorrect types: r=0, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010101", + "result" : "invalid" + }, + { + "tcId" : 235, + "comment" : "Signature encoding contains incorrect types: r=0, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010100", + "result" : "invalid" + }, + { + "tcId" : 236, + "comment" : "Signature encoding contains incorrect types: r=0, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000500", + "result" : "invalid" + }, + { + "tcId" : 237, + "comment" : "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000c00", + "result" : "invalid" + }, + { + "tcId" : 238, + "comment" : "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000c0130", + "result" : "invalid" + }, + { + "tcId" : 239, + "comment" : "Signature encoding contains incorrect types: r=0, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201003000", + "result" : "invalid" + }, + { + "tcId" : 240, + "comment" : "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201003003020100", + "result" : "invalid" + }, + { + "tcId" : 241, + "comment" : "Signature encoding contains incorrect types: r=1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020101090380fe01", + "result" : "invalid" + }, + { + "tcId" : 242, + "comment" : "Signature encoding contains incorrect types: r=1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101090142", + "result" : "invalid" + }, + { + "tcId" : 243, + "comment" : "Signature encoding contains incorrect types: r=1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010101", + "result" : "invalid" + }, + { + "tcId" : 244, + "comment" : "Signature encoding contains incorrect types: r=1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010100", + "result" : "invalid" + }, + { + "tcId" : 245, + "comment" : "Signature encoding contains incorrect types: r=1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010500", + "result" : "invalid" + }, + { + "tcId" : 246, + "comment" : "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010c00", + "result" : "invalid" + }, + { + "tcId" : 247, + "comment" : "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010c0130", + "result" : "invalid" + }, + { + "tcId" : 248, + "comment" : "Signature encoding contains incorrect types: r=1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201013000", + "result" : "invalid" + }, + { + "tcId" : 249, + "comment" : "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201013003020100", + "result" : "invalid" + }, + { + "tcId" : 250, + "comment" : "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 251, + "comment" : "Signature encoding contains incorrect types: r=-1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff090142", + "result" : "invalid" + }, + { + "tcId" : 252, + "comment" : "Signature encoding contains incorrect types: r=-1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010101", + "result" : "invalid" + }, + { + "tcId" : 253, + "comment" : "Signature encoding contains incorrect types: r=-1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010100", + "result" : "invalid" + }, + { + "tcId" : 254, + "comment" : "Signature encoding contains incorrect types: r=-1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0500", + "result" : "invalid" + }, + { + "tcId" : 255, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0c00", + "result" : "invalid" + }, + { + "tcId" : 256, + "comment" : "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0c0130", + "result" : "invalid" + }, + { + "tcId" : 257, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff3000", + "result" : "invalid" + }, + { + "tcId" : 258, + "comment" : "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff3003020100", + "result" : "invalid" + }, + { + "tcId" : 259, + "comment" : "Signature encoding contains incorrect types: r=n, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090380fe01", + "result" : "invalid" + }, + { + "tcId" : 260, + "comment" : "Signature encoding contains incorrect types: r=n, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090142", + "result" : "invalid" + }, + { + "tcId" : 261, + "comment" : "Signature encoding contains incorrect types: r=n, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010101", + "result" : "invalid" + }, + { + "tcId" : 262, + "comment" : "Signature encoding contains incorrect types: r=n, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010100", + "result" : "invalid" + }, + { + "tcId" : 263, + "comment" : "Signature encoding contains incorrect types: r=n, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510500", + "result" : "invalid" + }, + { + "tcId" : 264, + "comment" : "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c00", + "result" : "invalid" + }, + { + "tcId" : 265, + "comment" : "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c0130", + "result" : "invalid" + }, + { + "tcId" : 266, + "comment" : "Signature encoding contains incorrect types: r=n, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513000", + "result" : "invalid" + }, + { + "tcId" : 267, + "comment" : "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513003020100", + "result" : "invalid" + }, + { + "tcId" : 268, + "comment" : "Signature encoding contains incorrect types: r=p, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 269, + "comment" : "Signature encoding contains incorrect types: r=p, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090142", + "result" : "invalid" + }, + { + "tcId" : 270, + "comment" : "Signature encoding contains incorrect types: r=p, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010101", + "result" : "invalid" + }, + { + "tcId" : 271, + "comment" : "Signature encoding contains incorrect types: r=p, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010100", + "result" : "invalid" + }, + { + "tcId" : 272, + "comment" : "Signature encoding contains incorrect types: r=p, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0500", + "result" : "invalid" + }, + { + "tcId" : 273, + "comment" : "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c00", + "result" : "invalid" + }, + { + "tcId" : 274, + "comment" : "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c0130", + "result" : "invalid" + }, + { + "tcId" : 275, + "comment" : "Signature encoding contains incorrect types: r=p, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3000", + "result" : "invalid" + }, + { + "tcId" : 276, + "comment" : "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3003020100", + "result" : "invalid" + }, + { + "tcId" : 277, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a090380fe01090380fe01", + "result" : "invalid" + }, + { + "tcId" : 278, + "comment" : "Signature encoding contains incorrect types: r=nan, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142090142", + "result" : "invalid" + }, + { + "tcId" : 279, + "comment" : "Signature encoding contains incorrect types: r=True, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101010101", + "result" : "invalid" + }, + { + "tcId" : 280, + "comment" : "Signature encoding contains incorrect types: r=False, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100010100", + "result" : "invalid" + }, + { + "tcId" : 281, + "comment" : "Signature encoding contains incorrect types: r=Null, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300405000500", + "result" : "invalid" + }, + { + "tcId" : 282, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30040c000c00", + "result" : "invalid" + }, + { + "tcId" : 283, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c01300c0130", + "result" : "invalid" + }, + { + "tcId" : 284, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300430003000", + "result" : "invalid" + }, + { + "tcId" : 285, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a30030201003003020100", + "result" : "invalid" + }, + { + "tcId" : 286, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008090380fe01020100", + "result" : "invalid" + }, + { + "tcId" : 287, + "comment" : "Signature encoding contains incorrect types: r=nan, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142020100", + "result" : "invalid" + }, + { + "tcId" : 288, + "comment" : "Signature encoding contains incorrect types: r=True, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101020100", + "result" : "invalid" + }, + { + "tcId" : 289, + "comment" : "Signature encoding contains incorrect types: r=False, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100020100", + "result" : "invalid" + }, + { + "tcId" : 290, + "comment" : "Signature encoding contains incorrect types: r=Null, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050500020100", + "result" : "invalid" + }, + { + "tcId" : 291, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050c00020100", + "result" : "invalid" + }, + { + "tcId" : 292, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c0130020100", + "result" : "invalid" + }, + { + "tcId" : 293, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30053000020100", + "result" : "invalid" + }, + { + "tcId" : 294, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30083003020100020100", + "result" : "invalid" + }, + { + "tcId" : 295, + "comment" : "Edge case for Shamir multiplication", + "flags" : [ + "EdgeCaseShamirMultiplication" + ], + "msg" : "3639383139", + "sig" : "3044022064a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e02206af015971cc30be6d1a206d4e013e0997772a2f91d73286ffd683b9bb2cf4f1b", + "result" : "valid" + }, + { + "tcId" : 296, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343236343739373234", + "sig" : "3044022016aea964a2f6506d6f78c81c91fc7e8bded7d397738448de1e19a0ec580bf2660220252cd762130c6667cfe8b7bc47d27d78391e8e80c578d1cd38c3ff033be928e9", + "result" : "valid" + }, + { + "tcId" : 297, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37313338363834383931", + "sig" : "30450221009cc98be2347d469bf476dfc26b9b733df2d26d6ef524af917c665baccb23c8820220093496459effe2d8d70727b82462f61d0ec1b7847929d10ea631dacb16b56c32", + "result" : "valid" + }, + { + "tcId" : 298, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130333539333331363638", + "sig" : "3044022073b3c90ecd390028058164524dde892703dce3dea0d53fa8093999f07ab8aa4302202f67b0b8e20636695bb7d8bf0a651c802ed25a395387b5f4188c0c4075c88634", + "result" : "valid" + }, + { + "tcId" : 299, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33393439343031323135", + "sig" : "3046022100bfab3098252847b328fadf2f89b95c851a7f0eb390763378f37e90119d5ba3dd022100bdd64e234e832b1067c2d058ccb44d978195ccebb65c2aaf1e2da9b8b4987e3b", + "result" : "valid" + }, + { + "tcId" : 300, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333434323933303739", + "sig" : "30440220204a9784074b246d8bf8bf04a4ceb1c1f1c9aaab168b1596d17093c5cd21d2cd022051cce41670636783dc06a759c8847868a406c2506fe17975582fe648d1d88b52", + "result" : "valid" + }, + { + "tcId" : 301, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33373036323131373132", + "sig" : "3046022100ed66dc34f551ac82f63d4aa4f81fe2cb0031a91d1314f835027bca0f1ceeaa0302210099ca123aa09b13cd194a422e18d5fda167623c3f6e5d4d6abb8953d67c0c48c7", + "result" : "valid" + }, + { + "tcId" : 302, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333433363838373132", + "sig" : "30450220060b700bef665c68899d44f2356a578d126b062023ccc3c056bf0f60a237012b0221008d186c027832965f4fcc78a3366ca95dedbb410cbef3f26d6be5d581c11d3610", + "result" : "valid" + }, + { + "tcId" : 303, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333531353330333730", + "sig" : "30460221009f6adfe8d5eb5b2c24d7aa7934b6cf29c93ea76cd313c9132bb0c8e38c96831d022100b26a9c9e40e55ee0890c944cf271756c906a33e66b5bd15e051593883b5e9902", + "result" : "valid" + }, + { + "tcId" : 304, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36353533323033313236", + "sig" : "3045022100a1af03ca91677b673ad2f33615e56174a1abf6da168cebfa8868f4ba273f16b7022020aa73ffe48afa6435cd258b173d0c2377d69022e7d098d75caf24c8c5e06b1c", + "result" : "valid" + }, + { + "tcId" : 305, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353634333436363033", + "sig" : "3045022100fdc70602766f8eed11a6c99a71c973d5659355507b843da6e327a28c11893db902203df5349688a085b137b1eacf456a9e9e0f6d15ec0078ca60a7f83f2b10d21350", + "result" : "valid" + }, + { + "tcId" : 306, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343239353339313137", + "sig" : "3046022100b516a314f2fce530d6537f6a6c49966c23456f63c643cf8e0dc738f7b876e675022100d39ffd033c92b6d717dd536fbc5efdf1967c4bd80954479ba66b0120cd16fff2", + "result" : "valid" + }, + { + "tcId" : 307, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130393533323631333531", + "sig" : "304402203b2cbf046eac45842ecb7984d475831582717bebb6492fd0a485c101e29ff0a802204c9b7b47a98b0f82de512bc9313aaf51701099cac5f76e68c8595fc1c1d99258", + "result" : "valid" + }, + { + "tcId" : 308, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35393837333530303431", + "sig" : "3044022030c87d35e636f540841f14af54e2f9edd79d0312cfa1ab656c3fb15bfde48dcf022047c15a5a82d24b75c85a692bd6ecafeb71409ede23efd08e0db9abf6340677ed", + "result" : "valid" + }, + { + "tcId" : 309, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343633303036383738", + "sig" : "3044022038686ff0fda2cef6bc43b58cfe6647b9e2e8176d168dec3c68ff262113760f520220067ec3b651f422669601662167fa8717e976e2db5e6a4cf7c2ddabb3fde9d67d", + "result" : "valid" + }, + { + "tcId" : 310, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39383137333230323837", + "sig" : "3044022044a3e23bf314f2b344fc25c7f2de8b6af3e17d27f5ee844b225985ab6e2775cf02202d48e223205e98041ddc87be532abed584f0411f5729500493c9cc3f4dd15e86", + "result" : "valid" + }, + { + "tcId" : 311, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323232303431303436", + "sig" : "304402202ded5b7ec8e90e7bf11f967a3d95110c41b99db3b5aa8d330eb9d638781688e902207d5792c53628155e1bfc46fb1a67e3088de049c328ae1f44ec69238a009808f9", + "result" : "valid" + }, + { + "tcId" : 312, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36363636333037313034", + "sig" : "3046022100bdae7bcb580bf335efd3bc3d31870f923eaccafcd40ec2f605976f15137d8b8f022100f6dfa12f19e525270b0106eecfe257499f373a4fb318994f24838122ce7ec3c7", + "result" : "valid" + }, + { + "tcId" : 313, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303335393531383938", + "sig" : "3045022050f9c4f0cd6940e162720957ffff513799209b78596956d21ece251c2401f1c6022100d7033a0a787d338e889defaaabb106b95a4355e411a59c32aa5167dfab244726", + "result" : "valid" + }, + { + "tcId" : 314, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31383436353937313935", + "sig" : "3045022100f612820687604fa01906066a378d67540982e29575d019aabe90924ead5c860d02203f9367702dd7dd4f75ea98afd20e328a1a99f4857b316525328230ce294b0fef", + "result" : "valid" + }, + { + "tcId" : 315, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313336303436313839", + "sig" : "30460221009505e407657d6e8bc93db5da7aa6f5081f61980c1949f56b0f2f507da5782a7a022100c60d31904e3669738ffbeccab6c3656c08e0ed5cb92b3cfa5e7f71784f9c5021", + "result" : "valid" + }, + { + "tcId" : 316, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32363633373834323534", + "sig" : "3046022100bbd16fbbb656b6d0d83e6a7787cd691b08735aed371732723e1c68a40404517d0221009d8e35dba96028b7787d91315be675877d2d097be5e8ee34560e3e7fd25c0f00", + "result" : "valid" + }, + { + "tcId" : 317, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363532313030353234", + "sig" : "304402202ec9760122db98fd06ea76848d35a6da442d2ceef7559a30cf57c61e92df327e02207ab271da90859479701fccf86e462ee3393fb6814c27b760c4963625c0a19878", + "result" : "valid" + }, + { + "tcId" : 318, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35373438303831363936", + "sig" : "3044022054e76b7683b6650baa6a7fc49b1c51eed9ba9dd463221f7a4f1005a89fe00c5902202ea076886c773eb937ec1cc8374b7915cfd11b1c1ae1166152f2f7806a31c8fd", + "result" : "valid" + }, + { + "tcId" : 319, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36333433393133343638", + "sig" : "304402205291deaf24659ffbbce6e3c26f6021097a74abdbb69be4fb10419c0c496c9466022065d6fcf336d27cc7cdb982bb4e4ecef5827f84742f29f10abf83469270a03dc3", + "result" : "valid" + }, + { + "tcId" : 320, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353431313033353938", + "sig" : "30450220207a3241812d75d947419dc58efb05e8003b33fc17eb50f9d15166a88479f107022100cdee749f2e492b213ce80b32d0574f62f1c5d70793cf55e382d5caadf7592767", + "result" : "valid" + }, + { + "tcId" : 321, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130343738353830313238", + "sig" : "304502206554e49f82a855204328ac94913bf01bbe84437a355a0a37c0dee3cf81aa7728022100aea00de2507ddaf5c94e1e126980d3df16250a2eaebc8be486effe7f22b4f929", + "result" : "valid" + }, + { + "tcId" : 322, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130353336323835353638", + "sig" : "3046022100a54c5062648339d2bff06f71c88216c26c6e19b4d80a8c602990ac82707efdfc022100e99bbe7fcfafae3e69fd016777517aa01056317f467ad09aff09be73c9731b0d", + "result" : "valid" + }, + { + "tcId" : 323, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393533393034313035", + "sig" : "3045022100975bd7157a8d363b309f1f444012b1a1d23096593133e71b4ca8b059cff37eaf02207faa7a28b1c822baa241793f2abc930bd4c69840fe090f2aacc46786bf919622", + "result" : "valid" + }, + { + "tcId" : 324, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393738383438303339", + "sig" : "304402205694a6f84b8f875c276afd2ebcfe4d61de9ec90305afb1357b95b3e0da43885e02200dffad9ffd0b757d8051dec02ebdf70d8ee2dc5c7870c0823b6ccc7c679cbaa4", + "result" : "valid" + }, + { + "tcId" : 325, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33363130363732343432", + "sig" : "3045022100a0c30e8026fdb2b4b4968a27d16a6d08f7098f1a98d21620d7454ba9790f1ba602205e470453a8a399f15baf463f9deceb53acc5ca64459149688bd2760c65424339", + "result" : "valid" + }, + { + "tcId" : 326, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303534323430373035", + "sig" : "30440220614ea84acf736527dd73602cd4bb4eea1dfebebd5ad8aca52aa0228cf7b99a880220737cc85f5f2d2f60d1b8183f3ed490e4de14368e96a9482c2a4dd193195c902f", + "result" : "valid" + }, + { + "tcId" : 327, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35313734343438313937", + "sig" : "3045022100bead6734ebe44b810d3fb2ea00b1732945377338febfd439a8d74dfbd0f942fa02206bb18eae36616a7d3cad35919fd21a8af4bbe7a10f73b3e036a46b103ef56e2a", + "result" : "valid" + }, + { + "tcId" : 328, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393637353631323531", + "sig" : "30440220499625479e161dacd4db9d9ce64854c98d922cbf212703e9654fae182df9bad2022042c177cf37b8193a0131108d97819edd9439936028864ac195b64fca76d9d693", + "result" : "valid" + }, + { + "tcId" : 329, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343437323533333433", + "sig" : "3045022008f16b8093a8fb4d66a2c8065b541b3d31e3bfe694f6b89c50fb1aaa6ff6c9b20221009d6455e2d5d1779748573b611cb95d4a21f967410399b39b535ba3e5af81ca2e", + "result" : "valid" + }, + { + "tcId" : 330, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333638323634333138", + "sig" : "3046022100be26231b6191658a19dd72ddb99ed8f8c579b6938d19bce8eed8dc2b338cb5f8022100e1d9a32ee56cffed37f0f22b2dcb57d5c943c14f79694a03b9c5e96952575c89", + "result" : "valid" + }, + { + "tcId" : 331, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323631313938363038", + "sig" : "3045022015e76880898316b16204ac920a02d58045f36a229d4aa4f812638c455abe0443022100e74d357d3fcb5c8c5337bd6aba4178b455ca10e226e13f9638196506a1939123", + "result" : "valid" + }, + { + "tcId" : 332, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39363738373831303934", + "sig" : "30440220352ecb53f8df2c503a45f9846fc28d1d31e6307d3ddbffc1132315cc07f16dad02201348dfa9c482c558e1d05c5242ca1c39436726ecd28258b1899792887dd0a3c6", + "result" : "valid" + }, + { + "tcId" : 333, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34393538383233383233", + "sig" : "304402204a40801a7e606ba78a0da9882ab23c7677b8642349ed3d652c5bfa5f2a9558fb02203a49b64848d682ef7f605f2832f7384bdc24ed2925825bf8ea77dc5981725782", + "result" : "valid" + }, + { + "tcId" : 334, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383234363337383337", + "sig" : "3045022100eacc5e1a8304a74d2be412b078924b3bb3511bac855c05c9e5e9e44df3d61e9602207451cd8e18d6ed1885dd827714847f96ec4bb0ed4c36ce9808db8f714204f6d1", + "result" : "valid" + }, + { + "tcId" : 335, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131303230383333373736", + "sig" : "304502202f7a5e9e5771d424f30f67fdab61e8ce4f8cd1214882adb65f7de94c31577052022100ac4e69808345809b44acb0b2bd889175fb75dd050c5a449ab9528f8f78daa10c", + "result" : "valid" + }, + { + "tcId" : 336, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313333383731363438", + "sig" : "3045022100ffcda40f792ce4d93e7e0f0e95e1a2147dddd7f6487621c30a03d710b3300219022079938b55f8a17f7ed7ba9ade8f2065a1fa77618f0b67add8d58c422c2453a49a", + "result" : "valid" + }, + { + "tcId" : 337, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333232313434313632", + "sig" : "304602210081f2359c4faba6b53d3e8c8c3fcc16a948350f7ab3a588b28c17603a431e39a8022100cd6f6a5cc3b55ead0ff695d06c6860b509e46d99fccefb9f7f9e101857f74300", + "result" : "valid" + }, + { + "tcId" : 338, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130363836363535353436", + "sig" : "3045022100dfc8bf520445cbb8ee1596fb073ea283ea130251a6fdffa5c3f5f2aaf75ca8080220048e33efce147c9dd92823640e338e68bfd7d0dc7a4905b3a7ac711e577e90e7", + "result" : "valid" + }, + { + "tcId" : 339, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3632313535323436", + "sig" : "3046022100ad019f74c6941d20efda70b46c53db166503a0e393e932f688227688ba6a576202210093320eb7ca0710255346bdbb3102cdcf7964ef2e0988e712bc05efe16c199345", + "result" : "valid" + }, + { + "tcId" : 340, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37303330383138373734", + "sig" : "3046022100ac8096842e8add68c34e78ce11dd71e4b54316bd3ebf7fffdeb7bd5a3ebc1883022100f5ca2f4f23d674502d4caf85d187215d36e3ce9f0ce219709f21a3aac003b7a8", + "result" : "valid" + }, + { + "tcId" : 341, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35393234353233373434", + "sig" : "30440220677b2d3a59b18a5ff939b70ea002250889ddcd7b7b9d776854b4943693fb92f702206b4ba856ade7677bf30307b21f3ccda35d2f63aee81efd0bab6972cc0795db55", + "result" : "valid" + }, + { + "tcId" : 342, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343935353836363231", + "sig" : "30450220479e1ded14bcaed0379ba8e1b73d3115d84d31d4b7c30e1f05e1fc0d5957cfb0022100918f79e35b3d89487cf634a4f05b2e0c30857ca879f97c771e877027355b2443", + "result" : "valid" + }, + { + "tcId" : 343, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34303035333134343036", + "sig" : "3044022043dfccd0edb9e280d9a58f01164d55c3d711e14b12ac5cf3b64840ead512a0a302201dbe33fa8ba84533cd5c4934365b3442ca1174899b78ef9a3199f49584389772", + "result" : "valid" + }, + { + "tcId" : 344, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303936343537353132", + "sig" : "304402205b09ab637bd4caf0f4c7c7e4bca592fea20e9087c259d26a38bb4085f0bbff11022045b7eb467b6748af618e9d80d6fdcd6aa24964e5a13f885bca8101de08eb0d75", + "result" : "valid" + }, + { + "tcId" : 345, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373834303235363230", + "sig" : "304502205e9b1c5a028070df5728c5c8af9b74e0667afa570a6cfa0114a5039ed15ee06f022100b1360907e2d9785ead362bb8d7bd661b6c29eeffd3c5037744edaeb9ad990c20", + "result" : "valid" + }, + { + "tcId" : 346, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32363138373837343138", + "sig" : "304502200671a0a85c2b72d54a2fb0990e34538b4890050f5a5712f6d1a7a5fb8578f32e022100db1846bab6b7361479ab9c3285ca41291808f27fd5bd4fdac720e5854713694c", + "result" : "valid" + }, + { + "tcId" : 347, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363432363235323632", + "sig" : "304402207673f8526748446477dbbb0590a45492c5d7d69859d301abbaedb35b2095103a02203dc70ddf9c6b524d886bed9e6af02e0e4dec0d417a414fed3807ef4422913d7c", + "result" : "valid" + }, + { + "tcId" : 348, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36383234313839343336", + "sig" : "304402207f085441070ecd2bb21285089ebb1aa6450d1a06c36d3ff39dfd657a796d12b50220249712012029870a2459d18d47da9aa492a5e6cb4b2d8dafa9e4c5c54a2b9a8b", + "result" : "valid" + }, + { + "tcId" : 349, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343834323435343235", + "sig" : "3046022100914c67fb61dd1e27c867398ea7322d5ab76df04bc5aa6683a8e0f30a5d287348022100fa07474031481dda4953e3ac1959ee8cea7e66ec412b38d6c96d28f6d37304ea", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e", + "wx" : "0ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103", + "wy" : "00c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECtmVACiNRmlAAx1yqfVEWk1DeEZA\nhVvwpph00t5f4QPFAR5u8sQtzVDV09Kfma5uuiyAySRPTFQi8Jef8MO6Xg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 350, + "comment" : "k*G has a large x-coordinate", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "303502104319055358e8617b0c46353d039cdaab022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "valid" + }, + { + "tcId" : 351, + "comment" : "r too large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000fffffffffffffffffffffffc022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ab05fd9d0de26b9ce6f4819652d9fc69193d0aa398f0fba8013e09c58220455419235271228c786759095d12b75af0692dd4103f19f6a8c32f49435a1e9b8d45", + "wx" : "00ab05fd9d0de26b9ce6f4819652d9fc69193d0aa398f0fba8013e09c582204554", + "wy" : "19235271228c786759095d12b75af0692dd4103f19f6a8c32f49435a1e9b8d45" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ab05fd9d0de26b9ce6f4819652d9fc69193d0aa398f0fba8013e09c58220455419235271228c786759095d12b75af0692dd4103f19f6a8c32f49435a1e9b8d45", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqwX9nQ3ia5zm9IGWUtn8aRk9CqOY\n8PuoAT4JxYIgRVQZI1JxIox4Z1kJXRK3WvBpLdQQPxn2qMMvSUNaHpuNRQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 352, + "comment" : "r,s are large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0480984f39a1ff38a86a68aa4201b6be5dfbfecf876219710b07badf6fdd4c6c5611feb97390d9826e7a06dfb41871c940d74415ed3cac2089f1445019bb55ed95", + "wx" : "0080984f39a1ff38a86a68aa4201b6be5dfbfecf876219710b07badf6fdd4c6c56", + "wy" : "11feb97390d9826e7a06dfb41871c940d74415ed3cac2089f1445019bb55ed95" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000480984f39a1ff38a86a68aa4201b6be5dfbfecf876219710b07badf6fdd4c6c5611feb97390d9826e7a06dfb41871c940d74415ed3cac2089f1445019bb55ed95", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgJhPOaH/OKhqaKpCAba+Xfv+z4di\nGXELB7rfb91MbFYR/rlzkNmCbnoG37QYcclA10QV7TysIInxRFAZu1XtlQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 353, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044201b4272944201c3294f5baa9a3232b6dd687495fcc19a70a95bc602b4f7c0595c37eba9ee8171c1bb5ac6feaf753bc36f463e3aef16629572c0c0a8fb0800e", + "wx" : "4201b4272944201c3294f5baa9a3232b6dd687495fcc19a70a95bc602b4f7c05", + "wy" : "0095c37eba9ee8171c1bb5ac6feaf753bc36f463e3aef16629572c0c0a8fb0800e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044201b4272944201c3294f5baa9a3232b6dd687495fcc19a70a95bc602b4f7c0595c37eba9ee8171c1bb5ac6feaf753bc36f463e3aef16629572c0c0a8fb0800e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQgG0JylEIBwylPW6qaMjK23Wh0lf\nzBmnCpW8YCtPfAWVw366nugXHBu1rG/q91O8NvRj467xZilXLAwKj7CADg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 354, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022027b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a71af64de5126a4a4e02b7922d66ce9415ce88a4c9d25514d91082c8725ac9575d47723c8fbe580bb369fec9c2665d8e30a435b9932645482e7c9f11e872296b", + "wx" : "00a71af64de5126a4a4e02b7922d66ce9415ce88a4c9d25514d91082c8725ac957", + "wy" : "5d47723c8fbe580bb369fec9c2665d8e30a435b9932645482e7c9f11e872296b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a71af64de5126a4a4e02b7922d66ce9415ce88a4c9d25514d91082c8725ac9575d47723c8fbe580bb369fec9c2665d8e30a435b9932645482e7c9f11e872296b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEpxr2TeUSakpOAreSLWbOlBXOiKTJ\n0lUU2RCCyHJayVddR3I8j75YC7Np/snCZl2OMKQ1uZMmRUgufJ8R6HIpaw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 355, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046627cec4f0731ea23fc2931f90ebe5b7572f597d20df08fc2b31ee8ef16b15726170ed77d8d0a14fc5c9c3c4c9be7f0d3ee18f709bb275eaf2073e258fe694a5", + "wx" : "6627cec4f0731ea23fc2931f90ebe5b7572f597d20df08fc2b31ee8ef16b1572", + "wy" : "6170ed77d8d0a14fc5c9c3c4c9be7f0d3ee18f709bb275eaf2073e258fe694a5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046627cec4f0731ea23fc2931f90ebe5b7572f597d20df08fc2b31ee8ef16b15726170ed77d8d0a14fc5c9c3c4c9be7f0d3ee18f709bb275eaf2073e258fe694a5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZifOxPBzHqI/wpMfkOvlt1cvWX0g\n3wj8KzHujvFrFXJhcO132NChT8XJw8TJvn8NPuGPcJuyderyBz4lj+aUpQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 356, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045a7c8825e85691cce1f5e7544c54e73f14afc010cb731343262ca7ec5a77f5bfef6edf62a4497c1bd7b147fb6c3d22af3c39bfce95f30e13a16d3d7b2812f813", + "wx" : "5a7c8825e85691cce1f5e7544c54e73f14afc010cb731343262ca7ec5a77f5bf", + "wy" : "00ef6edf62a4497c1bd7b147fb6c3d22af3c39bfce95f30e13a16d3d7b2812f813" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045a7c8825e85691cce1f5e7544c54e73f14afc010cb731343262ca7ec5a77f5bfef6edf62a4497c1bd7b147fb6c3d22af3c39bfce95f30e13a16d3d7b2812f813", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWnyIJehWkczh9edUTFTnPxSvwBDL\ncxNDJiyn7Fp39b/vbt9ipEl8G9exR/tsPSKvPDm/zpXzDhOhbT17KBL4Ew==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 357, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020105", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cbe0c29132cd738364fedd603152990c048e5e2fff996d883fa6caca7978c73770af6a8ce44cb41224b2603606f4c04d188e80bff7cc31ad5189d4ab0d70e8c1", + "wx" : "00cbe0c29132cd738364fedd603152990c048e5e2fff996d883fa6caca7978c737", + "wy" : "70af6a8ce44cb41224b2603606f4c04d188e80bff7cc31ad5189d4ab0d70e8c1" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cbe0c29132cd738364fedd603152990c048e5e2fff996d883fa6caca7978c73770af6a8ce44cb41224b2603606f4c04d188e80bff7cc31ad5189d4ab0d70e8c1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEy+DCkTLNc4Nk/t1gMVKZDASOXi//\nmW2IP6bKynl4xzdwr2qM5Ey0EiSyYDYG9MBNGI6Av/fMMa1RidSrDXDowQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 358, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020106", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042ef747671c97d9c7f9cb2f6a30d678c3d84757ba241ef7183d51a29f52d87c2ea8fb2ea635b761baefc1c4ded2099281b844e13e044c328553bbbafa337d8a76", + "wx" : "2ef747671c97d9c7f9cb2f6a30d678c3d84757ba241ef7183d51a29f52d87c2e", + "wy" : "00a8fb2ea635b761baefc1c4ded2099281b844e13e044c328553bbbafa337d8a76" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042ef747671c97d9c7f9cb2f6a30d678c3d84757ba241ef7183d51a29f52d87c2ea8fb2ea635b761baefc1c4ded2099281b844e13e044c328553bbbafa337d8a76", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELvdHZxyX2cf5yy9qMNZ4w9hHV7ok\nHvcYPVGin1LYfC6o+y6mNbdhuu/BxN7SCZKBuEThPgRMMoVTu7r6M32Kdg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 359, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04931cc49cda4d87d25b1601c56c3b83b4f45e44971998f2d3e7d3c55152214edf058dc140abbba42fc1ddbf30dab8eb9b46ee7338b3f7ee96242bf45e1df5e995", + "wx" : "00931cc49cda4d87d25b1601c56c3b83b4f45e44971998f2d3e7d3c55152214edf", + "wy" : "058dc140abbba42fc1ddbf30dab8eb9b46ee7338b3f7ee96242bf45e1df5e995" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004931cc49cda4d87d25b1601c56c3b83b4f45e44971998f2d3e7d3c55152214edf058dc140abbba42fc1ddbf30dab8eb9b46ee7338b3f7ee96242bf45e1df5e995", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkxzEnNpNh9JbFgHFbDuDtPReRJcZ\nmPLT59PFUVIhTt8FjcFAq7ukL8HdvzDauOubRu5zOLP37pYkK/ReHfXplQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 360, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04899a4af61867e3f3c190dbb48f8bc9fc74b70a467a4a1f06477b3af2f39ab8ed47ac000f9ea8a3034939bf48ad5d061a69fc8495ae4df2dbec7effa03a0062b3", + "wx" : "00899a4af61867e3f3c190dbb48f8bc9fc74b70a467a4a1f06477b3af2f39ab8ed", + "wy" : "47ac000f9ea8a3034939bf48ad5d061a69fc8495ae4df2dbec7effa03a0062b3" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004899a4af61867e3f3c190dbb48f8bc9fc74b70a467a4a1f06477b3af2f39ab8ed47ac000f9ea8a3034939bf48ad5d061a69fc8495ae4df2dbec7effa03a0062b3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiZpK9hhn4/PBkNu0j4vJ/HS3CkZ6\nSh8GR3s68vOauO1HrAAPnqijA0k5v0itXQYaafyEla5N8tvsfv+gOgBisw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 361, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020106", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d03eb09913cc20c6a8d0070f0d8d2a7f63527fafa44117fce6bd1ef2aa4ae3c46d5df3f45ac58fa334c6d102381b3120b7a2455600dcaff3d1a845514f12bf46", + "wx" : "00d03eb09913cc20c6a8d0070f0d8d2a7f63527fafa44117fce6bd1ef2aa4ae3c4", + "wy" : "6d5df3f45ac58fa334c6d102381b3120b7a2455600dcaff3d1a845514f12bf46" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d03eb09913cc20c6a8d0070f0d8d2a7f63527fafa44117fce6bd1ef2aa4ae3c46d5df3f45ac58fa334c6d102381b3120b7a2455600dcaff3d1a845514f12bf46", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0D6wmRPMIMao0AcPDY0qf2NSf6+k\nQRf85r0e8qpK48RtXfP0WsWPozTG0QI4GzEgt6JFVgDcr/PRqEVRTxK/Rg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 362, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020107", + "result" : "valid" + }, + { + "tcId" : 363, + "comment" : "r is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632557020107", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043a72476291571193b4d109b2c37b59f2807e8fe9cffd804eacded903e77ca0da592dbc74fee0ca7508cc7bc282b0c51a143286ff53c60131668e7a0929e4ed04", + "wx" : "3a72476291571193b4d109b2c37b59f2807e8fe9cffd804eacded903e77ca0da", + "wy" : "592dbc74fee0ca7508cc7bc282b0c51a143286ff53c60131668e7a0929e4ed04" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043a72476291571193b4d109b2c37b59f2807e8fe9cffd804eacded903e77ca0da592dbc74fee0ca7508cc7bc282b0c51a143286ff53c60131668e7a0929e4ed04", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEOnJHYpFXEZO00Qmyw3tZ8oB+j+nP\n/YBOrN7ZA+d8oNpZLbx0/uDKdQjMe8KCsMUaFDKG/1PGATFmjnoJKeTtBA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 364, + "comment" : "s is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020106022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc75fbd8", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d0f73792203716afd4be4329faa48d269f15313ebbba379d7783c97bf3e890d9971f4a3206605bec21782bf5e275c714417e8f566549e6bc68690d2363c89cc1", + "wx" : "00d0f73792203716afd4be4329faa48d269f15313ebbba379d7783c97bf3e890d9", + "wy" : "00971f4a3206605bec21782bf5e275c714417e8f566549e6bc68690d2363c89cc1" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d0f73792203716afd4be4329faa48d269f15313ebbba379d7783c97bf3e890d9971f4a3206605bec21782bf5e275c714417e8f566549e6bc68690d2363c89cc1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0Pc3kiA3Fq/UvkMp+qSNJp8VMT67\nujedd4PJe/PokNmXH0oyBmBb7CF4K/XidccUQX6PVmVJ5rxoaQ0jY8icwQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 365, + "comment" : "small r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3027020201000221008f1e3c7862c58b16bb76eddbb76eddbb516af4f63f2d74d76e0d28c9bb75ea88", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044838b2be35a6276a80ef9e228140f9d9b96ce83b7a254f71ccdebbb8054ce05ffa9cbc123c919b19e00238198d04069043bd660a828814051fcb8aac738a6c6b", + "wx" : "4838b2be35a6276a80ef9e228140f9d9b96ce83b7a254f71ccdebbb8054ce05f", + "wy" : "00fa9cbc123c919b19e00238198d04069043bd660a828814051fcb8aac738a6c6b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044838b2be35a6276a80ef9e228140f9d9b96ce83b7a254f71ccdebbb8054ce05ffa9cbc123c919b19e00238198d04069043bd660a828814051fcb8aac738a6c6b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAESDiyvjWmJ2qA754igUD52bls6Dt6\nJU9xzN67uAVM4F/6nLwSPJGbGeACOBmNBAaQQ71mCoKIFAUfy4qsc4psaw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 366, + "comment" : "smallish r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302c02072d9b4d347952d6022100ef3043e7329581dbb3974497710ab11505ee1c87ff907beebadd195a0ffe6d7a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "047393983ca30a520bbc4783dc9960746aab444ef520c0a8e771119aa4e74b0f64e9d7be1ab01a0bf626e709863e6a486dbaf32793afccf774e2c6cd27b1857526", + "wx" : "7393983ca30a520bbc4783dc9960746aab444ef520c0a8e771119aa4e74b0f64", + "wy" : "00e9d7be1ab01a0bf626e709863e6a486dbaf32793afccf774e2c6cd27b1857526" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200047393983ca30a520bbc4783dc9960746aab444ef520c0a8e771119aa4e74b0f64e9d7be1ab01a0bf626e709863e6a486dbaf32793afccf774e2c6cd27b1857526", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEc5OYPKMKUgu8R4PcmWB0aqtETvUg\nwKjncRGapOdLD2Tp174asBoL9ibnCYY+akhtuvMnk6/M93Tixs0nsYV1Jg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 367, + "comment" : "100-bit r and small s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d1033e67e37b32b445580bf4eff0221008b748b74000000008b748b748b748b7466e769ad4a16d3dcd87129b8e91d1b4d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045ac331a1103fe966697379f356a937f350588a05477e308851b8a502d5dfcdc5fe9993df4b57939b2b8da095bf6d794265204cfe03be995a02e65d408c871c0b", + "wx" : "5ac331a1103fe966697379f356a937f350588a05477e308851b8a502d5dfcdc5", + "wy" : "00fe9993df4b57939b2b8da095bf6d794265204cfe03be995a02e65d408c871c0b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045ac331a1103fe966697379f356a937f350588a05477e308851b8a502d5dfcdc5fe9993df4b57939b2b8da095bf6d794265204cfe03be995a02e65d408c871c0b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWsMxoRA/6WZpc3nzVqk381BYigVH\nfjCIUbilAtXfzcX+mZPfS1eTmyuNoJW/bXlCZSBM/gO+mVoC5l1AjIccCw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 368, + "comment" : "small r and 100 bit s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302702020100022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041d209be8de2de877095a399d3904c74cc458d926e27bb8e58e5eae5767c41509dd59e04c214f7b18dce351fc2a549893a6860e80163f38cc60a4f2c9d040d8c9", + "wx" : "1d209be8de2de877095a399d3904c74cc458d926e27bb8e58e5eae5767c41509", + "wy" : "00dd59e04c214f7b18dce351fc2a549893a6860e80163f38cc60a4f2c9d040d8c9" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041d209be8de2de877095a399d3904c74cc458d926e27bb8e58e5eae5767c41509dd59e04c214f7b18dce351fc2a549893a6860e80163f38cc60a4f2c9d040d8c9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHSCb6N4t6HcJWjmdOQTHTMRY2Sbi\ne7jljl6uV2fEFQndWeBMIU97GNzjUfwqVJiTpoYOgBY/OMxgpPLJ0EDYyQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 369, + "comment" : "100-bit r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d062522bbd3ecbe7c39e93e7c25022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04083539fbee44625e3acaafa2fcb41349392cef0633a1b8fabecee0c133b10e99915c1ebe7bf00df8535196770a58047ae2a402f26326bb7d41d4d7616337911e", + "wx" : "083539fbee44625e3acaafa2fcb41349392cef0633a1b8fabecee0c133b10e99", + "wy" : "00915c1ebe7bf00df8535196770a58047ae2a402f26326bb7d41d4d7616337911e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004083539fbee44625e3acaafa2fcb41349392cef0633a1b8fabecee0c133b10e99915c1ebe7bf00df8535196770a58047ae2a402f26326bb7d41d4d7616337911e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECDU5++5EYl46yq+i/LQTSTks7wYz\nobj6vs7gwTOxDpmRXB6+e/AN+FNRlncKWAR64qQC8mMmu31B1NdhYzeRHg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 370, + "comment" : "r and s^-1 are close to n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d50220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e075effd9607d08d5f34e3652f64cfa3bd6d20c58d0a232f058491260ab212a4cc61760ac8b0680c1b644c03cc628ba9dc4a3c0561368489c692bd40f43aa3ca", + "wx" : "00e075effd9607d08d5f34e3652f64cfa3bd6d20c58d0a232f058491260ab212a4", + "wy" : "00cc61760ac8b0680c1b644c03cc628ba9dc4a3c0561368489c692bd40f43aa3ca" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e075effd9607d08d5f34e3652f64cfa3bd6d20c58d0a232f058491260ab212a4cc61760ac8b0680c1b644c03cc628ba9dc4a3c0561368489c692bd40f43aa3ca", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4HXv/ZYH0I1fNONlL2TPo71tIMWN\nCiMvBYSRJgqyEqTMYXYKyLBoDBtkTAPMYoup3Eo8BWE2hInGkr1A9Dqjyg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 371, + "comment" : "r and s are 64-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30160209009c44febf31c3594f020900839ed28247c2b06b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cffb758c3073ea3c08efd9f7f17a85b6ae385c5a140c146ad5f1f5a826718bc8dfdc6bebc894144c6d418ac5d97339726ad2ae925df868426e5628e9f4e62342", + "wx" : "00cffb758c3073ea3c08efd9f7f17a85b6ae385c5a140c146ad5f1f5a826718bc8", + "wy" : "00dfdc6bebc894144c6d418ac5d97339726ad2ae925df868426e5628e9f4e62342" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cffb758c3073ea3c08efd9f7f17a85b6ae385c5a140c146ad5f1f5a826718bc8dfdc6bebc894144c6d418ac5d97339726ad2ae925df868426e5628e9f4e62342", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEz/t1jDBz6jwI79n38XqFtq44XFoU\nDBRq1fH1qCZxi8jf3GvryJQUTG1BisXZczlyatKukl34aEJuVijp9OYjQg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 372, + "comment" : "r and s are 100-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "301e020d09df8b682430beef6f5fd7c7cd020d0fd0a62e13778f4222a0d61c8a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b98740e69e61a325d5f772e3b5c4f67fb7150b16a9afeca9ddc4afcbb6fa0549c446e814138e4ebc82dbf86a390056d4595dcf45e381fef217a4597d7bd51498", + "wx" : "00b98740e69e61a325d5f772e3b5c4f67fb7150b16a9afeca9ddc4afcbb6fa0549", + "wy" : "00c446e814138e4ebc82dbf86a390056d4595dcf45e381fef217a4597d7bd51498" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b98740e69e61a325d5f772e3b5c4f67fb7150b16a9afeca9ddc4afcbb6fa0549c446e814138e4ebc82dbf86a390056d4595dcf45e381fef217a4597d7bd51498", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuYdA5p5hoyXV93LjtcT2f7cVCxap\nr+yp3cSvy7b6BUnERugUE45OvILb+Go5AFbUWV3PReOB/vIXpFl9e9UUmA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 373, + "comment" : "r and s are 128-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30260211008a598e563a89f526c32ebec8de26367c02110084f633e2042630e99dd0f1e16f7a04bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0484536a270c3932bb2084732adf2c768efc6d3977e5220229ea9a44888b8f9d7b1766398cdac2fc8000017b29a7ba15a58f196037f35f7008ed4286ddff00fd46", + "wx" : "0084536a270c3932bb2084732adf2c768efc6d3977e5220229ea9a44888b8f9d7b", + "wy" : "1766398cdac2fc8000017b29a7ba15a58f196037f35f7008ed4286ddff00fd46" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000484536a270c3932bb2084732adf2c768efc6d3977e5220229ea9a44888b8f9d7b1766398cdac2fc8000017b29a7ba15a58f196037f35f7008ed4286ddff00fd46", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhFNqJww5MrsghHMq3yx2jvxtOXfl\nIgIp6ppEiIuPnXsXZjmM2sL8gAABeymnuhWljxlgN/NfcAjtQobd/wD9Rg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 374, + "comment" : "r and s are 160-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048aeb368a7027a4d64abdea37390c0c1d6a26f399e2d9734de1eb3d0e1937387405bd13834715e1dbae9b875cf07bd55e1b6691c7f7536aef3b19bf7a4adf576d", + "wx" : "008aeb368a7027a4d64abdea37390c0c1d6a26f399e2d9734de1eb3d0e19373874", + "wy" : "05bd13834715e1dbae9b875cf07bd55e1b6691c7f7536aef3b19bf7a4adf576d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048aeb368a7027a4d64abdea37390c0c1d6a26f399e2d9734de1eb3d0e1937387405bd13834715e1dbae9b875cf07bd55e1b6691c7f7536aef3b19bf7a4adf576d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEius2inAnpNZKveo3OQwMHWom85ni\n2XNN4es9Dhk3OHQFvRODRxXh266bh1zwe9VeG2aRx/dTau87Gb96St9XbQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 375, + "comment" : "s == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020101", + "result" : "valid" + }, + { + "tcId" : 376, + "comment" : "s == 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020100", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0461722eaba731c697c7a9ba4d0afdbb5713d8aa12b0eab601bb33dbaf792c5adc272cd993b2b663aba5b3a26c101182ff178684945e83879e71598b95fe647dfc", + "wx" : "61722eaba731c697c7a9ba4d0afdbb5713d8aa12b0eab601bb33dbaf792c5adc", + "wy" : "272cd993b2b663aba5b3a26c101182ff178684945e83879e71598b95fe647dfc" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000461722eaba731c697c7a9ba4d0afdbb5713d8aa12b0eab601bb33dbaf792c5adc272cd993b2b663aba5b3a26c101182ff178684945e83879e71598b95fe647dfc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYXIuq6cxxpfHqbpNCv27VxPYqhKw\n6rYBuzPbr3ksWtwnLNmTsrZjq6WzomwQEYL/F4aElF6Dh55xWYuV/mR9/A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 377, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022002f676969f451a8ccafa4c4f09791810e6d632dbd60b1d5540f3284fbe1889b0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c4c91981e720e20d7e478ff19d09b95a98f58c0f469b72801a8ce844a347316594afcd4188182e7779889b3258d0368ece1e66797fe7c648c6f0b9e26bd71871", + "wx" : "00c4c91981e720e20d7e478ff19d09b95a98f58c0f469b72801a8ce844a3473165", + "wy" : "0094afcd4188182e7779889b3258d0368ece1e66797fe7c648c6f0b9e26bd71871" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c4c91981e720e20d7e478ff19d09b95a98f58c0f469b72801a8ce844a347316594afcd4188182e7779889b3258d0368ece1e66797fe7c648c6f0b9e26bd71871", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExMkZgecg4g1+R4/xnQm5Wpj1jA9G\nm3KAGozoRKNHMWWUr81BiBgud3mImzJY0DaOzh5meX/nxkjG8Lnia9cYcQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 378, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204e260962e33362ef0046126d2d5a4edc6947ab20e19b8ec19cf79e5908b6e628", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d58d47bf49bc8f416641f6f760fcbca80aa52a814e56a5fa40bab44fd6f6317216deaa84d45d8e0e29cc9ecf5653f8ee6444750813becae8deb42b04ba07a634", + "wx" : "00d58d47bf49bc8f416641f6f760fcbca80aa52a814e56a5fa40bab44fd6f63172", + "wy" : "16deaa84d45d8e0e29cc9ecf5653f8ee6444750813becae8deb42b04ba07a634" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d58d47bf49bc8f416641f6f760fcbca80aa52a814e56a5fa40bab44fd6f6317216deaa84d45d8e0e29cc9ecf5653f8ee6444750813becae8deb42b04ba07a634", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Y1Hv0m8j0FmQfb3YPy8qAqlKoFO\nVqX6QLq0T9b2MXIW3qqE1F2ODinMns9WU/juZER1CBO+yujetCsEugemNA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 379, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220077ed0d8f20f697d8fc591ac64dd5219c7932122b4f9b9ec6441e44a0092cf21", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0491e305822e5e44f3fdb616e2ef42cd98f241b86e9f68815bc4dba6a945e4eefb3c5937e2ac1d9466f6d65e49b35fc8d75ffc22e1fe2f32af42f5fa3c26f9b4b0", + "wx" : "0091e305822e5e44f3fdb616e2ef42cd98f241b86e9f68815bc4dba6a945e4eefb", + "wy" : "3c5937e2ac1d9466f6d65e49b35fc8d75ffc22e1fe2f32af42f5fa3c26f9b4b0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000491e305822e5e44f3fdb616e2ef42cd98f241b86e9f68815bc4dba6a945e4eefb3c5937e2ac1d9466f6d65e49b35fc8d75ffc22e1fe2f32af42f5fa3c26f9b4b0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkeMFgi5eRPP9thbi70LNmPJBuG6f\naIFbxNumqUXk7vs8WTfirB2UZvbWXkmzX8jXX/wi4f4vMq9C9fo8Jvm0sA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 380, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203e0292a67e181c6c0105ee35e956e78e9bdd033c6e71ae57884039a245e4175f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0424a0bc4d16dbbd40d2fd81a7c3f8d8ec741607d5bb406a0611cc60d0e683bd46b575cad039c15f7f3dffcfc007b4b0f743c871ecc76a504a32672fd84526d861", + "wx" : "24a0bc4d16dbbd40d2fd81a7c3f8d8ec741607d5bb406a0611cc60d0e683bd46", + "wy" : "00b575cad039c15f7f3dffcfc007b4b0f743c871ecc76a504a32672fd84526d861" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000424a0bc4d16dbbd40d2fd81a7c3f8d8ec741607d5bb406a0611cc60d0e683bd46b575cad039c15f7f3dffcfc007b4b0f743c871ecc76a504a32672fd84526d861", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJKC8TRbbvUDS/YGnw/jY7HQWB9W7\nQGoGEcxg0OaDvUa1dcrQOcFffz3/z8AHtLD3Q8hx7MdqUEoyZy/YRSbYYQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 381, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022013d22b06d6b8f5d97e0c64962b4a3bae30f668ca6217ef5b35d799f159e23ebe", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d24dd06745cafb39186d22a92aa0e58169a79ab69488628a9da5ed3ef747269b7e9209d98faeb95355948adae61d5291c6015d3ee9513486d886fb05cbd25c6a", + "wx" : "00d24dd06745cafb39186d22a92aa0e58169a79ab69488628a9da5ed3ef747269b", + "wy" : "7e9209d98faeb95355948adae61d5291c6015d3ee9513486d886fb05cbd25c6a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d24dd06745cafb39186d22a92aa0e58169a79ab69488628a9da5ed3ef747269b7e9209d98faeb95355948adae61d5291c6015d3ee9513486d886fb05cbd25c6a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0k3QZ0XK+zkYbSKpKqDlgWmnmraU\niGKKnaXtPvdHJpt+kgnZj665U1WUitrmHVKRxgFdPulRNIbYhvsFy9Jcag==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 382, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204523ce342e4994bb8968bf6613f60c06c86111f15a3a389309e72cd447d5dd99", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048200f148e7eab1581bcd1e23946f8a9b8191d9641f9560341721f9d3fec3d63ece795669e0481e035de8623d716a6984d0a4809d6c65519443ee55260f7f3dcb", + "wx" : "008200f148e7eab1581bcd1e23946f8a9b8191d9641f9560341721f9d3fec3d63e", + "wy" : "00ce795669e0481e035de8623d716a6984d0a4809d6c65519443ee55260f7f3dcb" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048200f148e7eab1581bcd1e23946f8a9b8191d9641f9560341721f9d3fec3d63ece795669e0481e035de8623d716a6984d0a4809d6c65519443ee55260f7f3dcb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEggDxSOfqsVgbzR4jlG+Km4GR2WQf\nlWA0FyH50/7D1j7OeVZp4EgeA13oYj1xammE0KSAnWxlUZRD7lUmD389yw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 383, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022037d765be3c9c78189ad30edb5097a4db670de11686d01420e37039d4677f4809", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a8a69c5ed33b150ce8d37ac197070ed894c05d47258a80c9041d92486622024de85997c9666b60a393568efede8f4ca0167c1e10f626e62fc1b8c8e9c6ba6ed7", + "wx" : "00a8a69c5ed33b150ce8d37ac197070ed894c05d47258a80c9041d92486622024d", + "wy" : "00e85997c9666b60a393568efede8f4ca0167c1e10f626e62fc1b8c8e9c6ba6ed7" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a8a69c5ed33b150ce8d37ac197070ed894c05d47258a80c9041d92486622024de85997c9666b60a393568efede8f4ca0167c1e10f626e62fc1b8c8e9c6ba6ed7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqKacXtM7FQzo03rBlwcO2JTAXUcl\nioDJBB2SSGYiAk3oWZfJZmtgo5NWjv7ej0ygFnweEPYm5i/BuMjpxrpu1w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 384, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022044237823b54e0c74c2bf5f759d9ac5f8cb897d537ffa92effd4f0bb6c9acd860", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ed0587e75b3b9a1dd0794f41d1729fcd432b2436cbf51c230d8bc7273273181735a57f09c7873d3964aa8102c9e25fa53070cd924cb7e3a459174740b8b71c34", + "wx" : "00ed0587e75b3b9a1dd0794f41d1729fcd432b2436cbf51c230d8bc72732731817", + "wy" : "35a57f09c7873d3964aa8102c9e25fa53070cd924cb7e3a459174740b8b71c34" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ed0587e75b3b9a1dd0794f41d1729fcd432b2436cbf51c230d8bc7273273181735a57f09c7873d3964aa8102c9e25fa53070cd924cb7e3a459174740b8b71c34", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7QWH51s7mh3QeU9B0XKfzUMrJDbL\n9RwjDYvHJzJzGBc1pX8Jx4c9OWSqgQLJ4l+lMHDNkky346RZF0dAuLccNA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 385, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220266d30a485385906054ca86d46f5f2b17e7f4646a3092092ad92877126538111", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04077091d99004a99ee08224e59a46a70495e6fba4eff681c3ce42127e588681ef4f1c16c77dfa440dde18245c9de76243d8f2fd9dea3f2782d6c04974d02f25dc", + "wx" : "077091d99004a99ee08224e59a46a70495e6fba4eff681c3ce42127e588681ef", + "wy" : "4f1c16c77dfa440dde18245c9de76243d8f2fd9dea3f2782d6c04974d02f25dc" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004077091d99004a99ee08224e59a46a70495e6fba4eff681c3ce42127e588681ef4f1c16c77dfa440dde18245c9de76243d8f2fd9dea3f2782d6c04974d02f25dc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEB3CR2ZAEqZ7ggiTlmkanBJXm+6Tv\n9oHDzkISfliGge9PHBbHffpEDd4YJFyd52JD2PL9neo/J4LWwEl00C8l3A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 386, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220538c7b3798e84d0ce90340165806348971ed44db8f0c674f5f215968390f92ee", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04616a8b8e57d82c11678f5827911024cd23a16cb52a65f230fb554a7b110c35a5bb466660be5cab3e4b587c12b45bd998bd56c7d66c2f94d03a1a6d2028d8a154", + "wx" : "616a8b8e57d82c11678f5827911024cd23a16cb52a65f230fb554a7b110c35a5", + "wy" : "00bb466660be5cab3e4b587c12b45bd998bd56c7d66c2f94d03a1a6d2028d8a154" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004616a8b8e57d82c11678f5827911024cd23a16cb52a65f230fb554a7b110c35a5bb466660be5cab3e4b587c12b45bd998bd56c7d66c2f94d03a1a6d2028d8a154", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYWqLjlfYLBFnj1gnkRAkzSOhbLUq\nZfIw+1VKexEMNaW7RmZgvlyrPktYfBK0W9mYvVbH1mwvlNA6Gm0gKNihVA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 387, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206fef0ef15d1688e15e704c4e6bb8bb7f40d52d3af5c661bb78c4ed9b408699b3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0471dc92b2b1baa7612c4a53427a0d2dfe548fa9cf829bb6b248f736a5eb30b513f91c7dff1144cb36057c2b859f35bd666a7961833b06de0f45159fbae208e326", + "wx" : "71dc92b2b1baa7612c4a53427a0d2dfe548fa9cf829bb6b248f736a5eb30b513", + "wy" : "00f91c7dff1144cb36057c2b859f35bd666a7961833b06de0f45159fbae208e326" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000471dc92b2b1baa7612c4a53427a0d2dfe548fa9cf829bb6b248f736a5eb30b513f91c7dff1144cb36057c2b859f35bd666a7961833b06de0f45159fbae208e326", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcdySsrG6p2EsSlNCeg0t/lSPqc+C\nm7aySPc2peswtRP5HH3/EUTLNgV8K4WfNb1manlhgzsG3g9FFZ+64gjjJg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 388, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206f44275e9aeb1331efcb8d58f35c0252791427e403ad84daad51d247cc2a64c6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04662f43ae614bd9c90ff3fcded25cf0ef186b6967a47aa6aa7ae7f396594df931f5f94a525edd50d3738f7a28d03d7a2a70095c8f89de9bb2c645fea8d8bac9e0", + "wx" : "662f43ae614bd9c90ff3fcded25cf0ef186b6967a47aa6aa7ae7f396594df931", + "wy" : "00f5f94a525edd50d3738f7a28d03d7a2a70095c8f89de9bb2c645fea8d8bac9e0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004662f43ae614bd9c90ff3fcded25cf0ef186b6967a47aa6aa7ae7f396594df931f5f94a525edd50d3738f7a28d03d7a2a70095c8f89de9bb2c645fea8d8bac9e0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZi9DrmFL2ckP8/ze0lzw7xhraWek\neqaqeufzlllN+TH1+UpSXt1Q03OPeijQPXoqcAlcj4nem7LGRf6o2LrJ4A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 389, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022021323755b103d2f9da6ab83eccab9ad8598bcf625652f10e7a3eeee3c3945fb3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04dff107959bd2f7386497a5624430a0ab35e552c1a4e4dc9c298caeb96353170dcb5065d7947a676c76287ca8e430324f8a534b0ba6f21200e033c4b88852a3cc", + "wx" : "00dff107959bd2f7386497a5624430a0ab35e552c1a4e4dc9c298caeb96353170d", + "wy" : "00cb5065d7947a676c76287ca8e430324f8a534b0ba6f21200e033c4b88852a3cc" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004dff107959bd2f7386497a5624430a0ab35e552c1a4e4dc9c298caeb96353170dcb5065d7947a676c76287ca8e430324f8a534b0ba6f21200e033c4b88852a3cc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3/EHlZvS9zhkl6ViRDCgqzXlUsGk\n5NycKYyuuWNTFw3LUGXXlHpnbHYofKjkMDJPilNLC6byEgDgM8S4iFKjzA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 390, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206c50acfe76de1289e7a5edb240f1c2a7879db6873d5d931f3c6ac467a6eac171", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bd0862b0bfba85036922e06f5458754aafc3075b603a814b3ac75659bf24d7528258a607ffca2cfe05a300cb4c3c4e1963bbb1bc54d320e16969f85aad243385", + "wx" : "00bd0862b0bfba85036922e06f5458754aafc3075b603a814b3ac75659bf24d752", + "wy" : "008258a607ffca2cfe05a300cb4c3c4e1963bbb1bc54d320e16969f85aad243385" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bd0862b0bfba85036922e06f5458754aafc3075b603a814b3ac75659bf24d7528258a607ffca2cfe05a300cb4c3c4e1963bbb1bc54d320e16969f85aad243385", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvQhisL+6hQNpIuBvVFh1Sq/DB1tg\nOoFLOsdWWb8k11KCWKYH/8os/gWjAMtMPE4ZY7uxvFTTIOFpafharSQzhQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 391, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220755b7fffb0b17ad57dca50fcefb7fe297b029df25e5ccb5069e8e70c2742c2a6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b533d4695dd5b8c5e07757e55e6e516f7e2c88fa0239e23f60e8ec07dd70f2871b134ee58cc583278456863f33c3a85d881f7d4a39850143e29d4eaf009afe47", + "wx" : "00b533d4695dd5b8c5e07757e55e6e516f7e2c88fa0239e23f60e8ec07dd70f287", + "wy" : "1b134ee58cc583278456863f33c3a85d881f7d4a39850143e29d4eaf009afe47" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b533d4695dd5b8c5e07757e55e6e516f7e2c88fa0239e23f60e8ec07dd70f2871b134ee58cc583278456863f33c3a85d881f7d4a39850143e29d4eaf009afe47", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEtTPUaV3VuMXgd1flXm5Rb34siPoC\nOeI/YOjsB91w8ocbE07ljMWDJ4RWhj8zw6hdiB99SjmFAUPinU6vAJr+Rw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 392, + "comment" : "point at infinity during verify", + "flags" : [ + "PointDuplication", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a80220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f50d371b91bfb1d7d14e1323523bc3aa8cbf2c57f9e284de628c8b4536787b86f94ad887ac94d527247cd2e7d0c8b1291c553c9730405380b14cbb209f5fa2dd", + "wx" : "00f50d371b91bfb1d7d14e1323523bc3aa8cbf2c57f9e284de628c8b4536787b86", + "wy" : "00f94ad887ac94d527247cd2e7d0c8b1291c553c9730405380b14cbb209f5fa2dd" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f50d371b91bfb1d7d14e1323523bc3aa8cbf2c57f9e284de628c8b4536787b86f94ad887ac94d527247cd2e7d0c8b1291c553c9730405380b14cbb209f5fa2dd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9Q03G5G/sdfRThMjUjvDqoy/LFf5\n4oTeYoyLRTZ4e4b5StiHrJTVJyR80ufQyLEpHFU8lzBAU4CxTLsgn1+i3Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 393, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0468ec6e298eafe16539156ce57a14b04a7047c221bafc3a582eaeb0d857c4d94697bed1af17850117fdb39b2324f220a5698ed16c426a27335bb385ac8ca6fb30", + "wx" : "68ec6e298eafe16539156ce57a14b04a7047c221bafc3a582eaeb0d857c4d946", + "wy" : "0097bed1af17850117fdb39b2324f220a5698ed16c426a27335bb385ac8ca6fb30" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000468ec6e298eafe16539156ce57a14b04a7047c221bafc3a582eaeb0d857c4d94697bed1af17850117fdb39b2324f220a5698ed16c426a27335bb385ac8ca6fb30", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaOxuKY6v4WU5FWzlehSwSnBHwiG6\n/DpYLq6w2FfE2UaXvtGvF4UBF/2zmyMk8iClaY7RbEJqJzNbs4WsjKb7MA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 394, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0469da0364734d2e530fece94019265fefb781a0f1b08f6c8897bdf6557927c8b866d2d3c7dcd518b23d726960f069ad71a933d86ef8abbcce8b20f71e2a847002", + "wx" : "69da0364734d2e530fece94019265fefb781a0f1b08f6c8897bdf6557927c8b8", + "wy" : "66d2d3c7dcd518b23d726960f069ad71a933d86ef8abbcce8b20f71e2a847002" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000469da0364734d2e530fece94019265fefb781a0f1b08f6c8897bdf6557927c8b866d2d3c7dcd518b23d726960f069ad71a933d86ef8abbcce8b20f71e2a847002", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEadoDZHNNLlMP7OlAGSZf77eBoPGw\nj2yIl732VXknyLhm0tPH3NUYsj1yaWDwaa1xqTPYbvirvM6LIPceKoRwAg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 395, + "comment" : "u1 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d8adc00023a8edc02576e2b63e3e30621a471e2b2320620187bf067a1ac1ff3233e2b50ec09807accb36131fff95ed12a09a86b4ea9690aa32861576ba2362e1", + "wx" : "00d8adc00023a8edc02576e2b63e3e30621a471e2b2320620187bf067a1ac1ff32", + "wy" : "33e2b50ec09807accb36131fff95ed12a09a86b4ea9690aa32861576ba2362e1" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d8adc00023a8edc02576e2b63e3e30621a471e2b2320620187bf067a1ac1ff3233e2b50ec09807accb36131fff95ed12a09a86b4ea9690aa32861576ba2362e1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2K3AACOo7cAlduK2Pj4wYhpHHisj\nIGIBh78GehrB/zIz4rUOwJgHrMs2Ex//le0SoJqGtOqWkKoyhhV2uiNi4Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 396, + "comment" : "u1 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022044a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043623ac973ced0a56fa6d882f03a7d5c7edca02cfc7b2401fab3690dbe75ab7858db06908e64b28613da7257e737f39793da8e713ba0643b92e9bb3252be7f8fe", + "wx" : "3623ac973ced0a56fa6d882f03a7d5c7edca02cfc7b2401fab3690dbe75ab785", + "wy" : "008db06908e64b28613da7257e737f39793da8e713ba0643b92e9bb3252be7f8fe" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043623ac973ced0a56fa6d882f03a7d5c7edca02cfc7b2401fab3690dbe75ab7858db06908e64b28613da7257e737f39793da8e713ba0643b92e9bb3252be7f8fe", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENiOslzztClb6bYgvA6fVx+3KAs/H\nskAfqzaQ2+dat4WNsGkI5ksoYT2nJX5zfzl5PajnE7oGQ7kum7MlK+f4/g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 397, + "comment" : "u2 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cf04ea77e9622523d894b93ff52dc3027b31959503b6fa3890e5e04263f922f1e8528fb7c006b3983c8b8400e57b4ed71740c2f3975438821199bedeaecab2e9", + "wx" : "00cf04ea77e9622523d894b93ff52dc3027b31959503b6fa3890e5e04263f922f1", + "wy" : "00e8528fb7c006b3983c8b8400e57b4ed71740c2f3975438821199bedeaecab2e9" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cf04ea77e9622523d894b93ff52dc3027b31959503b6fa3890e5e04263f922f1e8528fb7c006b3983c8b8400e57b4ed71740c2f3975438821199bedeaecab2e9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzwTqd+liJSPYlLk/9S3DAnsxlZUD\ntvo4kOXgQmP5IvHoUo+3wAazmDyLhADle07XF0DC85dUOIIRmb7ersqy6Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 398, + "comment" : "u2 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04db7a2c8a1ab573e5929dc24077b508d7e683d49227996bda3e9f78dbeff773504f417f3bc9a88075c2e0aadd5a13311730cf7cc76a82f11a36eaf08a6c99a206", + "wx" : "00db7a2c8a1ab573e5929dc24077b508d7e683d49227996bda3e9f78dbeff77350", + "wy" : "4f417f3bc9a88075c2e0aadd5a13311730cf7cc76a82f11a36eaf08a6c99a206" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004db7a2c8a1ab573e5929dc24077b508d7e683d49227996bda3e9f78dbeff773504f417f3bc9a88075c2e0aadd5a13311730cf7cc76a82f11a36eaf08a6c99a206", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE23osihq1c+WSncJAd7UI1+aD1JIn\nmWvaPp942+/3c1BPQX87yaiAdcLgqt1aEzEXMM98x2qC8Ro26vCKbJmiBg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 399, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100e91e1ba60fdedb76a46bcb51dc0b8b4b7e019f0a28721885fa5d3a8196623397", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04dead11c7a5b396862f21974dc4752fadeff994efe9bbd05ab413765ea80b6e1f1de3f0640e8ac6edcf89cff53c40e265bb94078a343736df07aa0318fc7fe1ff", + "wx" : "00dead11c7a5b396862f21974dc4752fadeff994efe9bbd05ab413765ea80b6e1f", + "wy" : "1de3f0640e8ac6edcf89cff53c40e265bb94078a343736df07aa0318fc7fe1ff" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004dead11c7a5b396862f21974dc4752fadeff994efe9bbd05ab413765ea80b6e1f1de3f0640e8ac6edcf89cff53c40e265bb94078a343736df07aa0318fc7fe1ff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3q0Rx6WzloYvIZdNxHUvre/5lO/p\nu9BatBN2XqgLbh8d4/BkDorG7c+Jz/U8QOJlu5QHijQ3Nt8HqgMY/H/h/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 400, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100fdea5843ffeb73af94313ba4831b53fe24f799e525b1e8e8c87b59b95b430ad9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d0bc472e0d7c81ebaed3a6ef96c18613bb1fea6f994326fbe80e00dfde67c7e9986c723ea4843d48389b946f64ad56c83ad70ff17ba85335667d1bb9fa619efd", + "wx" : "00d0bc472e0d7c81ebaed3a6ef96c18613bb1fea6f994326fbe80e00dfde67c7e9", + "wy" : "00986c723ea4843d48389b946f64ad56c83ad70ff17ba85335667d1bb9fa619efd" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d0bc472e0d7c81ebaed3a6ef96c18613bb1fea6f994326fbe80e00dfde67c7e9986c723ea4843d48389b946f64ad56c83ad70ff17ba85335667d1bb9fa619efd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0LxHLg18geuu06bvlsGGE7sf6m+Z\nQyb76A4A395nx+mYbHI+pIQ9SDiblG9krVbIOtcP8XuoUzVmfRu5+mGe/Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 401, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022003ffcabf2f1b4d2a65190db1680d62bb994e41c5251cd73b3c3dfc5e5bafc035", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a0a44ca947d66a2acb736008b9c08d1ab2ad03776e02640f78495d458dd51c326337fe5cf8c4604b1f1c409dc2d872d4294a4762420df43a30a2392e40426add", + "wx" : "00a0a44ca947d66a2acb736008b9c08d1ab2ad03776e02640f78495d458dd51c32", + "wy" : "6337fe5cf8c4604b1f1c409dc2d872d4294a4762420df43a30a2392e40426add" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a0a44ca947d66a2acb736008b9c08d1ab2ad03776e02640f78495d458dd51c326337fe5cf8c4604b1f1c409dc2d872d4294a4762420df43a30a2392e40426add", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoKRMqUfWairLc2AIucCNGrKtA3du\nAmQPeEldRY3VHDJjN/5c+MRgSx8cQJ3C2HLUKUpHYkIN9DowojkuQEJq3Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 402, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02204dfbc401f971cd304b33dfdb17d0fed0fe4c1a88ae648e0d2847f74977534989", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c9c2115290d008b45fb65fad0f602389298c25420b775019d42b62c3ce8a96b73877d25a8080dc02d987ca730f0405c2c9dbefac46f9e601cc3f06e9713973fd", + "wx" : "00c9c2115290d008b45fb65fad0f602389298c25420b775019d42b62c3ce8a96b7", + "wy" : "3877d25a8080dc02d987ca730f0405c2c9dbefac46f9e601cc3f06e9713973fd" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c9c2115290d008b45fb65fad0f602389298c25420b775019d42b62c3ce8a96b73877d25a8080dc02d987ca730f0405c2c9dbefac46f9e601cc3f06e9713973fd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEycIRUpDQCLRftl+tD2AjiSmMJUIL\nd1AZ1Ctiw86Klrc4d9JagIDcAtmHynMPBAXCydvvrEb55gHMPwbpcTlz/Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 403, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bc4024761cd2ffd43dfdb17d0fed112b988977055cd3a8e54971eba9cda5ca71", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045eca1ef4c287dddc66b8bccf1b88e8a24c0018962f3c5e7efa83bc1a5ff6033e5e79c4cb2c245b8c45abdce8a8e4da758d92a607c32cd407ecaef22f1c934a71", + "wx" : "5eca1ef4c287dddc66b8bccf1b88e8a24c0018962f3c5e7efa83bc1a5ff6033e", + "wy" : "5e79c4cb2c245b8c45abdce8a8e4da758d92a607c32cd407ecaef22f1c934a71" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045eca1ef4c287dddc66b8bccf1b88e8a24c0018962f3c5e7efa83bc1a5ff6033e5e79c4cb2c245b8c45abdce8a8e4da758d92a607c32cd407ecaef22f1c934a71", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXsoe9MKH3dxmuLzPG4jookwAGJYv\nPF5++oO8Gl/2Az5eecTLLCRbjEWr3Oio5Np1jZKmB8Ms1AfsrvIvHJNKcQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 404, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220788048ed39a5ffa77bfb62fa1fda2257742bf35d128fb3459f2a0c909ee86f91", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045caaa030e7fdf0e4936bc7ab5a96353e0a01e4130c3f8bf22d473e317029a47adeb6adc462f7058f2a20d371e9702254e9b201642005b3ceda926b42b178bef9", + "wx" : "5caaa030e7fdf0e4936bc7ab5a96353e0a01e4130c3f8bf22d473e317029a47a", + "wy" : "00deb6adc462f7058f2a20d371e9702254e9b201642005b3ceda926b42b178bef9" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045caaa030e7fdf0e4936bc7ab5a96353e0a01e4130c3f8bf22d473e317029a47adeb6adc462f7058f2a20d371e9702254e9b201642005b3ceda926b42b178bef9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXKqgMOf98OSTa8erWpY1PgoB5BMM\nP4vyLUc+MXAppHretq3EYvcFjyog03HpcCJU6bIBZCAFs87akmtCsXi++Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 405, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220476d9131fd381bd917d0fed112bc9e0a5924b5ed5b11167edd8b23582b3cb15e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c2fd20bac06e555bb8ac0ce69eb1ea20f83a1fc3501c8a66469b1a31f619b0986237050779f52b615bd7b8d76a25fc95ca2ed32525c75f27ffc87ac397e6cbaf", + "wx" : "00c2fd20bac06e555bb8ac0ce69eb1ea20f83a1fc3501c8a66469b1a31f619b098", + "wy" : "6237050779f52b615bd7b8d76a25fc95ca2ed32525c75f27ffc87ac397e6cbaf" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c2fd20bac06e555bb8ac0ce69eb1ea20f83a1fc3501c8a66469b1a31f619b0986237050779f52b615bd7b8d76a25fc95ca2ed32525c75f27ffc87ac397e6cbaf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwv0gusBuVVu4rAzmnrHqIPg6H8NQ\nHIpmRpsaMfYZsJhiNwUHefUrYVvXuNdqJfyVyi7TJSXHXyf/yHrDl+bLrw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 406, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0221008374253e3e21bd154448d0a8f640fe46fafa8b19ce78d538f6cc0a19662d3601", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043fd6a1ca7f77fb3b0bbe726c372010068426e11ea6ae78ce17bedae4bba86ced03ce5516406bf8cfaab8745eac1cd69018ad6f50b5461872ddfc56e0db3c8ff4", + "wx" : "3fd6a1ca7f77fb3b0bbe726c372010068426e11ea6ae78ce17bedae4bba86ced", + "wy" : "03ce5516406bf8cfaab8745eac1cd69018ad6f50b5461872ddfc56e0db3c8ff4" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043fd6a1ca7f77fb3b0bbe726c372010068426e11ea6ae78ce17bedae4bba86ced03ce5516406bf8cfaab8745eac1cd69018ad6f50b5461872ddfc56e0db3c8ff4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEP9ahyn93+zsLvnJsNyAQBoQm4R6m\nrnjOF77a5LuobO0DzlUWQGv4z6q4dF6sHNaQGK1vULVGGHLd/Fbg2zyP9A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 407, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220357cfd3be4d01d413c5b9ede36cba5452c11ee7fe14879e749ae6a2d897a52d6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049cb8e51e27a5ae3b624a60d6dc32734e4989db20e9bca3ede1edf7b086911114b4c104ab3c677e4b36d6556e8ad5f523410a19f2e277aa895fc57322b4427544", + "wx" : "009cb8e51e27a5ae3b624a60d6dc32734e4989db20e9bca3ede1edf7b086911114", + "wy" : "00b4c104ab3c677e4b36d6556e8ad5f523410a19f2e277aa895fc57322b4427544" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049cb8e51e27a5ae3b624a60d6dc32734e4989db20e9bca3ede1edf7b086911114b4c104ab3c677e4b36d6556e8ad5f523410a19f2e277aa895fc57322b4427544", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnLjlHielrjtiSmDW3DJzTkmJ2yDp\nvKPt4e33sIaRERS0wQSrPGd+SzbWVW6K1fUjQQoZ8uJ3qolfxXMitEJ1RA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 408, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022029798c5c0ee287d4a5e8e6b799fd86b8df5225298e6ffc807cd2f2bc27a0a6d8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a3e52c156dcaf10502620b7955bc2b40bc78ef3d569e1223c262512d8f49602a4a2039f31c1097024ad3cc86e57321de032355463486164cf192944977df147f", + "wx" : "00a3e52c156dcaf10502620b7955bc2b40bc78ef3d569e1223c262512d8f49602a", + "wy" : "4a2039f31c1097024ad3cc86e57321de032355463486164cf192944977df147f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a3e52c156dcaf10502620b7955bc2b40bc78ef3d569e1223c262512d8f49602a4a2039f31c1097024ad3cc86e57321de032355463486164cf192944977df147f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+UsFW3K8QUCYgt5VbwrQLx47z1W\nnhIjwmJRLY9JYCpKIDnzHBCXAkrTzIblcyHeAyNVRjSGFkzxkpRJd98Ufw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 409, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02200b70f22c781092452dca1a5711fa3a5a1f72add1bf52c2ff7cae4820b30078dd", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f19b78928720d5bee8e670fb90010fb15c37bf91b58a5157c3f3c059b2655e88cf701ec962fb4a11dcf273f5dc357e58468560c7cfeb942d074abd4329260509", + "wx" : "00f19b78928720d5bee8e670fb90010fb15c37bf91b58a5157c3f3c059b2655e88", + "wy" : "00cf701ec962fb4a11dcf273f5dc357e58468560c7cfeb942d074abd4329260509" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f19b78928720d5bee8e670fb90010fb15c37bf91b58a5157c3f3c059b2655e88cf701ec962fb4a11dcf273f5dc357e58468560c7cfeb942d074abd4329260509", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8Zt4kocg1b7o5nD7kAEPsVw3v5G1\nilFXw/PAWbJlXojPcB7JYvtKEdzyc/XcNX5YRoVgx8/rlC0HSr1DKSYFCQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 410, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022016e1e458f021248a5b9434ae23f474b43ee55ba37ea585fef95c90416600f1ba", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0483a744459ecdfb01a5cf52b27a05bb7337482d242f235d7b4cb89345545c90a8c05d49337b9649813287de9ffe90355fd905df5f3c32945828121f37cc50de6e", + "wx" : "0083a744459ecdfb01a5cf52b27a05bb7337482d242f235d7b4cb89345545c90a8", + "wy" : "00c05d49337b9649813287de9ffe90355fd905df5f3c32945828121f37cc50de6e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000483a744459ecdfb01a5cf52b27a05bb7337482d242f235d7b4cb89345545c90a8c05d49337b9649813287de9ffe90355fd905df5f3c32945828121f37cc50de6e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEg6dERZ7N+wGlz1KyegW7czdILSQv\nI117TLiTRVRckKjAXUkze5ZJgTKH3p/+kDVf2QXfXzwylFgoEh83zFDebg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 411, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02202252d6856831b6cf895e4f0535eeaf0e5e5809753df848fe760ad86219016a97", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04dd13c6b34c56982ddae124f039dfd23f4b19bbe88cee8e528ae51e5d6f3a21d7bfad4c2e6f263fe5eb59ca974d039fc0e4c3345692fb5320bdae4bd3b42a45ff", + "wx" : "00dd13c6b34c56982ddae124f039dfd23f4b19bbe88cee8e528ae51e5d6f3a21d7", + "wy" : "00bfad4c2e6f263fe5eb59ca974d039fc0e4c3345692fb5320bdae4bd3b42a45ff" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004dd13c6b34c56982ddae124f039dfd23f4b19bbe88cee8e528ae51e5d6f3a21d7bfad4c2e6f263fe5eb59ca974d039fc0e4c3345692fb5320bdae4bd3b42a45ff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3RPGs0xWmC3a4STwOd/SP0sZu+iM\n7o5SiuUeXW86Ide/rUwubyY/5etZypdNA5/A5MM0VpL7UyC9rkvTtCpF/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 412, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02210081ffe55f178da695b28c86d8b406b15dab1a9e39661a3ae017fbe390ac0972c3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0467e6f659cdde869a2f65f094e94e5b4dfad636bbf95192feeed01b0f3deb7460a37e0a51f258b7aeb51dfe592f5cfd5685bbe58712c8d9233c62886437c38ba0", + "wx" : "67e6f659cdde869a2f65f094e94e5b4dfad636bbf95192feeed01b0f3deb7460", + "wy" : "00a37e0a51f258b7aeb51dfe592f5cfd5685bbe58712c8d9233c62886437c38ba0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000467e6f659cdde869a2f65f094e94e5b4dfad636bbf95192feeed01b0f3deb7460a37e0a51f258b7aeb51dfe592f5cfd5685bbe58712c8d9233c62886437c38ba0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZ+b2Wc3ehpovZfCU6U5bTfrWNrv5\nUZL+7tAbDz3rdGCjfgpR8li3rrUd/lkvXP1WhbvlhxLI2SM8YohkN8OLoA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 413, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042eb6412505aec05c6545f029932087e490d05511e8ec1f599617bb367f9ecaaf805f51efcc4803403f9b1ae0124890f06a43fedcddb31830f6669af292895cb0", + "wx" : "2eb6412505aec05c6545f029932087e490d05511e8ec1f599617bb367f9ecaaf", + "wy" : "00805f51efcc4803403f9b1ae0124890f06a43fedcddb31830f6669af292895cb0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042eb6412505aec05c6545f029932087e490d05511e8ec1f599617bb367f9ecaaf805f51efcc4803403f9b1ae0124890f06a43fedcddb31830f6669af292895cb0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELrZBJQWuwFxlRfApkyCH5JDQVRHo\n7B9Zlhe7Nn+eyq+AX1HvzEgDQD+bGuASSJDwakP+3N2zGDD2ZprykolcsA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 414, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0484db645868eab35e3a9fd80e056e2e855435e3a6b68d75a50a854625fe0d7f356d2589ac655edc9a11ef3e075eddda9abf92e72171570ef7bf43a2ee39338cfe", + "wx" : "0084db645868eab35e3a9fd80e056e2e855435e3a6b68d75a50a854625fe0d7f35", + "wy" : "6d2589ac655edc9a11ef3e075eddda9abf92e72171570ef7bf43a2ee39338cfe" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000484db645868eab35e3a9fd80e056e2e855435e3a6b68d75a50a854625fe0d7f356d2589ac655edc9a11ef3e075eddda9abf92e72171570ef7bf43a2ee39338cfe", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhNtkWGjqs146n9gOBW4uhVQ146a2\njXWlCoVGJf4NfzVtJYmsZV7cmhHvPgde3dqav5LnIXFXDve/Q6LuOTOM/g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 415, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0491b9e47c56278662d75c0983b22ca8ea6aa5059b7a2ff7637eb2975e386ad66349aa8ff283d0f77c18d6d11dc062165fd13c3c0310679c1408302a16854ecfbd", + "wx" : "0091b9e47c56278662d75c0983b22ca8ea6aa5059b7a2ff7637eb2975e386ad663", + "wy" : "49aa8ff283d0f77c18d6d11dc062165fd13c3c0310679c1408302a16854ecfbd" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000491b9e47c56278662d75c0983b22ca8ea6aa5059b7a2ff7637eb2975e386ad66349aa8ff283d0f77c18d6d11dc062165fd13c3c0310679c1408302a16854ecfbd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkbnkfFYnhmLXXAmDsiyo6mqlBZt6\nL/djfrKXXjhq1mNJqo/yg9D3fBjW0R3AYhZf0Tw8AxBnnBQIMCoWhU7PvQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 416, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022066755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f3ec2f13caf04d0192b47fb4c5311fb6d4dc6b0a9e802e5327f7ec5ee8e4834df97e3e468b7d0db867d6ecfe81e2b0f9531df87efdb47c1338ac321fefe5a432", + "wx" : "00f3ec2f13caf04d0192b47fb4c5311fb6d4dc6b0a9e802e5327f7ec5ee8e4834d", + "wy" : "00f97e3e468b7d0db867d6ecfe81e2b0f9531df87efdb47c1338ac321fefe5a432" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f3ec2f13caf04d0192b47fb4c5311fb6d4dc6b0a9e802e5327f7ec5ee8e4834df97e3e468b7d0db867d6ecfe81e2b0f9531df87efdb47c1338ac321fefe5a432", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8+wvE8rwTQGStH+0xTEfttTcawqe\ngC5TJ/fsXujkg035fj5Gi30NuGfW7P6B4rD5Ux34fv20fBM4rDIf7+WkMg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 417, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022055a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d92b200aefcab6ac7dafd9acaf2fa10b3180235b8f46b4503e4693c670fccc885ef2f3aebf5b317475336256768f7c19efb7352d27e4cccadc85b6b8ab922c72", + "wx" : "00d92b200aefcab6ac7dafd9acaf2fa10b3180235b8f46b4503e4693c670fccc88", + "wy" : "5ef2f3aebf5b317475336256768f7c19efb7352d27e4cccadc85b6b8ab922c72" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d92b200aefcab6ac7dafd9acaf2fa10b3180235b8f46b4503e4693c670fccc885ef2f3aebf5b317475336256768f7c19efb7352d27e4cccadc85b6b8ab922c72", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2SsgCu/Ktqx9r9msry+hCzGAI1uP\nRrRQPkaTxnD8zIhe8vOuv1sxdHUzYlZ2j3wZ77c1LSfkzMrchba4q5Iscg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 418, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040a88361eb92ecca2625b38e5f98bbabb96bf179b3d76fc48140a3bcd881523cde6bdf56033f84a5054035597375d90866aa2c96b86a41ccf6edebf47298ad489", + "wx" : "0a88361eb92ecca2625b38e5f98bbabb96bf179b3d76fc48140a3bcd881523cd", + "wy" : "00e6bdf56033f84a5054035597375d90866aa2c96b86a41ccf6edebf47298ad489" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040a88361eb92ecca2625b38e5f98bbabb96bf179b3d76fc48140a3bcd881523cde6bdf56033f84a5054035597375d90866aa2c96b86a41ccf6edebf47298ad489", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECog2HrkuzKJiWzjl+Yu6u5a/F5s9\ndvxIFAo7zYgVI83mvfVgM/hKUFQDVZc3XZCGaqLJa4akHM9u3r9HKYrUiQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 419, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d0fb17ccd8fafe827e0c1afc5d8d80366e2b20e7f14a563a2ba50469d84375e868612569d39e2bb9f554355564646de99ac602cc6349cf8c1e236a7de7637d93", + "wx" : "00d0fb17ccd8fafe827e0c1afc5d8d80366e2b20e7f14a563a2ba50469d84375e8", + "wy" : "68612569d39e2bb9f554355564646de99ac602cc6349cf8c1e236a7de7637d93" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d0fb17ccd8fafe827e0c1afc5d8d80366e2b20e7f14a563a2ba50469d84375e868612569d39e2bb9f554355564646de99ac602cc6349cf8c1e236a7de7637d93", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0PsXzNj6/oJ+DBr8XY2ANm4rIOfx\nSlY6K6UEadhDdehoYSVp054rufVUNVVkZG3pmsYCzGNJz4weI2p952N9kw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 420, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04836f33bbc1dc0d3d3abbcef0d91f11e2ac4181076c9af0a22b1e4309d3edb2769ab443ff6f901e30c773867582997c2bec2b0cb8120d760236f3a95bbe881f75", + "wx" : "00836f33bbc1dc0d3d3abbcef0d91f11e2ac4181076c9af0a22b1e4309d3edb276", + "wy" : "009ab443ff6f901e30c773867582997c2bec2b0cb8120d760236f3a95bbe881f75" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004836f33bbc1dc0d3d3abbcef0d91f11e2ac4181076c9af0a22b1e4309d3edb2769ab443ff6f901e30c773867582997c2bec2b0cb8120d760236f3a95bbe881f75", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEg28zu8HcDT06u87w2R8R4qxBgQds\nmvCiKx5DCdPtsnaatEP/b5AeMMdzhnWCmXwr7CsMuBINdgI286lbvogfdQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 421, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0492f99fbe973ed4a299719baee4b432741237034dec8d72ba5103cb33e55feeb8033dd0e91134c734174889f3ebcf1b7a1ac05767289280ee7a794cebd6e69697", + "wx" : "0092f99fbe973ed4a299719baee4b432741237034dec8d72ba5103cb33e55feeb8", + "wy" : "033dd0e91134c734174889f3ebcf1b7a1ac05767289280ee7a794cebd6e69697" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000492f99fbe973ed4a299719baee4b432741237034dec8d72ba5103cb33e55feeb8033dd0e91134c734174889f3ebcf1b7a1ac05767289280ee7a794cebd6e69697", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkvmfvpc+1KKZcZuu5LQydBI3A03s\njXK6UQPLM+Vf7rgDPdDpETTHNBdIifPrzxt6GsBXZyiSgO56eUzr1uaWlw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 422, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d35ba58da30197d378e618ec0fa7e2e2d12cffd73ebbb2049d130bba434af09eff83986e6875e41ea432b7585a49b3a6c77cbb3c47919f8e82874c794635c1d2", + "wx" : "00d35ba58da30197d378e618ec0fa7e2e2d12cffd73ebbb2049d130bba434af09e", + "wy" : "00ff83986e6875e41ea432b7585a49b3a6c77cbb3c47919f8e82874c794635c1d2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d35ba58da30197d378e618ec0fa7e2e2d12cffd73ebbb2049d130bba434af09eff83986e6875e41ea432b7585a49b3a6c77cbb3c47919f8e82874c794635c1d2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE01uljaMBl9N45hjsD6fi4tEs/9c+\nu7IEnRMLukNK8J7/g5huaHXkHqQyt1haSbOmx3y7PEeRn46Ch0x5RjXB0g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 423, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048651ce490f1b46d73f3ff475149be29136697334a519d7ddab0725c8d0793224e11c65bd8ca92dc8bc9ae82911f0b52751ce21dd9003ae60900bd825f590cc28", + "wx" : "008651ce490f1b46d73f3ff475149be29136697334a519d7ddab0725c8d0793224", + "wy" : "00e11c65bd8ca92dc8bc9ae82911f0b52751ce21dd9003ae60900bd825f590cc28" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048651ce490f1b46d73f3ff475149be29136697334a519d7ddab0725c8d0793224e11c65bd8ca92dc8bc9ae82911f0b52751ce21dd9003ae60900bd825f590cc28", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhlHOSQ8bRtc/P/R1FJvikTZpczSl\nGdfdqwclyNB5MiThHGW9jKktyLya6CkR8LUnUc4h3ZADrmCQC9gl9ZDMKA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 424, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046d8e1b12c831a0da8795650ff95f101ed921d9e2f72b15b1cdaca9826b9cfc6def6d63e2bc5c089570394a4bc9f892d5e6c7a6a637b20469a58c106ad486bf37", + "wx" : "6d8e1b12c831a0da8795650ff95f101ed921d9e2f72b15b1cdaca9826b9cfc6d", + "wy" : "00ef6d63e2bc5c089570394a4bc9f892d5e6c7a6a637b20469a58c106ad486bf37" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046d8e1b12c831a0da8795650ff95f101ed921d9e2f72b15b1cdaca9826b9cfc6def6d63e2bc5c089570394a4bc9f892d5e6c7a6a637b20469a58c106ad486bf37", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbY4bEsgxoNqHlWUP+V8QHtkh2eL3\nKxWxzaypgmuc/G3vbWPivFwIlXA5SkvJ+JLV5sempjeyBGmljBBq1Ia/Nw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 425, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02203fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040ae580bae933b4ef2997cbdbb0922328ca9a410f627a0f7dff24cb4d920e15428911e7f8cc365a8a88eb81421a361ccc2b99e309d8dcd9a98ba83c3949d893e3", + "wx" : "0ae580bae933b4ef2997cbdbb0922328ca9a410f627a0f7dff24cb4d920e1542", + "wy" : "008911e7f8cc365a8a88eb81421a361ccc2b99e309d8dcd9a98ba83c3949d893e3" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040ae580bae933b4ef2997cbdbb0922328ca9a410f627a0f7dff24cb4d920e15428911e7f8cc365a8a88eb81421a361ccc2b99e309d8dcd9a98ba83c3949d893e3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECuWAuukztO8pl8vbsJIjKMqaQQ9i\neg99/yTLTZIOFUKJEef4zDZaiojrgUIaNhzMK5njCdjc2amLqDw5SdiT4w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 426, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02205d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963838a40f2a36092e9004e92d8d940cf5638550ce672ce8b8d4e15eba5499249e9", + "wx" : "5b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963", + "wy" : "00838a40f2a36092e9004e92d8d940cf5638550ce672ce8b8d4e15eba5499249e9" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963838a40f2a36092e9004e92d8d940cf5638550ce672ce8b8d4e15eba5499249e9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEW4Ev1SGq+mmDWoSczm+962mDtELS\nRE/nDhNMAn/EaWODikDyo2CS6QBOktjZQM9WOFUM5nLOi41OFeulSZJJ6Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 427, + "comment" : "point duplication during verification", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304502206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022100bb726660235793aa9957a61e76e00c2c435109cf9a15dd624d53f4301047856b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc469637c75bf0c5c9f6d17ffb16d2726bf30a9c7aaf31a8d317472b1ea145ab66db616", + "wx" : "5b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963", + "wy" : "7c75bf0c5c9f6d17ffb16d2726bf30a9c7aaf31a8d317472b1ea145ab66db616" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc469637c75bf0c5c9f6d17ffb16d2726bf30a9c7aaf31a8d317472b1ea145ab66db616", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEW4Ev1SGq+mmDWoSczm+962mDtELS\nRE/nDhNMAn/EaWN8db8MXJ9tF/+xbScmvzCpx6rzGo0xdHKx6hRatm22Fg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 428, + "comment" : "duplication bug", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304502206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022100bb726660235793aa9957a61e76e00c2c435109cf9a15dd624d53f4301047856b", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046adda82b90261b0f319faa0d878665a6b6da497f09c903176222c34acfef72a647e6f50dcc40ad5d9b59f7602bb222fad71a41bf5e1f9df4959a364c62e488d9", + "wx" : "6adda82b90261b0f319faa0d878665a6b6da497f09c903176222c34acfef72a6", + "wy" : "47e6f50dcc40ad5d9b59f7602bb222fad71a41bf5e1f9df4959a364c62e488d9" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046adda82b90261b0f319faa0d878665a6b6da497f09c903176222c34acfef72a647e6f50dcc40ad5d9b59f7602bb222fad71a41bf5e1f9df4959a364c62e488d9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEat2oK5AmGw8xn6oNh4ZlprbaSX8J\nyQMXYiLDSs/vcqZH5vUNzECtXZtZ92ArsiL61xpBv14fnfSVmjZMYuSI2Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 429, + "comment" : "point with x-coordinate 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250201010220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042fca0d0a47914de77ed56e7eccc3276a601120c6df0069c825c8f6a01c9f382065f3450a1d17c6b24989a39beb1c7decfca8384fbdc294418e5d807b3c6ed7de", + "wx" : "2fca0d0a47914de77ed56e7eccc3276a601120c6df0069c825c8f6a01c9f3820", + "wy" : "65f3450a1d17c6b24989a39beb1c7decfca8384fbdc294418e5d807b3c6ed7de" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042fca0d0a47914de77ed56e7eccc3276a601120c6df0069c825c8f6a01c9f382065f3450a1d17c6b24989a39beb1c7decfca8384fbdc294418e5d807b3c6ed7de", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEL8oNCkeRTed+1W5+zMMnamARIMbf\nAGnIJcj2oByfOCBl80UKHRfGskmJo5vrHH3s/Kg4T73ClEGOXYB7PG7X3g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 430, + "comment" : "point with x-coordinate 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022101000000000000000000000000000000000000000000000000000000000000000002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04dd86d3b5f4a13e8511083b78002081c53ff467f11ebd98a51a633db76665d25045d5c8200c89f2fa10d849349226d21d8dfaed6ff8d5cb3e1b7e17474ebc18f7", + "wx" : "00dd86d3b5f4a13e8511083b78002081c53ff467f11ebd98a51a633db76665d250", + "wy" : "45d5c8200c89f2fa10d849349226d21d8dfaed6ff8d5cb3e1b7e17474ebc18f7" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004dd86d3b5f4a13e8511083b78002081c53ff467f11ebd98a51a633db76665d25045d5c8200c89f2fa10d849349226d21d8dfaed6ff8d5cb3e1b7e17474ebc18f7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3YbTtfShPoURCDt4ACCBxT/0Z/Ee\nvZilGmM9t2Zl0lBF1cggDIny+hDYSTSSJtIdjfrtb/jVyz4bfhdHTrwY9w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 431, + "comment" : "comparison with point at infinity ", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044fea55b32cb32aca0c12c4cd0abfb4e64b0f5a516e578c016591a93f5a0fbcc5d7d3fd10b2be668c547b212f6bb14c88f0fecd38a8a4b2c785ed3be62ce4b280", + "wx" : "4fea55b32cb32aca0c12c4cd0abfb4e64b0f5a516e578c016591a93f5a0fbcc5", + "wy" : "00d7d3fd10b2be668c547b212f6bb14c88f0fecd38a8a4b2c785ed3be62ce4b280" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044fea55b32cb32aca0c12c4cd0abfb4e64b0f5a516e578c016591a93f5a0fbcc5d7d3fd10b2be668c547b212f6bb14c88f0fecd38a8a4b2c785ed3be62ce4b280", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAET+pVsyyzKsoMEsTNCr+05ksPWlFu\nV4wBZZGpP1oPvMXX0/0Qsr5mjFR7IS9rsUyI8P7NOKiksseF7TvmLOSygA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 432, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc476699780220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c6a771527024227792170a6f8eee735bf32b7f98af669ead299802e32d7c3107bc3b4b5e65ab887bbd343572b3e5619261fe3a073e2ffd78412f726867db589e", + "wx" : "00c6a771527024227792170a6f8eee735bf32b7f98af669ead299802e32d7c3107", + "wy" : "00bc3b4b5e65ab887bbd343572b3e5619261fe3a073e2ffd78412f726867db589e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c6a771527024227792170a6f8eee735bf32b7f98af669ead299802e32d7c3107bc3b4b5e65ab887bbd343572b3e5619261fe3a073e2ffd78412f726867db589e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExqdxUnAkIneSFwpvju5zW/Mrf5iv\nZp6tKZgC4y18MQe8O0teZauIe700NXKz5WGSYf46Bz4v/XhBL3JoZ9tYng==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 433, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04851c2bbad08e54ec7a9af99f49f03644d6ec6d59b207fec98de85a7d15b956efcee9960283045075684b410be8d0f7494b91aa2379f60727319f10ddeb0fe9d6", + "wx" : "00851c2bbad08e54ec7a9af99f49f03644d6ec6d59b207fec98de85a7d15b956ef", + "wy" : "00cee9960283045075684b410be8d0f7494b91aa2379f60727319f10ddeb0fe9d6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004851c2bbad08e54ec7a9af99f49f03644d6ec6d59b207fec98de85a7d15b956efcee9960283045075684b410be8d0f7494b91aa2379f60727319f10ddeb0fe9d6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhRwrutCOVOx6mvmfSfA2RNbsbVmy\nB/7JjehafRW5Vu/O6ZYCgwRQdWhLQQvo0PdJS5GqI3n2BycxnxDd6w/p1g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 434, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f6417c8a670584e388676949e53da7fc55911ff68318d1bf3061205acb19c48f8f2b743df34ad0f72674acb7505929784779cd9ac916c3669ead43026ab6d43f", + "wx" : "00f6417c8a670584e388676949e53da7fc55911ff68318d1bf3061205acb19c48f", + "wy" : "008f2b743df34ad0f72674acb7505929784779cd9ac916c3669ead43026ab6d43f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f6417c8a670584e388676949e53da7fc55911ff68318d1bf3061205acb19c48f8f2b743df34ad0f72674acb7505929784779cd9ac916c3669ead43026ab6d43f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9kF8imcFhOOIZ2lJ5T2n/FWRH/aD\nGNG/MGEgWssZxI+PK3Q980rQ9yZ0rLdQWSl4R3nNmskWw2aerUMCarbUPw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 435, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997802203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04501421277be45a5eefec6c639930d636032565af420cf3373f557faa7f8a06438673d6cb6076e1cfcdc7dfe7384c8e5cac08d74501f2ae6e89cad195d0aa1371", + "wx" : "501421277be45a5eefec6c639930d636032565af420cf3373f557faa7f8a0643", + "wy" : "008673d6cb6076e1cfcdc7dfe7384c8e5cac08d74501f2ae6e89cad195d0aa1371" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004501421277be45a5eefec6c639930d636032565af420cf3373f557faa7f8a06438673d6cb6076e1cfcdc7dfe7384c8e5cac08d74501f2ae6e89cad195d0aa1371", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUBQhJ3vkWl7v7GxjmTDWNgMlZa9C\nDPM3P1V/qn+KBkOGc9bLYHbhz83H3+c4TI5crAjXRQHyrm6JytGV0KoTcQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 436, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040d935bf9ffc115a527735f729ca8a4ca23ee01a4894adf0e3415ac84e808bb343195a3762fea29ed38912bd9ea6c4fde70c3050893a4375850ce61d82eba33c5", + "wx" : "0d935bf9ffc115a527735f729ca8a4ca23ee01a4894adf0e3415ac84e808bb34", + "wy" : "3195a3762fea29ed38912bd9ea6c4fde70c3050893a4375850ce61d82eba33c5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040d935bf9ffc115a527735f729ca8a4ca23ee01a4894adf0e3415ac84e808bb343195a3762fea29ed38912bd9ea6c4fde70c3050893a4375850ce61d82eba33c5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDZNb+f/BFaUnc19ynKikyiPuAaSJ\nSt8ONBWshOgIuzQxlaN2L+op7TiRK9nqbE/ecMMFCJOkN1hQzmHYLrozxQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 437, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045e59f50708646be8a589355014308e60b668fb670196206c41e748e64e4dca215de37fee5c97bcaf7144d5b459982f52eeeafbdf03aacbafef38e213624a01de", + "wx" : "5e59f50708646be8a589355014308e60b668fb670196206c41e748e64e4dca21", + "wy" : "5de37fee5c97bcaf7144d5b459982f52eeeafbdf03aacbafef38e213624a01de" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045e59f50708646be8a589355014308e60b668fb670196206c41e748e64e4dca215de37fee5c97bcaf7144d5b459982f52eeeafbdf03aacbafef38e213624a01de", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXln1Bwhka+iliTVQFDCOYLZo+2cB\nliBsQedI5k5NyiFd43/uXJe8r3FE1bRZmC9S7ur73wOqy6/vOOITYkoB3g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 438, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2960220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04169fb797325843faff2f7a5b5445da9e2fd6226f7ef90ef0bfe924104b02db8e7bbb8de662c7b9b1cf9b22f7a2e582bd46d581d68878efb2b861b131d8a1d667", + "wx" : "169fb797325843faff2f7a5b5445da9e2fd6226f7ef90ef0bfe924104b02db8e", + "wy" : "7bbb8de662c7b9b1cf9b22f7a2e582bd46d581d68878efb2b861b131d8a1d667" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004169fb797325843faff2f7a5b5445da9e2fd6226f7ef90ef0bfe924104b02db8e7bbb8de662c7b9b1cf9b22f7a2e582bd46d581d68878efb2b861b131d8a1d667", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFp+3lzJYQ/r/L3pbVEXani/WIm9+\n+Q7wv+kkEEsC2457u43mYse5sc+bIvei5YK9RtWB1oh477K4YbEx2KHWZw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 439, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04271cd89c000143096b62d4e9e4ca885aef2f7023d18affdaf8b7b548981487540a1c6e954e32108435b55fa385b0f76481a609b9149ccb4b02b2ca47fe8e4da5", + "wx" : "271cd89c000143096b62d4e9e4ca885aef2f7023d18affdaf8b7b54898148754", + "wy" : "0a1c6e954e32108435b55fa385b0f76481a609b9149ccb4b02b2ca47fe8e4da5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004271cd89c000143096b62d4e9e4ca885aef2f7023d18affdaf8b7b548981487540a1c6e954e32108435b55fa385b0f76481a609b9149ccb4b02b2ca47fe8e4da5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJxzYnAABQwlrYtTp5MqIWu8vcCPR\niv/a+Le1SJgUh1QKHG6VTjIQhDW1X6OFsPdkgaYJuRScy0sCsspH/o5NpQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 440, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043d0bc7ed8f09d2cb7ddb46ebc1ed799ab1563a9ab84bf524587a220afe499c12e22dc3b3c103824a4f378d96adb0a408abf19ce7d68aa6244f78cb216fa3f8df", + "wx" : "3d0bc7ed8f09d2cb7ddb46ebc1ed799ab1563a9ab84bf524587a220afe499c12", + "wy" : "00e22dc3b3c103824a4f378d96adb0a408abf19ce7d68aa6244f78cb216fa3f8df" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043d0bc7ed8f09d2cb7ddb46ebc1ed799ab1563a9ab84bf524587a220afe499c12e22dc3b3c103824a4f378d96adb0a408abf19ce7d68aa6244f78cb216fa3f8df", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPQvH7Y8J0st920brwe15mrFWOpq4\nS/UkWHoiCv5JnBLiLcOzwQOCSk83jZatsKQIq/Gc59aKpiRPeMshb6P43w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 441, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c29602203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a6c885ade1a4c566f9bb010d066974abb281797fa701288c721bcbd23663a9b72e424b690957168d193a6096fc77a2b004a9c7d467e007e1f2058458f98af316", + "wx" : "00a6c885ade1a4c566f9bb010d066974abb281797fa701288c721bcbd23663a9b7", + "wy" : "2e424b690957168d193a6096fc77a2b004a9c7d467e007e1f2058458f98af316" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a6c885ade1a4c566f9bb010d066974abb281797fa701288c721bcbd23663a9b72e424b690957168d193a6096fc77a2b004a9c7d467e007e1f2058458f98af316", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEpsiFreGkxWb5uwENBml0q7KBeX+n\nASiMchvL0jZjqbcuQktpCVcWjRk6YJb8d6KwBKnH1GfgB+HyBYRY+YrzFg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 442, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048d3c2c2c3b765ba8289e6ac3812572a25bf75df62d87ab7330c3bdbad9ebfa5c4c6845442d66935b238578d43aec54f7caa1621d1af241d4632e0b780c423f5d", + "wx" : "008d3c2c2c3b765ba8289e6ac3812572a25bf75df62d87ab7330c3bdbad9ebfa5c", + "wy" : "4c6845442d66935b238578d43aec54f7caa1621d1af241d4632e0b780c423f5d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048d3c2c2c3b765ba8289e6ac3812572a25bf75df62d87ab7330c3bdbad9ebfa5c4c6845442d66935b238578d43aec54f7caa1621d1af241d4632e0b780c423f5d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjTwsLDt2W6gonmrDgSVyolv3XfYt\nh6tzMMO9utnr+lxMaEVELWaTWyOFeNQ67FT3yqFiHRryQdRjLgt4DEI/XQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 443, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "wx" : "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy" : "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 444, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca6050230220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + }, + { + "tcId" : 445, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022044a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e0220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "wx" : "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy" : "00b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpawHL0cAeWAZXEYFLWD8GHp1DHMqZTOoTE0Sb+XyECuCg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 446, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca6050230220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + }, + { + "tcId" : 447, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022044a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e0220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "wx" : "4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000", + "wy" : "00ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETzN8z9Z3JqgF5PFgCuKEnfOAfsoR\nc4Ajn72BaQAAAADtneoSTMjDlkFkEemIww9CfrUEr0OjFGzV336mBmbWhQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 448, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100d434e262a49eab7781e353a3565e482550dd0fd5defa013c7f29745eff3569f10221009b0c0a93f267fb6052fd8077be769c2b98953195d7bc10de844218305c6ba17a", + "result" : "valid" + }, + { + "tcId" : 449, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402200fe774355c04d060f76d79fd7a772e421463489221bf0a33add0be9b1979110b0220500dcba1c69a8fbd43fa4f57f743ce124ca8b91a1f325f3fac6181175df55737", + "result" : "valid" + }, + { + "tcId" : 450, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100bb40bf217bed3fb3950c7d39f03d36dc8e3b2cd79693f125bfd06595ee1135e30220541bf3532351ebb032710bdb6a1bf1bfc89a1e291ac692b3fa4780745bb55677", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "wx" : "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy" : "0084fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTWE+hdNeRxyvyzjiAqJYN0qfHoTOKgvhanlnNvegAAAAA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 451, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220664eb7ee6db84a34df3c86ea31389a5405badd5ca99231ff556d3e75a233e73a022059f3c752e52eca46137642490a51560ce0badc678754b8f72e51a2901426a1bd", + "result" : "valid" + }, + { + "tcId" : 452, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502204cd0429bbabd2827009d6fcd843d4ce39c3e42e2d1631fd001985a79d1fd8b430221009638bf12dd682f60be7ef1d0e0d98f08b7bca77a1a2b869ae466189d2acdabe3", + "result" : "valid" + }, + { + "tcId" : 453, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100e56c6ea2d1b017091c44d8b6cb62b9f460e3ce9aed5e5fd41e8added97c56c04022100a308ec31f281e955be20b457e463440b4fcf2b80258078207fc1378180f89b55", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "wx" : "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy" : "7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTV7BeixhuONQdMcd/V2nyLVg4XsyFfQelYaYyQhf////w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 454, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402201158a08d291500b4cabed3346d891eee57c176356a2624fb011f8fbbf34668300220228a8c486a736006e082325b85290c5bc91f378b75d487dda46798c18f285519", + "result" : "valid" + }, + { + "tcId" : 455, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100b1db9289649f59410ea36b0c0fc8d6aa2687b29176939dd23e0dde56d309fa9d02203e1535e4280559015b0dbd987366dcf43a6d1af5c23c7d584e1c3f48a1251336", + "result" : "valid" + }, + { + "tcId" : 456, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100b7b16e762286cb96446aa8d4e6e7578b0a341a79f2dd1a220ac6f0ca4e24ed86022100ddc60a700a139b04661c547d07bbb0721780146df799ccf55e55234ecb8f12bc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "wx" : "2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff", + "wy" : "00a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKCnDH6ouQA40TtlLyj/NBUWVbrz+\nitD236X/jv////+gGq+vAA5SWFhVr6dnat4oQRMJkFLfV+frO9N+vrkiLg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 457, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100d82a7c2717261187c8e00d8df963ff35d796edad36bc6e6bd1c91c670d9105b402203dcabddaf8fcaa61f4603e7cbac0f3c0351ecd5988efb23f680d07debd139929", + "result" : "valid" + }, + { + "tcId" : 458, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402205eb9c8845de68eb13d5befe719f462d77787802baff30ce96a5cba063254af7802202c026ae9be2e2a5e7ca0ff9bbd92fb6e44972186228ee9a62b87ddbe2ef66fb5", + "result" : "valid" + }, + { + "tcId" : 459, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304602210096843dd03c22abd2f3b782b170239f90f277921becc117d0404a8e4e36230c28022100f2be378f526f74a543f67165976de9ed9a31214eb4d7e6db19e1ede123dd991d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "wx" : "00fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5", + "wy" : "5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE////+UgIHmoEWN2PnnOPJmX/kFmt\naqwHCDGMTKmnpPVairy6LdqEdDEe5UFJuXPK4MD7iVV60L945lKaFmO9cw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 460, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220766456dce1857c906f9996af729339464d27e9d98edc2d0e3b760297067421f60220402385ecadae0d8081dccaf5d19037ec4e55376eced699e93646bfbbf19d0b41", + "result" : "valid" + }, + { + "tcId" : 461, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100c605c4b2edeab20419e6518a11b2dbc2b97ed8b07cced0b19c34f777de7b9fd9022100edf0f612c5f46e03c719647bc8af1b29b2cde2eda700fb1cff5e159d47326dba", + "result" : "valid" + }, + { + "tcId" : 462, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100d48b68e6cabfe03cf6141c9ac54141f210e64485d9929ad7b732bfe3b7eb8a84022100feedae50c61bd00e19dc26f9b7e2265e4508c389109ad2f208f0772315b6c941", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "wx" : "03fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e", + "wy" : "1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAAAAA/oV+WOUnV8DpvXH+G+eABXu\nsjrrv/EXOTe6dI4QmYcgcOjofFVfoTZZzKXX+tz8sAI+qIlUjKSK8rp+cQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 463, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100b7c81457d4aeb6aa65957098569f0479710ad7f6595d5874c35a93d12a5dd4c7022100b7961a0b652878c2d568069a432ca18a1a9199f2ca574dad4b9e3a05c0a1cdb3", + "result" : "valid" + }, + { + "tcId" : 464, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402206b01332ddb6edfa9a30a1321d5858e1ee3cf97e263e669f8de5e9652e76ff3f702205939545fced457309a6a04ace2bd0f70139c8f7d86b02cb1cc58f9e69e96cd5a", + "result" : "valid" + }, + { + "tcId" : 465, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100efdb884720eaeadc349f9fc356b6c0344101cd2fd8436b7d0e6a4fb93f106361022100f24bee6ad5dc05f7613975473aadf3aacba9e77de7d69b6ce48cb60d8113385d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "wx" : "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy" : "1352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BUAAAAAE1K7Sg+i6kzOuatj3WhK3loRJ7zzAKaYpxk7wg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 466, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022031230428405560dcb88fb5a646836aea9b23a23dd973dcbe8014c87b8b20eb0702200f9344d6e812ce166646747694a41b0aaf97374e19f3c5fb8bd7ae3d9bd0beff", + "result" : "valid" + }, + { + "tcId" : 467, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100caa797da65b320ab0d5c470cda0b36b294359c7db9841d679174db34c4855743022100cf543a62f23e212745391aaf7505f345123d2685ee3b941d3de6d9b36242e5a0", + "result" : "valid" + }, + { + "tcId" : 468, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502207e5f0ab5d900d3d3d7867657e5d6d36519bc54084536e7d21c336ed8001859450221009450c07f201faec94b82dfb322e5ac676688294aad35aa72e727ff0b19b646aa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "wx" : "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy" : "00fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BX////+7K1EtvBdFbMxRlScIpe1IqXu2EMM/1lnWObEPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-256", + "tests" : [ + { + "tcId" : 469, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100d7d70c581ae9e3f66dc6a480bf037ae23f8a1e4a2136fe4b03aa69f0ca25b35602210089c460f8a5a5c2bbba962c8a3ee833a413e85658e62a59e2af41d9127cc47224", + "result" : "valid" + }, + { + "tcId" : 470, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220341c1b9ff3c83dd5e0dfa0bf68bcdf4bb7aa20c625975e5eeee34bb396266b34022072b69f061b750fd5121b22b11366fad549c634e77765a017902a67099e0a4469", + "result" : "valid" + }, + { + "tcId" : 471, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022070bebe684cdcb5ca72a42f0d873879359bd1781a591809947628d313a3814f67022100aec03aca8f5587a4d535fa31027bbe9cc0e464b1c3577f4c2dcde6b2094798a9", + "result" : "valid" + } + ] + } + ] +} diff --git a/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha3_256_test.json b/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha3_256_test.json new file mode 100644 index 0000000000..cf4491668e --- /dev/null +++ b/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha3_256_test.json @@ -0,0 +1,6582 @@ +{ + "algorithm" : "ECDSA", + "schema" : "ecdsa_verify_schema.json", + "generatorVersion" : "0.9rc5", + "numberOfTests" : 479, + "header" : [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes" : { + "ArithmeticError" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.", + "cves" : [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature" : { + "bugType" : "BER_ENCODING", + "description" : "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect" : "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves" : [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication" : { + "bugType" : "EDGE_CASE", + "description" : "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding" : { + "bugType" : "CAN_OF_WORMS", + "description" : "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449" + ] + }, + "MissingZero" : { + "bugType" : "LEGACY", + "description" : "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect" : "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "CVE-2019-0865" + ] + }, + "PointDuplication" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves" : [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "2020-13895" + ] + }, + "SpecialCaseHash" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "ValidSignature" : { + "bugType" : "BASIC", + "description" : "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups" : [ + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "wx" : "04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5", + "wy" : "0087d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBKrsc2NXJvIT+4qeZNo7hjLkFJWp\nRNAEW1IuunJA+tWH2TFXmKqjpboBd1eHztBeqve04J/IHW0apUboNl1SXQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 1, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "", + "sig" : "3044022063f01899b4b0bfe9dc9929fd4526919b981acda781044ee3d2c337bf5fc748300220591381bdf1b1a9b01020b87314a128d06e4833342bf232779f61480739613927", + "result" : "valid" + }, + { + "tcId" : 2, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "4d7367", + "sig" : "3044022010228beaf773caeff22a94602e9eff1923dcc51b277f64b482ea63218c350b0d02202104c8343f8970a28c9eb221a63c857ef385e758eaccc5f7d2ae975553a1534b", + "result" : "valid" + }, + { + "tcId" : 3, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100e6e1b8c20e9d00f0b6cf1b2c39cacd9c50ee3f990553250f074a4a3eed3afe43022052f3be1ae2d2f9b2bfea8e8c22d95af4574581a9f4b09a89f7b6a4ad1c5b2776", + "result" : "valid" + }, + { + "tcId" : 4, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "0000000000000000000000000000000000000000", + "sig" : "3045022020f6203e48fc4c66ae8a74ec61d5124772daad058a74b871914d37dfe9d409c10221008b68de7a4786e29b3a726ea7fd8ef2a585b5c8dadf11281f2caa228eb3df3f96", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "wx" : "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838", + "wy" : "00c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKSexBRK64+3c/kZ4KBKLrSkDJpkZ\n9whgacjE32xzKDjHeHlk6qwA5ZIfsUmKYPRgZ2az2WhQAVWNGpdOc0FRPg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 5, + "comment" : "signature malleability", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "30460221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0221009364745a6a2d69f2283698fdfbee7b13de20bc93deb0230a9af3bd9fddf04401", + "result" : "valid" + }, + { + "tcId" : 6, + "comment" : "Legacy: ASN encoding of r misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "304402208ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 7, + "comment" : "valid", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "valid" + }, + { + "tcId" : 8, + "comment" : "length of sequence [r, s] uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3081450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 9, + "comment" : "length of sequence [r, s] contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "308200450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 10, + "comment" : "length of sequence [r, s] uses 70 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30460221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 11, + "comment" : "length of sequence [r, s] uses 68 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30440221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 12, + "comment" : "uint32 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308501000000450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 13, + "comment" : "uint64 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30890100000000000000450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 14, + "comment" : "length of sequence [r, s] = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30847fffffff0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 15, + "comment" : "length of sequence [r, s] = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084800000000221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 16, + "comment" : "length of sequence [r, s] = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084ffffffff0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 17, + "comment" : "length of sequence [r, s] = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085ffffffffff0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 18, + "comment" : "length of sequence [r, s] = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3088ffffffffffffffff0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 19, + "comment" : "incorrect length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30ff0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 20, + "comment" : "replaced sequence [r, s] by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30800221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 21, + "comment" : "removing sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "", + "result" : "invalid" + }, + { + "tcId" : 22, + "comment" : "lonely sequence tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30", + "result" : "invalid" + }, + { + "tcId" : 23, + "comment" : "appending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000", + "result" : "invalid" + }, + { + "tcId" : 24, + "comment" : "prepending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304700000221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 25, + "comment" : "appending unused 0's to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000", + "result" : "invalid" + }, + { + "tcId" : 26, + "comment" : "appending null value to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500500", + "result" : "invalid" + }, + { + "tcId" : 27, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a49817730450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 28, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049250030450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 29, + "comment" : "appending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304730450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 30, + "comment" : "including undefined tags", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304daa00bb00cd0030450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 31, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2229aa00bb00cd000221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 32, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e2228aa00bb00cd0002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 33, + "comment" : "truncated length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3081", + "result" : "invalid" + }, + { + "tcId" : 34, + "comment" : "including undefined tags to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304baa02aabb30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 35, + "comment" : "using composition with indefinite length for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308030450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000", + "result" : "invalid" + }, + { + "tcId" : 36, + "comment" : "using composition with wrong tag for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308031450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000", + "result" : "invalid" + }, + { + "tcId" : 37, + "comment" : "Replacing sequence [r, s] with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "0500", + "result" : "invalid" + }, + { + "tcId" : 38, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2e450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 39, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2f450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 40, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "31450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 41, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "32450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 42, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "ff450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 43, + "comment" : "dropping value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3000", + "result" : "invalid" + }, + { + "tcId" : 44, + "comment" : "using composition for sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049300102304421008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 45, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30440221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1", + "result" : "invalid" + }, + { + "tcId" : 46, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304421008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 47, + "comment" : "sequence [r, s] of size 4166 to check for overflows", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308210460221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 48, + "comment" : "indefinite length", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30800221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000", + "result" : "invalid" + }, + { + "tcId" : 49, + "comment" : "indefinite length with truncated delimiter", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30800221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e15000", + "result" : "invalid" + }, + { + "tcId" : 50, + "comment" : "indefinite length with additional element", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30800221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e15005000000", + "result" : "invalid" + }, + { + "tcId" : 51, + "comment" : "indefinite length with truncated element", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30800221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150060811220000", + "result" : "invalid" + }, + { + "tcId" : 52, + "comment" : "indefinite length with garbage", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30800221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000fe02beef", + "result" : "invalid" + }, + { + "tcId" : 53, + "comment" : "indefinite length with nonempty EOC", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30800221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500002beef", + "result" : "invalid" + }, + { + "tcId" : 54, + "comment" : "prepend empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304730000221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 55, + "comment" : "append empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1503000", + "result" : "invalid" + }, + { + "tcId" : 56, + "comment" : "append zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30480221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150020100", + "result" : "invalid" + }, + { + "tcId" : 57, + "comment" : "append garbage with high tag number", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30480221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150bf7f00", + "result" : "invalid" + }, + { + "tcId" : 58, + "comment" : "append null with explicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30490221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150a0020500", + "result" : "invalid" + }, + { + "tcId" : 59, + "comment" : "append null with implicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150a000", + "result" : "invalid" + }, + { + "tcId" : 60, + "comment" : "sequence of sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304730450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 61, + "comment" : "truncated sequence: removed last 1 elements", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30230221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e", + "result" : "invalid" + }, + { + "tcId" : 62, + "comment" : "repeating element in sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30670221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e15002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 63, + "comment" : "flipped bit 0 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36f02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 64, + "comment" : "flipped bit 32 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af43e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 65, + "comment" : "flipped bit 48 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b234af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 66, + "comment" : "flipped bit 64 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3043008ab9effd6738803fd19b92d2e9fdea1293056b793e29542a3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 67, + "comment" : "length of r uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3046028121008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 68, + "comment" : "length of r contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304702820021008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 69, + "comment" : "length of r uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450222008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 70, + "comment" : "length of r uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450220008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 71, + "comment" : "uint32 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02850100000021008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 72, + "comment" : "uint64 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e0289010000000000000021008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 73, + "comment" : "length of r = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902847fffffff008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 74, + "comment" : "length of r = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049028480000000008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 75, + "comment" : "length of r = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284ffffffff008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 76, + "comment" : "length of r = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285ffffffffff008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 77, + "comment" : "length of r = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0288ffffffffffffffff008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 78, + "comment" : "incorrect length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502ff008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 79, + "comment" : "replaced r by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450280008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 80, + "comment" : "removing r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302202206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 81, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30230202206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 82, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30240221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02", + "result" : "invalid" + }, + { + "tcId" : 83, + "comment" : "appending 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470223008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e000002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 84, + "comment" : "prepending 0's to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304702230000008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 85, + "comment" : "appending unused 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e000002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 86, + "comment" : "appending null value to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470223008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e050002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 87, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a22264981770221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 88, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049222525000221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 89, + "comment" : "appending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d22230221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0004deadbeef02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 90, + "comment" : "truncated length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3024028102206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 91, + "comment" : "including undefined tags to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b2227aa02aabb0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 92, + "comment" : "using composition with indefinite length for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304922800221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e000002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 93, + "comment" : "using composition with wrong tag for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304922800321008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e000002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 94, + "comment" : "Replacing r with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3024050002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 95, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450021008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 96, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450121008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 97, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450321008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 98, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450421008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 99, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045ff21008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 100, + "comment" : "dropping value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3024020002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 101, + "comment" : "using composition for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049222502010002208ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 102, + "comment" : "modifying first byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450221028ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 103, + "comment" : "modifying last byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c3ee02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 104, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30440220008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c302206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 105, + "comment" : "r of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3082104802821022008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 106, + "comment" : "leading ff in r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30460222ff008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 107, + "comment" : "replaced r by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302509018002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 108, + "comment" : "replacing r with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502010002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 109, + "comment" : "flipped bit 0 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30430221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e151", + "result" : "invalid" + }, + { + "tcId" : 110, + "comment" : "flipped bit 32 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30430221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d221e72e150", + "result" : "invalid" + }, + { + "tcId" : 111, + "comment" : "flipped bit 48 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30430221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c70d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 112, + "comment" : "flipped bit 64 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30430221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7b58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 113, + "comment" : "length of s uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30460221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0281206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 114, + "comment" : "length of s contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e028200206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 115, + "comment" : "length of s uses 33 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02216c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 116, + "comment" : "length of s uses 31 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e021f6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 117, + "comment" : "uint32 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e028501000000206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 118, + "comment" : "uint64 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02890100000000000000206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 119, + "comment" : "length of s = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02847fffffff6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 120, + "comment" : "length of s = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0284800000006c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 121, + "comment" : "length of s = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0284ffffffff6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 122, + "comment" : "length of s = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0285ffffffffff6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 123, + "comment" : "length of s = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0288ffffffffffffffff6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 124, + "comment" : "incorrect length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02ff6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 125, + "comment" : "replaced s by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02806c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 126, + "comment" : "appending 0's to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02226c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000", + "result" : "invalid" + }, + { + "tcId" : 127, + "comment" : "prepending 0's to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e022200006c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 128, + "comment" : "appending null value to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02226c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500500", + "result" : "invalid" + }, + { + "tcId" : 129, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e222549817702206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 130, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e2224250002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 131, + "comment" : "appending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e222202206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 132, + "comment" : "truncated length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0281", + "result" : "invalid" + }, + { + "tcId" : 133, + "comment" : "including undefined tags to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b0221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e2226aa02aabb02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 134, + "comment" : "using composition with indefinite length for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e228002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000", + "result" : "invalid" + }, + { + "tcId" : 135, + "comment" : "using composition with wrong tag for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e228003206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000", + "result" : "invalid" + }, + { + "tcId" : 136, + "comment" : "Replacing s with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30250221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0500", + "result" : "invalid" + }, + { + "tcId" : 137, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e00206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 138, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e01206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 139, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e03206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 140, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e04206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 141, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36eff206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 142, + "comment" : "dropping value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0200", + "result" : "invalid" + }, + { + "tcId" : 143, + "comment" : "using composition for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e222402016c021f9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 144, + "comment" : "modifying first byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206e9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 145, + "comment" : "modifying last byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30450221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1d0", + "result" : "invalid" + }, + { + "tcId" : 146, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30440221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e021f6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1", + "result" : "invalid" + }, + { + "tcId" : 147, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30440221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e021f9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 148, + "comment" : "s of size 4129 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308210480221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e028210216c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e1500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 149, + "comment" : "leading ff in s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30460221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e0221ff6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 150, + "comment" : "replaced s by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30260221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e090180", + "result" : "invalid" + }, + { + "tcId" : 151, + "comment" : "replacing s with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30260221008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e020100", + "result" : "invalid" + }, + { + "tcId" : 152, + "comment" : "replaced r by r + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450221018ab9effc67388040d19b92d2e9fdea124fec6626e540f2b02edc15b83a73e8bf02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 153, + "comment" : "replaced r by r - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304402208ab9effe6738803ed19b92d2e9fdea12d61e70cb9711b5a64768803241ad9e1d02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 154, + "comment" : "replaced r by r + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022201008ab9eefd6738813fd19b92d2e9fde9cf7a00192055c7d91ef4ed0df1a136146e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 155, + "comment" : "replaced r by -r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221ff7546100298c77fc02e646d2d160215ed6cfa9486c1d6abd4c4ddb50ac1ef3c9202206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 156, + "comment" : "replaced r by n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "304402207546100198c77fc12e646d2d160215ed29e18f3468ee4a59b8977fcdbe5261e302206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 157, + "comment" : "replaced r by -n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221fe7546100398c77fbf2e646d2d160215edb01399d91abf0d4fd123ea47c58c174102206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 158, + "comment" : "replaced r by r + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450221018ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 159, + "comment" : "replaced r by r + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304d02290100000000000000008ab9effd6738803fd19b92d2e9fdea1293056b793e29542b3b224af53e10c36e02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 160, + "comment" : "replaced s by s + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450221016c9b8ba395d2960fd7c96702041184eb9bad38c76f7f19ff4c7fd7e61ad606a102206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 161, + "comment" : "replaced s by s - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450221ff6c9b8ba595d2960dd7c96702041184ec21df436c214fdcf5650c4260220fbbff02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 162, + "comment" : "replaced s by s + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022201006c9b8aa495d2970ed7c96702041184a8c5c0ebc0e006006e1290d01f8198325002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 163, + "comment" : "replaced s by -s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "304402209364745b6a2d69f1283698fdfbee7b142139c1e637988485a739f2dce18d1eb002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 164, + "comment" : "replaced s by -n - s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450221fe9364745c6a2d69f0283698fdfbee7b146452c7389080e600b3802819e529f95f02206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 165, + "comment" : "replaced s by s + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450221016c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e15002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 166, + "comment" : "replaced s by s - 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450221ff6c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e15002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 167, + "comment" : "replaced s by s + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304d02290100000000000000006c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e15002206c9b8ba495d2960ed7c96702041184ebdec63e19c8677b7a58c60d231e72e150", + "result" : "invalid" + }, + { + "tcId" : 168, + "comment" : "Signature with special case values r=0 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020100", + "result" : "invalid" + }, + { + "tcId" : 169, + "comment" : "Signature with special case values r=0 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020101", + "result" : "invalid" + }, + { + "tcId" : 170, + "comment" : "Signature with special case values r=0 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000201ff", + "result" : "invalid" + }, + { + "tcId" : 171, + "comment" : "Signature with special case values r=0 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 172, + "comment" : "Signature with special case values r=0 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 173, + "comment" : "Signature with special case values r=0 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 174, + "comment" : "Signature with special case values r=0 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 175, + "comment" : "Signature with special case values r=0 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 176, + "comment" : "Signature with special case values r=1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020100", + "result" : "invalid" + }, + { + "tcId" : 177, + "comment" : "Signature with special case values r=1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "invalid" + }, + { + "tcId" : 178, + "comment" : "Signature with special case values r=1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010201ff", + "result" : "invalid" + }, + { + "tcId" : 179, + "comment" : "Signature with special case values r=1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 180, + "comment" : "Signature with special case values r=1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 181, + "comment" : "Signature with special case values r=1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 182, + "comment" : "Signature with special case values r=1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 183, + "comment" : "Signature with special case values r=1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 184, + "comment" : "Signature with special case values r=-1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020100", + "result" : "invalid" + }, + { + "tcId" : 185, + "comment" : "Signature with special case values r=-1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020101", + "result" : "invalid" + }, + { + "tcId" : 186, + "comment" : "Signature with special case values r=-1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0201ff", + "result" : "invalid" + }, + { + "tcId" : 187, + "comment" : "Signature with special case values r=-1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 188, + "comment" : "Signature with special case values r=-1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 189, + "comment" : "Signature with special case values r=-1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 190, + "comment" : "Signature with special case values r=-1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 191, + "comment" : "Signature with special case values r=-1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 192, + "comment" : "Signature with special case values r=n and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020100", + "result" : "invalid" + }, + { + "tcId" : 193, + "comment" : "Signature with special case values r=n and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020101", + "result" : "invalid" + }, + { + "tcId" : 194, + "comment" : "Signature with special case values r=n and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510201ff", + "result" : "invalid" + }, + { + "tcId" : 195, + "comment" : "Signature with special case values r=n and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 196, + "comment" : "Signature with special case values r=n and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 197, + "comment" : "Signature with special case values r=n and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 198, + "comment" : "Signature with special case values r=n and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 199, + "comment" : "Signature with special case values r=n and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 200, + "comment" : "Signature with special case values r=n - 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020100", + "result" : "invalid" + }, + { + "tcId" : 201, + "comment" : "Signature with special case values r=n - 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020101", + "result" : "invalid" + }, + { + "tcId" : 202, + "comment" : "Signature with special case values r=n - 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325500201ff", + "result" : "invalid" + }, + { + "tcId" : 203, + "comment" : "Signature with special case values r=n - 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 204, + "comment" : "Signature with special case values r=n - 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 205, + "comment" : "Signature with special case values r=n - 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 206, + "comment" : "Signature with special case values r=n - 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 207, + "comment" : "Signature with special case values r=n - 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 208, + "comment" : "Signature with special case values r=n + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020100", + "result" : "invalid" + }, + { + "tcId" : 209, + "comment" : "Signature with special case values r=n + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020101", + "result" : "invalid" + }, + { + "tcId" : 210, + "comment" : "Signature with special case values r=n + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325520201ff", + "result" : "invalid" + }, + { + "tcId" : 211, + "comment" : "Signature with special case values r=n + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 212, + "comment" : "Signature with special case values r=n + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 213, + "comment" : "Signature with special case values r=n + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 214, + "comment" : "Signature with special case values r=n + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 215, + "comment" : "Signature with special case values r=n + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 216, + "comment" : "Signature with special case values r=p and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020100", + "result" : "invalid" + }, + { + "tcId" : 217, + "comment" : "Signature with special case values r=p and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020101", + "result" : "invalid" + }, + { + "tcId" : 218, + "comment" : "Signature with special case values r=p and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0201ff", + "result" : "invalid" + }, + { + "tcId" : 219, + "comment" : "Signature with special case values r=p and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 220, + "comment" : "Signature with special case values r=p and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 221, + "comment" : "Signature with special case values r=p and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 222, + "comment" : "Signature with special case values r=p and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 223, + "comment" : "Signature with special case values r=p and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 224, + "comment" : "Signature with special case values r=p + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020100", + "result" : "invalid" + }, + { + "tcId" : 225, + "comment" : "Signature with special case values r=p + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020101", + "result" : "invalid" + }, + { + "tcId" : 226, + "comment" : "Signature with special case values r=p + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff000000010000000000000000000000010000000000000000000000000201ff", + "result" : "invalid" + }, + { + "tcId" : 227, + "comment" : "Signature with special case values r=p + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 228, + "comment" : "Signature with special case values r=p + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 229, + "comment" : "Signature with special case values r=p + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 230, + "comment" : "Signature with special case values r=p + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 231, + "comment" : "Signature with special case values r=p + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 232, + "comment" : "Signature encoding contains incorrect types: r=0, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020100090380fe01", + "result" : "invalid" + }, + { + "tcId" : 233, + "comment" : "Signature encoding contains incorrect types: r=0, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100090142", + "result" : "invalid" + }, + { + "tcId" : 234, + "comment" : "Signature encoding contains incorrect types: r=0, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010101", + "result" : "invalid" + }, + { + "tcId" : 235, + "comment" : "Signature encoding contains incorrect types: r=0, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010100", + "result" : "invalid" + }, + { + "tcId" : 236, + "comment" : "Signature encoding contains incorrect types: r=0, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000500", + "result" : "invalid" + }, + { + "tcId" : 237, + "comment" : "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000c00", + "result" : "invalid" + }, + { + "tcId" : 238, + "comment" : "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000c0130", + "result" : "invalid" + }, + { + "tcId" : 239, + "comment" : "Signature encoding contains incorrect types: r=0, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201003000", + "result" : "invalid" + }, + { + "tcId" : 240, + "comment" : "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201003003020100", + "result" : "invalid" + }, + { + "tcId" : 241, + "comment" : "Signature encoding contains incorrect types: r=1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020101090380fe01", + "result" : "invalid" + }, + { + "tcId" : 242, + "comment" : "Signature encoding contains incorrect types: r=1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101090142", + "result" : "invalid" + }, + { + "tcId" : 243, + "comment" : "Signature encoding contains incorrect types: r=1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010101", + "result" : "invalid" + }, + { + "tcId" : 244, + "comment" : "Signature encoding contains incorrect types: r=1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010100", + "result" : "invalid" + }, + { + "tcId" : 245, + "comment" : "Signature encoding contains incorrect types: r=1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010500", + "result" : "invalid" + }, + { + "tcId" : 246, + "comment" : "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010c00", + "result" : "invalid" + }, + { + "tcId" : 247, + "comment" : "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010c0130", + "result" : "invalid" + }, + { + "tcId" : 248, + "comment" : "Signature encoding contains incorrect types: r=1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201013000", + "result" : "invalid" + }, + { + "tcId" : 249, + "comment" : "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201013003020100", + "result" : "invalid" + }, + { + "tcId" : 250, + "comment" : "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 251, + "comment" : "Signature encoding contains incorrect types: r=-1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff090142", + "result" : "invalid" + }, + { + "tcId" : 252, + "comment" : "Signature encoding contains incorrect types: r=-1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010101", + "result" : "invalid" + }, + { + "tcId" : 253, + "comment" : "Signature encoding contains incorrect types: r=-1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010100", + "result" : "invalid" + }, + { + "tcId" : 254, + "comment" : "Signature encoding contains incorrect types: r=-1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0500", + "result" : "invalid" + }, + { + "tcId" : 255, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0c00", + "result" : "invalid" + }, + { + "tcId" : 256, + "comment" : "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0c0130", + "result" : "invalid" + }, + { + "tcId" : 257, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff3000", + "result" : "invalid" + }, + { + "tcId" : 258, + "comment" : "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff3003020100", + "result" : "invalid" + }, + { + "tcId" : 259, + "comment" : "Signature encoding contains incorrect types: r=n, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090380fe01", + "result" : "invalid" + }, + { + "tcId" : 260, + "comment" : "Signature encoding contains incorrect types: r=n, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090142", + "result" : "invalid" + }, + { + "tcId" : 261, + "comment" : "Signature encoding contains incorrect types: r=n, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010101", + "result" : "invalid" + }, + { + "tcId" : 262, + "comment" : "Signature encoding contains incorrect types: r=n, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010100", + "result" : "invalid" + }, + { + "tcId" : 263, + "comment" : "Signature encoding contains incorrect types: r=n, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510500", + "result" : "invalid" + }, + { + "tcId" : 264, + "comment" : "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c00", + "result" : "invalid" + }, + { + "tcId" : 265, + "comment" : "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c0130", + "result" : "invalid" + }, + { + "tcId" : 266, + "comment" : "Signature encoding contains incorrect types: r=n, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513000", + "result" : "invalid" + }, + { + "tcId" : 267, + "comment" : "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513003020100", + "result" : "invalid" + }, + { + "tcId" : 268, + "comment" : "Signature encoding contains incorrect types: r=p, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 269, + "comment" : "Signature encoding contains incorrect types: r=p, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090142", + "result" : "invalid" + }, + { + "tcId" : 270, + "comment" : "Signature encoding contains incorrect types: r=p, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010101", + "result" : "invalid" + }, + { + "tcId" : 271, + "comment" : "Signature encoding contains incorrect types: r=p, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010100", + "result" : "invalid" + }, + { + "tcId" : 272, + "comment" : "Signature encoding contains incorrect types: r=p, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0500", + "result" : "invalid" + }, + { + "tcId" : 273, + "comment" : "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c00", + "result" : "invalid" + }, + { + "tcId" : 274, + "comment" : "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c0130", + "result" : "invalid" + }, + { + "tcId" : 275, + "comment" : "Signature encoding contains incorrect types: r=p, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3000", + "result" : "invalid" + }, + { + "tcId" : 276, + "comment" : "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3003020100", + "result" : "invalid" + }, + { + "tcId" : 277, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a090380fe01090380fe01", + "result" : "invalid" + }, + { + "tcId" : 278, + "comment" : "Signature encoding contains incorrect types: r=nan, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142090142", + "result" : "invalid" + }, + { + "tcId" : 279, + "comment" : "Signature encoding contains incorrect types: r=True, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101010101", + "result" : "invalid" + }, + { + "tcId" : 280, + "comment" : "Signature encoding contains incorrect types: r=False, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100010100", + "result" : "invalid" + }, + { + "tcId" : 281, + "comment" : "Signature encoding contains incorrect types: r=Null, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300405000500", + "result" : "invalid" + }, + { + "tcId" : 282, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30040c000c00", + "result" : "invalid" + }, + { + "tcId" : 283, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c01300c0130", + "result" : "invalid" + }, + { + "tcId" : 284, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300430003000", + "result" : "invalid" + }, + { + "tcId" : 285, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a30030201003003020100", + "result" : "invalid" + }, + { + "tcId" : 286, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008090380fe01020100", + "result" : "invalid" + }, + { + "tcId" : 287, + "comment" : "Signature encoding contains incorrect types: r=nan, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142020100", + "result" : "invalid" + }, + { + "tcId" : 288, + "comment" : "Signature encoding contains incorrect types: r=True, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101020100", + "result" : "invalid" + }, + { + "tcId" : 289, + "comment" : "Signature encoding contains incorrect types: r=False, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100020100", + "result" : "invalid" + }, + { + "tcId" : 290, + "comment" : "Signature encoding contains incorrect types: r=Null, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050500020100", + "result" : "invalid" + }, + { + "tcId" : 291, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050c00020100", + "result" : "invalid" + }, + { + "tcId" : 292, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c0130020100", + "result" : "invalid" + }, + { + "tcId" : 293, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30053000020100", + "result" : "invalid" + }, + { + "tcId" : 294, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30083003020100020100", + "result" : "invalid" + }, + { + "tcId" : 295, + "comment" : "Edge case for Shamir multiplication", + "flags" : [ + "EdgeCaseShamirMultiplication" + ], + "msg" : "313733323231", + "sig" : "3044022064a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e0220404a1a6da158ae1473fce08d338b8d6410a6a5903358b23fdd3a54fee2c2742b", + "result" : "valid" + }, + { + "tcId" : 296, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313930393433323838", + "sig" : "3045022100a9edb87925684bcc5b92d0f7455123656e3498a0d182be63e2e6077c2b43bc6e02202c729ea1b01d14ee8fe702096cddd9394e351d801411ec8eac6b758475ea0070", + "result" : "valid" + }, + { + "tcId" : 297, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383433343734313535", + "sig" : "304402203fba20ca893dcaf04e89141337a96abc7e24e026a8ff4c86d950de1c31b6427202206be2eced4ce388ff8026dfd3b658144f30931b7083ee2af06e75158c15b12249", + "result" : "valid" + }, + { + "tcId" : 298, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353732363936383239", + "sig" : "3045022100c5aa31116f6006c479586ff7070014a35f22166701be8a5f1f1e9a43cb27dca0022068d1cee35ba3893b9cc3b5df5ac6afef55ebdb7ad9236b1fa8e438a538f8cb55", + "result" : "valid" + }, + { + "tcId" : 299, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353931383333343239", + "sig" : "304502205b5b4d890504f56c16a4ac7947ac0057cdf640d2c39bac09fedc648bb0a16f1d022100f9c12e73a56d799e2827538187f0ed0ec331f6f0c089a4f6249d04c1b0c5cc8d", + "result" : "valid" + }, + { + "tcId" : 300, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3832353330383232353839", + "sig" : "304502204338e710478e8b922e50dc947f6fa0cd1903106cf02ee0742da69e8b624c5b6702210090c73bd0fcd07a4dd4a3664d559bd4795ac950d89463680852d33915de1a5745", + "result" : "valid" + }, + { + "tcId" : 301, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3133373334383238313432", + "sig" : "304502200fc97d7744e0b2762e6b48730d44c758ab238136a72693ff27339aaebefad581022100ab68ec80cf4afcca0f7d75f3c4b00e34ed4fe9101c98ed4d8c2f97eb865b1683", + "result" : "valid" + }, + { + "tcId" : 302, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313733383135363430", + "sig" : "3045022100825f0b4230e30182b24b65151ec83d0aadc63ecfe0a91b5879ccf7fcce9eb40a022047f0211ad5471d055fe07c75f37f3fad8aeeff1ee11a54a17bab35212c46d5d6", + "result" : "valid" + }, + { + "tcId" : 303, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353533343636353034", + "sig" : "304502203fedd83579431889710b67b6454d43ea7eddaaa9da950424e2c4ac730065a822022100b50cef5a9da8323fccd5bf13260dea6517c8ae6ccd6495f9ed7494cfd5891573", + "result" : "valid" + }, + { + "tcId" : 304, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32313833303339313937", + "sig" : "3044022069ba62b020a36333f7a0716577dd57d280132c540f66b9e2fe8d470121e0f135022066c7811587cb9247ec6d8c223b4c6d5533948fbabf072973d74cb19d3b2c91a6", + "result" : "valid" + }, + { + "tcId" : 305, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130353236313736353435", + "sig" : "30450221008bb763097d8ca8e9cb84e111f361f47de93499f50bc85401ea96a61d54fad7a802202587b81e277283d5c139b8e9a5f4aa0bb0b1c2b28963efddbf73a0eef341659a", + "result" : "valid" + }, + { + "tcId" : 306, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353031353339393836", + "sig" : "30450221008260a1eb8ba8b52db95b0722887920a1f9989dfa1efd420d1f8f9ab3df0cffce02206752c5687e6889e008eb9ad6e41933796b4adcd6018420fdef250998f6adf603", + "result" : "valid" + }, + { + "tcId" : 307, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134393533313634363139", + "sig" : "3045022100b809c133b30c3a8ff11ea9024b131664b51c2768afb8536744e041015da9380602206cd015a49e19b260da6cd32a94806fb8bdceec5dc5542a7b2b938cce75137f30", + "result" : "valid" + }, + { + "tcId" : 308, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303633383532393036", + "sig" : "304502202069244f8e72562406d631f647a141831aca5907fbff09932797d8305ad3c19d022100dfb7a3ae1a4bdf76987d7de404c5d8b7c51a6ae8dbece9de345a4b71cb5e1f38", + "result" : "valid" + }, + { + "tcId" : 309, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37383339373634393932", + "sig" : "304402204d82e457954761001da6c5dd0fb45d3b8aae12a270cdc5b97d66f810e306532602200cc6217e3aee3839fd809b207d47dea412991932adb2de18ee86431452c22595", + "result" : "valid" + }, + { + "tcId" : 310, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32313239323634343639", + "sig" : "3045022100a81c6258489e10bb1132a6f81f76c31d7465869708d89eb018c51bf774e8a0930220304d75b7bebe9abda5daafc419a765ffb8e5c02dd91836c40c430f052d5ca59c", + "result" : "valid" + }, + { + "tcId" : 311, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34383332303432363833", + "sig" : "3045022100e8da776984d6af2b8d523d1bd6fab8b25409e669d172ef51e104648c1bf0dad1022049b4170fed1cc59ab000087a2c091b3f69a66c8562ed350472e982bd31a0d09e", + "result" : "valid" + }, + { + "tcId" : 312, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333635323231383136", + "sig" : "3046022100c53d293775c5cfdb879b67ff4f4792942132c35c9dc7f8fda8b3a00967c75b47022100c36045151f70a5d6af2fd27cf1f13cb308b2e847151fa4b47e22f2df6220ae95", + "result" : "valid" + }, + { + "tcId" : 313, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3234393137313236393635", + "sig" : "30440220300ee6fa4de853ac6680302a9c439b82dfd046c314d7bbacb2e01274e61e9b5402200bb2b62f11b789848648fab7e0c46ca7b09cded01887ef6bda9f871bc5cc609f", + "result" : "valid" + }, + { + "tcId" : 314, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32363232373930373738", + "sig" : "3045022100ac58a18fa5973efb06adba842affbd256a1c624606b146dae5a6ef85992cb428022048b4ecb8697e4cd20e0f30721ad94f4c18943879ce5d99d8c000d90465138bd0", + "result" : "valid" + }, + { + "tcId" : 315, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313031323537373238393237", + "sig" : "304402206ebc2857fd53656b857005eb8f95c4f6fd3c99f9636a028e5244edc60bc9e18c022027719f12eb1de6cade547cb98523bdc7108622240f38d12f415c79cd0b1344d9", + "result" : "valid" + }, + { + "tcId" : 316, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303530383732323032", + "sig" : "3044022067e8ca1907624419e3ccd88002dd7757f595abc84bd861cd0198364a4571ff6b02200db40b6a7200cdc1a09df432a5a763436ab4130cbdee024dea2a3ddd6c023ed9", + "result" : "valid" + }, + { + "tcId" : 317, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353037373237303332", + "sig" : "3045022100f4d8208eed5cb4bfe4ef6ddbbc3742e780e4212a39cf79c9f85605ee64a962cb022043dee8a3c45a45a91e83a18ff3f881047b4fd6ad3003b3af37fb8211eaf7d584", + "result" : "valid" + }, + { + "tcId" : 318, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373139333435393339", + "sig" : "304402203363ccc93e2413e47528ab086408bc0521be73353f2c2371bbf2d9dc16e63fb3022068f3d1074a2e06d33fc19a567a8af0edcae923560cf38da2dab82e2249c8dbbd", + "result" : "valid" + }, + { + "tcId" : 319, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363337333035373633", + "sig" : "304502210084960758125ad8de3df0c113ff35f1644e4d43f661c2d81848f3fe4e55846f1802205983630fc8975bab570d2c9f3cbbdecb4dd6179ec497aff312d807ec26ca940a", + "result" : "valid" + }, + { + "tcId" : 320, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34323431323733373133", + "sig" : "3044022006ca924b5686a22f2e39c0f980fd58d62bbaf33c3a57f98a315332121e9ba60b02206516b98b31048722ca25e0a6c450461823c0a35f37d671439084fbc27c4779a1", + "result" : "valid" + }, + { + "tcId" : 321, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343735363134373337", + "sig" : "304402200093c5ef07a7d955056b88cc8240060b4ffb42835a3df353cbe16ccb62eaf3f60220364dbea6d5ead4202d6fdc253bb0c2c0522b55823e8bb890235ab09ae9030ea2", + "result" : "valid" + }, + { + "tcId" : 322, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37313632333237373334", + "sig" : "3045022100835274f3157b737975486c73e5bbdd15b61e2ebb9e580911e45fc288214d2e6702201d5dcebfc6d3ae3826b9a3211f5e2249acc967eb47dfd41a849241ffe779154f", + "result" : "valid" + }, + { + "tcId" : 323, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31323232343034313239", + "sig" : "304502203797916fb5c401a691b710050df3eec163383f855f93b61322a56d862ad5572d022100eb7bff4000738a83dd64082eff710d5eb619427198ac290b291f4599768959ca", + "result" : "valid" + }, + { + "tcId" : 324, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353234353833333638", + "sig" : "3044022070992463694c845183db142a77bf5d73c17e9004a8b946b7b8eeb3fdf2b22e00022003843ec28e4c4d4f7726a5a5835575bb3e272f612246bc3aff288ac4a4e90c90", + "result" : "valid" + }, + { + "tcId" : 325, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3331363334333936", + "sig" : "3046022100aeaf228b41a1f311d4df74717f4134ee992e5f2922eec65ec83e2db82a866472022100f5ef65eb9fc3feaaac04f71a9a5ceb73e8cd6cb75b4595b39b250a50476cb68f", + "result" : "valid" + }, + { + "tcId" : 326, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36353332353938343339", + "sig" : "3045022100b84dbbddd3b8a2ddf67d27e4ef886f72d90cbb7ec2d6883728b27842d61505cc022032be7f0ff420ae3be212beb4c276d93e2527b0964d643c5807c8ee711e66e8e5", + "result" : "valid" + }, + { + "tcId" : 327, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373338353138353034", + "sig" : "3046022100f7f6782978f376caf9434941535e1c87ad09b9d39ee936145a0b53b9250fd182022100fb752930c84c29e49f81a997a4d0f00fcdcb4a2f2bf8049cca5d7cf70b079cea", + "result" : "valid" + }, + { + "tcId" : 328, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343635323636353739", + "sig" : "3045022100fb4b434112c1302ffd49ebd993cf5ec59729cbe78739db3c470264e378d56e8d02203aba99bd10be0fba04ca8d9601ae8f68ca7ffe5814f4cfbde78c1cc07a29fd8f", + "result" : "valid" + }, + { + "tcId" : 329, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303334383839343934", + "sig" : "3046022100eafafe851aad76036013bd571772147b7257fb736ed7b4458e0dcf60a2c7b9c0022100b59c6409e51043b7e5c86a8d465978a4c8f78e13ef5b184fe5f46f201ff4efa8", + "result" : "valid" + }, + { + "tcId" : 330, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343730383836373835", + "sig" : "304502206c74d1679d871a46a43c3fe375e09d4f1b6413c59b5e070d7984dae0aadbc37e022100ff1d22228c9e9cf9958d677eed4c3a252b10273ce2d360457faabe7f7439c0e8", + "result" : "valid" + }, + { + "tcId" : 331, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353537363430343436", + "sig" : "3046022100cae28b592e2d5bf6f9ea541e70bceedd07adde40bc2b5f883d35ae9560fc85c202210099eaffc16f570b7837d74177dae6e6cfd873ea89424581bc690d0e49c4218402", + "result" : "valid" + }, + { + "tcId" : 332, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36333434393536363038", + "sig" : "304502206ce5133579dd044447206b9f6e1605d27f094b2c4466a5bf8e157873176baf3a022100bbe35524d9c1936bacecb6c270bf494eac75933caa8dbb2fef30f6572ed8667c", + "result" : "valid" + }, + { + "tcId" : 333, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34393432383039303331", + "sig" : "304402202855cf6e65812ea246e366ab961970d19387039a93f0bd406365d68b0356661302201b3a9593117380899d5c8f8f976ad4dee97db9f1225f735b1d41c2a115be93fb", + "result" : "valid" + }, + { + "tcId" : 334, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323636353831393339", + "sig" : "304502210090ed3aa89579b73477e3fcba9f52a5a64b9b6d83b475a3881bc0e63d74f6bf9c022004cb5e2ca1d413b37a71607d5b5fa72ccc87a2edcd5c7f30daaa94241b749920", + "result" : "valid" + }, + { + "tcId" : 335, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33333332323134313134", + "sig" : "30450220055e38188756831ced4b01e0f9d4db6b02293c7ee2c3fd47860d38377ee0f4190221009c29f1688f16e111914d9c843c0a8f0306c1c4ddd5167cdd54338a4f4ab79a91", + "result" : "valid" + }, + { + "tcId" : 336, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363136353237373135", + "sig" : "3045022006b28cd8538d8cc563473cf6c7abb519e4c8bb4c37915ef76512f37de02c2164022100a62dc2afb01a1a9bc877edd54f25fd1f6d0378b3fbaa219ff9ef28c560cc8065", + "result" : "valid" + }, + { + "tcId" : 337, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333539393535383133", + "sig" : "3045022100c4b97652702efb1d1b67e966e88789efc0d9eb76d32efbeaf9c1bca36b2ea9a5022013e1b2358c7a34fef3ea738ef1a48fab63a2616455c81f8095394a2230c852e3", + "result" : "valid" + }, + { + "tcId" : 338, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323931333631393538", + "sig" : "304502206a86100848566b5f5f89c13643515d81390952b6b5ce56b64fc3349e4edf21df022100c9ca4ba3a6fd501dae9917283a6851692f57dfbfa49d7a31aa937534df760c87", + "result" : "valid" + }, + { + "tcId" : 339, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363230393033333936", + "sig" : "3046022100c1ea204ee71a0502fc47de5d89fad98b897b5c308a4030b4a29de9cc39ff1704022100a5261798ed9665358c31a2368c6705b53b5d7d17023c365ae532573593934481", + "result" : "valid" + }, + { + "tcId" : 340, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33333633313032383432", + "sig" : "3045022100b3c13e4907afa5a629398ff4fb50c48fae69dd3721a6f62ac13b901efcb4717c02206cb8a95728751b6274fb57e0e8fc87bd7911b1b94fb92edf09ef30fce410efe7", + "result" : "valid" + }, + { + "tcId" : 341, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363237373433343931", + "sig" : "30460221009fafebd8841588e56116b2aa354557be814630bae5824e187405f3398f36bc5e022100f01264feb46aeefe68c967e439986f14aeb85ad99b520db572af8d1349d696a6", + "result" : "valid" + }, + { + "tcId" : 342, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33383536373938313437", + "sig" : "3046022100b45703f2c6e95c2f2378913cb78ecf7a01932b66d85e6f687dbb618b056851e8022100e1333352ea3ad42d7fd9a52a9b6dd1252848a180606d30012e142d135156720b", + "result" : "valid" + }, + { + "tcId" : 343, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383831313830363430", + "sig" : "304502204138934da6329335702814333f4df8f907df7aa8e684cc38e2366961828ad937022100b90b1b0d77fa39c81f3df7a471499ebbe415a372e7c947eae8612646081aeb47", + "result" : "valid" + }, + { + "tcId" : 344, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130393537333934363738", + "sig" : "3045022100a52a6cca52d60aedc270cfd2fb0e0c2dde1ec4bb61434a7f11cd126ad46bec5602201dba92bb08e5665da3847abf695dbe18aeae37d9fdcd3617fab0c648f48d8ce6", + "result" : "valid" + }, + { + "tcId" : 345, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353432373131393834", + "sig" : "3045022100b153363d48a58d339a7e53bfedddb63ea63484569bda2630d61c129a45d352e10220592dc8769b4834fae70f2cf3eea157ea9684c56d4875d296313cdf12e4939df8", + "result" : "valid" + }, + { + "tcId" : 346, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313530303334333235", + "sig" : "304402203516e0c8c97110170a5121b5408043f33c6efbef0e5556165812713be6422ae802205d80c5dffa87d3856083bf67beb27e90ebdc2e54d84760c1588f6432ca733195", + "result" : "valid" + }, + { + "tcId" : 347, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393939383231333931", + "sig" : "3046022100903d8397244bfc99f2a677507db419597fef6f0cbfd49e0c022709c06c93e358022100f1705f4a19ab86893e0e022bca9081022764bd986c1c891eb80202ec46f50870", + "result" : "valid" + }, + { + "tcId" : 348, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393731323039323631", + "sig" : "304502203ba4d01ac8cbfc4abf848253d060a4e3faede188fd01c21657c20b61d1943f43022100ca3b5365ffbb98a5539cbe3e71b3d9fc59b5f1d5bee1122870e153ded9e1ce67", + "result" : "valid" + }, + { + "tcId" : 349, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353731383338383537", + "sig" : "30440220741b76d33821c8cac2361048f10d28060f43e2c30b42b3f1b64a432f322e705c022037331cdebe152ff84bf909183069f278f8b0779042d5486b2d9826b42546952d", + "result" : "valid" + }, + { + "tcId" : 350, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38363832323639383935", + "sig" : "3045022100d7988135fd211a2cc09a4588f2d91de3a9a9498d5c5c3ef7e78e9bd80906a63f022025de3162aefbd6afedf01116b4e69d498eaefbf29599a7e0ab60614d64fb3db7", + "result" : "valid" + }, + { + "tcId" : 351, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353438383536303331", + "sig" : "3045022014580cf3aae5ebbb74fed09ff193f347f69ac5b38435eeb7c38a0fd95f5b7ad8022100fcd923fdbdcecb3ece3bd0069c81396b4acf6328648fbe5324ae0c5a276fd87c", + "result" : "valid" + }, + { + "tcId" : 352, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34393935373031333139", + "sig" : "30450220130821bb00d0f4416ef06761aa283d35383cc2d46ad6be76c96d839adce2dbb6022100d9deef38e7d0f136cc535f1f8931f271cbf0b0d9e4e20fc8db7a1fb3c616bb68", + "result" : "valid" + }, + { + "tcId" : 353, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343536363831373835", + "sig" : "3046022100ab4991cad903fc45f6afe22b939640736aec9788b9d8f94109343649d6327695022100ab126decd1743caf4b461a9c8029cf1230a54a0180e5225a79c075167c2911bc", + "result" : "valid" + }, + { + "tcId" : 354, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34313835333731323336", + "sig" : "3045022100dc3b756b20b906f02dc03b46bbef56708be649bb4b23a41ac4333cd79d72749d0220309dfe0623034d6441332aebb327bf5b0fb2f3d6df5a6c02d836fc908e37b0e0", + "result" : "valid" + }, + { + "tcId" : 355, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373237383439303034", + "sig" : "3046022100d733b4391a4876d30acdb95977e4fdfded201e698e42be54c5c690b4c83c9036022100f55565475dc58e468b4aaee60eda224770c5b30517944c065758cd5155ae1251", + "result" : "valid" + }, + { + "tcId" : 356, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353632383139333138", + "sig" : "3045022100aa9ea086e301728e0cac7568bf64095b9f51d070edb46679a9983500245e346802203aeb2415f10625c3a4e818da7ddecea27f56f0a393920f6a5d2f4f3054e2131f", + "result" : "valid" + }, + { + "tcId" : 357, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3231383739393238333836", + "sig" : "3045022100d5a6ffddece918c5fe4e7d3a11344612bfb0cd2735ce071dfade01244c3b303c02200ff4ee3a70b9984e49277b3b15252c9f255b9ed51c7a4473cf55a7955083a985", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0458e71ffbfd2eabf4e4a465f68100f3d23d4702537dfcca5ee89d18a75ad7f75616535d3b19f050e443bf5dc38f7f7cda9df3798d4a2f65a413a9af5df002828c", + "wx" : "58e71ffbfd2eabf4e4a465f68100f3d23d4702537dfcca5ee89d18a75ad7f756", + "wy" : "16535d3b19f050e443bf5dc38f7f7cda9df3798d4a2f65a413a9af5df002828c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000458e71ffbfd2eabf4e4a465f68100f3d23d4702537dfcca5ee89d18a75ad7f75616535d3b19f050e443bf5dc38f7f7cda9df3798d4a2f65a413a9af5df002828c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWOcf+/0uq/TkpGX2gQDz0j1HAlN9\n/Mpe6J0Yp1rX91YWU107GfBQ5EO/XcOPf3zanfN5jUovZaQTqa9d8AKCjA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 358, + "comment" : "k*G has a large x-coordinate", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "303502104319055358e8617b0c46353d039cdaab022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "valid" + }, + { + "tcId" : 359, + "comment" : "r too large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000fffffffffffffffffffffffc022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040a78dad1701d0551089d3a0ee329a22a9d8bf4263c8a50e0668d24306cf0240b03950b34bb638c683c167a00ac06232c2ef1718d3ed7ebcfc145a41031b04ee0", + "wx" : "0a78dad1701d0551089d3a0ee329a22a9d8bf4263c8a50e0668d24306cf0240b", + "wy" : "03950b34bb638c683c167a00ac06232c2ef1718d3ed7ebcfc145a41031b04ee0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040a78dad1701d0551089d3a0ee329a22a9d8bf4263c8a50e0668d24306cf0240b03950b34bb638c683c167a00ac06232c2ef1718d3ed7ebcfc145a41031b04ee0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECnja0XAdBVEInToO4ymiKp2L9CY8\nilDgZo0kMGzwJAsDlQs0u2OMaDwWegCsBiMsLvFxjT7X68/BRaQQMbBO4A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 360, + "comment" : "r,s are large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e5b027e1f5daf6e52eca80e35be28651bf849ff3de70d2a34c0d782b5aaad6853c8e2cff9b02c90bf4d7d49c7ff2a261d26aed7d4022b41392c85a857d434579", + "wx" : "00e5b027e1f5daf6e52eca80e35be28651bf849ff3de70d2a34c0d782b5aaad685", + "wy" : "3c8e2cff9b02c90bf4d7d49c7ff2a261d26aed7d4022b41392c85a857d434579" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e5b027e1f5daf6e52eca80e35be28651bf849ff3de70d2a34c0d782b5aaad6853c8e2cff9b02c90bf4d7d49c7ff2a261d26aed7d4022b41392c85a857d434579", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5bAn4fXa9uUuyoDjW+KGUb+En/Pe\ncNKjTA14K1qq1oU8jiz/mwLJC/TX1Jx/8qJh0mrtfUAitBOSyFqFfUNFeQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 361, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0424c5462bb7d1f1763ce28b3a9f851d86d7cb4c5f7c61ed9ed7d397f1a920ffc99460936b6919f88646844b27503555262ef8a81e6704f43e07deda12aa06f4ae", + "wx" : "24c5462bb7d1f1763ce28b3a9f851d86d7cb4c5f7c61ed9ed7d397f1a920ffc9", + "wy" : "009460936b6919f88646844b27503555262ef8a81e6704f43e07deda12aa06f4ae" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000424c5462bb7d1f1763ce28b3a9f851d86d7cb4c5f7c61ed9ed7d397f1a920ffc99460936b6919f88646844b27503555262ef8a81e6704f43e07deda12aa06f4ae", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJMVGK7fR8XY84os6n4UdhtfLTF98\nYe2e19OX8akg/8mUYJNraRn4hkaESydQNVUmLvioHmcE9D4H3toSqgb0rg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 362, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022027b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046226bb83d3cef01ae27b7d04a905397682d5e4a5964b5160dba8a055a2e2aeca7a3630d49d999d0e85e59fe762c9c567cb767ca2a0a7a7756ac917e6085b18e1", + "wx" : "6226bb83d3cef01ae27b7d04a905397682d5e4a5964b5160dba8a055a2e2aeca", + "wy" : "7a3630d49d999d0e85e59fe762c9c567cb767ca2a0a7a7756ac917e6085b18e1" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046226bb83d3cef01ae27b7d04a905397682d5e4a5964b5160dba8a055a2e2aeca7a3630d49d999d0e85e59fe762c9c567cb767ca2a0a7a7756ac917e6085b18e1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYia7g9PO8Brie30EqQU5doLV5KWW\nS1Fg26igVaLirsp6NjDUnZmdDoXln+diycVny3Z8oqCnp3VqyRfmCFsY4Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 363, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0465af8c23310fe060a09e7366d82ea35f48f8e2c682eab3783de7d9711f5923bebebabfaf084741fc806b9698ef87c9459246b7846fa17400094ad0bb222c2cb6", + "wx" : "65af8c23310fe060a09e7366d82ea35f48f8e2c682eab3783de7d9711f5923be", + "wy" : "00bebabfaf084741fc806b9698ef87c9459246b7846fa17400094ad0bb222c2cb6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000465af8c23310fe060a09e7366d82ea35f48f8e2c682eab3783de7d9711f5923bebebabfaf084741fc806b9698ef87c9459246b7846fa17400094ad0bb222c2cb6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZa+MIzEP4GCgnnNm2C6jX0j44saC\n6rN4PefZcR9ZI76+ur+vCEdB/IBrlpjvh8lFkka3hG+hdAAJStC7Iiwstg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 364, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f26ea876edab91b4070c5ec6e36663fff86f1fe5ef73938b227766b1805773cd07059506a5296d5766d4c55c06eebccf81c04e52cb14c3b198a18808d570d417", + "wx" : "00f26ea876edab91b4070c5ec6e36663fff86f1fe5ef73938b227766b1805773cd", + "wy" : "07059506a5296d5766d4c55c06eebccf81c04e52cb14c3b198a18808d570d417" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f26ea876edab91b4070c5ec6e36663fff86f1fe5ef73938b227766b1805773cd07059506a5296d5766d4c55c06eebccf81c04e52cb14c3b198a18808d570d417", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8m6odu2rkbQHDF7G42Zj//hvH+Xv\nc5OLIndmsYBXc80HBZUGpSltV2bUxVwG7rzPgcBOUssUw7GYoYgI1XDUFw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 365, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020105", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "047811e16675799076c4f5ea78e5f833be4649925165672057443c436cf4017e0d8e377d53fecdf1556b1cdfdd8270d920cf7c6d32c946af2db4c864faec6b1eba", + "wx" : "7811e16675799076c4f5ea78e5f833be4649925165672057443c436cf4017e0d", + "wy" : "008e377d53fecdf1556b1cdfdd8270d920cf7c6d32c946af2db4c864faec6b1eba" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200047811e16675799076c4f5ea78e5f833be4649925165672057443c436cf4017e0d8e377d53fecdf1556b1cdfdd8270d920cf7c6d32c946af2db4c864faec6b1eba", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeBHhZnV5kHbE9ep45fgzvkZJklFl\nZyBXRDxDbPQBfg2ON31T/s3xVWsc392CcNkgz3xtMslGry20yGT67Gseug==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 366, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020106", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04614ec72ada338db0177b53573827f11c5b95b577117f14580aa81e12b47aeb8cd89bf53fd6de48ec10fa6ed7213474c04c5990ca9e14dc098a4ed4b6805937cf", + "wx" : "614ec72ada338db0177b53573827f11c5b95b577117f14580aa81e12b47aeb8c", + "wy" : "00d89bf53fd6de48ec10fa6ed7213474c04c5990ca9e14dc098a4ed4b6805937cf" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004614ec72ada338db0177b53573827f11c5b95b577117f14580aa81e12b47aeb8cd89bf53fd6de48ec10fa6ed7213474c04c5990ca9e14dc098a4ed4b6805937cf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYU7HKtozjbAXe1NXOCfxHFuVtXcR\nfxRYCqgeErR664zYm/U/1t5I7BD6btchNHTATFmQyp4U3AmKTtS2gFk3zw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 367, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0452c01eaee2e5c30e7db97061b0e00b44f7199a23c1db44f2428e342a71e1df6ee37cc4355d79bfa76afc34e2db9cdac7f451cc9b28f772269c8b017d964d9a67", + "wx" : "52c01eaee2e5c30e7db97061b0e00b44f7199a23c1db44f2428e342a71e1df6e", + "wy" : "00e37cc4355d79bfa76afc34e2db9cdac7f451cc9b28f772269c8b017d964d9a67" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000452c01eaee2e5c30e7db97061b0e00b44f7199a23c1db44f2428e342a71e1df6ee37cc4355d79bfa76afc34e2db9cdac7f451cc9b28f772269c8b017d964d9a67", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUsAeruLlww59uXBhsOALRPcZmiPB\n20TyQo40KnHh327jfMQ1XXm/p2r8NOLbnNrH9FHMmyj3ciaciwF9lk2aZw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 368, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0478c04ef617e9ba8427a4946816e39c1319ff166ad0f248ef61b48e80e8b5a23512d07e5c45e1500c8ca4f714f68d47f762cad5ce8b798fbac0e1e2bfa395bc5e", + "wx" : "78c04ef617e9ba8427a4946816e39c1319ff166ad0f248ef61b48e80e8b5a235", + "wy" : "12d07e5c45e1500c8ca4f714f68d47f762cad5ce8b798fbac0e1e2bfa395bc5e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000478c04ef617e9ba8427a4946816e39c1319ff166ad0f248ef61b48e80e8b5a23512d07e5c45e1500c8ca4f714f68d47f762cad5ce8b798fbac0e1e2bfa395bc5e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeMBO9hfpuoQnpJRoFuOcExn/FmrQ\n8kjvYbSOgOi1ojUS0H5cReFQDIyk9xT2jUf3YsrVzot5j7rA4eK/o5W8Xg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 369, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020106", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045a6605c4dd6006cd2575c4e5a4eeecb99513b3df4ad1482218951b44b9dc615327d7b42d22a138d10d275fc4bf3363fcabc2d3cb22d8b68e8f358f28bc765c39", + "wx" : "5a6605c4dd6006cd2575c4e5a4eeecb99513b3df4ad1482218951b44b9dc6153", + "wy" : "27d7b42d22a138d10d275fc4bf3363fcabc2d3cb22d8b68e8f358f28bc765c39" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045a6605c4dd6006cd2575c4e5a4eeecb99513b3df4ad1482218951b44b9dc615327d7b42d22a138d10d275fc4bf3363fcabc2d3cb22d8b68e8f358f28bc765c39", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWmYFxN1gBs0ldcTlpO7suZUTs99K\n0UgiGJUbRLncYVMn17QtIqE40Q0nX8S/M2P8q8LTyyLYto6PNY8ovHZcOQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 370, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020107", + "result" : "valid" + }, + { + "tcId" : 371, + "comment" : "r is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632557020107", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04254166f8cc3c42f25c88ad410aa3e3003165de62377aa1eb2baf1ca00c6f6e402abea7a234b07e3f962839ba9c31fdbc3b86618e2151fe50cbcc24153e86f5d9", + "wx" : "254166f8cc3c42f25c88ad410aa3e3003165de62377aa1eb2baf1ca00c6f6e40", + "wy" : "2abea7a234b07e3f962839ba9c31fdbc3b86618e2151fe50cbcc24153e86f5d9" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004254166f8cc3c42f25c88ad410aa3e3003165de62377aa1eb2baf1ca00c6f6e402abea7a234b07e3f962839ba9c31fdbc3b86618e2151fe50cbcc24153e86f5d9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJUFm+Mw8QvJciK1BCqPjADFl3mI3\neqHrK68coAxvbkAqvqeiNLB+P5YoObqcMf28O4ZhjiFR/lDLzCQVPob12Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 372, + "comment" : "s is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020106022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc75fbd8", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044b2475ae911ab3e3334bd5acefce2225e35ad7f4523df52c13f581b87898cca195575d5296d1bd97efaa74a12cc0df3d556a614f176c25b06348af8d304ea6c7", + "wx" : "4b2475ae911ab3e3334bd5acefce2225e35ad7f4523df52c13f581b87898cca1", + "wy" : "0095575d5296d1bd97efaa74a12cc0df3d556a614f176c25b06348af8d304ea6c7" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044b2475ae911ab3e3334bd5acefce2225e35ad7f4523df52c13f581b87898cca195575d5296d1bd97efaa74a12cc0df3d556a614f176c25b06348af8d304ea6c7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAESyR1rpEas+MzS9Ws784iJeNa1/RS\nPfUsE/WBuHiYzKGVV11SltG9l++qdKEswN89VWphTxdsJbBjSK+NME6mxw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 373, + "comment" : "small r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3027020201000221008f1e3c7862c58b16bb76eddbb76eddbb516af4f63f2d74d76e0d28c9bb75ea88", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04211cc26f1f60998bccfc6ae65cfe8f1bf2e70fc28b5aaf8e2a297f3f4460662c3ffc8dbd9b58a341d5160ff03b7a503649967a9a937edbbfc4bf154aa6e1a0ae", + "wx" : "211cc26f1f60998bccfc6ae65cfe8f1bf2e70fc28b5aaf8e2a297f3f4460662c", + "wy" : "3ffc8dbd9b58a341d5160ff03b7a503649967a9a937edbbfc4bf154aa6e1a0ae" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004211cc26f1f60998bccfc6ae65cfe8f1bf2e70fc28b5aaf8e2a297f3f4460662c3ffc8dbd9b58a341d5160ff03b7a503649967a9a937edbbfc4bf154aa6e1a0ae", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIRzCbx9gmYvM/GrmXP6PG/LnD8KL\nWq+OKil/P0RgZiw//I29m1ijQdUWD/A7elA2SZZ6mpN+27/EvxVKpuGgrg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 374, + "comment" : "smallish r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302c02072d9b4d347952d6022100ef3043e7329581dbb3974497710ab11505ee1c87ff907beebadd195a0ffe6d7a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040a7bb520f0cc16284831167d3622b276487a7bbf41bf911d367b484f1bd81a0c0c30d573d27d44e68fb9a109ac7faad2c57ae09de30d8203ab409cd3ca63af3a", + "wx" : "0a7bb520f0cc16284831167d3622b276487a7bbf41bf911d367b484f1bd81a0c", + "wy" : "0c30d573d27d44e68fb9a109ac7faad2c57ae09de30d8203ab409cd3ca63af3a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040a7bb520f0cc16284831167d3622b276487a7bbf41bf911d367b484f1bd81a0c0c30d573d27d44e68fb9a109ac7faad2c57ae09de30d8203ab409cd3ca63af3a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECnu1IPDMFihIMRZ9NiKydkh6e79B\nv5EdNntITxvYGgwMMNVz0n1E5o+5oQmsf6rSxXrgneMNggOrQJzTymOvOg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 375, + "comment" : "100-bit r and small s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d1033e67e37b32b445580bf4eff0221008b748b74000000008b748b748b748b7466e769ad4a16d3dcd87129b8e91d1b4d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d528a48fb391dd490d3f32810570613d16fe2709b82245027705e359549b0e155f4a5ac279d55c9ea6371f56403f816ee723632911df9804f01c7fa289eb2361", + "wx" : "00d528a48fb391dd490d3f32810570613d16fe2709b82245027705e359549b0e15", + "wy" : "5f4a5ac279d55c9ea6371f56403f816ee723632911df9804f01c7fa289eb2361" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d528a48fb391dd490d3f32810570613d16fe2709b82245027705e359549b0e155f4a5ac279d55c9ea6371f56403f816ee723632911df9804f01c7fa289eb2361", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Sikj7OR3UkNPzKBBXBhPRb+Jwm4\nIkUCdwXjWVSbDhVfSlrCedVcnqY3H1ZAP4Fu5yNjKRHfmATwHH+iiesjYQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 376, + "comment" : "small r and 100 bit s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302702020100022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d1f035f0a28c0c49e6248ff373874da5b26b47e7cd89c1b3bd15402dc9bd7b627a182a1884f30222976579d766da681a7f31fe55b14e770dd0f3f1c09654b29c", + "wx" : "00d1f035f0a28c0c49e6248ff373874da5b26b47e7cd89c1b3bd15402dc9bd7b62", + "wy" : "7a182a1884f30222976579d766da681a7f31fe55b14e770dd0f3f1c09654b29c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d1f035f0a28c0c49e6248ff373874da5b26b47e7cd89c1b3bd15402dc9bd7b627a182a1884f30222976579d766da681a7f31fe55b14e770dd0f3f1c09654b29c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0fA18KKMDEnmJI/zc4dNpbJrR+fN\nicGzvRVALcm9e2J6GCoYhPMCIpdleddm2mgafzH+VbFOdw3Q8/HAllSynA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 377, + "comment" : "100-bit r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d062522bbd3ecbe7c39e93e7c25022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0407df495050dcb1738f4e2aac5ba2c8a1f8e09d262a3b001865af3fba086d7aa1b596cde482a6bfdc5e49e4069fce7c2d1145d1e0f7fed63f9e848446fae479ed", + "wx" : "07df495050dcb1738f4e2aac5ba2c8a1f8e09d262a3b001865af3fba086d7aa1", + "wy" : "00b596cde482a6bfdc5e49e4069fce7c2d1145d1e0f7fed63f9e848446fae479ed" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000407df495050dcb1738f4e2aac5ba2c8a1f8e09d262a3b001865af3fba086d7aa1b596cde482a6bfdc5e49e4069fce7c2d1145d1e0f7fed63f9e848446fae479ed", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEB99JUFDcsXOPTiqsW6LIofjgnSYq\nOwAYZa8/ughteqG1ls3kgqa/3F5J5AafznwtEUXR4Pf+1j+ehIRG+uR57Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 378, + "comment" : "r and s^-1 are close to n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d50220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "047191df2d2802bf5c1c7f1a920334e7344ef340e8e5260ba6321bf1d8598099717fb768b3fe7eb246237e1ab5f42cc18d4b73e53b06ccfd7c86b0a13e7f6c411f", + "wx" : "7191df2d2802bf5c1c7f1a920334e7344ef340e8e5260ba6321bf1d859809971", + "wy" : "7fb768b3fe7eb246237e1ab5f42cc18d4b73e53b06ccfd7c86b0a13e7f6c411f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200047191df2d2802bf5c1c7f1a920334e7344ef340e8e5260ba6321bf1d8598099717fb768b3fe7eb246237e1ab5f42cc18d4b73e53b06ccfd7c86b0a13e7f6c411f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcZHfLSgCv1wcfxqSAzTnNE7zQOjl\nJgumMhvx2FmAmXF/t2iz/n6yRiN+GrX0LMGNS3PlOwbM/XyGsKE+f2xBHw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 379, + "comment" : "r and s are 64-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30160209009c44febf31c3594f020900839ed28247c2b06b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042c85a72b248789298f58a5a26a94afa6f5d6a7eb1eaac513ab23eefd9cb4ff99a1a1d193532f4c29d6625055000985809b5e8b8a10c72917d72e01c2f94aeeb2", + "wx" : "2c85a72b248789298f58a5a26a94afa6f5d6a7eb1eaac513ab23eefd9cb4ff99", + "wy" : "00a1a1d193532f4c29d6625055000985809b5e8b8a10c72917d72e01c2f94aeeb2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042c85a72b248789298f58a5a26a94afa6f5d6a7eb1eaac513ab23eefd9cb4ff99a1a1d193532f4c29d6625055000985809b5e8b8a10c72917d72e01c2f94aeeb2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELIWnKySHiSmPWKWiapSvpvXWp+se\nqsUTqyPu/Zy0/5mhodGTUy9MKdZiUFUACYWAm16LihDHKRfXLgHC+Urusg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 380, + "comment" : "r and s are 100-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "301e020d09df8b682430beef6f5fd7c7cd020d0fd0a62e13778f4222a0d61c8a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d12e2032878b23d1de80f0c651ef0808a70dc2d70cc3dcd20b98ac1a92d5d5022fd7907dde50f2787f5624ff87e7c30b1dabfd9205628a77205543aa27f4add6", + "wx" : "00d12e2032878b23d1de80f0c651ef0808a70dc2d70cc3dcd20b98ac1a92d5d502", + "wy" : "2fd7907dde50f2787f5624ff87e7c30b1dabfd9205628a77205543aa27f4add6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d12e2032878b23d1de80f0c651ef0808a70dc2d70cc3dcd20b98ac1a92d5d5022fd7907dde50f2787f5624ff87e7c30b1dabfd9205628a77205543aa27f4add6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0S4gMoeLI9HegPDGUe8ICKcNwtcM\nw9zSC5isGpLV1QIv15B93lDyeH9WJP+H58MLHav9kgViincgVUOqJ/St1g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 381, + "comment" : "r and s are 128-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30260211008a598e563a89f526c32ebec8de26367c02110084f633e2042630e99dd0f1e16f7a04bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c426e874ea701e368f3b0bffb0342e6e439769cd5c0cbf412b2114318ae2bb0d8ef8853bebf73416641b4b3516c939364fe0e042a503ee5fe1e3f497371f920b", + "wx" : "00c426e874ea701e368f3b0bffb0342e6e439769cd5c0cbf412b2114318ae2bb0d", + "wy" : "008ef8853bebf73416641b4b3516c939364fe0e042a503ee5fe1e3f497371f920b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c426e874ea701e368f3b0bffb0342e6e439769cd5c0cbf412b2114318ae2bb0d8ef8853bebf73416641b4b3516c939364fe0e042a503ee5fe1e3f497371f920b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExCbodOpwHjaPOwv/sDQubkOXac1c\nDL9BKyEUMYriuw2O+IU76/c0FmQbSzUWyTk2T+DgQqUD7l/h4/SXNx+SCw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 382, + "comment" : "r and s are 160-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ccd70d8730532b28c78c27dbd3043fdde3e96f10ede406582c9cba2618dc03c195d592c366bd189683fd581dde22fb91176b55d94e48dd81467234777d8c223a", + "wx" : "00ccd70d8730532b28c78c27dbd3043fdde3e96f10ede406582c9cba2618dc03c1", + "wy" : "0095d592c366bd189683fd581dde22fb91176b55d94e48dd81467234777d8c223a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ccd70d8730532b28c78c27dbd3043fdde3e96f10ede406582c9cba2618dc03c195d592c366bd189683fd581dde22fb91176b55d94e48dd81467234777d8c223a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzNcNhzBTKyjHjCfb0wQ/3ePpbxDt\n5AZYLJy6JhjcA8GV1ZLDZr0YloP9WB3eIvuRF2tV2U5I3YFGcjR3fYwiOg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 383, + "comment" : "s == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020101", + "result" : "valid" + }, + { + "tcId" : 384, + "comment" : "s == 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020100", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041f8988dacc3cad2c1b0c8ffd0a658aea1a3087fc17ff0e6b8c18460d27b85c51ff457f9c9d0f0ec9a600f80fffdd61ef4796393412e7a20fde0681d3cf459207", + "wx" : "1f8988dacc3cad2c1b0c8ffd0a658aea1a3087fc17ff0e6b8c18460d27b85c51", + "wy" : "00ff457f9c9d0f0ec9a600f80fffdd61ef4796393412e7a20fde0681d3cf459207" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041f8988dacc3cad2c1b0c8ffd0a658aea1a3087fc17ff0e6b8c18460d27b85c51ff457f9c9d0f0ec9a600f80fffdd61ef4796393412e7a20fde0681d3cf459207", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEH4mI2sw8rSwbDI/9CmWK6howh/wX\n/w5rjBhGDSe4XFH/RX+cnQ8OyaYA+A//3WHvR5Y5NBLnog/eBoHTz0WSBw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 385, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022002f676969f451a8ccafa4c4f09791810e6d632dbd60b1d5540f3284fbe1889b0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f4abc335796df25dd37438ffa95f10e95a7aa151772866d4d4552f4e57bc8534cd2ffd7ce1c68f1c76273907a63efff7b37d892056e1a92ecc92011f29123149", + "wx" : "00f4abc335796df25dd37438ffa95f10e95a7aa151772866d4d4552f4e57bc8534", + "wy" : "00cd2ffd7ce1c68f1c76273907a63efff7b37d892056e1a92ecc92011f29123149" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f4abc335796df25dd37438ffa95f10e95a7aa151772866d4d4552f4e57bc8534cd2ffd7ce1c68f1c76273907a63efff7b37d892056e1a92ecc92011f29123149", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9KvDNXlt8l3TdDj/qV8Q6Vp6oVF3\nKGbU1FUvTle8hTTNL/184caPHHYnOQemPv/3s32JIFbhqS7MkgEfKRIxSQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 386, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204e260962e33362ef0046126d2d5a4edc6947ab20e19b8ec19cf79e5908b6e628", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c14f3c54383dc417e1c5b5435e22970244ca7224b5f1de57e3504ba1d3c2917f1f918ffaf92826215ce07f5f154f85a8a53da1562b21956852b9e17f89a67a30", + "wx" : "00c14f3c54383dc417e1c5b5435e22970244ca7224b5f1de57e3504ba1d3c2917f", + "wy" : "1f918ffaf92826215ce07f5f154f85a8a53da1562b21956852b9e17f89a67a30" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c14f3c54383dc417e1c5b5435e22970244ca7224b5f1de57e3504ba1d3c2917f1f918ffaf92826215ce07f5f154f85a8a53da1562b21956852b9e17f89a67a30", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwU88VDg9xBfhxbVDXiKXAkTKciS1\n8d5X41BLodPCkX8fkY/6+SgmIVzgf18VT4WopT2hVishlWhSueF/iaZ6MA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 387, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220077ed0d8f20f697d8fc591ac64dd5219c7932122b4f9b9ec6441e44a0092cf21", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049b2c90cfdd7a8a863e7b6c87808084e9aa3139f28f4003a70f5f4eab7451acc21e9d89ce759ca1dacc053c891d62c3cfff7825ae90939eca14144dc412246518", + "wx" : "009b2c90cfdd7a8a863e7b6c87808084e9aa3139f28f4003a70f5f4eab7451acc2", + "wy" : "1e9d89ce759ca1dacc053c891d62c3cfff7825ae90939eca14144dc412246518" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049b2c90cfdd7a8a863e7b6c87808084e9aa3139f28f4003a70f5f4eab7451acc21e9d89ce759ca1dacc053c891d62c3cfff7825ae90939eca14144dc412246518", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmyyQz916ioY+e2yHgICE6aoxOfKP\nQAOnD19Oq3RRrMIenYnOdZyh2swFPIkdYsPP/3glrpCTnsoUFE3EEiRlGA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 388, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203e0292a67e181c6c0105ee35e956e78e9bdd033c6e71ae57884039a245e4175f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04610f3e2d4c77a03ef50fa14f493f4339495a1ec17fa8f808a882a511609aa7cff3aa69595f06ad03ad66631776ab92f46bb3ba4076a6700aa8e2506c7c3465dc", + "wx" : "610f3e2d4c77a03ef50fa14f493f4339495a1ec17fa8f808a882a511609aa7cf", + "wy" : "00f3aa69595f06ad03ad66631776ab92f46bb3ba4076a6700aa8e2506c7c3465dc" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004610f3e2d4c77a03ef50fa14f493f4339495a1ec17fa8f808a882a511609aa7cff3aa69595f06ad03ad66631776ab92f46bb3ba4076a6700aa8e2506c7c3465dc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYQ8+LUx3oD71D6FPST9DOUlaHsF/\nqPgIqIKlEWCap8/zqmlZXwatA61mYxd2q5L0a7O6QHamcAqo4lBsfDRl3A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 389, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022013d22b06d6b8f5d97e0c64962b4a3bae30f668ca6217ef5b35d799f159e23ebe", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041d4adb9b39e60961642009a7fcf652bdf2486a2a1d81d2053e0f74cf44ee25bcfc970fa80e9254aadeaf29953a70bcfec45036e80e9ffd2fcb613e0b77f3a79b", + "wx" : "1d4adb9b39e60961642009a7fcf652bdf2486a2a1d81d2053e0f74cf44ee25bc", + "wy" : "00fc970fa80e9254aadeaf29953a70bcfec45036e80e9ffd2fcb613e0b77f3a79b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041d4adb9b39e60961642009a7fcf652bdf2486a2a1d81d2053e0f74cf44ee25bcfc970fa80e9254aadeaf29953a70bcfec45036e80e9ffd2fcb613e0b77f3a79b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHUrbmznmCWFkIAmn/PZSvfJIaiod\ngdIFPg90z0TuJbz8lw+oDpJUqt6vKZU6cLz+xFA26A6f/S/LYT4Ld/Onmw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 390, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204523ce342e4994bb8968bf6613f60c06c86111f15a3a389309e72cd447d5dd99", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e07cd7e84b60e1796d2bc60425d6d78d23d1fd8ac9307dc093f192091729098bfbddbe1f37d56cd70d724351ace73a9bafae86ff25b07f6bc5c3bb0dc9e6c5ea", + "wx" : "00e07cd7e84b60e1796d2bc60425d6d78d23d1fd8ac9307dc093f192091729098b", + "wy" : "00fbddbe1f37d56cd70d724351ace73a9bafae86ff25b07f6bc5c3bb0dc9e6c5ea" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e07cd7e84b60e1796d2bc60425d6d78d23d1fd8ac9307dc093f192091729098bfbddbe1f37d56cd70d724351ace73a9bafae86ff25b07f6bc5c3bb0dc9e6c5ea", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4HzX6Etg4XltK8YEJdbXjSPR/YrJ\nMH3Ak/GSCRcpCYv73b4fN9Vs1w1yQ1Gs5zqbr66G/yWwf2vFw7sNyebF6g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 391, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022037d765be3c9c78189ad30edb5097a4db670de11686d01420e37039d4677f4809", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0416721082930348f66413f7e2f857e8c274504ea66882968ae67dabd67eacf97547f56aeb5ea69ef5f148a534fc483f3aa1d81ac7fc4c2fb09528d80b7fceee8b", + "wx" : "16721082930348f66413f7e2f857e8c274504ea66882968ae67dabd67eacf975", + "wy" : "47f56aeb5ea69ef5f148a534fc483f3aa1d81ac7fc4c2fb09528d80b7fceee8b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000416721082930348f66413f7e2f857e8c274504ea66882968ae67dabd67eacf97547f56aeb5ea69ef5f148a534fc483f3aa1d81ac7fc4c2fb09528d80b7fceee8b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFnIQgpMDSPZkE/fi+FfownRQTqZo\ngpaK5n2r1n6s+XVH9WrrXqae9fFIpTT8SD86odgax/xML7CVKNgLf87uiw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 392, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022044237823b54e0c74c2bf5f759d9ac5f8cb897d537ffa92effd4f0bb6c9acd860", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ed6a45063ce925581a2f1311175b803d52734b1d1eb228e2b7613fb035fceb176acf1c484f0a1b69edc4a57b7034071ffcf59bbfefbfc0e26bd782001ba64648", + "wx" : "00ed6a45063ce925581a2f1311175b803d52734b1d1eb228e2b7613fb035fceb17", + "wy" : "6acf1c484f0a1b69edc4a57b7034071ffcf59bbfefbfc0e26bd782001ba64648" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ed6a45063ce925581a2f1311175b803d52734b1d1eb228e2b7613fb035fceb176acf1c484f0a1b69edc4a57b7034071ffcf59bbfefbfc0e26bd782001ba64648", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7WpFBjzpJVgaLxMRF1uAPVJzSx0e\nsijit2E/sDX86xdqzxxITwobae3EpXtwNAcf/PWbv++/wOJr14IAG6ZGSA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 393, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220266d30a485385906054ca86d46f5f2b17e7f4646a3092092ad92877126538111", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0473b53fb23c69bd8125654f20f4d06e0c5c95bcf8517f9ddb4b2ebfdaa8cf697728c7ee3f0f7d01f7c1786cca19c2e615e6ae6f5893621c3987497e82da8e48d8", + "wx" : "73b53fb23c69bd8125654f20f4d06e0c5c95bcf8517f9ddb4b2ebfdaa8cf6977", + "wy" : "28c7ee3f0f7d01f7c1786cca19c2e615e6ae6f5893621c3987497e82da8e48d8" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000473b53fb23c69bd8125654f20f4d06e0c5c95bcf8517f9ddb4b2ebfdaa8cf697728c7ee3f0f7d01f7c1786cca19c2e615e6ae6f5893621c3987497e82da8e48d8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEc7U/sjxpvYElZU8g9NBuDFyVvPhR\nf53bSy6/2qjPaXcox+4/D30B98F4bMoZwuYV5q5vWJNiHDmHSX6C2o5I2A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 394, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220538c7b3798e84d0ce90340165806348971ed44db8f0c674f5f215968390f92ee", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042cce7a425b581db81b8d5cf49dc91b0fc87bfb68fd39441753b95c4553df9e3817c82c0f948a7f87d369342aebb69c7b4c31e7effaeebd47613f178440079b04", + "wx" : "2cce7a425b581db81b8d5cf49dc91b0fc87bfb68fd39441753b95c4553df9e38", + "wy" : "17c82c0f948a7f87d369342aebb69c7b4c31e7effaeebd47613f178440079b04" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042cce7a425b581db81b8d5cf49dc91b0fc87bfb68fd39441753b95c4553df9e3817c82c0f948a7f87d369342aebb69c7b4c31e7effaeebd47613f178440079b04", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELM56QltYHbgbjVz0nckbD8h7+2j9\nOUQXU7lcRVPfnjgXyCwPlIp/h9NpNCrrtpx7TDHn7/ruvUdhPxeEQAebBA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 395, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206fef0ef15d1688e15e704c4e6bb8bb7f40d52d3af5c661bb78c4ed9b408699b3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042def9d0d74cce8abf9392d66d5a615376287960a77d9c4c11a58a263033f09e9666783f2b5fd528738f87da459a51f6ad6be34427366bba458d8f16260427409", + "wx" : "2def9d0d74cce8abf9392d66d5a615376287960a77d9c4c11a58a263033f09e9", + "wy" : "666783f2b5fd528738f87da459a51f6ad6be34427366bba458d8f16260427409" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042def9d0d74cce8abf9392d66d5a615376287960a77d9c4c11a58a263033f09e9666783f2b5fd528738f87da459a51f6ad6be34427366bba458d8f16260427409", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELe+dDXTM6Kv5OS1m1aYVN2KHlgp3\n2cTBGliiYwM/CelmZ4Pytf1Shzj4faRZpR9q1r40QnNmu6RY2PFiYEJ0CQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 396, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206f44275e9aeb1331efcb8d58f35c0252791427e403ad84daad51d247cc2a64c6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e8d58db82caa3cbee903594e9a8d2f68b5dc005303e2272c315b5c9cd9e979c78dc83d900692ee88dd413e1a5ca79e31fcc0fb70da773be382fce154c0859d89", + "wx" : "00e8d58db82caa3cbee903594e9a8d2f68b5dc005303e2272c315b5c9cd9e979c7", + "wy" : "008dc83d900692ee88dd413e1a5ca79e31fcc0fb70da773be382fce154c0859d89" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e8d58db82caa3cbee903594e9a8d2f68b5dc005303e2272c315b5c9cd9e979c78dc83d900692ee88dd413e1a5ca79e31fcc0fb70da773be382fce154c0859d89", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE6NWNuCyqPL7pA1lOmo0vaLXcAFMD\n4icsMVtcnNnpeceNyD2QBpLuiN1BPhpcp54x/MD7cNp3O+OC/OFUwIWdiQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 397, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022021323755b103d2f9da6ab83eccab9ad8598bcf625652f10e7a3eeee3c3945fb3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0471434412bb06b96a7acd4d89017aa877746fd38fc7aac6c65b52443b1af8a29f242e9bdf23984bf7232d6c37a47411c653c89a9093e140e321167b28fd21eb7b", + "wx" : "71434412bb06b96a7acd4d89017aa877746fd38fc7aac6c65b52443b1af8a29f", + "wy" : "242e9bdf23984bf7232d6c37a47411c653c89a9093e140e321167b28fd21eb7b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000471434412bb06b96a7acd4d89017aa877746fd38fc7aac6c65b52443b1af8a29f242e9bdf23984bf7232d6c37a47411c653c89a9093e140e321167b28fd21eb7b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcUNEErsGuWp6zU2JAXqod3Rv04/H\nqsbGW1JEOxr4op8kLpvfI5hL9yMtbDekdBHGU8iakJPhQOMhFnso/SHrew==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 398, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206c50acfe76de1289e7a5edb240f1c2a7879db6873d5d931f3c6ac467a6eac171", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ff9dd577f73a189a2505d428db8c3b298d2c0e4ad749608a5bd69d528ee9d3a1c96de2d4d55742a132b5ce72c79e43bdfd55c8054f6a095ba2c08166bd1ec583", + "wx" : "00ff9dd577f73a189a2505d428db8c3b298d2c0e4ad749608a5bd69d528ee9d3a1", + "wy" : "00c96de2d4d55742a132b5ce72c79e43bdfd55c8054f6a095ba2c08166bd1ec583" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ff9dd577f73a189a2505d428db8c3b298d2c0e4ad749608a5bd69d528ee9d3a1c96de2d4d55742a132b5ce72c79e43bdfd55c8054f6a095ba2c08166bd1ec583", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/53Vd/c6GJolBdQo24w7KY0sDkrX\nSWCKW9adUo7p06HJbeLU1VdCoTK1znLHnkO9/VXIBU9qCVuiwIFmvR7Fgw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 399, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220755b7fffb0b17ad57dca50fcefb7fe297b029df25e5ccb5069e8e70c2742c2a6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fc13b37baba182ba13dfc8ca74f5896483378aa9bd6f0aa931877ddc5e77262f1bf8b9cfdcbbe0d62eed81e5874310bd51178d1c6d01b6929a345d94190fdf3b", + "wx" : "00fc13b37baba182ba13dfc8ca74f5896483378aa9bd6f0aa931877ddc5e77262f", + "wy" : "1bf8b9cfdcbbe0d62eed81e5874310bd51178d1c6d01b6929a345d94190fdf3b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fc13b37baba182ba13dfc8ca74f5896483378aa9bd6f0aa931877ddc5e77262f1bf8b9cfdcbbe0d62eed81e5874310bd51178d1c6d01b6929a345d94190fdf3b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/BOze6uhgroT38jKdPWJZIM3iqm9\nbwqpMYd93F53Ji8b+LnP3Lvg1i7tgeWHQxC9UReNHG0BtpKaNF2UGQ/fOw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 400, + "comment" : "point at infinity during verify", + "flags" : [ + "PointDuplication", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a80220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0420adbb6cb9e09ce8ee4b6bdbc2e8047a0b9dc811eb415a2a258906efbd8a88cec16b2111b5991d98dc4c935da619b55f784c79f000830d514ffeb6ad3fcf0640", + "wx" : "20adbb6cb9e09ce8ee4b6bdbc2e8047a0b9dc811eb415a2a258906efbd8a88ce", + "wy" : "00c16b2111b5991d98dc4c935da619b55f784c79f000830d514ffeb6ad3fcf0640" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000420adbb6cb9e09ce8ee4b6bdbc2e8047a0b9dc811eb415a2a258906efbd8a88cec16b2111b5991d98dc4c935da619b55f784c79f000830d514ffeb6ad3fcf0640", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIK27bLngnOjuS2vbwugEegudyBHr\nQVoqJYkG772KiM7BayERtZkdmNxMk12mGbVfeEx58ACDDVFP/ratP88GQA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 401, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f033aa211cf11ee61c247567974fb8667c78f13a35bc2e6bead4436c261f144d99b4d07b6ce8008fecf8a4c4af561b972b00e63443a2f20038ee84ed0c238a3c", + "wx" : "00f033aa211cf11ee61c247567974fb8667c78f13a35bc2e6bead4436c261f144d", + "wy" : "0099b4d07b6ce8008fecf8a4c4af561b972b00e63443a2f20038ee84ed0c238a3c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f033aa211cf11ee61c247567974fb8667c78f13a35bc2e6bead4436c261f144d99b4d07b6ce8008fecf8a4c4af561b972b00e63443a2f20038ee84ed0c238a3c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8DOqIRzxHuYcJHVnl0+4Znx48To1\nvC5r6tRDbCYfFE2ZtNB7bOgAj+z4pMSvVhuXKwDmNEOi8gA47oTtDCOKPA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 402, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bef2538da3d07158791556b2d0297ca9c1b306459c9323ce7d07a21282de1ace4e400c8e4eb57751faa0dde6bbebf96faaac9efc80e3de768fb4f5a37f95ead7", + "wx" : "00bef2538da3d07158791556b2d0297ca9c1b306459c9323ce7d07a21282de1ace", + "wy" : "4e400c8e4eb57751faa0dde6bbebf96faaac9efc80e3de768fb4f5a37f95ead7" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bef2538da3d07158791556b2d0297ca9c1b306459c9323ce7d07a21282de1ace4e400c8e4eb57751faa0dde6bbebf96faaac9efc80e3de768fb4f5a37f95ead7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvvJTjaPQcVh5FVay0Cl8qcGzBkWc\nkyPOfQeiEoLeGs5OQAyOTrV3Ufqg3ea76/lvqqye/IDj3naPtPWjf5Xq1w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 403, + "comment" : "u1 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002205731b7c4bd04cb9efb836935ff2e547bf2909f86824af4d8df78acf76d7b3d4e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bf2570b58f38183fabca3ca72255bd4651cbb7e8292287809bd8e5c285d24a532f859b7f75c2f5e8d3791a5ccb60fa3888895c63237c9ea65e43f87523e104e5", + "wx" : "00bf2570b58f38183fabca3ca72255bd4651cbb7e8292287809bd8e5c285d24a53", + "wy" : "2f859b7f75c2f5e8d3791a5ccb60fa3888895c63237c9ea65e43f87523e104e5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bf2570b58f38183fabca3ca72255bd4651cbb7e8292287809bd8e5c285d24a532f859b7f75c2f5e8d3791a5ccb60fa3888895c63237c9ea65e43f87523e104e5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvyVwtY84GD+ryjynIlW9RlHLt+gp\nIoeAm9jlwoXSSlMvhZt/dcL16NN5GlzLYPo4iIlcYyN8nqZeQ/h1I+EE5Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 404, + "comment" : "u1 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100a8ce483a42fb3462047c96ca00d1ab83ca565b2724cca9ac14411dcb8ee7e803", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049ba8f147332270987e5baab2ab0a4ebc9968eb8682c2872266a22b43c2cf55f7728d552fc65b5a3c7cee18876f1d8b46ae60153aec3b8a2b2c2527979f4a7d29", + "wx" : "009ba8f147332270987e5baab2ab0a4ebc9968eb8682c2872266a22b43c2cf55f7", + "wy" : "728d552fc65b5a3c7cee18876f1d8b46ae60153aec3b8a2b2c2527979f4a7d29" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049ba8f147332270987e5baab2ab0a4ebc9968eb8682c2872266a22b43c2cf55f7728d552fc65b5a3c7cee18876f1d8b46ae60153aec3b8a2b2c2527979f4a7d29", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEm6jxRzMicJh+W6qyqwpOvJlo64aC\nwociZqIrQ8LPVfdyjVUvxltaPHzuGIdvHYtGrmAVOuw7iissJSeXn0p9KQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 405, + "comment" : "u2 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d9e64db2ea560162dad3ec67d6ebaab9e821a81da8d4584f00fb14813c7e96e153e9e96e17eb05228ff3c9cbc5318bbb87e88bec489dec2be7a20adce06cf8bd", + "wx" : "00d9e64db2ea560162dad3ec67d6ebaab9e821a81da8d4584f00fb14813c7e96e1", + "wy" : "53e9e96e17eb05228ff3c9cbc5318bbb87e88bec489dec2be7a20adce06cf8bd" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d9e64db2ea560162dad3ec67d6ebaab9e821a81da8d4584f00fb14813c7e96e153e9e96e17eb05228ff3c9cbc5318bbb87e88bec489dec2be7a20adce06cf8bd", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2eZNsupWAWLa0+xn1uuqueghqB2o\n1FhPAPsUgTx+luFT6eluF+sFIo/zycvFMYu7h+iL7Eid7Cvnogrc4Gz4vQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 406, + "comment" : "u2 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04857c58d9010d1f8386e279cdcc369b32a8960259a3a646f6d89ad5273252f3fc65d2384cabf6a2158b1cd1b2e2477d10b1b719125e9226e99ae90a7afaab499e", + "wx" : "00857c58d9010d1f8386e279cdcc369b32a8960259a3a646f6d89ad5273252f3fc", + "wy" : "65d2384cabf6a2158b1cd1b2e2477d10b1b719125e9226e99ae90a7afaab499e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004857c58d9010d1f8386e279cdcc369b32a8960259a3a646f6d89ad5273252f3fc65d2384cabf6a2158b1cd1b2e2477d10b1b719125e9226e99ae90a7afaab499e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhXxY2QENH4OG4nnNzDabMqiWAlmj\npkb22JrVJzJS8/xl0jhMq/aiFYsc0bLiR30QsbcZEl6SJuma6Qp6+qtJng==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 407, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02201d109296e9ac43dfa92bcdbcaa64c6d3fb858a822b6e519d9fd2e45279d3bf1a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0489d887b0645d2f96b407b080cf6db3685cc9d4454d35a5ac7983bb5ebbfd2e20de4fcd410c3b6e11f5e4cccb19327c181c43c2d216869309f22495d34ee2796f", + "wx" : "0089d887b0645d2f96b407b080cf6db3685cc9d4454d35a5ac7983bb5ebbfd2e20", + "wy" : "00de4fcd410c3b6e11f5e4cccb19327c181c43c2d216869309f22495d34ee2796f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000489d887b0645d2f96b407b080cf6db3685cc9d4454d35a5ac7983bb5ebbfd2e20de4fcd410c3b6e11f5e4cccb19327c181c43c2d216869309f22495d34ee2796f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEidiHsGRdL5a0B7CAz22zaFzJ1EVN\nNaWseYO7Xrv9LiDeT81BDDtuEfXkzMsZMnwYHEPC0haGkwnyJJXTTuJ5bw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 408, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220027d377d04715e43754629961c6233961b921b3283c33fcb541cc27285092e8d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04040924291aa7975fd04f8b2e923a1f9121836fdfbf2fea123cc1870f4f6cc0f2c510ee34a325e772d232b576052f96d3ec4a33b086508682fc53099c0cd48e45", + "wx" : "040924291aa7975fd04f8b2e923a1f9121836fdfbf2fea123cc1870f4f6cc0f2", + "wy" : "00c510ee34a325e772d232b576052f96d3ec4a33b086508682fc53099c0cd48e45" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004040924291aa7975fd04f8b2e923a1f9121836fdfbf2fea123cc1870f4f6cc0f2c510ee34a325e772d232b576052f96d3ec4a33b086508682fc53099c0cd48e45", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBAkkKRqnl1/QT4sukjofkSGDb9+/\nL+oSPMGHD09swPLFEO40oyXnctIytXYFL5bT7EozsIZQhoL8UwmcDNSORQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 409, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ce1602ee5a6d686c5b8d8a3f44f419aa6064f0d35323341d77a65a4bc9e1989b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043e7ed2fbb89f7b643d4ab44895ff9fb16e8be7a8649e4ac4ee2f59ec8f68fc634ca91cc26043a8242e2969c871d3ca9833148135b27d377198182ceaa7e70fd4", + "wx" : "3e7ed2fbb89f7b643d4ab44895ff9fb16e8be7a8649e4ac4ee2f59ec8f68fc63", + "wy" : "4ca91cc26043a8242e2969c871d3ca9833148135b27d377198182ceaa7e70fd4" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043e7ed2fbb89f7b643d4ab44895ff9fb16e8be7a8649e4ac4ee2f59ec8f68fc634ca91cc26043a8242e2969c871d3ca9833148135b27d377198182ceaa7e70fd4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPn7S+7ife2Q9SrRIlf+fsW6L56hk\nnkrE7i9Z7I9o/GNMqRzCYEOoJC4pachx08qYMxSBNbJ9N3GYGCzqp+cP1A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 410, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220328ab273ff681a79a9662dc174ee014ef73d597d32ef42b17f443a33f5e430fe", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e67f559f552772b174d377b239e60750299d379b6bec6fc93adf040269d58c426c397f7984a149f07bf79fbba3b18c925a797cc6678e2eeabec47fb4ac461041", + "wx" : "00e67f559f552772b174d377b239e60750299d379b6bec6fc93adf040269d58c42", + "wy" : "6c397f7984a149f07bf79fbba3b18c925a797cc6678e2eeabec47fb4ac461041" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e67f559f552772b174d377b239e60750299d379b6bec6fc93adf040269d58c426c397f7984a149f07bf79fbba3b18c925a797cc6678e2eeabec47fb4ac461041", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5n9Vn1UncrF003eyOeYHUCmdN5tr\n7G/JOt8EAmnVjEJsOX95hKFJ8Hv3n7ujsYySWnl8xmeOLuq+xH+0rEYQQQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 411, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ab27431e81a7976e62dc174ee014f0479c909f17919ec453013b47f1aa221858", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0488b1d30e29fe0edeb93ab469d2698d0fbc2977f77f48293d0e87acc0856a51fc3d1b4f23fa3f6ef26f0e94cb7a63907b1923e30d08197115050b9da98a2b5f56", + "wx" : "0088b1d30e29fe0edeb93ab469d2698d0fbc2977f77f48293d0e87acc0856a51fc", + "wy" : "3d1b4f23fa3f6ef26f0e94cb7a63907b1923e30d08197115050b9da98a2b5f56" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000488b1d30e29fe0edeb93ab469d2698d0fbc2977f77f48293d0e87acc0856a51fc3d1b4f23fa3f6ef26f0e94cb7a63907b1923e30d08197115050b9da98a2b5f56", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiLHTDin+Dt65OrRp0mmND7wpd/d/\nSCk9DoeswIVqUfw9G08j+j9u8m8OlMt6Y5B7GSPjDQgZcRUFC52piitfVg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 412, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220564e863e034f2edbc5b82e9dc029e08f7c3a43817c25ea210ebcc52057e10b5f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0423a6ed2b1064923104d08ee4392b44bb51555a395477dc52546af6c787cc65aa81105b8c72c357d75215b210286df781d6731c4f0b87e9fe7066489653dc35d3", + "wx" : "23a6ed2b1064923104d08ee4392b44bb51555a395477dc52546af6c787cc65aa", + "wy" : "0081105b8c72c357d75215b210286df781d6731c4f0b87e9fe7066489653dc35d3" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000423a6ed2b1064923104d08ee4392b44bb51555a395477dc52546af6c787cc65aa81105b8c72c357d75215b210286df781d6731c4f0b87e9fe7066489653dc35d3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEI6btKxBkkjEE0I7kOStEu1FVWjlU\nd9xSVGr2x4fMZaqBEFuMcsNX11IVshAobfeB1nMcTwuH6f5wZkiWU9w10w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 413, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022031f2cced76db7b4d74ee014f047c96c9f3ba3e21f11248bcf451526ac376c54c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04592d27cd81fbb61ebbdd782eaa1d86d53b59eaef43496677c345adc9896c562e355b8ffda4f8683da98653f0d6067bd8134c5c3e22e3dcdee6a5cdbd826f4915", + "wx" : "592d27cd81fbb61ebbdd782eaa1d86d53b59eaef43496677c345adc9896c562e", + "wy" : "355b8ffda4f8683da98653f0d6067bd8134c5c3e22e3dcdee6a5cdbd826f4915" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004592d27cd81fbb61ebbdd782eaa1d86d53b59eaef43496677c345adc9896c562e355b8ffda4f8683da98653f0d6067bd8134c5c3e22e3dcdee6a5cdbd826f4915", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWS0nzYH7th673Xguqh2G1TtZ6u9D\nSWZ3w0WtyYlsVi41W4/9pPhoPamGU/DWBnvYE0xcPiLj3N7mpc29gm9JFQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 414, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220668fcfbedd4eed7eb6840c7f6cf1e3dde504afe5732ee0e1bcbeee15b94a2c64", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048c4aa42ef47c4e2d7b60ca2b5a0b3038a9f8e7ee1de77d299286db3cd635b754f65438558a2271c9444b77405a1f97e84036c3146c425006e65be83f97e41191", + "wx" : "008c4aa42ef47c4e2d7b60ca2b5a0b3038a9f8e7ee1de77d299286db3cd635b754", + "wy" : "00f65438558a2271c9444b77405a1f97e84036c3146c425006e65be83f97e41191" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048c4aa42ef47c4e2d7b60ca2b5a0b3038a9f8e7ee1de77d299286db3cd635b754f65438558a2271c9444b77405a1f97e84036c3146c425006e65be83f97e41191", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjEqkLvR8Ti17YMorWgswOKn45+4d\n530pkobbPNY1t1T2VDhViiJxyURLd0BaH5foQDbDFGxCUAbmW+g/l+QRkQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 415, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220637e57bd4f085f9d3be20506bbc2b8eab268a33871b19da56b1ba0ac25927bd1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f5618fb978b70f15b8e07a74edfbcea775dcb92055f9431b816cd4cb5d4fd63cbd1759fd35bae79bf5bb0394646b14fbcb1ed2614fdcc9a9f53663e09f8c6a09", + "wx" : "00f5618fb978b70f15b8e07a74edfbcea775dcb92055f9431b816cd4cb5d4fd63c", + "wy" : "00bd1759fd35bae79bf5bb0394646b14fbcb1ed2614fdcc9a9f53663e09f8c6a09" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f5618fb978b70f15b8e07a74edfbcea775dcb92055f9431b816cd4cb5d4fd63cbd1759fd35bae79bf5bb0394646b14fbcb1ed2614fdcc9a9f53663e09f8c6a09", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9WGPuXi3DxW44Hp07fvOp3XcuSBV\n+UMbgWzUy11P1jy9F1n9Nbrnm/W7A5RkaxT7yx7SYU/cyan1NmPgn4xqCQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 416, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100b0a105281711f1755bbfc1a0b6ea67add1085e84b73016989e20a90be3504d22", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0453c143435247e1e2144c4c32cb1c900b8e9cb160976bdcda1b24877ce7266a7441a21780d91554d349a4c7c61f799bda9ddc81a66323078245dcb3960417a660", + "wx" : "53c143435247e1e2144c4c32cb1c900b8e9cb160976bdcda1b24877ce7266a74", + "wy" : "41a21780d91554d349a4c7c61f799bda9ddc81a66323078245dcb3960417a660" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000453c143435247e1e2144c4c32cb1c900b8e9cb160976bdcda1b24877ce7266a7441a21780d91554d349a4c7c61f799bda9ddc81a66323078245dcb3960417a660", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEU8FDQ1JH4eIUTEwyyxyQC46csWCX\na9zaGySHfOcmanRBoheA2RVU00mkx8YfeZvandyBpmMjB4JF3LOWBBemYA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 417, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100f177b6b38b29de112b6a1921aacd9c95bf24356c916075b623d05899bf7945c4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0493486f6653c2906152eb9d1c2b28e51c085f20ac54016a808f6e3c6b2cdcc02a35439b7b9ab9e86df0ca617737b49f28badf8f5636c9bbaa199bdd20063ec7ff", + "wx" : "0093486f6653c2906152eb9d1c2b28e51c085f20ac54016a808f6e3c6b2cdcc02a", + "wy" : "35439b7b9ab9e86df0ca617737b49f28badf8f5636c9bbaa199bdd20063ec7ff" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000493486f6653c2906152eb9d1c2b28e51c085f20ac54016a808f6e3c6b2cdcc02a35439b7b9ab9e86df0ca617737b49f28badf8f5636c9bbaa199bdd20063ec7ff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEk0hvZlPCkGFS650cKyjlHAhfIKxU\nAWqAj248ayzcwCo1Q5t7mrnobfDKYXc3tJ8out+PVjbJu6oZm90gBj7H/w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 418, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100e2ef6d681653bc2156d43243559b392bc161702b7ba94ce753e6e670828f6637", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045f2e06f0ec92b6499eb7d249ff0147639253e7abe0e4497226336a5c94caa7774eb3c28acf5012ba023971416c600a10fb6d28a23f3a2c1f77fb0686d06cdf80", + "wx" : "5f2e06f0ec92b6499eb7d249ff0147639253e7abe0e4497226336a5c94caa777", + "wy" : "4eb3c28acf5012ba023971416c600a10fb6d28a23f3a2c1f77fb0686d06cdf80" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045f2e06f0ec92b6499eb7d249ff0147639253e7abe0e4497226336a5c94caa7774eb3c28acf5012ba023971416c600a10fb6d28a23f3a2c1f77fb0686d06cdf80", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXy4G8OyStkmet9JJ/wFHY5JT56vg\n5ElyJjNqXJTKp3dOs8KKz1ASugI5cUFsYAoQ+20ooj86LB93+waG0GzfgA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 419, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100d467241ca17d9a31823e4b650068d5c1c39eaaea65f2241883fd744745a586aa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c2af0b9da06d54b1a5ff93800b579cbce295d0b2719da307b028bee3c657424b28c4928f185f68312b47de31ad87fac134de90cf114cc85d45a8fefd9a3a2350", + "wx" : "00c2af0b9da06d54b1a5ff93800b579cbce295d0b2719da307b028bee3c657424b", + "wy" : "28c4928f185f68312b47de31ad87fac134de90cf114cc85d45a8fefd9a3a2350" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c2af0b9da06d54b1a5ff93800b579cbce295d0b2719da307b028bee3c657424b28c4928f185f68312b47de31ad87fac134de90cf114cc85d45a8fefd9a3a2350", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwq8LnaBtVLGl/5OAC1ecvOKV0LJx\nnaMHsCi+48ZXQksoxJKPGF9oMStH3jGth/rBNN6QzxFMyF1FqP79mjojUA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 420, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100e70b0176ad36b436adc6c51fa27a0cd50ea5f5c07d1d695135b0128763225ef6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042a3c0253d54dc8a2a72a31f815b0bb6c36d852f8db14edf1e1b71cd3a7389a494891bafa1767b85e36f7507fa5eebd3da0024208fcfef28d56cd49a980ba1465", + "wx" : "2a3c0253d54dc8a2a72a31f815b0bb6c36d852f8db14edf1e1b71cd3a7389a49", + "wy" : "4891bafa1767b85e36f7507fa5eebd3da0024208fcfef28d56cd49a980ba1465" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042a3c0253d54dc8a2a72a31f815b0bb6c36d852f8db14edf1e1b71cd3a7389a494891bafa1767b85e36f7507fa5eebd3da0024208fcfef28d56cd49a980ba1465", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKjwCU9VNyKKnKjH4FbC7bDbYUvjb\nFO3x4bcc06c4mklIkbr6F2e4Xjb3UH+l7r09oAJCCPz+8o1WzUmpgLoUZQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 421, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043dd345114090328ccc0bdeaf8269396593645720b0b326849d1fe81ec956f996ceee0a81d7f65e1205bb1b6963a8e0facfd2a6124701b1a152094d037a216f4e", + "wx" : "3dd345114090328ccc0bdeaf8269396593645720b0b326849d1fe81ec956f996", + "wy" : "00ceee0a81d7f65e1205bb1b6963a8e0facfd2a6124701b1a152094d037a216f4e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043dd345114090328ccc0bdeaf8269396593645720b0b326849d1fe81ec956f996ceee0a81d7f65e1205bb1b6963a8e0facfd2a6124701b1a152094d037a216f4e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPdNFEUCQMozMC96vgmk5ZZNkVyCw\nsyaEnR/oHslW+ZbO7gqB1/ZeEgW7G2ljqOD6z9KmEkcBsaFSCU0DeiFvTg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 422, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fc8207ca84c4af4229139de953da3bdebf694537c15406e172d631e98591f40c34a0d957e39e9686914e98ea467972cedec5a5c6bb55bec7916dc71f7a4c6f77", + "wx" : "00fc8207ca84c4af4229139de953da3bdebf694537c15406e172d631e98591f40c", + "wy" : "34a0d957e39e9686914e98ea467972cedec5a5c6bb55bec7916dc71f7a4c6f77" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fc8207ca84c4af4229139de953da3bdebf694537c15406e172d631e98591f40c34a0d957e39e9686914e98ea467972cedec5a5c6bb55bec7916dc71f7a4c6f77", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/IIHyoTEr0IpE53pU9o73r9pRTfB\nVAbhctYx6YWR9Aw0oNlX456WhpFOmOpGeXLO3sWlxrtVvseRbccfekxvdw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 423, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0460bf7beb808286d8abff60c20faed73997395124542e6b7672089d88c14bbed57f4af9606f9be0199e4145698a62ad2545123a49eb14e0c33317f6909e3915b5", + "wx" : "60bf7beb808286d8abff60c20faed73997395124542e6b7672089d88c14bbed5", + "wy" : "7f4af9606f9be0199e4145698a62ad2545123a49eb14e0c33317f6909e3915b5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000460bf7beb808286d8abff60c20faed73997395124542e6b7672089d88c14bbed57f4af9606f9be0199e4145698a62ad2545123a49eb14e0c33317f6909e3915b5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYL9764CChtir/2DCD67XOZc5USRU\nLmt2cgidiMFLvtV/Svlgb5vgGZ5BRWmKYq0lRRI6SesU4MMzF/aQnjkVtQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 424, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022066755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042dcd699362d3665b6c9260608b3faf989d45ac15b9da41fb348d5520ecdf4e0403e483670aadef4615c7a13fe1bf3bf927b4e47a667660b505ba47affee92ab6", + "wx" : "2dcd699362d3665b6c9260608b3faf989d45ac15b9da41fb348d5520ecdf4e04", + "wy" : "03e483670aadef4615c7a13fe1bf3bf927b4e47a667660b505ba47affee92ab6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042dcd699362d3665b6c9260608b3faf989d45ac15b9da41fb348d5520ecdf4e0403e483670aadef4615c7a13fe1bf3bf927b4e47a667660b505ba47affee92ab6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELc1pk2LTZltskmBgiz+vmJ1FrBW5\n2kH7NI1VIOzfTgQD5INnCq3vRhXHoT/hvzv5J7TkemZ2YLUFukev/ukqtg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 425, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022055a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e6205f87fa837c474a2badac671578de77d6a077cd286aed45403508767114ffc18daaf2463dea80300c1f4d7e25b9f603eefb2e2cbf012f31a819c91cad7cf2", + "wx" : "00e6205f87fa837c474a2badac671578de77d6a077cd286aed45403508767114ff", + "wy" : "00c18daaf2463dea80300c1f4d7e25b9f603eefb2e2cbf012f31a819c91cad7cf2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e6205f87fa837c474a2badac671578de77d6a077cd286aed45403508767114ffc18daaf2463dea80300c1f4d7e25b9f603eefb2e2cbf012f31a819c91cad7cf2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5iBfh/qDfEdKK62sZxV43nfWoHfN\nKGrtRUA1CHZxFP/BjaryRj3qgDAMH01+Jbn2A+77Liy/AS8xqBnJHK188g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 426, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04357e7687a79243d5e030eb120a3652c2fb95fcb148813f3da95d044bdc31c8d5e3ed90ea73567cb36c0fccd021da4ccccffe40dfe1b603428969788bed4416db", + "wx" : "357e7687a79243d5e030eb120a3652c2fb95fcb148813f3da95d044bdc31c8d5", + "wy" : "00e3ed90ea73567cb36c0fccd021da4ccccffe40dfe1b603428969788bed4416db" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004357e7687a79243d5e030eb120a3652c2fb95fcb148813f3da95d044bdc31c8d5e3ed90ea73567cb36c0fccd021da4ccccffe40dfe1b603428969788bed4416db", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENX52h6eSQ9XgMOsSCjZSwvuV/LFI\ngT89qV0ES9wxyNXj7ZDqc1Z8s2wPzNAh2kzMz/5A3+G2A0KJaXiL7UQW2w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 427, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043d9723a8ea5ebaffacab8bf87b1d63e42da7bdf94e6c2520a0786b7b534dacf33725db2fb27248274ac2e6212f9071495c90ae684d056b57ad18e72bce8f36b0", + "wx" : "3d9723a8ea5ebaffacab8bf87b1d63e42da7bdf94e6c2520a0786b7b534dacf3", + "wy" : "3725db2fb27248274ac2e6212f9071495c90ae684d056b57ad18e72bce8f36b0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043d9723a8ea5ebaffacab8bf87b1d63e42da7bdf94e6c2520a0786b7b534dacf33725db2fb27248274ac2e6212f9071495c90ae684d056b57ad18e72bce8f36b0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPZcjqOpeuv+sq4v4ex1j5C2nvflO\nbCUgoHhre1NNrPM3JdsvsnJIJ0rC5iEvkHFJXJCuaE0Fa1etGOcrzo82sA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 428, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044bab5b68667090ed13e5658cfe68f1247031aee80a8ccb52ba0505752f7cd3f085c70129c1715d9610a41bf7a063b81c1bc7ec34bb6a1c95ccd08e09f1476343", + "wx" : "4bab5b68667090ed13e5658cfe68f1247031aee80a8ccb52ba0505752f7cd3f0", + "wy" : "0085c70129c1715d9610a41bf7a063b81c1bc7ec34bb6a1c95ccd08e09f1476343" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044bab5b68667090ed13e5658cfe68f1247031aee80a8ccb52ba0505752f7cd3f085c70129c1715d9610a41bf7a063b81c1bc7ec34bb6a1c95ccd08e09f1476343", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAES6tbaGZwkO0T5WWM/mjxJHAxrugK\njMtSugUFdS980/CFxwEpwXFdlhCkG/egY7gcG8fsNLtqHJXM0I4J8UdjQw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 429, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "047801780aaab4aaf31b7c94069609a5ecf623a6dd7e97964061c6b3e4103bb84a59c111796624cccbba09394bca04af79a31cbd36176d2ec4ceaa700730d57300", + "wx" : "7801780aaab4aaf31b7c94069609a5ecf623a6dd7e97964061c6b3e4103bb84a", + "wy" : "59c111796624cccbba09394bca04af79a31cbd36176d2ec4ceaa700730d57300" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200047801780aaab4aaf31b7c94069609a5ecf623a6dd7e97964061c6b3e4103bb84a59c111796624cccbba09394bca04af79a31cbd36176d2ec4ceaa700730d57300", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeAF4Cqq0qvMbfJQGlgml7PYjpt1+\nl5ZAYcaz5BA7uEpZwRF5ZiTMy7oJOUvKBK95oxy9NhdtLsTOqnAHMNVzAA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 430, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0455b0451d911e9c64516ac9e9da3da1703eaaa46a8b0a7025c8c5ed38b5474713f1fde0cdee830bf169da9ca3d70d56f4607989873fbdcfcbb740e9a42faf860a", + "wx" : "55b0451d911e9c64516ac9e9da3da1703eaaa46a8b0a7025c8c5ed38b5474713", + "wy" : "00f1fde0cdee830bf169da9ca3d70d56f4607989873fbdcfcbb740e9a42faf860a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000455b0451d911e9c64516ac9e9da3da1703eaaa46a8b0a7025c8c5ed38b5474713f1fde0cdee830bf169da9ca3d70d56f4607989873fbdcfcbb740e9a42faf860a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEVbBFHZEenGRRasnp2j2hcD6qpGqL\nCnAlyMXtOLVHRxPx/eDN7oML8WnanKPXDVb0YHmJhz+9z8u3QOmkL6+GCg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 431, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042e19ea3a973a4c155814f8a7b641e12477d288f958b74f6031326356f5061fa41acdd1be10c052eaeb9c22d3f04cfec6e91bd23d6d3996eca9cd485e50e85909", + "wx" : "2e19ea3a973a4c155814f8a7b641e12477d288f958b74f6031326356f5061fa4", + "wy" : "1acdd1be10c052eaeb9c22d3f04cfec6e91bd23d6d3996eca9cd485e50e85909" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042e19ea3a973a4c155814f8a7b641e12477d288f958b74f6031326356f5061fa41acdd1be10c052eaeb9c22d3f04cfec6e91bd23d6d3996eca9cd485e50e85909", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELhnqOpc6TBVYFPintkHhJHfSiPlY\nt09gMTJjVvUGH6QazdG+EMBS6uucItPwTP7G6RvSPW05luypzUheUOhZCQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 432, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046eafbcb683e05e0bdb2aa0ac0686f60b34ce66761b7ecffccd3da8fe8799d6244547b4aeca8a8e56dba45750cd9fc4f0e3f1333dcb855566c29bd14457cf489b", + "wx" : "6eafbcb683e05e0bdb2aa0ac0686f60b34ce66761b7ecffccd3da8fe8799d624", + "wy" : "4547b4aeca8a8e56dba45750cd9fc4f0e3f1333dcb855566c29bd14457cf489b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046eafbcb683e05e0bdb2aa0ac0686f60b34ce66761b7ecffccd3da8fe8799d6244547b4aeca8a8e56dba45750cd9fc4f0e3f1333dcb855566c29bd14457cf489b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbq+8toPgXgvbKqCsBob2CzTOZnYb\nfs/8zT2o/oeZ1iRFR7SuyoqOVtukV1DNn8Tw4/EzPcuFVWbCm9FEV89Imw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 433, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02203fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0450f51ce959e24ac86b1054ea016c57d1da5f4cee008dd800757a817606234f78aa17f3ef6f7a6c51381c63d66697b1b5c196eb1da73d7b73c33f9115d7432d23", + "wx" : "50f51ce959e24ac86b1054ea016c57d1da5f4cee008dd800757a817606234f78", + "wy" : "00aa17f3ef6f7a6c51381c63d66697b1b5c196eb1da73d7b73c33f9115d7432d23" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000450f51ce959e24ac86b1054ea016c57d1da5f4cee008dd800757a817606234f78aa17f3ef6f7a6c51381c63d66697b1b5c196eb1da73d7b73c33f9115d7432d23", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUPUc6VniSshrEFTqAWxX0dpfTO4A\njdgAdXqBdgYjT3iqF/Pvb3psUTgcY9Zml7G1wZbrHac9e3PDP5EV10MtIw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 434, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02205d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049c8ef36f19815572db154e8f47a8dc5cc807d551a7141fed8a2c15460fe7ee10660b936644e1ccad24578811dd45a325214e28a78e99a0ed2df7354fe9bca0ad", + "wx" : "009c8ef36f19815572db154e8f47a8dc5cc807d551a7141fed8a2c15460fe7ee10", + "wy" : "660b936644e1ccad24578811dd45a325214e28a78e99a0ed2df7354fe9bca0ad" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049c8ef36f19815572db154e8f47a8dc5cc807d551a7141fed8a2c15460fe7ee10660b936644e1ccad24578811dd45a325214e28a78e99a0ed2df7354fe9bca0ad", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnI7zbxmBVXLbFU6PR6jcXMgH1VGn\nFB/tiiwVRg/n7hBmC5NmROHMrSRXiBHdRaMlIU4op46ZoO0t9zVP6bygrQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 435, + "comment" : "point duplication during verification", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304402206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022056be8aaebb8627ef5e37057feb3448f726fb605312992466ee8d9ed7cd43c1b1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049c8ef36f19815572db154e8f47a8dc5cc807d551a7141fed8a2c15460fe7ee1099f46c98bb1e3353dba877ee22ba5cdadeb1d75971665f12d208cab016435f52", + "wx" : "009c8ef36f19815572db154e8f47a8dc5cc807d551a7141fed8a2c15460fe7ee10", + "wy" : "0099f46c98bb1e3353dba877ee22ba5cdadeb1d75971665f12d208cab016435f52" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049c8ef36f19815572db154e8f47a8dc5cc807d551a7141fed8a2c15460fe7ee1099f46c98bb1e3353dba877ee22ba5cdadeb1d75971665f12d208cab016435f52", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnI7zbxmBVXLbFU6PR6jcXMgH1VGn\nFB/tiiwVRg/n7hCZ9GyYux4zU9uod+4iulza3rHXWXFmXxLSCMqwFkNfUg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 436, + "comment" : "duplication bug", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304402206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022056be8aaebb8627ef5e37057feb3448f726fb605312992466ee8d9ed7cd43c1b1", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f2a3ebc44fe94406cd6dc9bfc79a84600ae568cf533131e01505012649e39b8f0f886d549f83aa61ecd1eeb77ba7256e984f088c3b9183e84a16e96f93860e4f", + "wx" : "00f2a3ebc44fe94406cd6dc9bfc79a84600ae568cf533131e01505012649e39b8f", + "wy" : "0f886d549f83aa61ecd1eeb77ba7256e984f088c3b9183e84a16e96f93860e4f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f2a3ebc44fe94406cd6dc9bfc79a84600ae568cf533131e01505012649e39b8f0f886d549f83aa61ecd1eeb77ba7256e984f088c3b9183e84a16e96f93860e4f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8qPrxE/pRAbNbcm/x5qEYArlaM9T\nMTHgFQUBJknjm48PiG1Un4OqYezR7rd7pyVumE8IjDuRg+hKFulvk4YOTw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 437, + "comment" : "point with x-coordinate 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250201010220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e30751018c302c6916c21e2239baa41f0e69c5acfc371bb3e376ad364ea63802659cceeae0cabfee3ed33abacbc490e8716b5fbf11137647b524e4b855d7d659", + "wx" : "00e30751018c302c6916c21e2239baa41f0e69c5acfc371bb3e376ad364ea63802", + "wy" : "659cceeae0cabfee3ed33abacbc490e8716b5fbf11137647b524e4b855d7d659" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e30751018c302c6916c21e2239baa41f0e69c5acfc371bb3e376ad364ea63802659cceeae0cabfee3ed33abacbc490e8716b5fbf11137647b524e4b855d7d659", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4wdRAYwwLGkWwh4iObqkHw5pxaz8\nNxuz43atNk6mOAJlnM7q4Mq/7j7TOrrLxJDocWtfvxETdke1JOS4VdfWWQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 438, + "comment" : "point with x-coordinate 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022101000000000000000000000000000000000000000000000000000000000000000002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ef28340fb027dabc05a2bd3be99c6cc2730ab0c3d8289e6a242f2b76cfccf9a2405cd0530183db6640119a20ad9c1c24ec87d4d9d5de42bffab54fd6cb6f9ed6", + "wx" : "00ef28340fb027dabc05a2bd3be99c6cc2730ab0c3d8289e6a242f2b76cfccf9a2", + "wy" : "405cd0530183db6640119a20ad9c1c24ec87d4d9d5de42bffab54fd6cb6f9ed6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ef28340fb027dabc05a2bd3be99c6cc2730ab0c3d8289e6a242f2b76cfccf9a2405cd0530183db6640119a20ad9c1c24ec87d4d9d5de42bffab54fd6cb6f9ed6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7yg0D7An2rwFor076ZxswnMKsMPY\nKJ5qJC8rds/M+aJAXNBTAYPbZkARmiCtnBwk7IfU2dXeQr/6tU/Wy2+e1g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 439, + "comment" : "comparison with point at infinity ", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0401b4e8eb0cf6f321006fc107246c1996f7034f56d82706cd8f14f05da0a7c514f158ad7ff3c6a08b2f057c6c28255f9513811f20ab18f7104df554d591913f78", + "wx" : "01b4e8eb0cf6f321006fc107246c1996f7034f56d82706cd8f14f05da0a7c514", + "wy" : "00f158ad7ff3c6a08b2f057c6c28255f9513811f20ab18f7104df554d591913f78" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000401b4e8eb0cf6f321006fc107246c1996f7034f56d82706cd8f14f05da0a7c514f158ad7ff3c6a08b2f057c6c28255f9513811f20ab18f7104df554d591913f78", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAbTo6wz28yEAb8EHJGwZlvcDT1bY\nJwbNjxTwXaCnxRTxWK1/88agiy8FfGwoJV+VE4EfIKsY9xBN9VTVkZE/eA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 440, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc476699780220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040b1cc580bb6f71e4bffb731a1e74f929c04a10ff94ac2312359d3f13213c3b4c870213c2ad3665a3d243dcb55780e21c8601c5f9803f27e31ff22f8ce77e739e", + "wx" : "0b1cc580bb6f71e4bffb731a1e74f929c04a10ff94ac2312359d3f13213c3b4c", + "wy" : "00870213c2ad3665a3d243dcb55780e21c8601c5f9803f27e31ff22f8ce77e739e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040b1cc580bb6f71e4bffb731a1e74f929c04a10ff94ac2312359d3f13213c3b4c870213c2ad3665a3d243dcb55780e21c8601c5f9803f27e31ff22f8ce77e739e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECxzFgLtvceS/+3MaHnT5KcBKEP+U\nrCMSNZ0/EyE8O0yHAhPCrTZlo9JD3LVXgOIchgHF+YA/J+Mf8i+M535zng==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 441, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042699736fdb603e90b1d9a04fcd90ed39756ed567214033ddb5ad579213089d2e96acfb0baeec9cfe2df150aa06b01ba58d03162b497c57a0d305adb4c5f7f375", + "wx" : "2699736fdb603e90b1d9a04fcd90ed39756ed567214033ddb5ad579213089d2e", + "wy" : "0096acfb0baeec9cfe2df150aa06b01ba58d03162b497c57a0d305adb4c5f7f375" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042699736fdb603e90b1d9a04fcd90ed39756ed567214033ddb5ad579213089d2e96acfb0baeec9cfe2df150aa06b01ba58d03162b497c57a0d305adb4c5f7f375", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJplzb9tgPpCx2aBPzZDtOXVu1Wch\nQDPdta1XkhMInS6WrPsLruyc/i3xUKoGsBuljQMWK0l8V6DTBa20xffzdQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 442, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042a3021069e8841f9d69ad4c2992b02dc7a2f5447afa55a4683c6451cdc4e728600ca4123520611085cb10ea80bdb851a0b09dd79703c420606ff658dba94c345", + "wx" : "2a3021069e8841f9d69ad4c2992b02dc7a2f5447afa55a4683c6451cdc4e7286", + "wy" : "00ca4123520611085cb10ea80bdb851a0b09dd79703c420606ff658dba94c345" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042a3021069e8841f9d69ad4c2992b02dc7a2f5447afa55a4683c6451cdc4e728600ca4123520611085cb10ea80bdb851a0b09dd79703c420606ff658dba94c345", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKjAhBp6IQfnWmtTCmSsC3HovVEev\npVpGg8ZFHNxOcoYAykEjUgYRCFyxDqgL24UaCwndeXA8QgYG/2WNupTDRQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 443, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997802203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04535212040d83b1802cd4a9c0b6ceb0a89de68b794ddf979c2ffb9a72e59eea007650166217eb39f4e03fecd48e9e7448032da261caa68d21df639ba68ee667a6", + "wx" : "535212040d83b1802cd4a9c0b6ceb0a89de68b794ddf979c2ffb9a72e59eea00", + "wy" : "7650166217eb39f4e03fecd48e9e7448032da261caa68d21df639ba68ee667a6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004535212040d83b1802cd4a9c0b6ceb0a89de68b794ddf979c2ffb9a72e59eea007650166217eb39f4e03fecd48e9e7448032da261caa68d21df639ba68ee667a6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEU1ISBA2DsYAs1KnAts6wqJ3mi3lN\n35ecL/uacuWe6gB2UBZiF+s59OA/7NSOnnRIAy2iYcqmjSHfY5umjuZnpg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 444, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04884a86a89981e216732916569f9e3f203806359ef9b9ced61ebb82d5f8030045079ceef71b8f9e1deb29aeddaf3bcc780dff88f92b705c68f572ec481139b84a", + "wx" : "00884a86a89981e216732916569f9e3f203806359ef9b9ced61ebb82d5f8030045", + "wy" : "079ceef71b8f9e1deb29aeddaf3bcc780dff88f92b705c68f572ec481139b84a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004884a86a89981e216732916569f9e3f203806359ef9b9ced61ebb82d5f8030045079ceef71b8f9e1deb29aeddaf3bcc780dff88f92b705c68f572ec481139b84a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiEqGqJmB4hZzKRZWn54/IDgGNZ75\nuc7WHruC1fgDAEUHnO73G4+eHesprt2vO8x4Df+I+StwXGj1cuxIETm4Sg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 445, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cdb031f0e0bc432f0b959bc270456f6a500635732c76764010a5ea20f54a71d85cf6ce18411cdcb5056e4280e449c3ad6df90f9ae2dea4abc08280d99749643d", + "wx" : "00cdb031f0e0bc432f0b959bc270456f6a500635732c76764010a5ea20f54a71d8", + "wy" : "5cf6ce18411cdcb5056e4280e449c3ad6df90f9ae2dea4abc08280d99749643d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cdb031f0e0bc432f0b959bc270456f6a500635732c76764010a5ea20f54a71d85cf6ce18411cdcb5056e4280e449c3ad6df90f9ae2dea4abc08280d99749643d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzbAx8OC8Qy8LlZvCcEVvalAGNXMs\ndnZAEKXqIPVKcdhc9s4YQRzctQVuQoDkScOtbfkPmuLepKvAgoDZl0lkPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 446, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2960220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046309ffd3c559fe1b0967213461d884b58d1cd549dbc297101d9db5a7e3fcf3d388f5fa86bd31043ca6077cd1da4b283f4179a23e9d680f66a2081ac502732714", + "wx" : "6309ffd3c559fe1b0967213461d884b58d1cd549dbc297101d9db5a7e3fcf3d3", + "wy" : "0088f5fa86bd31043ca6077cd1da4b283f4179a23e9d680f66a2081ac502732714" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046309ffd3c559fe1b0967213461d884b58d1cd549dbc297101d9db5a7e3fcf3d388f5fa86bd31043ca6077cd1da4b283f4179a23e9d680f66a2081ac502732714", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYwn/08VZ/hsJZyE0YdiEtY0c1Unb\nwpcQHZ21p+P889OI9fqGvTEEPKYHfNHaSyg/QXmiPp1oD2aiCBrFAnMnFA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 447, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046e564ff8412e92f5ee23fd299c92c57eb6ef0cbd17c28721b92625938d0eab1cff8941068815c9ad2d3b7f05845c41c4acebb92b3dc155aa7a51046948a4eed0", + "wx" : "6e564ff8412e92f5ee23fd299c92c57eb6ef0cbd17c28721b92625938d0eab1c", + "wy" : "00ff8941068815c9ad2d3b7f05845c41c4acebb92b3dc155aa7a51046948a4eed0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046e564ff8412e92f5ee23fd299c92c57eb6ef0cbd17c28721b92625938d0eab1cff8941068815c9ad2d3b7f05845c41c4acebb92b3dc155aa7a51046948a4eed0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEblZP+EEukvXuI/0pnJLFfrbvDL0X\nwochuSYlk40Oqxz/iUEGiBXJrS07fwWEXEHErOu5Kz3BVap6UQRpSKTu0A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 448, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0483fe782d906023da7ba700d097f8cc9618cb23f1cd89c213b98b8f9ae8fc023db15de38b856db24d4d6cc79b6d761fbd9ac94dad5f172883ba09278ba86d9955", + "wx" : "0083fe782d906023da7ba700d097f8cc9618cb23f1cd89c213b98b8f9ae8fc023d", + "wy" : "00b15de38b856db24d4d6cc79b6d761fbd9ac94dad5f172883ba09278ba86d9955" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000483fe782d906023da7ba700d097f8cc9618cb23f1cd89c213b98b8f9ae8fc023db15de38b856db24d4d6cc79b6d761fbd9ac94dad5f172883ba09278ba86d9955", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEg/54LZBgI9p7pwDQl/jMlhjLI/HN\nicITuYuPmuj8Aj2xXeOLhW2yTU1sx5ttdh+9mslNrV8XKIO6CSeLqG2ZVQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 449, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c29602203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d1dddc947aaf9e6930cc46072f2cf2b68eb5e32dcf4ee84ea0647a201b299fbc6b382061309943abefa5938e8465e2f6afd051eab974d261797cd483934097a4", + "wx" : "00d1dddc947aaf9e6930cc46072f2cf2b68eb5e32dcf4ee84ea0647a201b299fbc", + "wy" : "6b382061309943abefa5938e8465e2f6afd051eab974d261797cd483934097a4" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d1dddc947aaf9e6930cc46072f2cf2b68eb5e32dcf4ee84ea0647a201b299fbc6b382061309943abefa5938e8465e2f6afd051eab974d261797cd483934097a4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0d3clHqvnmkwzEYHLyzyto614y3P\nTuhOoGR6IBspn7xrOCBhMJlDq++lk46EZeL2r9BR6rl00mF5fNSDk0CXpA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 450, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d17c1c5505bc710145ef74984864fe861e64302c16bb4a4bc69b47507b3f023541480e047b19bfe4bb885ec127cf254db1041ae1d5e8fd77e08294d398b62eb0", + "wx" : "00d17c1c5505bc710145ef74984864fe861e64302c16bb4a4bc69b47507b3f0235", + "wy" : "41480e047b19bfe4bb885ec127cf254db1041ae1d5e8fd77e08294d398b62eb0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d17c1c5505bc710145ef74984864fe861e64302c16bb4a4bc69b47507b3f023541480e047b19bfe4bb885ec127cf254db1041ae1d5e8fd77e08294d398b62eb0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0XwcVQW8cQFF73SYSGT+hh5kMCwW\nu0pLxptHUHs/AjVBSA4Eexm/5LuIXsEnzyVNsQQa4dXo/XfggpTTmLYusA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 451, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "wx" : "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy" : "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 452, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304402205731b7c4bd04cb9efb836935ff2e547bf2909f86824af4d8df78acf76d7b3d4e0220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + }, + { + "tcId" : 453, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100a8ce483a42fb3462047c96ca00d1ab83ca565b2724cca9ac14411dcb8ee7e8030220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "wx" : "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy" : "00b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpawHL0cAeWAZXEYFLWD8GHp1DHMqZTOoTE0Sb+XyECuCg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 454, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304402205731b7c4bd04cb9efb836935ff2e547bf2909f86824af4d8df78acf76d7b3d4e0220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + }, + { + "tcId" : 455, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100a8ce483a42fb3462047c96ca00d1ab83ca565b2724cca9ac14411dcb8ee7e8030220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "wx" : "4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000", + "wy" : "00ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETzN8z9Z3JqgF5PFgCuKEnfOAfsoR\nc4Ajn72BaQAAAADtneoSTMjDlkFkEemIww9CfrUEr0OjFGzV336mBmbWhQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 456, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220207db605e42c96035d54352c5bc55cf27d5ded42cb6b42bdaee499ea64784db602207f83c09192aa04ce038e861699a0f27ca55bf32741dbc95bbf997dee57f538fc", + "result" : "valid" + }, + { + "tcId" : 457, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022067c259a2580089ed52780755c75ea8a26b9057cc1995e4b044c8176cefe3cc7b022100d48f63d31333054bbd7fab676d207bbdc4dea1cf1b4f71aceb037b8dc7f79555", + "result" : "valid" + }, + { + "tcId" : 458, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502205dc675a2beae6deeb1ef682e922c5fe47156e069acd08073a0f8d9184d6baa6c022100e33cad4ce48f22ff6e50b47ba5dd44046a78ed7873cfd3a2c8b2d4b49aad2580", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "wx" : "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy" : "0084fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTWE+hdNeRxyvyzjiAqJYN0qfHoTOKgvhanlnNvegAAAAA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 459, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502201a3b5c4b4a2fb0c2f9efb028a9efc78993f3151683cedf76214009ea418d3e5d022100e82e87332e7bd004cad9b13857939c01467fc1c3e4207efa45ef827985a82435", + "result" : "valid" + }, + { + "tcId" : 460, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30460221008c44ef660ab8936fe01571168435c1918d005bd24ec76f72cea8f0faeb9f777a022100d793dcb3a6d47e2451e7d62e1c284ae25bbfaa0820f58adab79c201ba8d34a3e", + "result" : "valid" + }, + { + "tcId" : 461, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402204227a3dbff7ac5353cd32c8b3456397a7ee7c0e6809615fcee466b1dcde3eb49022022ea6ad811b27f944abe70b47f490d255760f8c3562e6f7e2c1da3dbe45eb540", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "wx" : "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy" : "7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTV7BeixhuONQdMcd/V2nyLVg4XsyFfQelYaYyQhf////w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 462, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022036636162db85e8d300ee45c51b9da00a7c2cffd9a6fb200761a647ccbf5d7e8e0221009d18374cf1f87a9051e563838e75728d3f2ff7a86c10292851b6ce885c5b0c76", + "result" : "valid" + }, + { + "tcId" : 463, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100a637fc972f3800705b8d5293096382d1c1ae7f670be45011b8bd29059f3049bd0221009c4abb6bbe06552d5d598b07728ccaed1738eac9fc985fd786fbc0a7347da828", + "result" : "valid" + }, + { + "tcId" : 464, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022076bfc74f3b488b34835aee96ee96067f53da021cff4020a10996d6933a27c03202202fd1658fe4e09b2e711b10117f5c37d9c3ea8b6f55cdf1e5a5ddae2c966d7e4e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "wx" : "2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff", + "wy" : "00a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKCnDH6ouQA40TtlLyj/NBUWVbrz+\nitD236X/jv////+gGq+vAA5SWFhVr6dnat4oQRMJkFLfV+frO9N+vrkiLg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 465, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450221008e0c35240e9e5b7bf2ab351afb13ac2655653baeabc247cab2c71cc40da44c000220079cbf8c9ba9b53608b219d6989875d960bdefcde224cf7ac6f8e791adaa4364", + "result" : "valid" + }, + { + "tcId" : 466, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100f6ceb6c8f76c337f51f4ec3859eb16caec969fc02a61dec1a70fa4223bdfb254022010c0334298a98a6e5c12e9c0cad587dcab43199b43cdf3785bd9c36b30925ccf", + "result" : "valid" + }, + { + "tcId" : 467, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450220083000a8e6121939f4b83612727b2091d8abbbdf9c92bf9bdcace8366150ce6f022100ba693f4e0b96dcbeeaa78c0d744365761151740323c346a54d74b332568d939f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "wx" : "00fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5", + "wy" : "5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE////+UgIHmoEWN2PnnOPJmX/kFmt\naqwHCDGMTKmnpPVairy6LdqEdDEe5UFJuXPK4MD7iVV60L945lKaFmO9cw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 468, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30460221008a1bd6ef283948184b5a32d31860e97cc0c450931f024c30bb3b261f2552cdc7022100b7e50c0513a8ec730d112109e92761a21151e4bec68268e5c79ef804b757deaa", + "result" : "valid" + }, + { + "tcId" : 469, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502200c18337b701b6000d3ce3574664c5dc44ead6a1f2ee0c27a728ea0b0f37990b9022100c31db9b199b3e1709c44a44118d1d7cb75324ee82ada2318744eb89651e6f6c0", + "result" : "valid" + }, + { + "tcId" : 470, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502202133d6fc78b394d4c34e173120b1e48c7fed7b89a03e55cab90b1367155b438a0221009293e67ff4b981e50c48b0304f7b1e6b530416ee35188302b1dd2f21e5cb479a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "wx" : "03fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e", + "wy" : "1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAAAAA/oV+WOUnV8DpvXH+G+eABXu\nsjrrv/EXOTe6dI4QmYcgcOjofFVfoTZZzKXX+tz8sAI+qIlUjKSK8rp+cQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 471, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502203604a98e926b2f9d7585e341a5ecc73a4e811c5c8da82b65790ff8a117a75bda022100a0ff07774c9a0d4bf83db294b970f2696cc29a73637aa454d4d3b45eb964bb88", + "result" : "valid" + }, + { + "tcId" : 472, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502206bf7e8f8bc3a5a2e2249c92725cf0dffa9b72ead3cc56d05107a4d587563beb4022100a05332b5b424d97bfc080fe0353470610931cd538d2e4bcf78c6fc59b481d271", + "result" : "valid" + }, + { + "tcId" : 473, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502210097e099c73088fc37052180d0483987e50c155c993cba2e6c93dd9bea5798e2c302204a9ec5f05739efb4ea93790ea22c3fc423d0aeb109cd13fb1b44d87ea52ca71f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "wx" : "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy" : "1352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BUAAAAAE1K7Sg+i6kzOuatj3WhK3loRJ7zzAKaYpxk7wg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 474, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502203988bce3195aaf7c9b008a9f1663a5e13a8bee7ddba33a1bc5d55aa49fd3903d022100c39f614828e2f71a4c66d86d1c3ec7e283f768033cff5ed09e93e3218d9df1c9", + "result" : "valid" + }, + { + "tcId" : 475, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100c3eb2e8f78a31f221d6003b949f8df6c7ec1e0c53803231e12438cb2b1b1d9ba022100b97cc1fcce1d8ddbb5e1bfa6d5300d7cac155494603c66f7eee8b8e9c9643431", + "result" : "valid" + }, + { + "tcId" : 476, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304602210089e0c23ccf61e68dc0cb9777f18b18c84b2b02b4360c79eaa40d46ebe7f3d9b1022100a5d0164e398764e7d12d696750fcb092211c22dfdd3941e59cd73bc48eb91496", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "wx" : "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy" : "00fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BX////+7K1EtvBdFbMxRlScIpe1IqXu2EMM/1lnWObEPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-256", + "tests" : [ + { + "tcId" : 477, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100bbc1bb4ffceb61a0dbe5a12d9638dc9f004e797cf72cdba8d879fdbcd84dec14022065a7c17d9a6892cf5455a1904fdd9b57ce2b41549b9b2ca5d7d182c305e9a202", + "result" : "valid" + }, + { + "tcId" : 478, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502202f093a33c69eeaf847e332b12bd0758be41dcf75d8131878f16e6f121cb3f4f102210093c304df074aef8cc2c8cddeaffda67eb2428ea7d3a113d51363e178d8068f71", + "result" : "valid" + }, + { + "tcId" : 479, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100b686774db39201a9462b96842adbeea16ae6003789bb18214dab9e5a758bf6ef022100ffc6b396293b94c96fcb325fae127608ebfd118a46f715b49b918caafb602a34", + "result" : "valid" + } + ] + } + ] +} diff --git a/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha3_512_test.json b/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha3_512_test.json new file mode 100644 index 0000000000..c03ffdce0a --- /dev/null +++ b/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha3_512_test.json @@ -0,0 +1,7246 @@ +{ + "algorithm" : "ECDSA", + "schema" : "ecdsa_verify_schema.json", + "generatorVersion" : "0.9rc5", + "numberOfTests" : 545, + "header" : [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes" : { + "ArithmeticError" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.", + "cves" : [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature" : { + "bugType" : "BER_ENCODING", + "description" : "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect" : "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves" : [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication" : { + "bugType" : "EDGE_CASE", + "description" : "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding" : { + "bugType" : "CAN_OF_WORMS", + "description" : "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449" + ] + }, + "MissingZero" : { + "bugType" : "LEGACY", + "description" : "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect" : "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "CVE-2019-0865" + ] + }, + "PointDuplication" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves" : [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "2020-13895" + ] + }, + "SpecialCaseHash" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "Untruncatedhash" : { + "bugType" : "MISSING_STEP", + "description" : "If the size of the digest is longer than the size of the underlying order of the multiplicative subgroup then the hash digest must be truncated during signature generation and verification. This test vector contains a signature where this step has been omitted." + }, + "ValidSignature" : { + "bugType" : "BASIC", + "description" : "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups" : [ + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "wx" : "04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5", + "wy" : "0087d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBKrsc2NXJvIT+4qeZNo7hjLkFJWp\nRNAEW1IuunJA+tWH2TFXmKqjpboBd1eHztBeqve04J/IHW0apUboNl1SXQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 1, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "", + "sig" : "3046022100ddb577670d5a9b93666df2af7f9baadd8256fca0c81deb2d5cd7301a4b39105f022100a2bcd9f6228a0aa0a4f066aa674b9b08da252b02a77fd1b2f7a2d85929e8b491", + "result" : "valid" + }, + { + "tcId" : 2, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "4d7367", + "sig" : "30440220532d672c307da2891720d11422035ea25771f4fce0dc9948d754ca4f66ef36bb02204f296181799d3e6780086d6908ab8642711bd406e481b0ce3af1c44b9f098496", + "result" : "valid" + }, + { + "tcId" : 3, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304502201c58cde69ddb363e7a6d2612771b3e713be8bed07f37bcda4875f152db2ac1ad022100a66755b078262b6b0d90c74aee64522104aa58b5f82fc5ba98bcef5bdb9d43a8", + "result" : "valid" + }, + { + "tcId" : 4, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "0000000000000000000000000000000000000000", + "sig" : "304402206637f14369d1dd112c5691969fcc867e64bafb1f5d8f917a9acf8ecf1dc957540220457b4a8bdd1c047b12826897991241700dad09666b4f410a56993023b098fd1e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "wx" : "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838", + "wy" : "00c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKSexBRK64+3c/kZ4KBKLrSkDJpkZ\n9whgacjE32xzKDjHeHlk6qwA5ZIfsUmKYPRgZ2az2WhQAVWNGpdOc0FRPg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 5, + "comment" : "signature malleability", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d02201202069b6b5ffadede2fdc290da1badc989ba98a9a491db339bfe478450ef9cc", + "result" : "valid" + }, + { + "tcId" : 6, + "comment" : "Legacy: ASN encoding of r misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "30450220dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 7, + "comment" : "Legacy: ASN encoding of s misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "3045022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0220edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 8, + "comment" : "valid", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "valid" + }, + { + "tcId" : 9, + "comment" : "length of sequence [r, s] uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "308146022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 10, + "comment" : "length of sequence [r, s] contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30820046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 11, + "comment" : "length of sequence [r, s] uses 71 instead of 70", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 12, + "comment" : "length of sequence [r, s] uses 69 instead of 70", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 13, + "comment" : "uint32 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30850100000046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 14, + "comment" : "uint64 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3089010000000000000046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 15, + "comment" : "length of sequence [r, s] = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30847fffffff022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 16, + "comment" : "length of sequence [r, s] = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308480000000022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 17, + "comment" : "length of sequence [r, s] = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084ffffffff022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 18, + "comment" : "length of sequence [r, s] = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085ffffffffff022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 19, + "comment" : "length of sequence [r, s] = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3088ffffffffffffffff022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 20, + "comment" : "incorrect length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30ff022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 21, + "comment" : "replaced sequence [r, s] by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 22, + "comment" : "removing sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "", + "result" : "invalid" + }, + { + "tcId" : 23, + "comment" : "lonely sequence tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30", + "result" : "invalid" + }, + { + "tcId" : 24, + "comment" : "appending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000", + "result" : "invalid" + }, + { + "tcId" : 25, + "comment" : "prepending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30480000022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 26, + "comment" : "appending unused 0's to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000", + "result" : "invalid" + }, + { + "tcId" : 27, + "comment" : "appending null value to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850500", + "result" : "invalid" + }, + { + "tcId" : 28, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b4981773046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 29, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a25003046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 30, + "comment" : "appending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30483046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 31, + "comment" : "including undefined tags", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304eaa00bb00cd003046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 32, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e2229aa00bb00cd00022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 33, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d2229aa00bb00cd00022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 34, + "comment" : "truncated length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3081", + "result" : "invalid" + }, + { + "tcId" : 35, + "comment" : "including undefined tags to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304caa02aabb3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 36, + "comment" : "using composition with indefinite length for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30803046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000", + "result" : "invalid" + }, + { + "tcId" : 37, + "comment" : "using composition with wrong tag for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30803146022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000", + "result" : "invalid" + }, + { + "tcId" : 38, + "comment" : "Replacing sequence [r, s] with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "0500", + "result" : "invalid" + }, + { + "tcId" : 39, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2e46022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 40, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2f46022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 41, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3146022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 42, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3246022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 43, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "ff46022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 44, + "comment" : "dropping value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3000", + "result" : "invalid" + }, + { + "tcId" : 45, + "comment" : "using composition for sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a30010230452100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 46, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b", + "result" : "invalid" + }, + { + "tcId" : 47, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30452100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 48, + "comment" : "sequence [r, s] of size 4167 to check for overflows", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30821047022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 49, + "comment" : "indefinite length", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3080022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000", + "result" : "invalid" + }, + { + "tcId" : 50, + "comment" : "indefinite length with truncated delimiter", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b8500", + "result" : "invalid" + }, + { + "tcId" : 51, + "comment" : "indefinite length with additional element", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b8505000000", + "result" : "invalid" + }, + { + "tcId" : 52, + "comment" : "indefinite length with truncated element", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85060811220000", + "result" : "invalid" + }, + { + "tcId" : 53, + "comment" : "indefinite length with garbage", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000fe02beef", + "result" : "invalid" + }, + { + "tcId" : 54, + "comment" : "indefinite length with nonempty EOC", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3080022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850002beef", + "result" : "invalid" + }, + { + "tcId" : 55, + "comment" : "prepend empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30483000022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 56, + "comment" : "append empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b853000", + "result" : "invalid" + }, + { + "tcId" : 57, + "comment" : "append zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3049022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85020100", + "result" : "invalid" + }, + { + "tcId" : 58, + "comment" : "append garbage with high tag number", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3049022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85bf7f00", + "result" : "invalid" + }, + { + "tcId" : 59, + "comment" : "append null with explicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304a022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85a0020500", + "result" : "invalid" + }, + { + "tcId" : 60, + "comment" : "append null with implicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85a000", + "result" : "invalid" + }, + { + "tcId" : 61, + "comment" : "sequence of sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30483046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 62, + "comment" : "truncated sequence: removed last 1 elements", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3023022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d", + "result" : "invalid" + }, + { + "tcId" : 63, + "comment" : "repeating element in sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3069022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 64, + "comment" : "flipped bit 0 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304400dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2c022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 65, + "comment" : "flipped bit 32 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304400dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49376ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 66, + "comment" : "flipped bit 48 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304400dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a59377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 67, + "comment" : "flipped bit 64 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304400dcbe02d38091fccba712175e1effda765021c6b8f211bc9c41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 68, + "comment" : "length of r uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304702812100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 69, + "comment" : "length of r contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30480282002100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 70, + "comment" : "length of r uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022200dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 71, + "comment" : "length of r uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022000dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 72, + "comment" : "uint32 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b0285010000002100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 73, + "comment" : "uint64 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304f028901000000000000002100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 74, + "comment" : "length of r = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02847fffffff00dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 75, + "comment" : "length of r = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02848000000000dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 76, + "comment" : "length of r = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0284ffffffff00dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 77, + "comment" : "length of r = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b0285ffffffffff00dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 78, + "comment" : "length of r = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e0288ffffffffffffffff00dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 79, + "comment" : "incorrect length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304602ff00dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 80, + "comment" : "replaced r by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046028000dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 81, + "comment" : "removing r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3023022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 82, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 83, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3024022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d02", + "result" : "invalid" + }, + { + "tcId" : 84, + "comment" : "appending 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022300dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0000022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 85, + "comment" : "prepending 0's to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30480223000000dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 86, + "comment" : "appending unused 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0000022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 87, + "comment" : "appending null value to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022300dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0500022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 88, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b2226498177022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 89, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a22252500022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 90, + "comment" : "appending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e2223022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0004deadbeef022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 91, + "comment" : "truncated length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250281022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 92, + "comment" : "including undefined tags to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304c2227aa02aabb022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 93, + "comment" : "using composition with indefinite length for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a2280022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0000022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 94, + "comment" : "using composition with wrong tag for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a2280032100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0000022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 95, + "comment" : "Replacing r with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30250500022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 96, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046002100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 97, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046012100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 98, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046032100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 99, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046042100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 100, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046ff2100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 101, + "comment" : "dropping value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250200022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 102, + "comment" : "using composition for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a22250201000220dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 103, + "comment" : "modifying first byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022102dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 104, + "comment" : "modifying last byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57efad022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 105, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022000dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 106, + "comment" : "r of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308210490282102200dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 107, + "comment" : "leading ff in r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30470222ff00dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 108, + "comment" : "replaced r by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026090180022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 109, + "comment" : "replacing r with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 110, + "comment" : "flipped bit 0 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b84", + "result" : "invalid" + }, + { + "tcId" : 111, + "comment" : "flipped bit 32 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64bb7542b85", + "result" : "invalid" + }, + { + "tcId" : 112, + "comment" : "flipped bit 48 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f8e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 113, + "comment" : "flipped bit 64 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d00edfdf96394a0052221d023d6f25e4523244b51230cce80d0b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 114, + "comment" : "length of s uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d02812100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 115, + "comment" : "length of s contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0282002100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 116, + "comment" : "length of s uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022200edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 117, + "comment" : "length of s uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022000edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 118, + "comment" : "uint32 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0285010000002100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 119, + "comment" : "uint64 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304f022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d028901000000000000002100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 120, + "comment" : "length of s = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d02847fffffff00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 121, + "comment" : "length of s = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d02848000000000edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 122, + "comment" : "length of s = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0284ffffffff00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 123, + "comment" : "length of s = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0285ffffffffff00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 124, + "comment" : "length of s = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0288ffffffffffffffff00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 125, + "comment" : "incorrect length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d02ff00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 126, + "comment" : "replaced s by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d028000edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 127, + "comment" : "appending 0's to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022300edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000", + "result" : "invalid" + }, + { + "tcId" : 128, + "comment" : "prepending 0's to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0223000000edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 129, + "comment" : "appending null value to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3048022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022300edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850500", + "result" : "invalid" + }, + { + "tcId" : 130, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d2226498177022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 131, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d22252500022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 132, + "comment" : "appending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d2223022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 133, + "comment" : "truncated length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3025022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0281", + "result" : "invalid" + }, + { + "tcId" : 134, + "comment" : "including undefined tags to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304c022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d2227aa02aabb022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 135, + "comment" : "using composition with indefinite length for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d2280022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000", + "result" : "invalid" + }, + { + "tcId" : 136, + "comment" : "using composition with wrong tag for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d2280032100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000", + "result" : "invalid" + }, + { + "tcId" : 137, + "comment" : "Replacing s with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0500", + "result" : "invalid" + }, + { + "tcId" : 138, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d002100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 139, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d012100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 140, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d032100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 141, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d042100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 142, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2dff2100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 143, + "comment" : "dropping value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3025022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0200", + "result" : "invalid" + }, + { + "tcId" : 144, + "comment" : "using composition for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d22250201000220edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 145, + "comment" : "modifying first byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022102edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 146, + "comment" : "modifying last byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b05", + "result" : "invalid" + }, + { + "tcId" : 147, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3045022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022000edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b", + "result" : "invalid" + }, + { + "tcId" : 148, + "comment" : "s of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30821049022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0282102200edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 149, + "comment" : "leading ff in s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d0222ff00edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 150, + "comment" : "replaced s by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d090180", + "result" : "invalid" + }, + { + "tcId" : 151, + "comment" : "replacing s with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d020100", + "result" : "invalid" + }, + { + "tcId" : 152, + "comment" : "replaced r by r + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022101dcbe02d28091fccca712175e1effda760d08c16699295b22355e5e3ae9bb147e022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 153, + "comment" : "replaced r by r - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450220dcbe02d48091fccaa712175e1effda76933acc0b4afa1e184deac8b4f0f4c9dc022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 154, + "comment" : "replaced r by r + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304702220100dcbe01d38091fdcba712175e1effda33371c746009b04190fb6f5674507d402d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 155, + "comment" : "replaced r by -r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221ff2341fd2c7f6e033458ede8a1e1002589afde39470dee4362be5b6c8812a810d3022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 156, + "comment" : "replaced r by n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "304502202341fd2b7f6e033558ede8a1e10025896cc533f4b505e1e7b215374b0f0b3624022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 157, + "comment" : "replaced r by -n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fe2341fd2d7f6e033358ede8a1e1002589f2f73e9966d6a4ddcaa1a1c51644eb82022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 158, + "comment" : "replaced r by r + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "3046022101dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 159, + "comment" : "replaced r by r + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e0229010000000000000000dcbe02d38091fccba712175e1effda765021c6b8f211bc9d41a49377ed57ef2d022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 160, + "comment" : "replaced s by s + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022101edfdf96294a0052321d023d6f25e4522e1324bd0b3e61f56adb3b10db3b750d6022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 161, + "comment" : "replaced s by s - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450220edfdf96494a0052121d023d6f25e45236764567565b6e24cc6401b87baf10634022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 162, + "comment" : "replaced s by s + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304702220100edfdf86394a0062221d023d6f25e44e00b45feca246d05c573c4a9471a797c85022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 163, + "comment" : "replaced s by -s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221ff1202069c6b5ffaddde2fdc290da1badcdbb4aedcf3317f2e460619b548abd47b022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 164, + "comment" : "replaced s by -n - s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fe1202069d6b5ffadcde2fdc290da1badd1ecdb42f4c19e0a9524c4ef24c48af2a022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 165, + "comment" : "replaced s by s + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "3046022101edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 166, + "comment" : "replaced s by s - 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450220edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 167, + "comment" : "replaced s by s + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e0229010000000000000000edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85022100edfdf96394a0052221d023d6f25e4523244b51230cce80d1b9f9e64ab7542b85", + "result" : "invalid" + }, + { + "tcId" : 168, + "comment" : "Signature with special case values r=0 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020100", + "result" : "invalid" + }, + { + "tcId" : 169, + "comment" : "Signature with special case values r=0 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020101", + "result" : "invalid" + }, + { + "tcId" : 170, + "comment" : "Signature with special case values r=0 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000201ff", + "result" : "invalid" + }, + { + "tcId" : 171, + "comment" : "Signature with special case values r=0 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 172, + "comment" : "Signature with special case values r=0 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 173, + "comment" : "Signature with special case values r=0 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 174, + "comment" : "Signature with special case values r=0 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 175, + "comment" : "Signature with special case values r=0 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 176, + "comment" : "Signature with special case values r=1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020100", + "result" : "invalid" + }, + { + "tcId" : 177, + "comment" : "Signature with special case values r=1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "invalid" + }, + { + "tcId" : 178, + "comment" : "Signature with special case values r=1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010201ff", + "result" : "invalid" + }, + { + "tcId" : 179, + "comment" : "Signature with special case values r=1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 180, + "comment" : "Signature with special case values r=1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 181, + "comment" : "Signature with special case values r=1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 182, + "comment" : "Signature with special case values r=1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 183, + "comment" : "Signature with special case values r=1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 184, + "comment" : "Signature with special case values r=-1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020100", + "result" : "invalid" + }, + { + "tcId" : 185, + "comment" : "Signature with special case values r=-1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020101", + "result" : "invalid" + }, + { + "tcId" : 186, + "comment" : "Signature with special case values r=-1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0201ff", + "result" : "invalid" + }, + { + "tcId" : 187, + "comment" : "Signature with special case values r=-1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 188, + "comment" : "Signature with special case values r=-1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 189, + "comment" : "Signature with special case values r=-1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 190, + "comment" : "Signature with special case values r=-1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 191, + "comment" : "Signature with special case values r=-1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 192, + "comment" : "Signature with special case values r=n and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020100", + "result" : "invalid" + }, + { + "tcId" : 193, + "comment" : "Signature with special case values r=n and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020101", + "result" : "invalid" + }, + { + "tcId" : 194, + "comment" : "Signature with special case values r=n and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510201ff", + "result" : "invalid" + }, + { + "tcId" : 195, + "comment" : "Signature with special case values r=n and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 196, + "comment" : "Signature with special case values r=n and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 197, + "comment" : "Signature with special case values r=n and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 198, + "comment" : "Signature with special case values r=n and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 199, + "comment" : "Signature with special case values r=n and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 200, + "comment" : "Signature with special case values r=n - 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020100", + "result" : "invalid" + }, + { + "tcId" : 201, + "comment" : "Signature with special case values r=n - 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020101", + "result" : "invalid" + }, + { + "tcId" : 202, + "comment" : "Signature with special case values r=n - 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325500201ff", + "result" : "invalid" + }, + { + "tcId" : 203, + "comment" : "Signature with special case values r=n - 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 204, + "comment" : "Signature with special case values r=n - 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 205, + "comment" : "Signature with special case values r=n - 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 206, + "comment" : "Signature with special case values r=n - 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 207, + "comment" : "Signature with special case values r=n - 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 208, + "comment" : "Signature with special case values r=n + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020100", + "result" : "invalid" + }, + { + "tcId" : 209, + "comment" : "Signature with special case values r=n + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020101", + "result" : "invalid" + }, + { + "tcId" : 210, + "comment" : "Signature with special case values r=n + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325520201ff", + "result" : "invalid" + }, + { + "tcId" : 211, + "comment" : "Signature with special case values r=n + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 212, + "comment" : "Signature with special case values r=n + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 213, + "comment" : "Signature with special case values r=n + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 214, + "comment" : "Signature with special case values r=n + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 215, + "comment" : "Signature with special case values r=n + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 216, + "comment" : "Signature with special case values r=p and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020100", + "result" : "invalid" + }, + { + "tcId" : 217, + "comment" : "Signature with special case values r=p and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020101", + "result" : "invalid" + }, + { + "tcId" : 218, + "comment" : "Signature with special case values r=p and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0201ff", + "result" : "invalid" + }, + { + "tcId" : 219, + "comment" : "Signature with special case values r=p and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 220, + "comment" : "Signature with special case values r=p and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 221, + "comment" : "Signature with special case values r=p and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 222, + "comment" : "Signature with special case values r=p and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 223, + "comment" : "Signature with special case values r=p and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 224, + "comment" : "Signature with special case values r=p + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020100", + "result" : "invalid" + }, + { + "tcId" : 225, + "comment" : "Signature with special case values r=p + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020101", + "result" : "invalid" + }, + { + "tcId" : 226, + "comment" : "Signature with special case values r=p + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff000000010000000000000000000000010000000000000000000000000201ff", + "result" : "invalid" + }, + { + "tcId" : 227, + "comment" : "Signature with special case values r=p + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 228, + "comment" : "Signature with special case values r=p + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 229, + "comment" : "Signature with special case values r=p + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 230, + "comment" : "Signature with special case values r=p + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 231, + "comment" : "Signature with special case values r=p + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 232, + "comment" : "Signature encoding contains incorrect types: r=0, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020100090380fe01", + "result" : "invalid" + }, + { + "tcId" : 233, + "comment" : "Signature encoding contains incorrect types: r=0, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100090142", + "result" : "invalid" + }, + { + "tcId" : 234, + "comment" : "Signature encoding contains incorrect types: r=0, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010101", + "result" : "invalid" + }, + { + "tcId" : 235, + "comment" : "Signature encoding contains incorrect types: r=0, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010100", + "result" : "invalid" + }, + { + "tcId" : 236, + "comment" : "Signature encoding contains incorrect types: r=0, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000500", + "result" : "invalid" + }, + { + "tcId" : 237, + "comment" : "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000c00", + "result" : "invalid" + }, + { + "tcId" : 238, + "comment" : "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000c0130", + "result" : "invalid" + }, + { + "tcId" : 239, + "comment" : "Signature encoding contains incorrect types: r=0, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201003000", + "result" : "invalid" + }, + { + "tcId" : 240, + "comment" : "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201003003020100", + "result" : "invalid" + }, + { + "tcId" : 241, + "comment" : "Signature encoding contains incorrect types: r=1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020101090380fe01", + "result" : "invalid" + }, + { + "tcId" : 242, + "comment" : "Signature encoding contains incorrect types: r=1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101090142", + "result" : "invalid" + }, + { + "tcId" : 243, + "comment" : "Signature encoding contains incorrect types: r=1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010101", + "result" : "invalid" + }, + { + "tcId" : 244, + "comment" : "Signature encoding contains incorrect types: r=1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010100", + "result" : "invalid" + }, + { + "tcId" : 245, + "comment" : "Signature encoding contains incorrect types: r=1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010500", + "result" : "invalid" + }, + { + "tcId" : 246, + "comment" : "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010c00", + "result" : "invalid" + }, + { + "tcId" : 247, + "comment" : "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010c0130", + "result" : "invalid" + }, + { + "tcId" : 248, + "comment" : "Signature encoding contains incorrect types: r=1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201013000", + "result" : "invalid" + }, + { + "tcId" : 249, + "comment" : "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201013003020100", + "result" : "invalid" + }, + { + "tcId" : 250, + "comment" : "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 251, + "comment" : "Signature encoding contains incorrect types: r=-1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff090142", + "result" : "invalid" + }, + { + "tcId" : 252, + "comment" : "Signature encoding contains incorrect types: r=-1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010101", + "result" : "invalid" + }, + { + "tcId" : 253, + "comment" : "Signature encoding contains incorrect types: r=-1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010100", + "result" : "invalid" + }, + { + "tcId" : 254, + "comment" : "Signature encoding contains incorrect types: r=-1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0500", + "result" : "invalid" + }, + { + "tcId" : 255, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0c00", + "result" : "invalid" + }, + { + "tcId" : 256, + "comment" : "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0c0130", + "result" : "invalid" + }, + { + "tcId" : 257, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff3000", + "result" : "invalid" + }, + { + "tcId" : 258, + "comment" : "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff3003020100", + "result" : "invalid" + }, + { + "tcId" : 259, + "comment" : "Signature encoding contains incorrect types: r=n, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090380fe01", + "result" : "invalid" + }, + { + "tcId" : 260, + "comment" : "Signature encoding contains incorrect types: r=n, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090142", + "result" : "invalid" + }, + { + "tcId" : 261, + "comment" : "Signature encoding contains incorrect types: r=n, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010101", + "result" : "invalid" + }, + { + "tcId" : 262, + "comment" : "Signature encoding contains incorrect types: r=n, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010100", + "result" : "invalid" + }, + { + "tcId" : 263, + "comment" : "Signature encoding contains incorrect types: r=n, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510500", + "result" : "invalid" + }, + { + "tcId" : 264, + "comment" : "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c00", + "result" : "invalid" + }, + { + "tcId" : 265, + "comment" : "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c0130", + "result" : "invalid" + }, + { + "tcId" : 266, + "comment" : "Signature encoding contains incorrect types: r=n, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513000", + "result" : "invalid" + }, + { + "tcId" : 267, + "comment" : "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513003020100", + "result" : "invalid" + }, + { + "tcId" : 268, + "comment" : "Signature encoding contains incorrect types: r=p, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 269, + "comment" : "Signature encoding contains incorrect types: r=p, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090142", + "result" : "invalid" + }, + { + "tcId" : 270, + "comment" : "Signature encoding contains incorrect types: r=p, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010101", + "result" : "invalid" + }, + { + "tcId" : 271, + "comment" : "Signature encoding contains incorrect types: r=p, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010100", + "result" : "invalid" + }, + { + "tcId" : 272, + "comment" : "Signature encoding contains incorrect types: r=p, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0500", + "result" : "invalid" + }, + { + "tcId" : 273, + "comment" : "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c00", + "result" : "invalid" + }, + { + "tcId" : 274, + "comment" : "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c0130", + "result" : "invalid" + }, + { + "tcId" : 275, + "comment" : "Signature encoding contains incorrect types: r=p, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3000", + "result" : "invalid" + }, + { + "tcId" : 276, + "comment" : "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3003020100", + "result" : "invalid" + }, + { + "tcId" : 277, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a090380fe01090380fe01", + "result" : "invalid" + }, + { + "tcId" : 278, + "comment" : "Signature encoding contains incorrect types: r=nan, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142090142", + "result" : "invalid" + }, + { + "tcId" : 279, + "comment" : "Signature encoding contains incorrect types: r=True, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101010101", + "result" : "invalid" + }, + { + "tcId" : 280, + "comment" : "Signature encoding contains incorrect types: r=False, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100010100", + "result" : "invalid" + }, + { + "tcId" : 281, + "comment" : "Signature encoding contains incorrect types: r=Null, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300405000500", + "result" : "invalid" + }, + { + "tcId" : 282, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30040c000c00", + "result" : "invalid" + }, + { + "tcId" : 283, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c01300c0130", + "result" : "invalid" + }, + { + "tcId" : 284, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300430003000", + "result" : "invalid" + }, + { + "tcId" : 285, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a30030201003003020100", + "result" : "invalid" + }, + { + "tcId" : 286, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008090380fe01020100", + "result" : "invalid" + }, + { + "tcId" : 287, + "comment" : "Signature encoding contains incorrect types: r=nan, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142020100", + "result" : "invalid" + }, + { + "tcId" : 288, + "comment" : "Signature encoding contains incorrect types: r=True, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101020100", + "result" : "invalid" + }, + { + "tcId" : 289, + "comment" : "Signature encoding contains incorrect types: r=False, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100020100", + "result" : "invalid" + }, + { + "tcId" : 290, + "comment" : "Signature encoding contains incorrect types: r=Null, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050500020100", + "result" : "invalid" + }, + { + "tcId" : 291, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050c00020100", + "result" : "invalid" + }, + { + "tcId" : 292, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c0130020100", + "result" : "invalid" + }, + { + "tcId" : 293, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30053000020100", + "result" : "invalid" + }, + { + "tcId" : 294, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30083003020100020100", + "result" : "invalid" + }, + { + "tcId" : 295, + "comment" : "Edge case for Shamir multiplication", + "flags" : [ + "EdgeCaseShamirMultiplication" + ], + "msg" : "3335343130", + "sig" : "3044022064a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e02203d4e6c69176bb9e30eec304a30d982cb3f6073a2273f36b67b1b284899b08163", + "result" : "valid" + }, + { + "tcId" : 296, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373239373236343137", + "sig" : "3046022100f521807c1e329ac6df4df24208d1e7088b4e4de5a82ed37dbfd8d49c7406f91b022100c44f723038deea858a25d7264d1680b416ffc0d909b94def9fbda02477d69ef4", + "result" : "valid" + }, + { + "tcId" : 297, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343331343737363137", + "sig" : "30450220219f842783028cab66f419241dee39da459e2d295d0ab1e56b29b38f50a8bd51022100f6f357077677e2669c1e289f65c6094c68b8e1efbe4c87468327c81d55979bd9", + "result" : "valid" + }, + { + "tcId" : 298, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36363033343338303333", + "sig" : "3045022015768c2623e7093c7dcb468d430007fc7338f1cfd058fe22ab09a451b61ec34c022100a609689226f073c968fc46336cfd116edb92045f2383d5376ff88272dc444ca2", + "result" : "valid" + }, + { + "tcId" : 299, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383239363231343535", + "sig" : "3045022100bb449ace6f3b900103a09357cda16e3b14e9e99beb3b8f1928f0a66ce30b0ea502206e6b65f9798cd8c32d7068270800da5d98f06d36836ccb7c30551717fae3052f", + "result" : "valid" + }, + { + "tcId" : 300, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34333131383231373336", + "sig" : "30450220589e10e34c3fea59478a9301bde976cbd56ac15afa2f13f14f310e5e8d6bf1e1022100adf5198111939bd395bd3820742a68ae97f8595cfc8b7e1892fc360d13142158", + "result" : "valid" + }, + { + "tcId" : 301, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131373730373734313735", + "sig" : "3046022100ad5a1daab3023a651b58e3a13ebfaefc14fb9c79ad2610be68e49bd3992e5722022100cfb91fa16a32c8724cef5714e72f2c91b1d50050b4eb272a82327604486cbbb2", + "result" : "valid" + }, + { + "tcId" : 302, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353938353135353635", + "sig" : "3045022059d0df1176b277e12c097e9e00860dc4ad3bb7f2e4af2282beb13eff9d7b6afc022100d3da4f61e8adc8449885a52bf73eda66ac1b77ba05a1ab8397e42ecaeaff68cf", + "result" : "valid" + }, + { + "tcId" : 303, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383831313031363138", + "sig" : "3045022100d274baceefc72a921fc4962cc9487263ec6984f0f82c0b992ae3c80ba685b423022024bd9a9f39ed02773e8ba54e3f0f99f4e806a69839b7890099be2978cd55076f", + "result" : "valid" + }, + { + "tcId" : 304, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303034373833333332", + "sig" : "304502203411db9e53af62472c8afa3a4ae7d044fdbb78b1e3a8e8fd329bc72e9e1dfb5d0221008284d93b62242f6274a26a3419719dc0635e0604fa6da5c2dbfbb85541c88566", + "result" : "valid" + }, + { + "tcId" : 305, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39353030323437373837", + "sig" : "3044022033b2abf92021a14fd1e5293008c8aff551fd4a0cacaf8ec6e147f40d0f521cb002204d0d3ed085477a4dc7fd86d242905637a71700ffd4c22cf962a67e9ae32b8877", + "result" : "valid" + }, + { + "tcId" : 306, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323039353030303630", + "sig" : "30440220717f5185242ac57215d8713f902cf9012f45dba76b8e7e51c67b71e6de10f0d8022028a9ad765a6b1248807be126b9eee01e8e2d65d8528cb28f0d45763f507d97f0", + "result" : "valid" + }, + { + "tcId" : 307, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38313933373839323237", + "sig" : "304402204e57dbece14d3d279f1e831777b28401d2990c4ae477eebb997b583e82f29c5402203e41fe090c8f14b8af7fd39c2628869258cf05b0e289b6692602c10cdcc8dd83", + "result" : "valid" + }, + { + "tcId" : 308, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33363530363033323938", + "sig" : "3045022009eb0b2bf6a2491eb35c3a902da3c6c90933dd374dfb1f60f8ef7bd749725755022100df8a0ee8f757dc599350bb0e2aec515451152ff05bb2e439ba9145fc9a0849fa", + "result" : "valid" + }, + { + "tcId" : 309, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3136333833393533353233", + "sig" : "304402201c66a303f7f548ff4c17ce6c6038879cb9d47abbb71ad69a798d0d8a99518dcd0220485ee205c6fa3ffe5411948dff2351ab9bbbc20ca419d6182da77f5579058749", + "result" : "valid" + }, + { + "tcId" : 310, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303931373638323035", + "sig" : "3045022100ae1fd2dbad7ebc2b7f19d1789e1f68ce345f40568a576a29dadcf894c51f7a3f022069e80f80c76b57e1767484485915980b5e2493e89d8824b7922ea2cbc687d2b3", + "result" : "valid" + }, + { + "tcId" : 311, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39333634373032383235", + "sig" : "3044022067afdc527b0003c8400ade54df5663635f811950cb34ea77435c0ce40036524902207afa3d39b8a7e52ce768e466db6da41a354c12ea2f677bf05a24fc689e347323", + "result" : "valid" + }, + { + "tcId" : 312, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393236383638373931", + "sig" : "30450221009b1a90f8116d33d674137579528f395ed13ecbc238940a1a9a8504a72568a9d7022007f34d9400af004fd657144ce97a13b76d509f7fd4c9245ce54609f749ead3cd", + "result" : "valid" + }, + { + "tcId" : 313, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35313738313334383231", + "sig" : "30450220263040f9babb63aec7d73fdbce988fb3ca2115ab24bba0c80832e3de34b698b9022100f7d99b7738aca745b91b65c697a83ac76ce1e61568d9271631d06af1b77ad5d6", + "result" : "valid" + }, + { + "tcId" : 314, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373335303130373531", + "sig" : "304502210082f676de71ecae7041b8788e0870a57923c71fd21db1f8864e4519ee2f65d8880220020f12d98b79d45348513696d5b4926856d953e72f267d30e7bcd57ee8147210", + "result" : "valid" + }, + { + "tcId" : 315, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134333533393131363839", + "sig" : "304502204e3c9c22a54f1ceb9336b656bf7019c375cb7f9137d692454c6d882927f16795022100b3bde8f45d5f885948b45402b9e7a722c292e88bfadb5bb2fdadfe8e1b3f5181", + "result" : "valid" + }, + { + "tcId" : 316, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333834353439323034", + "sig" : "3046022100b20721bd0e8c9ee6eb790cee9d88481d17d568b4c942ba437e607460031c1df50221009f13ff6a54e6a0c5041cc3690c8f3b499f05e34f235c8adf8fd455df4a17ce97", + "result" : "valid" + }, + { + "tcId" : 317, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373632313932373839", + "sig" : "304502206b1d46eeacccf7066a0fef27f498a59a9376b2544258510452787bd4a35783b502210088328ac07938b5b9cfe62a3841382cfbe9d623480cec2a3fdb73ee36dd4aef8f", + "result" : "valid" + }, + { + "tcId" : 318, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31383331363534333331", + "sig" : "30440220257e760a54637387b443f829f1a5802c7fc92bdf033039acf68e1acea0cbcdbe022025087f120467a80cc07efb7bb27ae68d8569a38fe2908282c3c7a310322761c5", + "result" : "valid" + }, + { + "tcId" : 319, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343336383939303330", + "sig" : "304402201869c821e271838453c88c4a867df2301d27662b72d9385bacb6740ab6d6b5c3022022ccc9a0493116556d9ffc7582253c581452d717a7e00618dce21f46f5b64fd0", + "result" : "valid" + }, + { + "tcId" : 320, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323034303431323232", + "sig" : "304602210094a521fb3bed347b0dcbe55f2e67c0d7abc4aa32ed2e1a6fd1c209de3a25ca250221009b7631a6520ed4b14b5b2a8b57a52de31f583b8d1260eb8dc061ad965d0e9eb6", + "result" : "valid" + }, + { + "tcId" : 321, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33333337313139393735", + "sig" : "3045022100ee4913a5f83dd3310e91595ef197075600ae17785e1c0b9139cbaea8def1d6d002202818f7847c48a9a38739c71653919104db8920a816000ed21e5179980efb6b6d", + "result" : "valid" + }, + { + "tcId" : 322, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36363935363230363738", + "sig" : "3045022100e912b0e5436db2a50817c6424291ffdd41352916e956ccad9068c95125f3a1e9022073309aa384c56486b6a4c699fca446e6f67a1133892971be83b4e2dab49afc2a", + "result" : "valid" + }, + { + "tcId" : 323, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303933303137373437", + "sig" : "3046022100eb0b719879b2fd1676b3f6f913e353c2b4dd8201facb067e15da1dae9addcc8c022100a73b3a703857aa8d12263290366a19d64e0b3efccd0623f53a7370099e9dcece", + "result" : "valid" + }, + { + "tcId" : 324, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313233343137393136", + "sig" : "304602210095617b71dc18a99e96a95ab5384324bff797ad704dfb1e2d6b3cc06e76652ced022100b11bc49444a2e2635d4d9b1bdedeb61593b5f3e0e16ce78da813ff64b728f8d2", + "result" : "valid" + }, + { + "tcId" : 325, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373634333530363837", + "sig" : "3045022028fbebb0c142c6d200bfb173173c03bc3aa55da6d48c1b784628f2b9f59038f2022100c0f1427005a46aac00a0af43b8f54a951e673e0480c6bf7a6b5775d4a3de5e60", + "result" : "valid" + }, + { + "tcId" : 326, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131343137323431343431", + "sig" : "30440220457ff86369e4efd69592b161aea2b09153f37cf69006907a7558998ab34b38a4022012692ffc569849dc8e3b9fd2cd7c6f42207bb4c07832d490c9d35a702665ce58", + "result" : "valid" + }, + { + "tcId" : 327, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323638323436343933", + "sig" : "3046022100ac70036f6058fd1eb40dc6f58dd68ab56e73dc6841eaa45a83813b6aaf75fae2022100f70f7f0563c46a07d248e80a65f38532d5759f49fc104184fa6718ca55274372", + "result" : "valid" + }, + { + "tcId" : 328, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373234373936373737", + "sig" : "3044022059baaba3992dab0b594a2e9fbc4c344cfdabe7868e4e77f47a310d94916d30ce022020b16c383085ee74402157d4f2da5f7e3e995dbbf53ee50985d4f7096882edda", + "result" : "valid" + }, + { + "tcId" : 329, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393733333935313139", + "sig" : "3046022100aa567a710f7010718b1e02792bc63f9049c02f798bb319214c97bc734e54d115022100ddb7c78b45c4221db6f26e845f8c30be61c29bcf38e38abaf7cbd03e5af914f7", + "result" : "valid" + }, + { + "tcId" : 330, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353037303032373036", + "sig" : "304402206ac18c06081a51ac5fb6d0a0735af510dd0ad529206e7fc0c1b6d0ea36cec4a8022064d49524cc26ef8eda21ad5f2c371203d6eef8ddfa5da7a6c37d86f29efc1fca", + "result" : "valid" + }, + { + "tcId" : 331, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33373433353638373832", + "sig" : "3046022100cf59dfd67512e2d173a398cb648805fb41e3099f27a7867aa2dda50dcf2e1f86022100bd528be771fa1e52cab6d7485c5887befb378ceaf565aca0f32d2831a466959e", + "result" : "valid" + }, + { + "tcId" : 332, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393437363731323438", + "sig" : "30440220455f1c4406b598fc828ddb3bc77df7ad04baad399fb4975f542b19aeedfd5a1102204e0555d9bf4211d3ab173e2e6c7edb990867f8f982f6afc1b4b6732ee96a0af0", + "result" : "valid" + }, + { + "tcId" : 333, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373235343434333234", + "sig" : "3045022100e1dc7a439633b9bc91d37a954943bc94e5f56a0442a3528fba5c6070cf25e86f02200376b7ff7601978a47bbf7d11c6844520a442ceb167aec3a0ddf36e150a385c9", + "result" : "valid" + }, + { + "tcId" : 334, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35353334303231323139", + "sig" : "3046022100aeeeef010cf97f324e6f89f3163656305728a573b885c52ec5973eba863a08da022100904c25f931e78e2b59fa9a138cb80a5c22341601a18501d364af361d69cd0bb8", + "result" : "valid" + }, + { + "tcId" : 335, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3132333031383133373933", + "sig" : "304502200e3798e441e787dae4bf84e2748abce913f362d41d59a39d58d89c889e52229f022100e3a002023296fe6d9395fc92ba31dd35c5ada42e06db01466a24f087ae70cdb4", + "result" : "valid" + }, + { + "tcId" : 336, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39313135333137363130", + "sig" : "30460221009bfe9e09c40fad40bb442eb045216c20dc1282d3cc4ba77fe2e3db92d312fd800221008a152afa2164548b6edfd6610046ee001fdfb06555677c98bc505b6aef297d15", + "result" : "valid" + }, + { + "tcId" : 337, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383934333937393632", + "sig" : "304502201531f9b622d3172f72096b8afc7278eb7bee49b72e1b948e48cc1add8f01e365022100edc803cdb54bd4c54b87bc69a42df3dd11ab56bb13d8b5b78642ffa9ef88d31d", + "result" : "valid" + }, + { + "tcId" : 338, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31323333353833303333", + "sig" : "304402207973333617680ff89798c6b64bb42f436be7771887c2d14a98dd3397e6896e0a022011b70b23a62fd9ce1b27c1b669c851187c09e9081f0aa6ae011411425f694929", + "result" : "valid" + }, + { + "tcId" : 339, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323131323639323536", + "sig" : "304502204fc40e0b3dd49c4f259c5ee2ff271b703b9b7380455167e11360bf336f72c0c4022100d219cdbfefa9ced843f947191ff11bfe4880702a4504f34b28481b424f433a38", + "result" : "valid" + }, + { + "tcId" : 340, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303035343833383634", + "sig" : "3046022100816c369e7b8672cce325dae1ad2f2a5330d177fe0da399c8e520f361ac770389022100858c9cdf1a2ca40ef9c1e02f883b34701dc1760a9d13ba714c57dd886282acd8", + "result" : "valid" + }, + { + "tcId" : 341, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38333536373632373235", + "sig" : "3044022051adf43cda1a938e1deb5fe08ab28df1e607f25fb2e98913d2579420b63056e602203b8920181a8ab6f9ea0a1814171db3eb4ff3d5fd9cbd2d9c1ec4018a7625562e", + "result" : "valid" + }, + { + "tcId" : 342, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38333239353030373630", + "sig" : "3045022042ce9e0f877b7586e7c0eb2fde6f7c4b1f4cc888f54402f2b7bb99dedc2b7f07022100f0413e7636cb6605e0d7284c7804d7c9a3cc0924d37fca7d4943d9e0c9817427", + "result" : "valid" + }, + { + "tcId" : 343, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393237303834313635", + "sig" : "304402204b2e5a797d240cd8c80b424a41dc47eaad249fc642e3c5b4bc68328fc1e26fc50220117910985597a6f7482bec7632e94676c432684f16f7f3d09a90ff4ed6ad36db", + "result" : "valid" + }, + { + "tcId" : 344, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37333032333538323838", + "sig" : "3044022042bf9a164723ef3f5cb59b528966ae648e80291785a4e0067283a7af59795bb70220017e1d24962a34d850d94187d269836ad437396a0ff134067b1baedef69b5951", + "result" : "valid" + }, + { + "tcId" : 345, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3133343733373337333833", + "sig" : "304502201ec06a62d69fca8d99473b8d5a8af3bbd701891df976e33e2f86c6084fb705f2022100b679eff436faa53c0a3c437717f574b59135d5dc49fb8524a365296db2d119e6", + "result" : "valid" + }, + { + "tcId" : 346, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353031353533363839", + "sig" : "30440220183c81ab34a7d7c6742ede4198f5c75ed7fb79e8315899ef0dd26f95e3c4ba26022073f0196e459eb980b6e7ac44d868ab632d6421d1788b9f9651fb827b1a8e5dcc", + "result" : "valid" + }, + { + "tcId" : 347, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353335303430303239", + "sig" : "3045022100f5bec00e6b90ab2a8f188f8163dcdd9b8185a6bbbc623c12d583c9cf55c8e3ba02205dba085bd57b5471f8547cff0aca9e51234d85c0847d01a3aa0b3cf3cace82d9", + "result" : "valid" + }, + { + "tcId" : 348, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343230333537323930", + "sig" : "304402207c18891499af92cfa1db5538c7afbd44605b17dd0ede573206db85af23d3fe9d022028ceff96833996ebababef332b05372209844ddcc4c2134fd9311397e733b10a", + "result" : "valid" + }, + { + "tcId" : 349, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393035313735303638", + "sig" : "304502204ed587536ba15e6707014f5ae773a423475e5e37564ffe91aec17722894cff340221009ff59fabe5e8dcf9539ea1bf9f4b880f112a26c915c14827dad9de6b251dd65e", + "result" : "valid" + }, + { + "tcId" : 350, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363133373734323935", + "sig" : "304402204fb615772d56b6d1ba60f371eb04c557e0c9414c4eec00819c7647d91e7dee0102202623c6c4a3bffc596cb5f2f70a5a381942d350df04c35978f6607ddf7d57e4e3", + "result" : "valid" + }, + { + "tcId" : 351, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383733363733343931", + "sig" : "3046022100c53d6697f536b8fb0e79f3b002dc626a02948e206d96de7c62bd7f9736408ace022100c9423b8575e4afe16cfebefb03e55d628270264fad0eb67c9acf0268e514584c", + "result" : "valid" + }, + { + "tcId" : 352, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34333535313036343035", + "sig" : "3044022008012cfd3713068d8ba6f3fa453be9da95afa6572a893882075ed5d64d62a41702203c5d1bf341823a4cca251cd67d43a6bcd6b5e47303082b7e54c80df5acbbac82", + "result" : "valid" + }, + { + "tcId" : 353, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34353339353735383736", + "sig" : "30450221008ad3da767111f41558fdc51723c649a87f58d42bea3431c8fdfa1f1096e3f2dd02207d1ea6859a0c932f2298f9d21c89ebea7354bbe508d2b73469dc3efe8613bc87", + "result" : "valid" + }, + { + "tcId" : 354, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383933363633323031", + "sig" : "3045022062becf5afb08835f6768882c58a26c501f277ecd61a48d1fe683b6a78c49ce8202210089d11230de6953a1eeeb6b30774fc6bfd093c1e7c0422a7253428ba17ef969ce", + "result" : "valid" + }, + { + "tcId" : 355, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33383036303638303338", + "sig" : "3045022022b54382e2f2e6d7cffe3b34fbd567c8b503bfa6b5c3e5b8131e0ffe20747176022100a6d25ae5cab39cc83116d073cd1eb59d80ce2ed208c1c970b134be2ad29d6068", + "result" : "valid" + }, + { + "tcId" : 356, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323332383137343937", + "sig" : "3045022100e2d9f5c37ddb25978ed4727b63a5e17546292526877e903f11d3d29874e952c802205c28ebafa2c2d285ed7f143d49b6d47daf12ad21c36f78ed7f18cb53d9c29f76", + "result" : "valid" + }, + { + "tcId" : 357, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34303734333232353538", + "sig" : "304402203b4c2fb773223c1dafa6d6de9ed2304dc25eea1fd487442a3a64ae8dc8f14927022056c21579e85fc9075c7601bd36ef8a3fa57d5bc7550c9a17bb8383e7fdbb366f", + "result" : "valid" + }, + { + "tcId" : 358, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363130363735383237", + "sig" : "3044022005276f6159e2853fc6884c2939997b5a3be7ae615dad7517d6006208111dd6780220059ea3474bc6908c565dfb5bc72fd1a84231363cf78c4c317a061dbf1b03cc07", + "result" : "valid" + }, + { + "tcId" : 359, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3137343138373339323133", + "sig" : "304502205f856a30a8803a2276e8e5b8475f085d14f6de0c5f64eaf9e9b81c75fa831672022100a210a74c1c682de5708b9d19e6fd2f74ea047b1352edac7e4784cc008e8b0b5a", + "result" : "valid" + }, + { + "tcId" : 360, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35313237383432323837", + "sig" : "304402201c058daeb17f995cbaa4b02fc1ccf0a121fb7673d7b9b7bbaa2c9d850f9ba74102203e5400acc992698dbe9c41e25547c6ee08c841d6604de457558ee8af11d54446", + "result" : "valid" + }, + { + "tcId" : 361, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35303338363930383739", + "sig" : "304402207a6c6eb198bced25223fed630dbd2956c3799a21389e007efc23a0b3968f8aa502204535354e8fb477d0be4a16f44719d94650ed4607eabe206848ba24322406c1d5", + "result" : "valid" + }, + { + "tcId" : 362, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33383737303432333937", + "sig" : "30460221009d05a43f8dea2c4a3c0838e5987d899e63317a17fa5f609a4baa3764dac9899a022100d7c1833485f0a6914e5633115330a59b2ade5153b01b2a1af0a815f44d7f0aaa", + "result" : "valid" + }, + { + "tcId" : 363, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333231373038313738", + "sig" : "3046022100b262a757ffcb496d880739d1937f139d39cde8e7ed29512a3be51ad470dcf5d9022100eb8dd006680530f27326f1c9c54e5c4300f1bca21bdb17245c485d7b296a2372", + "result" : "valid" + }, + { + "tcId" : 364, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37363637303434323730", + "sig" : "30440220480a6875b7bee4ed80f70206400df10264c38be42b07443c6ff19c0aab580444022078e3fa1c2fe11208c189a39e717b19a51f5172054891c083931861c7919d4745", + "result" : "valid" + }, + { + "tcId" : 365, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31313034373435303432", + "sig" : "3045022100f2be8cc615b14c289e50114ae2473b105447ec8c5311ecc3abcedcbeaeea1983022056ae20cd659370712e06bd6d5936bcaa06169737a062438c7e599bfff0099fb1", + "result" : "valid" + }, + { + "tcId" : 366, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313533383730313534", + "sig" : "3045022100bed38f88fd52bf1cc4b4cc58bdd8a81af894c5a45bd822acf468eee08a68358402201c9f77ab2c821daa896e73b9f6ed4edf72ce62a6c48b5caae6a5ac9edd8d2953", + "result" : "valid" + }, + { + "tcId" : 367, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323631333835303439", + "sig" : "30460221008513ed012ea7a10d2239c209e172edb565b1bfd2cdfd80269f79956a4aab5af2022100a413070c1e974643e5d5fdc56209e1421a254f47fda3312ceda244064efe69ce", + "result" : "valid" + }, + { + "tcId" : 368, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37353538373437363632", + "sig" : "3045022025bc1c38b291a5f60b7b01eec8a5025c69723b183f9090150a7f0ac87464f2f5022100c986a03025cbf9bdfa4e9a0988822dae44c48624bc63a203072c9cb1b813102d", + "result" : "valid" + }, + { + "tcId" : 369, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343939333634313832", + "sig" : "3046022100b721214cff1779b8f407f4b1b2b2c5aa4e49a4a517031ff3d24b5af589b28b96022100e9c53670e94337535dda10a599de0a6da240ea813e8081f9caa6bae59cbd310a", + "result" : "valid" + }, + { + "tcId" : 370, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333639323733393835", + "sig" : "30460221008695064bbd15d76b698e4bb8c0183bc2634a5c2455d6bd2c3f8323a4268edfe0022100c706f66507b52d2c8865e3eb5959267307f51fdb0565c2320132f2ca14123452", + "result" : "valid" + }, + { + "tcId" : 371, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343933383339353635", + "sig" : "3045022100c91aad6b3c086073dafdb7688c6366be9127d9935cbc6e0c14b9f76c9d272c43022073c0f75156531aad36d2d14169c2b66797e8dd31d6f66b8ddb83f7522fba2176", + "result" : "valid" + }, + { + "tcId" : 372, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353334333739393337", + "sig" : "30460221008125832edd19949328b170b1067eafcc17b3b79f5c139dfb6c109a1107ac76c8022100fce7f770e2245eeab16c33a230f6dea2ce1da67d11302a8ce7dc6145c30a2bf9", + "result" : "valid" + }, + { + "tcId" : 373, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383334383031353938", + "sig" : "304402205e399962385aec963cb80dab6b5f5c341ce15e437142f4275ef9c210385348c1022018a8157a0976bb0e349a02134fad0d0286c40a5e43a47b49b5a03653e3ae9e19", + "result" : "valid" + }, + { + "tcId" : 374, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343131303537343836", + "sig" : "3046022100ada147d5937331d037083c0bcda59adb6125485a9ea78ef6884c1432e93e4093022100b5ea223b88f45533826a8b24fc91ed80ae3560543102fed1d82360372988dd74", + "result" : "valid" + }, + { + "tcId" : 375, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373836343638363335", + "sig" : "3046022100ff56b22aca9206d8dba458507804c9f80b94e75d2b61443a1c8d72480d8680b4022100a866f620640511357b7dd3bc0eddcddcc5a59e9162204c1d85f223ec485cdee2", + "result" : "valid" + }, + { + "tcId" : 376, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303534373733373638", + "sig" : "3046022100cf3555d277eb8f6fa629e8ed875df1440352e53f32f9509ceecf222c4197c5de02210084829a1286f98c299ec5c2169a14d0cbf4892a97baca8310279d9b4c98fdef47", + "result" : "valid" + }, + { + "tcId" : 377, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393237303137373338", + "sig" : "3045022100d8dd5094bc40652ddc19d04beeefee8d90fef82628edbc218a9d2de596bb023d02205c0a46804e7de7c741e5be55a7ebba092dc10a4d1691e6a04ac1690b54acf950", + "result" : "valid" + }, + { + "tcId" : 378, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303531333235363334", + "sig" : "3044022025236b00a0a67e12ea781ae53a929e13c37994ddce784f3c0c33402a43b4a6f00220117331e5b39fe2a11f5c8bbfa5bb4fdc3659ac0a0efcd03a94362081a4c0e579", + "result" : "valid" + }, + { + "tcId" : 379, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34303139383636363832", + "sig" : "304402200f3564b771337bc8d494a04e4d0518f26d067d07c31689d5e27b503d3652117a022017144740db21874aa58c0de6a4cadb16c5d9230d4f4607980aabd161d21045ae", + "result" : "valid" + }, + { + "tcId" : 380, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130343530323537333530", + "sig" : "3045022100bff706d27dc3c8c59951c342244e3c3552216b9225898de130c6a5a8f58eef4202200e20cb9bffd20d88fe70e5d1f909051528c55efbadbfd7cdcce67de853f64632", + "result" : "valid" + }, + { + "tcId" : 381, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333236393538353830", + "sig" : "3045022100ec5c12881dae52168aa635c80dcb0031a43e7d1b76ea97231b819051a861a7ff022009149c000d1af12d800225c1ba3587a53e5aabd8a8fe78230b1b4c12ba7df008", + "result" : "valid" + }, + { + "tcId" : 382, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303734363533323431", + "sig" : "3045022100caeda2ff27eef0c71a30c277dda128692e4850e589d07f84046342ddaef9842a022069d422215439150d1da00a0811d2126de5b5c5a85be18fd3c06eb638703e6031", + "result" : "valid" + }, + { + "tcId" : 383, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37373134363833343830", + "sig" : "304402203977465917472d3cb67d6fc8888834f26fa47c8d3a2c8e046f70680e3037a37e0220785adced4f3d400b286ad7eb7bdf0b7c0f46d9e7268db5a34e740166caafd14a", + "result" : "valid" + }, + { + "tcId" : 384, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373933333831333230", + "sig" : "30450220051b252934f1c65f39652a893e9517f049af42259936832cc3f8ff56d7f3cc54022100867bc57a96eb9d8dc3afd6db11b527f19e4ad8c031134ae6ec9b2b6ee092549b", + "result" : "valid" + }, + { + "tcId" : 385, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34383830363235353636", + "sig" : "304402200162ba940a75c7a12574736d45d60bbb2c6ce7739b04429cc72352adea4666c302204c686aaafb4f3615247ff06b97bd76d49b93f65b5f66c93fc2a8a22246536c24", + "result" : "valid" + }, + { + "tcId" : 386, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3439343337363438383537", + "sig" : "3045022100f74e65ddb41c6c01564b3344fcaa8db2b7b73f8fd156e500865a04826c5e4ab002206ec0376675b8c3692f397341269667eadc60696d56d8450ced85a65de9d3cfe1", + "result" : "valid" + }, + { + "tcId" : 387, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373038363839373836", + "sig" : "304502210091f3ccfb87b3667bea8c6bb07d554467fbb9a77685a6523da5cf97dfa710e6b202205559936f9c94c6e4a97c9febbcb2c1a418fbf9f2933dd64def686b3771dc3fa8", + "result" : "valid" + }, + { + "tcId" : 388, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303239383732393531", + "sig" : "304402200afdcdcf68669ecc53b019d7adbe8dc943f453b74451335a631a2a3dd5672f83022077ea833468953e14bd428663eebce4b3cdef41e9821704fb91d1515d20078e92", + "result" : "valid" + }, + { + "tcId" : 389, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303137313930333835", + "sig" : "3046022100a197d8f8fa0cccfa7eccfaea7ca4441bda9789cc3e8d22a1d1b14d6deeb2db2102210088fb12318d60b66b68fe80834172813989c24901e3adbcd4c73860fa9500bc75", + "result" : "valid" + }, + { + "tcId" : 390, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393536333633393339", + "sig" : "304402204b3eeeaf50e9f9bae0bfe64e2776bf2db181ab44c763393136927827f3adb24e0220317abec131eddf2117e27ea2bb4008e8fd0f4a32aa41f74eec7b1659c091fd9c", + "result" : "valid" + }, + { + "tcId" : 391, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35333030373634333530", + "sig" : "30450220464bdc2db7c5a2745a5d8c96a323eb99c175e0f99baa75dbb9c6d29b98facf3b022100d9328ca00ce32934b4ed340a6e15236cb16e5364cc91ef5cd6f675e048985bac", + "result" : "valid" + }, + { + "tcId" : 392, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393334363634383434", + "sig" : "30440220270250c591cb20c7978d9f457104afa7c3484879cfdcf9dc6ac8e785e1fd20a0022009601dc597c123ed7e76bdbe2d146863bddcf357f9217713dfe1afd8f49891b6", + "result" : "valid" + }, + { + "tcId" : 393, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3335353435303535393632", + "sig" : "30440220729a17311a2fbf9f2325117b2cdac18fd6bbe3db4c5a1bd4e4f4f3d8f3d68dc7022048dd0269cb216e2792f3b410a781c9b10e59abdc553aae2a00d4038f44a2849e", + "result" : "valid" + }, + { + "tcId" : 394, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333031373232313038", + "sig" : "304502205228f97e5d0dfb62cec6820029175867d7d63b179db3e8a9e7eecd1ec55e0b90022100dc547d7b7b680b40bcbe0cbf9a2d749787864158af3c0e0f8ef08dfcbbb36f7e", + "result" : "valid" + }, + { + "tcId" : 395, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35363137363931363932", + "sig" : "3045022021f775d3c7f7fe68e84842b30de9fbe4ffbb4f3324b295591e36e4651c14830d022100afa24a4cd163042da5f767e7088e6fa03efe039a477fc13f6c23270cda91519f", + "result" : "valid" + }, + { + "tcId" : 396, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33353831393332353334", + "sig" : "3045022100dabec42e9c44f0c230d36c45956cd4a8250f3665b6f291f700e73d06fe203744022023b687c29e03bc69c5491774588e3c519fa1eafae2ff8ede2ffd4a004e233215", + "result" : "valid" + }, + { + "tcId" : 397, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3135373136363738373434", + "sig" : "30440220381458d6c40c888bf90aef1428bc968caace553f94287e7adaa48943dc55315d02201e0e1f75489a451fc7cc4bca61a0a7330a5b4dc4283df68e21798996d8c69bd4", + "result" : "valid" + }, + { + "tcId" : 398, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313939373833333630", + "sig" : "3045022100e08881dacd7ad6441f80be1d5510b7e29da4c8504d658634f13e5f3cfcf2a16d02203792541548f0d891ddf95ee40b815fc3ac160cbfe8cd948e0786db7cc20b38d2", + "result" : "valid" + }, + { + "tcId" : 399, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373430343735303832", + "sig" : "3046022100a3efb0abc9d76e6601cb23d28b0276293eb8d6f2103d0da7b06a0169db1ea6a4022100c619ab2ba23b20f90bc815d2fd4c345d0381476b164590cd932b40b2263e4054", + "result" : "valid" + }, + { + "tcId" : 400, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343137343336353339", + "sig" : "3044022061746df1d5f3d30403f5281767cb6601172b26564e97c35d4c68fb7426db4ffd02207ca2b0a4fb0d58a119a8df391ad3f2de47cb3b1a8fdf04d6ec235f639fe44080", + "result" : "valid" + }, + { + "tcId" : 401, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31323335363538383839", + "sig" : "3045022100ce48fc4bedd4dabacc68f71c4f5b58414e9b054b445c4781cf6d9b40d335b4b602201e73b8299579684b80801d2fd70d5c6f9a904ab0735b26d27ff44021002c6107", + "result" : "valid" + }, + { + "tcId" : 402, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343239323535343034", + "sig" : "30460221008c936b044cf6dbdbe30cffdeb9eb40b4aa48e697975805dd40455e44fa4d6dfb022100f03bd82bc73dc7a9d518012f9cab5360d6daa06dd0145765b512263b13c3d851", + "result" : "valid" + }, + { + "tcId" : 403, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3531383033303235343636", + "sig" : "304502204bfaa8c78636efe63915dabaaee914deaaf4a06ae473679160eaeca88d5cc1160221008bc24546613e4811facecf605d6b1f79b442c3d8fe458c1c69334cbee31ef532", + "result" : "valid" + }, + { + "tcId" : 404, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343736333938323030", + "sig" : "30440220130fc664eccece7b71a0a9cadc5369fb5bd54ccc53fd2c515e5ef232acd1b96502204372a69ef34ec2b296dbe94c5e8a8881645b9c0f6b6c4270c19b81493eb59421", + "result" : "valid" + }, + { + "tcId" : 405, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39303630303335323132", + "sig" : "304402207b675a89f3165e2ad1f3ac4950898d17e7cd869df4ef58aa54901d51193f91f302203a7ea099d7c2909ff4a5c3c286d9f7739f38b7e44605ea3f515fde117a4519ec", + "result" : "valid" + }, + { + "tcId" : 406, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373536303533303938", + "sig" : "30440220393a056a5ce76dc161daf1a6a77afb72cacb809d4173b9126e636a01cf7ccea102200859e4195124e11e40db391a7bf04f3ecd7dffe2a5629aac9374468fe8f1701b", + "result" : "valid" + }, + { + "tcId" : 407, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34393830383630303338", + "sig" : "304402202d9738a6e36c24a5dcde61ff7fa5ecb1e96e0077a4a183e8953745cb9461e5fa022055abb27fad179d132830f7e5dff0d26a63f0141fe2288b9ff7943c3a482ac124", + "result" : "valid" + }, + { + "tcId" : 408, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33363231383735333335", + "sig" : "30440220460f528bb6f8adb55626c5166c4572a93c3825dd1a695822a81c9e75e37fe8fd02200197c8b83193110f0426a417fae7ec3b99fc669371f1e7debbbd3850f6956c14", + "result" : "valid" + }, + { + "tcId" : 409, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36363433333334373231", + "sig" : "304402202d13939455192c22b1f18f7ca82ad4265ec2c4dbd124ae4a2b0017984512c9e902203d9e4fac784be61e2decb75a1f6768af21873eb49881849b936036b19187a734", + "result" : "valid" + }, + { + "tcId" : 410, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343534393432373832", + "sig" : "30450221008f2523bbd4a2f4d144c0b7f7b5da84ce20d0d4f551cf5e0ad2b0cb06c6a207f0022005e46a85f61e1676def59d819220edcdf421db36efbe00bda7f9e331d56e8ce1", + "result" : "valid" + }, + { + "tcId" : 411, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3230313834343032", + "sig" : "304502204f60878beb2755b35f7152a33e416e16e10f77bca2ad70b09c86eff148ca6fb3022100bcbc6fa18d8ca570b4a9a5f2a8f6ff9db3e3370ffd3e5a7e19880990f6f8e614", + "result" : "valid" + }, + { + "tcId" : 412, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3538313332313733", + "sig" : "30450221009b148c63588ee8f22436a61d52ae8a60c3f35007dde8bb6e31997d99205973b302202015548563168f496c7b115bff541fd71fc926448a4554a15f97c58fdd039015", + "result" : "valid" + }, + { + "tcId" : 413, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31313833383631383131", + "sig" : "304402202b7d769ea682af0be42866cf3ad8865b12d4b37c3708fb2ad0dc5c87eda10154022011d8c48ba6c400f7950f9dfd9ea65617b3765db0e79778bb079fbd7db67b68f8", + "result" : "valid" + }, + { + "tcId" : 414, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393232363032393036", + "sig" : "3045022100bfd3ac436e5c4d42f15fbce06d9859ad82d460d322a8c4c1d06ec318fdff4f510220335bd5d0619a5290c7fce42aaa97ccd52d80528a09a62a4ce8d1e7cf00db7a26", + "result" : "valid" + }, + { + "tcId" : 415, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393735313433323037", + "sig" : "3044022056a5c2c2e803e66c5751fe8fb348822609b167478cad4030e7bf6120fd535bb002207b3fee66768794c0b362f2d40ad64fdf03e0fb0e8a47f2034167aae2ca383c0e", + "result" : "valid" + }, + { + "tcId" : 416, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38333135313136333833", + "sig" : "3044022071bc399e5643a1d8e2afc317e78a2c43d76b6d87f17a5809a7b6d19f922c2e620220057e7615a2c9033ef0d1a3d3020977002395e196d3b8206c9afecfb98abd52d8", + "result" : "valid" + }, + { + "tcId" : 417, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333236333136383132", + "sig" : "30450221008f94bcda036e64783935456289aedcb67232932db1ac2e8ad1ca970b14d47a1a022021a71528f9e8fe6067ca74cc0d8b4b48270aad9ade9db44a98c98182a5e8f208", + "result" : "valid" + }, + { + "tcId" : 418, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34303239363837313336", + "sig" : "30450220277a0c4f34b2749fd58f55a0f373430f3c868bb1f485d477102b3e797cea5560022100bccbec7dc1e2740751b7cb8968e7d388e136d7647a29c6845bcf3759f44bf389", + "result" : "valid" + }, + { + "tcId" : 419, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36333230383831313931", + "sig" : "3045022100934762967efc8c97655cb73d7168d1abb5889e55243dc67c1c5517d6298ce2c3022044c32fb9d2b5e6f9c38226538776538a55eb1bdfbac44e3e1229337415645db6", + "result" : "valid" + }, + { + "tcId" : 420, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35323235333930373830", + "sig" : "30450221008f052802126f222ba3ade9cfedf59fc479a120ed8e59366b1be4f3039480004e02203e14e9209be9dc6d00ed76cddca1c2e5b85f112bffd2779f45f246cb60c319a8", + "result" : "valid" + }, + { + "tcId" : 421, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333439333933363934", + "sig" : "304402204456d6792ff7e4d27517113f309177c26ef3bf6482e131d43f9d8b80e954d61e02204ffbcc50a7a69dfce92a47410f8574f7b0abfc8b4c7f74ac0dc1c1183d393482", + "result" : "valid" + }, + { + "tcId" : 422, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130333937393630373631", + "sig" : "3045022100c0e27a8ad306f4ed4dd77edcefb61a6d8f1a9f6546a9969e794432fcb576cd49022067fdcab3395eebe53dd03b9cadd3eb62d84327de15498b60a60b023fea990436", + "result" : "valid" + }, + { + "tcId" : 423, + "comment" : "Signature generated without truncating the hash", + "flags" : [ + "Untruncatedhash" + ], + "msg" : "313233343030", + "sig" : "30450220504d070e4cf2596e560c1aadc63c573cee0bf8c4d128292c23b47a294c607703022100f181213b28b921af292ea2fbcb8af4a0e14e2c5aa603c45dab7a46f05bbd5d85", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040fbf9d131ff8a037747ac23246c5b0e0ce09a905432d3d75477af2d2993b1e0a4b14e93d4574fc2a553f85eb3c4c0658a1bd7e1cc7f08d47396e76d6d40ed772", + "wx" : "0fbf9d131ff8a037747ac23246c5b0e0ce09a905432d3d75477af2d2993b1e0a", + "wy" : "4b14e93d4574fc2a553f85eb3c4c0658a1bd7e1cc7f08d47396e76d6d40ed772" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040fbf9d131ff8a037747ac23246c5b0e0ce09a905432d3d75477af2d2993b1e0a4b14e93d4574fc2a553f85eb3c4c0658a1bd7e1cc7f08d47396e76d6d40ed772", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAED7+dEx/4oDd0esIyRsWw4M4JqQVD\nLT11R3ry0pk7HgpLFOk9RXT8KlU/hes8TAZYob1+HMfwjUc5bnbW1A7Xcg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 424, + "comment" : "k*G has a large x-coordinate", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "303502104319055358e8617b0c46353d039cdaab022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "valid" + }, + { + "tcId" : 425, + "comment" : "r too large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000fffffffffffffffffffffffc022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04920945522a364975ffc27bdddd7f01ec26ef8ac48d466a81fbb1d02fc89133e9ce7d01190e815daf1d18e5932ec8a3d83af59c7f66738b6521a9850d794a4ba3", + "wx" : "00920945522a364975ffc27bdddd7f01ec26ef8ac48d466a81fbb1d02fc89133e9", + "wy" : "00ce7d01190e815daf1d18e5932ec8a3d83af59c7f66738b6521a9850d794a4ba3" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004920945522a364975ffc27bdddd7f01ec26ef8ac48d466a81fbb1d02fc89133e9ce7d01190e815daf1d18e5932ec8a3d83af59c7f66738b6521a9850d794a4ba3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkglFUio2SXX/wnvd3X8B7CbvisSN\nRmqB+7HQL8iRM+nOfQEZDoFdrx0Y5ZMuyKPYOvWcf2Zzi2UhqYUNeUpLow==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 426, + "comment" : "r,s are large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e0ce6d55dae257d10a06be4fb7333e68475407a401de84ff86a931ac022a4513802ca56c9a1d2f67e8a45703b174f0562dfb7e6a532eb1743b3ceb49f9bea420", + "wx" : "00e0ce6d55dae257d10a06be4fb7333e68475407a401de84ff86a931ac022a4513", + "wy" : "00802ca56c9a1d2f67e8a45703b174f0562dfb7e6a532eb1743b3ceb49f9bea420" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e0ce6d55dae257d10a06be4fb7333e68475407a401de84ff86a931ac022a4513802ca56c9a1d2f67e8a45703b174f0562dfb7e6a532eb1743b3ceb49f9bea420", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4M5tVdriV9EKBr5PtzM+aEdUB6QB\n3oT/hqkxrAIqRROALKVsmh0vZ+ikVwOxdPBWLft+alMusXQ7POtJ+b6kIA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 427, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040c5baefb69764c3a55e9d3ef10a76f652ffa697794ab91169878116d058420e3ccd7b9153694151ee2d05048e40fe072d8e0f481af5d3d0a9e8cf39e1ef7e0bb", + "wx" : "0c5baefb69764c3a55e9d3ef10a76f652ffa697794ab91169878116d058420e3", + "wy" : "00ccd7b9153694151ee2d05048e40fe072d8e0f481af5d3d0a9e8cf39e1ef7e0bb" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040c5baefb69764c3a55e9d3ef10a76f652ffa697794ab91169878116d058420e3ccd7b9153694151ee2d05048e40fe072d8e0f481af5d3d0a9e8cf39e1ef7e0bb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDFuu+2l2TDpV6dPvEKdvZS/6aXeU\nq5EWmHgRbQWEIOPM17kVNpQVHuLQUEjkD+By2OD0ga9dPQqejPOeHvfguw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 428, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022027b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041a4cb39a674bf0bec4be1a5b035ae18634f4b681a330c1f91b42366a0a7c75320b3f8018da54a8d0db30f7c2b3f04dc011a4a1c383221e52187632a565e5795c", + "wx" : "1a4cb39a674bf0bec4be1a5b035ae18634f4b681a330c1f91b42366a0a7c7532", + "wy" : "0b3f8018da54a8d0db30f7c2b3f04dc011a4a1c383221e52187632a565e5795c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041a4cb39a674bf0bec4be1a5b035ae18634f4b681a330c1f91b42366a0a7c75320b3f8018da54a8d0db30f7c2b3f04dc011a4a1c383221e52187632a565e5795c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGkyzmmdL8L7EvhpbA1rhhjT0toGj\nMMH5G0I2agp8dTILP4AY2lSo0Nsw98Kz8E3AEaShw4MiHlIYdjKlZeV5XA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 429, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041cd72095fd856cf29fafb81c25f7ff24dee34eeaeacc0025d512091b1f1e822b427eb3bbb915209e064bfbe1a1798ff6dac8d0add6d753bff4f128fee7e00f89", + "wx" : "1cd72095fd856cf29fafb81c25f7ff24dee34eeaeacc0025d512091b1f1e822b", + "wy" : "427eb3bbb915209e064bfbe1a1798ff6dac8d0add6d753bff4f128fee7e00f89" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041cd72095fd856cf29fafb81c25f7ff24dee34eeaeacc0025d512091b1f1e822b427eb3bbb915209e064bfbe1a1798ff6dac8d0add6d753bff4f128fee7e00f89", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHNcglf2FbPKfr7gcJff/JN7jTurq\nzAAl1RIJGx8egitCfrO7uRUgngZL++GheY/22sjQrdbXU7/08Sj+5+APiQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 430, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04697cd5856c8c347fdfbca4c2cb2fc1be12f1611f190333b80a5cf4e0f7d48dab5d08740936bbc46c90b1da916d5ef39c3d9fb9092f579a43d911472022a7fa90", + "wx" : "697cd5856c8c347fdfbca4c2cb2fc1be12f1611f190333b80a5cf4e0f7d48dab", + "wy" : "5d08740936bbc46c90b1da916d5ef39c3d9fb9092f579a43d911472022a7fa90" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004697cd5856c8c347fdfbca4c2cb2fc1be12f1611f190333b80a5cf4e0f7d48dab5d08740936bbc46c90b1da916d5ef39c3d9fb9092f579a43d911472022a7fa90", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaXzVhWyMNH/fvKTCyy/BvhLxYR8Z\nAzO4Clz04PfUjatdCHQJNrvEbJCx2pFtXvOcPZ+5CS9XmkPZEUcgIqf6kA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 431, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020105", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0469d31ff52dbc0935508755cd48cf3f30f0ea78fb670048983be0ebacf4de1076773c9dce9aa24b783d8688d63547dc987d4650f20c1179e6ae5d4f14f6d55cc1", + "wx" : "69d31ff52dbc0935508755cd48cf3f30f0ea78fb670048983be0ebacf4de1076", + "wy" : "773c9dce9aa24b783d8688d63547dc987d4650f20c1179e6ae5d4f14f6d55cc1" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000469d31ff52dbc0935508755cd48cf3f30f0ea78fb670048983be0ebacf4de1076773c9dce9aa24b783d8688d63547dc987d4650f20c1179e6ae5d4f14f6d55cc1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEadMf9S28CTVQh1XNSM8/MPDqePtn\nAEiYO+DrrPTeEHZ3PJ3OmqJLeD2GiNY1R9yYfUZQ8gwReeauXU8U9tVcwQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 432, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020106", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048742a58dac696325bb9285ca9fefbd9811456e55b5a7c37b87cb6009251a475f02dc5fd4cd5b5fab165e69663c2a0e76745303131eab5962594de66d5f75a25e", + "wx" : "008742a58dac696325bb9285ca9fefbd9811456e55b5a7c37b87cb6009251a475f", + "wy" : "02dc5fd4cd5b5fab165e69663c2a0e76745303131eab5962594de66d5f75a25e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048742a58dac696325bb9285ca9fefbd9811456e55b5a7c37b87cb6009251a475f02dc5fd4cd5b5fab165e69663c2a0e76745303131eab5962594de66d5f75a25e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEh0KljaxpYyW7koXKn++9mBFFblW1\np8N7h8tgCSUaR18C3F/UzVtfqxZeaWY8Kg52dFMDEx6rWWJZTeZtX3WiXg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 433, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040ae130e90dba4a6a03a5b1bae96bd53e43170751a19311d251d06c084723c79c0f76151d6ded09a6ad33cbe1ea098adf92db0d7a793020a7f962b0b0bd9e013e", + "wx" : "0ae130e90dba4a6a03a5b1bae96bd53e43170751a19311d251d06c084723c79c", + "wy" : "0f76151d6ded09a6ad33cbe1ea098adf92db0d7a793020a7f962b0b0bd9e013e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040ae130e90dba4a6a03a5b1bae96bd53e43170751a19311d251d06c084723c79c0f76151d6ded09a6ad33cbe1ea098adf92db0d7a793020a7f962b0b0bd9e013e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECuEw6Q26SmoDpbG66WvVPkMXB1Gh\nkxHSUdBsCEcjx5wPdhUdbe0Jpq0zy+HqCYrfktsNenkwIKf5YrCwvZ4BPg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 434, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0407c0272add144c4b89fe4e96e3bfd2ab765121c8485221bce3b5e4090419a0c7c7899aba984d2fdf78f053c212476e7ec0b38a5ad389ec51d459bc96eebed1ba", + "wx" : "07c0272add144c4b89fe4e96e3bfd2ab765121c8485221bce3b5e4090419a0c7", + "wy" : "00c7899aba984d2fdf78f053c212476e7ec0b38a5ad389ec51d459bc96eebed1ba" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000407c0272add144c4b89fe4e96e3bfd2ab765121c8485221bce3b5e4090419a0c7c7899aba984d2fdf78f053c212476e7ec0b38a5ad389ec51d459bc96eebed1ba", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEB8AnKt0UTEuJ/k6W47/Sq3ZRIchI\nUiG847XkCQQZoMfHiZq6mE0v33jwU8ISR25+wLOKWtOJ7FHUWbyW7r7Rug==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 435, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020106", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c26d838237a552c8b9d00f95cfd30849330fa4e50857b148f01317913423ad9fcd9308496fc1a86bc21b3cd90a6472a8164690ab7728b0545d8a9aecf07df5fa", + "wx" : "00c26d838237a552c8b9d00f95cfd30849330fa4e50857b148f01317913423ad9f", + "wy" : "00cd9308496fc1a86bc21b3cd90a6472a8164690ab7728b0545d8a9aecf07df5fa" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c26d838237a552c8b9d00f95cfd30849330fa4e50857b148f01317913423ad9fcd9308496fc1a86bc21b3cd90a6472a8164690ab7728b0545d8a9aecf07df5fa", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwm2DgjelUsi50A+Vz9MISTMPpOUI\nV7FI8BMXkTQjrZ/NkwhJb8Goa8IbPNkKZHKoFkaQq3cosFRdiprs8H31+g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 436, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020107", + "result" : "valid" + }, + { + "tcId" : 437, + "comment" : "r is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632557020107", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0441d762efd59a622d2b8a6eb6260d4d5a02ec69bf91fce3b0d3a4b00014ab26c90646963fd7309a420cfc400580c3e16fc4e39f51f937843158c2a6c4f24ef27c", + "wx" : "41d762efd59a622d2b8a6eb6260d4d5a02ec69bf91fce3b0d3a4b00014ab26c9", + "wy" : "0646963fd7309a420cfc400580c3e16fc4e39f51f937843158c2a6c4f24ef27c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000441d762efd59a622d2b8a6eb6260d4d5a02ec69bf91fce3b0d3a4b00014ab26c90646963fd7309a420cfc400580c3e16fc4e39f51f937843158c2a6c4f24ef27c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQddi79WaYi0rim62Jg1NWgLsab+R\n/OOw06SwABSrJskGRpY/1zCaQgz8QAWAw+FvxOOfUfk3hDFYwqbE8k7yfA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 438, + "comment" : "s is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020106022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc75fbd8", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042f5c464f48423a87806e88e2e6b4e6f947eea1a5f2c0717897406d97dd3c286561b62e969abf04b840be9587a2a16c0a83ff3bf6812b7257c106a26be2e71d25", + "wx" : "2f5c464f48423a87806e88e2e6b4e6f947eea1a5f2c0717897406d97dd3c2865", + "wy" : "61b62e969abf04b840be9587a2a16c0a83ff3bf6812b7257c106a26be2e71d25" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042f5c464f48423a87806e88e2e6b4e6f947eea1a5f2c0717897406d97dd3c286561b62e969abf04b840be9587a2a16c0a83ff3bf6812b7257c106a26be2e71d25", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEL1xGT0hCOoeAboji5rTm+UfuoaXy\nwHF4l0Btl908KGVhti6Wmr8EuEC+lYeioWwKg/879oErclfBBqJr4ucdJQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 439, + "comment" : "small r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3027020201000221008f1e3c7862c58b16bb76eddbb76eddbb516af4f63f2d74d76e0d28c9bb75ea88", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0427527d9ba351f69285cbd9ba144b9e7c6c957d418c8bf63925fb934ab587d385216a626307e247c3d5bcf489b52ad4c1987973d7d4cc90fb5b1f488d80134656", + "wx" : "27527d9ba351f69285cbd9ba144b9e7c6c957d418c8bf63925fb934ab587d385", + "wy" : "216a626307e247c3d5bcf489b52ad4c1987973d7d4cc90fb5b1f488d80134656" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000427527d9ba351f69285cbd9ba144b9e7c6c957d418c8bf63925fb934ab587d385216a626307e247c3d5bcf489b52ad4c1987973d7d4cc90fb5b1f488d80134656", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJ1J9m6NR9pKFy9m6FEuefGyVfUGM\ni/Y5JfuTSrWH04UhamJjB+JHw9W89Im1KtTBmHlz19TMkPtbH0iNgBNGVg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 440, + "comment" : "smallish r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302c02072d9b4d347952d6022100ef3043e7329581dbb3974497710ab11505ee1c87ff907beebadd195a0ffe6d7a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041bfc106d79112f08439a4ffa4e06261bbab3031ff7ed32568172caaeabae2f90b894ecc8922ace776ed6d1526b7771f2cc43b0e84bac400541619e142319059f", + "wx" : "1bfc106d79112f08439a4ffa4e06261bbab3031ff7ed32568172caaeabae2f90", + "wy" : "00b894ecc8922ace776ed6d1526b7771f2cc43b0e84bac400541619e142319059f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041bfc106d79112f08439a4ffa4e06261bbab3031ff7ed32568172caaeabae2f90b894ecc8922ace776ed6d1526b7771f2cc43b0e84bac400541619e142319059f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEG/wQbXkRLwhDmk/6TgYmG7qzAx/3\n7TJWgXLKrquuL5C4lOzIkirOd27W0VJrd3HyzEOw6EusQAVBYZ4UIxkFnw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 441, + "comment" : "100-bit r and small s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d1033e67e37b32b445580bf4eff0221008b748b74000000008b748b748b748b7466e769ad4a16d3dcd87129b8e91d1b4d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0471e13191229197eefe9224be11217878635056fd8e558b74121036043cb7501709a09bc004ffc98a4051a3fb9798cb9fd5c17919ecab9ff8459a7d561f3058b2", + "wx" : "71e13191229197eefe9224be11217878635056fd8e558b74121036043cb75017", + "wy" : "09a09bc004ffc98a4051a3fb9798cb9fd5c17919ecab9ff8459a7d561f3058b2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000471e13191229197eefe9224be11217878635056fd8e558b74121036043cb7501709a09bc004ffc98a4051a3fb9798cb9fd5c17919ecab9ff8459a7d561f3058b2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEceExkSKRl+7+kiS+ESF4eGNQVv2O\nVYt0EhA2BDy3UBcJoJvABP/JikBRo/uXmMuf1cF5Geyrn/hFmn1WHzBYsg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 442, + "comment" : "small r and 100 bit s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302702020100022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0415b8867217bf4d531a5618509d9cddc6a3ff4fcc55cc94df82d9952b42ae564d7234d5c43238e591501c1fada39a60057fefb46b588d47cbedb529def080fb83", + "wx" : "15b8867217bf4d531a5618509d9cddc6a3ff4fcc55cc94df82d9952b42ae564d", + "wy" : "7234d5c43238e591501c1fada39a60057fefb46b588d47cbedb529def080fb83" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000415b8867217bf4d531a5618509d9cddc6a3ff4fcc55cc94df82d9952b42ae564d7234d5c43238e591501c1fada39a60057fefb46b588d47cbedb529def080fb83", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFbiGche/TVMaVhhQnZzdxqP/T8xV\nzJTfgtmVK0KuVk1yNNXEMjjlkVAcH62jmmAFf++0a1iNR8vttSne8ID7gw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 443, + "comment" : "100-bit r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d062522bbd3ecbe7c39e93e7c25022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e7c1fcc775b8d46770261c413291bc9d913c7785779870eb475f7437da3ee1a016ad8986f7ef63d4237a9c802e5e49471d248e4df64283e77608ee191ec61f3f", + "wx" : "00e7c1fcc775b8d46770261c413291bc9d913c7785779870eb475f7437da3ee1a0", + "wy" : "16ad8986f7ef63d4237a9c802e5e49471d248e4df64283e77608ee191ec61f3f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e7c1fcc775b8d46770261c413291bc9d913c7785779870eb475f7437da3ee1a016ad8986f7ef63d4237a9c802e5e49471d248e4df64283e77608ee191ec61f3f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE58H8x3W41GdwJhxBMpG8nZE8d4V3\nmHDrR190N9o+4aAWrYmG9+9j1CN6nIAuXklHHSSOTfZCg+d2CO4ZHsYfPw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 444, + "comment" : "r and s^-1 are close to n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d50220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e4de4956e823bcd5e6869e25ce155de0ac260bbd1eef4d005f88c9c4d025d2a16eaa99ce6e5f4c68b785594b979f04933c31a97e1362862dc5b86cbf485f4b1d", + "wx" : "00e4de4956e823bcd5e6869e25ce155de0ac260bbd1eef4d005f88c9c4d025d2a1", + "wy" : "6eaa99ce6e5f4c68b785594b979f04933c31a97e1362862dc5b86cbf485f4b1d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e4de4956e823bcd5e6869e25ce155de0ac260bbd1eef4d005f88c9c4d025d2a16eaa99ce6e5f4c68b785594b979f04933c31a97e1362862dc5b86cbf485f4b1d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5N5JVugjvNXmhp4lzhVd4KwmC70e\n700AX4jJxNAl0qFuqpnObl9MaLeFWUuXnwSTPDGpfhNihi3FuGy/SF9LHQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 445, + "comment" : "r and s are 64-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30160209009c44febf31c3594f020900839ed28247c2b06b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048ec4f82d4d7a728053c1aaa73224cefa565c6f458050c25501ca4d7f60bb1f17085fdb2d7afbb08e0a439e04e8a8a2a702953d731175971787d4c84e378ea9b7", + "wx" : "008ec4f82d4d7a728053c1aaa73224cefa565c6f458050c25501ca4d7f60bb1f17", + "wy" : "085fdb2d7afbb08e0a439e04e8a8a2a702953d731175971787d4c84e378ea9b7" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048ec4f82d4d7a728053c1aaa73224cefa565c6f458050c25501ca4d7f60bb1f17085fdb2d7afbb08e0a439e04e8a8a2a702953d731175971787d4c84e378ea9b7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjsT4LU16coBTwaqnMiTO+lZcb0WA\nUMJVAcpNf2C7HxcIX9stevuwjgpDngToqKKnApU9cxF1lxeH1MhON46ptw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 446, + "comment" : "r and s are 100-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "301e020d09df8b682430beef6f5fd7c7cd020d0fd0a62e13778f4222a0d61c8a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b81824d27d30da7d0d71cf9a7a89f4925688d4b414be8fa72cb04d91323e51db0aa7471634de339dd3f9011e088af81ac569fe4473a04597f3ca26124753b53f", + "wx" : "00b81824d27d30da7d0d71cf9a7a89f4925688d4b414be8fa72cb04d91323e51db", + "wy" : "0aa7471634de339dd3f9011e088af81ac569fe4473a04597f3ca26124753b53f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b81824d27d30da7d0d71cf9a7a89f4925688d4b414be8fa72cb04d91323e51db0aa7471634de339dd3f9011e088af81ac569fe4473a04597f3ca26124753b53f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuBgk0n0w2n0Ncc+aeon0klaI1LQU\nvo+nLLBNkTI+UdsKp0cWNN4zndP5AR4IivgaxWn+RHOgRZfzyiYSR1O1Pw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 447, + "comment" : "r and s are 128-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30260211008a598e563a89f526c32ebec8de26367c02110084f633e2042630e99dd0f1e16f7a04bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048e9bd1999133b7ac90cc08926645ae11edd3e636bf66411314f0abd6e381ac02543e1ab4ed25714e4d5f62908730bf3a45cb667afca5157eeafa075646cafceb", + "wx" : "008e9bd1999133b7ac90cc08926645ae11edd3e636bf66411314f0abd6e381ac02", + "wy" : "543e1ab4ed25714e4d5f62908730bf3a45cb667afca5157eeafa075646cafceb" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048e9bd1999133b7ac90cc08926645ae11edd3e636bf66411314f0abd6e381ac02543e1ab4ed25714e4d5f62908730bf3a45cb667afca5157eeafa075646cafceb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjpvRmZEzt6yQzAiSZkWuEe3T5ja/\nZkETFPCr1uOBrAJUPhq07SVxTk1fYpCHML86RctmevylFX7q+gdWRsr86w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 448, + "comment" : "r and s are 160-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cfac11bd4b7aa0a29309767eddd337d302f1f42ccab215171f9622992a671e4a1451102ad100a24e6fb5cb130c69de2a61fa50f2d07a099d73ae96f971593588", + "wx" : "00cfac11bd4b7aa0a29309767eddd337d302f1f42ccab215171f9622992a671e4a", + "wy" : "1451102ad100a24e6fb5cb130c69de2a61fa50f2d07a099d73ae96f971593588" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cfac11bd4b7aa0a29309767eddd337d302f1f42ccab215171f9622992a671e4a1451102ad100a24e6fb5cb130c69de2a61fa50f2d07a099d73ae96f971593588", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEz6wRvUt6oKKTCXZ+3dM30wLx9CzK\nshUXH5YimSpnHkoUURAq0QCiTm+1yxMMad4qYfpQ8tB6CZ1zrpb5cVk1iA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 449, + "comment" : "s == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020101", + "result" : "valid" + }, + { + "tcId" : 450, + "comment" : "s == 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020100", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0417edf3d93090cf77f4d2942c655d693a2fe28c4db390d7298ea8abc1710057e5dc5dbdaabab0ffbbda80ee961bac9ab1596265e6d6416c97253006f1d4a4a4ee", + "wx" : "17edf3d93090cf77f4d2942c655d693a2fe28c4db390d7298ea8abc1710057e5", + "wy" : "00dc5dbdaabab0ffbbda80ee961bac9ab1596265e6d6416c97253006f1d4a4a4ee" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000417edf3d93090cf77f4d2942c655d693a2fe28c4db390d7298ea8abc1710057e5dc5dbdaabab0ffbbda80ee961bac9ab1596265e6d6416c97253006f1d4a4a4ee", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEF+3z2TCQz3f00pQsZV1pOi/ijE2z\nkNcpjqirwXEAV+XcXb2qurD/u9qA7pYbrJqxWWJl5tZBbJclMAbx1KSk7g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 451, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022002f676969f451a8ccafa4c4f09791810e6d632dbd60b1d5540f3284fbe1889b0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04027da56bed7d56a9ac595245887992d05d6d1efc0a98298657aa40a3f603b91c108b18bcfff9c382bf6ae4f924607c3db0f39a0baf2e5319b894e7bbabb1d1b4", + "wx" : "027da56bed7d56a9ac595245887992d05d6d1efc0a98298657aa40a3f603b91c", + "wy" : "108b18bcfff9c382bf6ae4f924607c3db0f39a0baf2e5319b894e7bbabb1d1b4" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004027da56bed7d56a9ac595245887992d05d6d1efc0a98298657aa40a3f603b91c108b18bcfff9c382bf6ae4f924607c3db0f39a0baf2e5319b894e7bbabb1d1b4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAn2la+19VqmsWVJFiHmS0F1tHvwK\nmCmGV6pAo/YDuRwQixi8//nDgr9q5PkkYHw9sPOaC68uUxm4lOe7q7HRtA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 452, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204e260962e33362ef0046126d2d5a4edc6947ab20e19b8ec19cf79e5908b6e628", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a5afda4dcf49a010c4e0afb54745926d69d4b53e6b255ab43f18c8fe7449c8de41f9eabf20bd50fc7592f772684ce221168c41ae7e47731dc1259f46fd0a7f3f", + "wx" : "00a5afda4dcf49a010c4e0afb54745926d69d4b53e6b255ab43f18c8fe7449c8de", + "wy" : "41f9eabf20bd50fc7592f772684ce221168c41ae7e47731dc1259f46fd0a7f3f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a5afda4dcf49a010c4e0afb54745926d69d4b53e6b255ab43f18c8fe7449c8de41f9eabf20bd50fc7592f772684ce221168c41ae7e47731dc1259f46fd0a7f3f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEpa/aTc9JoBDE4K+1R0WSbWnUtT5r\nJVq0PxjI/nRJyN5B+eq/IL1Q/HWS93JoTOIhFoxBrn5Hcx3BJZ9G/Qp/Pw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 453, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220077ed0d8f20f697d8fc591ac64dd5219c7932122b4f9b9ec6441e44a0092cf21", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "047526afc0c4c1be20c6bc819fa2ec37509b4c8d311d57ef07effc374d73766f2c1af54f9434280547ad854c0f96139fd3437b22fa6eb6676849d659055fea2149", + "wx" : "7526afc0c4c1be20c6bc819fa2ec37509b4c8d311d57ef07effc374d73766f2c", + "wy" : "1af54f9434280547ad854c0f96139fd3437b22fa6eb6676849d659055fea2149" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200047526afc0c4c1be20c6bc819fa2ec37509b4c8d311d57ef07effc374d73766f2c1af54f9434280547ad854c0f96139fd3437b22fa6eb6676849d659055fea2149", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdSavwMTBviDGvIGfouw3UJtMjTEd\nV+8H7/w3TXN2bywa9U+UNCgFR62FTA+WE5/TQ3si+m62Z2hJ1lkFX+ohSQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 454, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203e0292a67e181c6c0105ee35e956e78e9bdd033c6e71ae57884039a245e4175f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ce328e614f57f32b46c888cb3302c404dfc831ecc1dfcd3a3dfec7ba0819fe287df4f1de4f31d3ccb6d2e83bfa8113d75537ba6e37177e82384c4d16f8a6ed5b", + "wx" : "00ce328e614f57f32b46c888cb3302c404dfc831ecc1dfcd3a3dfec7ba0819fe28", + "wy" : "7df4f1de4f31d3ccb6d2e83bfa8113d75537ba6e37177e82384c4d16f8a6ed5b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ce328e614f57f32b46c888cb3302c404dfc831ecc1dfcd3a3dfec7ba0819fe287df4f1de4f31d3ccb6d2e83bfa8113d75537ba6e37177e82384c4d16f8a6ed5b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzjKOYU9X8ytGyIjLMwLEBN/IMezB\n3806Pf7HuggZ/ih99PHeTzHTzLbS6Dv6gRPXVTe6bjcXfoI4TE0W+KbtWw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 455, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022013d22b06d6b8f5d97e0c64962b4a3bae30f668ca6217ef5b35d799f159e23ebe", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049da871b379d5ca4252d7683a9087b85fd92c910c29a5e6acffe5baf18b2c6786db7f1ba6367b62556b683e2c396813587f299b459ed98f2fe34c9fc1e29620ce", + "wx" : "009da871b379d5ca4252d7683a9087b85fd92c910c29a5e6acffe5baf18b2c6786", + "wy" : "00db7f1ba6367b62556b683e2c396813587f299b459ed98f2fe34c9fc1e29620ce" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049da871b379d5ca4252d7683a9087b85fd92c910c29a5e6acffe5baf18b2c6786db7f1ba6367b62556b683e2c396813587f299b459ed98f2fe34c9fc1e29620ce", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnahxs3nVykJS12g6kIe4X9kskQwp\npeas/+W68YssZ4bbfxumNntiVWtoPiw5aBNYfymbRZ7Zjy/jTJ/B4pYgzg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 456, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204523ce342e4994bb8968bf6613f60c06c86111f15a3a389309e72cd447d5dd99", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f5f796c6fec37a6e7bd968aac5fdcb444318b2dd93af278f766f730d1eb6972dfff606e22879e2e18de131484310e7f81396bd6e5eb9a92dad82f174f6becadc", + "wx" : "00f5f796c6fec37a6e7bd968aac5fdcb444318b2dd93af278f766f730d1eb6972d", + "wy" : "00fff606e22879e2e18de131484310e7f81396bd6e5eb9a92dad82f174f6becadc" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f5f796c6fec37a6e7bd968aac5fdcb444318b2dd93af278f766f730d1eb6972dfff606e22879e2e18de131484310e7f81396bd6e5eb9a92dad82f174f6becadc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9feWxv7Dem572Wiqxf3LREMYst2T\nryePdm9zDR62ly3/9gbiKHni4Y3hMUhDEOf4E5a9bl65qS2tgvF09r7K3A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 457, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022037d765be3c9c78189ad30edb5097a4db670de11686d01420e37039d4677f4809", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040f9e25bfb59835d1441a0d620a196f2b7bf7dfa44acec89bd44052b49480bfe468d8420f3fc3812fba033a65e2d976ad168a7bfd7d31fd987bd57caaa2715596", + "wx" : "0f9e25bfb59835d1441a0d620a196f2b7bf7dfa44acec89bd44052b49480bfe4", + "wy" : "68d8420f3fc3812fba033a65e2d976ad168a7bfd7d31fd987bd57caaa2715596" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040f9e25bfb59835d1441a0d620a196f2b7bf7dfa44acec89bd44052b49480bfe468d8420f3fc3812fba033a65e2d976ad168a7bfd7d31fd987bd57caaa2715596", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAED54lv7WYNdFEGg1iChlvK3v336RK\nzsib1EBStJSAv+Ro2EIPP8OBL7oDOmXi2XatFop7/X0x/Zh71XyqonFVlg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 458, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022044237823b54e0c74c2bf5f759d9ac5f8cb897d537ffa92effd4f0bb6c9acd860", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048e18d19b8a0b4b158303761e77fe9e16f48871b1545ea18e87e0745e860b0ad8812ec55ed5b88338b00f178ea435b9f07540253d8e6b0f61d1f632dc76e36290", + "wx" : "008e18d19b8a0b4b158303761e77fe9e16f48871b1545ea18e87e0745e860b0ad8", + "wy" : "00812ec55ed5b88338b00f178ea435b9f07540253d8e6b0f61d1f632dc76e36290" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048e18d19b8a0b4b158303761e77fe9e16f48871b1545ea18e87e0745e860b0ad8812ec55ed5b88338b00f178ea435b9f07540253d8e6b0f61d1f632dc76e36290", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjhjRm4oLSxWDA3Yed/6eFvSIcbFU\nXqGOh+B0XoYLCtiBLsVe1biDOLAPF46kNbnwdUAlPY5rD2HR9jLcduNikA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 459, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220266d30a485385906054ca86d46f5f2b17e7f4646a3092092ad92877126538111", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bb8cdc50326f91f60c2d92189119fb4fa71822e42b32f418321c4e18acab753c0987643b6fc34b51e606270a5f48a116e33a0154633f8b48bcf416636ffe3e1d", + "wx" : "00bb8cdc50326f91f60c2d92189119fb4fa71822e42b32f418321c4e18acab753c", + "wy" : "0987643b6fc34b51e606270a5f48a116e33a0154633f8b48bcf416636ffe3e1d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bb8cdc50326f91f60c2d92189119fb4fa71822e42b32f418321c4e18acab753c0987643b6fc34b51e606270a5f48a116e33a0154633f8b48bcf416636ffe3e1d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEu4zcUDJvkfYMLZIYkRn7T6cYIuQr\nMvQYMhxOGKyrdTwJh2Q7b8NLUeYGJwpfSKEW4zoBVGM/i0i89BZjb/4+HQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 460, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220538c7b3798e84d0ce90340165806348971ed44db8f0c674f5f215968390f92ee", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "047bb31c1eb5db2b2e852ffdff6cf1922874019fd4a08fb11a7ad7a7b2d2b998f6b00332ed69bc1ee3e9d014a7828e016ad3d7fbcc9bd8c5605ee35ee4c155c9a0", + "wx" : "7bb31c1eb5db2b2e852ffdff6cf1922874019fd4a08fb11a7ad7a7b2d2b998f6", + "wy" : "00b00332ed69bc1ee3e9d014a7828e016ad3d7fbcc9bd8c5605ee35ee4c155c9a0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200047bb31c1eb5db2b2e852ffdff6cf1922874019fd4a08fb11a7ad7a7b2d2b998f6b00332ed69bc1ee3e9d014a7828e016ad3d7fbcc9bd8c5605ee35ee4c155c9a0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEe7McHrXbKy6FL/3/bPGSKHQBn9Sg\nj7EaetenstK5mPawAzLtabwe4+nQFKeCjgFq09f7zJvYxWBe417kwVXJoA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 461, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206fef0ef15d1688e15e704c4e6bb8bb7f40d52d3af5c661bb78c4ed9b408699b3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04c0d73ae13cd4a0d7f5e6c7e0d04a80e777610dd10dce997b29f30b56c3a8cc48a7843569178892b75825807052423a8f069e3b19b49ef16ad0f9755365bd438f", + "wx" : "00c0d73ae13cd4a0d7f5e6c7e0d04a80e777610dd10dce997b29f30b56c3a8cc48", + "wy" : "00a7843569178892b75825807052423a8f069e3b19b49ef16ad0f9755365bd438f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004c0d73ae13cd4a0d7f5e6c7e0d04a80e777610dd10dce997b29f30b56c3a8cc48a7843569178892b75825807052423a8f069e3b19b49ef16ad0f9755365bd438f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwNc64TzUoNf15sfg0EqA53dhDdEN\nzpl7KfMLVsOozEinhDVpF4iSt1glgHBSQjqPBp47GbSe8WrQ+XVTZb1Djw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 462, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206f44275e9aeb1331efcb8d58f35c0252791427e403ad84daad51d247cc2a64c6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045f5846c6688b584e2ac1a1ce618353b7f02d3238d6b90e6547031670fbc7a60b48bbe517b630ee4cbd0c1fe2eaff0b23e2710c9320c0024198bb31b4347d2034", + "wx" : "5f5846c6688b584e2ac1a1ce618353b7f02d3238d6b90e6547031670fbc7a60b", + "wy" : "48bbe517b630ee4cbd0c1fe2eaff0b23e2710c9320c0024198bb31b4347d2034" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045f5846c6688b584e2ac1a1ce618353b7f02d3238d6b90e6547031670fbc7a60b48bbe517b630ee4cbd0c1fe2eaff0b23e2710c9320c0024198bb31b4347d2034", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEX1hGxmiLWE4qwaHOYYNTt/AtMjjW\nuQ5lRwMWcPvHpgtIu+UXtjDuTL0MH+Lq/wsj4nEMkyDAAkGYuzG0NH0gNA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 463, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022021323755b103d2f9da6ab83eccab9ad8598bcf625652f10e7a3eeee3c3945fb3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040c51eb799d377bacf2bd1ffafe88086129b8079cacccce3f61fb69da0353877c9c656a31f5008a18b32f7bdd7f7697fa4dbef6cf8f02d06b24d08a0b6bab0dfa", + "wx" : "0c51eb799d377bacf2bd1ffafe88086129b8079cacccce3f61fb69da0353877c", + "wy" : "009c656a31f5008a18b32f7bdd7f7697fa4dbef6cf8f02d06b24d08a0b6bab0dfa" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040c51eb799d377bacf2bd1ffafe88086129b8079cacccce3f61fb69da0353877c9c656a31f5008a18b32f7bdd7f7697fa4dbef6cf8f02d06b24d08a0b6bab0dfa", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDFHreZ03e6zyvR/6/ogIYSm4B5ys\nzM4/Yftp2gNTh3ycZWox9QCKGLMve91/dpf6Tb72z48C0Gsk0IoLa6sN+g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 464, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206c50acfe76de1289e7a5edb240f1c2a7879db6873d5d931f3c6ac467a6eac171", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f90cc708939129c66d61eef220921d197600f2c5dafe53a88b673d3ba5cb6efcb12a2944e5344b50a0781797f874e45c44766c91cce89a2fc000b9fee2ba7c21", + "wx" : "00f90cc708939129c66d61eef220921d197600f2c5dafe53a88b673d3ba5cb6efc", + "wy" : "00b12a2944e5344b50a0781797f874e45c44766c91cce89a2fc000b9fee2ba7c21" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f90cc708939129c66d61eef220921d197600f2c5dafe53a88b673d3ba5cb6efcb12a2944e5344b50a0781797f874e45c44766c91cce89a2fc000b9fee2ba7c21", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+QzHCJORKcZtYe7yIJIdGXYA8sXa\n/lOoi2c9O6XLbvyxKilE5TRLUKB4F5f4dORcRHZskczomi/AALn+4rp8IQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 465, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220755b7fffb0b17ad57dca50fcefb7fe297b029df25e5ccb5069e8e70c2742c2a6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ca99e8cacb96b9b73a7ecf478617269f08971c307aba958692381696c244443b5c5df1f740db3016b0ad298997131cea685b2ba405c3b0f722c6992bdaa6fd3a", + "wx" : "00ca99e8cacb96b9b73a7ecf478617269f08971c307aba958692381696c244443b", + "wy" : "5c5df1f740db3016b0ad298997131cea685b2ba405c3b0f722c6992bdaa6fd3a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ca99e8cacb96b9b73a7ecf478617269f08971c307aba958692381696c244443b5c5df1f740db3016b0ad298997131cea685b2ba405c3b0f722c6992bdaa6fd3a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEypnoysuWubc6fs9HhhcmnwiXHDB6\nupWGkjgWlsJERDtcXfH3QNswFrCtKYmXExzqaFsrpAXDsPcixpkr2qb9Og==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 466, + "comment" : "point at infinity during verify", + "flags" : [ + "PointDuplication", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a80220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043c31be015178a9c3d3cae9103bf25bc11a709316d06ab46c01f884a8eb33da2e91f32a1352712508642c4774ea67049175161cb2bafd5524b813274b140f8e99", + "wx" : "3c31be015178a9c3d3cae9103bf25bc11a709316d06ab46c01f884a8eb33da2e", + "wy" : "0091f32a1352712508642c4774ea67049175161cb2bafd5524b813274b140f8e99" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043c31be015178a9c3d3cae9103bf25bc11a709316d06ab46c01f884a8eb33da2e91f32a1352712508642c4774ea67049175161cb2bafd5524b813274b140f8e99", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPDG+AVF4qcPTyukQO/JbwRpwkxbQ\narRsAfiEqOsz2i6R8yoTUnElCGQsR3TqZwSRdRYcsrr9VSS4EydLFA+OmQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 467, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04355d9c3f97a282ac17f7bc98373f271d6a2bc02eb964f13c1e2d7debff4a02fd63282e78fb9b88f81413bcf95f16982d9f50e7f94a5d28685b41da997201db5e", + "wx" : "355d9c3f97a282ac17f7bc98373f271d6a2bc02eb964f13c1e2d7debff4a02fd", + "wy" : "63282e78fb9b88f81413bcf95f16982d9f50e7f94a5d28685b41da997201db5e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004355d9c3f97a282ac17f7bc98373f271d6a2bc02eb964f13c1e2d7debff4a02fd63282e78fb9b88f81413bcf95f16982d9f50e7f94a5d28685b41da997201db5e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENV2cP5eigqwX97yYNz8nHWorwC65\nZPE8Hi196/9KAv1jKC54+5uI+BQTvPlfFpgtn1Dn+UpdKGhbQdqZcgHbXg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 468, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041c959964cabaa5ce966b95acda1c5264847a780426c878d716d73ae6621d3084d3fedfc4f9c3b8cc8bc6539b821ad208ec08d5737aaaf1801d666ddc37e54faf", + "wx" : "1c959964cabaa5ce966b95acda1c5264847a780426c878d716d73ae6621d3084", + "wy" : "00d3fedfc4f9c3b8cc8bc6539b821ad208ec08d5737aaaf1801d666ddc37e54faf" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041c959964cabaa5ce966b95acda1c5264847a780426c878d716d73ae6621d3084d3fedfc4f9c3b8cc8bc6539b821ad208ec08d5737aaaf1801d666ddc37e54faf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHJWZZMq6pc6Wa5Ws2hxSZIR6eAQm\nyHjXFtc65mIdMITT/t/E+cO4zIvGU5uCGtII7AjVc3qq8YAdZm3cN+VPrw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 469, + "comment" : "u1 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220342dae751a63a3ca8189cf342b3b34eaaa2565e2c7e26121c1bfd5435447f1c3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049842a82a83932d5a44daab14afb79968dd24d9ffc58e638586a90b0f25b521dd38b2c05c8d548bcf5ab2a906e2f3fbdde7f0b9bbdecb852297d55ae34257f8f3", + "wx" : "009842a82a83932d5a44daab14afb79968dd24d9ffc58e638586a90b0f25b521dd", + "wy" : "38b2c05c8d548bcf5ab2a906e2f3fbdde7f0b9bbdecb852297d55ae34257f8f3" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049842a82a83932d5a44daab14afb79968dd24d9ffc58e638586a90b0f25b521dd38b2c05c8d548bcf5ab2a906e2f3fbdde7f0b9bbdecb852297d55ae34257f8f3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmEKoKoOTLVpE2qsUr7eZaN0k2f/F\njmOFhqkLDyW1Id04ssBcjVSLz1qyqQbi8/vd5/C5u97LhSKX1VrjQlf48w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 470, + "comment" : "u1 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100cbd25189e59c5c367e7630cbd4c4cb1512c194cadf353d6331f9f57fa81b338e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04987a839ec570964d3a1bfc6a0334e7328c1624677c66b8fef3a5e64d1178ddae5577dfcd0fe00da9e1d8bb8bbd952aaa5bc10ecb14cae4e3f5e28c506bbc3a21", + "wx" : "00987a839ec570964d3a1bfc6a0334e7328c1624677c66b8fef3a5e64d1178ddae", + "wy" : "5577dfcd0fe00da9e1d8bb8bbd952aaa5bc10ecb14cae4e3f5e28c506bbc3a21" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004987a839ec570964d3a1bfc6a0334e7328c1624677c66b8fef3a5e64d1178ddae5577dfcd0fe00da9e1d8bb8bbd952aaa5bc10ecb14cae4e3f5e28c506bbc3a21", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmHqDnsVwlk06G/xqAzTnMowWJGd8\nZrj+86XmTRF43a5Vd9/ND+ANqeHYu4u9lSqqW8EOyxTK5OP14oxQa7w6IQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 471, + "comment" : "u2 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ab6590ad5134f8e1bf4581cf90ca0398ceb92861c2af06928cc0303d9654ca3e1d821f6a357dc173f22a3b77145c057a632bb56f31514e31d6d2ed7fddeade55", + "wx" : "00ab6590ad5134f8e1bf4581cf90ca0398ceb92861c2af06928cc0303d9654ca3e", + "wy" : "1d821f6a357dc173f22a3b77145c057a632bb56f31514e31d6d2ed7fddeade55" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ab6590ad5134f8e1bf4581cf90ca0398ceb92861c2af06928cc0303d9654ca3e1d821f6a357dc173f22a3b77145c057a632bb56f31514e31d6d2ed7fddeade55", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEq2WQrVE0+OG/RYHPkMoDmM65KGHC\nrwaSjMAwPZZUyj4dgh9qNX3Bc/IqO3cUXAV6Yyu1bzFRTjHW0u1/3ereVQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 472, + "comment" : "u2 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cde41230f0cdf732ac76e5f284cb7f46915ed309b48debf245f3ff2f243e9366240da36ca5ad289bdfea83213847b14a73079705eab0a2a28aefc999e5ed1504", + "wx" : "00cde41230f0cdf732ac76e5f284cb7f46915ed309b48debf245f3ff2f243e9366", + "wy" : "240da36ca5ad289bdfea83213847b14a73079705eab0a2a28aefc999e5ed1504" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cde41230f0cdf732ac76e5f284cb7f46915ed309b48debf245f3ff2f243e9366240da36ca5ad289bdfea83213847b14a73079705eab0a2a28aefc999e5ed1504", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzeQSMPDN9zKsduXyhMt/RpFe0wm0\njevyRfP/LyQ+k2YkDaNspa0om9/qgyE4R7FKcweXBeqwoqKK78mZ5e0VBA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 473, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bc0f3a265e2136998083451163be66f8b6a673bf5cb08a0e8dbbce4319af6977", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0436c6faa9f6dca42ea8b0e6d02d36c3941582749251bfa88c35fc8a8e9ad51cdac44ce5f20f36b4ae75cc7291678dbff188cf8c838b8963eeb8b78891795a7364", + "wx" : "36c6faa9f6dca42ea8b0e6d02d36c3941582749251bfa88c35fc8a8e9ad51cda", + "wy" : "00c44ce5f20f36b4ae75cc7291678dbff188cf8c838b8963eeb8b78891795a7364" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000436c6faa9f6dca42ea8b0e6d02d36c3941582749251bfa88c35fc8a8e9ad51cdac44ce5f20f36b4ae75cc7291678dbff188cf8c838b8963eeb8b78891795a7364", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENsb6qfbcpC6osObQLTbDlBWCdJJR\nv6iMNfyKjprVHNrETOXyDza0rnXMcpFnjb/xiM+Mg4uJY+64t4iReVpzZA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 474, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02202a06d743967a1330ca91cc46c9394512cc85b4f1b9355eb7f4bbe53a32b76cf4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04709e58a12b12034173395bf91e68255d90d8a3a1d5875c75f87787d9a85a092980e09b79f43489be726a4253ae6c05adce71bcc65389254923cbfacc0775bff6", + "wx" : "709e58a12b12034173395bf91e68255d90d8a3a1d5875c75f87787d9a85a0929", + "wy" : "0080e09b79f43489be726a4253ae6c05adce71bcc65389254923cbfacc0775bff6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004709e58a12b12034173395bf91e68255d90d8a3a1d5875c75f87787d9a85a092980e09b79f43489be726a4253ae6c05adce71bcc65389254923cbfacc0775bff6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcJ5YoSsSA0FzOVv5HmglXZDYo6HV\nh1x1+HeH2ahaCSmA4Jt59DSJvnJqQlOubAWtznG8xlOJJUkjy/rMB3W/9g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 475, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0221008a457017b290d6edb5455e167b9944f67dc5ba958c7c8108ac56e8596b9bc9a1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0486664a9e09db80dbe3bd0158cc4a64a2cded9c852b455f4443e97cca5569f7cc7454f96b52a27a43a1345b5d340902e147880adaf2fe691c168b4203ba2e1df4", + "wx" : "0086664a9e09db80dbe3bd0158cc4a64a2cded9c852b455f4443e97cca5569f7cc", + "wy" : "7454f96b52a27a43a1345b5d340902e147880adaf2fe691c168b4203ba2e1df4" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000486664a9e09db80dbe3bd0158cc4a64a2cded9c852b455f4443e97cca5569f7cc7454f96b52a27a43a1345b5d340902e147880adaf2fe691c168b4203ba2e1df4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhmZKngnbgNvjvQFYzEpkos3tnIUr\nRV9EQ+l8ylVp98x0VPlrUqJ6Q6E0W100CQLhR4gK2vL+aRwWi0IDui4d9A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 476, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100cbfaf812124638c0b98c18cac3dd8d0848ff921f26aec42a708df7b6a97571c7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04623c668c5dbae406e7b4e8e97b2bba2028586f2e3c31f694d9fe87a3de29f8433ac7eb04891898dd9077432c38cc978049cab7721630ed033095f850ade83e3e", + "wx" : "623c668c5dbae406e7b4e8e97b2bba2028586f2e3c31f694d9fe87a3de29f843", + "wy" : "3ac7eb04891898dd9077432c38cc978049cab7721630ed033095f850ade83e3e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004623c668c5dbae406e7b4e8e97b2bba2028586f2e3c31f694d9fe87a3de29f8433ac7eb04891898dd9077432c38cc978049cab7721630ed033095f850ade83e3e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYjxmjF265AbntOjpeyu6IChYby48\nMfaU2f6Ho94p+EM6x+sEiRiY3ZB3Qyw4zJeAScq3chYw7QMwlfhQreg+Pg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 477, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100af812de3638bfed9c18cac3dd8d087e7350cc7062635266a525bff486363cc91", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b034897e2a74a787e008b14c62882eaee0e6e53a1c8a58f709a54432713c20fd28e07de2ca64b5e215d25d0530d7807df11b98bb39c26a2405388ac0b163fafc", + "wx" : "00b034897e2a74a787e008b14c62882eaee0e6e53a1c8a58f709a54432713c20fd", + "wy" : "28e07de2ca64b5e215d25d0530d7807df11b98bb39c26a2405388ac0b163fafc" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b034897e2a74a787e008b14c62882eaee0e6e53a1c8a58f709a54432713c20fd28e07de2ca64b5e215d25d0530d7807df11b98bb39c26a2405388ac0b163fafc", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsDSJfip0p4fgCLFMYoguruDm5Toc\nilj3CaVEMnE8IP0o4H3iymS14hXSXQUw14B98RuYuznCaiQFOIrAsWP6/A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 478, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02205f025bc7c717fdb28319587bb1a10fcead32935ea552ae4fb0fe33cdca6473d1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0414c4f6210b628edd441651d3cb61a07f7ca87629a9e0add5a4fd92902a20cd255146bebdb22b4d49527ebc90ba6294784ae7ca664724d45a466c9fe8b8699bbf", + "wx" : "14c4f6210b628edd441651d3cb61a07f7ca87629a9e0add5a4fd92902a20cd25", + "wy" : "5146bebdb22b4d49527ebc90ba6294784ae7ca664724d45a466c9fe8b8699bbf" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000414c4f6210b628edd441651d3cb61a07f7ca87629a9e0add5a4fd92902a20cd255146bebdb22b4d49527ebc90ba6294784ae7ca664724d45a466c9fe8b8699bbf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFMT2IQtijt1EFlHTy2Ggf3yodimp\n4K3VpP2SkCogzSVRRr69sitNSVJ+vJC6YpR4SufKZkck1FpGbJ/ouGmbvw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 479, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100de4130d1ed9120b8c3dd8d087e7630cb9a8402519439af08e96b342788c6e84e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b5408eefbdb7480fad4c1735f378c9a1ded28cf476835f27b6fd3b8af5e4c596a60a806e244c63a798baf2fd5a66c6c0d7f77952ba2d74b0fe3652811caac6f0", + "wx" : "00b5408eefbdb7480fad4c1735f378c9a1ded28cf476835f27b6fd3b8af5e4c596", + "wy" : "00a60a806e244c63a798baf2fd5a66c6c0d7f77952ba2d74b0fe3652811caac6f0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b5408eefbdb7480fad4c1735f378c9a1ded28cf476835f27b6fd3b8af5e4c596a60a806e244c63a798baf2fd5a66c6c0d7f77952ba2d74b0fe3652811caac6f0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEtUCO7723SA+tTBc183jJod7SjPR2\ng18ntv07ivXkxZamCoBuJExjp5i68v1aZsbA1/d5UrotdLD+NlKBHKrG8A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 480, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ec618e7b1af40be0d052f5a020388fc6cafb822933c1bffab137885f52e89d3e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04de9e22bc58f4b9c913e7f7c26fcbc5d7f6bdc9fced5f520ac88e8a03290be403746a125844509d79840e35440b312dbfdf4ab8ab0011e7c36bc9e01201b1b0e0", + "wx" : "00de9e22bc58f4b9c913e7f7c26fcbc5d7f6bdc9fced5f520ac88e8a03290be403", + "wy" : "746a125844509d79840e35440b312dbfdf4ab8ab0011e7c36bc9e01201b1b0e0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004de9e22bc58f4b9c913e7f7c26fcbc5d7f6bdc9fced5f520ac88e8a03290be403746a125844509d79840e35440b312dbfdf4ab8ab0011e7c36bc9e01201b1b0e0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3p4ivFj0uckT5/fCb8vF1/a9yfzt\nX1IKyI6KAykL5AN0ahJYRFCdeYQONUQLMS2/30q4qwAR58NryeASAbGw4A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 481, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100d39813c8102fe0f18cbfac4b0fa028e6e48c093c59ea00dc99fad50f2d614a3d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ee3bfd2e1c3d99acd88dbf6fc9a3a8f5686b50a6a3e9215f57e83a81389836a5f8ebff9a3e463d47ec36259fdde694bdbb880b0a09fe9ac649d691646ba624f6", + "wx" : "00ee3bfd2e1c3d99acd88dbf6fc9a3a8f5686b50a6a3e9215f57e83a81389836a5", + "wy" : "00f8ebff9a3e463d47ec36259fdde694bdbb880b0a09fe9ac649d691646ba624f6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ee3bfd2e1c3d99acd88dbf6fc9a3a8f5686b50a6a3e9215f57e83a81389836a5f8ebff9a3e463d47ec36259fdde694bdbb880b0a09fe9ac649d691646ba624f6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7jv9Lhw9mazYjb9vyaOo9WhrUKaj\n6SFfV+g6gTiYNqX46/+aPkY9R+w2JZ/d5pS9u4gLCgn+msZJ1pFka6Yk9g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 482, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100e9fcbcad906698e02d9aba57b3c4e9eefeaf3cec7a980c422fe7f6303fc4a3ab", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043c0c4d0ad0848d1335b12a8919d32fafc5f2b0d5c2f3cf6494b06ba8eb17cb29dd7054095454fdb519279cde10259ec5d9e5e4b5a8c4daca649a150f2dbf21ac", + "wx" : "3c0c4d0ad0848d1335b12a8919d32fafc5f2b0d5c2f3cf6494b06ba8eb17cb29", + "wy" : "00dd7054095454fdb519279cde10259ec5d9e5e4b5a8c4daca649a150f2dbf21ac" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043c0c4d0ad0848d1335b12a8919d32fafc5f2b0d5c2f3cf6494b06ba8eb17cb29dd7054095454fdb519279cde10259ec5d9e5e4b5a8c4daca649a150f2dbf21ac", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPAxNCtCEjRM1sSqJGdMvr8XysNXC\n889klLBrqOsXyyndcFQJVFT9tRknnN4QJZ7F2eXktajE2spkmhUPLb8hrA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 483, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022021f862ec50ef64b3bfbe5d774e20cc838320437725338a3b32fefe3ff159dded", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046cf91440818ea262b9376e23f7b530b9e44edf5bc6db1a67dd60cc722975d62317c19e7d6ebc0cbdc89388242d604ae94ac4ca179ef2cd8bf33fbf738afcb39b", + "wx" : "6cf91440818ea262b9376e23f7b530b9e44edf5bc6db1a67dd60cc722975d623", + "wy" : "17c19e7d6ebc0cbdc89388242d604ae94ac4ca179ef2cd8bf33fbf738afcb39b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046cf91440818ea262b9376e23f7b530b9e44edf5bc6db1a67dd60cc722975d62317c19e7d6ebc0cbdc89388242d604ae94ac4ca179ef2cd8bf33fbf738afcb39b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbPkUQIGOomK5N24j97UwueRO31vG\n2xpn3WDMcil11iMXwZ59brwMvciTiCQtYErpSsTKF57yzYvzP79zivyzmw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 484, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022043f0c5d8a1dec9677f7cbaee9c419907064086ee4a67147665fdfc7fe2b3bbda", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041b5afcf39888d2da7215f36421a85c4217b0ac883bf5957c2d066efd8bc89f18d8fb3b6aca0b3577a883948e016905065a3fdc13d6f433172ee0f16784e52c78", + "wx" : "1b5afcf39888d2da7215f36421a85c4217b0ac883bf5957c2d066efd8bc89f18", + "wy" : "00d8fb3b6aca0b3577a883948e016905065a3fdc13d6f433172ee0f16784e52c78" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041b5afcf39888d2da7215f36421a85c4217b0ac883bf5957c2d066efd8bc89f18d8fb3b6aca0b3577a883948e016905065a3fdc13d6f433172ee0f16784e52c78", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEG1r885iI0tpyFfNkIahcQhewrIg7\n9ZV8LQZu/YvInxjY+ztqygs1d6iDlI4BaQUGWj/cE9b0Mxcu4PFnhOUseA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 485, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022065e928c4f2ce2e1b3f3b1865ea62658a8960ca656f9a9eb198fcfabfd40d99c7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04890d36db646c27c2e6c7bc7fdc3f0cbf66fab36d13279b9ecf6e98457d8cf49207a83cfda8e9d0375404c6cbff66792eef97220239254000b4bf983e6bae26d7", + "wx" : "00890d36db646c27c2e6c7bc7fdc3f0cbf66fab36d13279b9ecf6e98457d8cf492", + "wy" : "07a83cfda8e9d0375404c6cbff66792eef97220239254000b4bf983e6bae26d7" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004890d36db646c27c2e6c7bc7fdc3f0cbf66fab36d13279b9ecf6e98457d8cf49207a83cfda8e9d0375404c6cbff66792eef97220239254000b4bf983e6bae26d7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiQ0222RsJ8Lmx7x/3D8Mv2b6s20T\nJ5uez26YRX2M9JIHqDz9qOnQN1QExsv/Znku75ciAjklQAC0v5g+a64m1w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 486, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100c522b80b59486b775aa2af0b3dcca27b1d565aa199ca0fc6d008598e33ff7779", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042a1571ed0ffe39574d030b406f638bf88eea5b4b50754e93431fe0172fdf2fbcbc77f601dc6dbc88cc2b560e8cca5e738f2c769810b2c8762dab917adfe24535", + "wx" : "2a1571ed0ffe39574d030b406f638bf88eea5b4b50754e93431fe0172fdf2fbc", + "wy" : "00bc77f601dc6dbc88cc2b560e8cca5e738f2c769810b2c8762dab917adfe24535" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042a1571ed0ffe39574d030b406f638bf88eea5b4b50754e93431fe0172fdf2fbcbc77f601dc6dbc88cc2b560e8cca5e738f2c769810b2c8762dab917adfe24535", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKhVx7Q/+OVdNAwtAb2OL+I7qW0tQ\ndU6TQx/gFy/fL7y8d/YB3G28iMwrVg6Myl5zjyx2mBCyyHYtq5F63+JFNQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 487, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04612b4467c8b3b8ecbf5374997ec7db8cab2bda9e431982c49727f3fcefb10b47b9d1ecc026c3665425730128138c4e181c61ec28b38910ca59e5fc496ec31f08", + "wx" : "612b4467c8b3b8ecbf5374997ec7db8cab2bda9e431982c49727f3fcefb10b47", + "wy" : "00b9d1ecc026c3665425730128138c4e181c61ec28b38910ca59e5fc496ec31f08" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004612b4467c8b3b8ecbf5374997ec7db8cab2bda9e431982c49727f3fcefb10b47b9d1ecc026c3665425730128138c4e181c61ec28b38910ca59e5fc496ec31f08", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYStEZ8izuOy/U3SZfsfbjKsr2p5D\nGYLElyfz/O+xC0e50ezAJsNmVCVzASgTjE4YHGHsKLOJEMpZ5fxJbsMfCA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 488, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0434191b6ce8865c2230a514b61e2b2730c94beb072e9de309872aea3743bb3e2722d202fc59984e7421a25e6a82664b5080f72ab28df9c0af4e1e300af11ae9b0", + "wx" : "34191b6ce8865c2230a514b61e2b2730c94beb072e9de309872aea3743bb3e27", + "wy" : "22d202fc59984e7421a25e6a82664b5080f72ab28df9c0af4e1e300af11ae9b0" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000434191b6ce8865c2230a514b61e2b2730c94beb072e9de309872aea3743bb3e2722d202fc59984e7421a25e6a82664b5080f72ab28df9c0af4e1e300af11ae9b0", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENBkbbOiGXCIwpRS2HisnMMlL6wcu\nneMJhyrqN0O7Pici0gL8WZhOdCGiXmqCZktQgPcqso35wK9OHjAK8RrpsA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 489, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d533c620a8fd3d5a8342caba89eadc25907d1e9b6fea48ee8f806aa772f0c80f70e09c022fa1139da32a456ec024949824477bf0bdbf603e8faccd6b205d263c", + "wx" : "00d533c620a8fd3d5a8342caba89eadc25907d1e9b6fea48ee8f806aa772f0c80f", + "wy" : "70e09c022fa1139da32a456ec024949824477bf0bdbf603e8faccd6b205d263c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d533c620a8fd3d5a8342caba89eadc25907d1e9b6fea48ee8f806aa772f0c80f70e09c022fa1139da32a456ec024949824477bf0bdbf603e8faccd6b205d263c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1TPGIKj9PVqDQsq6iercJZB9Hptv\n6kjuj4Bqp3LwyA9w4JwCL6ETnaMqRW7AJJSYJEd78L2/YD6PrM1rIF0mPA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 490, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022066755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0491014bea8705a022972e12b176c96e84c0b61c05eb1c6f8c5c1db731d54d67e29060ef6c764d8d47ed5ebf8f6c23835cb89f8b056cdf7e457f9273b6477ece33", + "wx" : "0091014bea8705a022972e12b176c96e84c0b61c05eb1c6f8c5c1db731d54d67e2", + "wy" : "009060ef6c764d8d47ed5ebf8f6c23835cb89f8b056cdf7e457f9273b6477ece33" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000491014bea8705a022972e12b176c96e84c0b61c05eb1c6f8c5c1db731d54d67e29060ef6c764d8d47ed5ebf8f6c23835cb89f8b056cdf7e457f9273b6477ece33", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkQFL6ocFoCKXLhKxdsluhMC2HAXr\nHG+MXB23MdVNZ+KQYO9sdk2NR+1ev49sI4NcuJ+LBWzffkV/knO2R37OMw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 491, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022055a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04287a7f8edfbb55cbb56d6b7be5b96c410a85a35bc6639661a92bd653e1f59688bbd133a77828493b3e0f867f34acfcac099415399a6b1106a0f9420c06f8bf94", + "wx" : "287a7f8edfbb55cbb56d6b7be5b96c410a85a35bc6639661a92bd653e1f59688", + "wy" : "00bbd133a77828493b3e0f867f34acfcac099415399a6b1106a0f9420c06f8bf94" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004287a7f8edfbb55cbb56d6b7be5b96c410a85a35bc6639661a92bd653e1f59688bbd133a77828493b3e0f867f34acfcac099415399a6b1106a0f9420c06f8bf94", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKHp/jt+7Vcu1bWt75blsQQqFo1vG\nY5ZhqSvWU+H1loi70TOneChJOz4Phn80rPysCZQVOZprEQag+UIMBvi/lA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 492, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0482eca524c9ee8475ec8948721a9409b5090c6c28866d0c12669bd5cb7e685a58066b1e7135946a425ddd228076ea24d131b9bd2eae6b51c8083857628f260b80", + "wx" : "0082eca524c9ee8475ec8948721a9409b5090c6c28866d0c12669bd5cb7e685a58", + "wy" : "066b1e7135946a425ddd228076ea24d131b9bd2eae6b51c8083857628f260b80" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000482eca524c9ee8475ec8948721a9409b5090c6c28866d0c12669bd5cb7e685a58066b1e7135946a425ddd228076ea24d131b9bd2eae6b51c8083857628f260b80", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEguylJMnuhHXsiUhyGpQJtQkMbCiG\nbQwSZpvVy35oWlgGax5xNZRqQl3dIoB26iTRMbm9Lq5rUcgIOFdijyYLgA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 493, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049cc512b58d5b921f91075441b0df61e0381459de703a84523cda31dc18549ff85647dd4bd39f6761a144d81ef39db7bc0dedbcb15bdaf084e3a10fdd10bd906a", + "wx" : "009cc512b58d5b921f91075441b0df61e0381459de703a84523cda31dc18549ff8", + "wy" : "5647dd4bd39f6761a144d81ef39db7bc0dedbcb15bdaf084e3a10fdd10bd906a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049cc512b58d5b921f91075441b0df61e0381459de703a84523cda31dc18549ff85647dd4bd39f6761a144d81ef39db7bc0dedbcb15bdaf084e3a10fdd10bd906a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnMUStY1bkh+RB1RBsN9h4DgUWd5w\nOoRSPNox3BhUn/hWR91L059nYaFE2B7znbe8De28sVva8ITjoQ/dEL2Qag==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 494, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04aa9d33c76ccd011ba23047a420840374b4fa3be480c65263d543baf2ccc6141e5ed3b42ad9527869fae92914b82b952d2c31c8fcc85b4c100983096694285766", + "wx" : "00aa9d33c76ccd011ba23047a420840374b4fa3be480c65263d543baf2ccc6141e", + "wy" : "5ed3b42ad9527869fae92914b82b952d2c31c8fcc85b4c100983096694285766" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004aa9d33c76ccd011ba23047a420840374b4fa3be480c65263d543baf2ccc6141e5ed3b42ad9527869fae92914b82b952d2c31c8fcc85b4c100983096694285766", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqp0zx2zNARuiMEekIIQDdLT6O+SA\nxlJj1UO68szGFB5e07Qq2VJ4afrpKRS4K5UtLDHI/MhbTBAJgwlmlChXZg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 495, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042812996934db1357048a1aacb07cb2a8730fbe530984a7a5166f84748ff63e4ce6e8a80e235e216e1a9e75ba3b3a321af51d2e4524ad3c8be99288463b91155a", + "wx" : "2812996934db1357048a1aacb07cb2a8730fbe530984a7a5166f84748ff63e4c", + "wy" : "00e6e8a80e235e216e1a9e75ba3b3a321af51d2e4524ad3c8be99288463b91155a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042812996934db1357048a1aacb07cb2a8730fbe530984a7a5166f84748ff63e4ce6e8a80e235e216e1a9e75ba3b3a321af51d2e4524ad3c8be99288463b91155a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKBKZaTTbE1cEihqssHyyqHMPvlMJ\nhKelFm+EdI/2Pkzm6KgOI14hbhqedbo7OjIa9R0uRSStPIvpkohGO5EVWg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 496, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048286d34afa1904ae756d73bf02a6b6a9db1eaa1b8351ad713a786dcfb829135bf97922dfe80cd4f0e438a8d842e7666853436d972860f715e622a1e876db4251", + "wx" : "008286d34afa1904ae756d73bf02a6b6a9db1eaa1b8351ad713a786dcfb829135b", + "wy" : "00f97922dfe80cd4f0e438a8d842e7666853436d972860f715e622a1e876db4251" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048286d34afa1904ae756d73bf02a6b6a9db1eaa1b8351ad713a786dcfb829135bf97922dfe80cd4f0e438a8d842e7666853436d972860f715e622a1e876db4251", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgobTSvoZBK51bXO/Aqa2qdseqhuD\nUa1xOnhtz7gpE1v5eSLf6AzU8OQ4qNhC52ZoU0Ntlyhg9xXmIqHodttCUQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 497, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044b7b9990a6c2c5a810107c09ee09cf3388c1a6e82aaa44c378d9886e2508c2e0867e7632fcc312fcfdc01fb6a579ce6aa6285563b1adbb3272f0e122f9de73e3", + "wx" : "4b7b9990a6c2c5a810107c09ee09cf3388c1a6e82aaa44c378d9886e2508c2e0", + "wy" : "00867e7632fcc312fcfdc01fb6a579ce6aa6285563b1adbb3272f0e122f9de73e3" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044b7b9990a6c2c5a810107c09ee09cf3388c1a6e82aaa44c378d9886e2508c2e0867e7632fcc312fcfdc01fb6a579ce6aa6285563b1adbb3272f0e122f9de73e3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAES3uZkKbCxagQEHwJ7gnPM4jBpugq\nqkTDeNmIbiUIwuCGfnYy/MMS/P3AH7alec5qpihVY7GtuzJy8OEi+d5z4w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 498, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04568426540e19be6404e6cb4745fc7a943c0c059d7c7baf3bc4fc782e9aedf2deba7fb20ad12a886c53945d3cdb019afa8b0d58ed307d55f556acf79ec89012d5", + "wx" : "568426540e19be6404e6cb4745fc7a943c0c059d7c7baf3bc4fc782e9aedf2de", + "wy" : "00ba7fb20ad12a886c53945d3cdb019afa8b0d58ed307d55f556acf79ec89012d5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004568426540e19be6404e6cb4745fc7a943c0c059d7c7baf3bc4fc782e9aedf2deba7fb20ad12a886c53945d3cdb019afa8b0d58ed307d55f556acf79ec89012d5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEVoQmVA4ZvmQE5stHRfx6lDwMBZ18\ne687xPx4Lprt8t66f7IK0SqIbFOUXTzbAZr6iw1Y7TB9VfVWrPeeyJAS1Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 499, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02203fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041bebc1a6823107d1263219e36d2ec1957d20b0b450b481c9de46ea9294d48b6672b7a811af9528e61199f4a2a7f30d8685f5a04767b59276e65a732e8f3950a1", + "wx" : "1bebc1a6823107d1263219e36d2ec1957d20b0b450b481c9de46ea9294d48b66", + "wy" : "72b7a811af9528e61199f4a2a7f30d8685f5a04767b59276e65a732e8f3950a1" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041bebc1a6823107d1263219e36d2ec1957d20b0b450b481c9de46ea9294d48b6672b7a811af9528e61199f4a2a7f30d8685f5a04767b59276e65a732e8f3950a1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEG+vBpoIxB9EmMhnjbS7BlX0gsLRQ\ntIHJ3kbqkpTUi2Zyt6gRr5Uo5hGZ9KKn8w2GhfWgR2e1knbmWnMujzlQoQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 500, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02205d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0408a2b7fa625f09106a1a8d98f831e53d918fb330d6c388a7b80df98bb9e9c934478da818b4d94082517fa9635a8aa5be05323de604fcfa97bc3a1a57a5e80c34", + "wx" : "08a2b7fa625f09106a1a8d98f831e53d918fb330d6c388a7b80df98bb9e9c934", + "wy" : "478da818b4d94082517fa9635a8aa5be05323de604fcfa97bc3a1a57a5e80c34" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000408a2b7fa625f09106a1a8d98f831e53d918fb330d6c388a7b80df98bb9e9c934478da818b4d94082517fa9635a8aa5be05323de604fcfa97bc3a1a57a5e80c34", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECKK3+mJfCRBqGo2Y+DHlPZGPszDW\nw4inuA35i7npyTRHjagYtNlAglF/qWNaiqW+BTI95gT8+pe8OhpXpegMNA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 501, + "comment" : "point duplication during verification", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304502206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022100ae36701f241f6073608b5f77d9039a9aec44aa5a12a99227fd2911b001915de2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0408a2b7fa625f09106a1a8d98f831e53d918fb330d6c388a7b80df98bb9e9c934b87257e64b26bf7eae80569ca5755a41facdc21afb03056843c5e5a85a17f3cb", + "wx" : "08a2b7fa625f09106a1a8d98f831e53d918fb330d6c388a7b80df98bb9e9c934", + "wy" : "00b87257e64b26bf7eae80569ca5755a41facdc21afb03056843c5e5a85a17f3cb" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000408a2b7fa625f09106a1a8d98f831e53d918fb330d6c388a7b80df98bb9e9c934b87257e64b26bf7eae80569ca5755a41facdc21afb03056843c5e5a85a17f3cb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECKK3+mJfCRBqGo2Y+DHlPZGPszDW\nw4inuA35i7npyTS4clfmSya/fq6AVpyldVpB+s3CGvsDBWhDxeWoWhfzyw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 502, + "comment" : "duplication bug", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304502206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022100ae36701f241f6073608b5f77d9039a9aec44aa5a12a99227fd2911b001915de2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0469aac6897b0457e54cac25f24590be255d352a20055004e7caa7cbb430b3c90f9113bffe220db9143e38514da0481df67f1717c58aab1a189fb9d4f6e53c3900", + "wx" : "69aac6897b0457e54cac25f24590be255d352a20055004e7caa7cbb430b3c90f", + "wy" : "009113bffe220db9143e38514da0481df67f1717c58aab1a189fb9d4f6e53c3900" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000469aac6897b0457e54cac25f24590be255d352a20055004e7caa7cbb430b3c90f9113bffe220db9143e38514da0481df67f1717c58aab1a189fb9d4f6e53c3900", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaarGiXsEV+VMrCXyRZC+JV01KiAF\nUATnyqfLtDCzyQ+RE7/+Ig25FD44UU2gSB32fxcXxYqrGhifudT25Tw5AA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 503, + "comment" : "point with x-coordinate 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250201010220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04449ff6ddbec4bf9bcc3149b8dfe480f9a677c3b8e203d272f3e0a2cf90a2cea787fcbc0799a9323da3f7fddb4818b89b1d97b32b962e1b3edad2fbed47b58d41", + "wx" : "449ff6ddbec4bf9bcc3149b8dfe480f9a677c3b8e203d272f3e0a2cf90a2cea7", + "wy" : "0087fcbc0799a9323da3f7fddb4818b89b1d97b32b962e1b3edad2fbed47b58d41" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004449ff6ddbec4bf9bcc3149b8dfe480f9a677c3b8e203d272f3e0a2cf90a2cea787fcbc0799a9323da3f7fddb4818b89b1d97b32b962e1b3edad2fbed47b58d41", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERJ/23b7Ev5vMMUm43+SA+aZ3w7ji\nA9Jy8+Ciz5CizqeH/LwHmakyPaP3/dtIGLibHZezK5YuGz7a0vvtR7WNQQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 504, + "comment" : "point with x-coordinate 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022101000000000000000000000000000000000000000000000000000000000000000002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b282b1b5bc00c2bb18f28ce678e1cd48c8ced8335af5d8e4abd3d7a7d3616f563d47a55ddc11e966fde2bd87b028e62fc8133def824e3e00528f2442908fe84c", + "wx" : "00b282b1b5bc00c2bb18f28ce678e1cd48c8ced8335af5d8e4abd3d7a7d3616f56", + "wy" : "3d47a55ddc11e966fde2bd87b028e62fc8133def824e3e00528f2442908fe84c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b282b1b5bc00c2bb18f28ce678e1cd48c8ced8335af5d8e4abd3d7a7d3616f563d47a55ddc11e966fde2bd87b028e62fc8133def824e3e00528f2442908fe84c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsoKxtbwAwrsY8ozmeOHNSMjO2DNa\n9djkq9PXp9Nhb1Y9R6Vd3BHpZv3ivYewKOYvyBM974JOPgBSjyRCkI/oTA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 505, + "comment" : "comparison with point at infinity ", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04facbd6f5e996284a53cb1ca41ffc4eb0a3fd73b73c730194011169b9ada14519c5491ede60614d823b491198df7bc6c6768e064e0e43b7f053ab8f279cd4f4ec", + "wx" : "00facbd6f5e996284a53cb1ca41ffc4eb0a3fd73b73c730194011169b9ada14519", + "wy" : "00c5491ede60614d823b491198df7bc6c6768e064e0e43b7f053ab8f279cd4f4ec" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004facbd6f5e996284a53cb1ca41ffc4eb0a3fd73b73c730194011169b9ada14519c5491ede60614d823b491198df7bc6c6768e064e0e43b7f053ab8f279cd4f4ec", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+svW9emWKEpTyxykH/xOsKP9c7c8\ncwGUARFpua2hRRnFSR7eYGFNgjtJEZjfe8bGdo4GTg5Dt/BTq48nnNT07A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 506, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc476699780220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a011801d52a75f4841e40240da49dda8f38e868b4e6f941f77ca9b86665ad5a74751eabf00fc2a7a863fec366975edbcd4885693022cd755c0d8936e660d61db", + "wx" : "00a011801d52a75f4841e40240da49dda8f38e868b4e6f941f77ca9b86665ad5a7", + "wy" : "4751eabf00fc2a7a863fec366975edbcd4885693022cd755c0d8936e660d61db" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a011801d52a75f4841e40240da49dda8f38e868b4e6f941f77ca9b86665ad5a74751eabf00fc2a7a863fec366975edbcd4885693022cd755c0d8936e660d61db", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoBGAHVKnX0hB5AJA2kndqPOOhotO\nb5Qfd8qbhmZa1adHUeq/APwqeoY/7DZpde281IhWkwIs11XA2JNuZg1h2w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 507, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fdfa5d35e42ef91b1842c9f28aeb6c68bd7732935f748168deb718e66608b980d6f85fa678df3cabb55b5002e63b55d7cae11e89f74940b7990a3b167dfa191b", + "wx" : "00fdfa5d35e42ef91b1842c9f28aeb6c68bd7732935f748168deb718e66608b980", + "wy" : "00d6f85fa678df3cabb55b5002e63b55d7cae11e89f74940b7990a3b167dfa191b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fdfa5d35e42ef91b1842c9f28aeb6c68bd7732935f748168deb718e66608b980d6f85fa678df3cabb55b5002e63b55d7cae11e89f74940b7990a3b167dfa191b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/fpdNeQu+RsYQsnyiutsaL13MpNf\ndIFo3rcY5mYIuYDW+F+meN88q7VbUALmO1XXyuEeifdJQLeZCjsWffoZGw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 508, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040754de71bd21f14f4927bdab77efc57f148b36275c305a86c1d7a0dcfd53bab4989fc99bc725da84197c2f284ecc6030489eda77ef92f8680130622b631af2b3", + "wx" : "0754de71bd21f14f4927bdab77efc57f148b36275c305a86c1d7a0dcfd53bab4", + "wy" : "00989fc99bc725da84197c2f284ecc6030489eda77ef92f8680130622b631af2b3" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040754de71bd21f14f4927bdab77efc57f148b36275c305a86c1d7a0dcfd53bab4989fc99bc725da84197c2f284ecc6030489eda77ef92f8680130622b631af2b3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEB1Tecb0h8U9JJ72rd+/FfxSLNidc\nMFqGwdeg3P1TurSYn8mbxyXahBl8LyhOzGAwSJ7ad++S+GgBMGIrYxrysw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 509, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997802203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048aad84fd5d52afd531f1068fb7a10bb365faefa89975597187470d04a8c9c8b327258e32d19cd58ddfd35bd7ea1f063c77c61b7879451bdd3e8f44cbf40241a2", + "wx" : "008aad84fd5d52afd531f1068fb7a10bb365faefa89975597187470d04a8c9c8b3", + "wy" : "27258e32d19cd58ddfd35bd7ea1f063c77c61b7879451bdd3e8f44cbf40241a2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048aad84fd5d52afd531f1068fb7a10bb365faefa89975597187470d04a8c9c8b327258e32d19cd58ddfd35bd7ea1f063c77c61b7879451bdd3e8f44cbf40241a2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiq2E/V1Sr9Ux8QaPt6ELs2X676iZ\ndVlxh0cNBKjJyLMnJY4y0ZzVjd/TW9fqHwY8d8YbeHlFG90+j0TL9AJBog==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 510, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b4a01ec7b10acff3dace05222fae05c75368a375d8ce1faf4a1b2def1ab715ab61a6642e82ff950f373ace5c0cc298639ab9ae739e4614a93fb1122ee16d922f", + "wx" : "00b4a01ec7b10acff3dace05222fae05c75368a375d8ce1faf4a1b2def1ab715ab", + "wy" : "61a6642e82ff950f373ace5c0cc298639ab9ae739e4614a93fb1122ee16d922f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b4a01ec7b10acff3dace05222fae05c75368a375d8ce1faf4a1b2def1ab715ab61a6642e82ff950f373ace5c0cc298639ab9ae739e4614a93fb1122ee16d922f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEtKAex7EKz/PazgUiL64Fx1Noo3XY\nzh+vShst7xq3FathpmQugv+VDzc6zlwMwphjmrmuc55GFKk/sRIu4W2SLw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 511, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044efc2bef42b11e0929edca3b025f01b1fa37aceef4cd3e8c2d4beab500856af87716828fc1788c881ae39f534c3e270ca869a578210b5dad8a8938691d0c4b73", + "wx" : "4efc2bef42b11e0929edca3b025f01b1fa37aceef4cd3e8c2d4beab500856af8", + "wy" : "7716828fc1788c881ae39f534c3e270ca869a578210b5dad8a8938691d0c4b73" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044efc2bef42b11e0929edca3b025f01b1fa37aceef4cd3e8c2d4beab500856af87716828fc1788c881ae39f534c3e270ca869a578210b5dad8a8938691d0c4b73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETvwr70KxHgkp7co7Al8Bsfo3rO70\nzT6MLUvqtQCFavh3FoKPwXiMiBrjn1NMPicMqGmleCELXa2KiThpHQxLcw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 512, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2960220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044606b9fceecc47babcc78de73ca55672f09930aacd560db0a2967a99ef8a595e612a050025785c0e7c7763db0bb53c48b6ff0ed1dfb6055df90299e295092990", + "wx" : "4606b9fceecc47babcc78de73ca55672f09930aacd560db0a2967a99ef8a595e", + "wy" : "612a050025785c0e7c7763db0bb53c48b6ff0ed1dfb6055df90299e295092990" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044606b9fceecc47babcc78de73ca55672f09930aacd560db0a2967a99ef8a595e612a050025785c0e7c7763db0bb53c48b6ff0ed1dfb6055df90299e295092990", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERga5/O7MR7q8x43nPKVWcvCZMKrN\nVg2wopZ6me+KWV5hKgUAJXhcDnx3Y9sLtTxItv8O0d+2BV35ApnilQkpkA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 513, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b6de6de267720d16bccf71fdbe07ebe5c1149f8cfb2041b1d6cabbc9b6656d682d3e21f4025ddcacab035b5da6310361102079f1b40c1ef7c7b88427694c11c6", + "wx" : "00b6de6de267720d16bccf71fdbe07ebe5c1149f8cfb2041b1d6cabbc9b6656d68", + "wy" : "2d3e21f4025ddcacab035b5da6310361102079f1b40c1ef7c7b88427694c11c6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b6de6de267720d16bccf71fdbe07ebe5c1149f8cfb2041b1d6cabbc9b6656d682d3e21f4025ddcacab035b5da6310361102079f1b40c1ef7c7b88427694c11c6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEtt5t4mdyDRa8z3H9vgfr5cEUn4z7\nIEGx1sq7ybZlbWgtPiH0Al3crKsDW12mMQNhECB58bQMHvfHuIQnaUwRxg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 514, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04efd3bd1299d4b2bb0afbce2afd90792d8c72e1d29c6092e4681540420664e275390a4dbb20d10f7360c5b794564dcd443bb1df94bf6b1f4be5909a22a6a534ba", + "wx" : "00efd3bd1299d4b2bb0afbce2afd90792d8c72e1d29c6092e4681540420664e275", + "wy" : "390a4dbb20d10f7360c5b794564dcd443bb1df94bf6b1f4be5909a22a6a534ba" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004efd3bd1299d4b2bb0afbce2afd90792d8c72e1d29c6092e4681540420664e275390a4dbb20d10f7360c5b794564dcd443bb1df94bf6b1f4be5909a22a6a534ba", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE79O9EpnUsrsK+84q/ZB5LYxy4dKc\nYJLkaBVAQgZk4nU5Ck27INEPc2DFt5RWTc1EO7HflL9rH0vlkJoipqU0ug==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 515, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c29602203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04dae9cf165867da6482ede84bfc5b94375529bcb953f26d0cd68fc877088f78d951cadc9f61c55f8e2a04dbaae1251fd15cb12df9bcd072a51971127eaa6ce612", + "wx" : "00dae9cf165867da6482ede84bfc5b94375529bcb953f26d0cd68fc877088f78d9", + "wy" : "51cadc9f61c55f8e2a04dbaae1251fd15cb12df9bcd072a51971127eaa6ce612" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004dae9cf165867da6482ede84bfc5b94375529bcb953f26d0cd68fc877088f78d951cadc9f61c55f8e2a04dbaae1251fd15cb12df9bcd072a51971127eaa6ce612", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2unPFlhn2mSC7ehL/FuUN1UpvLlT\n8m0M1o/IdwiPeNlRytyfYcVfjioE26rhJR/RXLEt+bzQcqUZcRJ+qmzmEg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 516, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048418924e94161d350c9fe8dc1cc087de4b4491d0bc694a6862df4e8a555f9afbb0b391af97b0dacbdceb7a982781d0090978efbf76b8e6914250e92ade9a6126", + "wx" : "008418924e94161d350c9fe8dc1cc087de4b4491d0bc694a6862df4e8a555f9afb", + "wy" : "00b0b391af97b0dacbdceb7a982781d0090978efbf76b8e6914250e92ade9a6126" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048418924e94161d350c9fe8dc1cc087de4b4491d0bc694a6862df4e8a555f9afbb0b391af97b0dacbdceb7a982781d0090978efbf76b8e6914250e92ade9a6126", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhBiSTpQWHTUMn+jcHMCH3ktEkdC8\naUpoYt9OilVfmvuws5Gvl7Day9zrepgngdAJCXjvv3a45pFCUOkq3pphJg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 517, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "wx" : "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy" : "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 518, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "30440220342dae751a63a3ca8189cf342b3b34eaaa2565e2c7e26121c1bfd5435447f1c30220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + }, + { + "tcId" : 519, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100cbd25189e59c5c367e7630cbd4c4cb1512c194cadf353d6331f9f57fa81b338e0220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "wx" : "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy" : "00b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpawHL0cAeWAZXEYFLWD8GHp1DHMqZTOoTE0Sb+XyECuCg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 520, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "30440220342dae751a63a3ca8189cf342b3b34eaaa2565e2c7e26121c1bfd5435447f1c30220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + }, + { + "tcId" : 521, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100cbd25189e59c5c367e7630cbd4c4cb1512c194cadf353d6331f9f57fa81b338e0220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "wx" : "4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000", + "wy" : "00ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETzN8z9Z3JqgF5PFgCuKEnfOAfsoR\nc4Ajn72BaQAAAADtneoSTMjDlkFkEemIww9CfrUEr0OjFGzV336mBmbWhQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 522, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100ef9a4672e0a07a0efd5936a77f4ea0fcd69dae6fd95ccba8dcb685e7490623c3022100cf135d42f5e379f6ef94b6a493db01c740f441ff5b2475638b6b081f445b17e2", + "result" : "valid" + }, + { + "tcId" : 523, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100b8cb05b278c15df7c6a311b0ce7bb5598fe3a95fdb57683ac0821aa2f5d6fa18022100a9dfa1cc0c9ae0015ae2485f22ed6b0925e82d96ff695b8c2ed593f02719f30e", + "result" : "valid" + }, + { + "tcId" : 524, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502202fe6f2aaed0eb760223e8c580363630d3041614806e7fbc863405aa4d98825ee022100f5d2c396e45d9af9fe1b06b27f0db4d9ee66e1855f4846dae5db6b3d8afbc4f8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "wx" : "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy" : "0084fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTWE+hdNeRxyvyzjiAqJYN0qfHoTOKgvhanlnNvegAAAAA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 525, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100fb9e312ced9f95c91248bae25056b7bbd84a05fc92acbd304269a1269bbf4f4c022100f31426a809ceebb369278a5182bce94835f066cab8654f8bd2339595844244db", + "result" : "valid" + }, + { + "tcId" : 526, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220284fe5f1c86a55fcb3c27a12d82d794eab9a0d76d1fdc4f25df5a9bf52e8e76802207aaa75e5a7948be66f06ce52fc3e4916fc93514b08c51f84b73839d2c05acf58", + "result" : "valid" + }, + { + "tcId" : 527, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100812950449ab90351ab0f124774a2633625d0871d42a69d2e473d8ac118b506a6022050c98878c3699c34f3049e6f9496e3199fb5d860232995205f1761c000af4e07", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "wx" : "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy" : "7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTV7BeixhuONQdMcd/V2nyLVg4XsyFfQelYaYyQhf////w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 528, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100eaa4f3a8805c60cff74cec78c6b7cea71ef116c333612a6e0096a4c42450936b022100fbb3508d6692b8e0854c1a1749ea065262bae7c8b831ece895a1eeda01cebe7d", + "result" : "valid" + }, + { + "tcId" : 529, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502203d0caca44c21d34cfdcfb00098c95203e08847f4aabab5ae6ea7f365aefbbcf8022100bb99be729e51cfd167dad22182383314c9d85432309cbe36f4b1eb73e776b249", + "result" : "valid" + }, + { + "tcId" : 530, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100e4f8b27c3c2c5cb2a6cb9c2049011dd1060085c6e2a15380bcf5224063d3ae0802204b3a19f1be945cd649f34d965e7eecac0a05ac8030b7cd2d6bed84086fda567e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "wx" : "2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff", + "wy" : "00a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKCnDH6ouQA40TtlLyj/NBUWVbrz+\nitD236X/jv////+gGq+vAA5SWFhVr6dnat4oQRMJkFLfV+frO9N+vrkiLg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 531, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220670ce60d0fc7224c8d06f3b01c4416ee0b3ac12f0cff3e1ad214898389ebc819022045da7b6fc8f4f766f82c5132735f2ed94130780b444e2e10c1484d5e45f64332", + "result" : "valid" + }, + { + "tcId" : 532, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100a22928b3022fd554670a86ed519a48d8448dc90856e9c40589076baff591e076022100b4005a89aef027e5063a89709fbc66a05eb12d8d34af84f35ea7ac93f7bbd40e", + "result" : "valid" + }, + { + "tcId" : 533, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100a277181e641edafbdb359801605791c833ff3b462dac3c4d3608d479c98090ff0221008b2ad68880cede2290a996fe5b7003610c5c9f53e1dcf2cdb2ad815e2ba5c1cf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "wx" : "00fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5", + "wy" : "5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE////+UgIHmoEWN2PnnOPJmX/kFmt\naqwHCDGMTKmnpPVairy6LdqEdDEe5UFJuXPK4MD7iVV60L945lKaFmO9cw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 534, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450220760c487841a7214e9850b5569d99fe3ff9dddc41dee7313a780921d8d3657b16022100b99d63e3cc81458801d5fd5926405d33b894e0f96a85c3c4a929a45c828d76d0", + "result" : "valid" + }, + { + "tcId" : 535, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450221009b7e72ac454505017c5377b2c379f31a7a0268b739fca4c97dfe1c9aa4bc548e02201e65cbee69a42ab0a7ae50e9acceaa0971574fb604958876ad6316c39eebdd96", + "result" : "valid" + }, + { + "tcId" : 536, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502204a7e44e4a8a9fee22647923eaee0368b3fa408edaa19b406507309b13e073855022100fd8597585fa0270c8cdf855a7a69a843eb28124ecf90ac53a58a847c7b43c7a6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "wx" : "03fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e", + "wy" : "1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAAAAA/oV+WOUnV8DpvXH+G+eABXu\nsjrrv/EXOTe6dI4QmYcgcOjofFVfoTZZzKXX+tz8sAI+qIlUjKSK8rp+cQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 537, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402204589f0c24d1b2f89c2e806f667297c844c63330d6b9a079b2bdd2d95247e3eae022075daa1da09a3f1ed8de1aacc7039a721c46f9ebcd4672750f2fd9c2f70f1e6ed", + "result" : "valid" + }, + { + "tcId" : 538, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450220377578a81da586eae269f05c9bb2280a517ab3184e02179aca5d64dee1a930c7022100cc1735efd4b43e8bdba8c1b44f9ec3e62577e5f4f6543051467bacd9eaaa4d4a", + "result" : "valid" + }, + { + "tcId" : 539, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502207f722716c279f3d14563fbd8cbf3abcd51c3305795609e04c8ed7ede12ae25180221008a996a370679c3ce6232244d64481e96e47bf6611aa5490000c0b1dffc231aa1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "wx" : "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy" : "1352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BUAAAAAE1K7Sg+i6kzOuatj3WhK3loRJ7zzAKaYpxk7wg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 540, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402202f11d967790dd4387a218929b3fc0f130238ec6fd9321348fe631a1e607bd74202203b52a42606d0daa135092d89ab74b3c4e72b4ed213137406d4b50fa84c4ea049", + "result" : "valid" + }, + { + "tcId" : 541, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220192d299e96272a0c49ed1b15f9047b54b4878eaf350a7b2f5439b1e3c83f9703022026513e9cbbaca7946f3d6d90b5cc65a985cdfe089734f944ab74842a4dc4127d", + "result" : "valid" + }, + { + "tcId" : 542, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100ebd7a6f1450f8bb9e9abf9f66c4143d28c8c845b2e260ab0fff3f7ba5837f9440221009928afe57df6b8c90b7af7c3da981b71db6ae3a5a21a4c5a48b71628e5811a9e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "wx" : "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy" : "00fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BX////+7K1EtvBdFbMxRlScIpe1IqXu2EMM/1lnWObEPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA3-512", + "tests" : [ + { + "tcId" : 543, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3044022037fd00b14ff469a8bb4d2f9c6ca228c4c24b85719389a46099653c41174e9afd02205f64dc68893cf3186df3e83af70e96e9f2103d25b8ddffecda96e8e9181619cf", + "result" : "valid" + }, + { + "tcId" : 544, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502203ce339a63ea4cc1a6b12d1e66b91205e8af530eebe3208359c5327b242b2b669022100f2b1d6dae62bfe9c44b1cbd56cf0de865a1201c0486d658da5fc029ad47b917e", + "result" : "valid" + }, + { + "tcId" : 545, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502207bf225bec33ce7fb4014097e350c1504d3374028cda8f6fbbac4e0fa5319a048022100aaa45d54eba6bb3ce00ce8e63de24dc7ee19069062e8d340663adcac07f097cd", + "result" : "valid" + } + ] + } + ] +} diff --git a/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha512_test.json b/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha512_test.json new file mode 100644 index 0000000000..c168f4be1a --- /dev/null +++ b/packages/crypto/testdata/wycheproof/ecdsa_secp256r1_sha512_test.json @@ -0,0 +1,7206 @@ +{ + "algorithm" : "ECDSA", + "schema" : "ecdsa_verify_schema.json", + "generatorVersion" : "0.9rc5", + "numberOfTests" : 541, + "header" : [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes" : { + "ArithmeticError" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.", + "cves" : [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature" : { + "bugType" : "BER_ENCODING", + "description" : "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect" : "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves" : [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication" : { + "bugType" : "EDGE_CASE", + "description" : "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding" : { + "bugType" : "CAN_OF_WORMS", + "description" : "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature" : { + "bugType" : "AUTH_BYPASS", + "description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.", + "cves" : [ + "CVE-2022-21449" + ] + }, + "MissingZero" : { + "bugType" : "LEGACY", + "description" : "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect" : "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "CVE-2019-0865" + ] + }, + "PointDuplication" : { + "bugType" : "EDGE_CASE", + "description" : "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves" : [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck" : { + "bugType" : "CAN_OF_WORMS", + "description" : "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect" : "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS" : { + "bugType" : "EDGE_CASE", + "description" : "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect" : "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves" : [ + "2020-13895" + ] + }, + "SpecialCaseHash" : { + "bugType" : "EDGE_CASE", + "description" : "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "Untruncatedhash" : { + "bugType" : "MISSING_STEP", + "description" : "If the size of the digest is longer than the size of the underlying order of the multiplicative subgroup then the hash digest must be truncated during signature generation and verification. This test vector contains a signature where this step has been omitted." + }, + "ValidSignature" : { + "bugType" : "BASIC", + "description" : "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups" : [ + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "wx" : "04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5", + "wy" : "0087d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBKrsc2NXJvIT+4qeZNo7hjLkFJWp\nRNAEW1IuunJA+tWH2TFXmKqjpboBd1eHztBeqve04J/IHW0apUboNl1SXQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 1, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "", + "sig" : "30440220093f3825c0cf820cced816a3a67446c85606a6d529e43857643fccc11e1f705f0220769782888c63058630f97a5891c8700e82979e4f233586bfc5042fa73cb70a4e", + "result" : "valid" + }, + { + "tcId" : 2, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "4d7367", + "sig" : "3046022100e8564e3e515a09f9f35258442b99e162d27e10975fcb7963d3c26319dc093f84022100c3af01ed0fd0148749ca323364846c862fc6f4beb682b7ead3b2d89b9da8bad4", + "result" : "valid" + }, + { + "tcId" : 3, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304502201412254f8c1dd2742a00ddee5192e7baa288741026871f3057ad9f983b5ab114022100bcdf878fa156f37040922698ad6fb6928601ddc26c40448ea660e67c25eda090", + "result" : "valid" + }, + { + "tcId" : 4, + "comment" : "pseudorandom signature", + "flags" : [ + "ValidSignature" + ], + "msg" : "0000000000000000000000000000000000000000", + "sig" : "30450221009e0676048381839bb0a4703a0ae38facfe1e2c61bd25950c896aa975cd6ec86902206ea0cedf96f11fff0e746941183492f4d17272c92449afd20e34041a6894ee82", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "wx" : "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838", + "wy" : "00c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKSexBRK64+3c/kZ4KBKLrSkDJpkZ\n9whgacjE32xzKDjHeHlk6qwA5ZIfsUmKYPRgZ2az2WhQAVWNGpdOc0FRPg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 5, + "comment" : "signature malleability", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304402202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c002205f85a63a5be977ad714cea16b10035f07cadf7513ae8cca86f35b7692aafd69f", + "result" : "valid" + }, + { + "tcId" : 6, + "comment" : "Legacy: ASN encoding of s misses leading 0", + "flags" : [ + "MissingZero" + ], + "msg" : "313233343030", + "sig" : "304402202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00220a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 7, + "comment" : "valid", + "flags" : [ + "ValidSignature" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "valid" + }, + { + "tcId" : 8, + "comment" : "length of sequence [r, s] uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30814502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 9, + "comment" : "length of sequence [r, s] contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3082004502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 10, + "comment" : "length of sequence [r, s] uses 70 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304602202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 11, + "comment" : "length of sequence [r, s] uses 68 instead of 69", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304402202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 12, + "comment" : "uint32 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085010000004502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 13, + "comment" : "uint64 overflow in length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308901000000000000004502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 14, + "comment" : "length of sequence [r, s] = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30847fffffff02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 15, + "comment" : "length of sequence [r, s] = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30848000000002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 16, + "comment" : "length of sequence [r, s] = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3084ffffffff02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 17, + "comment" : "length of sequence [r, s] = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3085ffffffffff02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 18, + "comment" : "length of sequence [r, s] = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3088ffffffffffffffff02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 19, + "comment" : "incorrect length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30ff02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 20, + "comment" : "replaced sequence [r, s] by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 21, + "comment" : "removing sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "", + "result" : "invalid" + }, + { + "tcId" : 22, + "comment" : "lonely sequence tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30", + "result" : "invalid" + }, + { + "tcId" : 23, + "comment" : "appending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000", + "result" : "invalid" + }, + { + "tcId" : 24, + "comment" : "prepending 0's to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047000002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 25, + "comment" : "appending unused 0's to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000", + "result" : "invalid" + }, + { + "tcId" : 26, + "comment" : "appending null value to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20500", + "result" : "invalid" + }, + { + "tcId" : 27, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a498177304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 28, + "comment" : "prepending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492500304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 29, + "comment" : "appending garbage to sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 30, + "comment" : "including undefined tags", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304daa00bb00cd00304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 31, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d2228aa00bb00cd0002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 32, + "comment" : "including undefined tags", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c02229aa00bb00cd00022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 33, + "comment" : "truncated length of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3081", + "result" : "invalid" + }, + { + "tcId" : 34, + "comment" : "including undefined tags to sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304baa02aabb304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 35, + "comment" : "using composition with indefinite length for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000", + "result" : "invalid" + }, + { + "tcId" : 36, + "comment" : "using composition with wrong tag for sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3080314502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000", + "result" : "invalid" + }, + { + "tcId" : 37, + "comment" : "Replacing sequence [r, s] with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "0500", + "result" : "invalid" + }, + { + "tcId" : 38, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2e4502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 39, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "2f4502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 40, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "314502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 41, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "324502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 42, + "comment" : "changing tag value of sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "ff4502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 43, + "comment" : "dropping value of sequence [r, s]", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3000", + "result" : "invalid" + }, + { + "tcId" : 44, + "comment" : "using composition for sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30493001023044202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 45, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304402202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34e", + "result" : "invalid" + }, + { + "tcId" : 46, + "comment" : "truncated sequence [r, s]", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3044202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 47, + "comment" : "sequence [r, s] of size 4166 to check for overflows", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3082104602202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 48, + "comment" : "indefinite length", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "308002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000", + "result" : "invalid" + }, + { + "tcId" : 49, + "comment" : "indefinite length with truncated delimiter", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb200", + "result" : "invalid" + }, + { + "tcId" : 50, + "comment" : "indefinite length with additional element", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "308002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb205000000", + "result" : "invalid" + }, + { + "tcId" : 51, + "comment" : "indefinite length with truncated element", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2060811220000", + "result" : "invalid" + }, + { + "tcId" : 52, + "comment" : "indefinite length with garbage", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000fe02beef", + "result" : "invalid" + }, + { + "tcId" : 53, + "comment" : "indefinite length with nonempty EOC", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "308002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20002beef", + "result" : "invalid" + }, + { + "tcId" : 54, + "comment" : "prepend empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047300002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 55, + "comment" : "append empty sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb23000", + "result" : "invalid" + }, + { + "tcId" : 56, + "comment" : "append zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304802202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2020100", + "result" : "invalid" + }, + { + "tcId" : 57, + "comment" : "append garbage with high tag number", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304802202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2bf7f00", + "result" : "invalid" + }, + { + "tcId" : 58, + "comment" : "append null with explicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304902202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2a0020500", + "result" : "invalid" + }, + { + "tcId" : 59, + "comment" : "append null with implicit tag", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2a000", + "result" : "invalid" + }, + { + "tcId" : 60, + "comment" : "sequence of sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3047304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 61, + "comment" : "truncated sequence: removed last 1 elements", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302202202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0", + "result" : "invalid" + }, + { + "tcId" : 62, + "comment" : "repeating element in sequence", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "306802202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 63, + "comment" : "flipped bit 0 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30432478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c1022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 64, + "comment" : "flipped bit 32 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30432478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42a98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 65, + "comment" : "flipped bit 48 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30432478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c67f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 66, + "comment" : "flipped bit 64 in r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30432478f1d049f6d857ac900a7af1772226a4c59b345fbb90603c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 67, + "comment" : "length of r uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "30460281202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 68, + "comment" : "length of r contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "3047028200202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 69, + "comment" : "length of r uses 33 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502212478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 70, + "comment" : "length of r uses 31 instead of 32", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045021f2478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 71, + "comment" : "uint32 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a028501000000202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 72, + "comment" : "uint64 overflow in length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e02890100000000000000202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 73, + "comment" : "length of r = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902847fffffff2478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 74, + "comment" : "length of r = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284800000002478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 75, + "comment" : "length of r = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30490284ffffffff2478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 76, + "comment" : "length of r = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a0285ffffffffff2478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 77, + "comment" : "length of r = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d0288ffffffffffffffff2478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 78, + "comment" : "incorrect length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502ff2478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 79, + "comment" : "replaced r by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502802478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 80, + "comment" : "removing r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3023022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 81, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 82, + "comment" : "lonely integer tag", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302302202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c002", + "result" : "invalid" + }, + { + "tcId" : 83, + "comment" : "appending 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702222478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00000022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 84, + "comment" : "prepending 0's to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3047022200002478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 85, + "comment" : "appending unused 0's to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00000022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 86, + "comment" : "appending null value to r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702222478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00500022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 87, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a222549817702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 88, + "comment" : "prepending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492224250002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 89, + "comment" : "appending garbage to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d222202202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00004deadbeef022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 90, + "comment" : "truncated length of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250281022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 91, + "comment" : "including undefined tags to r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b2226aa02aabb02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 92, + "comment" : "using composition with indefinite length for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049228002202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00000022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 93, + "comment" : "using composition with wrong tag for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3049228003202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00000022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 94, + "comment" : "Replacing r with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30250500022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 95, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304500202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 96, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304501202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 97, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304503202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 98, + "comment" : "changing tag value of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304504202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 99, + "comment" : "changing tag value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "3045ff202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 100, + "comment" : "dropping value of r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30250200022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 101, + "comment" : "using composition for r", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "30492224020124021f78f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 102, + "comment" : "modifying first byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202678f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 103, + "comment" : "modifying last byte of r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f98140022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 104, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044021f2478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 105, + "comment" : "truncated r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3044021f78f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 106, + "comment" : "r of size 4129 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30821048028210212478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 107, + "comment" : "leading ff in r", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "30460221ff2478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 108, + "comment" : "replaced r by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026090180022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 109, + "comment" : "replacing r with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 110, + "comment" : "flipped bit 0 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb3", + "result" : "invalid" + }, + { + "tcId" : 111, + "comment" : "flipped bit 32 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841358d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 112, + "comment" : "flipped bit 48 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84851359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 113, + "comment" : "flipped bit 64 in s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304302202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dd84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 114, + "comment" : "length of s uses long form encoding", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304602202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c002812100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 115, + "comment" : "length of s contains a leading 0", + "flags" : [ + "BerEncodedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00282002100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 116, + "comment" : "length of s uses 34 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022200a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 117, + "comment" : "length of s uses 32 instead of 33", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 118, + "comment" : "uint32 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00285010000002100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 119, + "comment" : "uint64 overflow in length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304e02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0028901000000000000002100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 120, + "comment" : "length of s = 2**31 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c002847fffffff00a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 121, + "comment" : "length of s = 2**31", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c002848000000000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 122, + "comment" : "length of s = 2**32 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00284ffffffff00a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 123, + "comment" : "length of s = 2**40 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00285ffffffffff00a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 124, + "comment" : "length of s = 2**64 - 1", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00288ffffffffffffffff00a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 125, + "comment" : "incorrect length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c002ff00a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 126, + "comment" : "replaced s by an indefinite length tag without termination", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0028000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 127, + "comment" : "appending 0's to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022300a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000", + "result" : "invalid" + }, + { + "tcId" : 128, + "comment" : "prepending 0's to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00223000000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 129, + "comment" : "appending null value to s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304702202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022300a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20500", + "result" : "invalid" + }, + { + "tcId" : 130, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304a02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c02226498177022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 131, + "comment" : "prepending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c022252500022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 132, + "comment" : "appending garbage to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304d02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c02223022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20004deadbeef", + "result" : "invalid" + }, + { + "tcId" : 133, + "comment" : "truncated length of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00281", + "result" : "invalid" + }, + { + "tcId" : 134, + "comment" : "including undefined tags to s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304b02202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c02227aa02aabb022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 135, + "comment" : "using composition with indefinite length for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c02280022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000", + "result" : "invalid" + }, + { + "tcId" : 136, + "comment" : "using composition with wrong tag for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c02280032100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000", + "result" : "invalid" + }, + { + "tcId" : 137, + "comment" : "Replacing s with NULL", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302402202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00500", + "result" : "invalid" + }, + { + "tcId" : 138, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0002100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 139, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0012100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 140, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0032100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 141, + "comment" : "changing tag value of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0042100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 142, + "comment" : "changing tag value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0ff2100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 143, + "comment" : "dropping value of s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "302402202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00200", + "result" : "invalid" + }, + { + "tcId" : 144, + "comment" : "using composition for s", + "flags" : [ + "InvalidEncoding" + ], + "msg" : "313233343030", + "sig" : "304902202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c022250201000220a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 145, + "comment" : "modifying first byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022102a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 146, + "comment" : "modifying last byte of s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34e32", + "result" : "invalid" + }, + { + "tcId" : 147, + "comment" : "truncated s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304402202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34e", + "result" : "invalid" + }, + { + "tcId" : 148, + "comment" : "s of size 4130 to check for overflows", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "3082104802202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00282102200a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 149, + "comment" : "leading ff in s", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "304602202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c00222ff00a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 150, + "comment" : "replaced s by infinity", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0090180", + "result" : "invalid" + }, + { + "tcId" : 151, + "comment" : "replacing s with zero", + "flags" : [ + "ModifiedSignature" + ], + "msg" : "313233343030", + "sig" : "302502202478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0020100", + "result" : "invalid" + }, + { + "tcId" : 152, + "comment" : "replaced r by r + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460221012478f1cf49f6d858ac900a7af177222661ac95e206d32ee63020beee955ca711022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 153, + "comment" : "replaced r by r - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30460221ff2478f1d149f6d856ac900a7af1772226e7dea086b8a3f1dc48ad29689c965c6f022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 154, + "comment" : "replaced r by r + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3047022201002478f0d049f6d957ac900a7af17721e38bc048db775a1554f631b727fc1ed2c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 155, + "comment" : "replaced r by -r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30450220db870e2fb60927a8536ff5850e88ddd95b3a64cba0446f9ec3990bd467067e40022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 156, + "comment" : "replaced r by n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "3046022100db870e2eb60927a9536ff5850e88ddd918215f79475c0e23b752d6976369a391022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 157, + "comment" : "replaced r by -n - r", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fedb870e30b60927a7536ff5850e88ddd99e536a1df92cd119cfdf41116aa358ef022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 158, + "comment" : "replaced r by r + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30460221012478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 159, + "comment" : "replaced r by r + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e02290100000000000000002478f1d049f6d857ac900a7af1772226a4c59b345fbb90613c66f42b98f981c0022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 160, + "comment" : "replaced s by s + n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "3046022101a07a59c3a41688548eb315e94effca0efd1ffe0a13467061783dde1cce167403022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 161, + "comment" : "replaced s by s - n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "30450220a07a59c5a41688528eb315e94effca0f835208aec517335790ca4896d5502961022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 162, + "comment" : "replaced s by s + 256 * n", + "flags" : [ + "RangeCheck" + ], + "msg" : "313233343030", + "sig" : "304702220100a07a58c4a41689538eb315e94effc9cc2733b10383cd56d03e4ed65634d89fb2022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 163, + "comment" : "replaced s by -s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221ff5f85a63b5be977ac714cea16b10035f0bfc6fca393d12e237b7beca62e4cb14e022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 164, + "comment" : "replaced s by -n - s", + "flags" : [ + "ModifiedInteger" + ], + "msg" : "313233343030", + "sig" : "30460221fe5f85a63c5be977ab714cea16b10035f102e001f5ecb98f9e87c221e331e98bfd022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 165, + "comment" : "replaced s by s + 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "3046022101a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 166, + "comment" : "replaced s by s - 2**256", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "30450220a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 167, + "comment" : "replaced s by s + 2**320", + "flags" : [ + "IntegerOverflow" + ], + "msg" : "313233343030", + "sig" : "304e0229010000000000000000a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2022100a07a59c4a41688538eb315e94effca0f4039035c6c2ed1dc84841359d1b34eb2", + "result" : "invalid" + }, + { + "tcId" : 168, + "comment" : "Signature with special case values r=0 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020100", + "result" : "invalid" + }, + { + "tcId" : 169, + "comment" : "Signature with special case values r=0 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100020101", + "result" : "invalid" + }, + { + "tcId" : 170, + "comment" : "Signature with special case values r=0 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000201ff", + "result" : "invalid" + }, + { + "tcId" : 171, + "comment" : "Signature with special case values r=0 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 172, + "comment" : "Signature with special case values r=0 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 173, + "comment" : "Signature with special case values r=0 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 174, + "comment" : "Signature with special case values r=0 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 175, + "comment" : "Signature with special case values r=0 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020100022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 176, + "comment" : "Signature with special case values r=1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020100", + "result" : "invalid" + }, + { + "tcId" : 177, + "comment" : "Signature with special case values r=1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101020101", + "result" : "invalid" + }, + { + "tcId" : 178, + "comment" : "Signature with special case values r=1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010201ff", + "result" : "invalid" + }, + { + "tcId" : 179, + "comment" : "Signature with special case values r=1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 180, + "comment" : "Signature with special case values r=1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 181, + "comment" : "Signature with special case values r=1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 182, + "comment" : "Signature with special case values r=1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 183, + "comment" : "Signature with special case values r=1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026020101022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 184, + "comment" : "Signature with special case values r=-1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020100", + "result" : "invalid" + }, + { + "tcId" : 185, + "comment" : "Signature with special case values r=-1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff020101", + "result" : "invalid" + }, + { + "tcId" : 186, + "comment" : "Signature with special case values r=-1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0201ff", + "result" : "invalid" + }, + { + "tcId" : 187, + "comment" : "Signature with special case values r=-1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 188, + "comment" : "Signature with special case values r=-1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 189, + "comment" : "Signature with special case values r=-1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 190, + "comment" : "Signature with special case values r=-1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 191, + "comment" : "Signature with special case values r=-1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "30260201ff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 192, + "comment" : "Signature with special case values r=n and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020100", + "result" : "invalid" + }, + { + "tcId" : 193, + "comment" : "Signature with special case values r=n and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020101", + "result" : "invalid" + }, + { + "tcId" : 194, + "comment" : "Signature with special case values r=n and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510201ff", + "result" : "invalid" + }, + { + "tcId" : 195, + "comment" : "Signature with special case values r=n and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 196, + "comment" : "Signature with special case values r=n and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 197, + "comment" : "Signature with special case values r=n and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 198, + "comment" : "Signature with special case values r=n and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 199, + "comment" : "Signature with special case values r=n and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 200, + "comment" : "Signature with special case values r=n - 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020100", + "result" : "invalid" + }, + { + "tcId" : 201, + "comment" : "Signature with special case values r=n - 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020101", + "result" : "invalid" + }, + { + "tcId" : 202, + "comment" : "Signature with special case values r=n - 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325500201ff", + "result" : "invalid" + }, + { + "tcId" : 203, + "comment" : "Signature with special case values r=n - 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 204, + "comment" : "Signature with special case values r=n - 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 205, + "comment" : "Signature with special case values r=n - 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 206, + "comment" : "Signature with special case values r=n - 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 207, + "comment" : "Signature with special case values r=n - 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 208, + "comment" : "Signature with special case values r=n + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020100", + "result" : "invalid" + }, + { + "tcId" : 209, + "comment" : "Signature with special case values r=n + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020101", + "result" : "invalid" + }, + { + "tcId" : 210, + "comment" : "Signature with special case values r=n + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325520201ff", + "result" : "invalid" + }, + { + "tcId" : 211, + "comment" : "Signature with special case values r=n + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 212, + "comment" : "Signature with special case values r=n + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 213, + "comment" : "Signature with special case values r=n + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 214, + "comment" : "Signature with special case values r=n + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 215, + "comment" : "Signature with special case values r=n + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 216, + "comment" : "Signature with special case values r=p and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020100", + "result" : "invalid" + }, + { + "tcId" : 217, + "comment" : "Signature with special case values r=p and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020101", + "result" : "invalid" + }, + { + "tcId" : 218, + "comment" : "Signature with special case values r=p and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0201ff", + "result" : "invalid" + }, + { + "tcId" : 219, + "comment" : "Signature with special case values r=p and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 220, + "comment" : "Signature with special case values r=p and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 221, + "comment" : "Signature with special case values r=p and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 222, + "comment" : "Signature with special case values r=p and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 223, + "comment" : "Signature with special case values r=p and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 224, + "comment" : "Signature with special case values r=p + 1 and s=0", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020100", + "result" : "invalid" + }, + { + "tcId" : 225, + "comment" : "Signature with special case values r=p + 1 and s=1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020101", + "result" : "invalid" + }, + { + "tcId" : 226, + "comment" : "Signature with special case values r=p + 1 and s=-1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff000000010000000000000000000000010000000000000000000000000201ff", + "result" : "invalid" + }, + { + "tcId" : 227, + "comment" : "Signature with special case values r=p + 1 and s=n", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result" : "invalid" + }, + { + "tcId" : 228, + "comment" : "Signature with special case values r=p + 1 and s=n - 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result" : "invalid" + }, + { + "tcId" : 229, + "comment" : "Signature with special case values r=p + 1 and s=n + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result" : "invalid" + }, + { + "tcId" : 230, + "comment" : "Signature with special case values r=p + 1 and s=p", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result" : "invalid" + }, + { + "tcId" : 231, + "comment" : "Signature with special case values r=p + 1 and s=p + 1", + "flags" : [ + "InvalidSignature" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result" : "invalid" + }, + { + "tcId" : 232, + "comment" : "Signature encoding contains incorrect types: r=0, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020100090380fe01", + "result" : "invalid" + }, + { + "tcId" : 233, + "comment" : "Signature encoding contains incorrect types: r=0, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100090142", + "result" : "invalid" + }, + { + "tcId" : 234, + "comment" : "Signature encoding contains incorrect types: r=0, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010101", + "result" : "invalid" + }, + { + "tcId" : 235, + "comment" : "Signature encoding contains incorrect types: r=0, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020100010100", + "result" : "invalid" + }, + { + "tcId" : 236, + "comment" : "Signature encoding contains incorrect types: r=0, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000500", + "result" : "invalid" + }, + { + "tcId" : 237, + "comment" : "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201000c00", + "result" : "invalid" + }, + { + "tcId" : 238, + "comment" : "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201000c0130", + "result" : "invalid" + }, + { + "tcId" : 239, + "comment" : "Signature encoding contains incorrect types: r=0, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201003000", + "result" : "invalid" + }, + { + "tcId" : 240, + "comment" : "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201003003020100", + "result" : "invalid" + }, + { + "tcId" : 241, + "comment" : "Signature encoding contains incorrect types: r=1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008020101090380fe01", + "result" : "invalid" + }, + { + "tcId" : 242, + "comment" : "Signature encoding contains incorrect types: r=1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101090142", + "result" : "invalid" + }, + { + "tcId" : 243, + "comment" : "Signature encoding contains incorrect types: r=1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010101", + "result" : "invalid" + }, + { + "tcId" : 244, + "comment" : "Signature encoding contains incorrect types: r=1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006020101010100", + "result" : "invalid" + }, + { + "tcId" : 245, + "comment" : "Signature encoding contains incorrect types: r=1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010500", + "result" : "invalid" + }, + { + "tcId" : 246, + "comment" : "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201010c00", + "result" : "invalid" + }, + { + "tcId" : 247, + "comment" : "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201010c0130", + "result" : "invalid" + }, + { + "tcId" : 248, + "comment" : "Signature encoding contains incorrect types: r=1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201013000", + "result" : "invalid" + }, + { + "tcId" : 249, + "comment" : "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201013003020100", + "result" : "invalid" + }, + { + "tcId" : 250, + "comment" : "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 251, + "comment" : "Signature encoding contains incorrect types: r=-1, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff090142", + "result" : "invalid" + }, + { + "tcId" : 252, + "comment" : "Signature encoding contains incorrect types: r=-1, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010101", + "result" : "invalid" + }, + { + "tcId" : 253, + "comment" : "Signature encoding contains incorrect types: r=-1, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff010100", + "result" : "invalid" + }, + { + "tcId" : 254, + "comment" : "Signature encoding contains incorrect types: r=-1, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0500", + "result" : "invalid" + }, + { + "tcId" : 255, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff0c00", + "result" : "invalid" + }, + { + "tcId" : 256, + "comment" : "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060201ff0c0130", + "result" : "invalid" + }, + { + "tcId" : 257, + "comment" : "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050201ff3000", + "result" : "invalid" + }, + { + "tcId" : 258, + "comment" : "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30080201ff3003020100", + "result" : "invalid" + }, + { + "tcId" : 259, + "comment" : "Signature encoding contains incorrect types: r=n, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090380fe01", + "result" : "invalid" + }, + { + "tcId" : 260, + "comment" : "Signature encoding contains incorrect types: r=n, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090142", + "result" : "invalid" + }, + { + "tcId" : 261, + "comment" : "Signature encoding contains incorrect types: r=n, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010101", + "result" : "invalid" + }, + { + "tcId" : 262, + "comment" : "Signature encoding contains incorrect types: r=n, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010100", + "result" : "invalid" + }, + { + "tcId" : 263, + "comment" : "Signature encoding contains incorrect types: r=n, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510500", + "result" : "invalid" + }, + { + "tcId" : 264, + "comment" : "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c00", + "result" : "invalid" + }, + { + "tcId" : 265, + "comment" : "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c0130", + "result" : "invalid" + }, + { + "tcId" : 266, + "comment" : "Signature encoding contains incorrect types: r=n, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513000", + "result" : "invalid" + }, + { + "tcId" : 267, + "comment" : "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513003020100", + "result" : "invalid" + }, + { + "tcId" : 268, + "comment" : "Signature encoding contains incorrect types: r=p, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090380fe01", + "result" : "invalid" + }, + { + "tcId" : 269, + "comment" : "Signature encoding contains incorrect types: r=p, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090142", + "result" : "invalid" + }, + { + "tcId" : 270, + "comment" : "Signature encoding contains incorrect types: r=p, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010101", + "result" : "invalid" + }, + { + "tcId" : 271, + "comment" : "Signature encoding contains incorrect types: r=p, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010100", + "result" : "invalid" + }, + { + "tcId" : 272, + "comment" : "Signature encoding contains incorrect types: r=p, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0500", + "result" : "invalid" + }, + { + "tcId" : 273, + "comment" : "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c00", + "result" : "invalid" + }, + { + "tcId" : 274, + "comment" : "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c0130", + "result" : "invalid" + }, + { + "tcId" : 275, + "comment" : "Signature encoding contains incorrect types: r=p, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3000", + "result" : "invalid" + }, + { + "tcId" : 276, + "comment" : "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3003020100", + "result" : "invalid" + }, + { + "tcId" : 277, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a090380fe01090380fe01", + "result" : "invalid" + }, + { + "tcId" : 278, + "comment" : "Signature encoding contains incorrect types: r=nan, s=nan", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142090142", + "result" : "invalid" + }, + { + "tcId" : 279, + "comment" : "Signature encoding contains incorrect types: r=True, s=True", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101010101", + "result" : "invalid" + }, + { + "tcId" : 280, + "comment" : "Signature encoding contains incorrect types: r=False, s=False", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100010100", + "result" : "invalid" + }, + { + "tcId" : 281, + "comment" : "Signature encoding contains incorrect types: r=Null, s=Null", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300405000500", + "result" : "invalid" + }, + { + "tcId" : 282, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30040c000c00", + "result" : "invalid" + }, + { + "tcId" : 283, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c01300c0130", + "result" : "invalid" + }, + { + "tcId" : 284, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300430003000", + "result" : "invalid" + }, + { + "tcId" : 285, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "300a30030201003003020100", + "result" : "invalid" + }, + { + "tcId" : 286, + "comment" : "Signature encoding contains incorrect types: r=0.25, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3008090380fe01020100", + "result" : "invalid" + }, + { + "tcId" : 287, + "comment" : "Signature encoding contains incorrect types: r=nan, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006090142020100", + "result" : "invalid" + }, + { + "tcId" : 288, + "comment" : "Signature encoding contains incorrect types: r=True, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010101020100", + "result" : "invalid" + }, + { + "tcId" : 289, + "comment" : "Signature encoding contains incorrect types: r=False, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "3006010100020100", + "result" : "invalid" + }, + { + "tcId" : 290, + "comment" : "Signature encoding contains incorrect types: r=Null, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050500020100", + "result" : "invalid" + }, + { + "tcId" : 291, + "comment" : "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30050c00020100", + "result" : "invalid" + }, + { + "tcId" : 292, + "comment" : "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30060c0130020100", + "result" : "invalid" + }, + { + "tcId" : 293, + "comment" : "Signature encoding contains incorrect types: r=empty list, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30053000020100", + "result" : "invalid" + }, + { + "tcId" : 294, + "comment" : "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags" : [ + "InvalidTypesInSignature" + ], + "msg" : "313233343030", + "sig" : "30083003020100020100", + "result" : "invalid" + }, + { + "tcId" : 295, + "comment" : "Edge case for Shamir multiplication", + "flags" : [ + "EdgeCaseShamirMultiplication" + ], + "msg" : "3932323038", + "sig" : "3044022064a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e02203c623e7f7598376825fa8bc09e727c75794cbb4ee8716ae15c31cd1cbe9ca3ee", + "result" : "valid" + }, + { + "tcId" : 296, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33393439313934313732", + "sig" : "304402203a4f61f7f8c4546e3580f7848411786fee1229a07a6ecf5fb84870869188215d022018c5ce44354e2274eadb8fea319f8d6f60944532dbaae86bfd8105f253041bcb", + "result" : "valid" + }, + { + "tcId" : 297, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35333637363431383737", + "sig" : "304502203fa9975fb2b08b7b6e33f3843099da3f43f1dcfe9b171a60cafd5489ca9c5328022100985a86825a0cc728f5d9dac2a513b49127a06100f0fc4b8b1f200903e0df9ed2", + "result" : "valid" + }, + { + "tcId" : 298, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35363731343831303935", + "sig" : "304402204d66e7ee5edd02ab96db25954050079ef8de1d0f02f34d4d75112eaf3f73124002206292d1563140013c589be40e599862bdd6bda2103809928928a119b43851a2ce", + "result" : "valid" + }, + { + "tcId" : 299, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131323037313732393039", + "sig" : "3046022100a9228305f7b486f568eb65d44e49ba007e3f14b8f23c689c952e4ced1e6cf91e022100b73c74d28bd1268002bed784a6b06c40a90ee5938ea6d08f272d027e0f96a72c", + "result" : "valid" + }, + { + "tcId" : 300, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131323938303334323336", + "sig" : "304402203fa39842bfab6c38afa7963c60beb09484d4579fc75ef09efff44e91bc62ca8302205612add1924f0285ace5b158828e2b32ab2b6e7f10ee68dca1cc54591fee1fec", + "result" : "valid" + }, + { + "tcId" : 301, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39383736303239363833", + "sig" : "3045022006c04b02edfeecd8620f035ea4f449bd924593e86e5288a6f22d1923b0e2e8a9022100f666718e6fefb515bb9339d29cc0e58cfba89d605ca0066bca87f6a3f08ebcfa", + "result" : "valid" + }, + { + "tcId" : 302, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3230323034323936353139", + "sig" : "304402201ddd953c32a5f84109cd4d9ec8c364dd318376ff5d228211a367483077d638800220563dba4845de762baf04910618d587e0dd0c97dd1c9785c24ffdf2f8a660abf2", + "result" : "valid" + }, + { + "tcId" : 303, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343531363639313830", + "sig" : "30460221009fe4ec4831ef4945f100d5d35a2e6312411ca5df6c900ca60690f2985d553482022100c674ad5e1bead2f767c9248e444452a4a8530dd47246cbbc968da865bdf212b6", + "result" : "valid" + }, + { + "tcId" : 304, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303933363835393531", + "sig" : "3046022100e8703d6b16a79fc2ab3653cece29d06f65dd6f2c230cb08ee30c5517407d75db0221008cfeb87b8e95ddacd638b37d315393c5005f3ab8bba0cc1cd1a050829b775bfb", + "result" : "valid" + }, + { + "tcId" : 305, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36323139353630323031", + "sig" : "3046022100def608caf1f277d71403009f209c1d7eef11aaa7920397fbf429b8146181aece022100f3b8f2aa5b3df9a8b37313ea66ad5b74673f3e8614ff471b1eb6773217511fb0", + "result" : "valid" + }, + { + "tcId" : 306, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35363832343734333033", + "sig" : "304402204f5d08e8d936ce831d02d6b23fb8fce0e0750101af3ab9c3b28636b95a5e24ad02206f034480553bcecac221f8be8288163c55492e2e56a88f4d0341b61436a0a6c0", + "result" : "valid" + }, + { + "tcId" : 307, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33373336353331373836", + "sig" : "3045022100bdd822bfe3733d9f4b88764fe091db2e8f8af366e4c44d876bf82e62bd48c7ee02207fbf7750c5dc849a2c55dbdd067806f869652a7b3a57baa4733781d3128f02de", + "result" : "valid" + }, + { + "tcId" : 308, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373935393033373932", + "sig" : "304402201c4fc02961b7f4245566b410bf08f447502ea4f75b15690344681efa2edf7b4b02207d63eef119dc88bc4a1b2c43ac21cd53892443661f8c3a97d558bf888c29f769", + "result" : "valid" + }, + { + "tcId" : 309, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39333939363131303037", + "sig" : "304402206406f2d249ab1264e175476ca3300efd049fcad569dff40b922082b41cc7b7ce0220461872b803383f785077714a9566c4d652e87b2cad90dd4f4cc84bc55004c530", + "result" : "valid" + }, + { + "tcId" : 310, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303837343931313835", + "sig" : "30450220415c924b9ba1902b340058117d90623602d48b8280583fb231dc93823b83a153022100f18be8cdc2063a26ab030504d3397dc6e9c6b6c56f4e3a59832c0e4643c0263c", + "result" : "valid" + }, + { + "tcId" : 311, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323336363738353030", + "sig" : "3045022100d12e96c7d2f177b7cf6d8a1ede060a2b174dc993d43f5fe60f75604824b64fef02200c97d87035fcca0a5f47fe6461bb30cbaf05b37e4211ec3fcd51fc71a12239ca", + "result" : "valid" + }, + { + "tcId" : 312, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343438393937373033", + "sig" : "304502207df72a64c7e982c88f83b3a22802690098147e0e42ef4371ef069910858c0646022100adbaa7b10c6a3f995ed5f83d7bda4ba626b355f34a72bf92ff788300b70e72d0", + "result" : "valid" + }, + { + "tcId" : 313, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35373134363332383037", + "sig" : "30440220047c4306f8d30e425ae70e0bee9e0b94faa4ef18a9c6d7f2c95de0fe6e2a323702207a4d0d0a596bd9ea3fe9850e9c8c77322594344623c0b46ac2a8c95948aefd98", + "result" : "valid" + }, + { + "tcId" : 314, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323236343837343932", + "sig" : "3044022057d603a367e23af39c95dd418c0176da8b211d50b1be82bf5ef621a2640204f702205dc3f285ad015c4d71157bd11e5b8df6a89e4b267393b08b5ad5013bdae544b1", + "result" : "valid" + }, + { + "tcId" : 315, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35333533343439343739", + "sig" : "3044022011df6741021ec8cc567584aea16817c540859c4e5011551c00b097fcfc2337e50220668551919d43206ac0571fc5ad3ac0efb489bea599e7bf99fe4c7468d6c2c5e0", + "result" : "valid" + }, + { + "tcId" : 316, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373837333033383830", + "sig" : "304402207451ffede471bd370406533436fc42a89daa0af4903d087cbc062fe7e54dbf700220590895398f22b48ce72cbf7c3d3ee1dd7fb0ee645edb0b1b1de35f370e5bf5ee", + "result" : "valid" + }, + { + "tcId" : 317, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323332313935383233", + "sig" : "3045022100fc4c4d81da6f687a6426263193c1a680b67734a1b180647b8c76407cc4f0a9c6022056f775d372c9bee685374085be676c9cf31cf1f978a5e6ccb04e4a0761159cc7", + "result" : "valid" + }, + { + "tcId" : 318, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130373339333931393137", + "sig" : "3045022100feb978ca33c46ffba47eb63bb40de7833e43d5654575b54de1fea3d1de3c8ad50220108078ba997bfa064521baf342c97b0c64bd25240c8fd0fd7533ae2d03081b70", + "result" : "valid" + }, + { + "tcId" : 319, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31383831303237333135", + "sig" : "3046022100cc61729698467ba53da199ff481fe7433f194fc96367907e8dc5e1d9f42b1e2102210083dd9ef156e7c1f9c09b3bf86a4f1c88e5dd20cd74d997858e600797dbe74ad2", + "result" : "valid" + }, + { + "tcId" : 320, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36303631363933393037", + "sig" : "3045022100d47f616303ff0eb813eac32e760ba30ad445e0af7dc57e70756104823f6a895f0220047f2217b399c46a426b936a124980a6011f0896f51dbe07632828a72d7173f1", + "result" : "valid" + }, + { + "tcId" : 321, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38383935323237303934", + "sig" : "3046022100cff73dfa2bac67ce1340b25c885abb3e7979ef7f840f15d5f19e86640cdd40a3022100c7d1210802796c4f251049ee08a2c29f5c71064033d17010c65bf2e94499381e", + "result" : "valid" + }, + { + "tcId" : 322, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353830323334303934", + "sig" : "3044022010acaf9c485ab1220355b95be269f124e12eb252f2224b0fc50785eb2ee3df45022032443b557efc6896347fa778e1fcf33cbb769c9a7da896b20d93fea7c2791ea4", + "result" : "valid" + }, + { + "tcId" : 323, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33393635393931353132", + "sig" : "3046022100f919da0651abc2bff994a879d2778fa5195d57400e003e8dd6adb3fc7a0cc4cc0221009b945d06bd119665b278a59bd24fdd2350817d0be87997bee57b70c479d64a2d", + "result" : "valid" + }, + { + "tcId" : 324, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323838373332313938", + "sig" : "3045022100cc38e7a018f6d70b2d9b49120cc9b4a169f2f72238821a86b81f553b6225d24e0220276efd8bf06ccce07c7aae35eaac3bd1c374dcf0cf0588d5e0e4171936688636", + "result" : "valid" + }, + { + "tcId" : 325, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32323330383837333139", + "sig" : "3045022100ff85ad66621991c318b85cef73c576cb2a8d43c568c1aafc85b40ef2a9a6b41c0220732a79e6837ebf8434fea6e7fefa948f506ae455c1a3eb36a030185a23037d96", + "result" : "valid" + }, + { + "tcId" : 326, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313239303536393337", + "sig" : "3044022033f016e51eef9b1136380cb8b84c6b38b107e24c6731bd07cb1c7f4a29f33a83022036b177bb8be94c8be67ff3a41fcc4d22b5c9eb377da713eb014ae01c64ca6dd7", + "result" : "valid" + }, + { + "tcId" : 327, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373438363536343338", + "sig" : "3045022100929413ee91f27454d74e91370a10a86fc98ac7305c8ab4ca59752bda3a7bfc370220483b47a26a0d7d2e6bd37d351d9ee37c5ec2a4686d884d78b6beb7f6b08c50f9", + "result" : "valid" + }, + { + "tcId" : 328, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37353833353032363034", + "sig" : "30450220578202c7d0abac93ca43dde3cb44414e5601c1eb557604cb9adb4bde0a12633b022100fb9a7412e307aee95ef4b53540571a21559414e5306794ab5182cfb229dab3e9", + "result" : "valid" + }, + { + "tcId" : 329, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333237373534323739", + "sig" : "3045022046d45ad0bb75b8639d0e91d8450fc31887c211328a5784fc83b4cb7f5b962c1b022100d6751d13ede2079b7aa1d822bdb32d7f3cf00273a1ff03df90c0ec7c62a47568", + "result" : "valid" + }, + { + "tcId" : 330, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373735353038353834", + "sig" : "3046022100abe84c941783d5ced284fea56341ecc68d6bdd3196d318fbd074641f8c885bd5022100bdea3c44d48e01aa40935c1c9723ff733199563440f26b4ecf0b444b0418d9f5", + "result" : "valid" + }, + { + "tcId" : 331, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3137393832363438333832", + "sig" : "3045022005277cdbf491e336fe81be24e393a161a4fb89112c9ffed1ee6649c406713408022100ab6934332e68e108bb0484d21c457dcf381a620c3a4712fdbfeb658a3fafd60c", + "result" : "valid" + }, + { + "tcId" : 332, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333936373737333635", + "sig" : "30450220293825737c8c14430ed10dbadd7da337275f9b61d1d26377f778ffaa00c139de022100cdddec267a8678c96829bf6c1d6f38322e119937cfd2fee01e9dc9525f43ed6b", + "result" : "valid" + }, + { + "tcId" : 333, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35393938313035383031", + "sig" : "304402202041fdd6111c45dfd29e750e082dcdadc9a584a8a2be46580fb0ba3b3dc658620220421824fe987e4172a0f8bbcb7bcd9e1b073b7742ed9f9df98f2a1a37cd374ce3", + "result" : "valid" + }, + { + "tcId" : 334, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3136363737383237303537", + "sig" : "30450220267941db660e046ab14e795669e002b852f7788447c53ebef46a2056978b5574022100d00183bcaf75bc11e37653f952f6a6537151c3aa0a1b9e4e41b004a29185395b", + "result" : "valid" + }, + { + "tcId" : 335, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "323036323134333632", + "sig" : "304402205dcd7f6814739d47f80a363b9414e6cbfb5f0846223888510abd5b3903d7ae09022043418f138bb3c857c0ad750ca8389ebcf3719cb389634ac54a91de9f18fd7238", + "result" : "valid" + }, + { + "tcId" : 336, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36383432343936303435", + "sig" : "304502205e0e8cc0280409a0ce252da02b2424d2de3a52b406c3778932dbc60cb86c356702210093d25e929c5b00e950d89585ec6c01b6589ae0ec0af8a79c04df9e5b27b58bc5", + "result" : "valid" + }, + { + "tcId" : 337, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323639383937333231", + "sig" : "304502204fcf9c9d9ffbf4e0b98268c087071bffe0673bb8dcb32aa667f8a639c364ea47022100820db0730bee8227fc831643fcb8e2ef9c0f7059ce42da45cf74828effa8d772", + "result" : "valid" + }, + { + "tcId" : 338, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333837333234363932", + "sig" : "3046022100c60cd2e08248d58d1639b123633643c63f89aff611f998937ccb08c9113bcdca022100ac4bb470ce0164616dada7a173364ed3f9d16fd32c686136f904c99266fda17e", + "result" : "valid" + }, + { + "tcId" : 339, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34313138383837353336", + "sig" : "304502207cfdaf6f22c1c7668d7b6f56f8a7be3fdeeb17a7863539555bbfa899dd70c5f1022100cee151adc71e68483b95a7857a862ae0c5a6eee478d93d40ccc7d40a31dcbd90", + "result" : "valid" + }, + { + "tcId" : 340, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393838363036353435", + "sig" : "304402202270be7ee033a706b59746eab34816be7e15c8784061d5281060707a0abe0a7d022056a163341ee95e7e3c04294a57f5f7d24bf3c3c6f13ef2f161077c47bd27665d", + "result" : "valid" + }, + { + "tcId" : 341, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343739313135383435", + "sig" : "3044022016b5d2bfcaba21167a69f7433d0c476b21ded37d84dc74ca401a3ecddb2752a8022062852cf97d89adfb0ebbe6f398ee641bfea8a2271580aac8a3d8326d8c6e0ef9", + "result" : "valid" + }, + { + "tcId" : 342, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35303736383837333637", + "sig" : "3046022100d907eefa664115848b90c3d5baa0236f08eafaf81c0d52bb9d0f8acb57490847022100fd91bc45a76e31cdc58c4bfb3df27f6470d20b19f0fba6a77b6c8846650ed8a6", + "result" : "valid" + }, + { + "tcId" : 343, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "393838353036393637", + "sig" : "30450220048337b34f427e8774b3bf7c8ff4b1ae65d132ac8af94829bb2d32944579bb31022100bd6f8eab82213ccf80764644204bb6bf16c668729cdd31dd8596286c15686e8e", + "result" : "valid" + }, + { + "tcId" : 344, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32373231333036313331", + "sig" : "3046022100b2bc46b7c44293557ab7ebeb0264924277193f87a25d94c924df1518ba7c7260022100abf1f6238ff696aaafaf4f0cbbe152c3d771c5bfc43f36d7e5f5235819d02c1a", + "result" : "valid" + }, + { + "tcId" : 345, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323034313031363535", + "sig" : "3045022040d4b38a61232e654ffd08b91e18609851f4189f7bf8a425ad59d9cbb1b54c990221009e775a7bd0d934c3ed886037f5d3b356f60eda41191690566e99677d7aaf64f3", + "result" : "valid" + }, + { + "tcId" : 346, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313530363830393530", + "sig" : "3046022100ac8f64d7df8d9fea005744e3ac4af70aa3a38e5a0f3d069d85806a4f29710339022100c014e96decfef3857cc174f2c46ad0882bef0c4c8a17ce09441961e4ae8d2df3", + "result" : "valid" + }, + { + "tcId" : 347, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373237343630313033", + "sig" : "3044022041b3766f41a673a01e2c0cab5ceedbcec8d82530a393f884d72aa4e6685dea0a0220073a55dca2da577cafb40e12dd20bf8529a13a6acdf9a1c7d4b2048d60876cb3", + "result" : "valid" + }, + { + "tcId" : 348, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134353731343631323235", + "sig" : "304502201942755aa8128382cd8e35a4350c22cc45ba5704d99e8a240970df11956ad866022100f64cf1e0816cf7ac5044f73ba938e142ef3305cb09becb80a0a5b9ad7ba3eb07", + "result" : "valid" + }, + { + "tcId" : 349, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34313739353136303930", + "sig" : "3045022051aba4ff1c7ddf17e0632ab71684d8de6dc700219ef346cb28ce9dafc3565b3b022100b6aaebe1af0ad01f07a68bf1cf57f9d6040b43c14b7eb8238542760e32ce3b0c", + "result" : "valid" + }, + { + "tcId" : 350, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35383932373133303534", + "sig" : "304502210091efbfcc731650e9f004c38b71db146c17bf871c82c4e87716f7ff2f7f9e51d00220089ea631a7c5f05311c521d21ba798b5174881f0fd8095fb3a77515913efb6e0", + "result" : "valid" + }, + { + "tcId" : 351, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33383936313832323937", + "sig" : "304502204a7e47bd281ea09b9e3a32934c7a969e1f788f978b41585989f4689e804663fb022100e65f6bd702403cbbed7f8ad0045f331d4a96fbf8c43f71f11615b7d1b9153b7f", + "result" : "valid" + }, + { + "tcId" : 352, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38323833333436373332", + "sig" : "3046022100c795f5da86e10a604d4f94bf7cac381c73edad1461d66929e53aa57ca294e89f022100bae784ab6c7b58332ee05e7d54169edf55ce45f030e71ae8df63969fb327a10c", + "result" : "valid" + }, + { + "tcId" : 353, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33333636393734383931", + "sig" : "3046022100ea68b24843b225f505e01c0e608b20b4d93e8faf6b9cf70cf8f9134a80e7b668022100a3abc044b4728f80fe414bdc66f032b262356720547bec7729fad94151c6adc7", + "result" : "valid" + }, + { + "tcId" : 354, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32313939313533323239", + "sig" : "3046022100bfe7502140c57a24a77edc3d9b3c4bc11d21bdb0b196977b7f2b13ac973ad697022100947a01da9731849d72b67ef7bc40b012480fd389895aad1f6b1cdbeab3b93b8d", + "result" : "valid" + }, + { + "tcId" : 355, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35363030333136383232", + "sig" : "304402203434ee1142740a0ab8623b97fc8dc2567eda45dadf6039b45c448819e840cf3002203c0fac0487841997202c29f3bf2df540b115b29dc619160d52203d4a1fd4b9f7", + "result" : "valid" + }, + { + "tcId" : 356, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "383639363531363935", + "sig" : "304502205338500e23ba96a0adc6ef84932e25fbad7435d9f70eb7f476c6912de12e33c8022100a002f5583ea8c0d7fb17136d0ee0415acf629879ce6b01ac52e3ecd7772a3704", + "result" : "valid" + }, + { + "tcId" : 357, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36353833393236333732", + "sig" : "304402204ff2d4e31f4180de6901d2d20341d12387c9c55f4cf003a742f049b84af6fe0502200312f38771414555fa5ed2817dcc629a8c7cf69d306300e87bc167278ec3ef37", + "result" : "valid" + }, + { + "tcId" : 358, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3133323035303135373235", + "sig" : "3044022051d665bad5f2d6306c6bbfe1f27555887670061d4df36ec9f4ce6cdfaf9ea7ac02202905e43f6207ee93df35a2e9fb9bc8098c448ae98a14e4ad1ebaea5d56b6e493", + "result" : "valid" + }, + { + "tcId" : 359, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35303835333330373931", + "sig" : "3046022100b804e0235f135aba7b7531b6831f26cc9fb77d3f83854957431be20706b813690221009d317fd08e4e0467617db819cde1d7d4d74da489b2bce4db055ea01eccfafcf2", + "result" : "valid" + }, + { + "tcId" : 360, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37383636383133313139", + "sig" : "30450221008ab50ef3660ccb6af34c78e795ded6b256ffca5c94f249f3d907fb65235ef680022049d5aaeae5a6d0c15b286e428b5e720cf37a822ede445baa143ffae69aba91b8", + "result" : "valid" + }, + { + "tcId" : 361, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303832353339343239", + "sig" : "30440220571b9c46a47c5cc53a574c196c3fb07f3510c0f4443b9f2fe781252c24d343de022068a9aebd50ff165c89b5b9cb6c1754191958f360b4d2851a481a3e1106ee7809", + "result" : "valid" + }, + { + "tcId" : 362, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130303635393536363937", + "sig" : "304502204cb7817b04dc73be60d3711803bc10687a6e3f4ab79c4c1a4e9d63a73174d4eb022100ce398d2d6602d2af58a64042f830bf774aee18209d6fb5c743b6a6e437826b98", + "result" : "valid" + }, + { + "tcId" : 363, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33303234313831363034", + "sig" : "30450220684399c6cd6ebb1c5d5efb0d78dce40ebd48d9d944eb6548c9ce68d7fdc82229022100cf25c8e427fae359bfe60fa02964f4c9b8d6db54612e05c78c341f0a8c52d0b5", + "result" : "valid" + }, + { + "tcId" : 364, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37373637383532383734", + "sig" : "3045022020b7b36d5bc76fa182ca27152a99a956e6a0880000694296e31af98a7312d04b022100eeeabc5521f9856e920eb7d29ed7e4042f178ff706dff8eeb24b429e3b63402a", + "result" : "valid" + }, + { + "tcId" : 365, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353434313939393734", + "sig" : "304402206b65c95e8e121d2e6ee506cfd62cb88e0bfb3589da40876898ef66c43982aca9022009642c05ad619b4402fd297eb57e29cca5c2eb6823931ba82de32d7c652ba73e", + "result" : "valid" + }, + { + "tcId" : 366, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35383433343830333931", + "sig" : "3044022067c74cbf5ea4b777bf521ace099f4f094d8f58900e15e67e1b4bd399056629ed02203d2884655c49b8b5f64e802a054e7bf09b0fc80ca18ebf927b82e58bb4a00400", + "result" : "valid" + }, + { + "tcId" : 367, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "373138383932363239", + "sig" : "3045022079a5e40da5cf34c4c39adf7dfc5d454995a250314ebd212b5c8e3f4e6f875feb022100b268920e403ba17828ff271938a6558a5b2dd000229f8edb4a9d9f9b6ac1b472", + "result" : "valid" + }, + { + "tcId" : 368, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31373433323233343433", + "sig" : "3045022100c8b13006c3a51a322fff9321761b01de134f526be582b22e19693c443fc9fe46022034e7f60179c6162ab980fcd58f173b0e6c30b524d35c67921677522dcef843a1", + "result" : "valid" + }, + { + "tcId" : 369, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32343036303035393336", + "sig" : "304502203513db745489a487c88a6cedf8795b640f8f71578397bdabd6cc586c25bd66ad02210099a72cd3f0ca6c799149283ca0af37f86b88200d0c905bd3c9f1b859e55b1659", + "result" : "valid" + }, + { + "tcId" : 370, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363134303336393838", + "sig" : "304402203a6386afb08f7ff8140b5a270f764e8706ef2830fb177446f7b4eeb8a25aac6402204b70854b38c29245b2b980eba10ea936c68a38c1da5255ce2386db23afc7c06a", + "result" : "valid" + }, + { + "tcId" : 371, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32303935343235363835", + "sig" : "3046022100b8fc54a8a6be3c55e99c06f99ccdcce7af5c18a3c5829726a870cc1068458f64022100cc7237c39c8e6a4a1c8c62f5f88636549c7410798b89684c502c3adfe5fb7ad2", + "result" : "valid" + }, + { + "tcId" : 372, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31303038303938393833", + "sig" : "3045022047b460851e5607f2021626635c565a63f78f558795e1b330d09115970dbbb8ab022100a6a9f4f213e08d3c736d3e1c44a35140cb107619f265a5b13608ed729fd6d894", + "result" : "valid" + }, + { + "tcId" : 373, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353734313437393237", + "sig" : "30450221008cfda4f7a65864ebbea3144863da9b075c07b5b42cb4569643ddfd70dd753b190220595784b1ab217874b82b9585521f8090b9f6322884ab7a620464f51cf846c5b7", + "result" : "valid" + }, + { + "tcId" : 374, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32383636373731353232", + "sig" : "304402204cd6a45bd7c8bf0edbdf073dbf1f746234cbbca31ec20b526b077c9f480096e702207cf97ae0d33f50b73a5d7adf8aa4eeeb6ff10f89a8794efe1d874e23299c1b3d", + "result" : "valid" + }, + { + "tcId" : 375, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363934323830373837", + "sig" : "304402202e233f4df8ffebeaec64842b23cce161c80d303b016eca562429b227ae2b58ec022046b6b56adec82f82b54daa6a5fca286740a1704828052072a5f0bc8c7b884242", + "result" : "valid" + }, + { + "tcId" : 376, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "39393231363932353638", + "sig" : "30440220549f658d4a3f98233a2c93bd5b1a52d64af10815ae60becb4139cac822b579c3022027bdddf0dbcf374a2aec8accc47a8ac897f8d1823dda8eb2052590970b39ce2a", + "result" : "valid" + }, + { + "tcId" : 377, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131363039343339373938", + "sig" : "30450221009fabcc1e5fd965226902f594559e231369e584453974e74f49d7d762e134fb9d0220293cccc510793bac45ce5da2bb6c9e906437f59435ca206655f74b625df07c7c", + "result" : "valid" + }, + { + "tcId" : 378, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37313836313632313030", + "sig" : "304502202e5c140fd6f5f823addc8088ffaae967e7f4897274316769561dfb31435825d9022100eda47327d7cfae1daa344ff5582a467bd18eb9f01caeab9c6da3c0cc89df6713", + "result" : "valid" + }, + { + "tcId" : 379, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33323934333437313737", + "sig" : "304402204c11e3b7efbe3908ad2118e54d7d34d6c6eb4570bf7fdb11a7679fe93afa254c0220712e90f421836e542dac49d10bb39db4a98b2735b6336d8a3c392f3b90e60bbe", + "result" : "valid" + }, + { + "tcId" : 380, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3138353134343535313230", + "sig" : "3045022100dfb4619303f4ff689563d2275069fac44d63ea3c3b18f4fb1ac805d7df3d12ec022068e37b846583901db256329f9cf64f40c416fba50dcb9be333a3e29c76ae32db", + "result" : "valid" + }, + { + "tcId" : 381, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "343736303433393330", + "sig" : "3045022100e70e8e17bd758ff0c48f91cb2c53d293f0f5ae82eb9dfe76ab98f9b064278635022021dde32cb0389cad7bdf676d9b9b7d25bb034ad25a55ea71ee7ee26a18359dd2", + "result" : "valid" + }, + { + "tcId" : 382, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32353637333738373431", + "sig" : "30440220421397ecae30617a5a6081ad1badf6ce9d9d4cb2afdabf1f900e7fdb7fb0af5a022057ca89dc22801c75fdbefdaeca65c675625f94de7d635062b08ed308df5762cc", + "result" : "valid" + }, + { + "tcId" : 383, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35373339393334393935", + "sig" : "304502200610c08076909bb722fba105c23eac8f66b4db1d58f66a882fc90d59acdec8e0022100af59e8d570761cac589d49f11c884007f7ac1eea1a44c6f3fdad1d542187d25e", + "result" : "valid" + }, + { + "tcId" : 384, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343738333636313339", + "sig" : "3045022059a1181cab0ee8ce94ab2b5ab4f4b13a422e38efe69f634bf947485a5b9ea49c0221009b3c913d98a4ab15f6a39f1802b8f2d28559aa1f8d03a3a88df00c89dc293a97", + "result" : "valid" + }, + { + "tcId" : 385, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363439303532363032", + "sig" : "30460221008cae6c4dfbf901bd66ab82541011fa15c8e90e2c18c01bd881acaa2b63cb587b022100a86acf943f29cef91d1b66a7de5547df6cdfc45dd7bef816dcb8de9f5a425d2d", + "result" : "valid" + }, + { + "tcId" : 386, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34373633383837343936", + "sig" : "30450221008b00c74b86474d782eac9974aea606d8f7ee78c79597e15687021f5991e86acd0220309dfe3686648eae104e87b3e9b5616a3ad479ca4f0b558ae4f1e5ab3115346a", + "result" : "valid" + }, + { + "tcId" : 387, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "353739303230303830", + "sig" : "30450220433a915504c977809634a36fcf4480e4c8069fc127d201d30dfdb1f423c95fd4022100bcb1b89aafd50a1766b09741fc6a9a96e744ae9826d839bf85ffb50a91981773", + "result" : "valid" + }, + { + "tcId" : 388, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "35333434373837383438", + "sig" : "304502204b69abd2b39840a545cdd4a72d384234580e2fd938b7091d0ecdb562780857db022100fdab9957119e0a4092af82f6cc29f3c8a692671ec86efb0a03c1112a0a1e0467", + "result" : "valid" + }, + { + "tcId" : 389, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3139323636343130393230", + "sig" : "3045022100dab9d3686c28363ad017b4a2b36d35bf2eb80633613d44deb9501d42a3efbd3802201392a562d79f9ab19014e4f7e2f2668259f3720a76c120d4a3c3964e880f7679", + "result" : "valid" + }, + { + "tcId" : 390, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33373033393135373035", + "sig" : "3045022023f94e47b440ce379b74c9311232b19a64e3e7c9b90da34b0c1c3f3d7af28105022100e1425903b1479c2ce18b108a6d1ec8b7a4f0f657dedb00de3a3ceea7fdeee9be", + "result" : "valid" + }, + { + "tcId" : 391, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3831353435373730", + "sig" : "30450221009d706a8fa85d15bd0c3492c6672dfe529f4073b217b3947b5b2cfd61f87ccb7102206aaaaf369f82a0e542f72ded7d7eb90c8314ffa613a0ea81da1c8393dbae2bac", + "result" : "valid" + }, + { + "tcId" : 392, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "313935353330333737", + "sig" : "3046022100ac77918c4085c8a7ce5020b00c315629aee053a445cb4661eb50f6b62a47da29022100df2aea2b9c11a6ce39d3cd9e1faf4a53057e0b1b2e48a324be9e773203fe9fbb", + "result" : "valid" + }, + { + "tcId" : 393, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31323637383130393033", + "sig" : "30460221009db2dbd2935f147fae7f6a95c8e2307bd8537c3d96eb732ad6d5ebdd89bc754e02210093a9ab99d2de9d08fe0a61e26c8fe1ebbf88726e4b69d551b57d15f0ae16df5a", + "result" : "valid" + }, + { + "tcId" : 394, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131313830373230383135", + "sig" : "30440220769f70093939afbd1fa15873decfa803ca523ace8040280ba78cf833497722bc0220369875aba5e1ced5a4ca8444ec9399a38038b00e153a0ae34d9b3c9781447eea", + "result" : "valid" + }, + { + "tcId" : 395, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "38333831383639323930", + "sig" : "3045022026e5182b9822550ad52f46ad80781d6bef3d110a204db5e58a0746f796982200022100a9418e76029ced0cf78a571a9e59ad04086e91f70e6813981bb33c1dee891165", + "result" : "valid" + }, + { + "tcId" : 396, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33313331323837323737", + "sig" : "3046022100e7bd6aefcf7b27e1f3fadbe713f9adb3d23398e88200cd2e94989c9d12e921770221009583e0de3b76f8d4b1e634a81cbc34af54e2f8599f3684ce48d372760c8204c4", + "result" : "valid" + }, + { + "tcId" : 397, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134333331393236353338", + "sig" : "30450221008638ed7eaa83609a01a6af9c52ec9bfddda90442b1e6031d61cfa22e48b2e1e2022020c284d596f71c6c8df732f5a5a2006302301e1a792e2b39663d93a9760762d2", + "result" : "valid" + }, + { + "tcId" : 398, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333434393038323336", + "sig" : "3044022061d924307a96180b06383608ba91674e15c3ea06ff2534412b93a587dde649c1022059b84aa2115b2547edac88088ca6313e9fbe1ca6a361c7e57938f9dde3f4349c", + "result" : "valid" + }, + { + "tcId" : 399, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36383239383335393239", + "sig" : "30450220424fcfc3fd63d128c2eb125e88c7fe5d283b63470a786b82783edbb8a0b7a6d7022100b11548c2cd7fce9d44e795ca51af0b2f6a5180e9c9be0314007ed9e7f4bbe5e9", + "result" : "valid" + }, + { + "tcId" : 400, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "33343435313538303233", + "sig" : "3045022100a5f747ae6290fa9582c6ce8d5608621d495f061551bc4531bacba586a563b184022062faf8f92291e12812835b3f1d43c967bceb885b110bd06e5a68e2d74781ae2b", + "result" : "valid" + }, + { + "tcId" : 401, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3132363937393837363434", + "sig" : "3045022100b731dc0d92c2cc7a605d78233f7814699bdf1cab2df297b6844eec4015af8ea0022039b1a0cc88eb85bcdc356b3620c51f1298c60aec5306b107e900ffdba049dd6f", + "result" : "valid" + }, + { + "tcId" : 402, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "333939323432353533", + "sig" : "3046022100ef73c4fa322da39fb6503bab6b66b64d241056afbcd6908f84b61ccbbe890433022100f1ef85413e5764aa58a3128ccfcf388324fe5340e5edf8d0135ae76786ce415b", + "result" : "valid" + }, + { + "tcId" : 403, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31363031393737393737", + "sig" : "30450220694cd30e2ad0182579331474b271ee2d48723bc8415dc6513873586ce705b76b022100c5ac0c0ed5a4017d110cb45d63aa955dc7dc5ce23e7965c5397c3ff46a884636", + "result" : "valid" + }, + { + "tcId" : 404, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3130383738373535313435", + "sig" : "3046022100f38b2236be3024e10b894ffb1cc68d0bb8d4cf0fcd2cfc1779f8883765d3cd96022100da69cd0b74c25566d60a486edd559fc39d569fb2751445a4798df8a36891802c", + "result" : "valid" + }, + { + "tcId" : 405, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "37303034323532393939", + "sig" : "3046022100a881732c205a0b4b95669c00756fd91973450109a46f17d5a9d971b5e92b9aa40221008acefdca4e06c16b47ccad1c57c05912637e107096ba230c92b97187db79e19e", + "result" : "valid" + }, + { + "tcId" : 406, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31353635333235323833", + "sig" : "3044022004452f554bae819b42effb84ef44a9f1cb7e2d75b4ba9ff9b9cfffaddde3fd1b022061a3fbc5e73c350f2e3d85a7452cd231a3f3375fc11f5fe153b185f53b09c1d0", + "result" : "valid" + }, + { + "tcId" : 407, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3233383236333432333530", + "sig" : "3045022005814f57f58efc7cb490119e584e635e6f0ad1c19fb5dc2edafda075bb55f98e0221009dd5c6e39009d67d965903ecffe08a851775cc1248cc19c0b77798282131b8f6", + "result" : "valid" + }, + { + "tcId" : 408, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31343437383437303635", + "sig" : "3045022100dc1c4a46085e198843b1f01980cd5e4a1ff6f8e8ff7014397f0afd5b247fb0a0022038a13dc723ed90b30251d742b14733a03292ff26530a1ebcaf3d10862a6eff82", + "result" : "valid" + }, + { + "tcId" : 409, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3134323630323035353434", + "sig" : "304502201067667bf525734ca7f2510e36348fd9c2c9bccf032dfd571de6d45abd49361a022100fa762568d3a19e5a1d8ea65e00202a5b16f9afae56733a01f86e35378c558da4", + "result" : "valid" + }, + { + "tcId" : 410, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31393933383335323835", + "sig" : "3046022100e58d69dc56bc1031644847e3e046e2ea845a515d969d07ea1aa53aea5bd92fa1022100bfe50b80f7c512f5ab521fe7e1a131045fde78d4de826c91573baaba1e35ca97", + "result" : "valid" + }, + { + "tcId" : 411, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34323932313533353233", + "sig" : "3046022100fe79c6b8c14d0f23d426e3d157f1b541f6bb91bf29957ef97c55949c9ba48a350221009da112c4a4cf4b1ff490c426f6c8ff122183964a0de56f7336ab382dc9d10285", + "result" : "valid" + }, + { + "tcId" : 412, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "34343539393031343936", + "sig" : "3045022045d4ed7e9edacb5a730944ab0037fba0a136ed9d0d26b2f4d4058554f148fa6f022100f136f15fd30cfe5e5548b3f4965c16a66a7c12904686abe12da777619212ae8c", + "result" : "valid" + }, + { + "tcId" : 413, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "31333933393731313731", + "sig" : "304402204fb7c1727e40bae272f6143a50001b54b536f90233157896dbf845e263f2486302206fea5c924dca17519f6e502ef67efa08d39eb5cc3381266f0216864d2bd00a62", + "result" : "valid" + }, + { + "tcId" : 414, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "32333930363936343935", + "sig" : "30450220779aac665dd988054b04f2e9d483ca79179b3372b58ca00fe43520f44fcb4c32022100b4eca1182cd51f0abd3ea2268dcda49a807ad4116a583102047498aa863653f5", + "result" : "valid" + }, + { + "tcId" : 415, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3131343436303536323634", + "sig" : "3046022100db7ac6f65fb1c38d80064fd11861631237a09924b4eeca4e1569fa4b7d80ad24022100a38d178d37e13e1afa07a9d03da025d594461938a62a6c6744f5c8f7d7b7bb81", + "result" : "valid" + }, + { + "tcId" : 416, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "363835303034373530", + "sig" : "3046022100c90043b4aadf795d870ac223f33acdbd1948c31afff059054dc99528c6503fa6022100829f67b312bb134f6954a23c611a7f7b5b2a69efced9c48db589ac0b4d3da827", + "result" : "valid" + }, + { + "tcId" : 417, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "3232323035333630363139", + "sig" : "3045022100fa16c0125b6615b90e81f7499804308a90179bf3fcff6a4b2695271c68b23ded02200d6cda5ce041dc5a5f319ad9c0de4927d0cf5e89e37b79216194413d42976d54", + "result" : "valid" + }, + { + "tcId" : 418, + "comment" : "special case hash", + "flags" : [ + "SpecialCaseHash" + ], + "msg" : "36323135363635313234", + "sig" : "304502201a4b5bd0f806549f46a3e71bfe412d6d89206017640ded66f3d0b2d9b26bec45022100aac5f74e3130264e01428570ee82ee47e245d160ed812ae252dedffd82e1ec2c", + "result" : "valid" + }, + { + "tcId" : 419, + "comment" : "Signature generated without truncating the hash", + "flags" : [ + "Untruncatedhash" + ], + "msg" : "313233343030", + "sig" : "3045022100f8e272234b51475ec4c6f327562a6e5c9080a96225e88b2e5f72a8eecbd41ab40220516b91617fc39e3141b3bc769f6a3b2e468e687f50bdc29e19088af62d203f4b", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b6e08b1bcc89e7fb0b84d7497e310553495be4877eccc4b3d6d79f7c68a0573431760fa1bcea4972759174ac1103bc6011985ccee251918d0573fbcb78969116", + "wx" : "00b6e08b1bcc89e7fb0b84d7497e310553495be4877eccc4b3d6d79f7c68a05734", + "wy" : "31760fa1bcea4972759174ac1103bc6011985ccee251918d0573fbcb78969116" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b6e08b1bcc89e7fb0b84d7497e310553495be4877eccc4b3d6d79f7c68a0573431760fa1bcea4972759174ac1103bc6011985ccee251918d0573fbcb78969116", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEtuCLG8yJ5/sLhNdJfjEFU0lb5Id+\nzMSz1teffGigVzQxdg+hvOpJcnWRdKwRA7xgEZhczuJRkY0Fc/vLeJaRFg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 420, + "comment" : "k*G has a large x-coordinate", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "303502104319055358e8617b0c46353d039cdaab022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "valid" + }, + { + "tcId" : 421, + "comment" : "r too large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000001000000000000000000000000fffffffffffffffffffffffc022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043590c6a10353d669bc94d8e2ff9e14bbeed4a7f45b887255ab7e37b676387bb615fc6f97ce39a3874c2b34cc571889abfa0a706c2cfb0e5a4750cc25690696f8", + "wx" : "3590c6a10353d669bc94d8e2ff9e14bbeed4a7f45b887255ab7e37b676387bb6", + "wy" : "15fc6f97ce39a3874c2b34cc571889abfa0a706c2cfb0e5a4750cc25690696f8" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043590c6a10353d669bc94d8e2ff9e14bbeed4a7f45b887255ab7e37b676387bb615fc6f97ce39a3874c2b34cc571889abfa0a706c2cfb0e5a4750cc25690696f8", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENZDGoQNT1mm8lNji/54Uu+7Up/Rb\niHJVq343tnY4e7YV/G+Xzjmjh0wrNMxXGImr+gpwbCz7DlpHUMwlaQaW+A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 422, + "comment" : "r,s are large", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04369e96402f2cfd1a37b3acbdecfc562862dbca944a0f12d7aaacb8d325d7650aa723621922be2bdac9186290fdcdda028d94437966507d93f2fc1f5c887fdedb", + "wx" : "369e96402f2cfd1a37b3acbdecfc562862dbca944a0f12d7aaacb8d325d7650a", + "wy" : "00a723621922be2bdac9186290fdcdda028d94437966507d93f2fc1f5c887fdedb" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004369e96402f2cfd1a37b3acbdecfc562862dbca944a0f12d7aaacb8d325d7650aa723621922be2bdac9186290fdcdda028d94437966507d93f2fc1f5c887fdedb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENp6WQC8s/Ro3s6y97PxWKGLbypRK\nDxLXqqy40yXXZQqnI2IZIr4r2skYYpD9zdoCjZRDeWZQfZPy/B9ciH/e2w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 423, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0427a0a80ea2e1aa798ea9bcc3aedbf01ab78e49c9ec2ad0e08a0429a0e1db4d0d32a8ee7bee9d0a40014e484f34a92bd6f33fe63624ea9579657441ac79666e7f", + "wx" : "27a0a80ea2e1aa798ea9bcc3aedbf01ab78e49c9ec2ad0e08a0429a0e1db4d0d", + "wy" : "32a8ee7bee9d0a40014e484f34a92bd6f33fe63624ea9579657441ac79666e7f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000427a0a80ea2e1aa798ea9bcc3aedbf01ab78e49c9ec2ad0e08a0429a0e1db4d0d32a8ee7bee9d0a40014e484f34a92bd6f33fe63624ea9579657441ac79666e7f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJ6CoDqLhqnmOqbzDrtvwGreOScns\nKtDgigQpoOHbTQ0yqO577p0KQAFOSE80qSvW8z/mNiTqlXlldEGseWZufw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 424, + "comment" : "r and s^-1 have a large Hamming weight", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022027b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "049cff61712d4bc5b3638341e6e0a576a8098c9c6d3f198d389c4669f398dc0867f3b9e09f567f3dfd9c4d2c1163e82beadf16c76e8f9d7a64673800ea76fa1e59", + "wx" : "009cff61712d4bc5b3638341e6e0a576a8098c9c6d3f198d389c4669f398dc0867", + "wy" : "00f3b9e09f567f3dfd9c4d2c1163e82beadf16c76e8f9d7a64673800ea76fa1e59" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200049cff61712d4bc5b3638341e6e0a576a8098c9c6d3f198d389c4669f398dc0867f3b9e09f567f3dfd9c4d2c1163e82beadf16c76e8f9d7a64673800ea76fa1e59", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnP9hcS1LxbNjg0Hm4KV2qAmMnG0/\nGY04nEZp85jcCGfzueCfVn89/ZxNLBFj6Cvq3xbHbo+demRnOADqdvoeWQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 425, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d9117cae81295e82682fa387991e668e1570e0e90100bf4e63964822460561bc19f96b1787ed15769929978ba3dd7f68c97adf5c16f671e756cd8f08c49456ca", + "wx" : "00d9117cae81295e82682fa387991e668e1570e0e90100bf4e63964822460561bc", + "wy" : "19f96b1787ed15769929978ba3dd7f68c97adf5c16f671e756cd8f08c49456ca" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d9117cae81295e82682fa387991e668e1570e0e90100bf4e63964822460561bc19f96b1787ed15769929978ba3dd7f68c97adf5c16f671e756cd8f08c49456ca", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2RF8roEpXoJoL6OHmR5mjhVw4OkB\nAL9OY5ZIIkYFYbwZ+WsXh+0Vdpkpl4uj3X9oyXrfXBb2cedWzY8IxJRWyg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 426, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048cfcbad3524c22b992529f943e3ce0b2d126085501d6e3edd4f1dbf74bdca21eafb259b1ba179cac09e8e43a88c8a09e7339910a7c941932e44b8be56f1fccde", + "wx" : "008cfcbad3524c22b992529f943e3ce0b2d126085501d6e3edd4f1dbf74bdca21e", + "wy" : "00afb259b1ba179cac09e8e43a88c8a09e7339910a7c941932e44b8be56f1fccde" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048cfcbad3524c22b992529f943e3ce0b2d126085501d6e3edd4f1dbf74bdca21eafb259b1ba179cac09e8e43a88c8a09e7339910a7c941932e44b8be56f1fccde", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjPy601JMIrmSUp+UPjzgstEmCFUB\n1uPt1PHb90vcoh6vslmxuhecrAno5DqIyKCeczmRCnyUGTLkS4vlbx/M3g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 427, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020105", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fbb51127e1f1b6a38e9fe9a2544614edb8e43ad7cd8c56f14b3235dda3bc11179abd9753a9e647e9340c395fb2b91384d6d33fcb6456214350b6f3fa00f4364c", + "wx" : "00fbb51127e1f1b6a38e9fe9a2544614edb8e43ad7cd8c56f14b3235dda3bc1117", + "wy" : "009abd9753a9e647e9340c395fb2b91384d6d33fcb6456214350b6f3fa00f4364c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fbb51127e1f1b6a38e9fe9a2544614edb8e43ad7cd8c56f14b3235dda3bc11179abd9753a9e647e9340c395fb2b91384d6d33fcb6456214350b6f3fa00f4364c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+7URJ+HxtqOOn+miVEYU7bjkOtfN\njFbxSzI13aO8EReavZdTqeZH6TQMOV+yuROE1tM/y2RWIUNQtvP6APQ2TA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 428, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020105020106", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cba74b6b024a29a173df9abb9593294a6b8e83efd7f48d67311dcfb557ca80b8e68417e9afb0494417a568129701137effb2174b5c50bb8adf716a4a5ca95d0c", + "wx" : "00cba74b6b024a29a173df9abb9593294a6b8e83efd7f48d67311dcfb557ca80b8", + "wy" : "00e68417e9afb0494417a568129701137effb2174b5c50bb8adf716a4a5ca95d0c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cba74b6b024a29a173df9abb9593294a6b8e83efd7f48d67311dcfb557ca80b8e68417e9afb0494417a568129701137effb2174b5c50bb8adf716a4a5ca95d0c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEy6dLawJKKaFz35q7lZMpSmuOg+/X\n9I1nMR3PtVfKgLjmhBfpr7BJRBelaBKXARN+/7IXS1xQu4rfcWpKXKldDA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 429, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020101", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ea4518f4df8b277eb5ad16cb6bf851e841cedccd99c95c28f681c18a643d15ce4077c637f77b4da58ac8c9ab59523ebb0619d97dca2df1cb8a457b160af1adb9", + "wx" : "00ea4518f4df8b277eb5ad16cb6bf851e841cedccd99c95c28f681c18a643d15ce", + "wy" : "4077c637f77b4da58ac8c9ab59523ebb0619d97dca2df1cb8a457b160af1adb9" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ea4518f4df8b277eb5ad16cb6bf851e841cedccd99c95c28f681c18a643d15ce4077c637f77b4da58ac8c9ab59523ebb0619d97dca2df1cb8a457b160af1adb9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE6kUY9N+LJ361rRbLa/hR6EHO3M2Z\nyVwo9oHBimQ9Fc5Ad8Y393tNpYrIyatZUj67BhnZfcot8cuKRXsWCvGtuQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 430, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020103", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e148d9966e5b9b536380927de72e59a6655e7070091b25b47b44fdb2a8bd390f35259cd39d6f6ed62340d12152b0fdc1702be5ebdb8f0061d6607b05ca3d7b1b", + "wx" : "00e148d9966e5b9b536380927de72e59a6655e7070091b25b47b44fdb2a8bd390f", + "wy" : "35259cd39d6f6ed62340d12152b0fdc1702be5ebdb8f0061d6607b05ca3d7b1b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e148d9966e5b9b536380927de72e59a6655e7070091b25b47b44fdb2a8bd390f35259cd39d6f6ed62340d12152b0fdc1702be5ebdb8f0061d6607b05ca3d7b1b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4UjZlm5bm1NjgJJ95y5ZpmVecHAJ\nGyW0e0T9sqi9OQ81JZzTnW9u1iNA0SFSsP3BcCvl69uPAGHWYHsFyj17Gw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 431, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020106", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a61edf1f6e011a27b9fb4e43ca2ef58c1dd6a7f5cf9e89a678d87b2f9a6d8a80b6e5624c5ef144000bde93ccec7ec58b3c646b42e3d92806b281f35c62c39ccf", + "wx" : "00a61edf1f6e011a27b9fb4e43ca2ef58c1dd6a7f5cf9e89a678d87b2f9a6d8a80", + "wy" : "00b6e5624c5ef144000bde93ccec7ec58b3c646b42e3d92806b281f35c62c39ccf" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a61edf1f6e011a27b9fb4e43ca2ef58c1dd6a7f5cf9e89a678d87b2f9a6d8a80b6e5624c5ef144000bde93ccec7ec58b3c646b42e3d92806b281f35c62c39ccf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEph7fH24BGie5+05Dyi71jB3Wp/XP\nnommeNh7L5ptioC25WJMXvFEAAvek8zsfsWLPGRrQuPZKAaygfNcYsOczw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 432, + "comment" : "small r and s", + "flags" : [ + "SmallRandS", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3006020106020107", + "result" : "valid" + }, + { + "tcId" : 433, + "comment" : "r is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632557020107", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a1ff55a03cd061f2408c0ada1ae9f7197f53ef84190564fd3dace78839bc6420178e94a5d6028186997cd36f3c8d2631a272d7936b2cfb3d62730f8c0fe80983", + "wx" : "00a1ff55a03cd061f2408c0ada1ae9f7197f53ef84190564fd3dace78839bc6420", + "wy" : "178e94a5d6028186997cd36f3c8d2631a272d7936b2cfb3d62730f8c0fe80983" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a1ff55a03cd061f2408c0ada1ae9f7197f53ef84190564fd3dace78839bc6420178e94a5d6028186997cd36f3c8d2631a272d7936b2cfb3d62730f8c0fe80983", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEof9VoDzQYfJAjAraGun3GX9T74QZ\nBWT9PazniDm8ZCAXjpSl1gKBhpl80288jSYxonLXk2ss+z1icw+MD+gJgw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 434, + "comment" : "s is larger than n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3026020106022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc75fbd8", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041b824a11eed94fbcd9b722d06613bbcf7eca00b9136f2652642178f37b1a920ee900de495d9ef56fa6d19f3dd1e0edb23d23835ac8c2d3d13c0227e852e503eb", + "wx" : "1b824a11eed94fbcd9b722d06613bbcf7eca00b9136f2652642178f37b1a920e", + "wy" : "00e900de495d9ef56fa6d19f3dd1e0edb23d23835ac8c2d3d13c0227e852e503eb" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041b824a11eed94fbcd9b722d06613bbcf7eca00b9136f2652642178f37b1a920ee900de495d9ef56fa6d19f3dd1e0edb23d23835ac8c2d3d13c0227e852e503eb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEG4JKEe7ZT7zZtyLQZhO7z37KALkT\nbyZSZCF483sakg7pAN5JXZ71b6bRnz3R4O2yPSODWsjC09E8AifoUuUD6w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 435, + "comment" : "small r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3027020201000221008f1e3c7862c58b16bb76eddbb76eddbb516af4f63f2d74d76e0d28c9bb75ea88", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042914b30c4c784696ffc3dddcec05f36cb1488bc342b9f529d5387acb9e48cb8d3dbd30d0d5d6d6a39108863c2d6a6e8571cd3261fb9eb98ce46125bd8f139136", + "wx" : "2914b30c4c784696ffc3dddcec05f36cb1488bc342b9f529d5387acb9e48cb8d", + "wy" : "3dbd30d0d5d6d6a39108863c2d6a6e8571cd3261fb9eb98ce46125bd8f139136" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042914b30c4c784696ffc3dddcec05f36cb1488bc342b9f529d5387acb9e48cb8d3dbd30d0d5d6d6a39108863c2d6a6e8571cd3261fb9eb98ce46125bd8f139136", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKRSzDEx4Rpb/w93c7AXzbLFIi8NC\nufUp1Th6y55Iy409vTDQ1dbWo5EIhjwtam6Fcc0yYfueuYzkYSW9jxORNg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 436, + "comment" : "smallish r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302c02072d9b4d347952d6022100ef3043e7329581dbb3974497710ab11505ee1c87ff907beebadd195a0ffe6d7a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042579f546fe2f2aeb5f822feb28f2f8371618d04815455a7e903c10024a17da415528e951147f76bee1314e65a49c6ec70686e62d38fbc23472f96e3d3b33fd1f", + "wx" : "2579f546fe2f2aeb5f822feb28f2f8371618d04815455a7e903c10024a17da41", + "wy" : "5528e951147f76bee1314e65a49c6ec70686e62d38fbc23472f96e3d3b33fd1f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042579f546fe2f2aeb5f822feb28f2f8371618d04815455a7e903c10024a17da415528e951147f76bee1314e65a49c6ec70686e62d38fbc23472f96e3d3b33fd1f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJXn1Rv4vKutfgi/rKPL4NxYY0EgV\nRVp+kDwQAkoX2kFVKOlRFH92vuExTmWknG7HBobmLTj7wjRy+W49OzP9Hw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 437, + "comment" : "100-bit r and small s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d1033e67e37b32b445580bf4eff0221008b748b74000000008b748b748b748b7466e769ad4a16d3dcd87129b8e91d1b4d", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b102196bf455ee5aafc6f895504d3c3b6b2d37c35f8669bd0f0b694795fbd992f777b6f829b9628ac35db0ef43f6a89f0a42812614e4c15924d8d47ebe45bae5", + "wx" : "00b102196bf455ee5aafc6f895504d3c3b6b2d37c35f8669bd0f0b694795fbd992", + "wy" : "00f777b6f829b9628ac35db0ef43f6a89f0a42812614e4c15924d8d47ebe45bae5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b102196bf455ee5aafc6f895504d3c3b6b2d37c35f8669bd0f0b694795fbd992f777b6f829b9628ac35db0ef43f6a89f0a42812614e4c15924d8d47ebe45bae5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsQIZa/RV7lqvxviVUE08O2stN8Nf\nhmm9DwtpR5X72ZL3d7b4KbliisNdsO9D9qifCkKBJhTkwVkk2NR+vkW65Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 438, + "comment" : "small r and 100 bit s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302702020100022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044d056ab2ff57662fd6eebbe23930fef5cd08083e24146190cd01960b1fcd3749fe7ec5847651c857898be0f09efd6e0116a5dbe327f6f3080a65fc966bf64d91", + "wx" : "4d056ab2ff57662fd6eebbe23930fef5cd08083e24146190cd01960b1fcd3749", + "wy" : "00fe7ec5847651c857898be0f09efd6e0116a5dbe327f6f3080a65fc966bf64d91" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044d056ab2ff57662fd6eebbe23930fef5cd08083e24146190cd01960b1fcd3749fe7ec5847651c857898be0f09efd6e0116a5dbe327f6f3080a65fc966bf64d91", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETQVqsv9XZi/W7rviOTD+9c0ICD4k\nFGGQzQGWCx/NN0n+fsWEdlHIV4mL4PCe/W4BFqXb4yf28wgKZfyWa/ZNkQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 439, + "comment" : "100-bit r and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3032020d062522bbd3ecbe7c39e93e7c25022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04361c4a62cd867613138dfe24ccebc4b7df1b55fc7410f4995ee2b6b9ab2220584f116c6c84e53d262fd13a5f5de6b57e7a1981de4ecdffdf3323b4e91d80649c", + "wx" : "361c4a62cd867613138dfe24ccebc4b7df1b55fc7410f4995ee2b6b9ab222058", + "wy" : "4f116c6c84e53d262fd13a5f5de6b57e7a1981de4ecdffdf3323b4e91d80649c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004361c4a62cd867613138dfe24ccebc4b7df1b55fc7410f4995ee2b6b9ab2220584f116c6c84e53d262fd13a5f5de6b57e7a1981de4ecdffdf3323b4e91d80649c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENhxKYs2GdhMTjf4kzOvEt98bVfx0\nEPSZXuK2uasiIFhPEWxshOU9Ji/ROl9d5rV+ehmB3k7N/98zI7TpHYBknA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 440, + "comment" : "r and s^-1 are close to n", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d50220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048156a2127c4c46a1ecf24c0522b85fabe94e6c8b9d962420b2acc9e2b6291af05235bf5dc5ccdd1bd333bce846197de363ba0dc158ef0f0174d714a09e76a66f", + "wx" : "008156a2127c4c46a1ecf24c0522b85fabe94e6c8b9d962420b2acc9e2b6291af0", + "wy" : "5235bf5dc5ccdd1bd333bce846197de363ba0dc158ef0f0174d714a09e76a66f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048156a2127c4c46a1ecf24c0522b85fabe94e6c8b9d962420b2acc9e2b6291af05235bf5dc5ccdd1bd333bce846197de363ba0dc158ef0f0174d714a09e76a66f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgVaiEnxMRqHs8kwFIrhfq+lObIud\nliQgsqzJ4rYpGvBSNb9dxczdG9MzvOhGGX3jY7oNwVjvDwF01xSgnnambw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 441, + "comment" : "r and s are 64-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30160209009c44febf31c3594f020900839ed28247c2b06b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cb180dda5ed44ca0f78cc19c6659c88451b4d0084a4a904cb2dc770f78318613fae0bd290165858bd670788f5f78ad7806b49a2b932409e3dfb7195ccafaad0d", + "wx" : "00cb180dda5ed44ca0f78cc19c6659c88451b4d0084a4a904cb2dc770f78318613", + "wy" : "00fae0bd290165858bd670788f5f78ad7806b49a2b932409e3dfb7195ccafaad0d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cb180dda5ed44ca0f78cc19c6659c88451b4d0084a4a904cb2dc770f78318613fae0bd290165858bd670788f5f78ad7806b49a2b932409e3dfb7195ccafaad0d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEyxgN2l7UTKD3jMGcZlnIhFG00AhK\nSpBMstx3D3gxhhP64L0pAWWFi9ZweI9feK14BrSaK5MkCePftxlcyvqtDQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 442, + "comment" : "r and s are 100-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "301e020d09df8b682430beef6f5fd7c7cd020d0fd0a62e13778f4222a0d61c8a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0417e9a8ed4d6141f99dcc7794468576b16a9404c82a1969b91db0ca7534a5e00bbc4edd49e6dcf0476bd986551c3adccd4ddcdcdee6eb567cb68d925b4674113d", + "wx" : "17e9a8ed4d6141f99dcc7794468576b16a9404c82a1969b91db0ca7534a5e00b", + "wy" : "00bc4edd49e6dcf0476bd986551c3adccd4ddcdcdee6eb567cb68d925b4674113d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000417e9a8ed4d6141f99dcc7794468576b16a9404c82a1969b91db0ca7534a5e00bbc4edd49e6dcf0476bd986551c3adccd4ddcdcdee6eb567cb68d925b4674113d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEF+mo7U1hQfmdzHeURoV2sWqUBMgq\nGWm5HbDKdTSl4Au8Tt1J5tzwR2vZhlUcOtzNTdzc3ubrVny2jZJbRnQRPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 443, + "comment" : "r and s are 128-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30260211008a598e563a89f526c32ebec8de26367c02110084f633e2042630e99dd0f1e16f7a04bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f123d6999fec34a68c99539d2c9d50268fcdfafa99215d900c93c0c59bd34d933095156ba887f0f965804af24995cf5572553e6adb04da368a90419e523185ce", + "wx" : "00f123d6999fec34a68c99539d2c9d50268fcdfafa99215d900c93c0c59bd34d93", + "wy" : "3095156ba887f0f965804af24995cf5572553e6adb04da368a90419e523185ce" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f123d6999fec34a68c99539d2c9d50268fcdfafa99215d900c93c0c59bd34d933095156ba887f0f965804af24995cf5572553e6adb04da368a90419e523185ce", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8SPWmZ/sNKaMmVOdLJ1QJo/N+vqZ\nIV2QDJPAxZvTTZMwlRVrqIfw+WWASvJJlc9VclU+atsE2jaKkEGeUjGFzg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 444, + "comment" : "r and s are 160-bit integer", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04db9d5c5113f00822a146c9cda2e75cb6634cd0dff54aff6e22875171f57a0dad1c424cdd83eb01c02f6f8d36f42c6dc7e39db74358da8ac9bc9dc5890d46f667", + "wx" : "00db9d5c5113f00822a146c9cda2e75cb6634cd0dff54aff6e22875171f57a0dad", + "wy" : "1c424cdd83eb01c02f6f8d36f42c6dc7e39db74358da8ac9bc9dc5890d46f667" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004db9d5c5113f00822a146c9cda2e75cb6634cd0dff54aff6e22875171f57a0dad1c424cdd83eb01c02f6f8d36f42c6dc7e39db74358da8ac9bc9dc5890d46f667", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE251cURPwCCKhRsnNoudctmNM0N/1\nSv9uIodRcfV6Da0cQkzdg+sBwC9vjTb0LG3H4523Q1jaism8ncWJDUb2Zw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 445, + "comment" : "s == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020101", + "result" : "valid" + }, + { + "tcId" : 446, + "comment" : "s == 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020100", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044d9cddf6b4ff05cdf5f557a32db1712e49ab45ae53ade49b9469e665ffa2db773ead4c88e83f38cd16d61dda97645355424279e5132dfec14421cabfc1203a6b", + "wx" : "4d9cddf6b4ff05cdf5f557a32db1712e49ab45ae53ade49b9469e665ffa2db77", + "wy" : "3ead4c88e83f38cd16d61dda97645355424279e5132dfec14421cabfc1203a6b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044d9cddf6b4ff05cdf5f557a32db1712e49ab45ae53ade49b9469e665ffa2db773ead4c88e83f38cd16d61dda97645355424279e5132dfec14421cabfc1203a6b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETZzd9rT/Bc319VejLbFxLkmrRa5T\nreSblGnmZf+i23c+rUyI6D84zRbWHdqXZFNVQkJ55RMt/sFEIcq/wSA6aw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 447, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022002f676969f451a8ccafa4c4f09791810e6d632dbd60b1d5540f3284fbe1889b0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045eb0559c2fde581a0df6207f3b2872d8e80a1ec8f6d542bf0319ec254c1c23ea272a1ab985cdfab8573a797ed554e137bda258ae3c841ccbf6559187b3471233", + "wx" : "5eb0559c2fde581a0df6207f3b2872d8e80a1ec8f6d542bf0319ec254c1c23ea", + "wy" : "272a1ab985cdfab8573a797ed554e137bda258ae3c841ccbf6559187b3471233" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045eb0559c2fde581a0df6207f3b2872d8e80a1ec8f6d542bf0319ec254c1c23ea272a1ab985cdfab8573a797ed554e137bda258ae3c841ccbf6559187b3471233", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXrBVnC/eWBoN9iB/Oyhy2OgKHsj2\n1UK/AxnsJUwcI+onKhq5hc36uFc6eX7VVOE3vaJYrjyEHMv2VZGHs0cSMw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 448, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204e260962e33362ef0046126d2d5a4edc6947ab20e19b8ec19cf79e5908b6e628", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042cb4debf57562b9aa191e38d101c51d8bd3eedf242a1123cd3c6060526c4dd2bdc6abd94d54374aede721d0c78193e9b999508a9f2a9ae8737f87a5fc7e0c673", + "wx" : "2cb4debf57562b9aa191e38d101c51d8bd3eedf242a1123cd3c6060526c4dd2b", + "wy" : "00dc6abd94d54374aede721d0c78193e9b999508a9f2a9ae8737f87a5fc7e0c673" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042cb4debf57562b9aa191e38d101c51d8bd3eedf242a1123cd3c6060526c4dd2bdc6abd94d54374aede721d0c78193e9b999508a9f2a9ae8737f87a5fc7e0c673", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELLTev1dWK5qhkeONEBxR2L0+7fJC\noRI808YGBSbE3Svcar2U1UN0rt5yHQx4GT6bmZUIqfKproc3+Hpfx+DGcw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 449, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220077ed0d8f20f697d8fc591ac64dd5219c7932122b4f9b9ec6441e44a0092cf21", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0463d556714900ed08e751f58c1978c1a673c9a9bf975fc4b8af32c2e7944f21d4c2cdf2e7b72fcffe3e8767dc769856ef9fec98ef0139b22f87166300a3781599", + "wx" : "63d556714900ed08e751f58c1978c1a673c9a9bf975fc4b8af32c2e7944f21d4", + "wy" : "00c2cdf2e7b72fcffe3e8767dc769856ef9fec98ef0139b22f87166300a3781599" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000463d556714900ed08e751f58c1978c1a673c9a9bf975fc4b8af32c2e7944f21d4c2cdf2e7b72fcffe3e8767dc769856ef9fec98ef0139b22f87166300a3781599", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY9VWcUkA7QjnUfWMGXjBpnPJqb+X\nX8S4rzLC55RPIdTCzfLnty/P/j6HZ9x2mFbvn+yY7wE5si+HFmMAo3gVmQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 450, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203e0292a67e181c6c0105ee35e956e78e9bdd033c6e71ae57884039a245e4175f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040d09be47824c5c23f727bfb550c6dbbdf90abb35d3623013f1c6d7d31be03d95845fede0a0f580dff795e7d5b278a2c78bfa5c4facd1fccfe190ec8eef206778", + "wx" : "0d09be47824c5c23f727bfb550c6dbbdf90abb35d3623013f1c6d7d31be03d95", + "wy" : "00845fede0a0f580dff795e7d5b278a2c78bfa5c4facd1fccfe190ec8eef206778" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040d09be47824c5c23f727bfb550c6dbbdf90abb35d3623013f1c6d7d31be03d95845fede0a0f580dff795e7d5b278a2c78bfa5c4facd1fccfe190ec8eef206778", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDQm+R4JMXCP3J7+1UMbbvfkKuzXT\nYjAT8cbX0xvgPZWEX+3goPWA3/eV59WyeKLHi/pcT6zR/M/hkOyO7yBneA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 451, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022013d22b06d6b8f5d97e0c64962b4a3bae30f668ca6217ef5b35d799f159e23ebe", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0435b75a83731a5b56325add4f28a09742039e0e62f75728e896783fd957400d5be3f3fa5269577faa7089e9c8e9d9f732ef78d433e4be382820323c197c5bbc39", + "wx" : "35b75a83731a5b56325add4f28a09742039e0e62f75728e896783fd957400d5b", + "wy" : "00e3f3fa5269577faa7089e9c8e9d9f732ef78d433e4be382820323c197c5bbc39" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000435b75a83731a5b56325add4f28a09742039e0e62f75728e896783fd957400d5be3f3fa5269577faa7089e9c8e9d9f732ef78d433e4be382820323c197c5bbc39", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENbdag3MaW1YyWt1PKKCXQgOeDmL3\nVyjolng/2VdADVvj8/pSaVd/qnCJ6cjp2fcy73jUM+S+OCggMjwZfFu8OQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 452, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204523ce342e4994bb8968bf6613f60c06c86111f15a3a389309e72cd447d5dd99", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fdd28d47e3d60ed4c7fd48e68003f48c5346354ecae2e4b1b4ff43ecd6058fcb010d7e9f008ae48f88a90640999a931ee47d77b2cfb442c614b14054af2c9ddf", + "wx" : "00fdd28d47e3d60ed4c7fd48e68003f48c5346354ecae2e4b1b4ff43ecd6058fcb", + "wy" : "010d7e9f008ae48f88a90640999a931ee47d77b2cfb442c614b14054af2c9ddf" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fdd28d47e3d60ed4c7fd48e68003f48c5346354ecae2e4b1b4ff43ecd6058fcb010d7e9f008ae48f88a90640999a931ee47d77b2cfb442c614b14054af2c9ddf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/dKNR+PWDtTH/UjmgAP0jFNGNU7K\n4uSxtP9D7NYFj8sBDX6fAIrkj4ipBkCZmpMe5H13ss+0QsYUsUBUryyd3w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 453, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022037d765be3c9c78189ad30edb5097a4db670de11686d01420e37039d4677f4809", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0473d914dde798f430d51de4e43b3cc5aa557fc4797d9a1820813509979efe3753089ffa286ba30505e3a9ae5c9587854ddb3de2a04ee7a0dbed0dfb087e2d190b", + "wx" : "73d914dde798f430d51de4e43b3cc5aa557fc4797d9a1820813509979efe3753", + "wy" : "089ffa286ba30505e3a9ae5c9587854ddb3de2a04ee7a0dbed0dfb087e2d190b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000473d914dde798f430d51de4e43b3cc5aa557fc4797d9a1820813509979efe3753089ffa286ba30505e3a9ae5c9587854ddb3de2a04ee7a0dbed0dfb087e2d190b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEc9kU3eeY9DDVHeTkOzzFqlV/xHl9\nmhgggTUJl57+N1MIn/ooa6MFBeOprlyVh4VN2z3ioE7noNvtDfsIfi0ZCw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 454, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022044237823b54e0c74c2bf5f759d9ac5f8cb897d537ffa92effd4f0bb6c9acd860", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0424861819b9fb20fb1fcc75eb7a44b2abbb36047812429119ba5b232dfc1ad3c244ec4740e65634fae7d692ea166cb4640201486845c2fb96d4f49beaecc3289a", + "wx" : "24861819b9fb20fb1fcc75eb7a44b2abbb36047812429119ba5b232dfc1ad3c2", + "wy" : "44ec4740e65634fae7d692ea166cb4640201486845c2fb96d4f49beaecc3289a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000424861819b9fb20fb1fcc75eb7a44b2abbb36047812429119ba5b232dfc1ad3c244ec4740e65634fae7d692ea166cb4640201486845c2fb96d4f49beaecc3289a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJIYYGbn7IPsfzHXrekSyq7s2BHgS\nQpEZulsjLfwa08JE7EdA5lY0+ufWkuoWbLRkAgFIaEXC+5bU9Jvq7MMomg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 455, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220266d30a485385906054ca86d46f5f2b17e7f4646a3092092ad92877126538111", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04de056c8c24eb527ad5021ddcf3b16b099b668a03f7da03075f410a0770347bde01880d2a7b162491221c0b370fe81f28924422a4c70117682b898bc325791ce4", + "wx" : "00de056c8c24eb527ad5021ddcf3b16b099b668a03f7da03075f410a0770347bde", + "wy" : "01880d2a7b162491221c0b370fe81f28924422a4c70117682b898bc325791ce4" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004de056c8c24eb527ad5021ddcf3b16b099b668a03f7da03075f410a0770347bde01880d2a7b162491221c0b370fe81f28924422a4c70117682b898bc325791ce4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3gVsjCTrUnrVAh3c87FrCZtmigP3\n2gMHX0EKB3A0e94BiA0qexYkkSIcCzcP6B8okkQipMcBF2griYvDJXkc5A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 456, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220538c7b3798e84d0ce90340165806348971ed44db8f0c674f5f215968390f92ee", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cf2de76812f62ecd4e7d8e674d1b79dddbdca18677c8ba338a71b65134d0429fad6d87d6d6592ba1130b81198f6fbe39719cb872d30fc1757af2ae86307b3f9e", + "wx" : "00cf2de76812f62ecd4e7d8e674d1b79dddbdca18677c8ba338a71b65134d0429f", + "wy" : "00ad6d87d6d6592ba1130b81198f6fbe39719cb872d30fc1757af2ae86307b3f9e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cf2de76812f62ecd4e7d8e674d1b79dddbdca18677c8ba338a71b65134d0429fad6d87d6d6592ba1130b81198f6fbe39719cb872d30fc1757af2ae86307b3f9e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzy3naBL2Ls1OfY5nTRt53dvcoYZ3\nyLozinG2UTTQQp+tbYfW1lkroRMLgRmPb745cZy4ctMPwXV68q6GMHs/ng==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 457, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206fef0ef15d1688e15e704c4e6bb8bb7f40d52d3af5c661bb78c4ed9b408699b3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0428d9b9fe0d3c2471f224476eb89c13fa68b433213c31b6376b16226abfeae1c636fef52918dd106cd21958f1f379b09278051472309731ea1192121b3b78f873", + "wx" : "28d9b9fe0d3c2471f224476eb89c13fa68b433213c31b6376b16226abfeae1c6", + "wy" : "36fef52918dd106cd21958f1f379b09278051472309731ea1192121b3b78f873" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000428d9b9fe0d3c2471f224476eb89c13fa68b433213c31b6376b16226abfeae1c636fef52918dd106cd21958f1f379b09278051472309731ea1192121b3b78f873", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKNm5/g08JHHyJEduuJwT+mi0MyE8\nMbY3axYiar/q4cY2/vUpGN0QbNIZWPHzebCSeAUUcjCXMeoRkhIbO3j4cw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 458, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206f44275e9aeb1331efcb8d58f35c0252791427e403ad84daad51d247cc2a64c6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04334ddf8629f0b980796f255e650e247598f6f71e90c501dd11fcb58ea1e6c0a39215c31a4741e4b28657fc7ddb490c0e2a21c7b770460301344dbdd67e85f30d", + "wx" : "334ddf8629f0b980796f255e650e247598f6f71e90c501dd11fcb58ea1e6c0a3", + "wy" : "009215c31a4741e4b28657fc7ddb490c0e2a21c7b770460301344dbdd67e85f30d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004334ddf8629f0b980796f255e650e247598f6f71e90c501dd11fcb58ea1e6c0a39215c31a4741e4b28657fc7ddb490c0e2a21c7b770460301344dbdd67e85f30d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEM03fhinwuYB5byVeZQ4kdZj29x6Q\nxQHdEfy1jqHmwKOSFcMaR0HksoZX/H3bSQwOKiHHt3BGAwE0Tb3WfoXzDQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 459, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022021323755b103d2f9da6ab83eccab9ad8598bcf625652f10e7a3eeee3c3945fb3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "048e889d0a2530f73421ad2e08302651f41ddeb1ae5083ce7e313e06d6928c375afeca9b4490f6aa5e8d45d187ec8d3ab699f29c0cc77386c56f93f2f39e0f2874", + "wx" : "008e889d0a2530f73421ad2e08302651f41ddeb1ae5083ce7e313e06d6928c375a", + "wy" : "00feca9b4490f6aa5e8d45d187ec8d3ab699f29c0cc77386c56f93f2f39e0f2874" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200048e889d0a2530f73421ad2e08302651f41ddeb1ae5083ce7e313e06d6928c375afeca9b4490f6aa5e8d45d187ec8d3ab699f29c0cc77386c56f93f2f39e0f2874", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjoidCiUw9zQhrS4IMCZR9B3esa5Q\ng85+MT4G1pKMN1r+yptEkPaqXo1F0YfsjTq2mfKcDMdzhsVvk/Lzng8odA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 460, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206c50acfe76de1289e7a5edb240f1c2a7879db6873d5d931f3c6ac467a6eac171", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04297ef19b14f0dfb7c4a294732096ed4304bc5e2eeb86581e0014ddb6e14920878bf2260ecb396e33383c4898bd954dd3c6e7bcdd7810ad0a649f97722bad0095", + "wx" : "297ef19b14f0dfb7c4a294732096ed4304bc5e2eeb86581e0014ddb6e1492087", + "wy" : "008bf2260ecb396e33383c4898bd954dd3c6e7bcdd7810ad0a649f97722bad0095" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004297ef19b14f0dfb7c4a294732096ed4304bc5e2eeb86581e0014ddb6e14920878bf2260ecb396e33383c4898bd954dd3c6e7bcdd7810ad0a649f97722bad0095", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKX7xmxTw37fEopRzIJbtQwS8Xi7r\nhlgeABTdtuFJIIeL8iYOyzluMzg8SJi9lU3Txue83XgQrQpkn5dyK60AlQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 461, + "comment" : "edge case modular inverse", + "flags" : [ + "ModularInverse", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220755b7fffb0b17ad57dca50fcefb7fe297b029df25e5ccb5069e8e70c2742c2a6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0499f19f07b33e03caf4703e04b930d57d6d9baa44460c596a2d3064e0b63ea41286a74c4612a812ee348d2b43f80de627c11c75d81511e22a199c32119b792c6a", + "wx" : "0099f19f07b33e03caf4703e04b930d57d6d9baa44460c596a2d3064e0b63ea412", + "wy" : "0086a74c4612a812ee348d2b43f80de627c11c75d81511e22a199c32119b792c6a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000499f19f07b33e03caf4703e04b930d57d6d9baa44460c596a2d3064e0b63ea41286a74c4612a812ee348d2b43f80de627c11c75d81511e22a199c32119b792c6a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmfGfB7M+A8r0cD4EuTDVfW2bqkRG\nDFlqLTBk4LY+pBKGp0xGEqgS7jSNK0P4DeYnwRx12BUR4ioZnDIRm3ksag==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 462, + "comment" : "point at infinity during verify", + "flags" : [ + "PointDuplication", + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a80220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04313f3309b236484c6eb4ea381e007854467a617343a2e97d845801c01a632cfe33f231854bba89a8ca3f802a2764d3bf6c3233c811a31e5e8028a0b862cb1977", + "wx" : "313f3309b236484c6eb4ea381e007854467a617343a2e97d845801c01a632cfe", + "wy" : "33f231854bba89a8ca3f802a2764d3bf6c3233c811a31e5e8028a0b862cb1977" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004313f3309b236484c6eb4ea381e007854467a617343a2e97d845801c01a632cfe33f231854bba89a8ca3f802a2764d3bf6c3233c811a31e5e8028a0b862cb1977", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEMT8zCbI2SExutOo4HgB4VEZ6YXND\noul9hFgBwBpjLP4z8jGFS7qJqMo/gConZNO/bDIzyBGjHl6AKKC4YssZdw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 463, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04d3aa01fe59bad92cffe3db59e1385391fafd7af4e4ce462e8aac157274cc8a05c7a7e603e18538aac15f89610beacc21e39898e6c5f7680a81c5bd7bd744a989", + "wx" : "00d3aa01fe59bad92cffe3db59e1385391fafd7af4e4ce462e8aac157274cc8a05", + "wy" : "00c7a7e603e18538aac15f89610beacc21e39898e6c5f7680a81c5bd7bd744a989" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004d3aa01fe59bad92cffe3db59e1385391fafd7af4e4ce462e8aac157274cc8a05c7a7e603e18538aac15f89610beacc21e39898e6c5f7680a81c5bd7bd744a989", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE06oB/lm62Sz/49tZ4ThTkfr9evTk\nzkYuiqwVcnTMigXHp+YD4YU4qsFfiWEL6swh45iY5sX3aAqBxb1710SpiQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 464, + "comment" : "edge case for signature malleability", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "045e31eccd4704ebf7a4247ea57f9351abadff63679f2276e2a3b05009ebc1b8df648465a925010db823b2a5f3a6072343a6cc9961a9c482399d0d82051c2e3232", + "wx" : "5e31eccd4704ebf7a4247ea57f9351abadff63679f2276e2a3b05009ebc1b8df", + "wy" : "648465a925010db823b2a5f3a6072343a6cc9961a9c482399d0d82051c2e3232" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200045e31eccd4704ebf7a4247ea57f9351abadff63679f2276e2a3b05009ebc1b8df648465a925010db823b2a5f3a6072343a6cc9961a9c482399d0d82051c2e3232", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXjHszUcE6/ekJH6lf5NRq63/Y2ef\nInbio7BQCevBuN9khGWpJQENuCOypfOmByNDpsyZYanEgjmdDYIFHC4yMg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 465, + "comment" : "u1 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022043f800fbeaf9238c58af795bcdad04bc49cd850c394d3382953356b023210281", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ce0a47f881fd7315a733c4317848fa33c72e38de0b8fda36b61aa9a164f5808a85b05d25115ea4097ddf63f878c8e83657e66de136a8f9e62ed81a58bf117ff9", + "wx" : "00ce0a47f881fd7315a733c4317848fa33c72e38de0b8fda36b61aa9a164f5808a", + "wy" : "0085b05d25115ea4097ddf63f878c8e83657e66de136a8f9e62ed81a58bf117ff9" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ce0a47f881fd7315a733c4317848fa33c72e38de0b8fda36b61aa9a164f5808a85b05d25115ea4097ddf63f878c8e83657e66de136a8f9e62ed81a58bf117ff9", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzgpH+IH9cxWnM8QxeEj6M8cuON4L\nj9o2thqpoWT1gIqFsF0lEV6kCX3fY/h4yOg2V+Zt4Tao+eYu2BpYvxF/+Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 466, + "comment" : "u1 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100bc07ff031506dc74a75086a43252fb43731975a16dca6b025e867412d94222d0", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04cd6f487b47f36c0dea8f4b04c4e6ac637c76b725929c611f48addcf3d2f65941b50ea8f3a491190ee0b20cfb6efd113608e7c7c127577500e7f5c4a4e490fd60", + "wx" : "00cd6f487b47f36c0dea8f4b04c4e6ac637c76b725929c611f48addcf3d2f65941", + "wy" : "00b50ea8f3a491190ee0b20cfb6efd113608e7c7c127577500e7f5c4a4e490fd60" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004cd6f487b47f36c0dea8f4b04c4e6ac637c76b725929c611f48addcf3d2f65941b50ea8f3a491190ee0b20cfb6efd113608e7c7c127577500e7f5c4a4e490fd60", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzW9Ie0fzbA3qj0sExOasY3x2tyWS\nnGEfSK3c89L2WUG1DqjzpJEZDuCyDPtu/RE2COfHwSdXdQDn9cSk5JD9YA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 467, + "comment" : "u2 == 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04456e5f8067d68a1b0a2e8fe2b28acad5755687154a0f167734ebabbdc059070d720dbe96659a66ef0cf27a73e7b3f3f145a60e0ad29f1e21dcc2bb42f0d82c1e", + "wx" : "456e5f8067d68a1b0a2e8fe2b28acad5755687154a0f167734ebabbdc059070d", + "wy" : "720dbe96659a66ef0cf27a73e7b3f3f145a60e0ad29f1e21dcc2bb42f0d82c1e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004456e5f8067d68a1b0a2e8fe2b28acad5755687154a0f167734ebabbdc059070d720dbe96659a66ef0cf27a73e7b3f3f145a60e0ad29f1e21dcc2bb42f0d82c1e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERW5fgGfWihsKLo/isorK1XVWhxVK\nDxZ3NOurvcBZBw1yDb6WZZpm7wzyenPns/PxRaYOCtKfHiHcwrtC8NgsHg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 468, + "comment" : "u2 == n - 1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0442bf0c0ac1e3850baf5515748a878e34249f71035e20a9f54ed468ec273cb0fc5b3138500230055c71f12d53f5c7d0e3d8aa54a94c668cb311e20d195fc71abb", + "wx" : "42bf0c0ac1e3850baf5515748a878e34249f71035e20a9f54ed468ec273cb0fc", + "wy" : "5b3138500230055c71f12d53f5c7d0e3d8aa54a94c668cb311e20d195fc71abb" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000442bf0c0ac1e3850baf5515748a878e34249f71035e20a9f54ed468ec273cb0fc5b3138500230055c71f12d53f5c7d0e3d8aa54a94c668cb311e20d195fc71abb", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQr8MCsHjhQuvVRV0ioeONCSfcQNe\nIKn1TtRo7Cc8sPxbMThQAjAFXHHxLVP1x9Dj2KpUqUxmjLMR4g0ZX8cauw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 469, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02206bfd55a8f8fdb68472e52873ef39ac3eace6d53df576f0ad2da4607bb52c0d46", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04ffdd48da63d3af67223f16c51eb7e95600eb0b0e8b964f4fcd8c534face3c2c2b4e009ab2a76829480e69c9e43b2f1fe076cfafb3fa8d27dd4d6bab4d6c3db54", + "wx" : "00ffdd48da63d3af67223f16c51eb7e95600eb0b0e8b964f4fcd8c534face3c2c2", + "wy" : "00b4e009ab2a76829480e69c9e43b2f1fe076cfafb3fa8d27dd4d6bab4d6c3db54" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004ffdd48da63d3af67223f16c51eb7e95600eb0b0e8b964f4fcd8c534face3c2c2b4e009ab2a76829480e69c9e43b2f1fe076cfafb3fa8d27dd4d6bab4d6c3db54", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/91I2mPTr2ciPxbFHrfpVgDrCw6L\nlk9PzYxTT6zjwsK04AmrKnaClIDmnJ5DsvH+B2z6+z+o0n3U1rq01sPbVA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 470, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220654937791db0686f712ff9b453eeadb0026c9b058bba49199ca3e8fac03c094f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04793cbfce6f335dcfede7c6898ea1c537d7661ed6a8c9d308d64a2560d21c6e2c483d23a5ff05da00eaf9d52cf5362be9b53b95316c6a32e9ebe68d9ac35c2fd6", + "wx" : "793cbfce6f335dcfede7c6898ea1c537d7661ed6a8c9d308d64a2560d21c6e2c", + "wy" : "483d23a5ff05da00eaf9d52cf5362be9b53b95316c6a32e9ebe68d9ac35c2fd6" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004793cbfce6f335dcfede7c6898ea1c537d7661ed6a8c9d308d64a2560d21c6e2c483d23a5ff05da00eaf9d52cf5362be9b53b95316c6a32e9ebe68d9ac35c2fd6", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeTy/zm8zXc/t58aJjqHFN9dmHtao\nydMI1kolYNIcbixIPSOl/wXaAOr51Sz1NivptTuVMWxqMunr5o2aw1wv1g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 471, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100c51bbee23a95437abe5c978f8fe596a31c858ac8d55be9786aa5d36a5ac74e97", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a9f7023f559d4bb6c9f4bc3643e2824aff5451d929479ec3ea5eb30bad2c36ac6a7c77e8dd21f4ad49b103e67da9d3cda62b653dd194fad2ba8d1dd37bb0ea9b", + "wx" : "00a9f7023f559d4bb6c9f4bc3643e2824aff5451d929479ec3ea5eb30bad2c36ac", + "wy" : "6a7c77e8dd21f4ad49b103e67da9d3cda62b653dd194fad2ba8d1dd37bb0ea9b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a9f7023f559d4bb6c9f4bc3643e2824aff5451d929479ec3ea5eb30bad2c36ac6a7c77e8dd21f4ad49b103e67da9d3cda62b653dd194fad2ba8d1dd37bb0ea9b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqfcCP1WdS7bJ9Lw2Q+KCSv9UUdkp\nR57D6l6zC60sNqxqfHfo3SH0rUmxA+Z9qdPNpitlPdGU+tK6jR3Te7Dqmw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 472, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0221008ba4c3da7154ba564ab344ae12005aa482b6c1639ea191f8568afb6e47163c45", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04df79ee082b2fc77e9ce4633471f569bbcb5ce53856e3067774f37e8a64a2c7ffaa488a6c34d499df76f427de3609bfcfd9feae67ffe0b0de594463c453b0ab16", + "wx" : "00df79ee082b2fc77e9ce4633471f569bbcb5ce53856e3067774f37e8a64a2c7ff", + "wy" : "00aa488a6c34d499df76f427de3609bfcfd9feae67ffe0b0de594463c453b0ab16" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004df79ee082b2fc77e9ce4633471f569bbcb5ce53856e3067774f37e8a64a2c7ffaa488a6c34d499df76f427de3609bfcfd9feae67ffe0b0de594463c453b0ab16", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE33nuCCsvx36c5GM0cfVpu8tc5ThW\n4wZ3dPN+imSix/+qSIpsNNSZ33b0J942Cb/P2f6uZ//gsN5ZRGPEU7CrFg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 473, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02204c3dafcf4ba55bf1344ae12005aa4a74f46eaa85f5023131cc637ae2ea90ab26", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044cc3bf65e32e00284adfca00f40df755415c485091ac0489ae9a337103a5f8f0123ab86dd433b933b4f2063c002144df3cfeba78dad0ed89c0377541532908c2", + "wx" : "4cc3bf65e32e00284adfca00f40df755415c485091ac0489ae9a337103a5f8f0", + "wy" : "123ab86dd433b933b4f2063c002144df3cfeba78dad0ed89c0377541532908c2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044cc3bf65e32e00284adfca00f40df755415c485091ac0489ae9a337103a5f8f0123ab86dd433b933b4f2063c002144df3cfeba78dad0ed89c0377541532908c2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETMO/ZeMuAChK38oA9A33VUFcSFCR\nrASJrpozcQOl+PASOrht1DO5M7TyBjwAIUTfPP66eNrQ7YnAN3VBUykIwg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 474, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100987b5f9e974ab7e26895c2400b5494e9e8dd550bea04626398c6f5c5d521564c", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04264a7ad439a4828a9dc97ecf837155355f99ae0b65975f851b541ad3a0e032f067268b7298c73e581866fbcbd161689b16b81cf262e007ce68e25a28c83ef041", + "wx" : "264a7ad439a4828a9dc97ecf837155355f99ae0b65975f851b541ad3a0e032f0", + "wy" : "67268b7298c73e581866fbcbd161689b16b81cf262e007ce68e25a28c83ef041" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004264a7ad439a4828a9dc97ecf837155355f99ae0b65975f851b541ad3a0e032f067268b7298c73e581866fbcbd161689b16b81cf262e007ce68e25a28c83ef041", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJkp61DmkgoqdyX7Pg3FVNV+Zrgtl\nl1+FG1Qa06DgMvBnJotymMc+WBhm+8vRYWibFrgc8mLgB85o4looyD7wQQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 475, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100fcf97e2fbf0e80d412005aa4a75086a3f004f59d512cb47271798733ab418606", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041d7ff4d3a41206c8143635f12876e0ea0875ea5e4a5a249250d0eda33daa211f56e89c0beaf910ac934ca12380455600d0fd85b56a7035cb171b3f1c72a15569", + "wx" : "1d7ff4d3a41206c8143635f12876e0ea0875ea5e4a5a249250d0eda33daa211f", + "wy" : "56e89c0beaf910ac934ca12380455600d0fd85b56a7035cb171b3f1c72a15569" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041d7ff4d3a41206c8143635f12876e0ea0875ea5e4a5a249250d0eda33daa211f56e89c0beaf910ac934ca12380455600d0fd85b56a7035cb171b3f1c72a15569", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHX/006QSBsgUNjXxKHbg6gh16l5K\nWiSSUNDtoz2qIR9W6JwL6vkQrJNMoSOARVYA0P2FtWpwNcsXGz8ccqFVaQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 476, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022079d482b60864d6c5cb4fd5db9e7e28ccd9a5948c316c8740fb429c0f37169a02", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b09685f338dceb421778a1458d52bed734c236242da2baa280d6f6b7b86e4f117fe6a34146b422d7aebd1a51b20948d7872a514c4cfd7686dc436b70733d6473", + "wx" : "00b09685f338dceb421778a1458d52bed734c236242da2baa280d6f6b7b86e4f11", + "wy" : "7fe6a34146b422d7aebd1a51b20948d7872a514c4cfd7686dc436b70733d6473" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b09685f338dceb421778a1458d52bed734c236242da2baa280d6f6b7b86e4f117fe6a34146b422d7aebd1a51b20948d7872a514c4cfd7686dc436b70733d6473", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsJaF8zjc60IXeKFFjVK+1zTCNiQt\norqigNb2t7huTxF/5qNBRrQi1669GlGyCUjXhypRTEz9dobcQ2twcz1kcw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 477, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0221008ecd11081a4d0759c14f7bf46813d52cc6738115321be0a4da78a3356bb71510", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04dd811f2c0f5e9d4fbb2ef31818c1cd807247bc14fcd1170bef00e2c71dc037b443a15cdf8f3fbdc87e06250c0720d261d2b8d087fa7bf9548f6293f0ce5ae899", + "wx" : "00dd811f2c0f5e9d4fbb2ef31818c1cd807247bc14fcd1170bef00e2c71dc037b4", + "wy" : "43a15cdf8f3fbdc87e06250c0720d261d2b8d087fa7bf9548f6293f0ce5ae899" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004dd811f2c0f5e9d4fbb2ef31818c1cd807247bc14fcd1170bef00e2c71dc037b443a15cdf8f3fbdc87e06250c0720d261d2b8d087fa7bf9548f6293f0ce5ae899", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3YEfLA9enU+7LvMYGMHNgHJHvBT8\n0RcL7wDixx3AN7RDoVzfjz+9yH4GJQwHINJh0rjQh/p7+VSPYpPwzlromQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 478, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100e8dbffed13c9a2093085c079714f11f24eb583d73ba2b416b3169183e7d9b4c2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0469d60ae1f39e1da95809d408894707ad2134f4943a1db089bebf815a391f18db32b401d98bf894d3b6d59e6eb45573285642e358ad687b7d7bf9600b1987809e", + "wx" : "69d60ae1f39e1da95809d408894707ad2134f4943a1db089bebf815a391f18db", + "wy" : "32b401d98bf894d3b6d59e6eb45573285642e358ad687b7d7bf9600b1987809e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000469d60ae1f39e1da95809d408894707ad2134f4943a1db089bebf815a391f18db32b401d98bf894d3b6d59e6eb45573285642e358ad687b7d7bf9600b1987809e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEadYK4fOeHalYCdQIiUcHrSE09JQ6\nHbCJvr+BWjkfGNsytAHZi/iU07bVnm60VXMoVkLjWK1oe317+WALGYeAng==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 479, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ca01552a838124bec68d6bc6086329e06673900eac5c262e5ce79a8521cd1eae", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a658553a0620c95e987b5c3163bcfea68c52065f53c9d553f2a924d8b3ed511f79f0dfec4536b65aa5fb31297e96f6b464aa669b9268b3156c43d4612978a577", + "wx" : "00a658553a0620c95e987b5c3163bcfea68c52065f53c9d553f2a924d8b3ed511f", + "wy" : "79f0dfec4536b65aa5fb31297e96f6b464aa669b9268b3156c43d4612978a577" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a658553a0620c95e987b5c3163bcfea68c52065f53c9d553f2a924d8b3ed511f79f0dfec4536b65aa5fb31297e96f6b464aa669b9268b3156c43d4612978a577", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEplhVOgYgyV6Ye1wxY7z+poxSBl9T\nydVT8qkk2LPtUR958N/sRTa2WqX7MSl+lva0ZKpmm5JosxVsQ9RhKXildw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 480, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0221009402aa560702497c8d1ad78c10c653c11000256fb1a0add7c6156a474737180b", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bc4d3354a6a973dd8088919cc181194e879ed7920db30d0d1278edf74413b7b92450d162b26dcb25fbbd53ea4044189981d737055925bd2e86bfb0374b09f3ca", + "wx" : "00bc4d3354a6a973dd8088919cc181194e879ed7920db30d0d1278edf74413b7b9", + "wy" : "2450d162b26dcb25fbbd53ea4044189981d737055925bd2e86bfb0374b09f3ca" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bc4d3354a6a973dd8088919cc181194e879ed7920db30d0d1278edf74413b7b92450d162b26dcb25fbbd53ea4044189981d737055925bd2e86bfb0374b09f3ca", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvE0zVKapc92AiJGcwYEZToee15IN\nsw0NEnjt90QTt7kkUNFism3LJfu9U+pARBiZgdc3BVklvS6Gv7A3Swnzyg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 481, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02205e03ff818a836e3a53a8435219297da1b98cbad0b6e535812f433a096ca11168", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040eb628724fce764c687d874ade7b8e0aa4abf20ee6e3610fac9fe3e72f97ab5aed09f4843660eb1daf015d397a7c1073d7ae43bda0ba3e117008785abfffa00f", + "wx" : "0eb628724fce764c687d874ade7b8e0aa4abf20ee6e3610fac9fe3e72f97ab5a", + "wy" : "00ed09f4843660eb1daf015d397a7c1073d7ae43bda0ba3e117008785abfffa00f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040eb628724fce764c687d874ade7b8e0aa4abf20ee6e3610fac9fe3e72f97ab5aed09f4843660eb1daf015d397a7c1073d7ae43bda0ba3e117008785abfffa00f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDrYock/OdkxofYdK3nuOCqSr8g7m\n42EPrJ/j5y+Xq1rtCfSENmDrHa8BXTl6fBBz165DvaC6PhFwCHhav/+gDw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 482, + "comment" : "edge case for u1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100e28ddf709d4aa1bddf2e4bc7c7f2cb516cb642bb3e39c3feaf2fcf16ab9539f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04e7ac5cc7f296912f703f59fe88e49b521da245e12e6eee161ee6b3b1127611a77b3bedd2a773cf58b0629b936dd85dad2d0c39676306ed63e1a9bcd0e08bccc2", + "wx" : "00e7ac5cc7f296912f703f59fe88e49b521da245e12e6eee161ee6b3b1127611a7", + "wy" : "7b3bedd2a773cf58b0629b936dd85dad2d0c39676306ed63e1a9bcd0e08bccc2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004e7ac5cc7f296912f703f59fe88e49b521da245e12e6eee161ee6b3b1127611a77b3bedd2a773cf58b0629b936dd85dad2d0c39676306ed63e1a9bcd0e08bccc2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE56xcx/KWkS9wP1n+iOSbUh2iReEu\nbu4WHuazsRJ2Ead7O+3Sp3PPWLBim5Nt2F2tLQw5Z2MG7WPhqbzQ4IvMwg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 483, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042407b60abf3ee5edaf92ed505a11d0ddce0ea33eca58a031bb2f162c512f4062fb81bff36bf967e834e3d5d468730dcd70440022ab60061a62fac53350fe259f", + "wx" : "2407b60abf3ee5edaf92ed505a11d0ddce0ea33eca58a031bb2f162c512f4062", + "wy" : "00fb81bff36bf967e834e3d5d468730dcd70440022ab60061a62fac53350fe259f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042407b60abf3ee5edaf92ed505a11d0ddce0ea33eca58a031bb2f162c512f4062fb81bff36bf967e834e3d5d468730dcd70440022ab60061a62fac53350fe259f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJAe2Cr8+5e2vku1QWhHQ3c4Ooz7K\nWKAxuy8WLFEvQGL7gb/za/ln6DTj1dRocw3NcEQAIqtgBhpi+sUzUP4lnw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 484, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0447b2ad96dfc2f23fe5926809f38042b2c801962bd7394cefbf4aacb2554b7b0bdf2b937a16a7d96a2a0682cd164428890208597f2cdcc734fda73600b5cf6c59", + "wx" : "47b2ad96dfc2f23fe5926809f38042b2c801962bd7394cefbf4aacb2554b7b0b", + "wy" : "00df2b937a16a7d96a2a0682cd164428890208597f2cdcc734fda73600b5cf6c59" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000447b2ad96dfc2f23fe5926809f38042b2c801962bd7394cefbf4aacb2554b7b0bdf2b937a16a7d96a2a0682cd164428890208597f2cdcc734fda73600b5cf6c59", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAER7Ktlt/C8j/lkmgJ84BCssgBlivX\nOUzvv0qsslVLewvfK5N6FqfZaioGgs0WRCiJAghZfyzcxzT9pzYAtc9sWQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 485, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0469a65b75f31ae7b4930292f90902461befcee5d1606939c28e01b652a7fbc498cf68619e5860128f56cecf53eba2ffe82889a9bb04a5fa4c8b722bc91d55978a", + "wx" : "69a65b75f31ae7b4930292f90902461befcee5d1606939c28e01b652a7fbc498", + "wy" : "00cf68619e5860128f56cecf53eba2ffe82889a9bb04a5fa4c8b722bc91d55978a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000469a65b75f31ae7b4930292f90902461befcee5d1606939c28e01b652a7fbc498cf68619e5860128f56cecf53eba2ffe82889a9bb04a5fa4c8b722bc91d55978a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaaZbdfMa57STApL5CQJGG+/O5dFg\naTnCjgG2Uqf7xJjPaGGeWGASj1bOz1Prov/oKImpuwSl+kyLcivJHVWXig==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 486, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022066755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b2037176c84db04a6c773e32f9ed1d6b25ef4c303c6725c6932ec2cc2788bcbb9361505e6b771691adb41598f292d6521722404bf183241b195738b77abd6cfe", + "wx" : "00b2037176c84db04a6c773e32f9ed1d6b25ef4c303c6725c6932ec2cc2788bcbb", + "wy" : "009361505e6b771691adb41598f292d6521722404bf183241b195738b77abd6cfe" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b2037176c84db04a6c773e32f9ed1d6b25ef4c303c6725c6932ec2cc2788bcbb9361505e6b771691adb41598f292d6521722404bf183241b195738b77abd6cfe", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsgNxdshNsEpsdz4y+e0dayXvTDA8\nZyXGky7CzCeIvLuTYVBea3cWka20FZjyktZSFyJAS/GDJBsZVzi3er1s/g==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 487, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022055a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041eef95aef71f793afd50bb2604064d63e88bef7404a4d0e206446245ae2e7834c96e86dd040f9794b63712d90e719576b8b92c406ab0f288ad9b327bd124454f", + "wx" : "1eef95aef71f793afd50bb2604064d63e88bef7404a4d0e206446245ae2e7834", + "wy" : "00c96e86dd040f9794b63712d90e719576b8b92c406ab0f288ad9b327bd124454f" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041eef95aef71f793afd50bb2604064d63e88bef7404a4d0e206446245ae2e7834c96e86dd040f9794b63712d90e719576b8b92c406ab0f288ad9b327bd124454f", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHu+VrvcfeTr9ULsmBAZNY+iL73QE\npNDiBkRiRa4ueDTJbobdBA+XlLY3EtkOcZV2uLksQGqw8oitmzJ70SRFTw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 488, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04a9734899c954e5b7adbca8f783428b5fbcbdfd3d2813f8d2f95b31a78ab107567667abf8c02ce4951bc59b2564130c27d7b64cdbc5cad95ca42d5bbb7cd4e793", + "wx" : "00a9734899c954e5b7adbca8f783428b5fbcbdfd3d2813f8d2f95b31a78ab10756", + "wy" : "7667abf8c02ce4951bc59b2564130c27d7b64cdbc5cad95ca42d5bbb7cd4e793" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004a9734899c954e5b7adbca8f783428b5fbcbdfd3d2813f8d2f95b31a78ab107567667abf8c02ce4951bc59b2564130c27d7b64cdbc5cad95ca42d5bbb7cd4e793", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqXNImclU5betvKj3g0KLX7y9/T0o\nE/jS+Vsxp4qxB1Z2Z6v4wCzklRvFmyVkEwwn17ZM28XK2VykLVu7fNTnkw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 489, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041ae51662331a1dbfab0751d30dfab2273a04a239e055a537b16ab595f9612396434f21c2bfe6555c9fc4a8e82dab1fa5631881b016e0831d9e1bbf5799fcf32e", + "wx" : "1ae51662331a1dbfab0751d30dfab2273a04a239e055a537b16ab595f9612396", + "wy" : "434f21c2bfe6555c9fc4a8e82dab1fa5631881b016e0831d9e1bbf5799fcf32e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041ae51662331a1dbfab0751d30dfab2273a04a239e055a537b16ab595f9612396434f21c2bfe6555c9fc4a8e82dab1fa5631881b016e0831d9e1bbf5799fcf32e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGuUWYjMaHb+rB1HTDfqyJzoEojng\nVaU3sWq1lflhI5ZDTyHCv+ZVXJ/EqOgtqx+lYxiBsBbggx2eG79XmfzzLg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 490, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0453c90cdd8b0dadd21c44ad557b327f4dbf57144aaf06597deb3f94125206a6c14603475bd79b30e36340cd09b0b59e6cd46ce90150e9ffe5c8a0172b2c9898e3", + "wx" : "53c90cdd8b0dadd21c44ad557b327f4dbf57144aaf06597deb3f94125206a6c1", + "wy" : "4603475bd79b30e36340cd09b0b59e6cd46ce90150e9ffe5c8a0172b2c9898e3" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000453c90cdd8b0dadd21c44ad557b327f4dbf57144aaf06597deb3f94125206a6c14603475bd79b30e36340cd09b0b59e6cd46ce90150e9ffe5c8a0172b2c9898e3", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEU8kM3YsNrdIcRK1VezJ/Tb9XFEqv\nBll96z+UElIGpsFGA0db15sw42NAzQmwtZ5s1GzpAVDp/+XIoBcrLJiY4w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 491, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0433797539515c51f429967b8e36930d9fdda1edb13aecec9771f7cde5f6f2e74eba51d0b6456bb902dba1f3ea436f96ad2355da454dc9b32c503c4bc6cfd6d410", + "wx" : "33797539515c51f429967b8e36930d9fdda1edb13aecec9771f7cde5f6f2e74e", + "wy" : "00ba51d0b6456bb902dba1f3ea436f96ad2355da454dc9b32c503c4bc6cfd6d410" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000433797539515c51f429967b8e36930d9fdda1edb13aecec9771f7cde5f6f2e74eba51d0b6456bb902dba1f3ea436f96ad2355da454dc9b32c503c4bc6cfd6d410", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEM3l1OVFcUfQplnuONpMNn92h7bE6\n7OyXcffN5fby5066UdC2RWu5Atuh8+pDb5atI1XaRU3JsyxQPEvGz9bUEA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 492, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040a8f5f1d5bbd2783fa7f37c86879057fb2fcf25383aafb86d03d6bafb41a17b3eaf6da715fe950349fd5736117b08e15e32cf1d2fdc003e510009f1b4ba1e648", + "wx" : "0a8f5f1d5bbd2783fa7f37c86879057fb2fcf25383aafb86d03d6bafb41a17b3", + "wy" : "00eaf6da715fe950349fd5736117b08e15e32cf1d2fdc003e510009f1b4ba1e648" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040a8f5f1d5bbd2783fa7f37c86879057fb2fcf25383aafb86d03d6bafb41a17b3eaf6da715fe950349fd5736117b08e15e32cf1d2fdc003e510009f1b4ba1e648", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECo9fHVu9J4P6fzfIaHkFf7L88lOD\nqvuG0D1rr7QaF7Pq9tpxX+lQNJ/Vc2EXsI4V4yzx0v3AA+UQAJ8bS6HmSA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 493, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041dbc94e96c056b9d2cb6773bb24b69ed473851badf927a29955aff290ef3675a65e587561122aa8226facb95df08308cadf01c8351a1569176d917821113aa7c", + "wx" : "1dbc94e96c056b9d2cb6773bb24b69ed473851badf927a29955aff290ef3675a", + "wy" : "65e587561122aa8226facb95df08308cadf01c8351a1569176d917821113aa7c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041dbc94e96c056b9d2cb6773bb24b69ed473851badf927a29955aff290ef3675a65e587561122aa8226facb95df08308cadf01c8351a1569176d917821113aa7c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHbyU6WwFa50stnc7sktp7Uc4Ubrf\nknoplVr/KQ7zZ1pl5YdWESKqgib6y5XfCDCMrfAcg1GhVpF22ReCEROqfA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 494, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04084ab885dbff7f12e6cdadb59d456e500797779425c7518c259c83718289e6e991c345d3a093e86670605bbc2ff4c69d0ed694fd433ec6b6ba1bf7d56c3e6b51", + "wx" : "084ab885dbff7f12e6cdadb59d456e500797779425c7518c259c83718289e6e9", + "wy" : "0091c345d3a093e86670605bbc2ff4c69d0ed694fd433ec6b6ba1bf7d56c3e6b51" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004084ab885dbff7f12e6cdadb59d456e500797779425c7518c259c83718289e6e991c345d3a093e86670605bbc2ff4c69d0ed694fd433ec6b6ba1bf7d56c3e6b51", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECEq4hdv/fxLmza21nUVuUAeXd5Ql\nx1GMJZyDcYKJ5umRw0XToJPoZnBgW7wv9MadDtaU/UM+xra6G/fVbD5rUQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 495, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02203fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04003adfa4c620a207096cd18ee8fd2a90e20106cf824a0c63d6dec727a9fe7f509430d26bdd5f71e819d12b70069901461ae083cc809122d4fb86b5c475244e5a", + "wx" : "3adfa4c620a207096cd18ee8fd2a90e20106cf824a0c63d6dec727a9fe7f50", + "wy" : "009430d26bdd5f71e819d12b70069901461ae083cc809122d4fb86b5c475244e5a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004003adfa4c620a207096cd18ee8fd2a90e20106cf824a0c63d6dec727a9fe7f509430d26bdd5f71e819d12b70069901461ae083cc809122d4fb86b5c475244e5a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEADrfpMYgogcJbNGO6P0qkOIBBs+C\nSgxj1t7HJ6n+f1CUMNJr3V9x6BnRK3AGmQFGGuCDzICRItT7hrXEdSROWg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 496, + "comment" : "edge case for u2", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02205d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "047c98b2d47eb433c0d18e533cfbc8909d66f7b79d5925ccb17eccec9d105c58848d5ca99b350bd7d10ab5ee6fcfe46623fdc03e9f828158f4d4cc08ad1ff83de4", + "wx" : "7c98b2d47eb433c0d18e533cfbc8909d66f7b79d5925ccb17eccec9d105c5884", + "wy" : "008d5ca99b350bd7d10ab5ee6fcfe46623fdc03e9f828158f4d4cc08ad1ff83de4" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200047c98b2d47eb433c0d18e533cfbc8909d66f7b79d5925ccb17eccec9d105c58848d5ca99b350bd7d10ab5ee6fcfe46623fdc03e9f828158f4d4cc08ad1ff83de4", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfJiy1H60M8DRjlM8+8iQnWb3t51Z\nJcyxfszsnRBcWISNXKmbNQvX0Qq17m/P5GYj/cA+n4KBWPTUzAitH/g95A==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 497, + "comment" : "point duplication during verification", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304502206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022100b4cfa1996ec1d24cdbc8fa17fcabc3a5d4b2b36cf4b50a7b775ab78785710746", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "047c98b2d47eb433c0d18e533cfbc8909d66f7b79d5925ccb17eccec9d105c588472a35663caf4282ff54a1190301b99dc023fc1617d7ea70b2b33f752e007c21b", + "wx" : "7c98b2d47eb433c0d18e533cfbc8909d66f7b79d5925ccb17eccec9d105c5884", + "wy" : "72a35663caf4282ff54a1190301b99dc023fc1617d7ea70b2b33f752e007c21b" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200047c98b2d47eb433c0d18e533cfbc8909d66f7b79d5925ccb17eccec9d105c588472a35663caf4282ff54a1190301b99dc023fc1617d7ea70b2b33f752e007c21b", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfJiy1H60M8DRjlM8+8iQnWb3t51Z\nJcyxfszsnRBcWIRyo1ZjyvQoL/VKEZAwG5ncAj/BYX1+pwsrM/dS4AfCGw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 498, + "comment" : "duplication bug", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "304502206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022100b4cfa1996ec1d24cdbc8fa17fcabc3a5d4b2b36cf4b50a7b775ab78785710746", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04b7a90e21e7547d73267940033cea05042c50f7c9fa5eaeb471cd6260c685f2e38bb7309d0c3bab249faaf3e44179d6dd5302375c580fd0570a788c6be3680c67", + "wx" : "00b7a90e21e7547d73267940033cea05042c50f7c9fa5eaeb471cd6260c685f2e3", + "wy" : "008bb7309d0c3bab249faaf3e44179d6dd5302375c580fd0570a788c6be3680c67" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004b7a90e21e7547d73267940033cea05042c50f7c9fa5eaeb471cd6260c685f2e38bb7309d0c3bab249faaf3e44179d6dd5302375c580fd0570a788c6be3680c67", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEt6kOIedUfXMmeUADPOoFBCxQ98n6\nXq60cc1iYMaF8uOLtzCdDDurJJ+q8+RBedbdUwI3XFgP0FcKeIxr42gMZw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 499, + "comment" : "point with x-coordinate 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30250201010220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "041550a173373b2d594374f0642cd73de06a045c09c7a4f388c731e8cd8971adfc9a3a9843583a86c0e1c62cbde67165f40a926b1028ba38aa3895e188ebbc7066", + "wx" : "1550a173373b2d594374f0642cd73de06a045c09c7a4f388c731e8cd8971adfc", + "wy" : "009a3a9843583a86c0e1c62cbde67165f40a926b1028ba38aa3895e188ebbc7066" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200041550a173373b2d594374f0642cd73de06a045c09c7a4f388c731e8cd8971adfc9a3a9843583a86c0e1c62cbde67165f40a926b1028ba38aa3895e188ebbc7066", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFVChczc7LVlDdPBkLNc94GoEXAnH\npPOIxzHozYlxrfyaOphDWDqGwOHGLL3mcWX0CpJrECi6OKo4leGI67xwZg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 500, + "comment" : "point with x-coordinate 0", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "3045022101000000000000000000000000000000000000000000000000000000000000000002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04313447778195daa1791a6530cd0697ae34bf9d8d225984394f72eef3505971110996a8fbdd1a70ecd64cb00b595afe1669bfef80d91756a62d84c1d83e0f22ab", + "wx" : "313447778195daa1791a6530cd0697ae34bf9d8d225984394f72eef350597111", + "wy" : "0996a8fbdd1a70ecd64cb00b595afe1669bfef80d91756a62d84c1d83e0f22ab" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004313447778195daa1791a6530cd0697ae34bf9d8d225984394f72eef3505971110996a8fbdd1a70ecd64cb00b595afe1669bfef80d91756a62d84c1d83e0f22ab", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEMTRHd4GV2qF5GmUwzQaXrjS/nY0i\nWYQ5T3Lu81BZcREJlqj73Rpw7NZMsAtZWv4Wab/vgNkXVqYthMHYPg8iqw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 501, + "comment" : "comparison with point at infinity ", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044ada634941476ca63c2c5803eec2f33b2d17920f798a5be6275f5a54cd2e7639b1a04bead5c7314c427492db21b9544d81caa8159587e41aa023aa967f31aaa1", + "wx" : "4ada634941476ca63c2c5803eec2f33b2d17920f798a5be6275f5a54cd2e7639", + "wy" : "00b1a04bead5c7314c427492db21b9544d81caa8159587e41aa023aa967f31aaa1" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044ada634941476ca63c2c5803eec2f33b2d17920f798a5be6275f5a54cd2e7639b1a04bead5c7314c427492db21b9544d81caa8159587e41aa023aa967f31aaa1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEStpjSUFHbKY8LFgD7sLzOy0Xkg95\nilvmJ19aVM0udjmxoEvq1ccxTEJ0ktshuVRNgcqoFZWH5BqgI6qWfzGqoQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 502, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc476699780220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04aacce093270fa59ad412b5459a08e490743b97086c781ac3c8d54030b41a31193bece4956172d56befb7011d684e772905e48d2115444a75ac7a325a3f25f4b1", + "wx" : "00aacce093270fa59ad412b5459a08e490743b97086c781ac3c8d54030b41a3119", + "wy" : "3bece4956172d56befb7011d684e772905e48d2115444a75ac7a325a3f25f4b1" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004aacce093270fa59ad412b5459a08e490743b97086c781ac3c8d54030b41a31193bece4956172d56befb7011d684e772905e48d2115444a75ac7a325a3f25f4b1", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqszgkycPpZrUErVFmgjkkHQ7lwhs\neBrDyNVAMLQaMRk77OSVYXLVa++3AR1oTncpBeSNIRVESnWsejJaPyX0sQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 503, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f62b8d7feeff5a847ab79212269e55e62fa87ebe930821747b57a511a5ea99f0439ee057bb27898582a683c3fdb7f95404d41d42f276803751a316eb3aab7ebf", + "wx" : "00f62b8d7feeff5a847ab79212269e55e62fa87ebe930821747b57a511a5ea99f0", + "wy" : "439ee057bb27898582a683c3fdb7f95404d41d42f276803751a316eb3aab7ebf" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f62b8d7feeff5a847ab79212269e55e62fa87ebe930821747b57a511a5ea99f0439ee057bb27898582a683c3fdb7f95404d41d42f276803751a316eb3aab7ebf", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9iuNf+7/WoR6t5ISJp5V5i+ofr6T\nCCF0e1elEaXqmfBDnuBXuyeJhYKmg8P9t/lUBNQdQvJ2gDdRoxbrOqt+vw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 504, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044baa07ff6e7bb9aa223d1c61932005fe98fe78b787fdab4bd3619bc8833072a2bcacd63802c56af82607953e72a0f5d3c23bd265544e020951824ea485555d33", + "wx" : "4baa07ff6e7bb9aa223d1c61932005fe98fe78b787fdab4bd3619bc8833072a2", + "wy" : "00bcacd63802c56af82607953e72a0f5d3c23bd265544e020951824ea485555d33" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044baa07ff6e7bb9aa223d1c61932005fe98fe78b787fdab4bd3619bc8833072a2bcacd63802c56af82607953e72a0f5d3c23bd265544e020951824ea485555d33", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAES6oH/257uaoiPRxhkyAF/pj+eLeH\n/atL02GbyIMwcqK8rNY4AsVq+CYHlT5yoPXTwjvSZVROAglRgk6khVVdMw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 505, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997802203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "040c753ed1ba92f766800fdd0ae1c0d7f8f4cd8305fd803d8bca881397b5937e2db568509b1faf3cf251de6db9810e8b8caed235da10eeddbed62775c8e5c9460a", + "wx" : "0c753ed1ba92f766800fdd0ae1c0d7f8f4cd8305fd803d8bca881397b5937e2d", + "wy" : "00b568509b1faf3cf251de6db9810e8b8caed235da10eeddbed62775c8e5c9460a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200040c753ed1ba92f766800fdd0ae1c0d7f8f4cd8305fd803d8bca881397b5937e2db568509b1faf3cf251de6db9810e8b8caed235da10eeddbed62775c8e5c9460a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDHU+0bqS92aAD90K4cDX+PTNgwX9\ngD2LyogTl7WTfi21aFCbH6888lHebbmBDouMrtI12hDu3b7WJ3XI5clGCg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 506, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04030fdcae6541f22c5bab254e4f1a285c507d1cefea03bf90cf19daf3cb62df695ff2c94d588f2c2b2b0a12bebc011bcee4fa1b54506ec07d0a29d24a0891193c", + "wx" : "030fdcae6541f22c5bab254e4f1a285c507d1cefea03bf90cf19daf3cb62df69", + "wy" : "5ff2c94d588f2c2b2b0a12bebc011bcee4fa1b54506ec07d0a29d24a0891193c" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004030fdcae6541f22c5bab254e4f1a285c507d1cefea03bf90cf19daf3cb62df695ff2c94d588f2c2b2b0a12bebc011bcee4fa1b54506ec07d0a29d24a0891193c", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAw/crmVB8ixbqyVOTxooXFB9HO/q\nA7+Qzxna88ti32lf8slNWI8sKysKEr68ARvO5PobVFBuwH0KKdJKCJEZPA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 507, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0403fc621eaf90c23d8f9fa125d2c59b8728ebccb30ca3e3db879a06ca90f20cdcae58d3f0c6aef0e805be10ea54e23cf6f0397f9addddc2b09088855316b0ef44", + "wx" : "03fc621eaf90c23d8f9fa125d2c59b8728ebccb30ca3e3db879a06ca90f20cdc", + "wy" : "00ae58d3f0c6aef0e805be10ea54e23cf6f0397f9addddc2b09088855316b0ef44" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000403fc621eaf90c23d8f9fa125d2c59b8728ebccb30ca3e3db879a06ca90f20cdcae58d3f0c6aef0e805be10ea54e23cf6f0397f9addddc2b09088855316b0ef44", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEA/xiHq+Qwj2Pn6El0sWbhyjrzLMM\no+Pbh5oGypDyDNyuWNPwxq7w6AW+EOpU4jz28Dl/mt3dwrCQiIVTFrDvRA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 508, + "comment" : "extreme value for k and edgecase s", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2960220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0470f2ce24dc62923bb09cc92d74329bbd0d2e6b0e354c0be2383d24acdccb9e4cd42d1f973466f5e5462a939084a294ebfc7a45629c70ee5def46de9536ea7bf7", + "wx" : "70f2ce24dc62923bb09cc92d74329bbd0d2e6b0e354c0be2383d24acdccb9e4c", + "wy" : "00d42d1f973466f5e5462a939084a294ebfc7a45629c70ee5def46de9536ea7bf7" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000470f2ce24dc62923bb09cc92d74329bbd0d2e6b0e354c0be2383d24acdccb9e4cd42d1f973466f5e5462a939084a294ebfc7a45629c70ee5def46de9536ea7bf7", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcPLOJNxikjuwnMktdDKbvQ0uaw41\nTAviOD0krNzLnkzULR+XNGb15UYqk5CEopTr/HpFYpxw7l3vRt6VNup79w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 509, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04732b8ac0c30fe44307431235271cb5d6e5f677a19ce3f058b939a7bf19349d3c858cc735af8577468275847cf5ec19972e6c20738276e2708b23c595bfc4433d", + "wx" : "732b8ac0c30fe44307431235271cb5d6e5f677a19ce3f058b939a7bf19349d3c", + "wy" : "00858cc735af8577468275847cf5ec19972e6c20738276e2708b23c595bfc4433d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004732b8ac0c30fe44307431235271cb5d6e5f677a19ce3f058b939a7bf19349d3c858cc735af8577468275847cf5ec19972e6c20738276e2708b23c595bfc4433d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcyuKwMMP5EMHQxI1Jxy11uX2d6Gc\n4/BYuTmnvxk0nTyFjMc1r4V3RoJ1hHz17BmXLmwgc4J24nCLI8WVv8RDPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 510, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0447aff9501825a166782bb58a5b459006eacdbce5e5323addad34ec1b6444cdce9199c31502ad4277c73ddd0c807b72634c45762404837d9814a5d4b5a7c3f398", + "wx" : "47aff9501825a166782bb58a5b459006eacdbce5e5323addad34ec1b6444cdce", + "wy" : "009199c31502ad4277c73ddd0c807b72634c45762404837d9814a5d4b5a7c3f398" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000447aff9501825a166782bb58a5b459006eacdbce5e5323addad34ec1b6444cdce9199c31502ad4277c73ddd0c807b72634c45762404837d9814a5d4b5a7c3f398", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAER6/5UBgloWZ4K7WKW0WQBurNvOXl\nMjrdrTTsG2REzc6RmcMVAq1Cd8c93QyAe3JjTEV2JASDfZgUpdS1p8PzmA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 511, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c29602203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04aed8eeff77644bf83b9222f8f57173fa8217ec7e0763ee7d7171fb6092fba5c06486a86d94f48834ba5adbaf349687f9cee400389642b828e68207b147ca2c46", + "wx" : "00aed8eeff77644bf83b9222f8f57173fa8217ec7e0763ee7d7171fb6092fba5c0", + "wy" : "6486a86d94f48834ba5adbaf349687f9cee400389642b828e68207b147ca2c46" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004aed8eeff77644bf83b9222f8f57173fa8217ec7e0763ee7d7171fb6092fba5c06486a86d94f48834ba5adbaf349687f9cee400389642b828e68207b147ca2c46", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErtju/3dkS/g7kiL49XFz+oIX7H4H\nY+59cXH7YJL7pcBkhqhtlPSINLpa2680lof5zuQAOJZCuCjmggexR8osRg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 512, + "comment" : "extreme value for k and s^-1", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04f7c54a585a904300d05b53ef3b854e71999a344b89adc0caaa28e254db9bc7c7c161a79f38ff446051303577e40638fb020329940a63c241bb32c2205eb57b7d", + "wx" : "00f7c54a585a904300d05b53ef3b854e71999a344b89adc0caaa28e254db9bc7c7", + "wy" : "00c161a79f38ff446051303577e40638fb020329940a63c241bb32c2205eb57b7d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004f7c54a585a904300d05b53ef3b854e71999a344b89adc0caaa28e254db9bc7c7c161a79f38ff446051303577e40638fb020329940a63c241bb32c2205eb57b7d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE98VKWFqQQwDQW1PvO4VOcZmaNEuJ\nrcDKqijiVNubx8fBYaefOP9EYFEwNXfkBjj7AgMplApjwkG7MsIgXrV7fQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 513, + "comment" : "extreme value for k", + "flags" : [ + "ArithmeticError" + ], + "msg" : "313233343030", + "sig" : "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "wx" : "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy" : "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9Q==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 514, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022043f800fbeaf9238c58af795bcdad04bc49cd850c394d3382953356b0232102810220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + }, + { + "tcId" : 515, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100bc07ff031506dc74a75086a43252fb43731975a16dca6b025e867412d94222d00220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "wx" : "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy" : "00b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpawHL0cAeWAZXEYFLWD8GHp1DHMqZTOoTE0Sb+XyECuCg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 516, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3044022043f800fbeaf9238c58af795bcdad04bc49cd850c394d3382953356b0232102810220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + }, + { + "tcId" : 517, + "comment" : "public key shares x-coordinate with generator", + "flags" : [ + "PointDuplication" + ], + "msg" : "313233343030", + "sig" : "3045022100bc07ff031506dc74a75086a43252fb43731975a16dca6b025e867412d94222d00220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result" : "invalid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "wx" : "4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000", + "wy" : "00ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETzN8z9Z3JqgF5PFgCuKEnfOAfsoR\nc4Ajn72BaQAAAADtneoSTMjDlkFkEemIww9CfrUEr0OjFGzV336mBmbWhQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 518, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30440220554482404173a5582884b0d168a32ef8033d7eb780936c390e8eedf720c7f56402200a15413f9ed0d454b92ab901119e7251a4d444ba1421ba639fa57e0d8cf6b313", + "result" : "valid" + }, + { + "tcId" : 519, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502200b1d838dd54a462745e2c8d5f32637f26fb16dde20a385e45f8a20a8a1f8370e022100ae855e0a10ef087075fda0ed84e2bc5786a681172ea9834e53351316df332bbd", + "result" : "valid" + }, + { + "tcId" : 520, + "comment" : "x-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100af89e4f2b03e5d1f0352e258ef71493040c17d70c36cfd044128302df2ed5e4a0220420f04148c3e6f06561bd448362d6c6fa3f9aeeb7e42843b4674e7ddfd0ba901", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "wx" : "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy" : "0084fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTWE+hdNeRxyvyzjiAqJYN0qfHoTOKgvhanlnNvegAAAAA==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 521, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402206c1581f1485ccc4e657606fa1a38cf227e3870dc9f41e26b84e28483635e321b02201b3e3c22af23e919b30330f8710f6ef3760c0e2237a9a9f5cf30a1d9f5bbd464", + "result" : "valid" + }, + { + "tcId" : 522, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100dc83bf97ca28db0e04104a16fe3de694311a6cd9f230a300504ae71d8ec755b1022064a83af0ab3e6037003a1f4240dffd8a342afdee50604ed1afa416fd009e4668", + "result" : "valid" + }, + { + "tcId" : 523, + "comment" : "y-coordinate of the public key has many trailing 0's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450220575b70b4375684291b95d81e3c820ed9bde9e5b7343036e4951f3c46894a6d9d022100f10d716efbfeba953701b603fc9ef6ff6e47edef38c9eeef2d55e6486bc4d6e6", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "wx" : "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy" : "7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTV7BeixhuONQdMcd/V2nyLVg4XsyFfQelYaYyQhf////w==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 524, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450221008d4f113189dfd3d3239e331f76d3fca9cef86fcd5dc9b4ab2ca38aeba56c178b022078389c3cf11dcff6d6c7f5efd277d480060691144b568a6f090c8902557bfc61", + "result" : "valid" + }, + { + "tcId" : 525, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100834d10ec2d2d50eeebfecd6328f03fafbb488fc043c362cbc67880ec0ebd04b302210094c026feaf6e68759146fe5b6fd52eaa3c3c5552d83719d2cb900615e2a634db", + "result" : "valid" + }, + { + "tcId" : 526, + "comment" : "y-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304502206894de495e7bb5566807d475d96a0d414a94f4f02c3ab7c2edc2916deafc1e1f022100a603642c20fabc07182867fcc6923d35be23ad3f97a5f93c6ec5b9cce8239569", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "wx" : "2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff", + "wy" : "00a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d030107034200042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKCnDH6ouQA40TtlLyj/NBUWVbrz+\nitD236X/jv////+gGq+vAA5SWFhVr6dnat4oQRMJkFLfV+frO9N+vrkiLg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 527, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100e500c086fedd59e090ce7bfb615751ed9abe4c09b839ee8f05320245b9796f3e022100807b1d0638c86ef6113fff0d63497800e1b848b5a303a54c748e45ca8f35d7d7", + "result" : "valid" + }, + { + "tcId" : 528, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100b922c1abe1a8309c0acf90e586c6de8c33e37057673390a97ff098f71680b32b022100f86d92b051b7923d82555c205e21b54eab869766c716209648c3e6cc2629057d", + "result" : "valid" + }, + { + "tcId" : 529, + "comment" : "x-coordinate of the public key has many trailing 1's", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100823c37e46c74ec8497d89245fde3bf53ddb462c00d840e983dcb1b72bbf8bf27022100c4552f2425d14f0f0fa988778403d60a58962e7c548715af83b2edabbb24a49f", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "wx" : "00fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5", + "wy" : "5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE////+UgIHmoEWN2PnnOPJmX/kFmt\naqwHCDGMTKmnpPVairy6LdqEdDEe5UFJuXPK4MD7iVV60L945lKaFmO9cw==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 530, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30450220577a08a95db6dcda9985109942d3786630f640190f920b95bd4d5d84e0f163ef022100d762286e92925973fd38b67ef944a99c0ec5b499b7175cbb4369e053c1fcbb10", + "result" : "valid" + }, + { + "tcId" : 531, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402207ba458cfe952326922c7aa2854bdc673ce3daaf65d464dfb9f700701503056b102200df8821c92d20546fa741fb426bf56728a53182691964225c9b380b56b22ee6d", + "result" : "valid" + }, + { + "tcId" : 532, + "comment" : "x-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402205cd60c3b021b4be116f06f1d447f65e458329a8bbae1d9b5977d18cf5618486102204c635cd7aa9aebb5716d5ae09e57f8c481a741a029b40f71ec47344ef883e86e", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "0400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "wx" : "03fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e", + "wy" : "1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d0301070342000400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAAAAA/oV+WOUnV8DpvXH+G+eABXu\nsjrrv/EXOTe6dI4QmYcgcOjofFVfoTZZzKXX+tz8sAI+qIlUjKSK8rp+cQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 533, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402204b50e1e8cf830e04c17e7472caf60da8150ffa568e2c64498cc972a379e542e502202e3adaa5afab89cca91693609555f40543578852cde29c21cb037c0c0b78478e", + "result" : "valid" + }, + { + "tcId" : 534, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402205aea930c7d8fffcd5c6df2c9430ef76f8b5ed58a8b9c95847288abf8f09a1ac202207ddfef7688a6053ce4eeeeefd6f1a9d71381b7548925f6682aa0a9d05cf5a3a3", + "result" : "valid" + }, + { + "tcId" : 535, + "comment" : "x-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304602210098b092c2d14b5b14a23e9368e0ce1be744dfae9f9a5cdaba51e7872099df96f202210090d3e4f87bd7bc94589f8150b6b01045cd8759a00af78b24d7de771887610df5", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "wx" : "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy" : "1352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BUAAAAAE1K7Sg+i6kzOuatj3WhK3loRJ7zzAKaYpxk7wg==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 536, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "30460221009e95f2856a9fff9a172b07817c8c60fe185cd3ce9582678f8cc4b02bc444621a022100c54ca51d8117d904f0d3773911cb2792348fae21c2da7dad25f990d122376e4c", + "result" : "valid" + }, + { + "tcId" : 537, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3046022100e77df8f9782696344c33de29ebdc9f8d3fcf463d950cdbe256fd4fc2fd44877e02210087028850c962cf2fb450ffe6b983981e499dc498fbd654fa454c9e07c8cb5ca8", + "result" : "valid" + }, + { + "tcId" : 538, + "comment" : "y-coordinate of the public key is small", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100bd2dd6f5026d2b5ad7ead74bdf52b8cbcabc08facee0a1c8584658a85ed0c5dc02203e8543e819bdae47d872e29a85ba38addf3eaeaad8786d79c3fb027f6f1ff4bf", + "result" : "valid" + } + ] + }, + { + "type" : "EcdsaVerify", + "publicKey" : { + "type" : "EcPublicKey", + "curve" : "secp256r1", + "keySize" : 256, + "uncompressed" : "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "wx" : "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy" : "00fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d" + }, + "publicKeyDer" : "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "publicKeyPem" : "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BX////+7K1EtvBdFbMxRlScIpe1IqXu2EMM/1lnWObEPQ==\n-----END PUBLIC KEY-----\n", + "sha" : "SHA-512", + "tests" : [ + { + "tcId" : 539, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100bd5c0294acc28c15c5d1ebc7274c9ca21a081c8a67da430a34a7fff1a564fabb02207ec103a2385b4ff38b47d306434e9091de24dc9f1a25967ee06f8a0a53ac0181", + "result" : "valid" + }, + { + "tcId" : 540, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "304402203c7dbfb43dd80379ee2c23ad5472873a22c8a0179ac8f381ad9e0f193231dc1f02207cf8e07530ade503b3d43a84b75a2a76fc40763daed4e9734e745c58c9ae72d3", + "result" : "valid" + }, + { + "tcId" : 541, + "comment" : "y-coordinate of the public key is large", + "flags" : [ + "EdgeCasePublicKey" + ], + "msg" : "4d657373616765", + "sig" : "3045022100b38ca4dac6d949be5e5f969860269f0eedff2eb92f45bfc02470300cc96dd52602201c7b22992bb13749cc0c5bc25330a17446e40db734203f9035172725fc70f863", + "result" : "valid" + } + ] + } + ] +} diff --git a/packages/crypto/tests/bls12_381.rs b/packages/crypto/tests/bls12_381.rs new file mode 100644 index 0000000000..623d9d5b67 --- /dev/null +++ b/packages/crypto/tests/bls12_381.rs @@ -0,0 +1,438 @@ +use std::{error::Error, fs}; + +use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; +use base64::engine::general_purpose::STANDARD; +use base64_serde::base64_serde_type; +use cosmwasm_core::{BLS12_381_G1_GENERATOR, BLS12_381_G2_POINT_LEN}; +use cosmwasm_crypto::{ + bls12_381_aggregate_g1, bls12_381_aggregate_g2, bls12_381_g1_is_identity, + bls12_381_g2_is_identity, bls12_381_hash_to_g2, bls12_381_pairing_equality, HashFunction, +}; + +const PROOF_OF_POSSESSION_DST: &[u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; + +base64_serde_type!(Base64Standard, STANDARD); + +#[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)] +struct EthPubkey(#[serde(with = "Base64Standard")] Vec); + +#[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)] +struct EthHeaders { + public_keys: Vec, + #[serde(with = "Base64Standard")] + message: Vec, + #[serde(with = "Base64Standard")] + signature: Vec, + #[serde(with = "Base64Standard")] + aggregate_pubkey: Vec, +} + +#[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)] +struct AggregateTestFile { + input: Vec, + output: Option, +} + +struct AggregateTest { + input: Vec>, + output: Option>, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct HashTestInput { + msg: String, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct HashTestOutput { + x: String, + y: String, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct HashTestFile { + input: HashTestInput, + output: HashTestOutput, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct VerifyTestInput { + pubkey: String, + message: String, + signature: String, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct VerifyTestFile { + input: VerifyTestInput, + output: bool, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct AggregateVerifyInput { + pubkeys: Vec, + messages: Vec, + signature: String, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct AggregateVerifyFile { + input: AggregateVerifyInput, + output: bool, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct BatchVerifyInput { + pubkeys: Vec, + messages: Vec, + signatures: Vec, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct BatchVerifyFile { + input: BatchVerifyInput, + output: bool, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct FastAggregateVerifyInput { + pubkeys: Vec, + message: String, + signature: String, +} + +#[derive(serde::Deserialize, serde::Serialize)] +struct FastAggregateVerifyFile { + input: FastAggregateVerifyInput, + output: bool, +} + +const ETH_HEADER_FILE: &str = include_str!("../testdata/eth-headers/1699693797.394876721s.json"); +const AGGREGATE_1: &str = include_str!("../testdata/bls-tests/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json"); +const AGGREGATE_2: &str = include_str!("../testdata/bls-tests/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json"); +const AGGREGATE_3: &str = include_str!("../testdata/bls-tests/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json"); +const AGGREGATE_4: &str = + include_str!("../testdata/bls-tests/aggregate/aggregate_infinity_signature.json"); +const AGGREGATE_5: &str = + include_str!("../testdata/bls-tests/aggregate/aggregate_na_signatures.json"); +const AGGREGATE_6: &str = + include_str!("../testdata/bls-tests/aggregate/aggregate_single_signature.json"); + +fn read_eth_header_file() -> EthHeaders { + serde_json::from_str(ETH_HEADER_FILE).unwrap() +} + +fn read_aggregate_test(json: &str) -> AggregateTest { + let file: AggregateTestFile = serde_json::from_str(json).unwrap(); + AggregateTest { + input: file + .input + .into_iter() + .map(|entry| hex::decode(&entry[2..]).unwrap()) + .collect(), + output: file.output.map(|entry| hex::decode(&entry[2..]).unwrap()), + } +} + +// Test for https://eth2book.info/capella/part2/building_blocks/signatures/#aggregating-public-keys +#[test] +fn bls12_381_aggregate_g1_works() { + let file = read_eth_header_file(); + + let pubkeys: Vec<&[u8]> = file.public_keys.iter().map(|m| m.0.as_slice()).collect(); + let pubkeys_combined: Vec = pubkeys.concat(); + + let sum = bls12_381_aggregate_g1(&pubkeys_combined).unwrap(); + assert_eq!(sum.as_slice(), file.aggregate_pubkey); +} + +// Test for https://eth2book.info/capella/part2/building_blocks/signatures/#aggregating-signatures +#[test] +fn bls12_381_aggregate_g2_works() { + for json in [ + AGGREGATE_1, + AGGREGATE_2, + AGGREGATE_3, + AGGREGATE_4, + AGGREGATE_5, + AGGREGATE_6, + ] { + let test = read_aggregate_test(json); + let signatures: Vec<&[u8]> = test.input.iter().map(|m| m.as_slice()).collect(); + let signatures_combined: Vec = signatures.concat(); + + // Skip empty signatures since we explicitly error on empty inputs + if signatures_combined.is_empty() { + continue; + } + + let sum = bls12_381_aggregate_g2(&signatures_combined).unwrap(); + match test.output { + Some(expected) => assert_eq!(sum.as_slice(), expected), + None => assert_eq!( + sum.as_slice(), + // point at infinity – is this what we want here? + [ + // C_bit set (compression) + // I_bit set (point at infinity) + // S_bit unset (sign) + 0b11000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ] + ), + } + } +} + +#[test] +fn bls12_381_hash_to_g2_works() { + let paths = glob::glob("testdata/bls-tests/hash_to_G2/*.json") + .unwrap() + .flatten(); + + for path in paths { + let test_data = fs::read(&path).unwrap(); + let test_data: HashTestFile = serde_json::from_slice(&test_data).unwrap(); + let g2_point = bls12_381_hash_to_g2( + HashFunction::Sha256, + test_data.input.msg.as_bytes(), + b"QUUX-V01-CS02-with-BLS12381G2_XMD:SHA-256_SSWU_RO_", + ); + + let prepared_x = test_data.output.x.replace("0x", ""); + let (x1, x2) = prepared_x.split_once(',').unwrap(); + let decoded_x = hex::decode(format!("{x2}{x1}")).unwrap(); + + let prepared_y = test_data.output.y.replace("0x", ""); + let (y1, y2) = prepared_y.split_once(',').unwrap(); + let decoded_y = hex::decode(format!("{y2}{y1}")).unwrap(); + let uncompressed = [decoded_x.as_slice(), &decoded_y].concat(); + + let affine = ark_bls12_381::G2Affine::deserialize_uncompressed(&uncompressed[..]).unwrap(); + let mut compressed_affine = [0; BLS12_381_G2_POINT_LEN]; + affine + .serialize_compressed(&mut compressed_affine[..]) + .unwrap(); + + assert_eq!( + g2_point, + compressed_affine, + "Failed with test vector {}", + path.display() + ); + } +} + +#[test] +fn bls12_381_verify_works() { + let paths = glob::glob("testdata/bls-tests/verify/*.json") + .unwrap() + .flatten(); + + for path in paths { + let test_data = fs::read(&path).unwrap(); + let test_data: VerifyTestFile = serde_json::from_slice(&test_data).unwrap(); + + let pubkey = hex::decode(&test_data.input.pubkey[2..]).unwrap(); + let message = hex::decode(&test_data.input.message[2..]).unwrap(); + let signature = hex::decode(&test_data.input.signature[2..]).unwrap(); + + let message_point = + bls12_381_hash_to_g2(HashFunction::Sha256, &message, PROOF_OF_POSSESSION_DST); + + let pubkey = pubkey.try_into().unwrap(); + let signature = signature.try_into().unwrap(); + + let verify_result = (|| { + if bls12_381_g1_is_identity(&pubkey)? { + println!("pubkey is identity"); + return Ok(false); + } + + if bls12_381_g2_is_identity(&signature)? { + println!("signature is identity"); + return Ok(false); + } + + let bool_result = bls12_381_pairing_equality( + &pubkey, + &message_point, + &BLS12_381_G1_GENERATOR, + &signature, + )?; + + if !bool_result { + println!("pairing is not equal"); + } + + Ok::<_, Box>(bool_result) + })(); + + let verify_result = verify_result + .map_err(|err| eprintln!("error: {err}")) + .unwrap_or(false); + + assert_eq!( + verify_result, + test_data.output, + "Failed with test vector {}", + path.display() + ); + + println!("Finished case {}", path.display()); + println!("========================"); + } +} + +#[test] +fn bls12_381_aggregate_verify_works() { + let paths = glob::glob("testdata/bls-tests/aggregate_verify/*.json") + .unwrap() + .flatten(); + + for path in paths { + let test_data = fs::read(&path).unwrap(); + let test_data: AggregateVerifyFile = serde_json::from_slice(&test_data).unwrap(); + + let signature = hex::decode(&test_data.input.signature[2..]).unwrap(); + + let messages: Vec = test_data + .input + .messages + .iter() + .flat_map(|message| { + let msg = hex::decode(&message[2..]).unwrap(); + bls12_381_hash_to_g2(HashFunction::Sha256, &msg, PROOF_OF_POSSESSION_DST) + }) + .collect(); + + let verify_result = (|| { + let signature = signature.as_slice().try_into()?; + if bls12_381_g2_is_identity(&signature)? { + println!("signature is identity"); + return Ok(false); + } + + let mut pubkeys: Vec = Vec::with_capacity(test_data.input.pubkeys.len() * 48); + for pubkey in test_data.input.pubkeys { + let pubkey = hex::decode(&pubkey[2..]).unwrap(); + + if bls12_381_g1_is_identity(&pubkey.as_slice().try_into()?)? { + println!("pubkey is identity"); + return Ok(false); + } + + pubkeys.extend(pubkey); + } + + if pubkeys.is_empty() || messages.is_empty() { + println!("no keys or no signatures"); + return Ok(false); + } + + let bool_result = bls12_381_pairing_equality( + &pubkeys, + &messages, + &BLS12_381_G1_GENERATOR, + &signature, + )?; + + if !bool_result { + println!("pairing is not equal"); + } + + Ok::<_, Box>(bool_result) + })(); + + let verify_result = verify_result + .map_err(|err| eprintln!("error: {err:?}")) + .unwrap_or(false); + + assert_eq!( + verify_result, + test_data.output, + "Failed with test vector {}", + path.display() + ); + + println!("Finished case {}", path.display()); + println!("========================"); + } +} + +#[test] +fn bls12_381_fast_aggregate_verify_works() { + let paths = glob::glob("testdata/bls-tests/fast_aggregate_verify/*.json") + .unwrap() + .flatten(); + + for path in paths { + let test_data = fs::read(&path).unwrap(); + let test_data: FastAggregateVerifyFile = serde_json::from_slice(&test_data).unwrap(); + + let message = hex::decode(&test_data.input.message[2..]).unwrap(); + let signature = hex::decode(&test_data.input.signature[2..]).unwrap(); + + let message_point = + bls12_381_hash_to_g2(HashFunction::Sha256, &message, PROOF_OF_POSSESSION_DST); + let signature = signature.try_into().unwrap(); + + let verify_result = (|| { + let mut pubkeys: Vec = Vec::with_capacity(test_data.input.pubkeys.len() * 48); + for pubkey in test_data.input.pubkeys { + let pubkey = hex::decode(&pubkey[2..]).unwrap(); + + if bls12_381_g1_is_identity(&pubkey.as_slice().try_into()?)? { + println!("pubkey is identity"); + return Ok(false); + } + + pubkeys.extend(pubkey); + } + + // Reject cases with empty public keys since the aggregation will: + // + // 1. error out with our implementation specifically + // 2. if it wouldn't error out, it would return the identity element of G1, making the + // signature validation return invalid anyway + if pubkeys.is_empty() { + return Ok(false); + } + let pubkey = bls12_381_aggregate_g1(&pubkeys).unwrap(); + + if bls12_381_g2_is_identity(&signature)? { + println!("signature is identity"); + return Ok(false); + } + + let bool_result = bls12_381_pairing_equality( + &pubkey, + &message_point, + &BLS12_381_G1_GENERATOR, + &signature, + )?; + + if !bool_result { + println!("pairing is not equal"); + } + + Ok::<_, Box>(bool_result) + })(); + + let verify_result = verify_result + .map_err(|err| eprintln!("error: {err}")) + .unwrap_or(false); + + assert_eq!( + verify_result, + test_data.output, + "Failed with test vector {}", + path.display() + ); + + println!("Finished case {}", path.display()); + println!("========================"); + } +} diff --git a/packages/crypto/tests/hashers.rs b/packages/crypto/tests/hashers.rs new file mode 100644 index 0000000000..d23164f4a7 --- /dev/null +++ b/packages/crypto/tests/hashers.rs @@ -0,0 +1,30 @@ +// only some of the hashers are used in each test file, so some will be unused +#![allow(unused)] + +use digest::Digest; +use sha2::{Sha256, Sha512}; +use sha3::{Keccak256, Sha3_256, Sha3_512}; + +pub fn sha256(data: &[u8]) -> [u8; 32] { + Sha256::digest(data).into() +} + +pub fn keccak_256(data: &[u8]) -> [u8; 32] { + Keccak256::digest(data).into() +} + +// ecdsa_secp256k1_sha512 requires truncating to 32 bytes +pub fn sha512(data: &[u8]) -> [u8; 32] { + let hash = Sha512::digest(data).to_vec(); + hash[..32].try_into().unwrap() +} + +pub fn sha3_256(data: &[u8]) -> [u8; 32] { + Sha3_256::digest(data).into() +} + +// ecdsa_secp256k1_sha3_512 requires truncating to 32 bytes +pub fn sha3_512(data: &[u8]) -> [u8; 32] { + let hash = Sha3_512::digest(data).to_vec(); + hash[..32].try_into().unwrap() +} diff --git a/packages/crypto/tests/rootberg.rs b/packages/crypto/tests/rootberg.rs new file mode 100644 index 0000000000..6b1e043ede --- /dev/null +++ b/packages/crypto/tests/rootberg.rs @@ -0,0 +1,63 @@ +use serde::Deserialize; + +#[derive(Default, Debug, Clone, PartialEq, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct File { + pub num_tests: usize, + pub tests: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Test { + pub tc_id: i64, + #[serde(deserialize_with = "hex::deserialize")] + pub public_key_uncompressed: Vec, + #[serde(deserialize_with = "hex::deserialize")] + pub msg: Vec, + pub sig: Sig, + pub comment: String, + pub valid: bool, + pub flags: Vec, +} + +#[derive(Default, Debug, Clone, PartialEq, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Sig { + #[serde(deserialize_with = "hex::deserialize")] + pub r: Vec, + #[serde(deserialize_with = "hex::deserialize")] + pub s: Vec, + pub id: u8, +} + +pub fn read_file(path: &str) -> File { + use std::fs::File; + use std::io::BufReader; + + // Open the file in read-only mode with buffer. + let file = File::open(path).unwrap(); + let reader = BufReader::new(file); + + serde_json::from_reader(reader).unwrap() +} + +pub fn combine_signature(sig: &Sig) -> Vec { + // the test data contains values with leading zeroes, which we need to ignore + let first_non_zero = sig.r.iter().position(|&v| v != 0).unwrap_or_default(); + let r = &sig.r[first_non_zero..]; + let first_non_zero = sig.s.iter().position(|&v| v != 0).unwrap_or_default(); + let s = &sig.s[first_non_zero..]; + + // at least one of the tests has an s that is 33 bytes long + let r_len = r.len().max(32); + let s_len = s.len().max(32); + + // the test data also contains values with less than 32 bytes, so we need to pad them with zeroes + let mut signature = vec![0; r_len + s_len]; + let (r_part, s_part) = signature.split_at_mut(r_len); + r_part[r_len - r.len()..].copy_from_slice(r); + s_part[s_len - s.len()..].copy_from_slice(s); + + signature +} diff --git a/packages/crypto/tests/rootberg_secp256k1.rs b/packages/crypto/tests/rootberg_secp256k1.rs new file mode 100644 index 0000000000..8e316a9eac --- /dev/null +++ b/packages/crypto/tests/rootberg_secp256k1.rs @@ -0,0 +1,65 @@ +use cosmwasm_crypto::{secp256k1_recover_pubkey, secp256k1_verify}; +use rootberg::*; + +mod hashers; +mod rootberg; + +// See ./testdata/rootberg/README.md for how to get/update those files +const SECP256K1_SHA256: &str = "./testdata/rootberg/ecdsa_secp256k1_sha_256_raw.json"; +const SECP256K1_KECCAK256: &str = "./testdata/rootberg/ecdsa_secp256k1_keccak256_raw.json"; + +#[test] +fn rootberg_ecdsa_secp256k1_sha256() { + let File { num_tests, tests } = read_file(SECP256K1_SHA256); + assert_eq!(num_tests, tests.len(), "Invalid number of tests"); + assert!(num_tests >= 423, "Got unexpected number of tests"); + + for test in tests { + assert_eq!(test.public_key_uncompressed.len(), 65); + + eprintln!("Test case ID: {}", test.tc_id); + let message_hash = hashers::sha256(&test.msg); + + let signature = combine_signature(&test.sig); + match secp256k1_verify(&message_hash, &signature, &test.public_key_uncompressed) { + Ok(valid) => assert_eq!(test.valid, valid), + Err(e) => { + assert!(!test.valid, "expected valid signature, got {:?}", e); + } + } + + if test.valid { + let recovered = + secp256k1_recover_pubkey(&message_hash, &signature, test.sig.id).unwrap(); + assert_eq!(recovered, test.public_key_uncompressed); + } + } +} + +#[test] +fn rootberg_ecdsa_secp256k1_keccak256() { + let File { num_tests, tests } = read_file(SECP256K1_KECCAK256); + assert_eq!(num_tests, tests.len(), "Invalid number of tests"); + assert!(num_tests >= 263, "Got unexpected number of tests"); + + for test in tests { + assert_eq!(test.public_key_uncompressed.len(), 65); + + eprintln!("Test case ID: {}", test.tc_id); + let message_hash = hashers::keccak_256(&test.msg); + + let signature = combine_signature(&test.sig); + match secp256k1_verify(&message_hash, &signature, &test.public_key_uncompressed) { + Ok(valid) => assert_eq!(test.valid, valid), + Err(e) => { + assert!(!test.valid, "expected valid signature, got {:?}", e); + } + } + + if test.valid { + let recovered = + secp256k1_recover_pubkey(&message_hash, &signature, test.sig.id).unwrap(); + assert_eq!(recovered, test.public_key_uncompressed); + } + } +} diff --git a/packages/crypto/tests/rootberg_secp256r1.rs b/packages/crypto/tests/rootberg_secp256r1.rs new file mode 100644 index 0000000000..1f8e9f7e5f --- /dev/null +++ b/packages/crypto/tests/rootberg_secp256r1.rs @@ -0,0 +1,65 @@ +use cosmwasm_crypto::{secp256r1_recover_pubkey, secp256r1_verify}; +use rootberg::*; + +mod hashers; +mod rootberg; + +// See ./testdata/rootberg/README.md for how to get/update those files +const SECP256R1_SHA256: &str = "./testdata/rootberg/ecdsa_secp256r1_sha_256_raw.json"; +const SECP256R1_KECCAK256: &str = "./testdata/rootberg/ecdsa_secp256r1_keccak256_raw.json"; + +#[test] +fn rootberg_ecdsa_secp256r1_sha256() { + let File { num_tests, tests } = read_file(SECP256R1_SHA256); + assert_eq!(num_tests, tests.len(), "Invalid number of tests"); + assert!(num_tests >= 407, "Got unexpected number of tests"); + + for test in tests { + assert_eq!(test.public_key_uncompressed.len(), 65); + + eprintln!("Test case ID: {}", test.tc_id); + let message_hash = hashers::sha256(&test.msg); + + let signature = combine_signature(&test.sig); + match secp256r1_verify(&message_hash, &signature, &test.public_key_uncompressed) { + Ok(valid) => assert_eq!(test.valid, valid), + Err(e) => { + assert!(!test.valid, "expected valid signature, got {:?}", e); + } + } + + if test.valid { + let recovered = + secp256r1_recover_pubkey(&message_hash, &signature, test.sig.id).unwrap(); + assert_eq!(recovered, test.public_key_uncompressed); + } + } +} + +#[test] +fn rootberg_ecdsa_secp256r1_keccak256() { + let File { num_tests, tests } = read_file(SECP256R1_KECCAK256); + assert_eq!(num_tests, tests.len(), "Invalid number of tests"); + assert!(num_tests >= 247, "Got unexpected number of tests"); + + for test in tests { + assert_eq!(test.public_key_uncompressed.len(), 65); + + eprintln!("Test case ID: {}", test.tc_id); + let message_hash = hashers::keccak_256(&test.msg); + + let signature = combine_signature(&test.sig); + match secp256r1_verify(&message_hash, &signature, &test.public_key_uncompressed) { + Ok(valid) => assert_eq!(test.valid, valid), + Err(e) => { + assert!(!test.valid, "expected valid signature, got {:?}", e); + } + } + + if test.valid { + let recovered = + secp256r1_recover_pubkey(&message_hash, &signature, test.sig.id).unwrap(); + assert_eq!(recovered, test.public_key_uncompressed); + } + } +} diff --git a/packages/crypto/tests/wycheproof.rs b/packages/crypto/tests/wycheproof.rs new file mode 100644 index 0000000000..3794e88641 --- /dev/null +++ b/packages/crypto/tests/wycheproof.rs @@ -0,0 +1,43 @@ +use serde::Deserialize; + +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct File { + pub number_of_tests: usize, + pub test_groups: Vec, +} + +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct TestGroup { + pub public_key: Key, + pub tests: Vec, +} + +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct Key { + pub uncompressed: String, +} + +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct TestCase { + pub tc_id: u32, + pub comment: String, + pub msg: String, + pub sig: String, + // "acceptable", "valid" or "invalid" + pub result: String, +} + +pub fn read_file(path: &str) -> File { + use std::fs::File; + use std::io::BufReader; + + // Open the file in read-only mode with buffer. + let file = File::open(path).unwrap(); + let reader = BufReader::new(file); + + serde_json::from_reader(reader).unwrap() +} diff --git a/packages/crypto/tests/wycheproof_secp256k1.rs b/packages/crypto/tests/wycheproof_secp256k1.rs new file mode 100644 index 0000000000..4caa52aea3 --- /dev/null +++ b/packages/crypto/tests/wycheproof_secp256k1.rs @@ -0,0 +1,348 @@ +#![allow(clippy::single_match)] // Only needed for old clippy (e.g. 1.70.0) + +use cosmwasm_crypto::{secp256k1_recover_pubkey, secp256k1_verify}; +use wycheproof::*; + +mod hashers; +mod wycheproof; + +// See ./testdata/wycheproof/README.md for how to get/update those files +const SECP256K1_SHA256: &str = "./testdata/wycheproof/ecdsa_secp256k1_sha256_test.json"; +const SECP256K1_SHA512: &str = "./testdata/wycheproof/ecdsa_secp256k1_sha512_test.json"; +const SECP256K1_SHA3_256: &str = "./testdata/wycheproof/ecdsa_secp256k1_sha3_256_test.json"; +const SECP256K1_SHA3_512: &str = "./testdata/wycheproof/ecdsa_secp256k1_sha3_512_test.json"; + +#[test] +fn ecdsa_secp256k1_sha256() { + let mut tested: usize = 0; + let File { + number_of_tests, + test_groups, + } = read_file(SECP256K1_SHA256); + assert!(number_of_tests >= 463, "Got unexpected number of tests"); + + for group in test_groups { + let public_key = hex::decode(group.public_key.uncompressed).unwrap(); + assert_eq!(public_key.len(), 65); + + for tc in group.tests { + tested += 1; + assert_eq!(tc.tc_id as usize, tested); + // eprintln!("Test case ID: {}", tc.tc_id); + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha256(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + + match tc.result.as_str() { + "valid" | "acceptable" => { + let signature = from_der(&der_signature).unwrap(); + let valid = secp256k1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid); + if tc.comment == "k*G has a large x-coordinate" { + // This case (recovery ID 2 and 3) was never supported in the implementation of + // secp256k1_recover_pubkey because the library we used at that time did not support it. + // If needed, we could enable it now in a consensus breaking change. + } else { + test_recover_pubkey(&message_hash, &signature, &public_key, [0, 1]); + } + } + "invalid" => { + if let Ok(signature) = from_der(&der_signature) { + match secp256k1_verify(&message_hash, &signature, &public_key) { + Ok(valid) => assert!(!valid), + Err(_) => { /* this is expected for "invalid", all good */ } + } + } else { + // invalid DER encoding, okay + } + } + _ => panic!("Found unexpected result value"), + } + if tc.result == "valid" {} + } + } + assert_eq!(tested, number_of_tests); +} + +#[test] +fn ecdsa_secp256k1_sha512() { + let mut tested: usize = 0; + let File { + number_of_tests, + test_groups, + } = read_file(SECP256K1_SHA512); + assert!(number_of_tests >= 533, "Got unexpected number of tests"); + + for group in test_groups { + let public_key = hex::decode(group.public_key.uncompressed).unwrap(); + assert_eq!(public_key.len(), 65); + + for tc in group.tests { + tested += 1; + assert_eq!(tc.tc_id as usize, tested); + // eprintln!("Test case ID: {}", tc.tc_id); + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha512(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + + match tc.result.as_str() { + "valid" | "acceptable" => { + let signature = from_der(&der_signature).unwrap(); + let valid = secp256k1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid); + if tc.comment == "k*G has a large x-coordinate" { + // This case (recovery ID 2 and 3) was never supported in the implementation of + // secp256k1_recover_pubkey because the library we used at that time did not support it. + // If needed, we could enable it now in a consensus breaking change. + } else { + test_recover_pubkey(&message_hash, &signature, &public_key, [0, 1]); + } + } + "invalid" => { + if let Ok(signature) = from_der(&der_signature) { + match secp256k1_verify(&message_hash, &signature, &public_key) { + Ok(valid) => assert!(!valid), + Err(_) => { /* this is expected for "invalid", all good */ } + } + } else { + // invalid DER encoding, okay + } + } + _ => panic!("Found unexpected result value"), + } + if tc.result == "valid" {} + } + } + assert_eq!(tested, number_of_tests); +} + +#[test] +fn ecdsa_secp256k1_sha3_256() { + let mut tested: usize = 0; + let File { + number_of_tests, + test_groups, + } = read_file(SECP256K1_SHA3_256); + assert!(number_of_tests >= 471, "Got unexpected number of tests"); + + for group in test_groups { + let public_key = hex::decode(group.public_key.uncompressed).unwrap(); + assert_eq!(public_key.len(), 65); + + for tc in group.tests { + tested += 1; + assert_eq!(tc.tc_id as usize, tested); + // eprintln!("Test case ID: {}", tc.tc_id); + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha3_256(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + + match tc.result.as_str() { + "valid" | "acceptable" => { + let signature = from_der(&der_signature).unwrap(); + let valid = secp256k1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid); + if tc.comment == "k*G has a large x-coordinate" { + // This case (recovery ID 2 and 3) was never supported in the implementation of + // secp256k1_recover_pubkey because the library we used at that time did not support it. + // If needed, we could enable it now in a consensus breaking change. + } else { + test_recover_pubkey(&message_hash, &signature, &public_key, [0, 1]); + } + } + "invalid" => { + if let Ok(signature) = from_der(&der_signature) { + match secp256k1_verify(&message_hash, &signature, &public_key) { + Ok(valid) => assert!(!valid), + Err(_) => { /* this is expected for "invalid", all good */ } + } + } else { + // invalid DER encoding, okay + } + } + _ => panic!("Found unexpected result value"), + } + if tc.result == "valid" {} + } + } + assert_eq!(tested, number_of_tests); +} + +#[test] +fn ecdsa_secp256k1_sha3_512() { + let mut tested: usize = 0; + let File { + number_of_tests, + test_groups, + } = read_file(SECP256K1_SHA3_512); + assert!(number_of_tests >= 537, "Got unexpected number of tests"); + + for group in test_groups { + let public_key = hex::decode(group.public_key.uncompressed).unwrap(); + assert_eq!(public_key.len(), 65); + + for tc in group.tests { + tested += 1; + assert_eq!(tc.tc_id as usize, tested); + // eprintln!("Test case ID: {}", tc.tc_id); + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha3_512(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + + match tc.result.as_str() { + "valid" | "acceptable" => { + let signature = from_der(&der_signature).unwrap(); + let valid = secp256k1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid); + if tc.comment == "k*G has a large x-coordinate" { + // This case (recovery ID 2 and 3) was never supported in the implementation of + // secp256k1_recover_pubkey because the library we used at that time did not support it. + // If needed, we could enable it now in a consensus breaking change. + } else { + test_recover_pubkey(&message_hash, &signature, &public_key, [0, 1]); + } + } + "invalid" => { + if let Ok(signature) = from_der(&der_signature) { + match secp256k1_verify(&message_hash, &signature, &public_key) { + Ok(valid) => assert!(!valid), + Err(_) => { /* this is expected for "invalid", all good */ } + } + } else { + // invalid DER encoding, okay + } + } + _ => panic!("Found unexpected result value"), + } + if tc.result == "valid" {} + } + } + assert_eq!(tested, number_of_tests); +} + +fn test_recover_pubkey(message_hash: &[u8], signature: &[u8], public_key: &[u8], params: [u8; 2]) { + // Since the recovery param is missing in the test vectors, we try both + let recovered0 = secp256k1_recover_pubkey(message_hash, signature, params[0]).unwrap(); + let recovered1 = secp256k1_recover_pubkey(message_hash, signature, params[1]).unwrap(); + // Got two different pubkeys. Without the recovery param, we don't know which one is the right one. + assert_ne!(recovered0, recovered1); + assert!(recovered0 == public_key || recovered1 == public_key); +} + +fn from_der(data: &[u8]) -> Result<[u8; 64], String> { + const DER_TAG_INTEGER: u8 = 0x02; + + let mut pos = 0; + + let Some(prefix) = data.get(pos) else { + return Err("Could not read prefix".to_string()); + }; + pos += 1; + if *prefix != 0x30 { + return Err("Prefix 0x30 expected".to_string()); + } + + let Some(body_length) = data.get(pos) else { + return Err("Could not read body length".to_string()); + }; + pos += 1; + if data.len() - pos != *body_length as usize { + return Err("Data length mismatch detected".to_string()); + } + + // r + let Some(r_tag) = data.get(pos) else { + return Err("Could not read r_tag".to_string()); + }; + pos += 1; + if *r_tag != DER_TAG_INTEGER { + return Err("INTEGER tag expected".to_string()); + } + let Some(r_length) = data.get(pos).map(|rl: &u8| *rl as usize) else { + return Err("Could not read r_length".to_string()); + }; + pos += 1; + if r_length >= 0x80 { + return Err("Decoding length values above 127 not supported".to_string()); + } + if pos + r_length > data.len() { + return Err("R length exceeds end of data".to_string()); + } + let r_data = &data[pos..pos + r_length]; + pos += r_length; + + // s + let Some(s_tag) = data.get(pos) else { + return Err("Could not read s_tag".to_string()); + }; + pos += 1; + if *s_tag != DER_TAG_INTEGER { + return Err("INTEGER tag expected".to_string()); + } + let Some(s_length) = data.get(pos).map(|sl| *sl as usize) else { + return Err("Could not read s_length".to_string()); + }; + pos += 1; + if s_length >= 0x80 { + return Err("Decoding length values above 127 not supported".to_string()); + } + if pos + s_length > data.len() { + return Err("S length exceeds end of data".to_string()); + } + let s_data = &data[pos..pos + s_length]; + pos += s_length; + + if pos != data.len() { + return Err("Extra bytes in data input".to_string()); + } + + let r = decode_unsigned_integer(r_data, "r")?; + let s = decode_unsigned_integer(s_data, "s")?; + + let mut out = [0u8; 64]; + out[0..32].copy_from_slice(&r); + out[32..].copy_from_slice(&s); + Ok(out) +} + +fn decode_unsigned_integer(mut data: &[u8], name: &str) -> Result<[u8; 32], String> { + if data.is_empty() { + return Err(format!("{name} data is empty")); + } + + // If high bit of first byte is set, this is interpreted as a negative integer. + // A leading zero is needed to prevent this. + if (data[0] & 0x80) != 0 { + return Err(format!("{name} data missing leading zero")); + } + + // "Leading octets of all 0's (or all 1's) are not allowed. In other words, the leftmost + // nine bits of an encoded INTEGER value may not be all 0's or all 1's. This ensures that + // an INTEGER value is encoded in the smallest possible number of octets." + // https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference/basic-encoding-rules.html + + // If leading byte is 0 and there is more than 1 byte, trim it. + // If the high bit of the following byte is zero as well, the leading 0x00 was invalid. + if data.len() > 1 && data[0] == 0 { + data = &data[1..]; + if (data[0] & 0x80) == 0 { + return Err(format!("{name} data has invalid leading zero")); + } + } + + // The other requirement (first 9 bits being all 1) is not yet checked + + // Do we need a better value range check here? + if data.len() > 32 { + return Err(format!("{name} data exceeded 32 bytes")); + } + + Ok(pad_to_32(data)) +} + +fn pad_to_32(input: &[u8]) -> [u8; 32] { + let shift = 32 - input.len(); + let mut out = [0u8; 32]; + out[shift..].copy_from_slice(input); + out +} diff --git a/packages/crypto/tests/wycheproof_secp256r1.rs b/packages/crypto/tests/wycheproof_secp256r1.rs new file mode 100644 index 0000000000..e7e38bbcb3 --- /dev/null +++ b/packages/crypto/tests/wycheproof_secp256r1.rs @@ -0,0 +1,352 @@ +#![allow(clippy::single_match)] + +use cosmwasm_crypto::{secp256r1_recover_pubkey, secp256r1_verify}; +use wycheproof::*; + +mod hashers; +mod wycheproof; + +// See ./testdata/wycheproof/README.md for how to get/update those files +const SECP256R1_SHA256: &str = "./testdata/wycheproof/ecdsa_secp256r1_sha256_test.json"; +const SECP256R1_SHA512: &str = "./testdata/wycheproof/ecdsa_secp256r1_sha512_test.json"; +const SECP256R1_SHA3_256: &str = "./testdata/wycheproof/ecdsa_secp256r1_sha3_256_test.json"; +const SECP256R1_SHA3_512: &str = "./testdata/wycheproof/ecdsa_secp256r1_sha3_512_test.json"; + +#[test] +fn ecdsa_secp256r1_sha256() { + let mut tested: usize = 0; + let File { + number_of_tests, + test_groups, + } = read_file(SECP256R1_SHA256); + assert!(number_of_tests >= 471, "Got unexpected number of tests"); + + for group in test_groups { + let public_key = hex::decode(group.public_key.uncompressed).unwrap(); + assert_eq!(public_key.len(), 65); + + for tc in group.tests { + tested += 1; + assert_eq!(tc.tc_id as usize, tested); + + match tc.result.as_str() { + "valid" | "acceptable" => { + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha256(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + let signature = from_der(&der_signature).unwrap(); + let valid = secp256r1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid); + if tc.comment == "k*G has a large x-coordinate" { + test_recover_pubkey(&message_hash, &signature, &public_key, [2, 3]); + } else { + test_recover_pubkey(&message_hash, &signature, &public_key, [0, 1]); + } + } + "invalid" => { + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha256(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + + if let Ok(signature) = from_der(&der_signature) { + match secp256r1_verify(&message_hash, &signature, &public_key) { + Ok(valid) => assert!(!valid), + Err(_) => { /* this is expected for "invalid", all good */ } + } + } else { + // invalid DER encoding, okay + } + } + _ => panic!("Found unexpected result value"), + } + if tc.result == "valid" {} + } + } + assert_eq!(tested, number_of_tests); +} + +#[test] +fn ecdsa_secp256r1_sha512() { + let mut tested: usize = 0; + let File { + number_of_tests, + test_groups, + } = read_file(SECP256R1_SHA512); + assert!(number_of_tests >= 541, "Got unexpected number of tests"); + + for group in test_groups { + let public_key = hex::decode(group.public_key.uncompressed).unwrap(); + assert_eq!(public_key.len(), 65); + + for tc in group.tests { + tested += 1; + assert_eq!(tc.tc_id as usize, tested); + + match tc.result.as_str() { + "valid" | "acceptable" => { + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha512(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + let signature = from_der(&der_signature).unwrap(); + let valid = secp256r1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid); + if tc.comment == "k*G has a large x-coordinate" { + test_recover_pubkey(&message_hash, &signature, &public_key, [2, 3]); + } else { + test_recover_pubkey(&message_hash, &signature, &public_key, [0, 1]); + } + } + "invalid" => { + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha512(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + + if let Ok(signature) = from_der(&der_signature) { + match secp256r1_verify(&message_hash, &signature, &public_key) { + Ok(valid) => assert!(!valid), + Err(_) => { /* this is expected for "invalid", all good */ } + } + } else { + // invalid DER encoding, okay + } + } + _ => panic!("Found unexpected result value"), + } + if tc.result == "valid" {} + } + } + assert_eq!(tested, number_of_tests); +} + +#[test] +fn ecdsa_secp256r1_sha3_256() { + let mut tested: usize = 0; + let File { + number_of_tests, + test_groups, + } = read_file(SECP256R1_SHA3_256); + assert!(number_of_tests >= 479, "Got unexpected number of tests"); + + for group in test_groups { + let public_key = hex::decode(group.public_key.uncompressed).unwrap(); + assert_eq!(public_key.len(), 65); + + for tc in group.tests { + tested += 1; + assert_eq!(tc.tc_id as usize, tested); + + match tc.result.as_str() { + "valid" | "acceptable" => { + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha3_256(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + let signature = from_der(&der_signature).unwrap(); + let valid = secp256r1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid); + if tc.comment == "k*G has a large x-coordinate" { + test_recover_pubkey(&message_hash, &signature, &public_key, [2, 3]); + } else { + test_recover_pubkey(&message_hash, &signature, &public_key, [0, 1]); + } + } + "invalid" => { + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha3_256(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + + if let Ok(signature) = from_der(&der_signature) { + match secp256r1_verify(&message_hash, &signature, &public_key) { + Ok(valid) => assert!(!valid), + Err(_) => { /* this is expected for "invalid", all good */ } + } + } else { + // invalid DER encoding, okay + } + } + _ => panic!("Found unexpected result value"), + } + if tc.result == "valid" {} + } + } + assert_eq!(tested, number_of_tests); +} + +#[test] +fn ecdsa_secp256r1_sha3_512() { + let mut tested: usize = 0; + let File { + number_of_tests, + test_groups, + } = read_file(SECP256R1_SHA3_512); + assert!(number_of_tests >= 545, "Got unexpected number of tests"); + + for group in test_groups { + let public_key = hex::decode(group.public_key.uncompressed).unwrap(); + assert_eq!(public_key.len(), 65); + + for tc in group.tests { + tested += 1; + assert_eq!(tc.tc_id as usize, tested); + + match tc.result.as_str() { + "valid" | "acceptable" => { + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha3_512(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + let signature = from_der(&der_signature).unwrap(); + let valid = secp256r1_verify(&message_hash, &signature, &public_key).unwrap(); + assert!(valid); + if tc.comment == "k*G has a large x-coordinate" { + test_recover_pubkey(&message_hash, &signature, &public_key, [2, 3]); + } else { + test_recover_pubkey(&message_hash, &signature, &public_key, [0, 1]); + } + } + "invalid" => { + let message = hex::decode(tc.msg).unwrap(); + let message_hash = hashers::sha3_512(&message); + let der_signature = hex::decode(tc.sig).unwrap(); + + if let Ok(signature) = from_der(&der_signature) { + match secp256r1_verify(&message_hash, &signature, &public_key) { + Ok(valid) => assert!(!valid), + Err(_) => { /* this is expected for "invalid", all good */ } + } + } else { + // invalid DER encoding, okay + } + } + _ => panic!("Found unexpected result value"), + } + if tc.result == "valid" {} + } + } + assert_eq!(tested, number_of_tests); +} + +fn test_recover_pubkey(message_hash: &[u8], signature: &[u8], public_key: &[u8], params: [u8; 2]) { + // Since the recovery param is missing in the test vectors, we try both + let recovered0 = secp256r1_recover_pubkey(message_hash, signature, params[0]).unwrap(); + let recovered1 = secp256r1_recover_pubkey(message_hash, signature, params[1]).unwrap(); + // Got two different pubkeys. Without the recovery param, we don't know which one is the right one. + assert_ne!(recovered0, recovered1); + assert!(recovered0 == public_key || recovered1 == public_key); +} + +fn from_der(data: &[u8]) -> Result<[u8; 64], String> { + const DER_TAG_INTEGER: u8 = 0x02; + + let mut pos = 0; + + let Some(prefix) = data.get(pos) else { + return Err("Could not read prefix".to_string()); + }; + pos += 1; + if *prefix != 0x30 { + return Err("Prefix 0x30 expected".to_string()); + } + + let Some(body_length) = data.get(pos) else { + return Err("Could not read body length".to_string()); + }; + pos += 1; + if data.len() - pos != *body_length as usize { + return Err("Data length mismatch detected".to_string()); + } + + // r + let Some(r_tag) = data.get(pos) else { + return Err("Could not read r_tag".to_string()); + }; + pos += 1; + if *r_tag != DER_TAG_INTEGER { + return Err("INTEGER tag expected".to_string()); + } + let Some(r_length) = data.get(pos).map(|rl: &u8| *rl as usize) else { + return Err("Could not read r_length".to_string()); + }; + pos += 1; + if r_length >= 0x80 { + return Err("Decoding length values above 127 not supported".to_string()); + } + if pos + r_length > data.len() { + return Err("R length exceeds end of data".to_string()); + } + let r_data = &data[pos..pos + r_length]; + pos += r_length; + + // s + let Some(s_tag) = data.get(pos) else { + return Err("Could not read s_tag".to_string()); + }; + pos += 1; + if *s_tag != DER_TAG_INTEGER { + return Err("INTEGER tag expected".to_string()); + } + let Some(s_length) = data.get(pos).map(|sl| *sl as usize) else { + return Err("Could not read s_length".to_string()); + }; + pos += 1; + if s_length >= 0x80 { + return Err("Decoding length values above 127 not supported".to_string()); + } + if pos + s_length > data.len() { + return Err("S length exceeds end of data".to_string()); + } + let s_data = &data[pos..pos + s_length]; + pos += s_length; + + if pos != data.len() { + return Err("Extra bytes in data input".to_string()); + } + + let r = decode_unsigned_integer(r_data, "r")?; + let s = decode_unsigned_integer(s_data, "s")?; + + let mut out = [0u8; 64]; + out[0..32].copy_from_slice(&r); + out[32..].copy_from_slice(&s); + Ok(out) +} + +fn decode_unsigned_integer(mut data: &[u8], name: &str) -> Result<[u8; 32], String> { + if data.is_empty() { + return Err(format!("{name} data is empty")); + } + + // If high bit of first byte is set, this is interpreted as a negative integer. + // A leading zero is needed to prevent this. + if (data[0] & 0x80) != 0 { + return Err(format!("{name} data missing leading zero")); + } + + // "Leading octets of all 0's (or all 1's) are not allowed. In other words, the leftmost + // nine bits of an encoded INTEGER value may not be all 0's or all 1's. This ensures that + // an INTEGER value is encoded in the smallest possible number of octets." + // https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference/basic-encoding-rules.html + + // If leading byte is 0 and there is more than 1 byte, trim it. + // If the high bit of the following byte is zero as well, the leading 0x00 was invalid. + if data.len() > 1 && data[0] == 0 { + data = &data[1..]; + if (data[0] & 0x80) == 0 { + return Err(format!("{name} data has invalid leading zero")); + } + } + + // The other requirement (first 9 bits being all 1) is not yet checked + + // Do we need a better value range check here? + if data.len() > 32 { + return Err(format!("{name} data exceeded 32 bytes")); + } + + Ok(pad_to_32(data)) +} + +fn pad_to_32(input: &[u8]) -> [u8; 32] { + let shift = 32 - input.len(); + let mut out = [0u8; 32]; + out[shift..].copy_from_slice(input); + out +} diff --git a/packages/cw-schema-derive/Cargo.toml b/packages/cw-schema-derive/Cargo.toml new file mode 100644 index 0000000000..ec683dcd5a --- /dev/null +++ b/packages/cw-schema-derive/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "cw-schema-derive" +version = { workspace = true } +authors = ["Aumetra Weisman "] +edition = "2021" +description = "Derive macros for cw-schema" +repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/cw-schema-derive" +license = "Apache-2.0" + +[lib] +proc-macro = true + +[dependencies] +heck = "0.5.0" +itertools = { version = "0.13.0", default-features = false } +owo-colors = { version = "4.0.0", features = ["supports-colors"] } +proc-macro2 = { version = "1.0.86", features = ["span-locations"] } +quote = "1.0.36" +syn = { version = "2.0.72", features = ["full"] } diff --git a/packages/cw-schema-derive/src/expand.rs b/packages/cw-schema-derive/src/expand.rs new file mode 100644 index 0000000000..86fffc3fb1 --- /dev/null +++ b/packages/cw-schema-derive/src/expand.rs @@ -0,0 +1,576 @@ +use crate::bail; +use owo_colors::{OwoColorize, Style}; +use proc_macro2::TokenStream; +use quote::{format_ident, quote}; +use std::{ + borrow::Cow, + env, + fmt::Display, + io::{self, Write}, +}; +use syn::{spanned::Spanned, DataEnum, DataStruct, DataUnion, DeriveInput, Lit}; + +macro_rules! empty_meta { + ($meta:expr) => {{ + let _ = $meta + .value() + .map(|val| val.parse::().unwrap()) + .unwrap_or_else(|_| $meta.input.cursor().token_stream()); + }}; +} + +fn print_warning( + span: proc_macro2::Span, + title: impl Display, + content: impl Display, +) -> io::Result<()> { + let mut sink = io::stderr(); + + let bold_yellow = Style::new().bold().yellow(); + let bold = Style::new().bold(); + let blue = Style::new().blue(); + + write!(sink, "{}", "warning".style(bold_yellow))?; + writeln!( + sink, + "{}", + format_args!("({}): {title}", env!("CARGO_PKG_NAME")).style(bold) + )?; + + writeln!(sink, "{}", " | ".style(blue))?; + write!(sink, "{}", " | ".style(blue))?; + writeln!(sink, "{content}")?; + + let span = span.start(); + write!(sink, "{}", " | ".style(blue))?; + writeln!(sink, "Location: {}:{}", span.line, span.column)?; + + writeln!(sink, "{}", " | ".style(blue))?; + + write!(sink, "{}", " = ".style(blue))?; + write!(sink, "{}", "note: ".style(bold))?; + writeln!( + sink, + "annotate the container with #[schemaifier(mute_warnings)] to disable these warnings" + )?; + + Ok(()) +} + +type Converter = fn(&str) -> String; + +fn case_converter(case: &syn::LitStr) -> syn::Result { + macro_rules! define_converter { + (match $value:expr => { + $( $case:pat => $converter:expr, )* + }) => { + match $value { + $( $case => |txt: &str| $converter(txt).to_string(), )* + _ => return Err(syn::Error::new_spanned(case, "unsupported case style")), + } + }; + } + + let case = case.value(); + let converter = define_converter!(match case.as_str() => { + "camelCase" => heck::AsLowerCamelCase, + "snake_case" => heck::AsSnakeCase, + "kebab-case" => heck::AsKebabCase, + "SCREAMING_SNAKE_CASE" => heck::AsShoutySnakeCase, + "SCREAMING-KEBAB-CASE" => heck::AsShoutyKebabCase, + }); + + Ok(converter) +} + +#[inline] +fn maybe_case_converter(case: Option<&syn::LitStr>) -> syn::Result { + case.map(case_converter) + .unwrap_or_else(|| Ok(|txt: &str| txt.to_string())) +} + +#[inline] +fn ident_adapter(converter: Converter) -> impl Fn(&syn::Ident) -> syn::Ident { + move |ident: &syn::Ident| format_ident!("{}", converter(&ident.to_string())) +} + +struct SerdeContainerOptions { + rename_all: Option, + untagged: bool, +} + +impl SerdeContainerOptions { + fn parse(attributes: &[syn::Attribute], muted_warnings: bool) -> syn::Result { + let mut options = SerdeContainerOptions { + rename_all: None, + untagged: false, + }; + + for attribute in attributes + .iter() + .filter(|attr| attr.path().is_ident("serde")) + { + attribute.parse_nested_meta(|meta| { + if meta.path.is_ident("crate") { + // ignore the serde crate annotation. we don't really care for that. + empty_meta!(meta); + } else if meta.path.is_ident("rename_all") { + options.rename_all = Some(meta.value()?.parse()?); + } else if meta.path.is_ident("untagged") { + options.untagged = true; + } else { + if !muted_warnings { + print_warning( + meta.path.span(), + "unknown serde attribute", + format!( + "unknown attribute \"{}\"", + meta.path + .get_ident() + .map(|ident| ident.to_string()) + .unwrap_or_else(|| "[error]".into()) + ), + ) + .unwrap(); + } + + // TODO: support other serde attributes + // + // See: + // + // For now we simply clear the buffer to avoid errors + empty_meta!(meta); + } + + if (meta.path.is_ident("untagged") || meta.path.is_ident("tag")) && !muted_warnings + { + print_warning( + meta.path.span(), + "unsupported tag type", + meta.error("unsupported tag type").to_string(), + ) + .unwrap(); + } + + Ok(()) + })?; + } + + Ok(options) + } +} + +struct ContainerOptions { + r#as: Option, + r#type: Option, + crate_path: syn::Path, + muted_warnings: bool, +} + +impl ContainerOptions { + fn parse(attributes: &[syn::Attribute]) -> syn::Result { + let mut options = ContainerOptions { + r#as: None, + r#type: None, + crate_path: syn::parse_str("::cw_schema")?, + muted_warnings: false, + }; + + for attribute in attributes + .iter() + .filter(|attr| attr.path().is_ident("schemaifier")) + { + attribute.parse_nested_meta(|meta| { + if meta.path.is_ident("crate") { + let stringified: syn::LitStr = meta.value()?.parse()?; + options.crate_path = stringified.parse()?; + } else if meta.path.is_ident("as") { + options.r#as = Some(meta.value()?.parse()?); + } else if meta.path.is_ident("type") { + options.r#type = Some(meta.value()?.parse()?); + } else if meta.path.is_ident("mute_warnings") { + options.muted_warnings = true; + } else { + bail!(meta.path, "unknown attribute"); + } + + Ok(()) + })?; + } + + Ok(options) + } +} + +struct SerdeFieldOptions { + default: bool, + rename: Option, + skip_serializing_if: Option, +} + +impl SerdeFieldOptions { + fn parse(attributes: &[syn::Attribute], muted_warnings: bool) -> syn::Result { + let mut options = SerdeFieldOptions { + default: false, + rename: None, + skip_serializing_if: None, + }; + + for attribute in attributes + .iter() + .filter(|attr| attr.path().is_ident("serde")) + { + attribute.parse_nested_meta(|meta| { + if meta.path.is_ident("rename") { + options.rename = Some(meta.value()?.parse()?); + } else if meta.path.is_ident("default") { + options.default = true; + // just ignore the rest. it's not relevant. + // but without this code, we'd sometimes hit compile errors. + empty_meta!(meta); + } else if meta.path.is_ident("skip_serializing_if") { + options.skip_serializing_if = Some(meta.value()?.parse()?); + } else { + if !muted_warnings { + print_warning( + meta.path.span(), + "unknown serde attribute", + format!( + "unknown attribute \"{}\"", + meta.path + .get_ident() + .map(|ident| ident.to_string()) + .unwrap_or_else(|| "[error]".into()) + ), + ) + .unwrap(); + } + + // TODO: support other serde attributes + // + // See: + // + // For now we simply clear the buffer to avoid errors + empty_meta!(meta); + } + + Ok(()) + })?; + } + + Ok(options) + } +} + +#[inline] +fn normalize_option(value: Option) -> TokenStream { + match value { + Some(value) => quote! { Some(#value.into()) }, + None => quote! { None }, + } +} + +fn extract_documentation(attributes: &[syn::Attribute]) -> syn::Result> { + let docs_iter = attributes + .iter() + .filter(|attribute| attribute.path().is_ident("doc")) + .map(|doc_attribute| { + let name_value = doc_attribute.meta.require_name_value()?; + + let syn::Expr::Lit(syn::ExprLit { + lit: Lit::Str(ref text), + .. + }) = name_value.value + else { + bail!(name_value, "expected string literal"); + }; + + Ok(Cow::Owned(text.value().trim().to_string())) + }); + + let docs = itertools::intersperse(docs_iter, Ok(Cow::Borrowed("\n"))) + .collect::>()?; + + if docs.is_empty() { + return Ok(None); + } + + Ok(Some(docs)) +} + +fn patch_type_params<'a, I>(options: &ContainerOptions, type_params: I) +where + I: Iterator, +{ + let crate_path = &options.crate_path; + + for param in type_params { + param.bounds.push(syn::TypeParamBound::Verbatim( + quote! { #crate_path::Schemaifier }, + )); + } +} + +pub struct ContainerMeta { + name: syn::Ident, + description: Option, + generics: syn::Generics, + options: ContainerOptions, + serde_options: SerdeContainerOptions, +} + +fn collect_struct_fields<'a, C>( + converter: &'a C, + crate_path: &'a syn::Path, + fields: &'a syn::FieldsNamed, + muted_warnings: bool, +) -> impl Iterator> + 'a +where + C: Fn(&syn::Ident) -> syn::Ident, +{ + fields.named.iter().map(move |field| { + let field_options = SerdeFieldOptions::parse(&field.attrs, muted_warnings)?; + + let name = field_options + .rename + .map(|lit_str| format_ident!("{}", lit_str.value())) + .unwrap_or_else(|| converter(field.ident.as_ref().unwrap())); + let description = normalize_option(extract_documentation(&field.attrs)?); + let field_ty = &field.ty; + let defaulting = field_options.default; + + let expanded = quote! { + ( + stringify!(#name).into(), + #crate_path::StructProperty { + defaulting: #defaulting, + description: #description, + value: <#field_ty as #crate_path::Schemaifier>::visit_schema(visitor), + } + ) + }; + + Ok(expanded) + }) +} + +fn expand_enum(mut meta: ContainerMeta, input: DataEnum) -> syn::Result { + let crate_path = &meta.options.crate_path; + let converter = ident_adapter(maybe_case_converter( + meta.serde_options.rename_all.as_ref(), + )?); + + let mut cases = Vec::new(); + for variant in input.variants.iter() { + let value = match variant.fields { + syn::Fields::Named(ref fields) => { + let items = collect_struct_fields( + &converter, + crate_path, + fields, + meta.options.muted_warnings, + ) + .collect::>>()?; + + quote! { + #crate_path::EnumValue::Named { + properties: #crate_path::reexport::BTreeMap::from([ + #( #items, )* + ]) + } + } + } + syn::Fields::Unnamed(ref fields) => { + let types = fields.unnamed.iter().map(|field| &field.ty); + + quote! { + #crate_path::EnumValue::Tuple { + items: vec![ + #( <#types as #crate_path::Schemaifier>::visit_schema(visitor), )* + ] + } + } + } + syn::Fields::Unit => quote! { #crate_path::EnumValue::Unit }, + }; + + let field_options = SerdeFieldOptions::parse(&variant.attrs, meta.options.muted_warnings)?; + + let variant_name = field_options + .rename + .map(|lit_str| format_ident!("{}", lit_str.value())) + .unwrap_or_else(|| converter(&variant.ident)); + let description = normalize_option(extract_documentation(&variant.attrs)?); + + let expanded = quote! { + #crate_path::EnumCase { + description: #description, + value: #value, + } + }; + + cases.push(quote! { + ( + stringify!(#variant_name).into(), + #expanded, + ) + }); + } + + let name = &meta.name; + let description = normalize_option(meta.description.as_ref()); + let crate_path = &meta.options.crate_path; + + patch_type_params(&meta.options, meta.generics.type_params_mut()); + let (impl_generics, ty_generics, where_clause) = meta.generics.split_for_impl(); + + Ok(quote! { + #[automatically_derived] + impl #impl_generics #crate_path::Schemaifier for #name #ty_generics #where_clause { + fn visit_schema(visitor: &mut #crate_path::SchemaVisitor) -> #crate_path::DefinitionReference { + if let Some(reference) = visitor.get_reference::() { + return reference; + } + + visitor.reserve_spot(Self::id()); + + let node = #crate_path::Node { + name: std::any::type_name::() + .replace("::", "_") + .replace(['<', '>'], "_") + .into(), + description: #description, + value: #crate_path::NodeType::Enum { + discriminator: None, + cases: #crate_path::reexport::BTreeMap::from([ + #( #cases, )* + ]), + }, + }; + + visitor.insert(Self::id(), node) + } + } + }) +} + +fn expand_struct(mut meta: ContainerMeta, input: DataStruct) -> syn::Result { + let converter = ident_adapter(maybe_case_converter( + meta.serde_options.rename_all.as_ref(), + )?); + + let name = &meta.name; + let description = normalize_option(meta.description.as_ref()); + let crate_path = &meta.options.crate_path; + + let node = if let Some(ref r#as) = meta.options.r#as { + quote! { + let definition_resource = #crate_path::Schemaifier::visit_schema(visitor); + visitor.get_schema::<#r#as>().unwrap().clone() + } + } else { + let node_ty = if let Some(ref r#type) = meta.options.r#type { + quote! { + #r#type + } + } else { + let node_ty = match input.fields { + syn::Fields::Named(ref named) => { + let items = collect_struct_fields( + &converter, + crate_path, + named, + meta.options.muted_warnings, + ) + .collect::>>()?; + + quote! { + #crate_path::StructType::Named { + properties: #crate_path::reexport::BTreeMap::from([ + #( #items, )* + ]) + } + } + } + syn::Fields::Unnamed(fields) => { + let type_names = fields.unnamed.iter().map(|field| &field.ty); + + quote! { + #crate_path::StructType::Tuple { + items: vec![ + #( + <#type_names as #crate_path::Schemaifier>::visit_schema(visitor), + )* + ], + } + } + } + syn::Fields::Unit => quote! { #crate_path::StructType::Unit }, + }; + + quote! { + #crate_path::NodeType::Struct(#node_ty) + } + }; + + quote! { + #crate_path::Node { + name: std::any::type_name::() + .replace("::", "_") + .replace(['<', '>'], "_") + .into(), + description: #description, + value: #node_ty, + } + } + }; + + patch_type_params(&meta.options, meta.generics.type_params_mut()); + let (impl_generics, ty_generics, where_clause) = meta.generics.split_for_impl(); + + Ok(quote! { + #[automatically_derived] + impl #impl_generics #crate_path::Schemaifier for #name #ty_generics #where_clause { + fn visit_schema(visitor: &mut #crate_path::SchemaVisitor) -> #crate_path::DefinitionReference { + if let Some(reference) = visitor.get_reference::() { + return reference; + } + + visitor.reserve_spot(Self::id()); + + let node = { + #node + }; + + visitor.insert(Self::id(), node) + } + } + }) +} + +fn expand_union(_meta: ContainerMeta, input: DataUnion) -> syn::Result { + Err(syn::Error::new_spanned( + input.union_token, + "Unions are not supported (yet)", + )) +} + +pub fn expand(input: DeriveInput) -> syn::Result { + let options = ContainerOptions::parse(&input.attrs)?; + let serde_options = SerdeContainerOptions::parse(&input.attrs, options.muted_warnings)?; + let description = extract_documentation(&input.attrs)?; + + let meta = ContainerMeta { + name: input.ident, + description, + generics: input.generics, + options, + serde_options, + }; + + match input.data { + syn::Data::Enum(input) => expand_enum(meta, input), + syn::Data::Struct(input) => expand_struct(meta, input), + syn::Data::Union(input) => expand_union(meta, input), + } +} diff --git a/packages/cw-schema-derive/src/lib.rs b/packages/cw-schema-derive/src/lib.rs new file mode 100644 index 0000000000..810617bf19 --- /dev/null +++ b/packages/cw-schema-derive/src/lib.rs @@ -0,0 +1,30 @@ +//! Derive macros for cw-schema. For internal use only. +//! +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! For more information, see: + +mod expand; + +macro_rules! bail { + ($span_src:expr, $msg:literal) => {{ + return Err($crate::error_message!($span_src, $msg)); + }}; +} + +macro_rules! error_message { + ($span_src:expr, $msg:literal) => {{ + ::syn::Error::new(::syn::spanned::Spanned::span(&{ $span_src }), $msg) + }}; +} +// Needed so we can import macros. Rust, why? +use {bail, error_message}; + +#[proc_macro_derive(Schemaifier, attributes(schemaifier, serde))] +pub fn schemaifier(input: proc_macro::TokenStream) -> proc_macro::TokenStream { + let input = syn::parse_macro_input!(input as syn::DeriveInput); + + match expand::expand(input) { + Ok(output) => output.into(), + Err(err) => err.to_compile_error().into(), + } +} diff --git a/packages/cw-schema/.gitignore b/packages/cw-schema/.gitignore new file mode 100644 index 0000000000..ea8c4bf7f3 --- /dev/null +++ b/packages/cw-schema/.gitignore @@ -0,0 +1 @@ +/target diff --git a/packages/cw-schema/Cargo.toml b/packages/cw-schema/Cargo.toml new file mode 100644 index 0000000000..7ba277ee9f --- /dev/null +++ b/packages/cw-schema/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "cw-schema" +version = { workspace = true } +authors = ["Aumetra Weisman "] +edition = "2021" +description = "A dependency for CosmWasm contracts to generate schema files for their messages." +repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/cw-schema" +license = "Apache-2.0" + +[dependencies] +cw-schema-derive = { workspace = true } +indexmap = { version = "2.3.0", default-features = false } +schemars = { version = "1.0.4", optional = true } +serde = { version = "1.0.204", features = ["derive"] } +serde_with = { version = "3.9.0", default-features = false, features = ["macros"] } +siphasher = { version = "1.0.1", default-features = false } +typeid = "1.0.3" + +[dev-dependencies] +insta = { version = "1.39.0", features = ["json"] } +pretty_assertions = "1.4.0" +serde_json = "1.0.120" + +[features] +default = ["std"] +std = ["dep:schemars"] diff --git a/packages/cw-schema/src/default_impls.rs b/packages/cw-schema/src/default_impls.rs new file mode 100644 index 0000000000..eb3728e51f --- /dev/null +++ b/packages/cw-schema/src/default_impls.rs @@ -0,0 +1,276 @@ +use crate::{MapKind, Node, NodeType, Schemaifier}; +use alloc::{ + borrow::{Cow, ToOwned}, + boxed::Box, + collections::BTreeMap, + string::String, + vec, + vec::Vec, +}; + +impl Schemaifier for () { + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + visitor.insert( + Self::id(), + Node { + name: Cow::Borrowed("Unit"), + description: None, + value: NodeType::Unit, + }, + ) + } +} + +impl Schemaifier for str { + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + visitor.insert( + Self::id(), + Node { + name: Cow::Borrowed("str"), + description: None, + value: NodeType::String, + }, + ) + } +} + +impl Schemaifier for String { + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + visitor.insert( + Self::id(), + Node { + name: Cow::Borrowed("String"), + description: None, + value: NodeType::String, + }, + ) + } +} + +macro_rules! impl_integer { + ($($t:ty),+) => { + $( + impl Schemaifier for $t { + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + visitor.insert(Self::id(), Node { + name: Cow::Borrowed(stringify!($t)), + description: None, + value: NodeType::Integer { + signed: <$t>::MIN != 0, + precision: <$t>::BITS as u64, + }, + }) + } + } + )+ + }; +} + +impl_integer!(u8, i8, u16, i16, u32, i32, u64, i64, u128, i128, usize, isize); + +impl Schemaifier for f32 { + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + visitor.insert( + Self::id(), + Node { + name: Cow::Borrowed("f32"), + description: None, + value: NodeType::Float, + }, + ) + } +} + +impl Schemaifier for f64 { + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + visitor.insert( + Self::id(), + Node { + name: Cow::Borrowed("f64"), + description: None, + value: NodeType::Double, + }, + ) + } +} + +impl Schemaifier for bool { + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + visitor.insert( + Self::id(), + Node { + name: Cow::Borrowed("bool"), + description: None, + value: NodeType::Boolean, + }, + ) + } +} + +impl Schemaifier for Box +where + T: Schemaifier + ?Sized, +{ + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + let node = Node { + name: Cow::Borrowed(std::any::type_name::()), + description: None, + value: NodeType::Boxed { + inner: T::visit_schema(visitor), + }, + }; + + visitor.insert(Self::id(), node) + } +} + +impl Schemaifier for Vec +where + T: Schemaifier, +{ + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + let node = Node { + name: Cow::Borrowed(std::any::type_name::()), + description: None, + value: NodeType::Array { + items: T::visit_schema(visitor), + }, + }; + + visitor.insert(Self::id(), node) + } +} + +macro_rules! all_the_tuples { + ($($($n:ident),+);+$(;)?) => { + $( + impl<$($n: Schemaifier),+> Schemaifier for ($($n,)+) { + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + let node = Node { + name: Cow::Borrowed(std::any::type_name::()), + description: None, + value: NodeType::Tuple { + items: vec![ + $(<$n as Schemaifier>::visit_schema(visitor)),+ + ], + }, + }; + + visitor.insert(Self::id(), node) + } + } + )+ + }; +} + +// Implement for tuples up to 16 elements. +// Good enough. If someone needs more, PR it. +all_the_tuples! { + A; + A, B; + A, B, C; + A, B, C, D; + A, B, C, D, E; + A, B, C, D, E, F; + A, B, C, D, E, F, G; + A, B, C, D, E, F, G, H; + A, B, C, D, E, F, G, H, I; + A, B, C, D, E, F, G, H, I, J; + A, B, C, D, E, F, G, H, I, J, K; + A, B, C, D, E, F, G, H, I, J, K, L; + A, B, C, D, E, F, G, H, I, J, K, L, M; + A, B, C, D, E, F, G, H, I, J, K, L, M, N; + A, B, C, D, E, F, G, H, I, J, K, L, M, N, O; + A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P; +} + +impl Schemaifier for Option +where + T: Schemaifier, +{ + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + let node = Node { + name: Cow::Borrowed(std::any::type_name::()), + description: None, + value: NodeType::Optional { + inner: T::visit_schema(visitor), + }, + }; + + visitor.insert(Self::id(), node) + } +} + +impl Schemaifier for BTreeMap +where + K: Schemaifier, + V: Schemaifier, +{ + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + let node = Node { + name: Cow::Borrowed(std::any::type_name::()), + description: None, + value: NodeType::Map { + kind: MapKind::BTree, + key: K::visit_schema(visitor), + value: V::visit_schema(visitor), + }, + }; + + visitor.insert(Self::id(), node) + } +} + +#[cfg(feature = "std")] +impl Schemaifier for std::collections::HashMap +where + K: Schemaifier, + V: Schemaifier, +{ + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + let node = Node { + name: Cow::Borrowed(std::any::type_name::()), + description: None, + value: NodeType::Map { + kind: MapKind::Hash, + key: K::visit_schema(visitor), + value: V::visit_schema(visitor), + }, + }; + + visitor.insert(Self::id(), node) + } +} + +impl Schemaifier for &T +where + T: Schemaifier + ?Sized, +{ + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + T::visit_schema(visitor) + } +} + +impl Schemaifier for Cow<'_, T> +where + T: Schemaifier + ToOwned + ?Sized, +{ + #[inline] + fn visit_schema(visitor: &mut crate::SchemaVisitor) -> crate::DefinitionReference { + T::visit_schema(visitor) + } +} diff --git a/packages/cw-schema/src/lib.rs b/packages/cw-schema/src/lib.rs new file mode 100644 index 0000000000..43c643ca5b --- /dev/null +++ b/packages/cw-schema/src/lib.rs @@ -0,0 +1,250 @@ +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! This crate is a dependency for CosmWasm contracts to generate schema files for their messages. +//! +//! For more information, see: + +#![no_std] + +extern crate alloc; + +#[cfg(feature = "std")] +extern crate std; + +use alloc::{borrow::Cow, collections::BTreeMap, vec::Vec}; +use core::{any::TypeId, hash::BuildHasherDefault}; +use indexmap::IndexMap; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; +use siphasher::sip::SipHasher; + +pub use cw_schema_derive::Schemaifier; + +pub type DefinitionReference = usize; + +mod default_impls; + +#[skip_serializing_none] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub struct StructProperty { + #[serde(default, skip_serializing_if = "core::ops::Not::not")] + pub defaulting: bool, + pub description: Option>, + pub value: DefinitionReference, +} + +#[skip_serializing_none] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", untagged)] +pub enum StructType { + Unit, + Named { + properties: BTreeMap, StructProperty>, + }, + Tuple { + items: Vec, + }, +} + +#[skip_serializing_none] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub struct EnumCase { + pub description: Option>, + #[serde(flatten)] + pub value: EnumValue, +} + +#[skip_serializing_none] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", tag = "type")] +pub enum EnumValue { + Unit, + Named { + properties: BTreeMap, StructProperty>, + }, + Tuple { + items: Vec, + }, +} + +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +#[non_exhaustive] +pub enum MapKind { + BTree, + Hash, +} + +#[skip_serializing_none] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", tag = "type")] +pub enum NodeType { + // Floating point numbers + Float, + Double, + + // Decimal numbers + Decimal { + precision: u64, + signed: bool, + }, + + // Integer numbers + Integer { + precision: u64, + signed: bool, + }, + + Address, + Binary, + Checksum, + HexBinary, + Timestamp, + + String, + Boolean, + Array { + items: DefinitionReference, + }, + Struct(StructType), + Tuple { + items: Vec, + }, + Enum { + discriminator: Option>, + cases: BTreeMap, EnumCase>, + }, + + Map { + kind: MapKind, + key: DefinitionReference, + value: DefinitionReference, + }, + + Boxed { + inner: DefinitionReference, + }, + Optional { + inner: DefinitionReference, + }, + Unit, +} + +#[skip_serializing_none] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub struct Node { + pub name: Cow<'static, str>, + pub description: Option>, + #[serde(flatten)] + pub value: NodeType, +} + +#[skip_serializing_none] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase")] +pub struct SchemaV1 { + pub root: DefinitionReference, + pub definitions: Vec, +} + +#[skip_serializing_none] +#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "std", derive(schemars::JsonSchema))] +#[serde(rename_all = "camelCase", tag = "type")] +#[non_exhaustive] +pub enum Schema { + V1(SchemaV1), +} + +#[derive(Hash, PartialEq, Eq)] +pub struct Identifier(TypeId); + +impl Identifier { + pub fn of() -> Self + where + T: ?Sized, + { + Identifier(typeid::of::()) + } +} + +enum NodeSpot { + Reserved, + Occupied(Node), +} + +#[derive(Default)] +pub struct SchemaVisitor { + schemas: IndexMap>, +} + +impl SchemaVisitor { + pub fn get_reference(&self) -> Option { + self.schemas.get_index_of(&T::id()) + } + + pub fn get_schema(&self) -> Option<&Node> { + self.schemas + .get(&T::id()) + .and_then(|node_spot| match node_spot { + NodeSpot::Occupied(node) => Some(node), + NodeSpot::Reserved => None, + }) + } + + pub fn insert(&mut self, id: Identifier, node: Node) -> DefinitionReference { + let (id, _) = self.schemas.insert_full(id, NodeSpot::Occupied(node)); + id + } + + pub fn reserve_spot(&mut self, id: Identifier) -> DefinitionReference { + let (id, _) = self.schemas.insert_full(id, NodeSpot::Reserved); + id + } + + /// Transform this visitor into a vector where the `DefinitionReference` can be used as an index + /// to access the schema of the particular node. + pub fn into_vec(self) -> Vec { + self.schemas + .into_values() + .map(|node_spot| { + if let NodeSpot::Occupied(node) = node_spot { + node + } else { + panic!("reserved and never filled spot"); + } + }) + .collect() + } +} + +pub trait Schemaifier { + fn id() -> Identifier { + Identifier::of::() + } + + fn visit_schema(visitor: &mut SchemaVisitor) -> DefinitionReference; +} + +pub fn schema_of() -> Schema { + let mut visitor = SchemaVisitor::default(); + Schema::V1(SchemaV1 { + root: T::visit_schema(&mut visitor), + definitions: visitor.into_vec(), + }) +} + +#[doc(hidden)] +pub mod reexport { + pub use alloc::collections::BTreeMap; +} diff --git a/packages/cw-schema/tests/basic.rs b/packages/cw-schema/tests/basic.rs new file mode 100644 index 0000000000..3aeb1b66a0 --- /dev/null +++ b/packages/cw-schema/tests/basic.rs @@ -0,0 +1,13 @@ +use cw_schema::Schema; + +#[test] +fn can_decode_example() { + let example = include_str!("example.json"); + let _: Schema = serde_json::from_str(example).unwrap(); +} + +#[test] +fn snapshot_jsonschema() { + let schema = schemars::schema_for!(Schema); + insta::assert_json_snapshot!(schema); +} diff --git a/packages/cw-schema/tests/derive.rs b/packages/cw-schema/tests/derive.rs new file mode 100644 index 0000000000..f110de24f3 --- /dev/null +++ b/packages/cw-schema/tests/derive.rs @@ -0,0 +1,60 @@ +#![allow(dead_code)] // We never construct these types. Introspection is done at compile time. + +use cw_schema::Schemaifier; + +#[derive(Schemaifier)] +/// Hello world struct! +struct HelloWorld { + /// Name field! + name: String, + + /// Foo field! + foo: Option, + + /// Baz field! + baz: Baz, + + /// Quux field! + quux: Quux, + + /// Tuple field! + tuple: (u32, u32), + + /// Boxed field! + boxed: Box, +} + +#[derive(Schemaifier)] +/// Bar struct! +struct Bar { + /// Bar field! + baz: u32, +} + +#[derive(Schemaifier)] +/// Baz enum! +enum Baz { + /// A variant! + A, + /// B variant! + B { + /// C field! + c: u32, + }, + /// D variant! + D(u32, u32), +} + +#[derive(Schemaifier)] +#[serde(rename_all = "camelCase", thingy = "lmao")] +/// Quux struct! +pub struct Quux { + /// Quux field! + quux_field: u32, +} + +#[test] +fn snapshot_schema() { + let schema = cw_schema::schema_of::(); + insta::assert_json_snapshot!(schema); +} diff --git a/packages/cw-schema/tests/example.json b/packages/cw-schema/tests/example.json new file mode 100644 index 0000000000..996ab250da --- /dev/null +++ b/packages/cw-schema/tests/example.json @@ -0,0 +1,92 @@ +{ + "type": "v1", + "root": 6, + "definitions": [ + { + "name": "String", + "type": "string" + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "derive::Bar", + "description": "Bar struct!", + "type": "struct", + "properties": { + "baz": { + "description": "Bar field!", + "value": 1 + } + } + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 2 + }, + { + "name": "derive::Baz", + "description": "Baz enum!", + "type": "enum", + "cases": { + "A": { + "description": "A variant!", + "type": "unit" + }, + "B": { + "description": "B variant!", + "type": "named", + "properties": { + "c": { + "description": "C field!", + "value": 1 + } + } + }, + "D": { + "description": "D variant!", + "type": "tuple", + "items": [ + 1, + 1 + ] + } + } + }, + { + "name": "(u32, u32)", + "type": "tuple", + "items": [ + 1, + 1 + ] + }, + { + "name": "derive::HelloWorld", + "description": "Hello world struct!", + "type": "struct", + "properties": { + "baz": { + "description": "Baz field!", + "value": 4 + }, + "foo": { + "description": "Foo field!", + "value": 3 + }, + "name": { + "description": "Name field!", + "value": 0 + }, + "tuple": { + "description": "Tuple field!", + "value": 5 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/cw-schema/tests/non_static.rs b/packages/cw-schema/tests/non_static.rs new file mode 100644 index 0000000000..da31724b53 --- /dev/null +++ b/packages/cw-schema/tests/non_static.rs @@ -0,0 +1,18 @@ +#![allow(dead_code)] + +use cw_schema::Schemaifier; +use std::borrow::Cow; + +#[derive(Schemaifier)] +struct NonStatic<'a> { + test1: &'a str, + test2: Cow<'a, str>, + test3: Cow<'static, str>, + test4: &'static str, +} + +#[test] +fn non_static_schema() { + let schema = cw_schema::schema_of::>(); + insta::assert_json_snapshot!(schema); +} diff --git a/packages/cw-schema/tests/same_name.rs b/packages/cw-schema/tests/same_name.rs new file mode 100644 index 0000000000..3d47b0f049 --- /dev/null +++ b/packages/cw-schema/tests/same_name.rs @@ -0,0 +1,27 @@ +#![allow(dead_code)] + +mod module1 { + #[derive(cw_schema::Schemaifier)] + pub struct Test { + foo: usize, + } +} + +mod module2 { + #[derive(cw_schema::Schemaifier)] + pub struct Test { + bar: f32, + } +} + +#[derive(cw_schema::Schemaifier)] +struct Combined { + module1: module1::Test, + module2: module2::Test, +} + +#[test] +fn can_handle_same_name_in_different_modules() { + let schema = cw_schema::schema_of::(); + insta::assert_json_snapshot!(schema); +} diff --git a/packages/cw-schema/tests/self_ref.rs b/packages/cw-schema/tests/self_ref.rs new file mode 100644 index 0000000000..4ade78a41e --- /dev/null +++ b/packages/cw-schema/tests/self_ref.rs @@ -0,0 +1,11 @@ +#![allow(dead_code)] + +#[derive(cw_schema::Schemaifier)] +pub struct SelfRef { + meow: Vec, +} + +#[test] +fn selfref() { + insta::assert_json_snapshot!(cw_schema::schema_of::()); +} diff --git a/packages/cw-schema/tests/snapshots/basic__snapshot_jsonschema.snap b/packages/cw-schema/tests/snapshots/basic__snapshot_jsonschema.snap new file mode 100644 index 0000000000..2f76119bdd --- /dev/null +++ b/packages/cw-schema/tests/snapshots/basic__snapshot_jsonschema.snap @@ -0,0 +1,501 @@ +--- +source: packages/cw-schema/tests/basic.rs +assertion_line: 12 +expression: schema +--- +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Schema", + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "v1" + } + }, + "$ref": "#/$defs/SchemaV1", + "required": [ + "type" + ] + } + ], + "$defs": { + "EnumCase": { + "type": "object", + "properties": { + "description": { + "type": [ + "string", + "null" + ] + } + }, + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "unit" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/StructProperty" + } + }, + "type": { + "type": "string", + "const": "named" + } + }, + "required": [ + "type", + "properties" + ] + }, + { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0 + } + }, + "type": { + "type": "string", + "const": "tuple" + } + }, + "required": [ + "type", + "items" + ] + } + ] + }, + "MapKind": { + "type": "string", + "enum": [ + "bTree", + "hash" + ] + }, + "Node": { + "type": "object", + "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + } + }, + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "float" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "double" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "precision": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "signed": { + "type": "boolean" + }, + "type": { + "type": "string", + "const": "decimal" + } + }, + "required": [ + "type", + "precision", + "signed" + ] + }, + { + "type": "object", + "properties": { + "precision": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "signed": { + "type": "boolean" + }, + "type": { + "type": "string", + "const": "integer" + } + }, + "required": [ + "type", + "precision", + "signed" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "address" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "binary" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "checksum" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "hexBinary" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "timestamp" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "string" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "items": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "type": { + "type": "string", + "const": "array" + } + }, + "required": [ + "type", + "items" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "struct" + } + }, + "$ref": "#/$defs/StructType", + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0 + } + }, + "type": { + "type": "string", + "const": "tuple" + } + }, + "required": [ + "type", + "items" + ] + }, + { + "type": "object", + "properties": { + "cases": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/EnumCase" + } + }, + "discriminator": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "const": "enum" + } + }, + "required": [ + "type", + "cases" + ] + }, + { + "type": "object", + "properties": { + "key": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "kind": { + "$ref": "#/$defs/MapKind" + }, + "type": { + "type": "string", + "const": "map" + }, + "value": { + "type": "integer", + "format": "uint", + "minimum": 0 + } + }, + "required": [ + "type", + "kind", + "key", + "value" + ] + }, + { + "type": "object", + "properties": { + "inner": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "type": { + "type": "string", + "const": "boxed" + } + }, + "required": [ + "type", + "inner" + ] + }, + { + "type": "object", + "properties": { + "inner": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "type": { + "type": "string", + "const": "optional" + } + }, + "required": [ + "type", + "inner" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "unit" + } + }, + "required": [ + "type" + ] + } + ], + "required": [ + "name" + ] + }, + "SchemaV1": { + "type": "object", + "properties": { + "definitions": { + "type": "array", + "items": { + "$ref": "#/$defs/Node" + } + }, + "root": { + "type": "integer", + "format": "uint", + "minimum": 0 + } + }, + "required": [ + "root", + "definitions" + ] + }, + "StructProperty": { + "type": "object", + "properties": { + "defaulting": { + "type": "boolean" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": "integer", + "format": "uint", + "minimum": 0 + } + }, + "required": [ + "value" + ] + }, + "StructType": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/StructProperty" + } + } + }, + "required": [ + "properties" + ] + }, + { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "integer", + "format": "uint", + "minimum": 0 + } + } + }, + "required": [ + "items" + ] + } + ] + } + } +} diff --git a/packages/cw-schema/tests/snapshots/derive__snapshot_schema.snap b/packages/cw-schema/tests/snapshots/derive__snapshot_schema.snap new file mode 100644 index 0000000000..4d04cd34e6 --- /dev/null +++ b/packages/cw-schema/tests/snapshots/derive__snapshot_schema.snap @@ -0,0 +1,124 @@ +--- +source: packages/cw-schema/tests/derive.rs +expression: schema +--- +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "derive_HelloWorld", + "description": "Hello world struct!", + "type": "struct", + "properties": { + "baz": { + "description": "Baz field!", + "value": 5 + }, + "boxed": { + "description": "Boxed field!", + "value": 9 + }, + "foo": { + "description": "Foo field!", + "value": 4 + }, + "name": { + "description": "Name field!", + "value": 1 + }, + "quux": { + "description": "Quux field!", + "value": 6 + }, + "tuple": { + "description": "Tuple field!", + "value": 7 + } + } + }, + { + "name": "String", + "type": "string" + }, + { + "name": "derive_Bar", + "description": "Bar struct!", + "type": "struct", + "properties": { + "baz": { + "description": "Bar field!", + "value": 3 + } + } + }, + { + "name": "u32", + "type": "integer", + "precision": 32, + "signed": false + }, + { + "name": "core::option::Option", + "type": "optional", + "inner": 2 + }, + { + "name": "derive_Baz", + "description": "Baz enum!", + "type": "enum", + "cases": { + "A": { + "description": "A variant!", + "type": "unit" + }, + "B": { + "description": "B variant!", + "type": "named", + "properties": { + "c": { + "description": "C field!", + "value": 3 + } + } + }, + "D": { + "description": "D variant!", + "type": "tuple", + "items": [ + 3, + 3 + ] + } + } + }, + { + "name": "derive_Quux", + "description": "Quux struct!", + "type": "struct", + "properties": { + "quuxField": { + "description": "Quux field!", + "value": 3 + } + } + }, + { + "name": "(u32, u32)", + "type": "tuple", + "items": [ + 3, + 3 + ] + }, + { + "name": "str", + "type": "string" + }, + { + "name": "alloc::boxed::Box", + "type": "boxed", + "inner": 8 + } + ] +} diff --git a/packages/cw-schema/tests/snapshots/non_static__non_static_schema.snap b/packages/cw-schema/tests/snapshots/non_static__non_static_schema.snap new file mode 100644 index 0000000000..e1fe51726d --- /dev/null +++ b/packages/cw-schema/tests/snapshots/non_static__non_static_schema.snap @@ -0,0 +1,32 @@ +--- +source: packages/cw-schema/tests/non_static.rs +expression: schema +--- +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "non_static_NonStatic", + "type": "struct", + "properties": { + "test1": { + "value": 1 + }, + "test2": { + "value": 1 + }, + "test3": { + "value": 1 + }, + "test4": { + "value": 1 + } + } + }, + { + "name": "str", + "type": "string" + } + ] +} diff --git a/packages/cw-schema/tests/snapshots/same_name__can_handle_same_name_in_different_modules.snap b/packages/cw-schema/tests/snapshots/same_name__can_handle_same_name_in_different_modules.snap new file mode 100644 index 0000000000..fb7728d335 --- /dev/null +++ b/packages/cw-schema/tests/snapshots/same_name__can_handle_same_name_in_different_modules.snap @@ -0,0 +1,50 @@ +--- +source: packages/cw-schema/tests/same_name.rs +expression: schema +--- +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "same_name_Combined", + "type": "struct", + "properties": { + "module1": { + "value": 1 + }, + "module2": { + "value": 3 + } + } + }, + { + "name": "same_name_module1_Test", + "type": "struct", + "properties": { + "foo": { + "value": 2 + } + } + }, + { + "name": "usize", + "type": "integer", + "precision": 64, + "signed": false + }, + { + "name": "same_name_module2_Test", + "type": "struct", + "properties": { + "bar": { + "value": 4 + } + } + }, + { + "name": "f32", + "type": "float" + } + ] +} diff --git a/packages/cw-schema/tests/snapshots/self_ref__selfref.snap b/packages/cw-schema/tests/snapshots/self_ref__selfref.snap new file mode 100644 index 0000000000..a617116042 --- /dev/null +++ b/packages/cw-schema/tests/snapshots/self_ref__selfref.snap @@ -0,0 +1,24 @@ +--- +source: packages/cw-schema/tests/self_ref.rs +expression: "cw_schema::schema_of::()" +--- +{ + "type": "v1", + "root": 0, + "definitions": [ + { + "name": "self_ref_SelfRef", + "type": "struct", + "properties": { + "meow": { + "value": 1 + } + } + }, + { + "name": "alloc::vec::Vec", + "type": "array", + "items": 0 + } + ] +} diff --git a/packages/derive/Cargo.toml b/packages/derive/Cargo.toml index 939cebab5d..7a196ed3ae 100644 --- a/packages/derive/Cargo.toml +++ b/packages/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmwasm-derive" -version = "1.1.9" +version = { workspace = true } authors = ["Simon Warta "] edition = "2021" description = "A package for auto-generated code used for CosmWasm contract development. This is shipped as part of cosmwasm-std. Do not use directly." @@ -15,11 +15,6 @@ proc-macro = true default = [] [dependencies] -syn = { version = "1.0", features = ["full"] } - -[dev-dependencies] -# Needed for testing docs -# "What's even more fun, Cargo packages actually can have cyclic dependencies. -# "(a package can have an indirect dev-dependency on itself)" -# https://users.rust-lang.org/t/does-cargo-support-cyclic-dependencies/35666/3 -cosmwasm-std = { path = "../std" } +proc-macro2 = "1.0.79" +quote = "1.0.35" +syn = { version = "2", features = ["full"] } diff --git a/packages/derive/src/lib.rs b/packages/derive/src/lib.rs index 349f9e3094..88d6d8b8e4 100644 --- a/packages/derive/src/lib.rs +++ b/packages/derive/src/lib.rs @@ -1,84 +1,415 @@ -#[macro_use] -extern crate syn; - -use proc_macro::TokenStream; -use std::str::FromStr; - -/// This attribute macro generates the boilerplate required to call into the -/// contract-specific logic from the entry-points to the Wasm module. -/// -/// It should be added to the contract's init, handle, migrate and query implementations -/// like this: -/// ``` -/// # use cosmwasm_std::{ -/// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, -/// # Response, QueryResponse, -/// # }; -/// # -/// # type InstantiateMsg = (); -/// # type ExecuteMsg = (); -/// # type QueryMsg = (); -/// -/// #[entry_point] -/// pub fn instantiate( -/// deps: DepsMut, -/// env: Env, -/// info: MessageInfo, -/// msg: InstantiateMsg, -/// ) -> Result { -/// # Ok(Default::default()) -/// } -/// -/// #[entry_point] -/// pub fn execute( -/// deps: DepsMut, -/// env: Env, -/// info: MessageInfo, -/// msg: ExecuteMsg, -/// ) -> Result { -/// # Ok(Default::default()) -/// } -/// -/// #[entry_point] -/// pub fn query( -/// deps: Deps, -/// env: Env, -/// msg: QueryMsg, -/// ) -> Result { -/// # Ok(Default::default()) -/// } -/// ``` -/// -/// where `InstantiateMsg`, `ExecuteMsg`, and `QueryMsg` are contract defined -/// types that implement `DeserializeOwned + JsonSchema`. +//! Derive macros for CosmWasm contract development. For internal use only. Do not use directly. +//! +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! For more information, see: +use proc_macro2::TokenStream; +use quote::{format_ident, quote, ToTokens}; +use std::env; +use syn::{ + parse::{Parse, ParseStream}, + parse_quote, + punctuated::Punctuated, + ItemFn, Token, +}; + +macro_rules! maybe { + ($result:expr) => {{ + match { $result } { + Ok(val) => val, + Err(err) => return err.into_compile_error(), + } + }}; +} + +struct Options { + crate_path: syn::Path, +} + +impl Default for Options { + fn default() -> Self { + Self { + crate_path: parse_quote!(::cosmwasm_std), + } + } +} + +impl Parse for Options { + fn parse(input: ParseStream) -> syn::Result { + let mut ret = Self::default(); + let attrs = Punctuated::::parse_terminated(input)?; + + for kv in attrs { + if kv.path.is_ident("crate") { + let path_as_string: syn::LitStr = syn::parse2(kv.value.to_token_stream())?; + ret.crate_path = path_as_string.parse()?; + } else { + return Err(syn::Error::new_spanned(kv, "Unknown attribute")); + } + } + + Ok(ret) + } +} + +// function documented in cosmwasm-std #[proc_macro_attribute] -pub fn entry_point(_attr: TokenStream, mut item: TokenStream) -> TokenStream { - let cloned = item.clone(); - let function = parse_macro_input!(cloned as syn::ItemFn); - let name = function.sig.ident.to_string(); +pub fn entry_point( + attr: proc_macro::TokenStream, + item: proc_macro::TokenStream, +) -> proc_macro::TokenStream { + entry_point_impl(attr.into(), item.into()).into() +} + +fn expand_attributes(func: &mut ItemFn) -> syn::Result { + let attributes = std::mem::take(&mut func.attrs); + let mut stream = TokenStream::new(); + for attribute in attributes { + if !attribute.path().is_ident("migrate_version") { + func.attrs.push(attribute); + continue; + } + + if func.sig.ident != "migrate" { + return Err(syn::Error::new_spanned( + &attribute, + "you only want to add this attribute to your migrate function", + )); + } + + let version: syn::Expr = attribute.parse_args()?; + if !(matches!(version, syn::Expr::Lit(_)) || matches!(version, syn::Expr::Path(_))) { + return Err(syn::Error::new_spanned( + &attribute, + "Expected `u64` or `path::to::constant` in the migrate_version attribute", + )); + } + + stream = quote! { + #stream + + const _: () = { + #[allow(unused)] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + #[link_section = "cw_migrate_version"] + /// This is an internal constant exported as a custom section denoting the contract migrate version. + /// The format and even the existence of this value is an implementation detail, DO NOT RELY ON THIS! + static __CW_MIGRATE_VERSION: [u8; version_size(#version)] = stringify_version(#version); + + #[allow(unused)] + #[doc(hidden)] + const fn stringify_version(mut version: u64) -> [u8; N] { + let mut result: [u8; N] = [0; N]; + let mut index = N; + while index > 0 { + let digit: u8 = (version%10) as u8; + result[index-1] = digit + b'0'; + version /= 10; + index -= 1; + } + result + } + + #[allow(unused)] + #[doc(hidden)] + const fn version_size(version: u64) -> usize { + if version > 0 { + (version.ilog10()+1) as usize + } else { + panic!("Contract migrate version should be greater than 0.") + } + } + }; + }; + } + + Ok(stream) +} + +fn expand_bindings(crate_path: &syn::Path, mut function: syn::ItemFn) -> TokenStream { + let attribute_code = maybe!(expand_attributes(&mut function)); + // The first argument is `deps`, the rest is region pointers - let args = function.sig.inputs.len() - 1; + let args = function.sig.inputs.len().saturating_sub(1); + let fn_name = &function.sig.ident; + let wasm_export = format_ident!("__wasm_export_{fn_name}"); + + // Prevent contract dev from using the wrong identifier for the do_migrate_with_info function + if fn_name == "migrate_with_info" { + return syn::Error::new_spanned( + &function.sig.ident, + r#"To use the new migrate function signature, you should provide a "migrate" entry point with 4 arguments, not "migrate_with_info""#, + ).into_compile_error(); + } + + // Migrate entry point can take 2 or 3 arguments (not counting deps) + let do_call = if fn_name == "migrate" && args == 3 { + format_ident!("do_migrate_with_info") + } else { + format_ident!("do_{fn_name}") + }; + + let decl_args = (0..args).map(|item| format_ident!("ptr_{item}")); + let call_args = decl_args.clone(); + + quote! { + #attribute_code - // E.g. "ptr0: u32, ptr1: u32, ptr2: u32, " - let typed_ptrs = (0..args).fold(String::new(), |acc, i| format!("{}ptr{}: u32, ", acc, i)); - // E.g. "ptr0, ptr1, ptr2, " - let ptrs = (0..args).fold(String::new(), |acc, i| format!("{}ptr{}, ", acc, i)); + #function - let new_code = format!( - r##" #[cfg(target_arch = "wasm32")] - mod __wasm_export_{name} {{ // new module to avoid conflict of function name + mod #wasm_export { // new module to avoid conflict of function name #[no_mangle] - extern "C" fn {name}({typed_ptrs}) -> u32 {{ - cosmwasm_std::do_{name}(&super::{name}, {ptrs}) - }} - }} - "##, - name = name, - typed_ptrs = typed_ptrs, - ptrs = ptrs - ); - let entry = TokenStream::from_str(&new_code).unwrap(); - item.extend(entry); - item + extern "C" fn #fn_name(#( #decl_args : u32 ),*) -> u32 { + #crate_path::#do_call(&super::#fn_name, #( #call_args ),*) + } + } + } +} + +fn entry_point_impl(attr: TokenStream, item: TokenStream) -> TokenStream { + let mut function: syn::ItemFn = maybe!(syn::parse2(item)); + let Options { crate_path } = maybe!(syn::parse2(attr)); + + if env::var("CARGO_PRIMARY_PACKAGE").is_ok() { + expand_bindings(&crate_path, function) + } else { + function + .attrs + .retain(|attr| !attr.path().is_ident("migrate_version")); + + quote! { #function } + } +} + +#[cfg(test)] +mod test { + use std::env; + + use proc_macro2::TokenStream; + use quote::quote; + + use crate::entry_point_impl; + + fn setup_environment() { + env::set_var("CARGO_PRIMARY_PACKAGE", "1"); + } + + #[test] + fn contract_migrate_version_on_non_migrate() { + setup_environment(); + + let code = quote! { + #[migrate_version(42)] + fn anything_else() -> Response { + // Logic here + } + }; + + let actual = entry_point_impl(TokenStream::new(), code); + let expected = quote! { + ::core::compile_error! { "you only want to add this attribute to your migrate function" } + }; + + assert_eq!(actual.to_string(), expected.to_string()); + } + + #[test] + fn contract_migrate_version_expansion() { + setup_environment(); + + let code = quote! { + #[migrate_version(2)] + fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> Response { + // Logic here + } + }; + + let actual = entry_point_impl(TokenStream::new(), code); + let expected = quote! { + const _: () = { + #[allow(unused)] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + #[link_section = "cw_migrate_version"] + /// This is an internal constant exported as a custom section denoting the contract migrate version. + /// The format and even the existence of this value is an implementation detail, DO NOT RELY ON THIS! + static __CW_MIGRATE_VERSION: [u8; version_size(2)] = stringify_version(2); + + #[allow(unused)] + #[doc(hidden)] + const fn stringify_version(mut version: u64) -> [u8; N] { + let mut result: [u8; N] = [0; N]; + let mut index = N; + while index > 0 { + let digit: u8 = (version%10) as u8; + result[index-1] = digit + b'0'; + version /= 10; + index -= 1; + } + result + } + + #[allow(unused)] + #[doc(hidden)] + const fn version_size(version: u64) -> usize { + if version > 0 { + (version.ilog10()+1) as usize + } else { + panic!("Contract migrate version should be greater than 0.") + } + } + }; + + fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> Response { + // Logic here + } + + #[cfg(target_arch = "wasm32")] + mod __wasm_export_migrate { + #[no_mangle] + extern "C" fn migrate(ptr_0: u32, ptr_1: u32) -> u32 { + ::cosmwasm_std::do_migrate(&super::migrate, ptr_0, ptr_1) + } + } + }; + + assert_eq!(actual.to_string(), expected.to_string()); + + // this should cause a compiler error + let code = quote! { + #[entry_point] + pub fn migrate_with_info( + deps: DepsMut, + env: Env, + msg: MigrateMsg, + migrate_info: MigrateInfo, + ) -> Result { + // Logic here + } + }; + + let actual = entry_point_impl(TokenStream::new(), code); + let expected = quote! { + ::core::compile_error! { "To use the new migrate function signature, you should provide a \"migrate\" entry point with 4 arguments, not \"migrate_with_info\"" } + }; + + assert_eq!(actual.to_string(), expected.to_string()); + } + + #[test] + fn contract_migrate_version_with_const_expansion() { + setup_environment(); + + let code = quote! { + #[migrate_version(CONTRACT_VERSION)] + fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> Response { + // Logic here + } + }; + + let actual = entry_point_impl(TokenStream::new(), code); + let expected = quote! { + const _: () = { + #[allow(unused)] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + #[link_section = "cw_migrate_version"] + /// This is an internal constant exported as a custom section denoting the contract migrate version. + /// The format and even the existence of this value is an implementation detail, DO NOT RELY ON THIS! + static __CW_MIGRATE_VERSION: [u8; version_size(CONTRACT_VERSION)] = stringify_version(CONTRACT_VERSION); + + #[allow(unused)] + #[doc(hidden)] + const fn stringify_version(mut version: u64) -> [u8; N] { + let mut result: [u8; N] = [0; N]; + let mut index = N; + while index > 0 { + let digit: u8 = (version%10) as u8; + result[index-1] = digit + b'0'; + version /= 10; + index -= 1; + } + result + } + + #[allow(unused)] + #[doc(hidden)] + const fn version_size(version: u64) -> usize { + if version > 0 { + (version.ilog10()+1) as usize + } else { + panic!("Contract migrate version should be greater than 0.") + } + } + }; + + fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> Response { + // Logic here + } + + #[cfg(target_arch = "wasm32")] + mod __wasm_export_migrate { + #[no_mangle] + extern "C" fn migrate(ptr_0: u32, ptr_1: u32) -> u32 { + ::cosmwasm_std::do_migrate(&super::migrate, ptr_0, ptr_1) + } + } + }; + + assert_eq!(actual.to_string(), expected.to_string()); + } + + #[test] + fn default_expansion() { + setup_environment(); + + let code = quote! { + fn instantiate(deps: DepsMut, env: Env) -> Response { + // Logic here + } + }; + + let actual = entry_point_impl(TokenStream::new(), code); + let expected = quote! { + fn instantiate(deps: DepsMut, env: Env) -> Response { } + + #[cfg(target_arch = "wasm32")] + mod __wasm_export_instantiate { + #[no_mangle] + extern "C" fn instantiate(ptr_0: u32) -> u32 { + ::cosmwasm_std::do_instantiate(&super::instantiate, ptr_0) + } + } + }; + + assert_eq!(actual.to_string(), expected.to_string()); + } + + #[test] + fn renamed_expansion() { + setup_environment(); + + let attribute = quote!(crate = "::my_crate::cw_std"); + let code = quote! { + fn instantiate(deps: DepsMut, env: Env) -> Response { + // Logic here + } + }; + + let actual = entry_point_impl(attribute, code); + let expected = quote! { + fn instantiate(deps: DepsMut, env: Env) -> Response { } + + #[cfg(target_arch = "wasm32")] + mod __wasm_export_instantiate { + #[no_mangle] + extern "C" fn instantiate(ptr_0: u32) -> u32 { + ::my_crate::cw_std::do_instantiate(&super::instantiate, ptr_0) + } + } + }; + + assert_eq!(actual.to_string(), expected.to_string()); + } } diff --git a/packages/go-gen/Cargo.toml b/packages/go-gen/Cargo.toml new file mode 100644 index 0000000000..a35e6a16fb --- /dev/null +++ b/packages/go-gen/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "go-gen" +authors = ["Christoph Otter "] +version = "0.1.0" +edition = "2021" +publish = false + +[package.metadata.release] +release = false + +[dependencies] +cosmwasm-std = { workspace = true, default-features = true, features = ["cosmwasm_3_0", "staking", "stargate"] } +cosmwasm-schema = { workspace = true } +anyhow = "1" +indenter = "0.3.3" +schemars = { workspace = true } +heck = "0.5.0" diff --git a/packages/go-gen/README.md b/packages/go-gen/README.md new file mode 100644 index 0000000000..07d242a152 --- /dev/null +++ b/packages/go-gen/README.md @@ -0,0 +1,21 @@ +# JsonSchema Go Type Generator + +This is an internal utility to generate Go types from `cosmwasm-std`'s query +response types. These types can then be used in +[wasmvm](https://github.com/CosmWasm/wasmvm). + +## Usage + +Adjust the query / response type you want to generate in `src/main.rs` and run: +`cargo run -p go-gen` + +## Limitations + +Only basic structs and enums are supported. Tuples and enum variants with 0 or +more than 1 parameters don't work, for example. + +## License + +This package is part of the cosmwasm repository, licensed under the Apache +License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) +and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). diff --git a/packages/go-gen/src/go.rs b/packages/go-gen/src/go.rs new file mode 100644 index 0000000000..802dffccfa --- /dev/null +++ b/packages/go-gen/src/go.rs @@ -0,0 +1,259 @@ +use std::fmt::{self, Display, Write}; + +use heck::ToPascalCase; +use indenter::indented; + +use crate::utils::replace_acronyms; + +pub struct GoStruct { + pub name: String, + pub docs: Option, + pub fields: Vec, +} + +impl Display for GoStruct { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + // generate documentation + format_docs(f, self.docs.as_deref())?; + // generate type + writeln!(f, "type {} struct {{", self.name)?; + // generate fields + { + let mut f = indented(f); + for field in &self.fields { + writeln!(f, "{}", field)?; + } + } + f.write_char('}')?; + Ok(()) + } +} + +pub struct GoField { + /// The name of the field in Rust (snake_case) + pub rust_name: String, + /// The documentation of the field + pub docs: Option, + /// The type of the field + pub ty: GoType, +} + +impl Display for GoField { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + // documentation + format_docs(f, self.docs.as_deref())?; + // {field} {type} `json:"{field}"` + write!( + f, + "{} {} `json:\"{}", + replace_acronyms(self.rust_name.to_pascal_case()), + self.ty, + self.rust_name + )?; + match self.ty.nullability { + Nullability::OmitEmpty => { + f.write_str(",omitempty")?; + } + Nullability::Nullable if !self.ty.is_slice() => { + // if the type is nullable, we need to use a pointer type + // and add `omitempty` to the json tag + f.write_str(",omitempty")?; + } + _ => {} + } + f.write_str("\"`") + } +} + +pub struct GoType { + /// The name of the type in Go + pub name: String, + /// Whether the type should be nullable / omitempty / etc. + pub nullability: Nullability, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Nullability { + /// The type should be nullable + /// In Go, this will use a pointer type and add `omitempty` to the json tag + Nullable, + /// The type should not be nullable, use the type as is + NonNullable, + /// The type should be nullable by omitting it from the json object if it is empty + OmitEmpty, +} + +impl GoType { + pub fn is_basic_type(&self) -> bool { + const BASIC_GO_TYPES: &[&str] = &[ + "string", + "bool", + "int", + "int8", + "int16", + "int32", + "int64", + "uint", + "uint8", + "uint16", + "uint32", + "uint64", + "float32", + "float64", + "byte", + "rune", + "uintptr", + "complex64", + "complex128", + ]; + BASIC_GO_TYPES.contains(&&*self.name) + } + + pub fn is_slice(&self) -> bool { + self.name.starts_with("[]") + } +} + +impl Display for GoType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.nullability == Nullability::Nullable && !self.is_basic_type() && !self.is_slice() { + // if the type is nullable and not a basic type, use a pointer + // slices are already pointers, so we don't need to do anything for them + f.write_char('*')?; + } + f.write_str(&self.name) + } +} + +fn format_docs(f: &mut fmt::Formatter, docs: Option<&str>) -> fmt::Result { + if let Some(docs) = docs { + for line in docs.lines() { + f.write_str("// ")?; + f.write_str(line)?; + f.write_char('\n')?; + } + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn go_type_display_works() { + let ty = GoType { + name: "string".to_string(), + nullability: Nullability::Nullable, + }; + let ty2 = GoType { + name: "string".to_string(), + nullability: Nullability::NonNullable, + }; + assert_eq!(format!("{}", ty), "string"); + assert_eq!(format!("{}", ty2), "string"); + + let ty = GoType { + name: "FooBar".to_string(), + nullability: Nullability::Nullable, + }; + assert_eq!(format!("{}", ty), "*FooBar"); + let ty = GoType { + name: "FooBar".to_string(), + nullability: Nullability::NonNullable, + }; + assert_eq!(format!("{}", ty), "FooBar"); + } + + #[test] + fn go_field_display_works() { + let field = GoField { + rust_name: "foo_bar".to_string(), + docs: None, + ty: GoType { + name: "string".to_string(), + nullability: Nullability::Nullable, + }, + }; + assert_eq!( + format!("{}", field), + "FooBar string `json:\"foo_bar,omitempty\"`" + ); + + let field = GoField { + rust_name: "foo_bar".to_string(), + docs: None, + ty: GoType { + name: "string".to_string(), + nullability: Nullability::NonNullable, + }, + }; + assert_eq!(format!("{}", field), "FooBar string `json:\"foo_bar\"`"); + + let field = GoField { + rust_name: "foo_bar".to_string(), + docs: None, + ty: GoType { + name: "FooBar".to_string(), + nullability: Nullability::Nullable, + }, + }; + assert_eq!( + format!("{}", field), + "FooBar *FooBar `json:\"foo_bar,omitempty\"`" + ); + } + + #[test] + fn go_field_docs_display_works() { + let field = GoField { + rust_name: "foo_bar".to_string(), + docs: Some("foo_bar is a test field".to_string()), + ty: GoType { + name: "string".to_string(), + nullability: Nullability::Nullable, + }, + }; + assert_eq!( + format!("{}", field), + "// foo_bar is a test field\nFooBar string `json:\"foo_bar,omitempty\"`" + ); + } + + #[test] + fn go_type_def_display_works() { + let ty = GoStruct { + name: "FooBar".to_string(), + docs: None, + fields: vec![GoField { + rust_name: "foo_bar".to_string(), + docs: None, + ty: GoType { + name: "string".to_string(), + nullability: Nullability::Nullable, + }, + }], + }; + assert_eq!( + format!("{}", ty), + "type FooBar struct {\n FooBar string `json:\"foo_bar,omitempty\"`\n}" + ); + + let ty = GoStruct { + name: "FooBar".to_string(), + docs: Some("FooBar is a test struct".to_string()), + fields: vec![GoField { + rust_name: "foo_bar".to_string(), + docs: None, + ty: GoType { + name: "string".to_string(), + nullability: Nullability::Nullable, + }, + }], + }; + assert_eq!( + format!("{}", ty), + "// FooBar is a test struct\ntype FooBar struct {\n FooBar string `json:\"foo_bar,omitempty\"`\n}" + ); + } +} diff --git a/packages/go-gen/src/main.rs b/packages/go-gen/src/main.rs new file mode 100644 index 0000000000..19664a5eb6 --- /dev/null +++ b/packages/go-gen/src/main.rs @@ -0,0 +1,606 @@ +use anyhow::{bail, ensure, Context, Result}; +use go::*; +use heck::ToPascalCase; +use schema::{documentation, schema_object_type, SchemaExt, TypeContext}; +use schemars::schema::{ObjectValidation, RootSchema, Schema, SchemaObject}; +use std::fmt::Write; +use utils::replace_acronyms; + +mod go; +mod schema; +mod utils; + +fn main() -> Result<()> { + let root = cosmwasm_schema::schema_for!(cosmwasm_std::RawRangeResponse); + + let code = generate_go(root)?; + println!("{}", code); + + Ok(()) +} + +/// Generates the Go code for the given schema +fn generate_go(root: RootSchema) -> Result { + let title = root + .schema + .metadata + .as_ref() + .and_then(|m| m.title.as_ref()) + .context("failed to get type name")?; + + let mut types = vec![]; + build_type(title, &root.schema, &mut types) + .with_context(|| format!("failed to generate {title}"))?; + + // go through additional definitions + for (name, additional_type) in &root.definitions { + additional_type + .object() + .map(|def| build_type(name, def, &mut types)) + .and_then(|r| r) + .context("failed to generate additional definitions")?; + } + let mut code = String::new(); + for ty in types { + writeln!(&mut code, "{ty}")?; + } + + Ok(code) +} + +/// Generates Go structs for the given schema and adds them to `structs`. +/// This will add more than one struct if the schema contains object types (anonymous structs). +fn build_type(name: &str, schema: &SchemaObject, structs: &mut Vec) -> Result<()> { + if schema::custom_type_of(name).is_some() { + // ignore custom types + return Ok(()); + } + + // first detect if we have a struct or enum + if let Some(obj) = schema.object.as_ref() { + let strct = build_struct(name, schema, obj, structs) + .map(Some) + .with_context(|| format!("failed to generate struct '{name}'"))?; + if let Some(strct) = strct { + structs.push(strct); + } + } else if let Some(variants) = schema::enum_variants(schema) { + let strct = build_enum(name, schema, variants, structs) + .map(Some) + .with_context(|| format!("failed to generate enum '{name}'"))?; + if let Some(strct) = strct { + structs.push(strct); + } + } else { + anyhow::bail!("failed to determine type for '{name}'"); + } + + Ok(()) +} + +/// Creates a Go struct for the given schema object and returns it. +/// This will also add any additional structs to `additional_structs` (but not the returned one). +pub fn build_struct( + name: &str, + strct: &SchemaObject, + obj: &ObjectValidation, + additional_structs: &mut Vec, +) -> Result { + let docs = documentation(strct); + + // go through all fields + let fields = obj.properties.iter().map(|(field, ty)| { + // get schema object + let schema = ty + .object() + .with_context(|| format!("expected schema object for field {field}"))?; + // extract type from schema object + let ty = schema_object_type(schema, TypeContext::new(name, field), additional_structs) + .with_context(|| format!("failed to get type of field '{field}'"))?; + Ok(GoField { + rust_name: field.clone(), + docs: documentation(schema), + ty, + }) + }); + let fields = fields.collect::>>()?; + + Ok(GoStruct { + name: replace_acronyms(name.to_pascal_case()), + docs, + fields, + }) +} + +/// Creates a Go struct for the given schema object and returns it. +/// This will also add any additional structs to `additional_structs` (but not the returned one). +pub fn build_enum<'a>( + name: &str, + enm: &SchemaObject, + variants: impl Iterator, + additional_structs: &mut Vec, +) -> Result { + let name = replace_acronyms(name); + let docs = documentation(enm); + + // go through all fields + let fields = variants.map(|v| { + // get schema object + let v = v + .object() + .with_context(|| format!("expected schema object for enum variants of {name}"))?; + + // analyze the variant + let variant_field = build_enum_variant(v, &name, additional_structs) + .context("failed to extract enum variant")?; + + anyhow::Ok(variant_field) + }); + let fields = fields.collect::>>()?; + + Ok(GoStruct { name, docs, fields }) +} + +/// Tries to extract the name and type of the given enum variant and returns it as a `GoField`. +pub fn build_enum_variant( + schema: &SchemaObject, + enum_name: &str, + additional_structs: &mut Vec, +) -> Result { + // for variants without inner data, there is an entry in `enum_variants` + // we are not interested in that case, so we error out + if let Some(values) = &schema.enum_values { + bail!( + "enum variant {} without inner data not supported", + values + .iter() + .map(|v| v.to_string()) + .collect::>() + .join(", ") + ); + } + + let docs = documentation(schema); + + // for variants with inner data, there is an object validation entry with a single property + // we extract the type of that property + let properties = &schema + .object + .as_ref() + .context("expected object validation for enum variant")? + .properties; + ensure!( + properties.len() == 1, + "expected exactly one property in enum variant" + ); + // we can unwrap here, because we checked the length above + let (name, schema) = properties.first_key_value().unwrap(); + let GoType { name: ty, .. } = schema_object_type( + schema.object()?, + TypeContext::new(enum_name, name), + additional_structs, + )?; + + Ok(GoField { + rust_name: name.to_string(), + docs, + ty: GoType { + name: ty, + nullability: Nullability::Nullable, // always nullable + }, + }) +} + +#[cfg(test)] +mod tests { + use cosmwasm_schema::cw_serde; + use cosmwasm_std::{Binary, Checksum, Empty, HexBinary, Uint128}; + + use super::*; + + #[track_caller] + fn assert_code_eq(actual: String, expected: &str) { + let actual_no_ws = actual.split_whitespace().collect::>(); + let expected_no_ws = expected.split_whitespace().collect::>(); + + assert!( + actual_no_ws == expected_no_ws, + "assertion failed: `(actual == expected)`\nactual:\n`{}`,\nexpected:\n`\"{}\"`", + actual, + expected + ); + } + + #[track_caller] + fn assert_code_eq_ignore_docs(actual: String, expected: &str) { + let actual_filtered = actual + .lines() + .map(|line| line.split("//").next().unwrap()) // ignore comments + .flat_map(|line| line.split_whitespace()) + .collect::>(); + let expected_filtered = expected + .lines() + .map(|line| line.split("//").next().unwrap()) // ignore comments + .flat_map(|line| line.split_whitespace()) + .collect::>(); + + assert!( + actual_filtered == expected_filtered, + "assertion failed: `(actual == expected)`\nactual:\n`{}`,\nexpected:\n`\"{}\"`", + actual, + expected + ); + } + + #[test] + fn special_types() { + #[cw_serde] + struct SpecialTypes { + binary: Binary, + nested_binary: Vec>, + hex_binary: HexBinary, + checksum: Checksum, + uint128: Uint128, + } + + let schema = schemars::schema_for!(SpecialTypes); + let code = generate_go(schema).unwrap(); + + assert_code_eq( + code, + r#" + type SpecialTypes struct { + Binary []byte `json:"binary"` + Checksum Checksum `json:"checksum"` + HexBinary string `json:"hex_binary"` + NestedBinary Array[[]byte] `json:"nested_binary"` + Uint128 string `json:"uint128"` + }"#, + ); + } + + #[test] + fn integers() { + #[cw_serde] + struct Integers { + a: u64, + b: i64, + c: u32, + d: i32, + e: u8, + f: i8, + g: u16, + h: i16, + } + + let schema = schemars::schema_for!(Integers); + let code = generate_go(schema).unwrap(); + + assert_code_eq( + code, + r#" + type Integers struct { + A uint64 `json:"a"` + B int64 `json:"b"` + C uint32 `json:"c"` + D int32 `json:"d"` + E uint8 `json:"e"` + F int8 `json:"f"` + G uint16 `json:"g"` + H int16 `json:"h"` + }"#, + ); + + #[cw_serde] + struct U128 { + a: u128, + } + #[cw_serde] + struct I128 { + a: i128, + } + let schema = schemars::schema_for!(U128); + assert!(generate_go(schema) + .unwrap_err() + .root_cause() + .to_string() + .contains("unsupported integer format: uint128")); + let schema = schemars::schema_for!(I128); + assert!(generate_go(schema) + .unwrap_err() + .root_cause() + .to_string() + .contains("unsupported integer format: int128")); + } + + #[test] + fn empty() { + #[cw_serde] + struct Empty {} + + let schema = schemars::schema_for!(Empty); + let code = generate_go(schema).unwrap(); + assert_code_eq(code, "type Empty struct { }"); + } + + /// Compares the generated code for a given type with the code in the corresponding file in + /// `tests/`. + /// The file name is derived from the type name by replacing `::` with `__` and adding `.go`. + macro_rules! compare_codes { + ($name:ty) => {{ + let filename = stringify!($name).replace("::", "__"); + let generated = generate_go(cosmwasm_schema::schema_for!($name)).unwrap(); + let expected = std::fs::read_to_string(format!("tests/{}.go", filename)).unwrap(); + + assert_code_eq_ignore_docs(generated, &expected); + }}; + } + + #[test] + fn responses_work() { + // bank + compare_codes!(cosmwasm_std::SupplyResponse); + compare_codes!(cosmwasm_std::BalanceResponse); + compare_codes!(cosmwasm_std::DenomMetadataResponse); + // compare_codes!(cosmwasm_std::AllDenomMetadataResponse); // uses slice instead of `Array` type + // staking + compare_codes!(cosmwasm_std::BondedDenomResponse); + compare_codes!(cosmwasm_std::AllDelegationsResponse); + compare_codes!(cosmwasm_std::DelegationResponse); + compare_codes!(cosmwasm_std::AllValidatorsResponse); + // compare_codes!(cosmwasm_std::ValidatorResponse); // does not use "omitempty" for `Validator` field + // distribution + compare_codes!(cosmwasm_std::DelegatorWithdrawAddressResponse); + compare_codes!(cosmwasm_std::DelegationRewardsResponse); + compare_codes!(cosmwasm_std::DelegationTotalRewardsResponse); + compare_codes!(cosmwasm_std::DelegatorValidatorsResponse); + // wasm + compare_codes!(cosmwasm_std::ContractInfoResponse); + compare_codes!(cosmwasm_std::CodeInfoResponse); + compare_codes!(cosmwasm_std::RawRangeResponse); + } + + #[test] + fn nested_enum_works() { + #[cw_serde] + struct Inner { + a: String, + } + + #[cw_serde] + enum MyEnum { + A(Inner), + B(String), + C { a: String }, + } + + let schema = schemars::schema_for!(MyEnum); + let code = generate_go(schema).unwrap(); + assert_code_eq( + code, + r#" + type CEnum struct { + A string `json:"a"` + } + type MyEnum struct { + A *Inner `json:"a,omitempty"` + B string `json:"b,omitempty"` + C *CEnum `json:"c,omitempty"` + } + type Inner struct { + A string `json:"a"` + } + "#, + ); + + #[cw_serde] + enum ShouldFail1 { + A(), + } + #[cw_serde] + enum ShouldFail2 { + A, + } + let schema = schemars::schema_for!(ShouldFail1); + assert!(generate_go(schema) + .unwrap_err() + .root_cause() + .to_string() + .contains("array type with non-singular item type is not supported")); + let schema = schemars::schema_for!(ShouldFail2); + assert!(generate_go(schema) + .unwrap_err() + .root_cause() + .to_string() + .contains("failed to determine type for 'ShouldFail2'")); + } + + #[test] + fn queries_work() { + // compare_codes!(cosmwasm_std::QueryRequest); // omit for now because it's huge + // just assert that it compiles + generate_go(cosmwasm_schema::schema_for!( + cosmwasm_std::QueryRequest + )) + .unwrap(); + // TODO: PageRequest.Key uses "omitempty" and no * + // compare_codes!(cosmwasm_std::BankQuery); + compare_codes!(cosmwasm_std::StakingQuery); + compare_codes!(cosmwasm_std::DistributionQuery); + compare_codes!(cosmwasm_std::IbcQuery); + compare_codes!(cosmwasm_std::WasmQuery); + } + + #[test] + fn messages_work() { + compare_codes!(cosmwasm_std::BankMsg); + compare_codes!(cosmwasm_std::StakingMsg); + compare_codes!(cosmwasm_std::DistributionMsg); + compare_codes!(cosmwasm_std::IbcMsg); + compare_codes!(cosmwasm_std::WasmMsg); + compare_codes!(cosmwasm_std::GovMsg); + } + + #[test] + fn array_item_type_works() { + #[cw_serde] + struct A { + a: Vec>>>>, + } + #[cw_serde] + struct B {} + + // example json: + // A { a: vec![vec![vec![None, Some(Some(B {})), Some(None)]]] } + // => {"a":[[[null,{},null]]]} + let code = generate_go(cosmwasm_schema::schema_for!(A)).unwrap(); + assert_code_eq( + code, + r#" + type A struct { + A Array[Array[Array[*B]]] `json:"a"` + } + type B struct { }"#, + ); + + #[cw_serde] + struct C { + c: Vec>>>>, + } + let code = generate_go(cosmwasm_schema::schema_for!(C)).unwrap(); + assert_code_eq( + code, + r#" + type C struct { + C Array[Array[Array[*string]]] `json:"c"` + }"#, + ); + + #[cw_serde] + struct D { + // this should not get an `omitempty` because that prevents us from distinguishing between + // `None` and `Some(vec![])` + d: Option>, + nested: Vec>>, + } + let code = generate_go(cosmwasm_schema::schema_for!(D)).unwrap(); + assert_code_eq( + code, + r#" + type D struct { + D []string `json:"d"` + Nested Array[[]string] `json:"nested"` + }"#, + ); + } + + #[test] + fn acronym_replacement_works() { + #[cw_serde] + struct IbcStruct { + a: IbcSubStruct, + b: IbcSubEnum, + } + #[cw_serde] + enum IbcEnum { + A(IbcSubStruct), + B(IbcSubEnum), + } + #[cw_serde] + struct IbcSubStruct {} + #[cw_serde] + enum IbcSubEnum { + A(String), + } + + let code = generate_go(cosmwasm_schema::schema_for!(IbcStruct)).unwrap(); + assert_code_eq( + code, + r#" + type IBCStruct struct { + A IBCSubStruct `json:"a"` + B IBCSubEnum `json:"b"` + } + type IBCSubEnum struct { + A string `json:"a,omitempty"` + } + type IBCSubStruct struct { + } + "#, + ); + + let code = generate_go(cosmwasm_schema::schema_for!(IbcEnum)).unwrap(); + assert_code_eq( + code, + r#" + type IBCEnum struct { + A *IBCSubStruct `json:"a,omitempty"` + B *IBCSubEnum `json:"b,omitempty"` + } + type IBCSubEnum struct { + A string `json:"a,omitempty"` + } + type IBCSubStruct struct { + } + "#, + ); + } + + #[test] + fn timestamp_works() { + use cosmwasm_std::Timestamp; + + #[cw_serde] + struct A { + a: Timestamp, + b: Option, + } + + let code = generate_go(cosmwasm_schema::schema_for!(A)).unwrap(); + assert_code_eq( + code, + r#" + type A struct { + A Uint64 `json:"a"` + B *Uint64 `json:"b,omitempty"` + } + "#, + ); + } + + #[test] + fn serde_default_works() { + fn default_u32() -> u32 { + 42 + } + #[cw_serde] + #[derive(Default)] + struct Nested { + a: u32, + } + #[cw_serde] + struct A { + #[serde(default)] + payload: Binary, + #[serde(default = "default_u32")] + int: u32, + #[serde(default)] + nested: Nested, + } + + let code = generate_go(cosmwasm_schema::schema_for!(A)).unwrap(); + assert_code_eq( + code, + r#" + type A struct { + Int uint32 `json:"int,omitempty"` + Nested Nested `json:"nested,omitempty"` + Payload []byte `json:"payload,omitempty"` + } + type Nested struct { + A uint32 `json:"a"` + } + "#, + ); + } +} diff --git a/packages/go-gen/src/schema.rs b/packages/go-gen/src/schema.rs new file mode 100644 index 0000000000..58d0c88fe5 --- /dev/null +++ b/packages/go-gen/src/schema.rs @@ -0,0 +1,325 @@ +use anyhow::{bail, ensure, Context, Result}; + +use heck::ToPascalCase; +use schemars::schema::{InstanceType, Schema, SchemaObject, SingleOrVec}; + +use crate::{ + go::{GoField, GoStruct, GoType, Nullability}, + utils::{replace_acronyms, suffixes}, +}; + +pub trait SchemaExt { + /// Returns a reference to the contained schema object, + /// or an error if the schema is not an object. + fn object(&self) -> anyhow::Result<&SchemaObject>; +} + +impl SchemaExt for Schema { + fn object(&self) -> anyhow::Result<&SchemaObject> { + match self { + Schema::Object(o) => Ok(o), + _ => bail!("expected schema object"), + } + } +} + +/// Returns the schemas of the variants of this enum, if it is an enum. +/// Returns `None` if the schema is not an enum. +pub fn enum_variants(schema: &SchemaObject) -> Option> { + Some(schema.subschemas.as_ref()?.one_of.as_ref()?.iter()) +} + +/// Returns the Go type for the given schema object and whether it is nullable. +/// May also add additional structs to the given `Vec` that need to be generated for this type. +pub fn schema_object_type( + schema: &SchemaObject, + type_context: TypeContext, + additional_structs: &mut Vec, +) -> Result { + let mut nullability = if is_null(schema) { + Nullability::Nullable + } else { + Nullability::NonNullable + }; + + // Check for a default value. + // This is the case if the field was annotated with `#[serde(default)]` or variations of it. + // A `null` value is not necessarily allowed in this case, + // so we want to omit the field on the Go side. + if schema + .metadata + .as_ref() + .and_then(|m| m.default.as_ref()) + .is_some() + { + nullability = Nullability::OmitEmpty; + } + + let ty = if let Some(title) = schema.metadata.as_ref().and_then(|m| m.title.as_ref()) { + replace_custom_type(title) + } else if let Some(reference) = &schema.reference { + // if it has a reference, strip the path and use that + replace_custom_type(&replace_acronyms( + reference + .split('/') + .next_back() + .expect("split should always return at least one item"), + )) + } else if let Some(t) = &schema.instance_type { + type_from_instance_type(schema, type_context, t, additional_structs)? + } else if let Some(subschemas) = schema.subschemas.as_ref().and_then(|s| s.any_of.as_ref()) { + // check if one of them is null + let nullable = nullable_type(subschemas)?; + if let Some(non_null) = nullable { + ensure!(subschemas.len() == 2, "multiple subschemas in anyOf"); + nullability = Nullability::Nullable; + // extract non-null type + let GoType { name, .. } = + schema_object_type(non_null, type_context, additional_structs)?; + replace_custom_type(&name) + } else { + subschema_type(subschemas, type_context, additional_structs) + .context("failed to get type of anyOf subschemas")? + } + } else if let Some(subschemas) = schema + .subschemas + .as_ref() + .and_then(|s| s.all_of.as_ref().or(s.one_of.as_ref())) + { + subschema_type(subschemas, type_context, additional_structs) + .context("failed to get type of allOf subschemas")? + } else { + bail!("no type for schema found: {:?}", schema); + }; + + Ok(GoType { + name: ty, + nullability, + }) +} + +/// Tries to extract the type of the non-null variant of an anyOf schema. +/// +/// Returns `Ok(None)` if the type is not nullable. +pub fn nullable_type(subschemas: &[Schema]) -> Result, anyhow::Error> { + let (found_null, nullable_type): (bool, Option<&SchemaObject>) = subschemas + .iter() + .try_fold( + (false, None), + |(nullable, not_null), subschema| -> Result<_> { + let subschema = subschema.object()?; + if is_null(subschema) { + Ok((true, not_null)) + } else { + Ok((nullable, Some(subschema))) + } + }, + ) + .context("failed to get anyOf subschemas")?; + Ok(if found_null { nullable_type } else { None }) +} + +/// The context for type extraction +#[derive(Clone, Copy, Debug)] +pub struct TypeContext<'a> { + /// The struct name + struct_name: &'a str, + /// The name of the field in the parent struct + field: &'a str, +} + +impl<'a> TypeContext<'a> { + pub fn new(parent: &'a str, field: &'a str) -> Self { + Self { + struct_name: parent, + field, + } + } +} + +/// Tries to extract a type name from the given instance type. +/// +/// Fails for unsupported instance types or integer formats. +pub fn type_from_instance_type( + schema: &SchemaObject, + type_context: TypeContext, + t: &SingleOrVec, + additional_structs: &mut Vec, +) -> Result { + // if it has an instance type, use that + Ok(if t.contains(&InstanceType::String) { + "string".to_string() + } else if t.contains(&InstanceType::Number) { + "float64".to_string() + } else if t.contains(&InstanceType::Integer) { + const AVAILABLE_INTS: &[&str] = &[ + "uint8", "int8", "uint16", "int16", "uint32", "int32", "uint64", "int64", + ]; + let format = schema.format.as_deref().unwrap_or("int64"); + if AVAILABLE_INTS.contains(&format) { + format.to_string() + } else { + bail!("unsupported integer format: {}", format); + } + } else if t.contains(&InstanceType::Boolean) { + "bool".to_string() + } else if t.contains(&InstanceType::Object) { + // generate a new struct for this object + // struct_name should be in PascalCase, so we detect the last word and use that as + // the suffix for the new struct name + let suffix = suffixes(type_context.struct_name) + .rev() + .find(|s| s.starts_with(char::is_uppercase)) + .unwrap_or(type_context.struct_name); + let new_struct_name = format!( + "{}{suffix}", + replace_acronyms(type_context.field.to_pascal_case()) + ); + + let fields = schema + .object + .as_ref() + .context("expected object validation")? + .properties + .iter() + .map(|(name, schema)| { + let schema = schema.object()?; + let ty = schema_object_type( + schema, + TypeContext::new(&new_struct_name, name), + additional_structs, + )?; + Ok(GoField { + rust_name: name.to_string(), + docs: documentation(schema), + ty, + }) + }) + .collect::>>()?; + + let strct = GoStruct { + name: new_struct_name.clone(), + docs: None, + fields, + }; + additional_structs.push(strct); + + new_struct_name + } else if t.contains(&InstanceType::Array) { + // get type of items + let item_type = array_item_type(schema, type_context, additional_structs) + .context("failed to get array item type")?; + + // for nullable array item types, we have to use a pointer type, even for basic types, + // so we can pass null as elements + // otherwise they would just be omitted from the array, unless it's a slice itself + let maybe_ptr = if item_type.nullability == Nullability::Nullable && !item_type.is_slice() { + "*" + } else { + "" + }; + let ty = if t.contains(&InstanceType::Null) { + // if the array itself is nullable, we can use a native Go slice + format!("[]{maybe_ptr}{}", item_type.name) + } else { + // if it is not nullable, we enforce empty slices instead of nil using our own type + format!("Array[{maybe_ptr}{}]", item_type.name) + }; + + replace_custom_type(&ty) + } else { + unreachable!("instance type should be one of the above") + }) +} + +/// Extract the type of the items of an array. +/// +/// This fails if the given schema object is not an array, +/// has multiple item types or other errors occur during type extraction of +/// the underlying schema. +pub fn array_item_type( + schema: &SchemaObject, + type_context: TypeContext, + additional_structs: &mut Vec, +) -> Result { + match schema.array.as_ref().and_then(|a| a.items.as_ref()) { + Some(SingleOrVec::Single(array_validation)) => { + schema_object_type(array_validation.object()?, type_context, additional_structs) + } + Some(SingleOrVec::Vec(v)) + if v.len() == 1 || v.len() > 1 && v.windows(2).all(|w| w[0] == w[1]) => + { + // all items are the same type + schema_object_type( + v.first().unwrap().object()?, + type_context, + additional_structs, + ) + } + _ => bail!("array type with non-singular item type is not supported"), + } +} + +/// Tries to extract a type name from the given subschemas. +/// +/// This fails if there are multiple subschemas or other errors occur +/// during subschema type extraction. +pub fn subschema_type( + subschemas: &[Schema], + type_context: TypeContext, + additional_structs: &mut Vec, +) -> Result { + ensure!( + subschemas.len() == 1, + "multiple subschemas are not supported" + ); + let subschema = &subschemas[0]; + let GoType { name, .. } = + schema_object_type(subschema.object()?, type_context, additional_structs)?; + Ok(replace_custom_type(&name)) +} + +pub fn is_null(schema: &SchemaObject) -> bool { + schema + .instance_type + .as_ref() + .is_some_and(|s| s.contains(&InstanceType::Null)) +} + +pub fn documentation(schema: &SchemaObject) -> Option { + schema.metadata.as_ref()?.description.as_ref().cloned() +} + +/// Maps special types to their Go equivalents. +/// If the given type is not a special type, returns `None`. +pub fn custom_type_of(ty: &str) -> Option<&str> { + match ty { + "Uint64" => Some("Uint64"), + "Uint128" => Some("string"), + "Uint256" => Some("string"), + "Uint512" => Some("string"), + "Order" => Some("string"), + "Int64" => Some("Int64"), + "Int128" => Some("string"), + "Int256" => Some("string"), + "Int512" => Some("string"), + "Binary" => Some("[]byte"), + "HexBinary" => Some("string"), + "ReplyOn" => Some("replyOn"), + "VoteOption" => Some("voteOption"), + "Checksum" => Some("Checksum"), + "Addr" => Some("string"), + "Decimal" => Some("string"), + "Decimal256" => Some("string"), + "SignedDecimal" => Some("string"), + "SignedDecimal256" => Some("string"), + "Timestamp" => Some("Uint64"), + _ => None, + } +} + +pub fn replace_custom_type(ty: &str) -> String { + custom_type_of(ty) + .map(|ty| ty.to_string()) + .unwrap_or_else(|| ty.to_string()) +} diff --git a/packages/go-gen/src/utils.rs b/packages/go-gen/src/utils.rs new file mode 100644 index 0000000000..4e4eee5287 --- /dev/null +++ b/packages/go-gen/src/utils.rs @@ -0,0 +1,80 @@ +/// An iterator that returns all suffixes of a string, excluding the empty string. +/// +/// It starts with the full string and ends with the last character. +/// It is a double-ended iterator and can be reversed. +pub fn suffixes(s: &str) -> impl DoubleEndedIterator { + s.char_indices().map(|(pos, _)| &s[pos..]) +} + +/// Replaces common pascal-case acronyms with their uppercase counterparts. +pub fn replace_acronyms(ty: impl Into) -> String { + let mut ty = ty.into(); + replace_word_in_place(&mut ty, "Url", "URL"); + replace_word_in_place(&mut ty, "Uri", "URI"); + replace_word_in_place(&mut ty, "Id", "ID"); + replace_word_in_place(&mut ty, "Ibc", "IBC"); + ty +} + +fn replace_word_in_place(haystack: &mut String, from: &str, to: &str) { + assert_eq!(from.len(), to.len(), "from and to must be the same length"); + let mut start = 0; + while let Some(pos) = haystack[start..].find(from) { + let begin = start + pos; + let end = start + pos + from.len(); + let next_char = haystack.chars().nth(end); + match next_char { + Some(next_char) if next_char.is_ascii_lowercase() => {} + _ => { + // if the next character is uppercase or any non-ascii char or + // there is no next char, it's a full word + haystack.replace_range(begin..end, to); + } + } + start = end; + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[should_panic = "from and to must be the same length"] + fn replace_in_place_different_lengths() { + let mut s = "foo".to_string(); + replace_word_in_place(&mut s, "foo", "barbar"); + } + + #[test] + fn replace_in_place_multiple_works() { + let mut s = "FooFooFooFooFoo".to_string(); + replace_word_in_place(&mut s, "Foo", "bar"); + assert_eq!(s, "barbarbarbarbar"); + } + + #[test] + fn replace_in_place_single_works() { + let mut s = "foo".to_string(); + replace_word_in_place(&mut s, "foo", "bar"); + assert_eq!(s, "bar"); + } + + #[test] + fn replace_word_in_place_part() { + let mut s = "Foofoo".to_string(); + replace_word_in_place(&mut s, "Foo", "Bar"); + // should not replace, because it's not a full word + assert_eq!(s, "Foofoo"); + } + + #[test] + fn replace_acronyms_works() { + assert_eq!(replace_acronyms("MyIdentity"), "MyIdentity"); + assert_eq!(replace_acronyms("MyIdentityId"), "MyIdentityID"); + assert_eq!(replace_acronyms("MyUri"), "MyURI"); + assert_eq!(replace_acronyms("Url"), "URL"); + assert_eq!(replace_acronyms("A"), "A"); + assert_eq!(replace_acronyms("Url🦦"), "URL🦦"); + } +} diff --git a/packages/go-gen/tests/cosmwasm_std__AllBalanceResponse.go b/packages/go-gen/tests/cosmwasm_std__AllBalanceResponse.go new file mode 100644 index 0000000000..531bddcfb3 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__AllBalanceResponse.go @@ -0,0 +1,10 @@ +// AllBalancesResponse is the expected response to AllBalancesQuery +type AllBalancesResponse struct { + Amount Array[Coin] `json:"amount"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} diff --git a/packages/go-gen/tests/cosmwasm_std__AllDelegationsResponse.go b/packages/go-gen/tests/cosmwasm_std__AllDelegationsResponse.go new file mode 100644 index 0000000000..2cb5d73a60 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__AllDelegationsResponse.go @@ -0,0 +1,16 @@ +// AllDelegationsResponse is the expected response to AllDelegationsQuery +type AllDelegationsResponse struct { + Delegations Array[Delegation] `json:"delegations"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} + +type Delegation struct { + Amount Coin `json:"amount"` + Delegator string `json:"delegator"` + Validator string `json:"validator"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__AllDenomMetadataResponse.go b/packages/go-gen/tests/cosmwasm_std__AllDenomMetadataResponse.go new file mode 100644 index 0000000000..d61cf12f3f --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__AllDenomMetadataResponse.go @@ -0,0 +1,51 @@ +type AllDenomMetadataResponse struct { + Metadata []DenomMetadata `json:"metadata"` + // NextKey is the key to be passed to PageRequest.key to + // query the next page most efficiently. It will be empty if + // there are no more results. + NextKey []byte `json:"next_key,omitempty"` +} + +// Replicating the cosmos-sdk bank module Metadata type +type DenomMetadata struct { + // Base represents the base denom (should be the DenomUnit with exponent = 0). + Base string `json:"base"` + // DenomUnits represents the list of DenomUnits for a given coin + DenomUnits []DenomUnit `json:"denom_units"` + Description string `json:"description"` + // Display indicates the suggested denom that should be + // displayed in clients. + Display string `json:"display"` + // Name defines the name of the token (eg: Cosmos Atom) + // + // Since: cosmos-sdk 0.43 + Name string `json:"name"` + // Symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + // + // Since: cosmos-sdk 0.43 + Symbol string `json:"symbol"` + // URI to a document (on or off-chain) that contains additional information. Optional. + // + // Since: cosmos-sdk 0.46 + URI string `json:"uri"` + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + // + // Since: cosmos-sdk 0.46 + URIHash string `json:"uri_hash"` +} + +// Replicating the cosmos-sdk bank module DenomUnit type +type DenomUnit struct { + // Aliases is a list of string aliases for the given denom + Aliases []string `json:"aliases"` + // Denom represents the string name of the given denom unit (e.g uatom). + Denom string `json:"denom"` + // Exponent represents power of 10 exponent that one must + // raise the base_denom to in order to equal the given DenomUnit's denom + // 1 denom = 10^exponent base_denom + // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + // exponent = 6, thus: 1 atom = 10^6 uatom). + Exponent uint32 `json:"exponent"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__AllValidatorsResponse.go b/packages/go-gen/tests/cosmwasm_std__AllValidatorsResponse.go new file mode 100644 index 0000000000..7ad9e762a0 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__AllValidatorsResponse.go @@ -0,0 +1,14 @@ +// AllValidatorsResponse is the expected response to AllValidatorsQuery +type AllValidatorsResponse struct { + Validators Array[ValidatorMetadata] `json:"validators"` +} + +type ValidatorMetadata struct { + Address string `json:"address"` + // decimal string, eg "0.02" + Commission string `json:"commission"` + // decimal string, eg "0.02" + MaxChangeRate string `json:"max_change_rate"` + // decimal string, eg "0.02" + MaxCommission string `json:"max_commission"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__BalanceResponse.go b/packages/go-gen/tests/cosmwasm_std__BalanceResponse.go new file mode 100644 index 0000000000..a8735fd00f --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__BalanceResponse.go @@ -0,0 +1,10 @@ +// BalanceResponse is the expected response to BalanceQuery +type BalanceResponse struct { + Amount Coin `json:"amount"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} diff --git a/packages/go-gen/tests/cosmwasm_std__BankMsg.go b/packages/go-gen/tests/cosmwasm_std__BankMsg.go new file mode 100644 index 0000000000..ee43dc4723 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__BankMsg.go @@ -0,0 +1,24 @@ +// SendMsg contains instructions for a Cosmos-SDK/SendMsg +// It has a fixed interface here and should be converted into the proper SDK format before dispatching +type SendMsg struct { + Amount Array[Coin] `json:"amount"` + ToAddress string `json:"to_address"` +} + +// BurnMsg will burn the given coins from the contract's account. +// There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. +// Important if a contract controls significant token supply that must be retired. +type BurnMsg struct { + Amount Array[Coin] `json:"amount"` +} + +type BankMsg struct { + Send *SendMsg `json:"send,omitempty"` + Burn *BurnMsg `json:"burn,omitempty"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} diff --git a/packages/go-gen/tests/cosmwasm_std__BankQuery.go b/packages/go-gen/tests/cosmwasm_std__BankQuery.go new file mode 100644 index 0000000000..a0ccb16d31 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__BankQuery.go @@ -0,0 +1,43 @@ +type SupplyQuery struct { + Denom string `json:"denom"` +} + +type BalanceQuery struct { + Address string `json:"address"` + Denom string `json:"denom"` +} + +type AllBalancesQuery struct { + Address string `json:"address"` +} + +type DenomMetadataQuery struct { + Denom string `json:"denom"` +} + +type AllDenomMetadataQuery struct { + // Pagination is an optional argument. + // Default pagination will be used if this is omitted + Pagination *PageRequest `json:"pagination,omitempty"` +} + +type BankQuery struct { + Supply *SupplyQuery `json:"supply,omitempty"` + Balance *BalanceQuery `json:"balance,omitempty"` + AllBalances *AllBalancesQuery `json:"all_balances,omitempty"` + DenomMetadata *DenomMetadataQuery `json:"denom_metadata,omitempty"` + AllDenomMetadata *AllDenomMetadataQuery `json:"all_denom_metadata,omitempty"` +} + +// Simplified version of the cosmos-sdk PageRequest type +type PageRequest struct { + // Key is a value returned in PageResponse.next_key to begin + // querying the next page most efficiently. Only one of offset or key + // should be set. + Key []byte `json:"key"` + // Limit is the total number of results to be returned in the result page. + // If left empty it will default to a value to be set by each app. + Limit uint32 `json:"limit"` + // Reverse is set to true if results are to be returned in the descending order. + Reverse bool `json:"reverse"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__BondedDenomResponse.go b/packages/go-gen/tests/cosmwasm_std__BondedDenomResponse.go new file mode 100644 index 0000000000..83c0e3c8b8 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__BondedDenomResponse.go @@ -0,0 +1,3 @@ +type BondedDenomResponse struct { + Denom string `json:"denom"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__CodeInfoResponse.go b/packages/go-gen/tests/cosmwasm_std__CodeInfoResponse.go new file mode 100644 index 0000000000..54520073a5 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__CodeInfoResponse.go @@ -0,0 +1,5 @@ +type CodeInfoResponse struct { + Checksum Checksum `json:"checksum"` // before wasmvm 2.0.0, this was `omitempty` (https://github.com/CosmWasm/wasmvm/issues/471) + CodeID uint64 `json:"code_id"` + Creator string `json:"creator"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__ContractInfoResponse.go b/packages/go-gen/tests/cosmwasm_std__ContractInfoResponse.go new file mode 100644 index 0000000000..80f6ae3733 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__ContractInfoResponse.go @@ -0,0 +1,13 @@ +type ContractInfoResponse struct { + // admin who can run migrations (if any) + Admin string `json:"admin,omitempty"` + CodeID uint64 `json:"code_id"` + // address that instantiated this contract + Creator string `json:"creator"` + // set if this contract has bound an Ibc2 port + IBC2Port string `json:"ibc2_port,omitempty"` + // set if this contract has bound an IBC port + IBCPort string `json:"ibc_port,omitempty"` + // if set, the contract is pinned to the cache, and thus uses less gas when called + Pinned bool `json:"pinned"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__DelegationResponse.go b/packages/go-gen/tests/cosmwasm_std__DelegationResponse.go new file mode 100644 index 0000000000..2b73905ce6 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__DelegationResponse.go @@ -0,0 +1,18 @@ +// DelegationResponse is the expected response to DelegationsQuery +type DelegationResponse struct { + Delegation *FullDelegation `json:"delegation,omitempty"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} + +type FullDelegation struct { + AccumulatedRewards Array[Coin] `json:"accumulated_rewards"` + Amount Coin `json:"amount"` + CanRedelegate Coin `json:"can_redelegate"` + Delegator string `json:"delegator"` + Validator string `json:"validator"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__DelegationRewardsResponse.go b/packages/go-gen/tests/cosmwasm_std__DelegationRewardsResponse.go new file mode 100644 index 0000000000..8eb5122f9f --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__DelegationRewardsResponse.go @@ -0,0 +1,10 @@ +// See +type DelegationRewardsResponse struct { + Rewards Array[DecCoin] `json:"rewards"` // in wasmvm, this has type `[]DecCoin` +} + +// A coin type with decimal amount. Modeled after the Cosmos SDK's [DecCoin](https://github.com/cosmos/cosmos-sdk/blob/c74e2887b0b73e81d48c2f33e6b1020090089ee0/proto/cosmos/base/v1beta1/coin.proto#L32-L41) type +type DecCoin struct { + Amount string `json:"amount"` + Denom string `json:"denom"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__DelegationTotalRewardsResponse.go b/packages/go-gen/tests/cosmwasm_std__DelegationTotalRewardsResponse.go new file mode 100644 index 0000000000..04a0a3fd9a --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__DelegationTotalRewardsResponse.go @@ -0,0 +1,16 @@ +// See +type DelegationTotalRewardsResponse struct { + Rewards Array[DelegatorReward] `json:"rewards"` // in wasmvm, this has type `[]DelegatorReward` + Total Array[DecCoin] `json:"total"` // in wasmvm, this has type `[]DecCoin` +} + +// A coin type with decimal amount. Modeled after the Cosmos SDK's [DecCoin](https://github.com/cosmos/cosmos-sdk/blob/c74e2887b0b73e81d48c2f33e6b1020090089ee0/proto/cosmos/base/v1beta1/coin.proto#L32-L41) type +type DecCoin struct { + Amount string `json:"amount"` + Denom string `json:"denom"` +} + +type DelegatorReward struct { + Reward Array[DecCoin] `json:"reward"` // in wasmvm, this has type `[]DecCoin` + ValidatorAddress string `json:"validator_address"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__DelegatorValidatorsResponse.go b/packages/go-gen/tests/cosmwasm_std__DelegatorValidatorsResponse.go new file mode 100644 index 0000000000..8fea33d5fe --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__DelegatorValidatorsResponse.go @@ -0,0 +1,4 @@ +// See +type DelegatorValidatorsResponse struct { + Validators Array[string] `json:"validators"` // in wasmvm, this has type `[]string` +} diff --git a/packages/go-gen/tests/cosmwasm_std__DelegatorWithdrawAddressResponse.go b/packages/go-gen/tests/cosmwasm_std__DelegatorWithdrawAddressResponse.go new file mode 100644 index 0000000000..72997425b5 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__DelegatorWithdrawAddressResponse.go @@ -0,0 +1,3 @@ +type DelegatorWithdrawAddressResponse struct { + WithdrawAddress string `json:"withdraw_address"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__DenomMetadataResponse.go b/packages/go-gen/tests/cosmwasm_std__DenomMetadataResponse.go new file mode 100644 index 0000000000..474d2b0816 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__DenomMetadataResponse.go @@ -0,0 +1,47 @@ +type DenomMetadataResponse struct { + Metadata DenomMetadata `json:"metadata"` +} + +// Replicating the cosmos-sdk bank module Metadata type +type DenomMetadata struct { + // Base represents the base denom (should be the DenomUnit with exponent = 0). + Base string `json:"base"` + // DenomUnits represents the list of DenomUnits for a given coin + DenomUnits Array[DenomUnit] `json:"denom_units"` // in wasmvm, this has type `[]DenomUnit` + Description string `json:"description"` + // Display indicates the suggested denom that should be + // displayed in clients. + Display string `json:"display"` + // Name defines the name of the token (eg: Cosmos Atom) + // + // Since: cosmos-sdk 0.43 + Name string `json:"name"` + // Symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + // + // Since: cosmos-sdk 0.43 + Symbol string `json:"symbol"` + // URI to a document (on or off-chain) that contains additional information. Optional. + // + // Since: cosmos-sdk 0.46 + URI string `json:"uri"` + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + // + // Since: cosmos-sdk 0.46 + URIHash string `json:"uri_hash"` +} + +// Replicating the cosmos-sdk bank module DenomUnit type +type DenomUnit struct { + // Aliases is a list of string aliases for the given denom + Aliases Array[string] `json:"aliases"` // in wasmvm, this has type `[]string` + // Denom represents the string name of the given denom unit (e.g uatom). + Denom string `json:"denom"` + // Exponent represents power of 10 exponent that one must + // raise the base_denom to in order to equal the given DenomUnit's denom + // 1 denom = 10^exponent base_denom + // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + // exponent = 6, thus: 1 atom = 10^6 uatom). + Exponent uint32 `json:"exponent"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__DistributionMsg.go b/packages/go-gen/tests/cosmwasm_std__DistributionMsg.go new file mode 100644 index 0000000000..079698d3c6 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__DistributionMsg.go @@ -0,0 +1,32 @@ +// SetWithdrawAddressMsg is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). +// `delegator_address` is automatically filled with the current contract's address. +type SetWithdrawAddressMsg struct { + // Address contains the `delegator_address` of a MsgSetWithdrawAddress + Address string `json:"address"` +} + +// WithdrawDelegatorRewardMsg is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). +// `delegator_address` is automatically filled with the current contract's address. +type WithdrawDelegatorRewardMsg struct { + // Validator contains `validator_address` of a MsgWithdrawDelegatorReward + Validator string `json:"validator"` +} + +// FundCommunityPoolMsg is translated to a [MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). +// `depositor` is automatically filled with the current contract's address +type FundCommunityPoolMsg struct { + // Amount is the list of coins to be send to the community pool + Amount Array[Coin] `json:"amount"` +} + +type DistributionMsg struct { + SetWithdrawAddress *SetWithdrawAddressMsg `json:"set_withdraw_address,omitempty"` + WithdrawDelegatorReward *WithdrawDelegatorRewardMsg `json:"withdraw_delegator_reward,omitempty"` + FundCommunityPool *FundCommunityPoolMsg `json:"fund_community_pool,omitempty"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} diff --git a/packages/go-gen/tests/cosmwasm_std__DistributionQuery.go b/packages/go-gen/tests/cosmwasm_std__DistributionQuery.go new file mode 100644 index 0000000000..cc0f236418 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__DistributionQuery.go @@ -0,0 +1,24 @@ +type DelegatorWithdrawAddressQuery struct { + DelegatorAddress string `json:"delegator_address"` +} +type DelegationRewardsQuery struct { + DelegatorAddress string `json:"delegator_address"` + ValidatorAddress string `json:"validator_address"` +} +type DelegationTotalRewardsQuery struct { + DelegatorAddress string `json:"delegator_address"` +} +type DelegatorValidatorsQuery struct { + DelegatorAddress string `json:"delegator_address"` +} + +type DistributionQuery struct { + // See + DelegatorWithdrawAddress *DelegatorWithdrawAddressQuery `json:"delegator_withdraw_address,omitempty"` + // See + DelegationRewards *DelegationRewardsQuery `json:"delegation_rewards,omitempty"` + // See + DelegationTotalRewards *DelegationTotalRewardsQuery `json:"delegation_total_rewards,omitempty"` + // See + DelegatorValidators *DelegatorValidatorsQuery `json:"delegator_validators,omitempty"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__GovMsg.go b/packages/go-gen/tests/cosmwasm_std__GovMsg.go new file mode 100644 index 0000000000..16efb6932e --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__GovMsg.go @@ -0,0 +1,26 @@ +type VoteMsg struct { + // Option is the vote option. + // + // This used to be called "vote", but was changed for consistency with Cosmos SDK. + // The old name is still supported for backwards compatibility. + Option voteOption `json:"option"` + ProposalID uint64 `json:"proposal_id"` // in wasmvm, this is `ProposalId` +} + +type VoteWeightedMsg struct { + Options Array[WeightedVoteOption] `json:"options"` // in wasmvm, this has type `[]WeightedVoteOption` + ProposalID uint64 `json:"proposal_id"` // in wasmvm, this is `ProposalId` +} + +type GovMsg struct { + // This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address. + Vote *VoteMsg `json:"vote,omitempty"` + /// This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address. + VoteWeighted *VoteWeightedMsg `json:"vote_weighted,omitempty"` +} + +type WeightedVoteOption struct { + Option voteOption `json:"option"` + // Weight is a Decimal string, e.g. "0.25" for 25% + Weight string `json:"weight"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__IbcMsg.go b/packages/go-gen/tests/cosmwasm_std__IbcMsg.go new file mode 100644 index 0000000000..202dde04ad --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__IbcMsg.go @@ -0,0 +1,60 @@ +type TransferMsg struct { + Amount Coin `json:"amount"` + ChannelID string `json:"channel_id"` + Memo string `json:"memo,omitempty"` // this is not yet in wasmvm, but will be soon + Timeout IBCTimeout `json:"timeout"` + ToAddress string `json:"to_address"` +} +type SendPacketMsg struct { + ChannelID string `json:"channel_id"` + Data []byte `json:"data"` + Timeout IBCTimeout `json:"timeout"` +} +type WriteAcknowledgementMsg struct { + // The acknowledgement to send back + Ack IBCAcknowledgement `json:"ack"` + // Existing channel where the packet was received + ChannelID string `json:"channel_id"` + // Sequence number of the packet that was received + PacketSequence uint64 `json:"packet_sequence"` +} +type CloseChannelMsg struct { + ChannelID string `json:"channel_id"` +} + +type IBCMsg struct { + Transfer *TransferMsg `json:"transfer,omitempty"` + SendPacket *SendPacketMsg `json:"send_packet,omitempty"` + WriteAcknowledgement *WriteAcknowledgementMsg `json:"write_acknowledgement,omitempty"` + CloseChannel *CloseChannelMsg `json:"close_channel,omitempty"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} + +type IBCAcknowledgement struct { + Data []byte `json:"data"` +} + +// IBCTimeout is the timeout for an IBC packet. At least one of block and timestamp is required. +type IBCTimeout struct { + Block *IBCTimeoutBlock `json:"block,omitempty"` // in wasmvm, this does not have "omitempty" + // Nanoseconds since UNIX epoch + Timestamp *Uint64 `json:"timestamp,omitempty"` +} + +// IBCTimeoutBlock Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients. +// Ordering is (revision_number, timeout_height) +type IBCTimeoutBlock struct { + // block height after which the packet times out. + // the height within the given revision + Height uint64 `json:"height"` + // the version that the client is currently on + // (eg. after resetting the chain this could increment 1 as height drops to 0) + Revision uint64 `json:"revision"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__IbcQuery.go b/packages/go-gen/tests/cosmwasm_std__IbcQuery.go new file mode 100644 index 0000000000..d3157874fd --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__IbcQuery.go @@ -0,0 +1,15 @@ +type PortIDQuery struct { +} + +type ChannelQuery struct { + ChannelID string `json:"channel_id"` + // optional argument + PortID string `json:"port_id,omitempty"` +} + +// IBCQuery defines a query request from the contract into the chain. +// This is the counterpart of [IbcQuery](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta1/packages/std/src/ibc.rs#L61-L83). +type IBCQuery struct { + PortID *PortIDQuery `json:"port_id,omitempty"` + Channel *ChannelQuery `json:"channel,omitempty"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__RawRangeResponse.go b/packages/go-gen/tests/cosmwasm_std__RawRangeResponse.go new file mode 100644 index 0000000000..f711780de2 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__RawRangeResponse.go @@ -0,0 +1,6 @@ +type RawRangeResponse struct { + // The key-value pairs + Data Array[Array[[]byte]] `json:"data"` + // `None` if there are no more key-value pairs within the given key range. + NextKey []byte `json:"next_key"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__StakingMsg.go b/packages/go-gen/tests/cosmwasm_std__StakingMsg.go new file mode 100644 index 0000000000..e7cc377d1f --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__StakingMsg.go @@ -0,0 +1,25 @@ +type DelegateMsg struct { + Amount Coin `json:"amount"` + Validator string `json:"validator"` +} +type UndelegateMsg struct { + Amount Coin `json:"amount"` + Validator string `json:"validator"` +} +type RedelegateMsg struct { + Amount Coin `json:"amount"` + DstValidator string `json:"dst_validator"` + SrcValidator string `json:"src_validator"` +} + +type StakingMsg struct { + Delegate *DelegateMsg `json:"delegate,omitempty"` + Undelegate *UndelegateMsg `json:"undelegate,omitempty"` + Redelegate *RedelegateMsg `json:"redelegate,omitempty"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} diff --git a/packages/go-gen/tests/cosmwasm_std__StakingQuery.go b/packages/go-gen/tests/cosmwasm_std__StakingQuery.go new file mode 100644 index 0000000000..005f363e82 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__StakingQuery.go @@ -0,0 +1,27 @@ +type BondedDenomQuery struct { // does not exist in wasmvm, but is an anonymous struct instead +} + +type AllDelegationsQuery struct { + Delegator string `json:"delegator"` +} + +type DelegationQuery struct { + Delegator string `json:"delegator"` + Validator string `json:"validator"` +} + +type AllValidatorsQuery struct { +} + +type ValidatorQuery struct { + /// Address is the validator's address (e.g. cosmosvaloper1...) + Address string `json:"address"` +} + +type StakingQuery struct { + BondedDenom *BondedDenomQuery `json:"bonded_denom,omitempty"` + AllDelegations *AllDelegationsQuery `json:"all_delegations,omitempty"` + Delegation *DelegationQuery `json:"delegation,omitempty"` + AllValidators *AllValidatorsQuery `json:"all_validators,omitempty"` + Validator *ValidatorQuery `json:"validator,omitempty"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__SupplyResponse.go b/packages/go-gen/tests/cosmwasm_std__SupplyResponse.go new file mode 100644 index 0000000000..a44b8f81b2 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__SupplyResponse.go @@ -0,0 +1,10 @@ +// SupplyResponse is the expected response to SupplyQuery +type SupplyResponse struct { + Amount Coin `json:"amount"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} diff --git a/packages/go-gen/tests/cosmwasm_std__ValidatorResponse.go b/packages/go-gen/tests/cosmwasm_std__ValidatorResponse.go new file mode 100644 index 0000000000..21c24134ec --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__ValidatorResponse.go @@ -0,0 +1,14 @@ +// ValidatorResponse is the expected response to ValidatorQuery +type ValidatorResponse struct { + Validator *Validator `json:"validator"` // serializes to `null` when unset which matches Rust's Option::None serialization +} + +type Validator struct { + Address string `json:"address"` + // decimal string, eg "0.02" + Commission string `json:"commission"` + // decimal string, eg "0.02" + MaxChangeRate string `json:"max_change_rate"` + // decimal string, eg "0.02" + MaxCommission string `json:"max_commission"` +} diff --git a/packages/go-gen/tests/cosmwasm_std__WasmMsg.go b/packages/go-gen/tests/cosmwasm_std__WasmMsg.go new file mode 100644 index 0000000000..67c402cc6f --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__WasmMsg.go @@ -0,0 +1,115 @@ +// ExecuteMsg is used to call another defined contract on this chain. +// The calling contract requires the callee to be defined beforehand, +// and the address should have been defined in initialization. +// And we assume the developer tested the ABIs and coded them together. +// +// Since a contract is immutable once it is deployed, we don't need to transform this. +// If it was properly coded and worked once, it will continue to work throughout upgrades. +type ExecuteMsg struct { + // ContractAddr is the sdk.AccAddress of the contract, which uniquely defines + // the contract ID and instance ID. The sdk module should maintain a reverse lookup table. + ContractAddr string `json:"contract_addr"` + // Send is an optional amount of coins this contract sends to the called contract + Funds Array[Coin] `json:"funds"` + // Msg is assumed to be a json-encoded message, which will be passed directly + // as `userMsg` when calling `Handle` on the above-defined contract + Msg []byte `json:"msg"` +} + +// InstantiateMsg will create a new contract instance from a previously uploaded CodeID. +// This allows one contract to spawn "sub-contracts". +type InstantiateMsg struct { + // Admin (optional) may be set here to allow future migrations from this address + Admin string `json:"admin,omitempty"` + // CodeID is the reference to the wasm byte code as used by the Cosmos-SDK + CodeID uint64 `json:"code_id"` + // Send is an optional amount of coins this contract sends to the called contract + Funds Array[Coin] `json:"funds"` + // Label is optional metadata to be stored with a contract instance. + Label string `json:"label"` + // Msg is assumed to be a json-encoded message, which will be passed directly + // as `userMsg` when calling `Instantiate` on a new contract with the above-defined CodeID + Msg []byte `json:"msg"` +} + +// Instantiate2Msg will create a new contract instance from a previously uploaded CodeID +// using the predictable address derivation. +type Instantiate2Msg struct { + // Admin (optional) may be set here to allow future migrations from this address + Admin string `json:"admin,omitempty"` + // CodeID is the reference to the wasm byte code as used by the Cosmos-SDK + CodeID uint64 `json:"code_id"` + // Send is an optional amount of coins this contract sends to the called contract + Funds Array[Coin] `json:"funds"` + // Label is optional metadata to be stored with a contract instance. + Label string `json:"label"` + // Msg is assumed to be a json-encoded message, which will be passed directly + // as `userMsg` when calling `Instantiate` on a new contract with the above-defined CodeID + Msg []byte `json:"msg"` + Salt []byte `json:"salt"` +} + +// MigrateMsg will migrate an existing contract from it's current wasm code (logic) +// to another previously uploaded wasm code. It requires the calling contract to be +// listed as "admin" of the contract to be migrated. +type MigrateMsg struct { + // ContractAddr is the sdk.AccAddress of the target contract, to migrate. + ContractAddr string `json:"contract_addr"` + // Msg is assumed to be a json-encoded message, which will be passed directly + // as `userMsg` when calling `Migrate` on the above-defined contract + Msg []byte `json:"msg"` + // NewCodeID is the reference to the wasm byte code for the new logic to migrate to + NewCodeID uint64 `json:"new_code_id"` +} + +// UpdateAdminMsg is the Go counterpart of WasmMsg::UpdateAdmin +// (https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta5/packages/std/src/results/cosmos_msg.rs#L158-L160). +type UpdateAdminMsg struct { + // Admin is the sdk.AccAddress of the new admin. + Admin string `json:"admin"` + // ContractAddr is the sdk.AccAddress of the target contract. + ContractAddr string `json:"contract_addr"` +} + +// ClearAdminMsg is the Go counterpart of WasmMsg::ClearAdmin +// (https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta5/packages/std/src/results/cosmos_msg.rs#L158-L160). +type ClearAdminMsg struct { + // ContractAddr is the sdk.AccAddress of the target contract. + ContractAddr string `json:"contract_addr"` +} + +// The message types of the wasm module. +// +// See https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto +type WasmMsg struct { + // Dispatches a call to another contract at a known address (with known ABI). + // + // This is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address. + Execute *ExecuteMsg `json:"execute,omitempty"` + // Instantiates a new contracts from previously uploaded Wasm code. + // + // The contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2. + // + // This is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address. + Instantiate *InstantiateMsg `json:"instantiate,omitempty"` + // Instantiates a new contracts from previously uploaded Wasm code using a predictable address derivation algorithm implemented in [`cosmwasm_std::instantiate2_address`]. + // + // This is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). `sender` is automatically filled with the current contract's address. `fix_msg` is automatically set to false. + Instantiate2 *Instantiate2Msg `json:"instantiate2,omitempty"` + // Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior. + // + // Only the contract admin (as defined in wasmd), if any, is able to make this call. + // + // This is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address. + Migrate *MigrateMsg `json:"migrate,omitempty"` + // Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract. + UpdateAdmin *UpdateAdminMsg `json:"update_admin,omitempty"` + // Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract. + ClearAdmin *ClearAdminMsg `json:"clear_admin,omitempty"` +} + +// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int) +type Coin struct { + Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" + Denom string `json:"denom"` // type, eg. "ATOM" +} diff --git a/packages/go-gen/tests/cosmwasm_std__WasmQuery.go b/packages/go-gen/tests/cosmwasm_std__WasmQuery.go new file mode 100644 index 0000000000..187098c862 --- /dev/null +++ b/packages/go-gen/tests/cosmwasm_std__WasmQuery.go @@ -0,0 +1,47 @@ +// SmartQuery response is raw bytes ([]byte) +type SmartQuery struct { + // Bech32 encoded sdk.AccAddress of the contract + ContractAddr string `json:"contract_addr"` + Msg []byte `json:"msg"` +} + +// RawQuery response is raw bytes ([]byte) +type RawQuery struct { + // Bech32 encoded sdk.AccAddress of the contract + ContractAddr string `json:"contract_addr"` + Key []byte `json:"key"` +} + +type ContractInfoQuery struct { + // Bech32 encoded sdk.AccAddress of the contract + ContractAddr string `json:"contract_addr"` +} + +type CodeInfoQuery struct { + CodeID uint64 `json:"code_id"` +} + +type RawRangeQuery struct { + // The address of the contract to query + ContractAddr string `json:"contract_addr"` + // Exclusive end bound. This is the key after the last key you would like to get data for. + End []byte `json:"end"` + // Maximum number of elements to return. + // + // Make sure to set a reasonable limit to avoid running out of memory or into the deserialization limits of the VM. Also keep in mind that these limitations depend on the full JSON size of the response type. + Limit uint16 `json:"limit"` + // The order in which you want to receive the key-value pairs. + Order string `json:"order"` + // Inclusive start bound. This is the first key you would like to get data for. + // + // If `start` is lexicographically greater than or equal to `end`, an empty range is described, mo matter of the order. + Start []byte `json:"start"` +} + +type WasmQuery struct { + Smart *SmartQuery `json:"smart,omitempty"` + Raw *RawQuery `json:"raw,omitempty"` + ContractInfo *ContractInfoQuery `json:"contract_info,omitempty"` + CodeInfo *CodeInfoQuery `json:"code_info,omitempty"` + RawRange *RawRangeQuery `json:"raw_range,omitempty"` +} diff --git a/packages/schema-derive/Cargo.toml b/packages/schema-derive/Cargo.toml index 7527b0442d..62c0ce20eb 100644 --- a/packages/schema-derive/Cargo.toml +++ b/packages/schema-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmwasm-schema-derive" -version = "1.1.9" +version = { workspace = true } authors = ["Tomasz Kurcz "] edition = "2021" description = "Derive macros for cosmwasm-schema" @@ -10,7 +10,7 @@ license = "Apache-2.0" [dependencies] proc-macro2 = "1" quote = "1" -syn = { version = "1", features = ["full", "printing", "extra-traits"] } +syn = { version = "2", features = ["extra-traits", "full", "printing"] } [lib] proc-macro = true diff --git a/packages/schema-derive/src/cw_serde.rs b/packages/schema-derive/src/cw_serde.rs index e33bbaaad7..4de9fcaf64 100644 --- a/packages/schema-derive/src/cw_serde.rs +++ b/packages/schema-derive/src/cw_serde.rs @@ -1,51 +1,132 @@ -use syn::{parse_quote, DeriveInput}; +use crate::error::bail; +use quote::{quote, ToTokens}; +use syn::{ + parse::{Parse, ParseStream}, + parse_quote, + punctuated::Punctuated, + DeriveInput, MetaNameValue, Token, +}; + +pub struct Options { + crate_path: syn::Path, +} + +impl Default for Options { + fn default() -> Self { + Self { + crate_path: parse_quote!(::cosmwasm_schema), + } + } +} + +impl Parse for Options { + fn parse(input: ParseStream) -> syn::Result { + let mut acc = Self::default(); + let params = Punctuated::::parse_terminated(input)?; + for param in params { + if param.path.is_ident("crate") { + let path_as_string: syn::LitStr = syn::parse2(param.value.to_token_stream())?; + acc.crate_path = path_as_string.parse()? + } else { + bail!(param, "unknown option"); + } + } + + Ok(acc) + } +} + +pub fn cw_serde_impl(options: Options, input: DeriveInput) -> syn::Result { + let crate_path = &options.crate_path; + let crate_path_displayable = crate_path.to_token_stream(); + + let cw_schema_path = format!("{crate_path_displayable}::cw_schema"); + let serde_path = format!("{crate_path_displayable}::serde"); + let schemars_path = format!("{crate_path_displayable}::schemars"); + + let mut stream = quote! { + #[derive( + #crate_path::serde::Serialize, + #crate_path::serde::Deserialize, + ::std::clone::Clone, + ::std::fmt::Debug, + ::std::cmp::PartialEq, + #crate_path::schemars::JsonSchema, + #crate_path::cw_schema::Schemaifier, + )] + #[allow(clippy::derive_partial_eq_without_eq)] // Allow users of `#[cw_serde]` to not implement Eq without clippy complaining + #[serde(crate = #serde_path)] + #[schemaifier(crate = #cw_schema_path)] + #[schemars(crate = #schemars_path)] + }; -pub fn cw_serde_impl(input: DeriveInput) -> DeriveInput { match input.data { - syn::Data::Struct(_) => parse_quote! { - #[derive( - ::cosmwasm_schema::serde::Serialize, - ::cosmwasm_schema::serde::Deserialize, - ::std::clone::Clone, - ::std::fmt::Debug, - ::std::cmp::PartialEq, - ::cosmwasm_schema::schemars::JsonSchema - )] - #[allow(clippy::derive_partial_eq_without_eq)] // Allow users of `#[cw_serde]` to not implement Eq without clippy complaining - #[serde(deny_unknown_fields, crate = "::cosmwasm_schema::serde")] - #[schemars(crate = "::cosmwasm_schema::schemars")] - #input - }, - syn::Data::Enum(_) => parse_quote! { - #[derive( - ::cosmwasm_schema::serde::Serialize, - ::cosmwasm_schema::serde::Deserialize, - ::std::clone::Clone, - ::std::fmt::Debug, - ::std::cmp::PartialEq, - ::cosmwasm_schema::schemars::JsonSchema - )] - #[allow(clippy::derive_partial_eq_without_eq)] // Allow users of `#[cw_serde]` to not implement Eq without clippy complaining - #[serde(deny_unknown_fields, rename_all = "snake_case", crate = "::cosmwasm_schema::serde")] - #[schemars(crate = "::cosmwasm_schema::schemars")] - #input - }, - syn::Data::Union(_) => panic!("unions are not supported"), + syn::Data::Struct(..) => (), + syn::Data::Enum(..) => { + stream.extend(quote! { #[serde(rename_all = "snake_case")] }); + } + syn::Data::Union(..) => bail!(input, "unions are not supported"), } + + stream.extend(input.to_token_stream()); + syn::parse2(stream) } #[cfg(test)] mod tests { use super::*; + use syn::parse_quote; #[test] - fn structs() { - let expanded = cw_serde_impl(parse_quote! { + fn crate_rename() { + let expanded = cw_serde_impl( + Options { + crate_path: parse_quote!(::my_crate::cw_schema), + }, + parse_quote! { + pub struct InstantiateMsg { + pub verifier: String, + pub beneficiary: String, + } + }, + ) + .unwrap(); + + let expected = parse_quote! { + #[derive( + ::my_crate::cw_schema::serde::Serialize, + ::my_crate::cw_schema::serde::Deserialize, + ::std::clone::Clone, + ::std::fmt::Debug, + ::std::cmp::PartialEq, + ::my_crate::cw_schema::schemars::JsonSchema, + ::my_crate::cw_schema::cw_schema::Schemaifier, + )] + #[allow(clippy::derive_partial_eq_without_eq)] + #[serde(crate = ":: my_crate :: cw_schema::serde")] + #[schemaifier(crate = ":: my_crate :: cw_schema::cw_schema")] + #[schemars(crate = ":: my_crate :: cw_schema::schemars")] pub struct InstantiateMsg { pub verifier: String, pub beneficiary: String, } - }); + }; + + assert_eq!(expanded, expected); + } + + #[test] + fn structs() { + let expanded = cw_serde_impl( + Options::default(), + parse_quote! { + pub struct InstantiateMsg { + pub verifier: String, + pub beneficiary: String, + } + }, + ) + .unwrap(); let expected = parse_quote! { #[derive( @@ -54,11 +135,13 @@ mod tests { ::std::clone::Clone, ::std::fmt::Debug, ::std::cmp::PartialEq, - ::cosmwasm_schema::schemars::JsonSchema + ::cosmwasm_schema::schemars::JsonSchema, + ::cosmwasm_schema::cw_schema::Schemaifier, )] #[allow(clippy::derive_partial_eq_without_eq)] - #[serde(deny_unknown_fields, crate = "::cosmwasm_schema::serde")] - #[schemars(crate = "::cosmwasm_schema::schemars")] + #[serde(crate = ":: cosmwasm_schema::serde")] + #[schemaifier(crate = ":: cosmwasm_schema::cw_schema")] + #[schemars(crate = ":: cosmwasm_schema::schemars")] pub struct InstantiateMsg { pub verifier: String, pub beneficiary: String, @@ -70,9 +153,13 @@ mod tests { #[test] fn empty_struct() { - let expanded = cw_serde_impl(parse_quote! { - pub struct InstantiateMsg {} - }); + let expanded = cw_serde_impl( + Options::default(), + parse_quote! { + pub struct InstantiateMsg {} + }, + ) + .unwrap(); let expected = parse_quote! { #[derive( @@ -81,11 +168,13 @@ mod tests { ::std::clone::Clone, ::std::fmt::Debug, ::std::cmp::PartialEq, - ::cosmwasm_schema::schemars::JsonSchema + ::cosmwasm_schema::schemars::JsonSchema, + ::cosmwasm_schema::cw_schema::Schemaifier, )] #[allow(clippy::derive_partial_eq_without_eq)] - #[serde(deny_unknown_fields, crate = "::cosmwasm_schema::serde")] - #[schemars(crate = "::cosmwasm_schema::schemars")] + #[serde(crate = ":: cosmwasm_schema::serde")] + #[schemaifier(crate = ":: cosmwasm_schema::cw_schema")] + #[schemars(crate = ":: cosmwasm_schema::schemars")] pub struct InstantiateMsg {} }; @@ -94,14 +183,18 @@ mod tests { #[test] fn enums() { - let expanded = cw_serde_impl(parse_quote! { - pub enum SudoMsg { - StealFunds { - recipient: String, - amount: Vec, - }, - } - }); + let expanded = cw_serde_impl( + Options::default(), + parse_quote! { + pub enum SudoMsg { + StealFunds { + recipient: String, + amount: Vec, + }, + } + }, + ) + .unwrap(); let expected = parse_quote! { #[derive( @@ -110,11 +203,14 @@ mod tests { ::std::clone::Clone, ::std::fmt::Debug, ::std::cmp::PartialEq, - ::cosmwasm_schema::schemars::JsonSchema + ::cosmwasm_schema::schemars::JsonSchema, + ::cosmwasm_schema::cw_schema::Schemaifier, )] #[allow(clippy::derive_partial_eq_without_eq)] - #[serde(deny_unknown_fields, rename_all = "snake_case", crate = "::cosmwasm_schema::serde")] - #[schemars(crate = "::cosmwasm_schema::schemars")] + #[serde(crate = ":: cosmwasm_schema::serde")] + #[schemaifier(crate = ":: cosmwasm_schema::cw_schema")] + #[schemars(crate = ":: cosmwasm_schema::schemars")] + #[serde(rename_all = "snake_case")] pub enum SudoMsg { StealFunds { recipient: String, @@ -129,11 +225,15 @@ mod tests { #[test] #[should_panic(expected = "unions are not supported")] fn unions() { - cw_serde_impl(parse_quote! { - pub union SudoMsg { - x: u32, - y: u32, - } - }); + cw_serde_impl( + Options::default(), + parse_quote! { + pub union SudoMsg { + x: u32, + y: u32, + } + }, + ) + .unwrap(); } } diff --git a/packages/schema-derive/src/error.rs b/packages/schema-derive/src/error.rs new file mode 100644 index 0000000000..4656ca8865 --- /dev/null +++ b/packages/schema-derive/src/error.rs @@ -0,0 +1,40 @@ +macro_rules! bail { + ($span_src:expr, $msg:literal) => {{ + return Err($crate::error::error_message!($span_src, $msg)); + }}; +} + +macro_rules! error_message { + ($span_src:expr, $msg:literal) => {{ + ::syn::Error::new(::syn::spanned::Spanned::span(&{ $span_src }), $msg) + }}; +} + +macro_rules! fallible_macro { + ( + $( + #[ $( $attribute_decl:tt )* ] + )* + pub fn $macro_name:ident ( $( $params:tt )* ) -> syn::Result<$inner_return:path> { + $( $fn_body:tt )* + } + ) => { + $( + #[ $( $attribute_decl )* ] + )* + pub fn $macro_name ( $( $params )* ) -> $inner_return { + let result = move || -> ::syn::Result<_> { + $( $fn_body )* + }; + + match result() { + Ok(val) => val, + Err(err) => err.into_compile_error().into(), + } + } + } +} + +pub(crate) use bail; +pub(crate) use error_message; +pub(crate) use fallible_macro; diff --git a/packages/schema-derive/src/generate_api.rs b/packages/schema-derive/src/generate_api.rs index b275ca561e..a3f7bc96f7 100644 --- a/packages/schema-derive/src/generate_api.rs +++ b/packages/schema-derive/src/generate_api.rs @@ -1,58 +1,95 @@ use std::collections::BTreeMap; +use super::SchemaBackend; +use crate::error::bail; use proc_macro2::TokenStream; use quote::quote; use syn::{ parse::{Parse, ParseStream}, - parse_quote, Block, ExprStruct, Ident, Path, Token, + parse_quote, Block, ExprStruct, Ident, Token, }; +fn generate_api_write(api_object: syn::ExprStruct, name: &TokenStream) -> TokenStream { + quote! {{ + let api = #api_object.render(); + let path = out_dir.join(concat!(#name, ".json")); + + let json = api.to_string().unwrap(); + write(&path, json + "\n").unwrap(); + println!("Exported the full API as {}", path.to_str().unwrap()); + + let raw_dir = out_dir.join("raw"); + create_dir_all(&raw_dir).unwrap(); + + for (filename, json) in api.to_schema_files().unwrap() { + let path = raw_dir.join(filename); + + write(&path, json + "\n").unwrap(); + println!("Exported {}", path.to_str().unwrap()); + } + }} +} + pub fn write_api_impl(input: Options) -> Block { - let api_object = generate_api_impl(&input); + let cw_api_object = generate_api_impl(SchemaBackend::CwSchema, &input); + let json_schema_api_object = generate_api_impl(SchemaBackend::JsonSchema, &input); + + let crate_name = input.crate_name; let name = input.name; + let cw_api_write = generate_api_write(cw_api_object, &name); + let json_schema_api_write = generate_api_write(json_schema_api_object, &name); + parse_quote! { { #[cfg(target_arch = "wasm32")] compile_error!("can't compile schema generator for the `wasm32` arch\nhint: are you trying to compile a smart contract without specifying `--lib`?"); - use ::std::env::current_dir; + use ::std::env; use ::std::fs::{create_dir_all, write}; - use ::cosmwasm_schema::{remove_schemas, Api, QueryResponses}; + use #crate_name::{remove_schemas, CwApi, Api, QueryResponses}; - let mut out_dir = current_dir().unwrap(); + let mut out_dir = env::current_dir().unwrap(); out_dir.push("schema"); create_dir_all(&out_dir).unwrap(); remove_schemas(&out_dir).unwrap(); - let path = out_dir.join(concat!(#name, ".json")); + #json_schema_api_write - let api = #api_object.render(); + out_dir.push("cw_schema"); + create_dir_all(&out_dir).unwrap(); + remove_schemas(&out_dir).unwrap(); - let json = api.to_string().unwrap(); - write(&path, json + "\n").unwrap(); - println!("Exported the full API as {}", path.to_str().unwrap()); + #cw_api_write } } } -pub fn generate_api_impl(input: &Options) -> ExprStruct { +pub fn generate_api_impl(backend: SchemaBackend, input: &Options) -> ExprStruct { let Options { + crate_name, name, version, - instantiate, - execute, - query, - migrate, - sudo, - responses, + .. } = input; + let instantiate = input.instantiate(backend); + let execute = input.execute(backend); + let query = input.query(backend); + let migrate = input.migrate(backend); + let sudo = input.sudo(backend); + let responses = input.responses(backend); + + let api_path = match backend { + SchemaBackend::CwSchema => quote! { #crate_name::CwApi }, + SchemaBackend::JsonSchema => quote! { #crate_name::Api }, + }; + parse_quote! { - ::cosmwasm_schema::Api { + #api_path { contract_name: #name.to_string(), contract_version: #version.to_string(), - instantiate: ::cosmwasm_schema::schema_for!(#instantiate), + instantiate: #instantiate, execute: #execute, query: #query, migrate: #migrate, @@ -69,19 +106,17 @@ enum Value { } impl Value { - fn unwrap_type(self) -> syn::Path { - if let Self::Type(p) = self { - p - } else { - panic!("expected a type"); + fn get_type(self) -> syn::Result { + match self { + Self::Type(p) => Ok(p), + Self::Str(other) => bail!(other, "expected a type"), } } - fn unwrap_str(self) -> syn::LitStr { - if let Self::Str(s) = self { - s - } else { - panic!("expected a string literal"); + fn get_str(self) -> syn::Result { + match self { + Self::Str(p) => Ok(p), + Self::Type(other) => bail!(other, "expected a string literal"), } } } @@ -109,25 +144,90 @@ impl Parse for Pair { } } +macro_rules! option_dispatch { + ($opt:expr, $closure:expr) => {{ + match $opt { + Some(ref ty) => { + #[allow(clippy::redundant_closure_call)] + let tokens = $closure(ty); + quote! { Some(#tokens) } + } + None => quote! { None }, + } + }}; +} + +macro_rules! backend_dispatch { + ($fn_name:ident, $ty_field:ident) => { + pub fn $fn_name(&self, backend: SchemaBackend) -> TokenStream { + let crate_name = &self.crate_name; + + option_dispatch!(self.$ty_field, |ty| { + match backend { + SchemaBackend::CwSchema => { + quote! { #crate_name::cw_schema::schema_of::<#ty>() } + } + SchemaBackend::JsonSchema => quote! { #crate_name::schema_for!(#ty) }, + } + }) + } + }; +} + #[derive(Debug)] pub struct Options { + crate_name: syn::Path, name: TokenStream, version: TokenStream, - instantiate: Path, - execute: TokenStream, - query: TokenStream, - migrate: TokenStream, - sudo: TokenStream, - responses: TokenStream, + instantiate_ty: Option, + execute_ty: Option, + query_ty: Option, + migrate_ty: Option, + sudo_ty: Option, + + schema_backend: SchemaBackend, +} + +impl Options { + backend_dispatch!(instantiate, instantiate_ty); + backend_dispatch!(execute, execute_ty); + backend_dispatch!(query, query_ty); + backend_dispatch!(migrate, migrate_ty); + backend_dispatch!(sudo, sudo_ty); + + pub fn responses(&self, backend: SchemaBackend) -> TokenStream { + let crate_name = &self.crate_name; + + option_dispatch!(self.query_ty, |ty| { + match backend { + SchemaBackend::CwSchema => { + quote! { <#ty as #crate_name::QueryResponses>::response_schemas_cw() } + } + SchemaBackend::JsonSchema => { + quote! { <#ty as #crate_name::QueryResponses>::response_schemas() } + } + } + }) + } + + pub fn schema_backend(&self) -> SchemaBackend { + self.schema_backend + } } impl Parse for Options { fn parse(input: ParseStream) -> syn::parse::Result { - let pairs = input.parse_terminated::(Pair::parse)?; + let pairs = input.parse_terminated(Pair::parse, Token![,])?; let mut map: BTreeMap<_, _> = pairs.into_iter().map(|p| p.0).collect(); + let crate_name = if let Some(crate_name_override) = map.remove(&parse_quote!(crate_name)) { + crate_name_override.get_type()? + } else { + parse_quote! { ::cosmwasm_schema } + }; + let name = if let Some(name_override) = map.remove(&parse_quote!(name)) { - let name_override = name_override.unwrap_str(); + let name_override = name_override.get_str()?; quote! { #name_override } @@ -138,7 +238,7 @@ impl Parse for Options { }; let version = if let Some(version_override) = map.remove(&parse_quote!(version)) { - let version_override = version_override.unwrap_str(); + let version_override = version_override.get_str()?; quote! { #version_override } @@ -148,59 +248,52 @@ impl Parse for Options { } }; - let instantiate = map + let instantiate_ty = map .remove(&parse_quote!(instantiate)) - .unwrap() - .unwrap_type(); - - let execute = match map.remove(&parse_quote!(execute)) { - Some(ty) => { - let ty = ty.unwrap_type(); - quote! {Some(::cosmwasm_schema::schema_for!(#ty))} - } - None => quote! { None }, - }; - - let (query, responses) = match map.remove(&parse_quote!(query)) { - Some(ty) => { - let ty = ty.unwrap_type(); - ( - quote! {Some(::cosmwasm_schema::schema_for!(#ty))}, - quote! { Some(<#ty as ::cosmwasm_schema::QueryResponses>::response_schemas().unwrap()) }, - ) - } - None => (quote! { None }, quote! { None }), - }; - - let migrate = match map.remove(&parse_quote!(migrate)) { - Some(ty) => { - let ty = ty.unwrap_type(); - quote! {Some(::cosmwasm_schema::schema_for!(#ty))} - } - None => quote! { None }, - }; - - let sudo = match map.remove(&parse_quote!(sudo)) { - Some(ty) => { - let ty = ty.unwrap_type(); - quote! {Some(::cosmwasm_schema::schema_for!(#ty))} - } - None => quote! { None }, + .map(|ty| ty.get_type()) + .transpose()?; + + let execute_ty = map + .remove(&parse_quote!(execute)) + .map(|ty| ty.get_type()) + .transpose()?; + + let query_ty = map + .remove(&parse_quote!(query)) + .map(|ty| ty.get_type()) + .transpose()?; + + let migrate_ty = map + .remove(&parse_quote!(migrate)) + .map(|ty| ty.get_type()) + .transpose()?; + + let sudo_ty = map + .remove(&parse_quote!(sudo)) + .map(|ty| ty.get_type()) + .transpose()?; + + let schema_backend = if let Some(backend) = map.remove(&parse_quote!(schema_backend)) { + let backend = backend.get_str()?; + parse_quote! { #backend } + } else { + SchemaBackend::JsonSchema }; if let Some((invalid_option, _)) = map.into_iter().next() { - panic!("unknown generate_api option: {}", invalid_option); + bail!(invalid_option, "unknown generate_api option"); } Ok(Self { + schema_backend, + crate_name, name, version, - instantiate, - execute, - query, - migrate, - sudo, - responses, + instantiate_ty, + execute_ty, + query_ty, + migrate_ty, + sudo_ty, }) } } @@ -209,17 +302,44 @@ impl Parse for Options { mod tests { use super::*; + #[test] + fn crate_rename() { + assert_eq!( + generate_api_impl( + SchemaBackend::JsonSchema, + &parse_quote! { + crate_name: ::my_crate::cw_schema, + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + migrate: MigrateMsg, + sudo: SudoMsg, + } + ), + parse_quote! { + ::my_crate::cw_schema::Api { + contract_name: ::std::env!("CARGO_PKG_NAME").to_string(), + contract_version: ::std::env!("CARGO_PKG_VERSION").to_string(), + instantiate: Some(::my_crate::cw_schema::schema_for!(InstantiateMsg)), + execute: Some(::my_crate::cw_schema::schema_for!(ExecuteMsg)), + query: Some(::my_crate::cw_schema::schema_for!(QueryMsg)), + migrate: Some(::my_crate::cw_schema::schema_for!(MigrateMsg)), + sudo: Some(::my_crate::cw_schema::schema_for!(SudoMsg)), + responses: Some(::response_schemas()), + } + } + ); + } + #[test] fn api_object_minimal() { assert_eq!( - generate_api_impl(&parse_quote! { - instantiate: InstantiateMsg, - }), + generate_api_impl(SchemaBackend::JsonSchema, &parse_quote! {}), parse_quote! { ::cosmwasm_schema::Api { contract_name: ::std::env!("CARGO_PKG_NAME").to_string(), contract_version: ::std::env!("CARGO_PKG_VERSION").to_string(), - instantiate: ::cosmwasm_schema::schema_for!(InstantiateMsg), + instantiate: None, execute: None, query: None, migrate: None, @@ -231,18 +351,45 @@ mod tests { } #[test] - fn api_object_name_vesion_override() { + fn api_object_instantiate_only() { assert_eq!( - generate_api_impl(&parse_quote! { - name: "foo", - version: "bar", - instantiate: InstantiateMsg, - }), + generate_api_impl( + SchemaBackend::JsonSchema, + &parse_quote! { + instantiate: InstantiateMsg, + } + ), + parse_quote! { + ::cosmwasm_schema::Api { + contract_name: ::std::env!("CARGO_PKG_NAME").to_string(), + contract_version: ::std::env!("CARGO_PKG_VERSION").to_string(), + instantiate: Some(::cosmwasm_schema::schema_for!(InstantiateMsg)), + execute: None, + query: None, + migrate: None, + sudo: None, + responses: None, + } + } + ); + } + + #[test] + fn api_object_name_version_override() { + assert_eq!( + generate_api_impl( + SchemaBackend::JsonSchema, + &parse_quote! { + name: "foo", + version: "bar", + instantiate: InstantiateMsg, + } + ), parse_quote! { ::cosmwasm_schema::Api { contract_name: "foo".to_string(), contract_version: "bar".to_string(), - instantiate: ::cosmwasm_schema::schema_for!(InstantiateMsg), + instantiate: Some(::cosmwasm_schema::schema_for!(InstantiateMsg)), execute: None, query: None, migrate: None, @@ -256,30 +403,33 @@ mod tests { #[test] fn api_object_all_msgs() { assert_eq!( - generate_api_impl(&parse_quote! { - instantiate: InstantiateMsg, - execute: ExecuteMsg, - query: QueryMsg, - migrate: MigrateMsg, - sudo: SudoMsg, - }), + generate_api_impl( + SchemaBackend::JsonSchema, + &parse_quote! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + migrate: MigrateMsg, + sudo: SudoMsg, + } + ), parse_quote! { ::cosmwasm_schema::Api { contract_name: ::std::env!("CARGO_PKG_NAME").to_string(), contract_version: ::std::env!("CARGO_PKG_VERSION").to_string(), - instantiate: ::cosmwasm_schema::schema_for!(InstantiateMsg), + instantiate: Some(::cosmwasm_schema::schema_for!(InstantiateMsg)), execute: Some(::cosmwasm_schema::schema_for!(ExecuteMsg)), query: Some(::cosmwasm_schema::schema_for!(QueryMsg)), migrate: Some(::cosmwasm_schema::schema_for!(MigrateMsg)), sudo: Some(::cosmwasm_schema::schema_for!(SudoMsg)), - responses: Some(::response_schemas().unwrap()), + responses: Some(::response_schemas()), } } ); } #[test] - #[should_panic(expected = "unknown generate_api option: asd")] + #[should_panic(expected = "unknown generate_api option")] fn invalid_option() { let _options: Options = parse_quote! { instantiate: InstantiateMsg, diff --git a/packages/schema-derive/src/lib.rs b/packages/schema-derive/src/lib.rs index 1674a5b476..02de6ff458 100644 --- a/packages/schema-derive/src/lib.rs +++ b/packages/schema-derive/src/lib.rs @@ -1,23 +1,48 @@ +//! Derive macros for cosmwasm-schema. For internal use only. +//! +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! For more information, see: mod cw_serde; +mod error; mod generate_api; mod query_responses; +use self::error::fallible_macro; use quote::ToTokens; -use syn::{parse_macro_input, DeriveInput, ItemEnum}; +use syn::parse_macro_input; -#[proc_macro_derive(QueryResponses, attributes(returns, query_responses))] -pub fn query_responses_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { - let input = parse_macro_input!(input as ItemEnum); +#[derive(Clone, Copy, Debug)] +enum SchemaBackend { + CwSchema, + JsonSchema, +} + +impl syn::parse::Parse for SchemaBackend { + fn parse(input: syn::parse::ParseStream) -> syn::Result { + let ident: syn::LitStr = input.parse()?; + match ident.value().as_str() { + "cw_schema" => Ok(SchemaBackend::CwSchema), + "json_schema" => Ok(SchemaBackend::JsonSchema), + _ => Err(syn::Error::new(ident.span(), "Unknown schema backend")), + } + } +} - let expanded = query_responses::query_responses_derive_impl(input).into_token_stream(); +fallible_macro! { + #[proc_macro_derive(QueryResponses, attributes(returns, query_responses))] + pub fn query_responses_derive( + input: proc_macro::TokenStream, + ) -> syn::Result { + let input = syn::parse(input)?; + let expanded = query_responses::query_responses_derive_impl(input)?; - proc_macro::TokenStream::from(expanded) + Ok(expanded.into_token_stream().into()) + } } #[proc_macro] pub fn write_api(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(input as generate_api::Options); - let expanded = generate_api::write_api_impl(input).into_token_stream(); proc_macro::TokenStream::from(expanded) @@ -26,20 +51,23 @@ pub fn write_api(input: proc_macro::TokenStream) -> proc_macro::TokenStream { #[proc_macro] pub fn generate_api(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(input as generate_api::Options); - - let expanded = generate_api::generate_api_impl(&input).into_token_stream(); + let expanded = + generate_api::generate_api_impl(input.schema_backend(), &input).into_token_stream(); proc_macro::TokenStream::from(expanded) } -#[proc_macro_attribute] -pub fn cw_serde( - _attr: proc_macro::TokenStream, - input: proc_macro::TokenStream, -) -> proc_macro::TokenStream { - let input = parse_macro_input!(input as DeriveInput); +fallible_macro! { + #[proc_macro_attribute] + pub fn cw_serde( + attr: proc_macro::TokenStream, + input: proc_macro::TokenStream, + ) -> syn::Result { + let options = syn::parse(attr)?; + let input = syn::parse(input)?; - let expanded = cw_serde::cw_serde_impl(input).into_token_stream(); + let expanded = cw_serde::cw_serde_impl(options, input)?; - proc_macro::TokenStream::from(expanded) + Ok(expanded.into_token_stream().into()) + } } diff --git a/packages/schema-derive/src/query_responses.rs b/packages/schema-derive/src/query_responses.rs index 195bb93d78..8fa3aad93a 100644 --- a/packages/schema-derive/src/query_responses.rs +++ b/packages/schema-derive/src/query_responses.rs @@ -1,61 +1,106 @@ mod context; -use syn::{parse_quote, Expr, ExprTuple, Generics, ItemEnum, ItemImpl, Type, Variant}; +use super::SchemaBackend; +use crate::error::{bail, error_message}; +use syn::{ + parse_quote, Expr, ExprTuple, Generics, ItemEnum, ItemImpl, Type, TypeParamBound, Variant, +}; use self::context::Context; -pub fn query_responses_derive_impl(input: ItemEnum) -> ItemImpl { - let ctx = context::get_context(&input); +pub fn query_responses_derive_impl(input: ItemEnum) -> syn::Result { + let ctx = context::get_context(&input)?; - if ctx.is_nested { + let item_impl = if ctx.is_nested { + let crate_name = &ctx.crate_name; let ident = input.ident; - let subquery_calls = input.variants.into_iter().map(parse_subquery); + let subquery_calls = input + .variants + .iter() + .map(|variant| parse_subquery(&ctx, variant, SchemaBackend::JsonSchema)) + .collect::>>()?; + + let subquery_calls_cw = input + .variants + .iter() + .map(|variant| parse_subquery(&ctx, variant, SchemaBackend::CwSchema)) + .collect::>>()?; // Handle generics if the type has any let (_, type_generics, where_clause) = input.generics.split_for_impl(); - let impl_generics = impl_generics(&ctx, &input.generics); + let impl_generics = impl_generics( + &ctx, + &input.generics, + &[parse_quote! {#crate_name::QueryResponses}], + ); let subquery_len = subquery_calls.len(); parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] - impl #impl_generics ::cosmwasm_schema::QueryResponses for #ident #type_generics #where_clause { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + impl #impl_generics #crate_name::QueryResponses for #ident #type_generics #where_clause { + fn response_schemas() -> ::std::collections::BTreeMap { let subqueries = [ #( #subquery_calls, )* ]; - ::cosmwasm_schema::combine_subqueries::<#subquery_len, #ident>(subqueries) + #crate_name::combine_subqueries::<#subquery_len, #ident #type_generics, _>(subqueries) + } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + let subqueries = [ + #( #subquery_calls_cw, )* + ]; + #crate_name::combine_subqueries::<#subquery_len, #ident #type_generics, _>(subqueries) } } } } else { + let crate_name = &ctx.crate_name; let ident = input.ident; - let mappings = input.variants.into_iter().map(parse_query); - let mut queries: Vec<_> = mappings.clone().map(|(q, _)| q).collect(); - queries.sort(); - let mappings = mappings.map(parse_tuple); + let mappings = input + .variants + .iter() + .map(|variant| parse_query(&ctx, variant, SchemaBackend::JsonSchema)) + .collect::>>()?; + + let mappings = mappings.into_iter().map(parse_tuple); + + let cw_mappings = input + .variants + .iter() + .map(|variant| parse_query(&ctx, variant, SchemaBackend::CwSchema)) + .collect::>>()?; + + let cw_mappings = cw_mappings.into_iter().map(parse_tuple); // Handle generics if the type has any let (_, type_generics, where_clause) = input.generics.split_for_impl(); - let impl_generics = impl_generics(&ctx, &input.generics); + let impl_generics = impl_generics(&ctx, &input.generics, &[]); parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] - impl #impl_generics ::cosmwasm_schema::QueryResponses for #ident #type_generics #where_clause { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + impl #impl_generics #crate_name::QueryResponses for #ident #type_generics #where_clause { + fn response_schemas() -> ::std::collections::BTreeMap { ::std::collections::BTreeMap::from([ #( #mappings, )* ]) } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + ::std::collections::BTreeMap::from([ + #( #cw_mappings, )* + ]) + } } } - } + }; + Ok(item_impl) } /// Takes a list of generics from the type definition and produces a list of generics /// for the expanded `impl` block, adding trait bounds like `JsonSchema` as appropriate. -fn impl_generics(ctx: &Context, generics: &Generics) -> Generics { +fn impl_generics(ctx: &Context, generics: &Generics, bounds: &[TypeParamBound]) -> Generics { let mut impl_generics = generics.to_owned(); for param in impl_generics.type_params_mut() { // remove the default type if present, as those are invalid in @@ -63,9 +108,16 @@ fn impl_generics(ctx: &Context, generics: &Generics) -> Generics { param.default = None; if !ctx.no_bounds_for.contains(¶m.ident) { + let crate_name = &ctx.crate_name; + param .bounds - .push(parse_quote! {::cosmwasm_schema::schemars::JsonSchema}) + .push(parse_quote! {#crate_name::schemars::JsonSchema}); + param + .bounds + .push(parse_quote! { #crate_name::cw_schema::Schemaifier }); + + param.bounds.extend(bounds.to_owned()); } } @@ -73,36 +125,56 @@ fn impl_generics(ctx: &Context, generics: &Generics) -> Generics { } /// Extract the query -> response mapping out of an enum variant. -fn parse_query(v: Variant) -> (String, Expr) { +fn parse_query( + ctx: &Context, + v: &Variant, + schema_backend: SchemaBackend, +) -> syn::Result<(String, Expr)> { + let crate_name = &ctx.crate_name; let query = to_snake_case(&v.ident.to_string()); let response_ty: Type = v .attrs .iter() - .find(|a| a.path.get_ident().unwrap() == "returns") - .unwrap_or_else(|| panic!("missing return type for query: {}", v.ident)) + .find(|a| a.path().is_ident("returns")) + .ok_or_else(|| error_message!(&v, "missing return type for query"))? .parse_args() - .unwrap_or_else(|_| panic!("return for {} must be a type", v.ident)); + .map_err(|e| error_message!(e.span(), "return must be a type"))?; + + let return_val = match schema_backend { + SchemaBackend::CwSchema => { + parse_quote!(#crate_name::cw_schema::schema_of::<#response_ty>()) + } + SchemaBackend::JsonSchema => parse_quote!(#crate_name::schema_for!(#response_ty)), + }; - ( - query, - parse_quote!(::cosmwasm_schema::schema_for!(#response_ty)), - ) + Ok((query, return_val)) } /// Extract the nested query -> response mapping out of an enum variant. -fn parse_subquery(v: Variant) -> Expr { +fn parse_subquery(ctx: &Context, v: &Variant, schema_backend: SchemaBackend) -> syn::Result { + let crate_name = &ctx.crate_name; let submsg = match v.fields { - syn::Fields::Named(_) => panic!("a struct variant is not a valid subquery"), - syn::Fields::Unnamed(fields) => { + syn::Fields::Named(_) => bail!(v, "a struct variant is not a valid subquery"), + syn::Fields::Unnamed(ref fields) => { if fields.unnamed.len() != 1 { - panic!("invalid number of subquery parameters"); + bail!(fields, "invalid number of subquery parameters"); } - fields.unnamed[0].ty.clone() + &fields.unnamed[0].ty } - syn::Fields::Unit => panic!("a unit variant is not a valid subquery"), + syn::Fields::Unit => bail!(v, "a unit variant is not a valid subquery"), }; - parse_quote!(<#submsg as ::cosmwasm_schema::QueryResponses>::response_schemas_impl()) + + let return_val = match schema_backend { + SchemaBackend::CwSchema => { + parse_quote!(<#submsg as #crate_name::QueryResponses>::response_schemas_cw()) + } + SchemaBackend::JsonSchema => { + parse_quote!(<#submsg as #crate_name::QueryResponses>::response_schemas()) + } + }; + + Ok(return_val) } fn parse_tuple((q, r): (String, Expr)) -> ExprTuple { @@ -125,10 +197,99 @@ fn to_snake_case(input: &str) -> String { #[cfg(test)] mod tests { + use std::collections::HashSet; + use syn::parse_quote; use super::*; + fn test_context() -> Context { + Context { + crate_name: parse_quote!(::cosmwasm_schema), + is_nested: false, + no_bounds_for: HashSet::new(), + } + } + + #[test] + fn crate_rename() { + let input: ItemEnum = parse_quote! { + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema, QueryResponses)] + #[serde(rename_all = "snake_case")] + #[query_responses(crate = "::my_crate::cw_schema")] + pub enum QueryMsg { + #[returns(some_crate::AnotherType)] + Supply {}, + #[returns(SomeType)] + Balance {}, + } + }; + + assert_eq!( + query_responses_derive_impl(input).unwrap(), + parse_quote! { + #[automatically_derived] + #[cfg(not(target_arch = "wasm32"))] + impl ::my_crate::cw_schema::QueryResponses for QueryMsg { + fn response_schemas() -> ::std::collections::BTreeMap { + ::std::collections::BTreeMap::from([ + ("supply".to_string(), ::my_crate::cw_schema::schema_for!(some_crate::AnotherType)), + ("balance".to_string(), ::my_crate::cw_schema::schema_for!(SomeType)), + ]) + } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + ::std::collections::BTreeMap::from([ + ("supply".to_string(), ::my_crate::cw_schema::cw_schema::schema_of::()), + ("balance".to_string(), ::my_crate::cw_schema::cw_schema::schema_of::()), + ]) + } + } + } + ); + } + + #[test] + fn crate_rename_nested() { + let input: ItemEnum = parse_quote! { + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema, QueryResponses)] + #[serde(untagged)] + #[query_responses(crate = "::my_crate::cw_schema", nested)] + pub enum ContractQueryMsg { + Cw1(QueryMsg1), + Whitelist(whitelist::QueryMsg), + Cw1WhitelistContract(QueryMsg), + } + }; + let result = query_responses_derive_impl(input).unwrap(); + assert_eq!( + result, + parse_quote! { + #[automatically_derived] + #[cfg(not(target_arch = "wasm32"))] + impl ::my_crate::cw_schema::QueryResponses for ContractQueryMsg { + fn response_schemas() -> ::std::collections::BTreeMap { + let subqueries = [ + ::response_schemas(), + ::response_schemas(), + ::response_schemas(), + ]; + ::my_crate::cw_schema::combine_subqueries::<3usize, ContractQueryMsg, _>(subqueries) + } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + let subqueries = [ + ::response_schemas_cw(), + ::response_schemas_cw(), + ::response_schemas_cw(), + ]; + ::my_crate::cw_schema::combine_subqueries::<3usize, ContractQueryMsg, _>(subqueries) + } + } + } + ); + } + #[test] fn happy_path() { let input: ItemEnum = parse_quote! { @@ -143,17 +304,24 @@ mod tests { }; assert_eq!( - query_responses_derive_impl(input), + query_responses_derive_impl(input).unwrap(), parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] impl ::cosmwasm_schema::QueryResponses for QueryMsg { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + fn response_schemas() -> ::std::collections::BTreeMap { ::std::collections::BTreeMap::from([ ("supply".to_string(), ::cosmwasm_schema::schema_for!(some_crate::AnotherType)), ("balance".to_string(), ::cosmwasm_schema::schema_for!(SomeType)), ]) } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + ::std::collections::BTreeMap::from([ + ("supply".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()), + ("balance".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()), + ]) + } } } ); @@ -168,12 +336,16 @@ mod tests { }; assert_eq!( - query_responses_derive_impl(input), + query_responses_derive_impl(input).unwrap(), parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] impl ::cosmwasm_schema::QueryResponses for QueryMsg { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + fn response_schemas() -> ::std::collections::BTreeMap { + ::std::collections::BTreeMap::from([]) + } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { ::std::collections::BTreeMap::from([]) } } @@ -218,60 +390,81 @@ mod tests { } }; - let result = query_responses_derive_impl(input); + let result = query_responses_derive_impl(input).unwrap(); assert_eq!( result, parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] - impl ::cosmwasm_schema::QueryResponses for QueryMsg { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + impl ::cosmwasm_schema::QueryResponses for QueryMsg { + fn response_schemas() -> ::std::collections::BTreeMap { ::std::collections::BTreeMap::from([ ("foo".to_string(), ::cosmwasm_schema::schema_for!(bool)), ("bar".to_string(), ::cosmwasm_schema::schema_for!(u32)), ]) } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + ::std::collections::BTreeMap::from([ + ("foo".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()), + ("bar".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()), + ]) + } } } ); assert_eq!( - query_responses_derive_impl(input2), + query_responses_derive_impl(input2).unwrap(), parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] - impl ::cosmwasm_schema::QueryResponses for QueryMsg { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + impl ::cosmwasm_schema::QueryResponses for QueryMsg { + fn response_schemas() -> ::std::collections::BTreeMap { ::std::collections::BTreeMap::from([ ("foo".to_string(), ::cosmwasm_schema::schema_for!(bool)), ("bar".to_string(), ::cosmwasm_schema::schema_for!(u32)), ]) } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + ::std::collections::BTreeMap::from([ + ("foo".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()), + ("bar".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()), + ]) + } } } ); - let a = query_responses_derive_impl(input3); + let a = query_responses_derive_impl(input3).unwrap(); assert_eq!( a, parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] - impl ::cosmwasm_schema::QueryResponses for QueryMsg + impl ::cosmwasm_schema::QueryResponses for QueryMsg where T: std::fmt::Debug + SomeTrait, { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + fn response_schemas() -> ::std::collections::BTreeMap { ::std::collections::BTreeMap::from([ ("foo".to_string(), ::cosmwasm_schema::schema_for!(bool)), ("bar".to_string(), ::cosmwasm_schema::schema_for!(u32)), ]) } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + ::std::collections::BTreeMap::from([ + ("foo".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()), + ("bar".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()), + ]) + } } } ); } #[test] - #[should_panic(expected = "missing return type for query: Supply")] + #[should_panic(expected = "missing return type for query")] fn missing_return() { let input: ItemEnum = parse_quote! { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema, QueryResponses)] @@ -283,11 +476,11 @@ mod tests { } }; - query_responses_derive_impl(input); + query_responses_derive_impl(input).unwrap(); } #[test] - #[should_panic(expected = "return for Supply must be a type")] + #[should_panic(expected = "return must be a type")] fn invalid_return() { let input: ItemEnum = parse_quote! { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema, QueryResponses)] @@ -300,7 +493,7 @@ mod tests { } }; - query_responses_derive_impl(input); + query_responses_derive_impl(input).unwrap(); } #[test] @@ -311,11 +504,17 @@ mod tests { }; assert_eq!( - parse_tuple(parse_query(variant)), + parse_tuple(parse_query(&test_context(), &variant, SchemaBackend::JsonSchema).unwrap()), parse_quote! { ("get_foo".to_string(), ::cosmwasm_schema::schema_for!(Foo)) } ); + assert_eq!( + parse_tuple(parse_query(&test_context(), &variant, SchemaBackend::CwSchema).unwrap()), + parse_quote! { + ("get_foo".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()) + } + ); let variant = parse_quote! { #[returns(some_crate::Foo)] @@ -323,9 +522,13 @@ mod tests { }; assert_eq!( - parse_tuple(parse_query(variant)), + parse_tuple(parse_query(&test_context(), &variant, SchemaBackend::JsonSchema).unwrap()), parse_quote! { ("get_foo".to_string(), ::cosmwasm_schema::schema_for!(some_crate::Foo)) } ); + assert_eq!( + parse_tuple(parse_query(&test_context(), &variant, SchemaBackend::CwSchema).unwrap()), + parse_quote! { ("get_foo".to_string(), ::cosmwasm_schema::cw_schema::schema_of::()) } + ); } #[test] @@ -346,20 +549,29 @@ mod tests { Cw1WhitelistContract(QueryMsg), } }; - let result = query_responses_derive_impl(input); + let result = query_responses_derive_impl(input).unwrap(); assert_eq!( result, parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] impl ::cosmwasm_schema::QueryResponses for ContractQueryMsg { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + fn response_schemas() -> ::std::collections::BTreeMap { let subqueries = [ - ::response_schemas_impl(), - ::response_schemas_impl(), - ::response_schemas_impl(), + ::response_schemas(), + ::response_schemas(), + ::response_schemas(), ]; - ::cosmwasm_schema::combine_subqueries::<3usize, ContractQueryMsg>(subqueries) + ::cosmwasm_schema::combine_subqueries::<3usize, ContractQueryMsg, _>(subqueries) + } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { + let subqueries = [ + ::response_schemas_cw(), + ::response_schemas_cw(), + ::response_schemas_cw(), + ]; + ::cosmwasm_schema::combine_subqueries::<3usize, ContractQueryMsg, _>(subqueries) } } } @@ -374,16 +586,21 @@ mod tests { #[query_responses(nested)] pub enum EmptyMsg {} }; - let result = query_responses_derive_impl(input); + let result = query_responses_derive_impl(input).unwrap(); assert_eq!( result, parse_quote! { #[automatically_derived] #[cfg(not(target_arch = "wasm32"))] impl ::cosmwasm_schema::QueryResponses for EmptyMsg { - fn response_schemas_impl() -> ::std::collections::BTreeMap { + fn response_schemas() -> ::std::collections::BTreeMap { + let subqueries = []; + ::cosmwasm_schema::combine_subqueries::<0usize, EmptyMsg, _>(subqueries) + } + + fn response_schemas_cw() -> ::std::collections::BTreeMap { let subqueries = []; - ::cosmwasm_schema::combine_subqueries::<0usize, EmptyMsg>(subqueries) + ::cosmwasm_schema::combine_subqueries::<0usize, EmptyMsg, _>(subqueries) } } } @@ -402,7 +619,7 @@ mod tests { Whitelist(whitelist::QueryMsg), } }; - query_responses_derive_impl(input); + query_responses_derive_impl(input).unwrap(); } #[test] @@ -419,7 +636,7 @@ mod tests { } } }; - query_responses_derive_impl(input); + query_responses_derive_impl(input).unwrap(); } #[test] @@ -434,6 +651,6 @@ mod tests { Whitelist, } }; - query_responses_derive_impl(input); + query_responses_derive_impl(input).unwrap(); } } diff --git a/packages/schema-derive/src/query_responses/context.rs b/packages/schema-derive/src/query_responses/context.rs index ed7f425f1d..614edb1aeb 100644 --- a/packages/schema-derive/src/query_responses/context.rs +++ b/packages/schema-derive/src/query_responses/context.rs @@ -1,63 +1,82 @@ use std::collections::HashSet; -use syn::{Ident, ItemEnum, Meta, NestedMeta}; +use crate::error::bail; +use syn::{parse_quote, Ident, ItemEnum, LitStr}; const ATTR_PATH: &str = "query_responses"; pub struct Context { + /// Name of the crate referenced in the macro expansions + pub crate_name: syn::Path, /// If the enum we're trying to derive QueryResponses for collects other QueryMsgs, /// setting this flag will derive the implementation appropriately, collecting all /// KV pairs from the nested enums rather than expecting `#[return]` annotations. pub is_nested: bool, - /// Disable infering the `JsonSchema` trait bound for chosen type parameters. + /// Disable inferring the `JsonSchema` trait bound for chosen type parameters. pub no_bounds_for: HashSet, } -pub fn get_context(input: &ItemEnum) -> Context { - let params = input - .attrs - .iter() - .filter(|attr| matches!(attr.path.get_ident(), Some(id) if *id == ATTR_PATH)) - .flat_map(|attr| { - if let Meta::List(l) = attr.parse_meta().unwrap() { - l.nested - } else { - panic!("{} attribute must contain a meta list", ATTR_PATH); - } - }) - .map(|nested_meta| { - if let NestedMeta::Meta(m) = nested_meta { - m - } else { - panic!("no literals allowed in QueryResponses params") - } - }); - +pub fn get_context(input: &ItemEnum) -> syn::Result { let mut ctx = Context { + crate_name: parse_quote!(::cosmwasm_schema), is_nested: false, no_bounds_for: HashSet::new(), }; - for param in params { - match param.path().get_ident().unwrap().to_string().as_str() { - "no_bounds_for" => { - if let Meta::List(l) = param { - for item in l.nested { - match item { - NestedMeta::Meta(Meta::Path(p)) => { - ctx.no_bounds_for.insert(p.get_ident().unwrap().clone()); - } - _ => panic!("`no_bounds_for` only accepts a list of type params"), - } - } - } else { - panic!("expected a list for `no_bounds_for`") - } - } - "nested" => ctx.is_nested = true, - path => panic!("unrecognized QueryResponses param: {}", path), + for attr in &input.attrs { + if !attr.path().is_ident(ATTR_PATH) { + continue; } + + let meta_list = attr.meta.require_list()?; + meta_list.parse_nested_meta(|param| { + if param.path.is_ident("no_bounds_for") { + param.parse_nested_meta(|item| { + ctx.no_bounds_for + .insert(item.path.get_ident().unwrap().clone()); + + Ok(()) + })?; + } else if param.path.is_ident("nested") { + ctx.is_nested = true; + } else if param.path.is_ident("crate") { + let crate_name_str: LitStr = param.value()?.parse()?; + ctx.crate_name = crate_name_str.parse()?; + } else { + bail!(param.path, "unrecognized QueryResponses param"); + } + + Ok(()) + })?; } - ctx + Ok(ctx) +} + +#[cfg(test)] +mod test { + use std::collections::HashSet; + + use quote::format_ident; + use syn::parse_quote; + + use super::get_context; + + #[test] + fn parse_context() { + let input = parse_quote! { + #[query_responses(crate = "::my_crate::cw_schema")] + #[query_responses(nested)] + #[query_responses(no_bounds_for(Item1, Item2))] + enum Test {} + }; + let context = get_context(&input).unwrap(); + + assert_eq!(context.crate_name, parse_quote!(::my_crate::cw_schema)); + assert!(context.is_nested); + assert_eq!( + context.no_bounds_for, + HashSet::from([format_ident!("Item1"), format_ident!("Item2")]) + ); + } } diff --git a/packages/schema/Cargo.toml b/packages/schema/Cargo.toml index 07e79dd652..cfd4ebe150 100644 --- a/packages/schema/Cargo.toml +++ b/packages/schema/Cargo.toml @@ -1,20 +1,25 @@ [package] name = "cosmwasm-schema" -version = "1.1.9" -authors = ["Simon Warta ", "Ethan Frey "] +version = { workspace = true } +authors = [ + "Ethan Frey ", + "Simon Warta ", +] edition = "2021" description = "A dev-dependency for CosmWasm contracts to generate JSON Schema files." repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/schema" license = "Apache-2.0" [dependencies] -cosmwasm-schema-derive = { version = "=1.1.9", path = "../schema-derive" } -schemars = "0.8.3" -serde = "1.0" -serde_json = "1.0.40" -thiserror = "1.0.13" +cosmwasm-schema-derive = { workspace = true } +cw-schema = { workspace = true } +schemars = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } [dev-dependencies] anyhow = "1.0.57" +insta = { version = "1.41.1", features = ["json"] } semver = "1" tempfile = "3" diff --git a/packages/schema/src/export.rs b/packages/schema/src/export.rs index 2e5c7dcd10..fa26dae9a9 100644 --- a/packages/schema/src/export.rs +++ b/packages/schema/src/export.rs @@ -7,7 +7,7 @@ use schemars::schema::RootSchema; use crate::casing::to_snake_case; -// Exports a schema, auto-generating filename based on the metadata title of the generated schema. +/// Exports a schema, auto-generating filename based on the metadata title of the generated schema. pub fn export_schema(schema: &RootSchema, out_dir: &Path) { let title = schema .schema @@ -18,8 +18,8 @@ pub fn export_schema(schema: &RootSchema, out_dir: &Path) { write_schema(schema, out_dir, &title); } -// use this if you want to override the auto-detected name of the object. -// very useful when creating an alias for a type-alias. +/// Use this if you want to override the auto-detected name of the object. +/// very useful when creating an alias for a type-alias. pub fn export_schema_with_title(schema: &RootSchema, out_dir: &Path, title: &str) { let mut schema = schema.clone(); // set the title explicitly on the schema's metadata diff --git a/packages/schema/src/idl.rs b/packages/schema/src/idl.rs index 8297d6f191..6177636d61 100644 --- a/packages/schema/src/idl.rs +++ b/packages/schema/src/idl.rs @@ -11,11 +11,40 @@ use thiserror::Error; // To determine if a change is breaking, assume consumers allow unknown fields and bump accordingly. pub const IDL_VERSION: &str = "1.0.0"; +/// Rust representation of a contract's API. +pub struct CwApi { + pub contract_name: String, + pub contract_version: String, + pub instantiate: Option, + pub execute: Option, + pub query: Option, + pub migrate: Option, + pub sudo: Option, + /// A mapping of query variants to response types + pub responses: Option>, +} + +impl CwApi { + pub fn render(self) -> JsonCwApi { + JsonCwApi { + contract_name: self.contract_name, + contract_version: self.contract_version, + idl_version: IDL_VERSION.to_string(), + instantiate: self.instantiate, + execute: self.execute, + query: self.query, + migrate: self.migrate, + sudo: self.sudo, + responses: self.responses, + } + } +} + /// Rust representation of a contract's API. pub struct Api { pub contract_name: String, pub contract_version: String, - pub instantiate: RootSchema, + pub instantiate: Option, pub execute: Option, pub query: Option, pub migrate: Option, @@ -38,8 +67,10 @@ impl Api { responses: self.responses, }; - if let Some(metadata) = &mut json_api.instantiate.schema.metadata { - metadata.title = Some("InstantiateMsg".to_string()); + if let Some(instantiate) = &mut json_api.instantiate { + if let Some(metadata) = &mut instantiate.schema.metadata { + metadata.title = Some("InstantiateMsg".to_string()); + } } if let Some(execute) = &mut json_api.execute { if let Some(metadata) = &mut execute.schema.metadata { @@ -66,13 +97,83 @@ impl Api { } } +/// A JSON representation of a contract's API. +#[derive(serde::Deserialize, serde::Serialize)] +pub struct JsonCwApi { + pub contract_name: String, + pub contract_version: String, + pub idl_version: String, + pub instantiate: Option, + pub execute: Option, + pub query: Option, + pub migrate: Option, + pub sudo: Option, + pub responses: Option>, +} + +impl JsonCwApi { + pub fn to_string(&self) -> Result { + serde_json::to_string_pretty(&self).map_err(Into::into) + } + + pub fn to_schema_files(&self) -> Result, EncodeError> { + let mut result = Vec::new(); + + if let Some(instantiate) = &self.instantiate { + result.push(( + "instantiate.json".to_string(), + serde_json::to_string_pretty(&instantiate)?, + )); + } + + if let Some(execute) = &self.execute { + result.push(( + "execute.json".to_string(), + serde_json::to_string_pretty(&execute)?, + )); + } + if let Some(query) = &self.query { + result.push(( + "query.json".to_string(), + serde_json::to_string_pretty(&query)?, + )); + } + if let Some(migrate) = &self.migrate { + result.push(( + "migrate.json".to_string(), + serde_json::to_string_pretty(&migrate)?, + )); + } + if let Some(sudo) = &self.sudo { + result.push(( + "sudo.json".to_string(), + serde_json::to_string_pretty(&sudo)?, + )); + } + if let Some(responses) = &self.responses { + for (name, response) in responses { + result.push(( + format!("response_to_{name}.json"), + serde_json::to_string_pretty(&response)?, + )); + } + } + + Ok(result) + } + + pub fn to_writer(&self, writer: impl std::io::Write) -> Result<(), EncodeError> { + serde_json::to_writer_pretty(writer, self).map_err(Into::into) + } +} + /// A JSON representation of a contract's API. #[derive(serde::Serialize)] pub struct JsonApi { contract_name: String, contract_version: String, idl_version: String, - instantiate: RootSchema, + instantiate: Option, execute: Option, query: Option, migrate: Option, @@ -85,6 +186,52 @@ impl JsonApi { serde_json::to_string_pretty(&self).map_err(Into::into) } + pub fn to_schema_files(&self) -> Result, EncodeError> { + let mut result = Vec::new(); + + if let Some(instantiate) = &self.instantiate { + result.push(( + "instantiate.json".to_string(), + serde_json::to_string_pretty(&instantiate)?, + )); + } + + if let Some(execute) = &self.execute { + result.push(( + "execute.json".to_string(), + serde_json::to_string_pretty(&execute)?, + )); + } + if let Some(query) = &self.query { + result.push(( + "query.json".to_string(), + serde_json::to_string_pretty(&query)?, + )); + } + if let Some(migrate) = &self.migrate { + result.push(( + "migrate.json".to_string(), + serde_json::to_string_pretty(&migrate)?, + )); + } + if let Some(sudo) = &self.sudo { + result.push(( + "sudo.json".to_string(), + serde_json::to_string_pretty(&sudo)?, + )); + } + if let Some(responses) = &self.responses { + for (name, response) in responses { + result.push(( + format!("response_to_{name}.json"), + serde_json::to_string_pretty(&response)?, + )); + } + } + + Ok(result) + } + pub fn to_writer(&self, writer: impl std::io::Write) -> Result<(), EncodeError> { serde_json::to_writer_pretty(writer, self).map_err(Into::into) } @@ -98,10 +245,55 @@ pub enum EncodeError { #[cfg(test)] mod tests { + use crate::schema_for; + use super::*; #[test] fn version_is_semver() { semver::Version::parse(IDL_VERSION).unwrap(); } + + #[test] + fn to_schema_files_works() { + let empty = Api { + contract_name: "my_contract".to_string(), + contract_version: "1.2.3".to_string(), + instantiate: None, + execute: None, + query: None, + migrate: None, + sudo: None, + responses: None, + }; + + let files = empty.render().to_schema_files().unwrap(); + assert_eq!(files, []); + + #[derive(schemars::JsonSchema)] + struct TestMsg {} + + let full = Api { + contract_name: "my_contract".to_string(), + contract_version: "1.2.3".to_string(), + instantiate: Some(schema_for!(TestMsg)), + execute: Some(schema_for!(TestMsg)), + query: Some(schema_for!(TestMsg)), + migrate: Some(schema_for!(TestMsg)), + sudo: Some(schema_for!(TestMsg)), + responses: Some(BTreeMap::from([( + "TestMsg".to_string(), + schema_for!(TestMsg), + )])), + }; + + let files = full.render().to_schema_files().unwrap(); + assert_eq!(files.len(), 6); + assert_eq!(files[0].0, "instantiate.json"); + assert_eq!(files[1].0, "execute.json"); + assert_eq!(files[2].0, "query.json"); + assert_eq!(files[3].0, "migrate.json"); + assert_eq!(files[4].0, "sudo.json"); + assert_eq!(files[5].0, "response_to_TestMsg.json"); + } } diff --git a/packages/schema/src/lib.rs b/packages/schema/src/lib.rs index 2abc7fe8f8..bcc92d9603 100644 --- a/packages/schema/src/lib.rs +++ b/packages/schema/src/lib.rs @@ -1,3 +1,8 @@ +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! This crate is a dev-dependency for CosmWasm contracts to generate JSON Schema files. +//! +//! For more information, see: + mod casing; mod export; mod idl; @@ -6,8 +11,8 @@ mod remove; mod schema_for; pub use export::{export_schema, export_schema_with_title}; -pub use idl::{Api, IDL_VERSION}; -pub use query_response::{combine_subqueries, IntegrityError, QueryResponses}; +pub use idl::{Api, CwApi, IDL_VERSION}; +pub use query_response::{combine_subqueries, QueryResponses}; pub use remove::remove_schemas; // Re-exports @@ -94,5 +99,6 @@ pub use cosmwasm_schema_derive::generate_api; pub use cosmwasm_schema_derive::write_api; // For use in macro expansions +pub use cw_schema; pub use schemars; pub use serde; diff --git a/packages/schema/src/query_response.rs b/packages/schema/src/query_response.rs index 20cf84e261..98f0fb6150 100644 --- a/packages/schema/src/query_response.rs +++ b/packages/schema/src/query_response.rs @@ -1,10 +1,6 @@ -use std::collections::{BTreeMap, BTreeSet}; +use std::collections::BTreeMap; -use schemars::{ - schema::{InstanceType, RootSchema, SingleOrVec, SubschemaValidation}, - JsonSchema, -}; -use thiserror::Error; +use schemars::{schema::RootSchema, JsonSchema}; pub use cosmwasm_schema_derive::QueryResponses; @@ -16,14 +12,15 @@ pub use cosmwasm_schema_derive::QueryResponses; /// # Examples /// ``` /// use cosmwasm_schema::QueryResponses; +/// use cw_schema::Schemaifier; /// use schemars::JsonSchema; /// -/// #[derive(JsonSchema)] +/// #[derive(JsonSchema, Schemaifier)] /// struct AccountInfo { /// IcqHandle: String, /// } /// -/// #[derive(JsonSchema, QueryResponses)] +/// #[derive(JsonSchema, Schemaifier, QueryResponses)] /// enum QueryMsg { /// #[returns(Vec)] /// Denoms {}, @@ -40,7 +37,8 @@ pub use cosmwasm_schema_derive::QueryResponses; /// ``` /// # use cosmwasm_schema::QueryResponses; /// # use schemars::JsonSchema; -/// #[derive(JsonSchema, QueryResponses)] +/// # use cw_schema::Schemaifier; +/// #[derive(JsonSchema, Schemaifier, QueryResponses)] /// #[query_responses(nested)] /// #[serde(untagged)] /// enum QueryMsg { @@ -48,42 +46,34 @@ pub use cosmwasm_schema_derive::QueryResponses; /// MsgB(QueryB), /// } /// -/// #[derive(JsonSchema, QueryResponses)] +/// #[derive(JsonSchema, Schemaifier, QueryResponses)] /// enum QueryA { /// #[returns(Vec)] /// Denoms {}, /// } /// -/// #[derive(JsonSchema, QueryResponses)] +/// #[derive(JsonSchema, Schemaifier, QueryResponses)] /// enum QueryB { /// #[returns(AccountInfo)] /// AccountInfo { account: String }, /// } /// -/// # #[derive(JsonSchema)] +/// # #[derive(JsonSchema, Schemaifier)] /// # struct AccountInfo { /// # IcqHandle: String, /// # } /// ``` pub trait QueryResponses: JsonSchema { - fn response_schemas() -> Result, IntegrityError> { - let response_schemas = Self::response_schemas_impl(); + fn response_schemas() -> BTreeMap; - let queries: BTreeSet<_> = response_schemas.keys().cloned().collect(); - - check_api_integrity::(queries)?; - - Ok(response_schemas) - } - - fn response_schemas_impl() -> BTreeMap; + fn response_schemas_cw() -> BTreeMap; } /// Combines multiple response schemas into one. Panics if there are name collisions. /// Used internally in the implementation of [`QueryResponses`] when using `#[query_responses(nested)]` -pub fn combine_subqueries( - subqueries: [BTreeMap; N], -) -> BTreeMap { +pub fn combine_subqueries( + subqueries: [BTreeMap; N], +) -> BTreeMap { let sub_count = subqueries.iter().flatten().count(); let map: BTreeMap<_, _> = subqueries.into_iter().flatten().collect(); if map.len() != sub_count { @@ -95,138 +85,9 @@ pub fn combine_subqueries( map } -/// Returns possible enum variants from `one_of` analysis -fn enum_variants( - subschemas: SubschemaValidation, -) -> Result>, IntegrityError> { - let iter = subschemas - .one_of - .ok_or(IntegrityError::InvalidQueryMsgSchema)? - .into_iter() - .map(|s| { - let s = s.into_object(); - - if let Some(SingleOrVec::Single(ty)) = s.instance_type { - match *ty { - // We'll have an object if the Rust enum variant was C-like or tuple-like - InstanceType::Object => s - .object - .ok_or(IntegrityError::InvalidQueryMsgSchema)? - .required - .into_iter() - .next() - .ok_or(IntegrityError::InvalidQueryMsgSchema), - // We might have a string here if the Rust enum variant was unit-like - InstanceType::String => { - let values = s.enum_values.ok_or(IntegrityError::InvalidQueryMsgSchema)?; - - if values.len() != 1 { - return Err(IntegrityError::InvalidQueryMsgSchema); - } - - values[0] - .as_str() - .map(String::from) - .ok_or(IntegrityError::InvalidQueryMsgSchema) - } - _ => Err(IntegrityError::InvalidQueryMsgSchema), - } - } else { - Err(IntegrityError::InvalidQueryMsgSchema) - } - }); - - Ok(iter) -} - -fn verify_queries( - query_msg: BTreeSet, - responses: BTreeSet, -) -> Result<(), IntegrityError> { - if query_msg != responses { - return Err(IntegrityError::InconsistentQueries { - query_msg, - responses, - }); - } - - Ok(()) -} - -/// `generated_queries` is expected to be a sorted slice here! -fn check_api_integrity( - generated_queries: BTreeSet, -) -> Result<(), IntegrityError> { - let schema = crate::schema_for!(T); - - let subschemas = if let Some(subschemas) = schema.schema.subschemas { - subschemas - } else { - // No subschemas - no resposnes are expected - return verify_queries(BTreeSet::new(), generated_queries); - }; - - let schema_queries = if let Some(any_of) = subschemas.any_of { - // If `any_of` exists, we assume schema is generated from untagged enum - any_of - .into_iter() - .map(|schema| dbg!(schema.into_object())) - .filter_map(|obj| { - if let Some(reference) = obj.reference { - // Subschemas can be hidden behind references - we want to map them to proper - // subschemas in such case - - // Only references to definitions are supported - let reference = match reference.strip_prefix("#/definitions/") { - Some(reference) => reference, - None => { - return Some(Err(IntegrityError::ExternalReference { - reference: reference.to_owned(), - })) - } - }; - - let schema = match schema.definitions.get(reference) { - Some(schema) => schema.clone(), - None => return Some(Err(IntegrityError::InvalidQueryMsgSchema)), - }; - - Ok(schema.into_object().subschemas).transpose() - } else { - Ok(obj.subschemas).transpose() - } - }) - .map(|subschema| enum_variants(*subschema?)) - .collect::, _>>()? - .into_iter() - .flatten() - .collect::>()? - } else { - // If `any_of` is not present, there was no untagged enum on top, we expect normal enum at - // this point - enum_variants(*subschemas)?.collect::>()? - }; - - verify_queries(schema_queries, generated_queries) -} - -#[derive(Debug, Error, PartialEq, Eq)] -pub enum IntegrityError { - #[error("the structure of the QueryMsg schema was unexpected")] - InvalidQueryMsgSchema, - #[error("external reference in schema found, but they are not supported")] - ExternalReference { reference: String }, - #[error( - "inconsistent queries - QueryMsg schema has {query_msg:?}, but query responses have {responses:?}" - )] - InconsistentQueries { - query_msg: BTreeSet, - responses: BTreeSet, - }, -} - #[cfg(test)] mod tests { + use cw_schema::schema_of; use schemars::schema_for; use super::*; @@ -243,7 +104,7 @@ mod tests { } impl QueryResponses for GoodMsg { - fn response_schemas_impl() -> BTreeMap { + fn response_schemas() -> BTreeMap { BTreeMap::from([ ("balance_for".to_string(), schema_for!(u128)), ("account_id_for".to_string(), schema_for!(u128)), @@ -252,11 +113,21 @@ mod tests { ("account_count".to_string(), schema_for!(u128)), ]) } + + fn response_schemas_cw() -> BTreeMap { + BTreeMap::from([ + ("balance_for".to_string(), schema_of::()), + ("account_id_for".to_string(), schema_of::()), + ("supply".to_string(), schema_of::()), + ("liquidity".to_string(), schema_of::()), + ("account_count".to_string(), schema_of::()), + ]) + } } #[test] fn good_msg_works() { - let response_schemas = GoodMsg::response_schemas().unwrap(); + let response_schemas = GoodMsg::response_schemas(); assert_eq!( response_schemas, BTreeMap::from([ @@ -275,14 +146,18 @@ mod tests { pub enum EmptyMsg {} impl QueryResponses for EmptyMsg { - fn response_schemas_impl() -> BTreeMap { + fn response_schemas() -> BTreeMap { + BTreeMap::from([]) + } + + fn response_schemas_cw() -> BTreeMap { BTreeMap::from([]) } } #[test] fn empty_msg_works() { - let response_schemas = EmptyMsg::response_schemas().unwrap(); + let response_schemas = EmptyMsg::response_schemas(); assert_eq!(response_schemas, BTreeMap::from([])); } @@ -294,21 +169,13 @@ mod tests { } impl QueryResponses for BadMsg { - fn response_schemas_impl() -> BTreeMap { + fn response_schemas() -> BTreeMap { BTreeMap::from([("balance_for".to_string(), schema_for!(u128))]) } - } - #[test] - fn bad_msg_fails() { - let err = BadMsg::response_schemas().unwrap_err(); - assert_eq!( - err, - IntegrityError::InconsistentQueries { - query_msg: BTreeSet::from(["balance-for".to_string()]), - responses: BTreeSet::from(["balance_for".to_string()]) - } - ); + fn response_schemas_cw() -> BTreeMap { + BTreeMap::from([("balance_for".to_string(), schema_of::())]) + } } #[derive(Debug, JsonSchema)] @@ -328,7 +195,7 @@ mod tests { } impl QueryResponses for UntaggedMsg { - fn response_schemas_impl() -> BTreeMap { + fn response_schemas() -> BTreeMap { BTreeMap::from([ ("balance_for".to_string(), schema_for!(u128)), ("account_id_for".to_string(), schema_for!(u128)), @@ -338,11 +205,22 @@ mod tests { ("extension".to_string(), schema_for!(())), ]) } + + fn response_schemas_cw() -> BTreeMap { + BTreeMap::from([ + ("balance_for".to_string(), schema_of::()), + ("account_id_for".to_string(), schema_of::()), + ("supply".to_string(), schema_of::()), + ("liquidity".to_string(), schema_of::()), + ("account_count".to_string(), schema_of::()), + ("extension".to_string(), schema_of::<()>()), + ]) + } } #[test] fn untagged_msg_works() { - let response_schemas = UntaggedMsg::response_schemas().unwrap(); + let response_schemas = UntaggedMsg::response_schemas(); assert_eq!( response_schemas, BTreeMap::from([ diff --git a/packages/schema/src/remove.rs b/packages/schema/src/remove.rs index 2b7c2359ef..b0a47c7ac8 100644 --- a/packages/schema/src/remove.rs +++ b/packages/schema/src/remove.rs @@ -28,7 +28,7 @@ pub fn remove_schemas(schemas_dir: &path::Path) -> Result<(), io::Error> { ; for file_path in file_paths { - println!("Removing {:?} …", file_path); + println!("Removing {file_path:?} …"); fs::remove_file(file_path)?; } Ok(()) @@ -37,7 +37,6 @@ pub fn remove_schemas(schemas_dir: &path::Path) -> Result<(), io::Error> { #[cfg(test)] mod tests { use super::*; - use std::ffi::OsStr; use std::path::Path; #[test] @@ -60,10 +59,11 @@ mod tests { // invalid UTF-8 #[cfg(any(unix, target_os = "redox"))] { + use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; - let non_hidden = OsStr::from_bytes(&[0x66, 0x6f, 0x80, 0x6f]); // fo�o + let non_hidden = OsStr::from_bytes(&[0x66, 0x6f, 0x80, 0x6f]); // fo�o // spellchecker:disable-line assert!(!is_hidden(Path::new(non_hidden))); - let hidden = OsStr::from_bytes(&[0x2e, 0x66, 0x6f, 0x80, 0x6f]); // .fo�o + let hidden = OsStr::from_bytes(&[0x2e, 0x66, 0x6f, 0x80, 0x6f]); // .fo�o // spellchecker:disable-line assert!(is_hidden(Path::new(hidden))); } } @@ -89,10 +89,11 @@ mod tests { // invalid UTF-8 #[cfg(any(unix, target_os = "redox"))] { + use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; - let non_hidden = OsStr::from_bytes(&[0x66, 0x6f, 0x80, 0x6f]); // fo�o + let non_hidden = OsStr::from_bytes(&[0x66, 0x6f, 0x80, 0x6f]); // fo�o // spellchecker:disable-line assert!(!is_json(Path::new(non_hidden))); - let hidden = OsStr::from_bytes(&[0x66, 0x6f, 0x80, 0x6f, 0x2e, 0x6a, 0x73, 0x6f, 0x6e]); // fo�o.json + let hidden = OsStr::from_bytes(&[0x66, 0x6f, 0x80, 0x6f, 0x2e, 0x6a, 0x73, 0x6f, 0x6e]); // fo�o.json // spellchecker:disable-line assert!(is_json(Path::new(hidden))); } } diff --git a/packages/schema/src/schema_for.rs b/packages/schema/src/schema_for.rs index 5a42fd834b..a8684b5984 100644 --- a/packages/schema/src/schema_for.rs +++ b/packages/schema/src/schema_for.rs @@ -18,9 +18,31 @@ /// ``` #[macro_export] macro_rules! schema_for { - ($type:ty) => { - $crate::schemars::gen::SchemaGenerator::new($crate::schemars::gen::SchemaSettings::draft07()).into_root_schema_for::<$type>() - }; + ($type:ty) => {{ + let mut schema = $crate::schemars::gen::SchemaGenerator::new( + $crate::schemars::gen::SchemaSettings::draft07(), + ) + .into_root_schema_for::<$type>(); + + struct Visitor; + impl $crate::schemars::visit::Visitor for Visitor { + fn visit_schema_object(&mut self, schema: &mut $crate::schemars::schema::SchemaObject) { + $crate::schemars::visit::visit_schema_object(self, schema); + + if let Some(ref mut validation) = schema.object { + if validation.additional_properties.is_some() { + return; + } + + validation.additional_properties = Some(Box::new(false.into())); + } + } + } + + $crate::schemars::visit::visit_root_schema(&mut Visitor, &mut schema); + + schema + }}; ($_:expr) => { compile_error!("The argument to `schema_for!` is not a type.") }; diff --git a/packages/schema/tests/idl.rs b/packages/schema/tests/idl.rs index d6f00d4f57..490b01b9c1 100644 --- a/packages/schema/tests/idl.rs +++ b/packages/schema/tests/idl.rs @@ -1,41 +1,63 @@ use std::collections::HashMap; -use cosmwasm_schema::{generate_api, QueryResponses, IDL_VERSION}; -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; +use cosmwasm_schema::{cw_serde, generate_api, QueryResponses, IDL_VERSION}; use serde_json::Value; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[cw_serde] pub struct InstantiateMsg { pub admin: String, pub cap: u128, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] +#[cw_serde] pub enum ExecuteMsg { Mint { amount: u128 }, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, QueryResponses)] -#[serde(rename_all = "snake_case")] +#[cw_serde] +#[derive(QueryResponses)] pub enum QueryMsg { #[returns(u128)] Balance { account: String }, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -#[serde(rename_all = "snake_case")] +#[cw_serde] pub enum SudoMsg { SetAdmin { new_admin: String }, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[cw_serde] pub struct MigrateMsg { pub admin: String, pub cap: u128, } +#[cw_serde] +pub struct MapMsg { + btree: std::collections::BTreeMap, + hash: std::collections::HashMap, +} + +#[test] +fn assert_maps_generate_correctly() { + let schema = cosmwasm_schema::schema_for!(MapMsg); + insta::assert_json_snapshot!(schema); +} + +#[test] +fn unknown_fields_explicitly_allowed() { + let json = serde_json::json!({ + "admin": "someone", + "cap": 512, + "UNKNOWN_FIELD_DONT_PANIC": "I MEAN IT" + }); + let json_str = serde_json::to_string(&json).unwrap(); + let migrate_msg: MigrateMsg = serde_json::from_str(&json_str).unwrap(); + + assert_eq!(migrate_msg.admin, "someone"); + assert_eq!(migrate_msg.cap, 512); +} + #[test] fn test_basic_structure() { let api_str = generate_api! { @@ -133,15 +155,15 @@ fn test_query_responses() { api.get("responses").unwrap().get("balance").unwrap(); } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, QueryResponses)] -#[serde(rename_all = "snake_case")] +#[cw_serde] +#[derive(QueryResponses)] pub enum QueryMsgWithGenerics { #[returns(u128)] QueryData { data: T }, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, QueryResponses)] -#[serde(rename_all = "snake_case")] +#[cw_serde] +#[derive(QueryResponses)] pub enum QueryMsgWithGenericsAndTraitBounds where T: PartialEq, @@ -150,8 +172,8 @@ where QueryData { data: T }, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, QueryResponses)] -#[serde(rename_all = "snake_case")] +#[cw_serde] +#[derive(QueryResponses)] pub enum QueryMsgWithGenericsAndDefaultType { #[returns(u128)] QueryData { data: T }, @@ -217,7 +239,8 @@ fn test_query_responses_generics_and_trait_bounds() { api.get("responses").unwrap().get("query_data").unwrap(); } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, QueryResponses)] +#[cw_serde] +#[derive(QueryResponses)] #[serde(untagged)] #[query_responses(nested)] pub enum NestedQueryMsg { @@ -225,8 +248,8 @@ pub enum NestedQueryMsg { Sub(SubQueryMsg1), } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, QueryResponses)] -#[serde(rename_all = "snake_case")] +#[cw_serde] +#[derive(QueryResponses)] pub enum SubQueryMsg1 { #[returns(u128)] Variant1 { test: String }, @@ -234,80 +257,45 @@ pub enum SubQueryMsg1 { #[test] fn test_nested_query_responses() { - let api_str = generate_api! { + generate_api! { instantiate: InstantiateMsg, query: NestedQueryMsg, } .render() .to_string() .unwrap(); +} - let api: Value = serde_json::from_str(&api_str).unwrap(); - let queries = api - .get("query") - .unwrap() - .get("anyOf") - .unwrap() - .as_array() - .unwrap(); - let definitions = api.get("query").unwrap().get("definitions").unwrap(); - - // Find the subqueries - assert_eq!(queries.len(), 2); - assert_eq!( - queries[0].get("$ref").unwrap().as_str().unwrap(), - "#/definitions/QueryMsg" - ); - assert_eq!( - queries[1].get("$ref").unwrap().as_str().unwrap(), - "#/definitions/SubQueryMsg1" - ); - let query_msg_queries = definitions - .get("QueryMsg") - .unwrap() - .get("oneOf") - .unwrap() - .as_array() - .unwrap(); - let sub_query_msg_queries = definitions - .get("SubQueryMsg1") - .unwrap() - .get("oneOf") - .unwrap() - .as_array() - .unwrap(); - - // Find "balance" and "variant1" queries in the query schema - assert_eq!( - query_msg_queries[0] - .get("required") - .unwrap() - .get(0) - .unwrap(), - "balance" - ); - assert_eq!( - sub_query_msg_queries[0] - .get("required") - .unwrap() - .get(0) - .unwrap(), - "variant1" - ); +#[cw_serde] +#[derive(QueryResponses)] +#[serde(untagged)] +#[query_responses(nested)] +pub enum NestedQueryMsgGenerics { + /// doc comment + Query(T), + Sub(U), +} - // Find "balance" and "variant1" queries in responses - api.get("responses").unwrap().get("balance").unwrap(); - api.get("responses").unwrap().get("variant1").unwrap(); +#[test] +fn test_nested_query_responses_with_generics() { + generate_api! { + instantiate: InstantiateMsg, + query: NestedQueryMsgGenerics, + } + .render() + .to_string() + .unwrap(); } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, QueryResponses)] -#[serde(rename_all = "snake_case")] +#[cw_serde] +#[derive(QueryResponses)] enum QueryMsg2 { #[returns(u128)] Balance {}, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, QueryResponses)] +#[cw_serde] +#[derive(QueryResponses)] #[query_responses(nested)] enum NestedNameCollision { Q1(QueryMsg), diff --git a/packages/schema/tests/snapshots/idl__assert_maps_generate_correctly.snap b/packages/schema/tests/snapshots/idl__assert_maps_generate_correctly.snap new file mode 100644 index 0000000000..629148a4e5 --- /dev/null +++ b/packages/schema/tests/snapshots/idl__assert_maps_generate_correctly.snap @@ -0,0 +1,32 @@ +--- +source: packages/schema/tests/idl.rs +expression: schema +--- +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MapMsg", + "type": "object", + "required": [ + "btree", + "hash" + ], + "properties": { + "btree": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "hash": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "additionalProperties": false +} diff --git a/packages/std/.cargo/config b/packages/std/.cargo/config deleted file mode 100644 index 7d1a066c82..0000000000 --- a/packages/std/.cargo/config +++ /dev/null @@ -1,5 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -wasm-debug = "build --target wasm32-unknown-unknown" -unit-test = "test --lib" -schema = "run --example schema" diff --git a/packages/std/.cargo/config.toml b/packages/std/.cargo/config.toml new file mode 100644 index 0000000000..b93207d67e --- /dev/null +++ b/packages/std/.cargo/config.toml @@ -0,0 +1,4 @@ +[alias] +wasm = "build --release --lib --target wasm32-unknown-unknown" +wasm-debug = "build --lib --target wasm32-unknown-unknown" +unit-test = "test --lib" diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index 4ca85911bb..645ba4b784 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmwasm-std" -version = "1.1.9" +version = { workspace = true } authors = ["Ethan Frey "] edition = "2021" description = "Standard library for Wasm based smart contracts on Cosmos blockchains" @@ -9,51 +9,83 @@ license = "Apache-2.0" readme = "README.md" [package.metadata.docs.rs] -features = ["stargate", "staking", "ibc3"] +features = ["cosmwasm_3_0", "staking", "stargate", "ibc2"] [features] -default = ["iterator", "abort"] -abort = [] +default = ["exports", "iterator", "std"] +# Enable if this cosmwasm-std is the primary version of cosmwas-std used in the contract. This +# adds exports and imports needed for basic communication between contract and VM. +exports = [] +std = [] # iterator allows us to iterate over all DB items in a given range # optional as some merkle stores (like tries) don't support this # given Ethereum 1.0, 2.0, Substrate, and other major projects use Tries # we keep this optional, to allow possible future integration (or different Cosmos Backends) iterator = [] -# staking exposes bindings to a required staking moudle in the runtime, via new +# staking exposes bindings to a required staking module in the runtime, via new # CosmosMsg types, and new QueryRequest types. This should only be enabled on contracts # that require these types, so other contracts can be used on systems with eg. PoA consensus staking = [] -# backtraces provides much better context at runtime errors (in non-wasm code) -# at the cost of a bit of code size and performance. -# This feature requires Rust nightly because it depends on the unstable backtrace feature. -backtraces = [] # stargate enables stargate-dependent messages and queries, like raw protobuf messages # as well as ibc-related functionality stargate = [] -# ibc3 extends ibc messages with ibc-v3 only features. This should only be enabled on contracts -# that require these types. Without this, they get the smaller ibc-v1 API. -ibc3 = ["stargate"] +# ibc2 enables ibc2-dependent messages, entrypoints and queries +ibc2 = [] # This feature makes `BankQuery::Supply` available for the contract to call, but requires # the host blockchain to run CosmWasm `1.1.0` or higher. cosmwasm_1_1 = [] +# This feature makes `GovMsg::VoteWeighted` available for the contract to call, but requires +# the host blockchain to run CosmWasm `1.2.0` or higher. +cosmwasm_1_2 = ["cosmwasm_1_1"] +# This feature makes `BankQuery::DenomMetadata` available for the contract to call, but requires +# the host blockchain to run CosmWasm `1.3.0` or higher. +cosmwasm_1_3 = ["cosmwasm_1_2"] +# Together with the `iterator` feature this enables additional imports for more +# efficient iteration over DB keys or values. +# It also makes `DistributionQuery::{DelegationRewards, DelegationTotalRewards, DelegatorValidators}` +# available for the contract to call. +# It requires the host blockchain to run CosmWasm `1.4.0` or higher. +cosmwasm_1_4 = ["cosmwasm_1_3"] +# This enables functionality that is only available on 2.0 chains. +# It adds `CosmosMsg::Any`, replacing `CosmosMsg::Stargate`. It also adds `QueryRequest::Grpc`. +cosmwasm_2_0 = ["cosmwasm_1_4"] +# This enables functionality that is only available on 2.1 chains. +# It adds verification and key recovery for the secp256r1 elliptic curve. +cosmwasm_2_1 = ["cosmwasm_2_0"] +# This enables functionality that is only available on 2.2 chains. +# It adds `IbcMsg::PayPacketFee` and `IbcMsg::PayPacketFeeAsync`. +cosmwasm_2_2 = ["cosmwasm_2_1"] +# This enables functionality that is only available on 3.0 chains. +# It adds `WasmQuery::RawRange`. +cosmwasm_3_0 = ["cosmwasm_2_2"] [dependencies] -base64 = "0.13.0" -cosmwasm-derive = { path = "../derive", version = "1.1.9" } -derivative = "2" -forward_ref = "1" +base64 = "0.22.0" +bnum = "0.11.0" +cosmwasm-core = { workspace = true } +cosmwasm-derive = { workspace = true } +cw-schema = { workspace = true } +derive_more = { version = "2.0.1", default-features = false, features = ["debug"] } hex = "0.4" -schemars = "0.8.3" -serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] } -serde-json-wasm = { version = "0.4.1" } -thiserror = "1.0.13" -uint = "0.9.3" +schemars = { workspace = true } +sha2 = "0.10.3" +serde = { workspace = true, features = ["std"] } +serde_json = "1.0.140" +static_assertions = "1.1.0" +thiserror = "1.0.26" +rmp-serde = "1.3.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -cosmwasm-crypto = { path = "../crypto", version = "1.1.9" } +bech32 = "0.11.0" +cosmwasm-crypto = { workspace = true } +rand_core = { version = "0.6.4", features = ["getrandom"] } [dev-dependencies] -cosmwasm-schema = { path = "../schema" } +cosmwasm-core = { workspace = true } +cosmwasm-schema = { workspace = true } # The chrono dependency is only used in an example, which Rust compiles for us. If this causes trouble, remove it. chrono = { version = "0.4", default-features = false, features = ["alloc", "std"] } -hex-literal = "0.3.1" +crc32fast = "1.3.2" +hex-literal = "0.4.1" +paste = "1.0.15" +proptest = { version = "1.5.0", default-features = false, features = ["attr-macro", "std"] } diff --git a/packages/std/examples/schema.rs b/packages/std/examples/schema.rs deleted file mode 100644 index 0fe2eac963..0000000000 --- a/packages/std/examples/schema.rs +++ /dev/null @@ -1,17 +0,0 @@ -use std::env::current_dir; -use std::fs::create_dir_all; - -use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, schema_for}; -use cosmwasm_std::{BlockInfo, CosmosMsg, Empty, QueryRequest, Timestamp}; - -fn main() { - let mut out_dir = current_dir().unwrap(); - out_dir.push("schema"); - create_dir_all(&out_dir).unwrap(); - remove_schemas(&out_dir).unwrap(); - - export_schema(&schema_for!(BlockInfo), &out_dir); - export_schema(&schema_for!(Timestamp), &out_dir); - export_schema_with_title(&schema_for!(CosmosMsg), &out_dir, "CosmosMsg"); - export_schema_with_title(&schema_for!(QueryRequest), &out_dir, "QueryRequest"); -} diff --git a/packages/std/schema/block_info.json b/packages/std/schema/block_info.json deleted file mode 100644 index 2ddc87f0d3..0000000000 --- a/packages/std/schema/block_info.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "BlockInfo", - "type": "object", - "required": [ - "chain_id", - "height", - "time" - ], - "properties": { - "chain_id": { - "type": "string" - }, - "height": { - "description": "The height of a block is the number of blocks preceding it in the blockchain.", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "time": { - "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md), which has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; # extern crate chrono; use chrono::NaiveDateTime; let seconds = env.block.time.seconds(); let nsecs = env.block.time.subsec_nanos(); let dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32); ```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; let millis = env.block.time.nanos() / 1_000_000; ```", - "allOf": [ - { - "$ref": "#/definitions/Timestamp" - } - ] - } - }, - "definitions": { - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } -} diff --git a/packages/std/schema/cosmos_msg.json b/packages/std/schema/cosmos_msg.json deleted file mode 100644 index 8361702ac2..0000000000 --- a/packages/std/schema/cosmos_msg.json +++ /dev/null @@ -1,303 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CosmosMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "bank" - ], - "properties": { - "bank": { - "$ref": "#/definitions/BankMsg" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "custom" - ], - "properties": { - "custom": { - "$ref": "#/definitions/Empty" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "wasm" - ], - "properties": { - "wasm": { - "$ref": "#/definitions/WasmMsg" - } - }, - "additionalProperties": false - } - ], - "definitions": { - "BankMsg": { - "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", - "oneOf": [ - { - "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "send" - ], - "properties": { - "send": { - "type": "object", - "required": [ - "amount", - "to_address" - ], - "properties": { - "amount": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "to_address": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", - "type": "object", - "required": [ - "burn" - ], - "properties": { - "burn": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - } - } - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", - "type": "string" - }, - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - }, - "WasmMsg": { - "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", - "oneOf": [ - { - "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "execute" - ], - "properties": { - "execute": { - "type": "object", - "required": [ - "contract_addr", - "funds", - "msg" - ], - "properties": { - "contract_addr": { - "type": "string" - }, - "funds": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "msg": { - "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "instantiate" - ], - "properties": { - "instantiate": { - "type": "object", - "required": [ - "code_id", - "funds", - "label", - "msg" - ], - "properties": { - "admin": { - "type": [ - "string", - "null" - ] - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "funds": { - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "label": { - "description": "A human-readbale label for the contract", - "type": "string" - }, - "msg": { - "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", - "type": "object", - "required": [ - "migrate" - ], - "properties": { - "migrate": { - "type": "object", - "required": [ - "contract_addr", - "msg", - "new_code_id" - ], - "properties": { - "contract_addr": { - "type": "string" - }, - "msg": { - "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - }, - "new_code_id": { - "description": "the code_id of the new logic to place in the given contract", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", - "type": "object", - "required": [ - "update_admin" - ], - "properties": { - "update_admin": { - "type": "object", - "required": [ - "admin", - "contract_addr" - ], - "properties": { - "admin": { - "type": "string" - }, - "contract_addr": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", - "type": "object", - "required": [ - "clear_admin" - ], - "properties": { - "clear_admin": { - "type": "object", - "required": [ - "contract_addr" - ], - "properties": { - "contract_addr": { - "type": "string" - } - } - } - }, - "additionalProperties": false - } - ] - } - } -} diff --git a/packages/std/schema/query_request.json b/packages/std/schema/query_request.json deleted file mode 100644 index 5653739422..0000000000 --- a/packages/std/schema/query_request.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "QueryRequest", - "oneOf": [ - { - "type": "object", - "required": [ - "bank" - ], - "properties": { - "bank": { - "$ref": "#/definitions/BankQuery" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "custom" - ], - "properties": { - "custom": { - "$ref": "#/definitions/Empty" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "wasm" - ], - "properties": { - "wasm": { - "$ref": "#/definitions/WasmQuery" - } - }, - "additionalProperties": false - } - ], - "definitions": { - "BankQuery": { - "oneOf": [ - { - "description": "This calls into the native bank module for querying the total supply of one denomination. It does the same as the SupplyOf call in Cosmos SDK's RPC API. Return value is of type SupplyResponse.", - "type": "object", - "required": [ - "supply" - ], - "properties": { - "supply": { - "type": "object", - "required": [ - "denom" - ], - "properties": { - "denom": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "This calls into the native bank module for one denomination Return value is BalanceResponse", - "type": "object", - "required": [ - "balance" - ], - "properties": { - "balance": { - "type": "object", - "required": [ - "address", - "denom" - ], - "properties": { - "address": { - "type": "string" - }, - "denom": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "This calls into the native bank module for all denominations. Note that this may be much more expensive than Balance and should be avoided if possible. Return value is AllBalanceResponse.", - "type": "object", - "required": [ - "all_balances" - ], - "properties": { - "all_balances": { - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "type": "string" - } - } - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", - "type": "string" - }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - }, - "WasmQuery": { - "oneOf": [ - { - "description": "this queries the public API of another contract at a known address (with known ABI) Return value is whatever the contract returns (caller should know), wrapped in a ContractResult that is JSON encoded.", - "type": "object", - "required": [ - "smart" - ], - "properties": { - "smart": { - "type": "object", - "required": [ - "contract_addr", - "msg" - ], - "properties": { - "contract_addr": { - "type": "string" - }, - "msg": { - "description": "msg is the json-encoded QueryMsg struct", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - } - } - }, - "additionalProperties": false - }, - { - "description": "this queries the raw kv-store of the contract. returns the raw, unparsed data stored at that key, which may be an empty vector if not present", - "type": "object", - "required": [ - "raw" - ], - "properties": { - "raw": { - "type": "object", - "required": [ - "contract_addr", - "key" - ], - "properties": { - "contract_addr": { - "type": "string" - }, - "key": { - "description": "Key is the raw key used in the contracts Storage", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - } - } - }, - "additionalProperties": false - }, - { - "description": "returns a ContractInfoResponse with metadata on the contract from the runtime", - "type": "object", - "required": [ - "contract_info" - ], - "properties": { - "contract_info": { - "type": "object", - "required": [ - "contract_addr" - ], - "properties": { - "contract_addr": { - "type": "string" - } - } - } - }, - "additionalProperties": false - } - ] - } - } -} diff --git a/packages/std/schema/timestamp.json b/packages/std/schema/timestamp.json deleted file mode 100644 index 6dd9971a14..0000000000 --- a/packages/std/schema/timestamp.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Timestamp", - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ], - "definitions": { - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } -} diff --git a/packages/std/src/__internal.rs b/packages/std/src/__internal.rs new file mode 100644 index 0000000000..6df23be4fb --- /dev/null +++ b/packages/std/src/__internal.rs @@ -0,0 +1,9 @@ +//! +//! # ⚠ DO NOT DEPEND ON THIS AS AN OUTSIDE CONSUMER +//! +//! **THIS MODULE IS SEMVER EXEMPT AND ONLY MEANT TO SHARE TYPES BETWEEN CORE AND STD** +//! +//! Module for re-exporting implementation details from `core` to `std` +//! + +pub use crate::__internal__forward_ref_partial_eq as forward_ref_partial_eq; diff --git a/packages/std/src/addresses.rs b/packages/std/src/addresses.rs index ef03d5ab60..f76a4d00d8 100644 --- a/packages/std/src/addresses.rs +++ b/packages/std/src/addresses.rs @@ -1,10 +1,14 @@ -use schemars::JsonSchema; +use alloc::{borrow::Cow, string::String, vec::Vec}; +use core::fmt; +use core::ops::Deref; use serde::{Deserialize, Serialize}; -use std::borrow::Cow; -use std::fmt; -use std::ops::Deref; +use sha2::{ + digest::{Digest, Update}, + Sha256, +}; -use crate::{binary::Binary, HexBinary}; +use crate::Binary; +use crate::{HexBinary, __internal::forward_ref_partial_eq}; /// A human readable address. /// @@ -23,10 +27,23 @@ use crate::{binary::Binary, HexBinary}; /// a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` /// instance. #[derive( - Serialize, Deserialize, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, JsonSchema, + Serialize, + Deserialize, + Clone, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + Hash, + schemars::JsonSchema, + cw_schema::Schemaifier, )] +#[schemaifier(type = cw_schema::NodeType::Address)] pub struct Addr(String); +forward_ref_partial_eq!(Addr, Addr); + impl Addr { /// Creates a new `Addr` instance from the given input without checking the validity /// of the input. Since `Addr` must always contain valid addresses, the caller is @@ -41,7 +58,7 @@ impl Addr { /// ``` /// # use cosmwasm_std::{Addr}; /// let address = Addr::unchecked("foobar"); - /// assert_eq!(address, "foobar"); + /// assert_eq!(address.as_str(), "foobar"); /// ``` pub fn unchecked(input: impl Into) -> Addr { Addr(input.into()) @@ -80,34 +97,6 @@ impl AsRef for Addr { } } -/// Implement `Addr == &str` -impl PartialEq<&str> for Addr { - fn eq(&self, rhs: &&str) -> bool { - self.0 == *rhs - } -} - -/// Implement `&str == Addr` -impl PartialEq for &str { - fn eq(&self, rhs: &Addr) -> bool { - *self == rhs.0 - } -} - -/// Implement `Addr == String` -impl PartialEq for Addr { - fn eq(&self, rhs: &String) -> bool { - &self.0 == rhs - } -} - -/// Implement `String == Addr` -impl PartialEq for String { - fn eq(&self, rhs: &Addr) -> bool { - self == &rhs.0 - } -} - // Addr->String is a safe conversion. // However, the opposite direction is unsafe and must not be implemented. @@ -148,10 +137,10 @@ impl<'a> From<&'a Addr> for Cow<'a, Addr> { /// /// The safe way to obtain a valid `CanonicalAddr` is using `Api::addr_canonicalize`. In /// addition to that there are many unsafe ways to convert any binary data into an instance. -/// So the type shoud be treated as a marker to express the intended data type, not as +/// So the type should be treated as a marker to express the intended data type, not as /// a validity guarantee of any sort. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash, JsonSchema)] -pub struct CanonicalAddr(pub Binary); +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash, schemars::JsonSchema)] +pub struct CanonicalAddr(Binary); /// Implement `CanonicalAddr == Binary` impl PartialEq for CanonicalAddr { @@ -265,18 +254,166 @@ impl CanonicalAddr { impl fmt::Display for CanonicalAddr { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for byte in self.0.as_slice() { - write!(f, "{:02X}", byte)?; + write!(f, "{byte:02X}")?; } Ok(()) } } +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +pub enum Instantiate2AddressError { + /// Checksum must be 32 bytes + InvalidChecksumLength, + /// Salt must be between 1 and 64 bytes + InvalidSaltLength, +} + +impl fmt::Display for Instantiate2AddressError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Instantiate2AddressError::InvalidChecksumLength => write!(f, "invalid checksum length"), + Instantiate2AddressError::InvalidSaltLength => write!(f, "invalid salt length"), + } + } +} + +/// Creates a contract address using the predictable address format introduced with +/// wasmd 0.29. When using instantiate2, this is a way to precompute the address. +/// When using instantiate, the contract address will use a different algorithm and +/// cannot be pre-computed as it contains inputs from the chain's state at the time of +/// message execution. +/// +/// The predictable address format of instantiate2 is stable. But bear in mind this is +/// a powerful tool that requires multiple software components to work together smoothly. +/// It should be used carefully and tested thoroughly to avoid the loss of funds. +/// +/// This method operates on [`CanonicalAddr`] to be implemented without chain interaction. +/// The typical usage looks like this: +/// +/// ``` +/// # use cosmwasm_std::{ +/// # HexBinary, +/// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, +/// # Response, QueryResponse, +/// # }; +/// # type ExecuteMsg = (); +/// use cosmwasm_std::instantiate2_address; +/// +/// #[entry_point] +/// pub fn execute( +/// deps: DepsMut, +/// env: Env, +/// info: MessageInfo, +/// msg: ExecuteMsg, +/// ) -> Result { +/// let canonical_creator = deps.api.addr_canonicalize(env.contract.address.as_str())?; +/// let checksum = HexBinary::from_hex("9af782a3a1bcbcd22dbb6a45c751551d9af782a3a1bcbcd22dbb6a45c751551d")?; +/// let salt = b"instance 1231"; +/// let canonical_addr = instantiate2_address(&checksum, &canonical_creator, salt)?; +/// let addr = deps.api.addr_humanize(&canonical_addr)?; +/// +/// # Ok(Default::default()) +/// } +/// ``` +pub fn instantiate2_address( + checksum: &[u8], + creator: &CanonicalAddr, + salt: &[u8], +) -> Result { + // Non-empty msg values are discouraged. + // See https://medium.com/cosmwasm/dev-note-3-limitations-of-instantiate2-and-how-to-deal-with-them-a3f946874230. + let msg = b""; + let len = 32; + instantiate2_address_impl(checksum, creator, salt, msg, len) +} + +/// The instantiate2 address derivation implementation. This API is used for +/// testing purposes only. The `msg` field is discouraged and should not be used. +/// Use [`instantiate2_address`]. +/// +/// `len` is the address length on bytes. The resulting address data will be truncated to +/// that length. A value > 32 is invalid because [`hash`] returns only 32 bytes of data. +/// A value of 0 is considered invalid because it indicates a bug. +/// For ADR-028 compatibility, 32 must be used. +/// However, some chains use 20 for compatibility with the Ethereum ecosystem. +/// Using any other value than 32 requires a coordination with the chain implementation. +/// See also . +/// +/// ## Examples +/// +/// ``` +/// use cosmwasm_std::{instantiate2_address_impl, CanonicalAddr, HexBinary, Instantiate2AddressError}; +/// +/// fn instantiate2_address_evm_compatible( +/// checksum: &[u8], +/// creator: &CanonicalAddr, +/// salt: &[u8], +/// ) -> Result { +/// instantiate2_address_impl(checksum, creator, salt, b"", 20) +/// } +/// +/// let checksum = HexBinary::from_hex("13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5").unwrap(); +/// let creator = CanonicalAddr::from(HexBinary::from_hex("9999999999aaaaaaaaaabbbbbbbbbbcccccccccc").unwrap()); +/// let salt = b"\x61"; +/// +/// let address = instantiate2_address_evm_compatible(&checksum, &creator, salt).unwrap(); +/// assert_eq!(address, HexBinary::from_hex("5e865d3e45ad3e961f77fd77d46543417ced44d9").unwrap()); +/// ``` +#[doc(hidden)] +#[inline] // Only call this through a wrapper like instantiate2_address or a custom instantiate2_address_evm_compatible +pub fn instantiate2_address_impl( + checksum: &[u8], + creator: &CanonicalAddr, + salt: &[u8], + msg: &[u8], + len: usize, +) -> Result { + if checksum.len() != 32 { + return Err(Instantiate2AddressError::InvalidChecksumLength); + } + + if salt.is_empty() || salt.len() > 64 { + return Err(Instantiate2AddressError::InvalidSaltLength); + }; + + let mut key = Vec::::new(); + key.extend_from_slice(b"wasm\0"); + key.extend_from_slice(&(checksum.len() as u64).to_be_bytes()); + key.extend_from_slice(checksum); + key.extend_from_slice(&(creator.len() as u64).to_be_bytes()); + key.extend_from_slice(creator); + key.extend_from_slice(&(salt.len() as u64).to_be_bytes()); + key.extend_from_slice(salt); + key.extend_from_slice(&(msg.len() as u64).to_be_bytes()); + key.extend_from_slice(msg); + let mut address_data = hash("module", &key); + + // Use the first `len` bytes + // Fingers crossed Rust can optimize this whole block out in the default case (32), because otherwise + // truncate will do a resize for len == address_data.len(), see https://github.com/rust-lang/rust/issues/76089 + if len != 32 { + debug_assert!(len <= 32); + debug_assert!(len > 0); + address_data.truncate(len); + } + + Ok(address_data.into()) +} + +/// The "Basic Address" Hash from +/// https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/docs/architecture/adr-028-public-key-addresses.md +fn hash(ty: &str, key: &[u8]) -> Vec { + let inner = Sha256::digest(ty.as_bytes()); + Sha256::new().chain(inner).chain(key).finalize().to_vec() +} + #[cfg(test)] mod tests { use super::*; - use std::collections::hash_map::DefaultHasher; - use std::collections::HashSet; - use std::hash::{Hash, Hasher}; + use crate::assert_hash_works; + use crate::HexBinary; + + use hex_literal::hex; #[test] fn addr_unchecked_works() { @@ -305,7 +442,7 @@ mod tests { #[test] fn addr_implements_display() { let addr = Addr::unchecked("cos934gh9034hg04g0h134"); - let embedded = format!("Address: {}", addr); + let embedded = format!("Address: {addr}"); assert_eq!(embedded, "Address: cos934gh9034hg04g0h134"); assert_eq!(addr.to_string(), "cos934gh9034hg04g0h134"); } @@ -317,23 +454,17 @@ mod tests { } #[test] - fn addr_implements_partial_eq_with_str() { - let addr = Addr::unchecked("cos934gh9034hg04g0h134"); - - // `Addr == &str` - assert_eq!(addr, "cos934gh9034hg04g0h134"); - // `&str == Addr` - assert_eq!("cos934gh9034hg04g0h134", addr); - } - - #[test] - fn addr_implements_partial_eq_with_string() { + fn addr_implements_partial_eq_addr_ref() { let addr = Addr::unchecked("cos934gh9034hg04g0h134"); + let addr_ref = &addr; + let addr_ref2 = &addr; - // `Addr == String` - assert_eq!(addr, String::from("cos934gh9034hg04g0h134")); - // `String == Addr` - assert_eq!(String::from("cos934gh9034hg04g0h134"), addr); + // `Addr == &Addr` + assert_eq!(addr, addr_ref); + // `&Addr == Addr` + assert_eq!(addr_ref, addr); + // `&Addr == &Addr` + assert_eq!(addr_ref, addr_ref2); } #[test] @@ -407,26 +538,34 @@ mod tests { let original_ptr = original.as_ptr(); let addr: CanonicalAddr = original.into(); assert_eq!(addr.as_slice(), [0u8, 187, 61, 11, 250, 0]); - assert_eq!((addr.0).0.as_ptr(), original_ptr, "must not be copied"); + assert_eq!( + (addr.0).as_slice().as_ptr(), + original_ptr, + "must not be copied" + ); // From> for CanonicalAddr let original = vec![0u8, 187, 61, 11, 250, 0]; let original_ptr = original.as_ptr(); let addr = CanonicalAddr::from(original); assert_eq!(addr.as_slice(), [0u8, 187, 61, 11, 250, 0]); - assert_eq!((addr.0).0.as_ptr(), original_ptr, "must not be copied"); + assert_eq!( + (addr.0).as_slice().as_ptr(), + original_ptr, + "must not be copied" + ); // Into> for CanonicalAddr // This test is a bit pointless because we get Into from the From implementation let original = CanonicalAddr::from(vec![0u8, 187, 61, 11, 250, 0]); - let original_ptr = (original.0).0.as_ptr(); + let original_ptr = (original.0).as_slice().as_ptr(); let vec: Vec = original.into(); assert_eq!(vec.as_slice(), [0u8, 187, 61, 11, 250, 0]); assert_eq!(vec.as_ptr(), original_ptr, "must not be copied"); // From for Vec let original = CanonicalAddr::from(vec![7u8, 35, 49, 101, 0, 255]); - let original_ptr = (original.0).0.as_ptr(); + let original_ptr = (original.0).as_slice().as_ptr(); let vec = Vec::::from(original); assert_eq!(vec.as_slice(), [7u8, 35, 49, 101, 0, 255]); assert_eq!(vec.as_ptr(), original_ptr, "must not be copied"); @@ -439,11 +578,15 @@ mod tests { let original_ptr = original.as_ptr(); let addr = CanonicalAddr::from(original); assert_eq!(addr.as_slice(), [0u8, 187, 61, 11, 250, 0]); - assert_eq!((addr.0).0.as_ptr(), original_ptr, "must not be copied"); + assert_eq!( + (addr.0).as_slice().as_ptr(), + original_ptr, + "must not be copied" + ); // From for Binary let original = CanonicalAddr::from(vec![7u8, 35, 49, 101, 0, 255]); - let original_ptr = (original.0).0.as_ptr(); + let original_ptr = (original.0).as_slice().as_ptr(); let bin = Binary::from(original); assert_eq!(bin.as_slice(), [7u8, 35, 49, 101, 0, 255]); assert_eq!(bin.as_ptr(), original_ptr, "must not be copied"); @@ -456,11 +599,15 @@ mod tests { let original_ptr = original.as_ptr(); let addr = CanonicalAddr::from(original); assert_eq!(addr.as_slice(), [0u8, 187, 61, 11, 250, 0]); - assert_eq!((addr.0).0.as_ptr(), original_ptr, "must not be copied"); + assert_eq!( + (addr.0).as_slice().as_ptr(), + original_ptr, + "must not be copied" + ); // From for HexBinary let original = CanonicalAddr::from(vec![7u8, 35, 49, 101, 0, 255]); - let original_ptr = (original.0).0.as_ptr(); + let original_ptr = (original.0).as_slice().as_ptr(); let bin = HexBinary::from(original); assert_eq!(bin.as_slice(), [7u8, 35, 49, 101, 0, 255]); assert_eq!(bin.as_ptr(), original_ptr, "must not be copied"); @@ -492,7 +639,7 @@ mod tests { 0xff, ]; let address = CanonicalAddr::from(bytes); - let embedded = format!("Address: {}", address); + let embedded = format!("Address: {address}"); assert_eq!(embedded, "Address: 1203AB00FF"); assert_eq!(address.to_string(), "1203AB00FF"); } @@ -512,43 +659,13 @@ mod tests { assert_eq!(canonical_addr_slice, &[0u8, 187, 61, 11, 250, 0]); } + /// Tests that `CanonicalAddr` implements `EQ` and `Hash` correctly and thus + /// can be used with hash maps and sets. #[test] - fn canonical_addr_implements_hash() { - let alice1 = CanonicalAddr::from([0, 187, 61, 11, 250, 0]); - let mut hasher = DefaultHasher::new(); - alice1.hash(&mut hasher); - let alice1_hash = hasher.finish(); - - let alice2 = CanonicalAddr::from([0, 187, 61, 11, 250, 0]); - let mut hasher = DefaultHasher::new(); - alice2.hash(&mut hasher); - let alice2_hash = hasher.finish(); - + fn canonical_addr_implements_hash_eq() { + let alice = CanonicalAddr::from([0, 187, 61, 11, 250, 0]); let bob = CanonicalAddr::from([16, 21, 33, 0, 255, 9]); - let mut hasher = DefaultHasher::new(); - bob.hash(&mut hasher); - let bob_hash = hasher.finish(); - - assert_eq!(alice1_hash, alice2_hash); - assert_ne!(alice1_hash, bob_hash); - } - - /// This requires Hash and Eq to be implemented - #[test] - fn canonical_addr_can_be_used_in_hash_set() { - let alice1 = CanonicalAddr::from([0, 187, 61, 11, 250, 0]); - let alice2 = CanonicalAddr::from([0, 187, 61, 11, 250, 0]); - let bob = CanonicalAddr::from([16, 21, 33, 0, 255, 9]); - - let mut set = HashSet::new(); - set.insert(alice1.clone()); - set.insert(alice2.clone()); - set.insert(bob.clone()); - assert_eq!(set.len(), 2); - - let set1 = HashSet::::from_iter(vec![bob.clone(), alice1.clone()]); - let set2 = HashSet::from_iter(vec![alice1, alice2, bob]); - assert_eq!(set1, set2); + assert_hash_works!(alice, bob); } // helper to show we can handle Addr and &Addr equally @@ -567,4 +684,223 @@ mod tests { // pass by value assert_eq!(value, &flexible(addr)); } + + #[test] + fn instantiate2_address_impl_works() { + let checksum1 = + HexBinary::from_hex("13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5") + .unwrap(); + let creator1 = CanonicalAddr::from(hex!("9999999999aaaaaaaaaabbbbbbbbbbcccccccccc")); + let salt1 = hex!("61"); + let salt2 = hex!("aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae"); + let msg1: &[u8] = b""; + let msg2: &[u8] = b"{}"; + let msg3: &[u8] = b"{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}"; + + // No msg + let expected = CanonicalAddr::from(hex!( + "5e865d3e45ad3e961f77fd77d46543417ced44d924dc3e079b5415ff6775f847" + )); + assert_eq!( + instantiate2_address_impl(&checksum1, &creator1, &salt1, msg1, 32).unwrap(), + expected + ); + + // With msg + let expected = CanonicalAddr::from(hex!( + "0995499608947a5281e2c7ebd71bdb26a1ad981946dad57f6c4d3ee35de77835" + )); + assert_eq!( + instantiate2_address_impl(&checksum1, &creator1, &salt1, msg2, 32).unwrap(), + expected + ); + + // Long msg + let expected = CanonicalAddr::from(hex!( + "83326e554723b15bac664ceabc8a5887e27003abe9fbd992af8c7bcea4745167" + )); + assert_eq!( + instantiate2_address_impl(&checksum1, &creator1, &salt1, msg3, 32).unwrap(), + expected + ); + + // Long salt + let expected = CanonicalAddr::from(hex!( + "9384c6248c0bb171e306fd7da0993ec1e20eba006452a3a9e078883eb3594564" + )); + assert_eq!( + instantiate2_address_impl(&checksum1, &creator1, &salt2, b"", 32).unwrap(), + expected + ); + + // Salt too short or too long + let empty = Vec::::new(); + assert!(matches!( + instantiate2_address_impl(&checksum1, &creator1, &empty, b"", 32).unwrap_err(), + Instantiate2AddressError::InvalidSaltLength + )); + let too_long = vec![0x11; 65]; + assert!(matches!( + instantiate2_address_impl(&checksum1, &creator1, &too_long, b"", 32).unwrap_err(), + Instantiate2AddressError::InvalidSaltLength + )); + + // invalid checksum length + let broken_cs = hex!("13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2"); + assert!(matches!( + instantiate2_address_impl(&broken_cs, &creator1, &salt1, b"", 32).unwrap_err(), + Instantiate2AddressError::InvalidChecksumLength + )); + let broken_cs = hex!(""); + assert!(matches!( + instantiate2_address_impl(&broken_cs, &creator1, &salt1, b"", 32).unwrap_err(), + Instantiate2AddressError::InvalidChecksumLength + )); + let broken_cs = hex!("13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2aaaa"); + assert!(matches!( + instantiate2_address_impl(&broken_cs, &creator1, &salt1, b"", 32).unwrap_err(), + Instantiate2AddressError::InvalidChecksumLength + )); + } + + #[test] + fn instantiate2_address_impl_truncates_address_data_to_first_len_bytes() { + // test data from above + let checksum = + HexBinary::from_hex("13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5") + .unwrap(); + let creator = CanonicalAddr::from(hex!("9999999999aaaaaaaaaabbbbbbbbbbcccccccccc")); + let salt = hex!("61"); + + let data = [ + ( + 32, + "5e865d3e45ad3e961f77fd77d46543417ced44d924dc3e079b5415ff6775f847", + ), + ( + 31, + "5e865d3e45ad3e961f77fd77d46543417ced44d924dc3e079b5415ff6775f8", + ), + ( + 30, + "5e865d3e45ad3e961f77fd77d46543417ced44d924dc3e079b5415ff6775", + ), + (21, "5e865d3e45ad3e961f77fd77d46543417ced44d924"), + (20, "5e865d3e45ad3e961f77fd77d46543417ced44d9"), + (19, "5e865d3e45ad3e961f77fd77d46543417ced44"), + (16, "5e865d3e45ad3e961f77fd77d4654341"), + (8, "5e865d3e45ad3e96"), + (1, "5e"), + ]; + + for (len, expected) in data { + let expected = CanonicalAddr::from(HexBinary::from_hex(expected).unwrap()); + assert_eq!( + instantiate2_address_impl(&checksum, &creator, &salt, b"", len).unwrap(), + expected + ); + } + } + + #[test] + fn instantiate2_address_impl_matches_wasmd_for_len_24() { + // Manual test data generated with wasmd and bech32 CLI as follows + // 1. Install https://github.com/cmoog/bech32 + // 2. Check out wasmd main and change to `var ContractAddrLen = 24` + // 3. Run `make build` + // 4. Run `./build/wasmd q wasm build-address 1122112211221122112211221122112211221122112211221122112211221122 wasm1xvenxvenxvenxvenxvenxvenxvenxvenkz5vxp aabbaabb | bech32 -d | xxd -p` + + let checksum = + HexBinary::from_hex("1122112211221122112211221122112211221122112211221122112211221122") + .unwrap(); + let creator = CanonicalAddr::from(hex!("3333333333333333333333333333333333333333")); + let salt = hex!("aabbaabb"); + + let expected = + CanonicalAddr::from(hex!["da1aaec9d0ddc75b873079eb1b4f7ddd73a0e3170225fec4"]); + assert_eq!( + instantiate2_address_impl(&checksum, &creator, &salt, b"", 24).unwrap(), + expected + ); + } + + #[test] + fn instantiate2_address_impl_works_for_cosmjs_test_vectors() { + // Test data from https://github.com/cosmos/cosmjs/pull/1253 + const COSMOS_ED25519_TESTS_JSON: &str = "./testdata/instantiate2_addresses.json"; + + #[derive(Deserialize, Debug)] + #[serde(rename_all = "camelCase")] + #[allow(dead_code)] + struct In { + checksum: HexBinary, + creator: String, + creator_data: HexBinary, + salt: HexBinary, + msg: Option, + } + + #[derive(Deserialize, Debug)] + #[serde(rename_all = "camelCase")] + #[allow(dead_code)] + struct Intermediate { + key: HexBinary, + address_data: HexBinary, + } + + #[derive(Deserialize, Debug)] + #[serde(rename_all = "camelCase")] + #[allow(dead_code)] + struct Out { + address: String, + } + + #[derive(Deserialize, Debug)] + #[allow(dead_code)] + struct Row { + #[serde(rename = "in")] + input: In, + intermediate: Intermediate, + out: Out, + } + + fn read_tests() -> Vec { + use std::fs::File; + use std::io::BufReader; + + // Open the file in read-only mode with buffer. + let file = File::open(COSMOS_ED25519_TESTS_JSON).unwrap(); + let reader = BufReader::new(file); + + serde_json::from_reader(reader).unwrap() + } + + for Row { + input, + intermediate, + out: _, + } in read_tests() + { + let msg = input.msg.map(|msg| msg.into_bytes()).unwrap_or_default(); + let addr = instantiate2_address_impl( + &input.checksum, + &input.creator_data.into(), + &input.salt, + &msg, + 32, + ) + .unwrap(); + assert_eq!(addr, intermediate.address_data); + } + } + + #[test] + fn hash_works() { + // Test case from https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-alpha1/types/address/hash_test.go#L19-L24 + let expected = [ + 195, 235, 23, 251, 9, 99, 177, 195, 81, 122, 182, 124, 36, 113, 245, 156, 76, 188, 221, + 83, 181, 192, 227, 82, 100, 177, 161, 133, 240, 160, 5, 25, + ]; + assert_eq!(hash("1", &[1]), expected); + } } diff --git a/packages/std/src/assertions.rs b/packages/std/src/assertions.rs index bc67312b71..d97991a8e5 100644 --- a/packages/std/src/assertions.rs +++ b/packages/std/src/assertions.rs @@ -30,7 +30,7 @@ macro_rules! ensure { ($cond:expr, $e:expr) => { if !($cond) { - return Err(std::convert::From::from($e)); + return Err(core::convert::From::from($e)); } }; } @@ -45,12 +45,12 @@ macro_rules! ensure { /// # Unauthorized {}, /// # } /// # struct Config { -/// # admin: String, +/// # admin: Addr, /// # } /// # /// # fn body() -> Result<(), ContractError> { /// # let info = MessageInfo { sender: Addr::unchecked("foo"), funds: Vec::new() }; -/// # let cfg = Config { admin: "foo".to_string() }; +/// # let cfg = Config { admin: Addr::unchecked("foo") }; /// use cosmwasm_std::ensure_eq; /// /// ensure_eq!(info.sender, cfg.admin, ContractError::Unauthorized {}); @@ -68,7 +68,7 @@ macro_rules! ensure_eq { ($a:expr, $b:expr, $e:expr) => { // Not implemented via `ensure!` because the caller would have to import both macros. if !($a == $b) { - return Err(std::convert::From::from($e)); + return Err(core::convert::From::from($e)); } }; } @@ -100,24 +100,24 @@ macro_rules! ensure_ne { ($a:expr, $b:expr, $e:expr) => { // Not implemented via `ensure!` because the caller would have to import both macros. if !($a != $b) { - return Err(std::convert::From::from($e)); + return Err(core::convert::From::from($e)); } }; } #[cfg(test)] mod tests { - use crate::StdError; + use crate::{errors::ErrorKind, StdError}; #[test] fn ensure_works() { fn check(a: usize, b: usize) -> Result<(), StdError> { - ensure!(a == b, StdError::generic_err("foobar")); + ensure!(a == b, StdError::msg("foobar")); Ok(()) } let err = check(5, 6).unwrap_err(); - assert!(matches!(err, StdError::GenericErr { .. })); + assert!(matches!(err.kind(), ErrorKind::Other)); check(5, 5).unwrap(); } @@ -125,12 +125,12 @@ mod tests { #[test] fn ensure_can_infer_error_type() { let check = |a, b| { - ensure!(a == b, StdError::generic_err("foobar")); + ensure!(a == b, StdError::msg("foobar")); Ok(()) }; - let err = check(5, 6).unwrap_err(); - assert!(matches!(err, StdError::GenericErr { .. })); + let err: StdError = check(5, 6).unwrap_err(); + assert!(matches!(err.kind(), ErrorKind::Other)); check(5, 5).unwrap(); } @@ -147,7 +147,7 @@ mod tests { } fn check(a: usize, b: usize) -> Result<(), ContractError> { - ensure!(a == b, StdError::generic_err("foobar")); + ensure!(a == b, StdError::msg("foobar")); Ok(()) } @@ -160,12 +160,12 @@ mod tests { #[test] fn ensure_eq_works() { let check = |a, b| { - ensure_eq!(a, b, StdError::generic_err("foobar")); + ensure_eq!(a, b, StdError::msg("foobar")); Ok(()) }; - let err = check("123", "456").unwrap_err(); - assert!(matches!(err, StdError::GenericErr { .. })); + let err: StdError = check("123", "456").unwrap_err(); + assert!(matches!(err.kind(), ErrorKind::Other)); check("123", "123").unwrap(); } @@ -176,7 +176,7 @@ mod tests { #[allow(clippy::nonminimal_bool)] fn check() -> Result<(), StdError> { - ensure_eq!(true || false, false, StdError::generic_err("foobar")); + ensure_eq!(true || false, false, StdError::msg("foobar")); Ok(()) } @@ -186,12 +186,12 @@ mod tests { #[test] fn ensure_ne_works() { let check = |a, b| { - ensure_ne!(a, b, StdError::generic_err("foobar")); + ensure_ne!(a, b, StdError::msg("foobar")); Ok(()) }; - let err = check("123", "123").unwrap_err(); - assert!(matches!(err, StdError::GenericErr { .. })); + let err: StdError = check("123", "123").unwrap_err(); + assert!(matches!(err.kind(), ErrorKind::Other)); check("123", "456").unwrap(); } @@ -202,7 +202,7 @@ mod tests { #[allow(clippy::nonminimal_bool)] fn check() -> Result<(), StdError> { - ensure_ne!(true || false, false, StdError::generic_err("foobar")); + ensure_ne!(true || false, false, StdError::msg("foobar")); Ok(()) } diff --git a/packages/std/src/binary.rs b/packages/std/src/binary.rs index 4ee4b253fb..e921c3e455 100644 --- a/packages/std/src/binary.rs +++ b/packages/std/src/binary.rs @@ -1,31 +1,49 @@ -use std::fmt; -use std::ops::Deref; +use alloc::{string::String, vec::Vec}; +use core::fmt; +use core::ops::Deref; -use schemars::JsonSchema; use serde::{de, ser, Deserialize, Deserializer, Serialize}; -use crate::errors::{StdError, StdResult}; +use crate::{ + encoding::{from_base64, to_base64}, + errors::{ErrorKind, StdError, StdResult}, +}; /// Binary is a wrapper around Vec to add base64 de/serialization /// with serde. It also adds some helper methods to help encode inline. /// /// This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. /// See also . -#[derive(Clone, Default, PartialEq, Eq, Hash, PartialOrd, Ord, JsonSchema)] -pub struct Binary(#[schemars(with = "String")] pub Vec); +#[derive( + Clone, + Default, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Binary)] +pub struct Binary(#[schemars(with = "String")] Vec); impl Binary { + /// Creates a new `Binary` containing the given data. + pub const fn new(data: Vec) -> Self { + Self(data) + } + /// take an (untrusted) string and decode it into bytes. /// fails if it is not valid base64 pub fn from_base64(encoded: &str) -> StdResult { - let binary = base64::decode(encoded).map_err(StdError::invalid_base64)?; - Ok(Binary(binary)) + from_base64(encoded).map(Self::new) } /// encode to base64 string (guaranteed to be success as we control the data inside). /// this returns normalized form (with trailing = if needed) pub fn to_base64(&self) -> String { - base64::encode(&self.0) + to_base64(&self.0) } pub fn as_slice(&self) -> &[u8] { @@ -55,13 +73,26 @@ impl Binary { /// ``` pub fn to_array(&self) -> StdResult<[u8; LENGTH]> { if self.len() != LENGTH { - return Err(StdError::invalid_data_size(LENGTH, self.len())); + return Err(StdError::msg(format_args!( + "invalid length. expected {LENGTH}, got {}", + self.len() + ))); } let mut out: [u8; LENGTH] = [0; LENGTH]; out.copy_from_slice(&self.0); Ok(out) } + + pub fn from_hex(input: &str) -> StdResult { + let binary = hex::decode(input) + .map_err(|err| StdError::from(err).with_kind(ErrorKind::InvalidData))?; + Ok(Self(binary)) + } + + pub fn to_hex(&self) -> String { + hex::encode(&self.0) + } } impl fmt::Display for Binary { @@ -73,22 +104,16 @@ impl fmt::Display for Binary { impl fmt::Debug for Binary { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Use an output inspired by tuples (https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_tuple) - // but with a custom implementation to avoid the need for an intemediate hex string. + // but with a custom implementation to avoid the need for an intermediate hex string. write!(f, "Binary(")?; for byte in self.0.iter() { - write!(f, "{:02x}", byte)?; + write!(f, "{byte:02x}")?; } write!(f, ")")?; Ok(()) } } -impl From<&[u8]> for Binary { - fn from(binary: &[u8]) -> Self { - Self(binary.to_vec()) - } -} - /// Just like Vec, Binary is a smart pointer to [u8]. /// This implements `*binary` for us and allows us to /// do `&*binary`, returning a `&[u8]` from a `&Binary`. @@ -102,14 +127,27 @@ impl Deref for Binary { } } -// Reference +impl AsRef<[u8]> for Binary { + fn as_ref(&self) -> &[u8] { + self.as_slice() + } +} + +// Slice +impl From<&[u8]> for Binary { + fn from(binary: &[u8]) -> Self { + Self(binary.to_vec()) + } +} + +// Array reference impl From<&[u8; LENGTH]> for Binary { fn from(source: &[u8; LENGTH]) -> Self { Self(source.to_vec()) } } -// Owned +// Owned array impl From<[u8; LENGTH]> for Binary { fn from(source: [u8; LENGTH]) -> Self { Self(source.into()) @@ -128,7 +166,7 @@ impl From for Vec { } } -/// Implement `encoding::Binary == std::vec::Vec` +/// Implement `encoding::Binary == alloc::vec::Vec` impl PartialEq> for Binary { fn eq(&self, rhs: &Vec) -> bool { // Use Vec == Vec @@ -136,7 +174,7 @@ impl PartialEq> for Binary { } } -/// Implement `std::vec::Vec == encoding::Binary` +/// Implement `alloc::vec::Vec == encoding::Binary` impl PartialEq for Vec { fn eq(&self, rhs: &Binary) -> bool { // Use Vec == Vec @@ -194,7 +232,11 @@ impl Serialize for Binary { where S: ser::Serializer, { - serializer.serialize_str(&self.to_base64()) + if serializer.is_human_readable() { + serializer.serialize_str(&self.to_base64()) + } else { + serializer.serialize_bytes(&self.0) + } } } @@ -204,13 +246,17 @@ impl<'de> Deserialize<'de> for Binary { where D: Deserializer<'de>, { - deserializer.deserialize_str(Base64Visitor) + if deserializer.is_human_readable() { + deserializer.deserialize_str(Base64Visitor) + } else { + deserializer.deserialize_bytes(BytesVisitor) + } } } struct Base64Visitor; -impl<'de> de::Visitor<'de> for Base64Visitor { +impl de::Visitor<'_> for Base64Visitor { type Value = Binary; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -223,37 +269,32 @@ impl<'de> de::Visitor<'de> for Base64Visitor { { match Binary::from_base64(v) { Ok(binary) => Ok(binary), - Err(_) => Err(E::custom(format!("invalid base64: {}", v))), + Err(_) => Err(E::custom(format_args!("invalid base64: {v}"))), } } } -#[cfg(test)] -mod tests { - use super::*; - use crate::errors::StdError; - use crate::serde::{from_slice, to_vec}; - use std::collections::hash_map::DefaultHasher; - use std::collections::HashSet; - use std::hash::{Hash, Hasher}; +struct BytesVisitor; - #[test] - fn encode_decode() { - let binary: &[u8] = b"hello"; - let encoded = Binary::from(binary).to_base64(); - assert_eq!(8, encoded.len()); - let decoded = Binary::from_base64(&encoded).unwrap(); - assert_eq!(binary, decoded.as_slice()); +impl de::Visitor<'_> for BytesVisitor { + type Value = Binary; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("byte array") } - #[test] - fn encode_decode_non_ascii() { - let binary = vec![12u8, 187, 0, 17, 250, 1]; - let encoded = Binary(binary.clone()).to_base64(); - assert_eq!(8, encoded.len()); - let decoded = Binary::from_base64(&encoded).unwrap(); - assert_eq!(binary.deref(), decoded.deref()); + fn visit_bytes(self, v: &[u8]) -> Result + where + E: de::Error, + { + Ok(Binary(v.to_vec())) } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::assert_hash_works; #[test] fn to_array_works() { @@ -270,15 +311,9 @@ mod tests { // invalid size let binary = Binary::from(&[1, 2, 3]); let error = binary.to_array::<8>().unwrap_err(); - match error { - StdError::InvalidDataSize { - expected, actual, .. - } => { - assert_eq!(expected, 8); - assert_eq!(actual, 3); - } - err => panic!("Unexpected error: {:?}", err), - } + assert!(error + .to_string() + .ends_with("invalid length. expected 8, got 3")); // long array (32 bytes) let binary = Binary::from_base64("t119JOQox4WUQEmO/nyqOZfO+wjJm91YG2sfn4ZglvA=").unwrap(); @@ -307,29 +342,32 @@ mod tests { } #[test] - fn from_valid_string() { - let valid_base64 = "cmFuZG9taVo="; - let binary = Binary::from_base64(valid_base64).unwrap(); - assert_eq!(b"randomiZ", binary.as_slice()); - } - - // this accepts input without a trailing = but outputs normal form - #[test] - fn from_shortened_string() { - let short = "cmFuZG9taVo"; - let long = "cmFuZG9taVo="; - let binary = Binary::from_base64(short).unwrap(); - assert_eq!(b"randomiZ", binary.as_slice()); - assert_eq!(long, binary.to_base64()); + fn test_base64_encoding_success() { + for (value, encoded, encoded_no_pad) in [ + (&b""[..], "", ""), + (&b"hello"[..], "aGVsbG8=", "aGVsbG8"), + (&b"\x0C\xBB\x00\x11\xFA\x01"[..], "DLsAEfoB", "DLsAEfoB"), + (&b"rand"[..], "cmFuZA==", "cmFuZA"), + (&b"rand"[..], "cmFuZA==", "cmFuZA="), + (&b"randomiZ"[..], "cmFuZG9taVo=", "cmFuZG9taVo"), + ] { + let value = Binary::from(value); + assert_eq!(encoded, value.to_base64()); + assert_eq!(value.clone(), Binary::from_base64(encoded).unwrap()); + assert_eq!(value.clone(), Binary::from_base64(encoded_no_pad).unwrap()); + } } #[test] - fn from_invalid_string() { - let invalid_base64 = "cm%uZG9taVo"; - let res = Binary::from_base64(invalid_base64); - match res.unwrap_err() { - StdError::InvalidBase64 { msg, .. } => assert_eq!(msg, "Invalid byte 37, offset 2."), - _ => panic!("Unexpected error type"), + fn test_base64_encoding_error() { + for (invalid_base64, want) in [ + ("cm%uZG9taVo", "Invalid symbol 37, offset 2."), + ("cmFuZ", "Invalid input length: 5"), + ] { + assert!(Binary::from_base64(invalid_base64) + .unwrap_err() + .to_string() + .ends_with(want)); } } @@ -444,31 +482,57 @@ mod tests { } #[test] - fn serialization_works() { + fn json_serialization_works() { let binary = Binary(vec![0u8, 187, 61, 11, 250, 0]); - let json = to_vec(&binary).unwrap(); - let deserialized: Binary = from_slice(&json).unwrap(); + let json = serde_json::to_vec(&binary).unwrap(); + let deserialized: Binary = serde_json::from_slice(&json).unwrap(); assert_eq!(binary, deserialized); } #[test] - fn deserialize_from_valid_string() { + fn json_deserialize_from_valid_string() { let b64_str = "ALs9C/oA"; // this is the binary behind above string let expected = vec![0u8, 187, 61, 11, 250, 0]; - let serialized = to_vec(&b64_str).unwrap(); - let deserialized: Binary = from_slice(&serialized).unwrap(); + let serialized = serde_json::to_vec(&b64_str).unwrap(); + let deserialized: Binary = serde_json::from_slice(&serialized).unwrap(); assert_eq!(expected, deserialized.as_slice()); } #[test] - fn deserialize_from_invalid_string() { + fn json_deserialize_from_invalid_string() { let invalid_str = "**BAD!**"; - let serialized = to_vec(&invalid_str).unwrap(); - let res = from_slice::(&serialized); + let serialized = serde_json::to_vec(&invalid_str).unwrap(); + let res = serde_json::from_slice::(&serialized); + assert!(res.is_err()); + } + + #[test] + fn msgpack_serialization_works() { + let data = Binary(vec![0u8, 187, 61, 11, 250, 0]); + // see: https://github.com/msgpack/msgpack/blob/8aa09e2/spec.md#bin-format-family + let expected = [196, 6, 0, 187, 61, 11, 250, 0]; + + assert_eq!(rmp_serde::to_vec(&data).unwrap(), expected); + } + + #[test] + fn msgpack_deserialize_from_valid_data() { + // see: https://github.com/msgpack/msgpack/blob/8aa09e2/spec.md#bin-format-family + let serialized = vec![196, 6, 0, 187, 61, 11, 250, 0]; + let expected = vec![0u8, 187, 61, 11, 250, 0]; + + let deserialized: Binary = rmp_serde::from_slice(&serialized).unwrap(); + assert_eq!(expected, deserialized.as_slice()); + } + + #[test] + fn msgpack_deserialize_from_invalid_data() { + let invalid_data = vec![0, 1, 2, 3, 4, 5]; + let res = rmp_serde::from_slice::(&invalid_data); assert!(res.is_err()); } @@ -476,11 +540,11 @@ mod tests { fn binary_implements_debug() { // Some data let binary = Binary(vec![0x07, 0x35, 0xAA, 0xcb, 0x00, 0xff]); - assert_eq!(format!("{:?}", binary), "Binary(0735aacb00ff)",); + assert_eq!(format!("{binary:?}"), "Binary(0735aacb00ff)",); // Empty let binary = Binary(vec![]); - assert_eq!(format!("{:?}", binary), "Binary()",); + assert_eq!(format!("{binary:?}"), "Binary()",); } #[test] @@ -497,42 +561,20 @@ mod tests { } #[test] - fn binary_implements_hash() { - let a1 = Binary::from([0, 187, 61, 11, 250, 0]); - let mut hasher = DefaultHasher::new(); - a1.hash(&mut hasher); - let a1_hash = hasher.finish(); - - let a2 = Binary::from([0, 187, 61, 11, 250, 0]); - let mut hasher = DefaultHasher::new(); - a2.hash(&mut hasher); - let a2_hash = hasher.finish(); - - let b = Binary::from([16, 21, 33, 0, 255, 9]); - let mut hasher = DefaultHasher::new(); - b.hash(&mut hasher); - let b_hash = hasher.finish(); - - assert_eq!(a1_hash, a2_hash); - assert_ne!(a1_hash, b_hash); + fn binary_implements_as_ref() { + let want = &[7u8, 35, 49, 101, 0, 255]; + let data = Binary(want.to_vec()); + assert_eq!(want, AsRef::<[u8]>::as_ref(&data)); + assert_eq!(want, AsRef::<[u8]>::as_ref(&&data)); } - /// This requires Hash and Eq to be implemented + /// Tests that `Binary` implements `EQ` and `Hash` correctly and thus can be + /// used with hash maps and sets. #[test] - fn binary_can_be_used_in_hash_set() { - let a1 = Binary::from([0, 187, 61, 11, 250, 0]); - let a2 = Binary::from([0, 187, 61, 11, 250, 0]); + fn binary_implements_hash_eq() { + let a = Binary::from([0, 187, 61, 11, 250, 0]); let b = Binary::from([16, 21, 33, 0, 255, 9]); - - let mut set = HashSet::new(); - set.insert(a1.clone()); - set.insert(a2.clone()); - set.insert(b.clone()); - assert_eq!(set.len(), 2); - - let set1 = HashSet::::from_iter(vec![b.clone(), a1.clone()]); - let set2 = HashSet::from_iter(vec![a1, a2, b]); - assert_eq!(set1, set2); + assert_hash_works!(a, b); } #[test] @@ -568,4 +610,20 @@ mod tests { assert_ne!(a, [0x11, 0x22]); assert_ne!([0x11, 0x22], a); } + + #[test] + fn hex_encoding_works() { + let hash = "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104"; + let parsed = Binary::from_hex(hash).unwrap(); + assert_eq!(parsed.to_hex(), hash); + + // invalid hex + let odd_num_of_digits = "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227"; + assert!(Binary::from_hex(odd_num_of_digits).is_err()); + let invalid_char = "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a1428842271g4"; + assert!(Binary::from_hex(invalid_char).is_err()); + let hex_prefix_unexpected = + "0x722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104"; + assert!(Binary::from_hex(hex_prefix_unexpected).is_err()); + } } diff --git a/packages/std/src/checksum.rs b/packages/std/src/checksum.rs new file mode 100644 index 0000000000..7c57bf9589 --- /dev/null +++ b/packages/std/src/checksum.rs @@ -0,0 +1,278 @@ +use core::fmt; + +use schemars::JsonSchema; +use serde::{de, ser, Deserialize, Deserializer, Serialize}; +use sha2::{Digest, Sha256}; +use thiserror::Error; + +use crate::errors::ErrorKind; +use crate::prelude::*; +use crate::{StdError, StdResult}; + +/// A SHA-256 checksum of a Wasm blob, used to identify a Wasm code. +/// This must remain stable since this checksum is stored in the blockchain state. +/// +/// This is often referred to as "code ID" in go-cosmwasm, even if code ID +/// usually refers to an auto-incrementing number. +#[derive(JsonSchema, Debug, Copy, Clone, PartialEq, Eq, Hash, cw_schema::Schemaifier)] +#[schemaifier(type = cw_schema::NodeType::Checksum)] +pub struct Checksum(#[schemars(with = "String")] [u8; 32]); + +impl Checksum { + pub fn generate(wasm: &[u8]) -> Self { + Checksum(Sha256::digest(wasm).into()) + } + + /// Tries to parse the given hex string into a checksum. + /// Errors if the string contains non-hex characters or does not contain 32 bytes. + pub fn from_hex(input: &str) -> StdResult { + let mut binary = [0u8; 32]; + hex::decode_to_slice(input, &mut binary) + .map_err(|err| StdError::from(err).with_kind(ErrorKind::Parsing))?; + + Ok(Self(binary)) + } + + /// Creates a lowercase hex encoded copy of this checksum. + /// + /// This takes an owned `self` instead of a reference because `Checksum` is cheap to `Copy`. + pub fn to_hex(self) -> String { + self.to_string() + } + + /// Returns a reference to the inner bytes of this checksum as a slice. + /// If you need a reference to the array, use [`AsRef::as_ref`]. + pub fn as_slice(&self) -> &[u8] { + &self.0 + } +} + +impl fmt::Display for Checksum { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + for byte in self.0.iter() { + write!(f, "{byte:02x}")?; + } + Ok(()) + } +} + +impl From<[u8; 32]> for Checksum { + fn from(data: [u8; 32]) -> Self { + Checksum(data) + } +} + +impl AsRef<[u8; 32]> for Checksum { + fn as_ref(&self) -> &[u8; 32] { + &self.0 + } +} + +/// Serializes as a hex string +impl Serialize for Checksum { + fn serialize(&self, serializer: S) -> Result + where + S: ser::Serializer, + { + if serializer.is_human_readable() { + serializer.serialize_str(&self.to_hex()) + } else { + serializer.serialize_bytes(&self.0) + } + } +} + +/// Deserializes as a hex string +impl<'de> Deserialize<'de> for Checksum { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + if deserializer.is_human_readable() { + deserializer.deserialize_str(ChecksumVisitor) + } else { + deserializer.deserialize_bytes(ChecksumBytesVisitor) + } + } +} + +struct ChecksumVisitor; + +impl de::Visitor<'_> for ChecksumVisitor { + type Value = Checksum; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("valid hex encoded 32 byte checksum") + } + + fn visit_str(self, v: &str) -> Result + where + E: de::Error, + { + match Checksum::from_hex(v) { + Ok(data) => Ok(data), + Err(_) => Err(E::custom(format!("invalid checksum: {v}"))), + } + } +} + +struct ChecksumBytesVisitor; + +impl de::Visitor<'_> for ChecksumBytesVisitor { + type Value = Checksum; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("32 byte checksum") + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: de::Error, + { + Checksum::try_from(v).map_err(|ChecksumError| E::invalid_length(v.len(), &"32 bytes")) + } +} + +#[derive(Error, Debug)] +#[error("Checksum not of length 32")] +pub struct ChecksumError; + +impl TryFrom<&[u8]> for Checksum { + type Error = ChecksumError; + + fn try_from(value: &[u8]) -> Result { + if value.len() != 32 { + return Err(ChecksumError); + } + let mut data = [0u8; 32]; + data.copy_from_slice(value); + Ok(Checksum(data)) + } +} + +impl From for Vec { + fn from(original: Checksum) -> Vec { + original.0.into() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + use crate::to_json_string; + + #[test] + fn generate_works() { + let wasm = vec![0x68, 0x69, 0x6a]; + let checksum = Checksum::generate(&wasm); + + // echo -n "hij" | sha256sum + let expected = [ + 0x72, 0x2c, 0x8c, 0x99, 0x3f, 0xd7, 0x5a, 0x76, 0x27, 0xd6, 0x9e, 0xd9, 0x41, 0x34, + 0x4f, 0xe2, 0xa1, 0x42, 0x3a, 0x3e, 0x75, 0xef, 0xd3, 0xe6, 0x77, 0x8a, 0x14, 0x28, + 0x84, 0x22, 0x71, 0x04, + ]; + assert_eq!(checksum.0, expected); + } + + #[test] + fn implemented_display() { + let wasm = vec![0x68, 0x69, 0x6a]; + let checksum = Checksum::generate(&wasm); + // echo -n "hij" | sha256sum + let embedded = format!("Check: {checksum}"); + assert_eq!( + embedded, + "Check: 722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104" + ); + assert_eq!( + checksum.to_string(), + "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104" + ); + } + + #[test] + fn from_hex_works() { + // echo -n "hij" | sha256sum + let checksum = "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104"; + let parsed = Checksum::from_hex(checksum).unwrap(); + assert_eq!(parsed, Checksum::generate(b"hij")); + // should be inverse of `to_hex` + assert_eq!(parsed.to_hex(), checksum); + + // invalid hex + let too_short = "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a1428842271"; + assert!(Checksum::from_hex(too_short).is_err()); + let invalid_char = "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a1428842271g4"; + assert!(Checksum::from_hex(invalid_char).is_err()); + let too_long = "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a14288422710400"; + assert!(Checksum::from_hex(too_long).is_err()); + } + + #[test] + fn to_hex_works() { + let wasm = vec![0x68, 0x69, 0x6a]; + let checksum = Checksum::generate(&wasm); + // echo -n "hij" | sha256sum + assert_eq!( + checksum.to_hex(), + "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104" + ); + } + + #[test] + fn into_vec_works() { + let checksum = Checksum::generate(&[12u8; 17]); + let as_vec: Vec = checksum.into(); + assert_eq!(as_vec, checksum.0); + } + + #[test] + fn ref_conversions_work() { + let checksum = Checksum::generate(&[12u8; 17]); + // as_ref + let _: &[u8; 32] = checksum.as_ref(); + let _: &[u8] = checksum.as_ref(); + // as_slice + let _: &[u8; 32] = checksum.as_ref(); + let _: &[u8] = checksum.as_ref(); + } + + #[test] + fn serde_works() { + // echo -n "hij" | sha256sum + let checksum = + Checksum::from_hex("722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104") + .unwrap(); + + let serialized = to_json_string(&checksum).unwrap(); + assert_eq!( + serialized, + "\"722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104\"" + ); + + let deserialized: Checksum = serde_json::from_str(&serialized).unwrap(); + assert_eq!(deserialized, checksum); + } + + #[test] + fn msgpack_works() { + // echo -n "hij" | sha256sum + let checksum = + Checksum::from_hex("722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104") + .unwrap(); + + let serialized = rmp_serde::to_vec(&checksum).unwrap(); + // see: https://github.com/msgpack/msgpack/blob/8aa09e2/spec.md#bin-format-family + let expected = vec![ + 0xc4, 0x20, 0x72, 0x2c, 0x8c, 0x99, 0x3f, 0xd7, 0x5a, 0x76, 0x27, 0xd6, 0x9e, 0xd9, + 0x41, 0x34, 0x4f, 0xe2, 0xa1, 0x42, 0x3a, 0x3e, 0x75, 0xef, 0xd3, 0xe6, 0x77, 0x8a, + 0x14, 0x28, 0x84, 0x22, 0x71, 0x04, + ]; + assert_eq!(serialized, expected); + + let deserialized: Checksum = rmp_serde::from_slice(&serialized).unwrap(); + assert_eq!(deserialized, checksum); + } +} diff --git a/packages/std/src/coin.rs b/packages/std/src/coin.rs index 289911deef..57997bec69 100644 --- a/packages/std/src/coin.rs +++ b/packages/std/src/coin.rs @@ -1,30 +1,60 @@ +use core::{fmt, str::FromStr}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use std::fmt; -use crate::math::Uint128; +use crate::prelude::*; +use crate::CoinFromStrError; +use crate::Uint256; -#[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Default, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct Coin { pub denom: String, - pub amount: Uint128, + pub amount: Uint256, } impl Coin { - pub fn new(amount: u128, denom: impl Into) -> Self { + pub fn new(amount: impl Into, denom: impl Into) -> Self { Coin { - amount: Uint128::new(amount), + amount: amount.into(), denom: denom.into(), } } } +impl fmt::Debug for Coin { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Coin {{ {} \"{}\" }}", self.amount, self.denom) + } +} + +impl FromStr for Coin { + type Err = CoinFromStrError; + + fn from_str(s: &str) -> Result { + let pos = s + .find(|c: char| !c.is_ascii_digit()) + .ok_or(CoinFromStrError::MissingDenom)?; + let (amount, denom) = s.split_at(pos); + + if amount.is_empty() { + return Err(CoinFromStrError::MissingAmount); + } + + Ok(Coin { + amount: amount.parse::()?.into(), + denom: denom.to_string(), + }) + } +} + impl fmt::Display for Coin { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { // We use the formatting without a space between amount and denom, // which is common in the Cosmos SDK ecosystem: // https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/types/coin.go#L643-L645 - // For communication to end users, Coin needs to transformed anways (e.g. convert integer uatom to decimal ATOM). + // For communication to end users, Coin needs to transformed anyway (e.g. convert integer uatom to decimal ATOM). write!(f, "{}{}", self.amount, self.denom) } } @@ -35,14 +65,14 @@ impl fmt::Display for Coin { /// /// ``` /// # use cosmwasm_std::{coins, BankMsg, CosmosMsg, Response, SubMsg}; -/// # use cosmwasm_std::testing::{mock_env, mock_info}; +/// # use cosmwasm_std::testing::mock_env; /// # let env = mock_env(); -/// # let info = mock_info("sender", &[]); +/// # let recipient = "blub".to_string(); /// let tip = coins(123, "ucosm"); /// /// let mut response: Response = Default::default(); /// response.messages = vec![SubMsg::new(BankMsg::Send { -/// to_address: info.sender.into(), +/// to_address: recipient, /// amount: tip, /// })]; /// ``` @@ -56,9 +86,7 @@ pub fn coins(amount: u128, denom: impl Into) -> Vec { /// /// ``` /// # use cosmwasm_std::{coin, BankMsg, CosmosMsg, Response, SubMsg}; -/// # use cosmwasm_std::testing::{mock_env, mock_info}; -/// # let env = mock_env(); -/// # let info = mock_info("sender", &[]); +/// # let recipient = "blub".to_string(); /// let tip = vec![ /// coin(123, "ucosm"), /// coin(24, "ustake"), @@ -66,7 +94,7 @@ pub fn coins(amount: u128, denom: impl Into) -> Vec { /// /// let mut response: Response = Default::default(); /// response.messages = vec![SubMsg::new(BankMsg::Send { -/// to_address: info.sender.into(), +/// to_address: recipient, /// amount: tip, /// })]; /// ``` @@ -90,11 +118,11 @@ mod tests { #[test] fn coin_implements_display() { let a = Coin { - amount: Uint128::new(123), + amount: Uint256::new(123), denom: "ucosm".to_string(), }; - let embedded = format!("Amount: {}", a); + let embedded = format!("Amount: {a}"); assert_eq!(embedded, "Amount: 123ucosm"); assert_eq!(a.to_string(), "123ucosm"); } @@ -105,7 +133,7 @@ mod tests { assert_eq!( a, Coin { - amount: Uint128::new(123), + amount: Uint256::new(123), denom: "ucosm".to_string() } ); @@ -114,7 +142,7 @@ mod tests { assert_eq!( zero, Coin { - amount: Uint128::new(0), + amount: Uint256::new(0), denom: "ucosm".to_string() } ); @@ -123,7 +151,7 @@ mod tests { assert_eq!( string_denom, Coin { - amount: Uint128::new(42), + amount: Uint256::new(42), denom: "ucosm".to_string() } ); @@ -135,7 +163,7 @@ mod tests { assert_eq!( a, vec![Coin { - amount: Uint128::new(123), + amount: Uint256::new(123), denom: "ucosm".to_string() }] ); @@ -144,7 +172,7 @@ mod tests { assert_eq!( zero, vec![Coin { - amount: Uint128::new(0), + amount: Uint256::new(0), denom: "ucosm".to_string() }] ); @@ -153,7 +181,7 @@ mod tests { assert_eq!( string_denom, vec![Coin { - amount: Uint128::new(42), + amount: Uint256::new(42), denom: "ucosm".to_string() }] ); @@ -166,4 +194,59 @@ mod tests { // less than same type assert!(has_coins(&wallet, &coin(777, "ETH"))); } + + #[test] + fn parse_coin() { + let expected = Coin::new(123u128, "ucosm"); + assert_eq!("123ucosm".parse::().unwrap(), expected); + // leading zeroes should be ignored + assert_eq!("00123ucosm".parse::().unwrap(), expected); + // 0 amount parses correctly + assert_eq!("0ucosm".parse::().unwrap(), Coin::new(0u128, "ucosm")); + // ibc denom should work + let ibc_str = "11111ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"; + let ibc_coin = Coin::new( + 11111u128, + "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2", + ); + assert_eq!(ibc_str.parse::().unwrap(), ibc_coin); + + // error cases + assert_eq!( + Coin::from_str("123").unwrap_err(), + CoinFromStrError::MissingDenom + ); + assert_eq!( + Coin::from_str("ucosm").unwrap_err(), // no amount + CoinFromStrError::MissingAmount + ); + assert_eq!( + Coin::from_str("-123ucosm").unwrap_err(), // negative amount + CoinFromStrError::MissingAmount + ); + assert_eq!( + Coin::from_str("").unwrap_err(), // empty input + CoinFromStrError::MissingDenom + ); + assert_eq!( + Coin::from_str(" 1ucosm").unwrap_err(), // unsupported whitespace + CoinFromStrError::MissingAmount + ); + assert_eq!( + Coin::from_str("�1ucosm").unwrap_err(), // other broken data + CoinFromStrError::MissingAmount + ); + assert_eq!( + Coin::from_str("340282366920938463463374607431768211456ucosm") + .unwrap_err() + .to_string(), + "Invalid amount: number too large to fit in target type" + ); + } + + #[test] + fn debug_coin() { + let coin = Coin::new(123u128, "ucosm"); + assert_eq!(format!("{coin:?}"), r#"Coin { 123 "ucosm" }"#); + } } diff --git a/packages/std/src/coins.rs b/packages/std/src/coins.rs new file mode 100644 index 0000000000..828032bd38 --- /dev/null +++ b/packages/std/src/coins.rs @@ -0,0 +1,538 @@ +use alloc::collections::BTreeMap; +use core::fmt; +use core::str::FromStr; + +use crate::prelude::*; +use crate::{Coin, CoinsError, OverflowError, OverflowOperation, StdError, StdResult, Uint256}; + +/// A collection of coins, similar to Cosmos SDK's `sdk.Coins` struct. +/// +/// Differently from `sdk.Coins`, which is a vector of `sdk.Coin`, here we +/// implement Coins as a BTreeMap that maps from coin denoms to `Coin`. +/// This has a number of advantages: +/// +/// - coins are naturally sorted alphabetically by denom +/// - duplicate denoms are automatically removed +/// - cheaper for searching/inserting/deleting: O(log(n)) compared to O(n) +#[derive(Clone, Default, Debug, PartialEq, Eq)] +pub struct Coins(BTreeMap); + +/// Casting a Vec to Coins. +/// The Vec can be out of order, but must not contain duplicate denoms. +/// If you want to sum up duplicates, create an empty instance using `Coins::default` and +/// use `Coins::add` to add your coins. +impl TryFrom> for Coins { + type Error = CoinsError; + + fn try_from(vec: Vec) -> Result { + let mut map = BTreeMap::new(); + for coin in vec { + if coin.amount.is_zero() { + continue; + } + + // if the insertion returns a previous value, we have a duplicate denom + if map.insert(coin.denom.clone(), coin).is_some() { + return Err(CoinsError::DuplicateDenom); + } + } + + Ok(Self(map)) + } +} + +impl TryFrom<&[Coin]> for Coins { + type Error = CoinsError; + + fn try_from(slice: &[Coin]) -> Result { + slice.to_vec().try_into() + } +} + +impl From for Coins { + fn from(value: Coin) -> Self { + let mut coins = Coins::default(); + // this can never overflow (because there are no coins in there yet), so we can unwrap + coins.add(value).unwrap(); + coins + } +} + +impl TryFrom<[Coin; N]> for Coins { + type Error = CoinsError; + + fn try_from(slice: [Coin; N]) -> Result { + slice.to_vec().try_into() + } +} + +impl From for Vec { + fn from(value: Coins) -> Self { + value.into_vec() + } +} + +impl FromStr for Coins { + type Err = StdError; + + fn from_str(s: &str) -> StdResult { + if s.is_empty() { + return Ok(Self::default()); + } + + Ok(s.split(',') + .map(Coin::from_str) + .collect::, _>>()? + .try_into()?) + } +} + +impl fmt::Display for Coins { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let s = self + .0 + .values() + .map(|coin| coin.to_string()) + .collect::>() + .join(","); + write!(f, "{s}") + } +} + +impl Coins { + /// Conversion to Vec, while NOT consuming the original object. + /// + /// This produces a vector of coins that is sorted alphabetically by denom with + /// no duplicate denoms. + pub fn to_vec(&self) -> Vec { + self.0.values().cloned().collect() + } + + /// Conversion to Vec, consuming the original object. + /// + /// This produces a vector of coins that is sorted alphabetically by denom with + /// no duplicate denoms. + pub fn into_vec(self) -> Vec { + self.0.into_values().collect() + } + + /// Returns the number of different denoms in this collection. + pub fn len(&self) -> usize { + self.0.len() + } + + /// Returns `true` if this collection contains no coins. + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } + + /// Returns the denoms as a vector of strings. + /// The vector is guaranteed to not contain duplicates and sorted alphabetically. + pub fn denoms(&self) -> Vec { + self.0.keys().cloned().collect() + } + + /// Returns the amount of the given denom or zero if the denom is not present. + pub fn amount_of(&self, denom: &str) -> Uint256 { + self.0 + .get(denom) + .map(|c| c.amount) + .unwrap_or_else(Uint256::zero) + } + + /// Returns the amount of the given denom if and only if this collection contains only + /// the given denom. Otherwise `None` is returned. + /// + /// # Examples + /// + /// ```rust + /// use cosmwasm_std::{Coin, Coins, coin, Uint256}; + /// + /// let coins: Coins = [coin(100, "uatom")].try_into().unwrap(); + /// assert_eq!(coins.contains_only("uatom").unwrap(), Uint256::new(100)); + /// assert_eq!(coins.contains_only("uluna"), None); + /// ``` + /// + /// ```rust + /// use cosmwasm_std::{Coin, Coins, coin}; + /// + /// let coins: Coins = [coin(100, "uatom"), coin(200, "uusd")].try_into().unwrap(); + /// assert_eq!(coins.contains_only("uatom"), None); + /// ``` + pub fn contains_only(&self, denom: &str) -> Option { + if self.len() == 1 { + self.0.get(denom).map(|c| c.amount) + } else { + None + } + } + + /// Adds the given coin to this `Coins` instance. + /// Errors in case of overflow. + pub fn add(&mut self, coin: Coin) -> StdResult<()> { + if coin.amount.is_zero() { + return Ok(()); + } + + // if the coin is not present yet, insert it, otherwise add to existing amount + match self.0.get_mut(&coin.denom) { + None => { + self.0.insert(coin.denom.clone(), coin); + } + Some(existing) => { + existing.amount = existing.amount.checked_add(coin.amount)?; + } + } + Ok(()) + } + + /// Subtracts the given coin from this `Coins` instance. + /// Errors in case of overflow or if the denom is not present. + pub fn sub(&mut self, coin: Coin) -> StdResult<()> { + match self.0.get_mut(&coin.denom) { + Some(existing) => { + existing.amount = existing.amount.checked_sub(coin.amount)?; + // make sure to remove zero coin + if existing.amount.is_zero() { + self.0.remove(&coin.denom); + } + } + None => { + // ignore zero subtraction + if coin.amount.is_zero() { + return Ok(()); + } + return Err(OverflowError::new(OverflowOperation::Sub).into()); + } + } + + Ok(()) + } + + /// Returns an iterator over the coins. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::{coin, Coin, Coins, Uint256}; + /// let mut coins = Coins::default(); + /// coins.add(coin(500, "uluna")).unwrap(); + /// coins.add(coin(1000, "uatom")).unwrap(); + /// let mut iterator = coins.iter(); + /// + /// let uatom = iterator.next().unwrap(); + /// assert_eq!(uatom.denom, "uatom"); + /// assert_eq!(uatom.amount, Uint256::new(1000)); + /// + /// let uluna = iterator.next().unwrap(); + /// assert_eq!(uluna.denom, "uluna"); + /// assert_eq!(uluna.amount, Uint256::new(500)); + /// + /// assert_eq!(iterator.next(), None); + /// ``` + pub fn iter(&self) -> CoinsIter<'_> { + CoinsIter(self.0.iter()) + } +} + +impl IntoIterator for Coins { + type Item = Coin; + type IntoIter = CoinsIntoIter; + + fn into_iter(self) -> Self::IntoIter { + CoinsIntoIter(self.0.into_iter()) + } +} + +impl<'a> IntoIterator for &'a Coins { + type Item = &'a Coin; + type IntoIter = CoinsIter<'a>; + + fn into_iter(self) -> Self::IntoIter { + self.iter() + } +} + +#[derive(Debug)] +pub struct CoinsIntoIter(alloc::collections::btree_map::IntoIter); + +impl Iterator for CoinsIntoIter { + type Item = Coin; + + fn next(&mut self) -> Option { + self.0.next().map(|(_, coin)| coin) + } + + fn size_hint(&self) -> (usize, Option) { + // Since btree_map::IntoIter implements ExactSizeIterator, this is guaranteed to return the exact length + self.0.size_hint() + } +} + +impl DoubleEndedIterator for CoinsIntoIter { + fn next_back(&mut self) -> Option { + self.0.next_back().map(|(_, coin)| coin) + } +} + +impl ExactSizeIterator for CoinsIntoIter { + fn len(&self) -> usize { + self.0.len() + } +} + +#[derive(Debug)] +pub struct CoinsIter<'a>(alloc::collections::btree_map::Iter<'a, String, Coin>); + +impl<'a> Iterator for CoinsIter<'a> { + type Item = &'a Coin; + + fn next(&mut self) -> Option { + self.0.next().map(|(_, coin)| coin) + } + + fn size_hint(&self) -> (usize, Option) { + // Since btree_map::Iter implements ExactSizeIterator, this is guaranteed to return the exact length + self.0.size_hint() + } +} + +impl DoubleEndedIterator for CoinsIter<'_> { + fn next_back(&mut self) -> Option { + self.0.next_back().map(|(_, coin)| coin) + } +} + +impl ExactSizeIterator for CoinsIter<'_> { + fn len(&self) -> usize { + self.0.len() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::coin; + + /// Sort a Vec by denom alphabetically + fn sort_by_denom(vec: &mut [Coin]) { + vec.sort_by(|a, b| a.denom.cmp(&b.denom)); + } + + /// Returns a mockup Vec. In this example, the coins are not in order + fn mock_vec() -> Vec { + vec![ + coin(12345, "uatom"), + coin(69420, "ibc/1234ABCD"), + coin(88888, "factory/osmo1234abcd/subdenom"), + ] + } + + /// Return a mockup Coins that contains the same coins as in `mock_vec` + fn mock_coins() -> Coins { + let mut coins = Coins::default(); + for coin in mock_vec() { + coins.add(coin).unwrap(); + } + coins + } + + #[test] + fn converting_vec() { + let mut vec = mock_vec(); + let coins = mock_coins(); + + // &[Coin] --> Coins + assert_eq!(Coins::try_from(vec.as_slice()).unwrap(), coins); + // Vec --> Coins + assert_eq!(Coins::try_from(vec.clone()).unwrap(), coins); + + sort_by_denom(&mut vec); + + // &Coins --> Vec + // NOTE: the returned vec should be sorted + assert_eq!(coins.to_vec(), vec); + // Coins --> Vec + // NOTE: the returned vec should be sorted + assert_eq!(coins.into_vec(), vec); + } + + #[test] + fn converting_str() { + // not in order + let s1 = "88888factory/osmo1234abcd/subdenom,12345uatom,69420ibc/1234ABCD"; + // in order + let s2 = "88888factory/osmo1234abcd/subdenom,69420ibc/1234ABCD,12345uatom"; + + let invalid = "12345uatom,noamount"; + + let coins = mock_coins(); + + // &str --> Coins + // NOTE: should generate the same Coins, regardless of input order + assert_eq!(Coins::from_str(s1).unwrap(), coins); + assert_eq!(Coins::from_str(s2).unwrap(), coins); + assert_eq!(Coins::from_str("").unwrap(), Coins::default()); + + // Coins --> String + // NOTE: the generated string should be sorted + assert_eq!(coins.to_string(), s2); + assert_eq!(Coins::default().to_string(), ""); + assert_eq!( + Coins::from_str(invalid).unwrap_err().to_string(), + "kind: Parsing, error: Missing amount or non-digit characters in amount" + ); + } + + #[test] + fn handling_duplicates() { + // create a Vec that contains duplicate denoms + let mut vec = mock_vec(); + vec.push(coin(67890, "uatom")); + + let err = Coins::try_from(vec).unwrap_err(); + assert_eq!(err, CoinsError::DuplicateDenom); + } + + #[test] + fn handling_zero_amount() { + // create a Vec that contains zero amounts + let mut vec = mock_vec(); + vec[0].amount = Uint256::zero(); + + let coins = Coins::try_from(vec).unwrap(); + assert_eq!(coins.len(), 2); + assert_ne!(coins.amount_of("ibc/1234ABCD"), Uint256::zero()); + assert_ne!( + coins.amount_of("factory/osmo1234abcd/subdenom"), + Uint256::zero() + ); + + // adding a coin with zero amount should not be added + let mut coins = Coins::default(); + coins.add(coin(0, "uusd")).unwrap(); + assert!(coins.is_empty()); + } + + #[test] + fn length() { + let coins = Coins::default(); + assert_eq!(coins.len(), 0); + assert!(coins.is_empty()); + + let coins = mock_coins(); + assert_eq!(coins.len(), 3); + assert!(!coins.is_empty()); + } + + #[test] + fn add_coin() { + let mut coins = mock_coins(); + + // existing denom + coins.add(coin(12345, "uatom")).unwrap(); + assert_eq!(coins.len(), 3); + assert_eq!(coins.amount_of("uatom"), Uint256::new(24690)); + + // new denom + coins.add(coin(123, "uusd")).unwrap(); + assert_eq!(coins.len(), 4); + + // zero amount + coins.add(coin(0, "uusd")).unwrap(); + assert_eq!(coins.amount_of("uusd"), Uint256::new(123)); + + // zero amount, new denom + coins.add(coin(0, "utest")).unwrap(); + assert_eq!(coins.len(), 4); + } + + #[test] + fn sub_coins() { + let mut coins: Coins = coin(12345, "uatom").into(); + + // sub more than available + assert!(coins.sub(coin(12346, "uatom")).is_err()); + + // sub non-existent denom + assert!(coins.sub(coin(12345, "uusd")).is_err()); + + // partial sub + coins.sub(coin(1, "uatom")).unwrap(); + assert_eq!(coins.len(), 1); + assert_eq!(coins.amount_of("uatom"), Uint256::new(12344)); + + // full sub + coins.sub(coin(12344, "uatom")).unwrap(); + assert!(coins.is_empty()); + + // sub zero, existing denom + coins.sub(coin(0, "uusd")).unwrap(); + assert!(coins.is_empty()); + let mut coins: Coins = coin(12345, "uatom").into(); + + // sub zero, non-existent denom + coins.sub(coin(0, "uatom")).unwrap(); + assert_eq!(coins.len(), 1); + assert_eq!(coins.amount_of("uatom"), Uint256::new(12345)); + } + + #[test] + fn coin_to_coins() { + // zero coin results in empty collection + let coins: Coins = coin(0, "uusd").into(); + assert!(coins.is_empty()); + + // happy path + let coins = Coins::from(coin(12345, "uatom")); + assert_eq!(coins.len(), 1); + assert_eq!(coins.amount_of("uatom"), Uint256::new(12345)); + } + + #[test] + fn exact_size_iterator() { + let coins = mock_coins(); + let iter = coins.iter(); + assert_eq!(iter.len(), 3); + assert_eq!(iter.size_hint(), (3, Some(3))); + + let iter = coins.into_iter(); + assert_eq!(iter.len(), 3); + assert_eq!(iter.size_hint(), (3, Some(3))); + } + + #[test] + fn can_iterate_owned() { + let coins = mock_coins(); + let mut moved = Coins::default(); + for c in coins { + moved.add(c).unwrap(); + } + assert_eq!(moved.len(), 3); + + assert!(mock_coins().into_iter().eq(mock_coins().to_vec())); + } + + #[test] + fn can_iterate_borrowed() { + let coins = mock_coins(); + assert!(coins + .iter() + .map(|c| &c.denom) + .eq(coins.to_vec().iter().map(|c| &c.denom))); + + // can still use the coins afterwards + assert_eq!(coins.amount_of("uatom"), Uint256::new(12345)); + } + + #[test] + fn contains_only_works() { + // doctests copied here because coverage does not work for doctests + let coins: Coins = [coin(100, "uatom")].try_into().unwrap(); + assert_eq!(coins.contains_only("uatom").unwrap(), Uint256::new(100)); + assert_eq!(coins.contains_only("uluna"), None); + + let coins: Coins = [coin(100, "uatom"), coin(200, "uusd")].try_into().unwrap(); + assert_eq!(coins.contains_only("uatom"), None); + } +} diff --git a/packages/std/src/deps.rs b/packages/std/src/deps.rs index 4d9a9ecdce..d36578a262 100644 --- a/packages/std/src/deps.rs +++ b/packages/std/src/deps.rs @@ -1,4 +1,4 @@ -use std::marker::PhantomData; +use core::marker::PhantomData; use crate::query::CustomQuery; use crate::results::Empty; @@ -33,7 +33,7 @@ pub struct Deps<'a, C: CustomQuery = Empty> { // See "There is a small difference between the two: the derive strategy will also // place a Copy bound on type parameters, which isn’t always desired." // https://doc.rust-lang.org/std/marker/trait.Copy.html -impl<'a, C: CustomQuery> Copy for Deps<'a, C> {} +impl Copy for Deps<'_, C> {} impl OwnedDeps { pub fn as_ref(&'_ self) -> Deps<'_, C> { @@ -69,6 +69,28 @@ impl<'a, C: CustomQuery> DepsMut<'a, C> { querier: self.querier, } } + + /// This allows to convert any `DepsMut` into one generic over `Empty` custom + /// query type. + pub fn into_empty(self) -> DepsMut<'a, Empty> { + DepsMut { + storage: self.storage, + api: self.api, + querier: self.querier.into_empty(), + } + } +} + +impl<'a, C: CustomQuery> Deps<'a, C> { + /// This allows to convert any `Deps` into one generic over `Empty` custom + /// query type. + pub fn into_empty(self) -> Deps<'a, Empty> { + Deps { + storage: self.storage, + api: self.api, + querier: self.querier.into_empty(), + } + } } #[cfg(test)] @@ -98,13 +120,13 @@ mod tests { query(deps.as_ref()) } + #[derive(Clone, Serialize, Deserialize)] + struct MyQuery; + impl CustomQuery for MyQuery {} + impl CustomQuery for u64 {} + #[test] fn deps_implements_copy() { - impl CustomQuery for u64 {} - #[derive(Clone, Serialize, Deserialize)] - struct MyQuery; - impl CustomQuery for MyQuery {} - // With C: Copy let owned = OwnedDeps::<_, _, _, u64> { storage: MockStorage::default(), @@ -127,4 +149,20 @@ mod tests { let _copy1 = deps; let _copy2 = deps; } + + #[test] + fn deps_to_empty() { + let mut owned = OwnedDeps::<_, _, _, MyQuery> { + storage: MockStorage::default(), + api: MockApi::default(), + querier: MockQuerier::::new(&[]), + custom_query_type: PhantomData, + }; + + let deps_mut: DepsMut = owned.as_mut(); + let _: DepsMut = deps_mut.into_empty(); + + let deps: Deps = owned.as_ref(); + let _: Deps = deps.into_empty(); + } } diff --git a/packages/std/src/encoding.rs b/packages/std/src/encoding.rs new file mode 100644 index 0000000000..3dfc27bea2 --- /dev/null +++ b/packages/std/src/encoding.rs @@ -0,0 +1,94 @@ +use alloc::{string::String, vec::Vec}; +use base64::{engine::GeneralPurpose, Engine}; + +use crate::StdResult; + +/// Base64 encoding engine used in conversion to/from base64. +/// +/// The engine adds padding when encoding and accepts strings with or +/// without padding when decoding. +const B64_ENGINE: GeneralPurpose = GeneralPurpose::new( + &base64::alphabet::STANDARD, + base64::engine::GeneralPurposeConfig::new() + .with_decode_padding_mode(base64::engine::DecodePaddingMode::Indifferent), +); + +/// Deserialize a bag of bytes from Base64 into a vector of bytes +pub fn from_base64(input: I) -> StdResult> +where + I: AsRef<[u8]>, +{ + Ok(B64_ENGINE.decode(input)?) +} + +/// Encode a bag of bytes into the Base64 format +pub fn to_base64(input: I) -> String +where + I: AsRef<[u8]>, +{ + B64_ENGINE.encode(input) +} + +/// Decode a bag of bytes from hex into a vector of bytes +pub fn from_hex(input: I) -> StdResult> +where + I: AsRef<[u8]>, +{ + Ok(hex::decode(input)?) +} + +/// Encode a bag of bytes into the hex format +pub fn to_hex(input: I) -> String +where + I: AsRef<[u8]>, +{ + hex::encode(input) +} + +#[cfg(test)] +mod test { + use crate::{from_base64, from_hex, to_base64, to_hex}; + + const BASE64_FOOBAR: &str = "Zm9vYmFy"; // utf-8 encoded "foobar" + const HEX_FOOBAR: &str = "666f6f626172"; // utf-8 encoded "foobar" + + #[test] + fn from_base64_works() { + let decoded = from_base64(BASE64_FOOBAR).unwrap(); + assert_eq!(decoded, b"foobar"); + } + + #[test] + fn to_base64_works() { + let encoded = to_base64("foobar"); + assert_eq!(encoded, BASE64_FOOBAR); + } + + #[test] + fn base64_roundtrip_works() { + let decoded = from_base64(BASE64_FOOBAR).unwrap(); + assert_eq!(decoded, b"foobar"); + let encoded = to_base64(decoded); + assert_eq!(encoded, BASE64_FOOBAR); + } + + #[test] + fn from_hex_works() { + let decoded = from_hex(HEX_FOOBAR).unwrap(); + assert_eq!(decoded, b"foobar"); + } + + #[test] + fn to_hex_works() { + let encoded = to_hex("foobar"); + assert_eq!(encoded, HEX_FOOBAR); + } + + #[test] + fn hex_roundtrip_works() { + let decoded = from_hex(HEX_FOOBAR).unwrap(); + assert_eq!(decoded, b"foobar"); + let encoded = to_hex(decoded); + assert_eq!(encoded, HEX_FOOBAR); + } +} diff --git a/packages/std/src/errors/backtrace.rs b/packages/std/src/errors/backtrace.rs new file mode 100644 index 0000000000..41bc3f06f1 --- /dev/null +++ b/packages/std/src/errors/backtrace.rs @@ -0,0 +1,74 @@ +use alloc::boxed::Box; +use core::fmt::{Debug, Display, Formatter, Result}; + +/// This wraps an actual backtrace to achieve two things: +/// - being able to fill this with a stub implementation in `no_std` environments +/// - being able to use this in conjunction with [`thiserror::Error`] +pub struct BT(Box); + +impl BT { + #[track_caller] + pub fn capture() -> Self { + // in case of no_std, we can fill with a stub here + #[cfg(feature = "std")] + { + #[cfg(target_arch = "wasm32")] + return BT(Box::new(std::backtrace::Backtrace::disabled())); + #[cfg(not(target_arch = "wasm32"))] + return BT(Box::new(std::backtrace::Backtrace::capture())); + } + #[cfg(not(feature = "std"))] + { + BT(Box::new(Stub)) + } + } +} + +trait Printable: Debug + Display {} +impl Printable for T where T: Debug + Display {} + +impl Debug for BT { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + Debug::fmt(&self.0, f) + } +} + +impl Display for BT { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + Display::fmt(&self.0, f) + } +} + +#[allow(unused)] +struct Stub; + +impl Debug for Stub { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + write!(f, "") + } +} + +impl Display for Stub { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + write!(f, "") + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn bt_works_without_std() { + #[derive(Debug)] + struct BacktraceStub; + + impl Display for BacktraceStub { + fn fmt(&self, _f: &mut Formatter<'_>) -> Result { + Ok(()) + } + } + + _ = BT(Box::new(BacktraceStub)); + } +} diff --git a/packages/std/src/errors/mod.rs b/packages/std/src/errors/mod.rs index bf7e61f433..6edf0bf84d 100644 --- a/packages/std/src/errors/mod.rs +++ b/packages/std/src/errors/mod.rs @@ -1,12 +1,16 @@ +mod backtrace; mod recover_pubkey_error; mod std_error; mod system_error; mod verification_error; +pub(crate) use backtrace::BT; pub use recover_pubkey_error::RecoverPubkeyError; pub use std_error::{ - CheckedFromRatioError, CheckedMultiplyRatioError, ConversionOverflowError, DivideByZeroError, - OverflowError, OverflowOperation, RoundUpOverflowError, StdError, StdResult, + CheckedFromRatioError, CheckedMultiplyFractionError, CheckedMultiplyRatioError, + CoinFromStrError, CoinsError, ConversionOverflowError, DivideByZeroError, DivisionError, + ErrorKind, OverflowError, OverflowOperation, RoundDownOverflowError, RoundUpOverflowError, + StdError, StdResult, StdResultExt, }; pub use system_error::SystemError; -pub use verification_error::VerificationError; +pub use verification_error::{AggregationError, PairingEqualityError, VerificationError}; diff --git a/packages/std/src/errors/recover_pubkey_error.rs b/packages/std/src/errors/recover_pubkey_error.rs index 75af03a7ca..f473b091f1 100644 --- a/packages/std/src/errors/recover_pubkey_error.rs +++ b/packages/std/src/errors/recover_pubkey_error.rs @@ -1,11 +1,10 @@ +use core::fmt::Debug; #[cfg(not(target_arch = "wasm32"))] use cosmwasm_crypto::CryptoError; -#[cfg(feature = "backtraces")] -use std::backtrace::Backtrace; -use std::fmt::Debug; -use thiserror::Error; -#[derive(Error, Debug)] +use super::BT; + +#[derive(Debug, thiserror::Error)] pub enum RecoverPubkeyError { #[error("Invalid hash format")] InvalidHashFormat, @@ -14,19 +13,15 @@ pub enum RecoverPubkeyError { #[error("Invalid recovery parameter. Supported values: 0 and 1.")] InvalidRecoveryParam, #[error("Unknown error: {error_code}")] - UnknownErr { - error_code: u32, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + UnknownErr { error_code: u32, backtrace: BT }, } impl RecoverPubkeyError { pub fn unknown_err(error_code: u32) -> Self { RecoverPubkeyError::UnknownErr { error_code, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + + backtrace: BT::capture(), } } } @@ -63,13 +58,17 @@ impl From for RecoverPubkeyError { fn from(original: CryptoError) -> Self { match original { CryptoError::InvalidHashFormat { .. } => RecoverPubkeyError::InvalidHashFormat, - CryptoError::InvalidPubkeyFormat { .. } => panic!("Conversion not supported"), CryptoError::InvalidSignatureFormat { .. } => { RecoverPubkeyError::InvalidSignatureFormat } CryptoError::GenericErr { .. } => RecoverPubkeyError::unknown_err(original.code()), CryptoError::InvalidRecoveryParam { .. } => RecoverPubkeyError::InvalidRecoveryParam, - CryptoError::BatchErr { .. } => panic!("Conversion not supported"), + CryptoError::Aggregation { .. } + | CryptoError::PairingEquality { .. } + | CryptoError::BatchErr { .. } + | CryptoError::InvalidPubkeyFormat { .. } + | CryptoError::InvalidPoint { .. } + | CryptoError::UnknownHashFunction { .. } => panic!("Conversion not supported"), } } } diff --git a/packages/std/src/errors/std_error.rs b/packages/std/src/errors/std_error.rs index fa5c27f328..569e4cf231 100644 --- a/packages/std/src/errors/std_error.rs +++ b/packages/std/src/errors/std_error.rs @@ -1,9 +1,30 @@ -#[cfg(feature = "backtraces")] -use std::backtrace::Backtrace; -use std::fmt; -use thiserror::Error; +use alloc::string::ToString; +use core::fmt; +use std::{error::Error, ops::Deref, str, string}; -use crate::errors::{RecoverPubkeyError, VerificationError}; +use super::BT; + +use crate::{ + errors::{RecoverPubkeyError, VerificationError}, + Decimal256RangeExceeded, DecimalRangeExceeded, SignedDecimal256RangeExceeded, + SignedDecimalRangeExceeded, +}; + +mod sealed { + pub trait Sealed {} + + impl Sealed for Result {} +} + +pub trait StdResultExt: sealed::Sealed { + fn unwrap_std_error(self) -> Result>; +} + +impl StdResultExt for Result { + fn unwrap_std_error(self) -> Result> { + self.map_err(|err| err.0.inner) + } +} /// Structured error type for init, execute and query. /// @@ -20,463 +41,149 @@ use crate::errors::{RecoverPubkeyError, VerificationError}; /// Checklist for adding a new error: /// - Add enum case /// - Add creator function in std_error_helpers.rs -#[derive(Error, Debug)] -pub enum StdError { - #[error("Verification error: {source}")] - VerificationErr { - source: VerificationError, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Recover pubkey error: {source}")] - RecoverPubkeyErr { - source: RecoverPubkeyError, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - /// Whenever there is no specific error type available - #[error("Generic error: {msg}")] - GenericErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Invalid Base64 string: {msg}")] - InvalidBase64 { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Invalid data size: expected={expected} actual={actual}")] - InvalidDataSize { - expected: u64, - actual: u64, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Invalid hex string: {msg}")] - InvalidHex { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - /// Whenever UTF-8 bytes cannot be decoded into a unicode string, e.g. in String::from_utf8 or str::from_utf8. - #[error("Cannot decode UTF8 bytes into string: {msg}")] - InvalidUtf8 { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("{kind} not found")] - NotFound { - kind: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Error parsing into type {target_type}: {msg}")] - ParseErr { - /// the target type that was attempted - target_type: String, - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Error serializing type {source_type}: {msg}")] - SerializeErr { - /// the source type that was attempted - source_type: String, - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Overflow: {source}")] - Overflow { - source: OverflowError, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Divide by zero: {source}")] - DivideByZero { - source: DivideByZeroError, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, - #[error("Conversion error: ")] - ConversionOverflow { - #[from] - source: ConversionOverflowError, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, +#[derive(Debug)] +pub struct StdError(Box); + +#[derive(Debug)] +struct InnerError { + backtrace: BT, + kind: ErrorKind, + inner: Box, } -impl StdError { - pub fn verification_err(source: VerificationError) -> Self { - StdError::VerificationErr { - source, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } - } - - pub fn recover_pubkey_err(source: RecoverPubkeyError) -> Self { - StdError::RecoverPubkeyErr { - source, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } - } - - pub fn generic_err(msg: impl Into) -> Self { - StdError::GenericErr { - msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } - } - - pub fn invalid_base64(msg: impl ToString) -> Self { - StdError::InvalidBase64 { - msg: msg.to_string(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } - } +const _: () = { + // Assert smolness (˶ᵔ ᵕ ᵔ˶) + assert!(std::mem::size_of::() == std::mem::size_of::()); +}; - pub fn invalid_data_size(expected: usize, actual: usize) -> Self { - StdError::InvalidDataSize { - // Cast is safe because usize is 32 or 64 bit large in all environments we support - expected: expected as u64, - actual: actual as u64, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } - } - - pub fn invalid_hex(msg: impl ToString) -> Self { - StdError::InvalidHex { - msg: msg.to_string(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } - } - - pub fn invalid_utf8(msg: impl ToString) -> Self { - StdError::InvalidUtf8 { - msg: msg.to_string(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } +impl AsRef for StdError { + fn as_ref(&self) -> &(dyn Error + Send + Sync + 'static) { + &*self.0.inner } +} - pub fn not_found(kind: impl Into) -> Self { - StdError::NotFound { - kind: kind.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } - } +impl Deref for StdError { + type Target = dyn Error + Send + Sync; - pub fn parse_err(target: impl Into, msg: impl ToString) -> Self { - StdError::ParseErr { - target_type: target.into(), - msg: msg.to_string(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } - } - - pub fn serialize_err(source: impl Into, msg: impl ToString) -> Self { - StdError::SerializeErr { - source_type: source.into(), - msg: msg.to_string(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } + fn deref(&self) -> &Self::Target { + &*self.0.inner } +} - pub fn overflow(source: OverflowError) -> Self { - StdError::Overflow { - source, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } +impl StdError { + pub fn msg(msg: D) -> Self + where + D: fmt::Display, + { + Self(Box::new(InnerError { + backtrace: BT::capture(), + kind: ErrorKind::Other, + inner: msg.to_string().into(), + })) } - pub fn divide_by_zero(source: DivideByZeroError) -> Self { - StdError::DivideByZero { - source, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), - } + pub fn backtrace(&self) -> &BT { + &self.0.backtrace } -} -impl PartialEq for StdError { - fn eq(&self, rhs: &StdError) -> bool { - match self { - StdError::VerificationErr { - source, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::VerificationErr { - source: rhs_source, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - source == rhs_source - } else { - false - } - } - StdError::RecoverPubkeyErr { - source, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::RecoverPubkeyErr { - source: rhs_source, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - source == rhs_source - } else { - false - } - } - StdError::GenericErr { - msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::GenericErr { - msg: rhs_msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - msg == rhs_msg - } else { - false - } - } - StdError::InvalidBase64 { - msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::InvalidBase64 { - msg: rhs_msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - msg == rhs_msg - } else { - false - } - } - StdError::InvalidDataSize { - expected, - actual, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::InvalidDataSize { - expected: rhs_expected, - actual: rhs_actual, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - expected == rhs_expected && actual == rhs_actual - } else { - false - } - } - StdError::InvalidHex { - msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::InvalidHex { - msg: rhs_msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - msg == rhs_msg - } else { - false - } - } - StdError::InvalidUtf8 { - msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::InvalidUtf8 { - msg: rhs_msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - msg == rhs_msg - } else { - false - } - } - StdError::NotFound { - kind, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::NotFound { - kind: rhs_kind, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - kind == rhs_kind - } else { - false - } - } - StdError::ParseErr { - target_type, - msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::ParseErr { - target_type: rhs_target_type, - msg: rhs_msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - target_type == rhs_target_type && msg == rhs_msg - } else { - false - } - } - StdError::SerializeErr { - source_type, - msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::SerializeErr { - source_type: rhs_source_type, - msg: rhs_msg, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - source_type == rhs_source_type && msg == rhs_msg - } else { - false - } - } - StdError::Overflow { - source, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::Overflow { - source: rhs_source, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - source == rhs_source - } else { - false - } - } - StdError::DivideByZero { - source, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::DivideByZero { - source: rhs_source, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - source == rhs_source - } else { - false - } - } - StdError::ConversionOverflow { - source, - #[cfg(feature = "backtraces")] - backtrace: _, - } => { - if let StdError::ConversionOverflow { - source: rhs_source, - #[cfg(feature = "backtraces")] - backtrace: _, - } = rhs - { - source == rhs_source - } else { - false - } - } - } + pub fn is(&self) -> bool + where + T: Error + 'static, + { + self.0.inner.is::() } -} -impl From for StdError { - fn from(source: std::str::Utf8Error) -> Self { - Self::invalid_utf8(source) + pub fn kind(&self) -> ErrorKind { + self.0.kind } -} -impl From for StdError { - fn from(source: std::string::FromUtf8Error) -> Self { - Self::invalid_utf8(source) + pub fn with_kind(mut self, kind: ErrorKind) -> Self { + self.0.kind = kind; + self } } -impl From for StdError { - fn from(source: VerificationError) -> Self { - Self::verification_err(source) +impl fmt::Display for StdError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "kind: {:?}, error: {}", self.0.kind, self.0.inner) } } -impl From for StdError { - fn from(source: RecoverPubkeyError) -> Self { - Self::recover_pubkey_err(source) +// Impossible to implement because of blanket `From` impls :( +/*impl Error for StdError { + fn source(&self) -> Option<&(dyn Error + 'static)> { + self.0.inner.source() + } +}*/ + +impl From for StdError +where + E: Error + Send + Sync + 'static, +{ + fn from(value: E) -> Self { + let inner: Box = Box::new(value); + + // "mom, can we have specialization?" + // "we have specialization at home" + // specialization at home: + let kind = if inner.is::() + || inner.is::() + || inner.is::() + || inner.is::() + { + ErrorKind::Parsing + } else if inner.is::() + || inner.is::() + || inner.is::() + || inner.is::() + || inner.is::() + || inner.is::() + || inner.is::() + || inner.is::() + { + ErrorKind::Overflow + } else if inner.is::() + || inner.is::() + || inner.is::() + { + ErrorKind::Serialization + } else if inner.is::() || inner.is::() { + ErrorKind::Cryptography + } else if inner.is::() || inner.is::() { + ErrorKind::Encoding + } else { + ErrorKind::Other + }; + + Self(Box::new(InnerError { + backtrace: BT::capture(), + kind, + inner, + })) } } -impl From for StdError { - fn from(source: OverflowError) -> Self { - Self::overflow(source) - } -} +#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)] +#[non_exhaustive] +pub enum ErrorKind { + Cryptography, + Encoding, + InvalidData, + Overflow, + Parsing, + Serialization, -impl From for StdError { - fn from(source: DivideByZeroError) -> Self { - Self::divide_by_zero(source) - } + Other, } /// The return type for init, execute and query. Since the error type cannot be serialized to JSON, /// this is only available within the contract and its unit tests. /// -/// The prefix "Std" means "the standard result within the standard library". This is not the only -/// result/error type in cosmwasm-std. -pub type StdResult = core::result::Result; +/// The prefix "Core"/"Std" means "the standard result within the core/standard library". This is not the only +/// result/error type in cosmwasm-core/cosmwasm-std. +pub type StdResult = core::result::Result; -#[derive(Error, Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq)] pub enum OverflowOperation { Add, Sub, @@ -488,75 +195,76 @@ pub enum OverflowOperation { impl fmt::Display for OverflowOperation { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self) + write!(f, "{self:?}") } } -#[derive(Error, Debug, PartialEq, Eq)] -#[error("Cannot {operation} with {operand1} and {operand2}")] +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +#[error("Cannot {operation} with given operands")] pub struct OverflowError { pub operation: OverflowOperation, - pub operand1: String, - pub operand2: String, } impl OverflowError { - pub fn new( - operation: OverflowOperation, - operand1: impl ToString, - operand2: impl ToString, - ) -> Self { - Self { - operation, - operand1: operand1.to_string(), - operand2: operand2.to_string(), - } + pub fn new(operation: OverflowOperation) -> Self { + Self { operation } } } /// The error returned by [`TryFrom`] conversions that overflow, for example /// when converting from [`Uint256`] to [`Uint128`]. /// -/// [`TryFrom`]: std::convert::TryFrom +/// [`TryFrom`]: core::convert::TryFrom /// [`Uint256`]: crate::Uint256 /// [`Uint128`]: crate::Uint128 -#[derive(Error, Debug, PartialEq, Eq)] -#[error("Error converting {source_type} to {target_type} for {value}")] +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +#[error("Error converting {source_type} to {target_type}")] pub struct ConversionOverflowError { pub source_type: &'static str, pub target_type: &'static str, - pub value: String, } impl ConversionOverflowError { - pub fn new( - source_type: &'static str, - target_type: &'static str, - value: impl Into, - ) -> Self { + pub fn new(source_type: &'static str, target_type: &'static str) -> Self { Self { source_type, target_type, - value: value.into(), } } } -#[derive(Error, Debug, PartialEq, Eq)] -#[error("Cannot devide {operand} by zero")] -pub struct DivideByZeroError { - pub operand: String, -} +#[derive(Debug, Default, PartialEq, Eq, thiserror::Error)] +#[error("Cannot divide by zero")] +pub struct DivideByZeroError; impl DivideByZeroError { - pub fn new(operand: impl ToString) -> Self { - Self { - operand: operand.to_string(), - } + pub fn new() -> Self { + Self } } -#[derive(Error, Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +pub enum DivisionError { + #[error("Divide by zero")] + DivideByZero, + + #[error("Overflow in division")] + Overflow, +} + +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +pub enum CheckedMultiplyFractionError { + #[error("{_0}")] + DivideByZero(#[from] DivideByZeroError), + + #[error("{_0}")] + ConversionOverflow(#[from] ConversionOverflowError), + + #[error("{_0}")] + Overflow(#[from] OverflowError), +} + +#[derive(Debug, PartialEq, Eq, thiserror::Error)] pub enum CheckedMultiplyRatioError { #[error("Denominator must not be zero")] DivideByZero, @@ -565,7 +273,7 @@ pub enum CheckedMultiplyRatioError { Overflow, } -#[derive(Error, Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, thiserror::Error)] pub enum CheckedFromRatioError { #[error("Denominator must not be zero")] DivideByZero, @@ -574,271 +282,88 @@ pub enum CheckedFromRatioError { Overflow, } -#[derive(Error, Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, thiserror::Error)] #[error("Round up operation failed because of overflow")] pub struct RoundUpOverflowError; -#[cfg(test)] -mod tests { - use super::*; - use std::str; - - // constructors - - // example of reporting contract errors with format! - #[test] - fn generic_err_owned() { - let guess = 7; - let error = StdError::generic_err(format!("{} is too low", guess)); - match error { - StdError::GenericErr { msg, .. } => { - assert_eq!(msg, String::from("7 is too low")); - } - e => panic!("unexpected error, {:?}", e), - } - } - - // example of reporting static contract errors - #[test] - fn generic_err_ref() { - let error = StdError::generic_err("not implemented"); - match error { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "not implemented"), - e => panic!("unexpected error, {:?}", e), - } - } - - #[test] - fn invalid_base64_works_for_strings() { - let error = StdError::invalid_base64("my text"); - match error { - StdError::InvalidBase64 { msg, .. } => { - assert_eq!(msg, "my text"); - } - _ => panic!("expect different error"), - } - } - - #[test] - fn invalid_base64_works_for_errors() { - let original = base64::DecodeError::InvalidLength; - let error = StdError::invalid_base64(original); - match error { - StdError::InvalidBase64 { msg, .. } => { - assert_eq!(msg, "Encoded text cannot have a 6-bit remainder."); - } - _ => panic!("expect different error"), - } - } - - #[test] - fn invalid_data_size_works() { - let error = StdError::invalid_data_size(31, 14); - match error { - StdError::InvalidDataSize { - expected, actual, .. - } => { - assert_eq!(expected, 31); - assert_eq!(actual, 14); - } - _ => panic!("expect different error"), - } - } +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +#[error("Round down operation failed because of overflow")] +pub struct RoundDownOverflowError; - #[test] - fn invalid_hex_works_for_strings() { - let error = StdError::invalid_hex("my text"); - match error { - StdError::InvalidHex { msg, .. } => { - assert_eq!(msg, "my text"); - } - _ => panic!("expect different error"), - } - } - - #[test] - fn invalid_hex_works_for_errors() { - let original = hex::FromHexError::OddLength; - let error = StdError::invalid_hex(original); - match error { - StdError::InvalidHex { msg, .. } => { - assert_eq!(msg, "Odd number of digits"); - } - _ => panic!("expect different error"), - } - } - - #[test] - fn invalid_utf8_works_for_strings() { - let error = StdError::invalid_utf8("my text"); - match error { - StdError::InvalidUtf8 { msg, .. } => { - assert_eq!(msg, "my text"); - } - _ => panic!("expect different error"), - } - } - - #[test] - fn invalid_utf8_works_for_errors() { - let original = String::from_utf8(vec![0x80]).unwrap_err(); - let error = StdError::invalid_utf8(original); - match error { - StdError::InvalidUtf8 { msg, .. } => { - assert_eq!(msg, "invalid utf-8 sequence of 1 bytes from index 0"); - } - _ => panic!("expect different error"), - } - } - - #[test] - fn not_found_works() { - let error = StdError::not_found("gold"); - match error { - StdError::NotFound { kind, .. } => assert_eq!(kind, "gold"), - _ => panic!("expect different error"), - } - } - - #[test] - fn parse_err_works() { - let error = StdError::parse_err("Book", "Missing field: title"); - match error { - StdError::ParseErr { - target_type, msg, .. - } => { - assert_eq!(target_type, "Book"); - assert_eq!(msg, "Missing field: title"); - } - _ => panic!("expect different error"), - } - } +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +pub enum CoinsError { + #[error("Duplicate denom")] + DuplicateDenom, +} - #[test] - fn serialize_err_works() { - let error = StdError::serialize_err("Book", "Content too long"); - match error { - StdError::SerializeErr { - source_type, msg, .. - } => { - assert_eq!(source_type, "Book"); - assert_eq!(msg, "Content too long"); - } - _ => panic!("expect different error"), - } - } +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +pub enum CoinFromStrError { + #[error("Missing denominator")] + MissingDenom, + #[error("Missing amount or non-digit characters in amount")] + MissingAmount, + #[error("Invalid amount: {_0}")] + InvalidAmount(core::num::ParseIntError), +} - #[test] - fn underflow_works_for_u128() { - let error = - StdError::overflow(OverflowError::new(OverflowOperation::Sub, 123u128, 456u128)); - match error { - StdError::Overflow { - source: - OverflowError { - operation, - operand1, - operand2, - }, - .. - } => { - assert_eq!(operation, OverflowOperation::Sub); - assert_eq!(operand1, "123"); - assert_eq!(operand2, "456"); - } - _ => panic!("expect different error"), - } +impl From for CoinFromStrError { + fn from(value: core::num::ParseIntError) -> Self { + Self::InvalidAmount(value) } +} - #[test] - fn overflow_works_for_i64() { - let error = StdError::overflow(OverflowError::new(OverflowOperation::Sub, 777i64, 1234i64)); - match error { - StdError::Overflow { - source: - OverflowError { - operation, - operand1, - operand2, - }, - .. - } => { - assert_eq!(operation, OverflowOperation::Sub); - assert_eq!(operand1, "777"); - assert_eq!(operand2, "1234"); - } - _ => panic!("expect different error"), - } - } +#[cfg(test)] +mod tests { + use super::*; + use core::str; + use std::string; - #[test] - fn divide_by_zero_works() { - let error = StdError::divide_by_zero(DivideByZeroError::new(123u128)); - match error { - StdError::DivideByZero { - source: DivideByZeroError { operand }, - .. - } => assert_eq!(operand, "123"), - _ => panic!("expect different error"), - } + #[derive(Debug, thiserror::Error)] + enum AssertThiserrorWorks { + #[error(transparent)] + Std(#[from] StdError), } #[test] fn implements_debug() { - let error: StdError = StdError::from(OverflowError::new(OverflowOperation::Sub, 3, 5)); - let embedded = format!("Debug: {:?}", error); - #[cfg(not(feature = "backtraces"))] - let expected = r#"Debug: Overflow { source: OverflowError { operation: Sub, operand1: "3", operand2: "5" } }"#; - #[cfg(feature = "backtraces")] - let expected = r#"Debug: Overflow { source: OverflowError { operation: Sub, operand1: "3", operand2: "5" }, backtrace: }"#; - assert_eq!(embedded, expected); + let error: StdError = StdError::from(OverflowError::new(OverflowOperation::Sub)); + let embedded = format!("Debug: {error:?}"); + assert!( + embedded.contains("kind: Overflow, inner: OverflowError { operation: Sub }"), + "{embedded}" + ); } #[test] fn implements_display() { - let error: StdError = StdError::from(OverflowError::new(OverflowOperation::Sub, 3, 5)); - let embedded = format!("Display: {}", error); - assert_eq!(embedded, "Display: Overflow: Cannot Sub with 3 and 5"); - } - - #[test] - fn implements_partial_eq() { - let u1 = StdError::from(OverflowError::new(OverflowOperation::Sub, 3, 5)); - let u2 = StdError::from(OverflowError::new(OverflowOperation::Sub, 3, 5)); - let u3 = StdError::from(OverflowError::new(OverflowOperation::Sub, 3, 7)); - let s1 = StdError::serialize_err("Book", "Content too long"); - let s2 = StdError::serialize_err("Book", "Content too long"); - let s3 = StdError::serialize_err("Book", "Title too long"); - assert_eq!(u1, u2); - assert_ne!(u1, u3); - assert_ne!(u1, s1); - assert_eq!(s1, s2); - assert_ne!(s1, s3); + let error: StdError = StdError::from(OverflowError::new(OverflowOperation::Sub)); + let embedded = format!("Display: {error}"); + assert!( + embedded.contains("kind: Overflow, error: Cannot Sub with given operands"), + "{embedded}" + ); } #[test] fn from_std_str_utf8error_works() { - let error: StdError = str::from_utf8(b"Hello \xF0\x90\x80World") - .unwrap_err() - .into(); - match error { - StdError::InvalidUtf8 { msg, .. } => { - assert_eq!(msg, "invalid utf-8 sequence of 3 bytes from index 6") - } - err => panic!("Unexpected error: {:?}", err), - } + let broken = Vec::from(b"Hello \xF0\x90\x80World" as &[u8]); + let error: StdError = str::from_utf8(&broken).unwrap_err().into(); + assert!(error.is::()); + + assert!(error + .to_string() + .ends_with("invalid utf-8 sequence of 3 bytes from index 6")); } #[test] - fn from_std_string_fromutf8error_works() { + fn from_std_string_from_utf8error_works() { let error: StdError = String::from_utf8(b"Hello \xF0\x90\x80World".to_vec()) .unwrap_err() .into(); - match error { - StdError::InvalidUtf8 { msg, .. } => { - assert_eq!(msg, "invalid utf-8 sequence of 3 bytes from index 6") - } - err => panic!("Unexpected error: {:?}", err), - } + + assert!(error.is::()); + assert!(error + .to_string() + .ends_with("invalid utf-8 sequence of 3 bytes from index 6")); } } diff --git a/packages/std/src/errors/system_error.rs b/packages/std/src/errors/system_error.rs index 27cd40f12e..6c584c08f0 100644 --- a/packages/std/src/errors/system_error.rs +++ b/packages/std/src/errors/system_error.rs @@ -1,3 +1,4 @@ +use alloc::string::String; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -7,12 +8,22 @@ use crate::Binary; /// /// This is used on return values for Querier as a nested result: Result, SystemError> /// The first wrap (SystemError) will trigger if the contract address doesn't exist, -/// the QueryRequest is malformated, etc. The second wrap will be an error message from +/// the QueryRequest is malformed, etc. The second wrap will be an error message from /// the contract itself. /// /// Such errors are only created by the VM. The error type is defined in the standard library, to ensure /// the contract understands the error format without creating a dependency on cosmwasm-vm. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, + Deserialize, + Clone, + Debug, + PartialEq, + Eq, + JsonSchema, + thiserror::Error, + cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] #[non_exhaustive] pub enum SystemError { @@ -28,16 +39,19 @@ pub enum SystemError { /// The address that was attempted to query addr: String, }, + /// A Wasm code was not found. + NoSuchCode { + /// The code ID that is missing + code_id: u64, + }, Unknown {}, UnsupportedRequest { kind: String, }, } -impl std::error::Error for SystemError {} - -impl std::fmt::Display for SystemError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for SystemError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { SystemError::InvalidRequest { error, request } => write!( f, @@ -51,11 +65,58 @@ impl std::fmt::Display for SystemError { error, String::from_utf8_lossy(response) ), - SystemError::NoSuchContract { addr } => write!(f, "No such contract: {}", addr), + SystemError::NoSuchContract { addr } => write!(f, "No such contract: {addr}"), + SystemError::NoSuchCode { code_id } => write!(f, "No such code: {code_id}"), SystemError::Unknown {} => write!(f, "Unknown system error"), SystemError::UnsupportedRequest { kind } => { - write!(f, "Unsupported query type: {}", kind) + write!(f, "Unsupported query type: {kind}") } } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn system_error_no_such_contract_serialization() { + let err = SystemError::NoSuchContract { + addr: "gibtsnicht".to_string(), + }; + + // ser + let json = serde_json::to_vec(&err).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"no_such_contract":{"addr":"gibtsnicht"}}"#, + ); + + // de + let err: SystemError = + serde_json::from_slice(br#"{"no_such_contract":{"addr":"nada"}}"#).unwrap(); + assert_eq!( + err, + SystemError::NoSuchContract { + addr: "nada".to_string() + } + ); + } + + #[test] + fn system_error_no_such_code_serialization() { + let err = SystemError::NoSuchCode { code_id: 13 }; + + // ser + let json = serde_json::to_vec(&err).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"no_such_code":{"code_id":13}}"#, + ); + + // de + let err: SystemError = + serde_json::from_slice(br#"{"no_such_code":{"code_id":987}}"#).unwrap(); + assert_eq!(err, SystemError::NoSuchCode { code_id: 987 },); + } +} diff --git a/packages/std/src/errors/verification_error.rs b/packages/std/src/errors/verification_error.rs index 26786596e5..3beafb9607 100644 --- a/packages/std/src/errors/verification_error.rs +++ b/packages/std/src/errors/verification_error.rs @@ -1,13 +1,32 @@ -#[cfg(feature = "backtraces")] -use std::backtrace::Backtrace; -use std::fmt::Debug; -use thiserror::Error; +use core::fmt::Debug; + +use super::BT; #[cfg(not(target_arch = "wasm32"))] use cosmwasm_crypto::CryptoError; -#[derive(Error, Debug)] +#[derive(Debug, PartialEq, thiserror::Error)] +pub enum AggregationError { + #[error("List of points is empty")] + Empty, + #[error("List is not an expected multiple")] + NotMultiple, +} + +#[derive(Debug, PartialEq, thiserror::Error)] +pub enum PairingEqualityError { + #[error("List is not a multiple of 48")] + NotMultipleG1, + #[error("List is not a multiple of 96")] + NotMultipleG2, + #[error("Not the same amount of points passed")] + UnequalPointAmount, +} + +#[derive(Debug, thiserror::Error)] pub enum VerificationError { + #[error("Aggregation error: {source}")] + Aggregation { source: AggregationError }, #[error("Batch error")] BatchErr, #[error("Generic error")] @@ -20,20 +39,22 @@ pub enum VerificationError { InvalidPubkeyFormat, #[error("Invalid recovery parameter. Supported values: 0 and 1.")] InvalidRecoveryParam, + #[error("Invalid point")] + InvalidPoint, + #[error("Unknown hash function")] + UnknownHashFunction, + #[error("Aggregation pairing equality error: {source}")] + PairingEquality { source: PairingEqualityError }, #[error("Unknown error: {error_code}")] - UnknownErr { - error_code: u32, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + UnknownErr { error_code: u32, backtrace: BT }, } impl VerificationError { pub fn unknown_err(error_code: u32) -> Self { VerificationError::UnknownErr { error_code, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + + backtrace: BT::capture(), } } } @@ -41,6 +62,12 @@ impl VerificationError { impl PartialEq for VerificationError { fn eq(&self, rhs: &VerificationError) -> bool { match self { + VerificationError::Aggregation { source: lhs_source } => { + matches!(rhs, VerificationError::Aggregation { source: rhs_source } if rhs_source == lhs_source) + } + VerificationError::PairingEquality { source: lhs_source } => { + matches!(rhs, VerificationError::PairingEquality { source: rhs_source } if rhs_source == lhs_source) + } VerificationError::BatchErr => matches!(rhs, VerificationError::BatchErr), VerificationError::GenericErr => matches!(rhs, VerificationError::GenericErr), VerificationError::InvalidHashFormat => { @@ -55,6 +82,10 @@ impl PartialEq for VerificationError { VerificationError::InvalidRecoveryParam => { matches!(rhs, VerificationError::InvalidRecoveryParam) } + VerificationError::InvalidPoint => matches!(rhs, VerificationError::InvalidPoint), + VerificationError::UnknownHashFunction => { + matches!(rhs, VerificationError::UnknownHashFunction) + } VerificationError::UnknownErr { error_code, .. } => { if let VerificationError::UnknownErr { error_code: rhs_error_code, @@ -74,12 +105,44 @@ impl PartialEq for VerificationError { impl From for VerificationError { fn from(original: CryptoError) -> Self { match original { + CryptoError::Aggregation { + source: cosmwasm_crypto::AggregationError::Empty, + .. + } => VerificationError::Aggregation { + source: AggregationError::Empty, + }, + CryptoError::Aggregation { + source: cosmwasm_crypto::AggregationError::NotMultiple { .. }, + .. + } => VerificationError::Aggregation { + source: AggregationError::NotMultiple, + }, + CryptoError::PairingEquality { + source: cosmwasm_crypto::PairingEqualityError::NotMultipleG1 { .. }, + .. + } => VerificationError::PairingEquality { + source: PairingEqualityError::NotMultipleG1, + }, + CryptoError::PairingEquality { + source: cosmwasm_crypto::PairingEqualityError::NotMultipleG2 { .. }, + .. + } => VerificationError::PairingEquality { + source: PairingEqualityError::NotMultipleG2, + }, + CryptoError::PairingEquality { + source: cosmwasm_crypto::PairingEqualityError::UnequalPointAmount { .. }, + .. + } => VerificationError::PairingEquality { + source: PairingEqualityError::UnequalPointAmount, + }, CryptoError::InvalidHashFormat { .. } => VerificationError::InvalidHashFormat, CryptoError::InvalidPubkeyFormat { .. } => VerificationError::InvalidPubkeyFormat, CryptoError::InvalidSignatureFormat { .. } => VerificationError::InvalidSignatureFormat, CryptoError::GenericErr { .. } => VerificationError::GenericErr, CryptoError::InvalidRecoveryParam { .. } => VerificationError::InvalidRecoveryParam, + CryptoError::InvalidPoint { .. } => VerificationError::InvalidPoint, CryptoError::BatchErr { .. } => VerificationError::BatchErr, + CryptoError::UnknownHashFunction { .. } => VerificationError::UnknownHashFunction, } } } diff --git a/packages/std/src/exports.rs b/packages/std/src/exports.rs deleted file mode 100644 index a2c986806f..0000000000 --- a/packages/std/src/exports.rs +++ /dev/null @@ -1,656 +0,0 @@ -//! exports exposes the public wasm API -//! -//! interface_version_8, allocate and deallocate turn into Wasm exports -//! as soon as cosmwasm_std is `use`d in the contract, even privately. -//! -//! `do_execute`, `do_instantiate`, `do_migrate`, `do_query`, `do_reply` -//! and `do_sudo` should be wrapped with a extern "C" entry point including -//! the contract-specific function pointer. This is done via the `#[entry_point]` -//! macro attribute from cosmwasm-derive. -use std::marker::PhantomData; -use std::vec::Vec; - -use serde::de::DeserializeOwned; - -use crate::deps::OwnedDeps; -#[cfg(feature = "stargate")] -use crate::ibc::{ - IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, - IbcChannelOpenResponse, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, - IbcReceiveResponse, -}; -use crate::imports::{ExternalApi, ExternalQuerier, ExternalStorage}; -use crate::memory::{alloc, consume_region, release_buffer, Region}; -#[cfg(feature = "abort")] -use crate::panic::install_panic_handler; -use crate::query::CustomQuery; -use crate::results::{ContractResult, QueryResponse, Reply, Response}; -use crate::serde::{from_slice, to_vec}; -use crate::types::Env; -use crate::{CustomMsg, Deps, DepsMut, MessageInfo}; - -#[cfg(feature = "iterator")] -#[no_mangle] -extern "C" fn requires_iterator() -> () {} - -#[cfg(feature = "staking")] -#[no_mangle] -extern "C" fn requires_staking() -> () {} - -#[cfg(feature = "stargate")] -#[no_mangle] -extern "C" fn requires_stargate() -> () {} - -#[cfg(feature = "cosmwasm_1_1")] -#[no_mangle] -extern "C" fn requires_cosmwasm_1_1() -> () {} - -/// interface_version_* exports mark which Wasm VM interface level this contract is compiled for. -/// They can be checked by cosmwasm_vm. -/// Update this whenever the Wasm VM interface breaks. -#[no_mangle] -extern "C" fn interface_version_8() -> () {} - -/// allocate reserves the given number of bytes in wasm memory and returns a pointer -/// to a Region defining this data. This space is managed by the calling process -/// and should be accompanied by a corresponding deallocate -#[no_mangle] -extern "C" fn allocate(size: usize) -> u32 { - alloc(size) as u32 -} - -/// deallocate expects a pointer to a Region created with allocate. -/// It will free both the Region and the memory referenced by the Region. -#[no_mangle] -extern "C" fn deallocate(pointer: u32) { - // auto-drop Region on function end - let _ = unsafe { consume_region(pointer as *mut Region) }; -} - -// TODO: replace with https://doc.rust-lang.org/std/ops/trait.Try.html once stabilized -macro_rules! r#try_into_contract_result { - ($expr:expr) => { - match $expr { - Ok(val) => val, - Err(err) => { - return ContractResult::Err(err.to_string()); - } - } - }; - ($expr:expr,) => { - $crate::try_into_contract_result!($expr) - }; -} - -/// This should be wrapped in an external "C" export, containing a contract-specific function as an argument. -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `M`: message type for request -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -pub fn do_instantiate( - instantiate_fn: &dyn Fn(DepsMut, Env, MessageInfo, M) -> Result, E>, - env_ptr: u32, - info_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - M: DeserializeOwned, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_instantiate( - instantiate_fn, - env_ptr as *mut Region, - info_ptr as *mut Region, - msg_ptr as *mut Region, - ); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_execute should be wrapped in an external "C" export, containing a contract-specific function as arg -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `M`: message type for request -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -pub fn do_execute( - execute_fn: &dyn Fn(DepsMut, Env, MessageInfo, M) -> Result, E>, - env_ptr: u32, - info_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - M: DeserializeOwned, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_execute( - execute_fn, - env_ptr as *mut Region, - info_ptr as *mut Region, - msg_ptr as *mut Region, - ); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_migrate should be wrapped in an external "C" export, containing a contract-specific function as arg -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `M`: message type for request -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -pub fn do_migrate( - migrate_fn: &dyn Fn(DepsMut, Env, M) -> Result, E>, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - M: DeserializeOwned, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_migrate(migrate_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_sudo should be wrapped in an external "C" export, containing a contract-specific function as arg -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `M`: message type for request -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -pub fn do_sudo( - sudo_fn: &dyn Fn(DepsMut, Env, M) -> Result, E>, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - M: DeserializeOwned, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_sudo(sudo_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_reply should be wrapped in an external "C" export, containing a contract-specific function as arg -/// message body is always `SubcallResult` -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -pub fn do_reply( - reply_fn: &dyn Fn(DepsMut, Env, Reply) -> Result, E>, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_reply(reply_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_query should be wrapped in an external "C" export, containing a contract-specific function as arg -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `M`: message type for request -/// - `E`: error type for responses -pub fn do_query( - query_fn: &dyn Fn(Deps, Env, M) -> Result, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - M: DeserializeOwned, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_query(query_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_ibc_channel_open is designed for use with #[entry_point] to make a "C" extern -/// -/// contract_fn does the protocol version negotiation during channel handshake phase -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `E`: error type for responses -#[cfg(feature = "stargate")] -pub fn do_ibc_channel_open( - contract_fn: &dyn Fn(DepsMut, Env, IbcChannelOpenMsg) -> Result, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_ibc_channel_open(contract_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_ibc_channel_connect is designed for use with #[entry_point] to make a "C" extern -/// -/// contract_fn is a callback when a IBC channel is established (after both sides agree in open) -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -#[cfg(feature = "stargate")] -pub fn do_ibc_channel_connect( - contract_fn: &dyn Fn(DepsMut, Env, IbcChannelConnectMsg) -> Result, E>, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_ibc_channel_connect(contract_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_ibc_channel_close is designed for use with #[entry_point] to make a "C" extern -/// -/// contract_fn is a callback when a IBC channel belonging to this contract is closed -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -#[cfg(feature = "stargate")] -pub fn do_ibc_channel_close( - contract_fn: &dyn Fn(DepsMut, Env, IbcChannelCloseMsg) -> Result, E>, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_ibc_channel_close(contract_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_ibc_packet_receive is designed for use with #[entry_point] to make a "C" extern -/// -/// contract_fn is called when this chain receives an IBC Packet on a channel belonging -/// to this contract -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -#[cfg(feature = "stargate")] -pub fn do_ibc_packet_receive( - contract_fn: &dyn Fn(DepsMut, Env, IbcPacketReceiveMsg) -> Result, E>, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_ibc_packet_receive(contract_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_ibc_packet_ack is designed for use with #[entry_point] to make a "C" extern -/// -/// contract_fn is called when this chain receives an IBC Acknowledgement for a packet -/// that this contract previously sent -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -#[cfg(feature = "stargate")] -pub fn do_ibc_packet_ack( - contract_fn: &dyn Fn(DepsMut, Env, IbcPacketAckMsg) -> Result, E>, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_ibc_packet_ack(contract_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -/// do_ibc_packet_timeout is designed for use with #[entry_point] to make a "C" extern -/// -/// contract_fn is called when a packet that this contract previously sent has provably -/// timedout and will never be relayed to the calling chain. This generally behaves -/// like ick_ack_fn upon an acknowledgement containing an error. -/// -/// - `Q`: custom query type (see QueryRequest) -/// - `C`: custom response message type (see CosmosMsg) -/// - `E`: error type for responses -#[cfg(feature = "stargate")] -pub fn do_ibc_packet_timeout( - contract_fn: &dyn Fn(DepsMut, Env, IbcPacketTimeoutMsg) -> Result, E>, - env_ptr: u32, - msg_ptr: u32, -) -> u32 -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - #[cfg(feature = "abort")] - install_panic_handler(); - let res = _do_ibc_packet_timeout(contract_fn, env_ptr as *mut Region, msg_ptr as *mut Region); - let v = to_vec(&res).unwrap(); - release_buffer(v) as u32 -} - -fn _do_instantiate( - instantiate_fn: &dyn Fn(DepsMut, Env, MessageInfo, M) -> Result, E>, - env_ptr: *mut Region, - info_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - M: DeserializeOwned, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let info: Vec = unsafe { consume_region(info_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let info: MessageInfo = try_into_contract_result!(from_slice(&info)); - let msg: M = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - instantiate_fn(deps.as_mut(), env, info, msg).into() -} - -fn _do_execute( - execute_fn: &dyn Fn(DepsMut, Env, MessageInfo, M) -> Result, E>, - env_ptr: *mut Region, - info_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - M: DeserializeOwned, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let info: Vec = unsafe { consume_region(info_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let info: MessageInfo = try_into_contract_result!(from_slice(&info)); - let msg: M = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - execute_fn(deps.as_mut(), env, info, msg).into() -} - -fn _do_migrate( - migrate_fn: &dyn Fn(DepsMut, Env, M) -> Result, E>, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - M: DeserializeOwned, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: M = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - migrate_fn(deps.as_mut(), env, msg).into() -} - -fn _do_sudo( - sudo_fn: &dyn Fn(DepsMut, Env, M) -> Result, E>, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - M: DeserializeOwned, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: M = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - sudo_fn(deps.as_mut(), env, msg).into() -} - -fn _do_reply( - reply_fn: &dyn Fn(DepsMut, Env, Reply) -> Result, E>, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: Reply = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - reply_fn(deps.as_mut(), env, msg).into() -} - -fn _do_query( - query_fn: &dyn Fn(Deps, Env, M) -> Result, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult -where - Q: CustomQuery, - M: DeserializeOwned, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: M = try_into_contract_result!(from_slice(&msg)); - - let deps = make_dependencies(); - query_fn(deps.as_ref(), env, msg).into() -} - -#[cfg(feature = "stargate")] -fn _do_ibc_channel_open( - contract_fn: &dyn Fn(DepsMut, Env, IbcChannelOpenMsg) -> Result, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult -where - Q: CustomQuery, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: IbcChannelOpenMsg = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - contract_fn(deps.as_mut(), env, msg).into() -} - -#[cfg(feature = "stargate")] -fn _do_ibc_channel_connect( - contract_fn: &dyn Fn(DepsMut, Env, IbcChannelConnectMsg) -> Result, E>, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: IbcChannelConnectMsg = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - contract_fn(deps.as_mut(), env, msg).into() -} - -#[cfg(feature = "stargate")] -fn _do_ibc_channel_close( - contract_fn: &dyn Fn(DepsMut, Env, IbcChannelCloseMsg) -> Result, E>, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: IbcChannelCloseMsg = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - contract_fn(deps.as_mut(), env, msg).into() -} - -#[cfg(feature = "stargate")] -fn _do_ibc_packet_receive( - contract_fn: &dyn Fn(DepsMut, Env, IbcPacketReceiveMsg) -> Result, E>, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: IbcPacketReceiveMsg = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - contract_fn(deps.as_mut(), env, msg).into() -} - -#[cfg(feature = "stargate")] -fn _do_ibc_packet_ack( - contract_fn: &dyn Fn(DepsMut, Env, IbcPacketAckMsg) -> Result, E>, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: IbcPacketAckMsg = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - contract_fn(deps.as_mut(), env, msg).into() -} - -#[cfg(feature = "stargate")] -fn _do_ibc_packet_timeout( - contract_fn: &dyn Fn(DepsMut, Env, IbcPacketTimeoutMsg) -> Result, E>, - env_ptr: *mut Region, - msg_ptr: *mut Region, -) -> ContractResult> -where - Q: CustomQuery, - C: CustomMsg, - E: ToString, -{ - let env: Vec = unsafe { consume_region(env_ptr) }; - let msg: Vec = unsafe { consume_region(msg_ptr) }; - - let env: Env = try_into_contract_result!(from_slice(&env)); - let msg: IbcPacketTimeoutMsg = try_into_contract_result!(from_slice(&msg)); - - let mut deps = make_dependencies(); - contract_fn(deps.as_mut(), env, msg).into() -} - -/// Makes all bridges to external dependencies (i.e. Wasm imports) that are injected by the VM -pub(crate) fn make_dependencies() -> OwnedDeps -where - Q: CustomQuery, -{ - OwnedDeps { - storage: ExternalStorage::new(), - api: ExternalApi::new(), - querier: ExternalQuerier::new(), - custom_query_type: PhantomData, - } -} diff --git a/packages/std/src/exports/exports.rs b/packages/std/src/exports/exports.rs new file mode 100644 index 0000000000..4e34f1f40a --- /dev/null +++ b/packages/std/src/exports/exports.rs @@ -0,0 +1,1109 @@ +//! exports exposes the public wasm API +//! +//! interface_version_8, allocate and deallocate turn into Wasm exports +//! as soon as cosmwasm_std is `use`d in the contract, even privately. +//! +//! `do_execute`, `do_instantiate`, `do_migrate`, `do_query`, `do_reply` +//! and `do_sudo` should be wrapped with a extern "C" entry point including +//! the contract-specific function pointer. This is done via the `#[entry_point]` +//! macro attribute from cosmwasm-derive. +use alloc::vec::Vec; +use core::{marker::PhantomData, ptr}; + +use serde::de::DeserializeOwned; + +use super::imports::{ExternalApi, ExternalQuerier, ExternalStorage}; +use super::memory::{Owned, Region}; +use super::panic::install_panic_handler; +use crate::deps::OwnedDeps; +#[cfg(any(feature = "stargate", feature = "ibc2"))] +use crate::ibc::IbcReceiveResponse; +use crate::ibc::{IbcBasicResponse, IbcDestinationCallbackMsg, IbcSourceCallbackMsg}; +#[cfg(feature = "stargate")] +use crate::ibc::{ + IbcChannelCloseMsg, IbcChannelConnectMsg, IbcPacketAckMsg, IbcPacketReceiveMsg, + IbcPacketTimeoutMsg, +}; +use crate::ibc::{IbcChannelOpenMsg, IbcChannelOpenResponse}; +#[cfg(feature = "ibc2")] +use crate::ibc2::{ + Ibc2PacketAckMsg, Ibc2PacketReceiveMsg, Ibc2PacketSendMsg, Ibc2PacketTimeoutMsg, +}; +use crate::query::CustomQuery; +use crate::results::{ContractResult, QueryResponse, Reply, Response}; +use crate::serde::{from_json, to_json_vec}; +use crate::types::Env; +use crate::{CustomMsg, Deps, DepsMut, MessageInfo, MigrateInfo}; + +// These functions are used as markers for the chain to know which features this contract requires. +// If the chain does not support all the required features, it will reject storing the contract. +// See `docs/CAPABILITIES.md` for more details. +#[cfg(feature = "iterator")] +#[no_mangle] +extern "C" fn requires_iterator() {} + +#[cfg(feature = "staking")] +#[no_mangle] +extern "C" fn requires_staking() {} + +#[cfg(feature = "stargate")] +#[no_mangle] +extern "C" fn requires_stargate() {} + +#[cfg(feature = "ibc2")] +#[no_mangle] +extern "C" fn requires_ibc2() {} + +#[cfg(feature = "cosmwasm_1_1")] +#[no_mangle] +extern "C" fn requires_cosmwasm_1_1() {} + +#[cfg(feature = "cosmwasm_1_2")] +#[no_mangle] +extern "C" fn requires_cosmwasm_1_2() {} + +#[cfg(feature = "cosmwasm_1_3")] +#[no_mangle] +extern "C" fn requires_cosmwasm_1_3() {} + +#[cfg(feature = "cosmwasm_1_4")] +#[no_mangle] +extern "C" fn requires_cosmwasm_1_4() {} + +#[cfg(feature = "cosmwasm_2_0")] +#[no_mangle] +extern "C" fn requires_cosmwasm_2_0() {} + +#[cfg(feature = "cosmwasm_2_1")] +#[no_mangle] +extern "C" fn requires_cosmwasm_2_1() {} + +#[cfg(feature = "cosmwasm_2_2")] +#[no_mangle] +extern "C" fn requires_cosmwasm_2_2() {} + +#[cfg(feature = "cosmwasm_3_0")] +#[no_mangle] +extern "C" fn requires_cosmwasm_3_0() {} + +/// interface_version_* exports mark which Wasm VM interface level this contract is compiled for. +/// They can be checked by cosmwasm_vm. +/// Update this whenever the Wasm VM interface breaks. +#[no_mangle] +extern "C" fn interface_version_8() {} + +/// allocate reserves the given number of bytes in wasm memory and returns a pointer +/// to a Region defining this data. This space is managed by the calling process +/// and should be accompanied by a corresponding deallocate +#[no_mangle] +extern "C" fn allocate(size: usize) -> u32 { + Region::with_capacity(size).to_heap_ptr() as u32 +} + +/// deallocate expects a pointer to a Region created with allocate. +/// It will free both the Region and the memory referenced by the Region. +#[no_mangle] +extern "C" fn deallocate(pointer: u32) { + // auto-drop Region on function end + let _ = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(pointer as *mut Region).unwrap()) }; +} + +// TODO: replace with https://doc.rust-lang.org/std/ops/trait.Try.html once stabilized +macro_rules! r#try_into_contract_result { + ($expr:expr) => { + match $expr { + Ok(val) => val, + Err(err) => { + return ContractResult::Err(err.to_string()); + } + } + }; + ($expr:expr,) => { + $crate::try_into_contract_result!($expr) + }; +} + +/// This should be wrapped in an external "C" export, containing a contract-specific function as an argument. +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `M`: message type for request +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +pub fn do_instantiate( + instantiate_fn: &dyn Fn(DepsMut, Env, MessageInfo, M) -> Result, E>, + env_ptr: u32, + info_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_instantiate( + instantiate_fn, + env_ptr as *mut Region, + info_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_execute should be wrapped in an external "C" export, containing a contract-specific function as arg +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `M`: message type for request +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +pub fn do_execute( + execute_fn: &dyn Fn(DepsMut, Env, MessageInfo, M) -> Result, E>, + env_ptr: u32, + info_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_execute( + execute_fn, + env_ptr as *mut Region, + info_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_migrate should be wrapped in an external "C" export, containing a contract-specific function as arg +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `M`: message type for request +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +pub fn do_migrate( + migrate_fn: &dyn Fn(DepsMut, Env, M) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_migrate( + migrate_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_migrate_with_info should be wrapped in an external "C" export, +/// containing a contract-specific function as arg +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `M`: message type for request +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "cosmwasm_2_2")] +pub fn do_migrate_with_info( + migrate_with_info_fn: &dyn Fn(DepsMut, Env, M, MigrateInfo) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, + migrate_info_ptr: u32, +) -> u32 +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_migrate_with_info( + migrate_with_info_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + migrate_info_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_sudo should be wrapped in an external "C" export, containing a contract-specific function as arg +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `M`: message type for request +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +pub fn do_sudo( + sudo_fn: &dyn Fn(DepsMut, Env, M) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_sudo( + sudo_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_reply should be wrapped in an external "C" export, containing a contract-specific function as arg +/// message body is always `SubcallResult` +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +pub fn do_reply( + reply_fn: &dyn Fn(DepsMut, Env, Reply) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_reply( + reply_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_query should be wrapped in an external "C" export, containing a contract-specific function as arg +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `M`: message type for request +/// - `E`: error type for responses +pub fn do_query( + query_fn: &dyn Fn(Deps, Env, M) -> Result, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + M: DeserializeOwned, + E: ToString, +{ + install_panic_handler(); + let res = _do_query( + query_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc_channel_open is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn does the protocol version negotiation during channel handshake phase +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `E`: error type for responses +#[cfg(feature = "stargate")] +pub fn do_ibc_channel_open( + contract_fn: &dyn Fn(DepsMut, Env, IbcChannelOpenMsg) -> Result, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc_channel_open( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc_channel_connect is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is a callback when an IBC channel is established (after both sides agree in open) +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "stargate")] +pub fn do_ibc_channel_connect( + contract_fn: &dyn Fn(DepsMut, Env, IbcChannelConnectMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc_channel_connect( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc_channel_close is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is a callback when an IBC channel belonging to this contract is closed +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "stargate")] +pub fn do_ibc_channel_close( + contract_fn: &dyn Fn(DepsMut, Env, IbcChannelCloseMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc_channel_close( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc_packet_receive is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is called when this chain receives an IBC Packet on a channel belonging +/// to this contract +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "stargate")] +pub fn do_ibc_packet_receive( + contract_fn: &dyn Fn(DepsMut, Env, IbcPacketReceiveMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc_packet_receive( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc_packet_ack is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is called when this chain receives an IBC Acknowledgement for a packet +/// that this contract previously sent +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "stargate")] +pub fn do_ibc_packet_ack( + contract_fn: &dyn Fn(DepsMut, Env, IbcPacketAckMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc_packet_ack( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc_packet_timeout is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is called when a packet that this contract previously sent has provably +/// timed out and will never be relayed to the destination chain. +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "stargate")] +pub fn do_ibc_packet_timeout( + contract_fn: &dyn Fn(DepsMut, Env, IbcPacketTimeoutMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc_packet_timeout( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +pub fn do_ibc_source_callback( + contract_fn: &dyn Fn(DepsMut, Env, IbcSourceCallbackMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc_source_callback( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +pub fn do_ibc_destination_callback( + contract_fn: &dyn Fn( + DepsMut, + Env, + IbcDestinationCallbackMsg, + ) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc_destination_callback( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc2_packet_ack is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is called when this chain receives an Ibc2 acknowledge payload on port belonging +/// to this contract +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "ibc2")] +pub fn do_ibc2_packet_ack( + contract_fn: &dyn Fn(DepsMut, Env, Ibc2PacketAckMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc2_packet_ack( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc2_packet_receive is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is called when this chain receives an Ibc2 payload on port belonging +/// to this contract +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "ibc2")] +pub fn do_ibc2_packet_receive( + contract_fn: &dyn Fn(DepsMut, Env, Ibc2PacketReceiveMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc2_packet_receive( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc2_packet_timeout is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is called when a packet that this contract previously sent has provably +/// timed out and will never be relayed to the destination chain. +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "ibc2")] +pub fn do_ibc2_packet_timeout( + contract_fn: &dyn Fn(DepsMut, Env, Ibc2PacketTimeoutMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc2_packet_timeout( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +/// do_ibc2_packet_send is designed for use with #[entry_point] to make a "C" extern +/// +/// contract_fn is called when there is an Ibc2 payload on port belonging +/// to this contract waiting to be verified before sending it to another +/// blockchain. +/// +/// - `Q`: custom query type (see QueryRequest) +/// - `C`: custom response message type (see CosmosMsg) +/// - `E`: error type for responses +#[cfg(feature = "ibc2")] +pub fn do_ibc2_packet_send( + contract_fn: &dyn Fn(DepsMut, Env, Ibc2PacketSendMsg) -> Result, E>, + env_ptr: u32, + msg_ptr: u32, +) -> u32 +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + install_panic_handler(); + let res = _do_ibc2_packet_send( + contract_fn, + env_ptr as *mut Region, + msg_ptr as *mut Region, + ); + let v = to_json_vec(&res).unwrap(); + Region::from_vec(v).to_heap_ptr() as u32 +} + +fn _do_instantiate( + instantiate_fn: &dyn Fn(DepsMut, Env, MessageInfo, M) -> Result, E>, + env_ptr: *mut Region, + info_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let info: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(info_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let info: MessageInfo = try_into_contract_result!(from_json(info)); + let msg: M = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + instantiate_fn(deps.as_mut(), env, info, msg).into() +} + +fn _do_execute( + execute_fn: &dyn Fn(DepsMut, Env, MessageInfo, M) -> Result, E>, + env_ptr: *mut Region, + info_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let info: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(info_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let info: MessageInfo = try_into_contract_result!(from_json(info)); + let msg: M = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + execute_fn(deps.as_mut(), env, info, msg).into() +} + +fn _do_migrate( + migrate_fn: &dyn Fn(DepsMut, Env, M) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: M = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + migrate_fn(deps.as_mut(), env, msg).into() +} + +fn _do_migrate_with_info( + migrate_with_info_fn: &dyn Fn(DepsMut, Env, M, MigrateInfo) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, + migrate_info_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + let migrate_info = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(migrate_info_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: M = try_into_contract_result!(from_json(msg)); + let migrate_info: MigrateInfo = try_into_contract_result!(from_json(migrate_info)); + + let mut deps = deps_from_imports(); + migrate_with_info_fn(deps.as_mut(), env, msg, migrate_info).into() +} + +fn _do_sudo( + sudo_fn: &dyn Fn(DepsMut, Env, M) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + M: DeserializeOwned, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: M = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + sudo_fn(deps.as_mut(), env, msg).into() +} + +fn _do_reply( + reply_fn: &dyn Fn(DepsMut, Env, Reply) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: Reply = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + reply_fn(deps.as_mut(), env, msg).into() +} + +fn _do_query( + query_fn: &dyn Fn(Deps, Env, M) -> Result, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult +where + Q: CustomQuery, + M: DeserializeOwned, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: M = try_into_contract_result!(from_json(msg)); + + let deps = deps_from_imports(); + query_fn(deps.as_ref(), env, msg).into() +} + +fn _do_ibc_channel_open( + contract_fn: &dyn Fn(DepsMut, Env, IbcChannelOpenMsg) -> Result, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult +where + Q: CustomQuery, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: IbcChannelOpenMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "stargate")] +fn _do_ibc_channel_connect( + contract_fn: &dyn Fn(DepsMut, Env, IbcChannelConnectMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: IbcChannelConnectMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "stargate")] +fn _do_ibc_channel_close( + contract_fn: &dyn Fn(DepsMut, Env, IbcChannelCloseMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: IbcChannelCloseMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "stargate")] +fn _do_ibc_packet_receive( + contract_fn: &dyn Fn(DepsMut, Env, IbcPacketReceiveMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: IbcPacketReceiveMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "stargate")] +fn _do_ibc_packet_ack( + contract_fn: &dyn Fn(DepsMut, Env, IbcPacketAckMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: IbcPacketAckMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "stargate")] +fn _do_ibc_packet_timeout( + contract_fn: &dyn Fn(DepsMut, Env, IbcPacketTimeoutMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: IbcPacketTimeoutMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +fn _do_ibc_source_callback( + contract_fn: &dyn Fn(DepsMut, Env, IbcSourceCallbackMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: IbcSourceCallbackMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +fn _do_ibc_destination_callback( + contract_fn: &dyn Fn( + DepsMut, + Env, + IbcDestinationCallbackMsg, + ) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: IbcDestinationCallbackMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "ibc2")] +fn _do_ibc2_packet_ack( + contract_fn: &dyn Fn(DepsMut, Env, Ibc2PacketAckMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: Ibc2PacketAckMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "ibc2")] +fn _do_ibc2_packet_receive( + contract_fn: &dyn Fn(DepsMut, Env, Ibc2PacketReceiveMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: Ibc2PacketReceiveMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "ibc2")] +fn _do_ibc2_packet_timeout( + contract_fn: &dyn Fn(DepsMut, Env, Ibc2PacketTimeoutMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: Ibc2PacketTimeoutMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +#[cfg(feature = "ibc2")] +fn _do_ibc2_packet_send( + contract_fn: &dyn Fn(DepsMut, Env, Ibc2PacketSendMsg) -> Result, E>, + env_ptr: *mut Region, + msg_ptr: *mut Region, +) -> ContractResult> +where + Q: CustomQuery, + C: CustomMsg, + E: ToString, +{ + let env: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(env_ptr).unwrap()).into_vec() }; + let msg: Vec = + unsafe { Region::from_heap_ptr(ptr::NonNull::new(msg_ptr).unwrap()).into_vec() }; + + let env: Env = try_into_contract_result!(from_json(env)); + let msg: Ibc2PacketSendMsg = try_into_contract_result!(from_json(msg)); + + let mut deps = deps_from_imports(); + contract_fn(deps.as_mut(), env, msg).into() +} + +/// Makes all bridges to external dependencies (i.e. Wasm imports) that are injected by the VM +fn deps_from_imports() -> OwnedDeps +where + Q: CustomQuery, +{ + OwnedDeps { + storage: ExternalStorage::new(), + api: ExternalApi::new(), + querier: ExternalQuerier::new(), + custom_query_type: PhantomData, + } +} diff --git a/packages/std/src/exports/imports.rs b/packages/std/src/exports/imports.rs new file mode 100644 index 0000000000..097ed6a19c --- /dev/null +++ b/packages/std/src/exports/imports.rs @@ -0,0 +1,759 @@ +use alloc::vec::Vec; +use core::ptr; + +#[cfg(feature = "iterator")] +use super::memory::get_optional_region_address; +use super::memory::{Owned, Region}; +use crate::import_helpers::{from_high_half, from_low_half}; +#[cfg(feature = "iterator")] +use crate::iterator::{Order, Record}; +use crate::results::SystemResult; +#[cfg(feature = "iterator")] +use crate::sections::decode_sections2; +use crate::sections::encode_sections; +use crate::serde::from_json; +use crate::traits::{Api, Querier, QuerierResult, Storage}; +use crate::{Addr, CanonicalAddr}; +#[cfg(feature = "cosmwasm_2_1")] +use crate::{AggregationError, HashFunction, PairingEqualityError}; +use crate::{RecoverPubkeyError, StdError, StdResult, SystemError, VerificationError}; + +/// An upper bound for typical canonical address lengths (e.g. 20 in Cosmos SDK/Ethereum or 32 in Nano/Substrate) +const CANONICAL_ADDRESS_BUFFER_LENGTH: usize = 64; +/// An upper bound for typical human readable address formats (e.g. 42 for Ethereum hex addresses or 90 for bech32) +const HUMAN_ADDRESS_BUFFER_LENGTH: usize = 90; + +// This interface will compile into required Wasm imports. +// A complete documentation those functions is available in the VM that provides them: +// https://github.com/CosmWasm/cosmwasm/blob/v1.0.0-beta/packages/vm/src/instance.rs#L89-L206 +extern "C" { + + fn abort(source_ptr: u32); + + fn db_read(key: u32) -> u32; + fn db_write(key: u32, value: u32); + fn db_remove(key: u32); + + // scan creates an iterator, which can be read by consecutive next() calls + #[cfg(feature = "iterator")] + fn db_scan(start_ptr: u32, end_ptr: u32, order: i32) -> u32; + #[cfg(feature = "iterator")] + fn db_next(iterator_id: u32) -> u32; + #[cfg(all(feature = "iterator", feature = "cosmwasm_1_4"))] + fn db_next_key(iterator_id: u32) -> u32; + #[cfg(all(feature = "iterator", feature = "cosmwasm_1_4"))] + fn db_next_value(iterator_id: u32) -> u32; + + fn addr_validate(source_ptr: u32) -> u32; + fn addr_canonicalize(source_ptr: u32, destination_ptr: u32) -> u32; + fn addr_humanize(source_ptr: u32, destination_ptr: u32) -> u32; + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_aggregate_g1(g1s_ptr: u32, out_ptr: u32) -> u32; + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_aggregate_g2(g2s_ptr: u32, out_ptr: u32) -> u32; + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_pairing_equality(ps_ptr: u32, qs_ptr: u32, r_ptr: u32, s_ptr: u32) -> u32; + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_hash_to_g1(hash_function: u32, msg_ptr: u32, dst_ptr: u32, out_ptr: u32) -> u32; + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_hash_to_g2(hash_function: u32, msg_ptr: u32, dst_ptr: u32, out_ptr: u32) -> u32; + + /// Verifies message hashes against a signature with a public key, using the + /// secp256k1 ECDSA parametrization. + /// Returns 0 on verification success, 1 on verification failure, and values + /// greater than 1 in case of error. + fn secp256k1_verify(message_hash_ptr: u32, signature_ptr: u32, public_key_ptr: u32) -> u32; + + fn secp256k1_recover_pubkey( + message_hash_ptr: u32, + signature_ptr: u32, + recovery_param: u32, + ) -> u64; + + /// Verifies message hashes against a signature with a public key, using the + /// secp256r1 ECDSA parametrization. + /// Returns 0 on verification success, 1 on verification failure, and values + /// greater than 1 in case of error. + #[cfg(feature = "cosmwasm_2_1")] + fn secp256r1_verify(message_hash_ptr: u32, signature_ptr: u32, public_key_ptr: u32) -> u32; + + #[cfg(feature = "cosmwasm_2_1")] + fn secp256r1_recover_pubkey( + message_hash_ptr: u32, + signature_ptr: u32, + recovery_param: u32, + ) -> u64; + + /// Verifies a message against a signature with a public key, using the + /// ed25519 EdDSA scheme. + /// Returns 0 on verification success, 1 on verification failure, and values + /// greater than 1 in case of error. + fn ed25519_verify(message_ptr: u32, signature_ptr: u32, public_key_ptr: u32) -> u32; + + /// Verifies a batch of messages against a batch of signatures and public keys, using the + /// ed25519 EdDSA scheme. + /// Returns 0 on verification success, 1 on verification failure, and values + /// greater than 1 in case of error. + fn ed25519_batch_verify(messages_ptr: u32, signatures_ptr: u32, public_keys_ptr: u32) -> u32; + + /// Writes a debug message (UTF-8 encoded) to the host for debugging purposes. + /// The host is free to log or process this in any way it considers appropriate. + /// In production environments it is expected that those messages are discarded. + fn debug(source_ptr: u32); + + /// Executes a query on the chain (import). Not to be confused with the + /// query export, which queries the state of the contract. + fn query_chain(request: u32) -> u32; +} + +/// A stateless convenience wrapper around database imports provided by the VM. +/// This cannot be cloned as it would not copy any data. If you need to clone this, it indicates a flaw in your logic. +pub struct ExternalStorage {} + +impl ExternalStorage { + pub fn new() -> ExternalStorage { + ExternalStorage {} + } +} + +impl Storage for ExternalStorage { + fn get(&self, key: &[u8]) -> Option> { + let key = Region::from_slice(key); + let key_ptr = key.as_ptr() as u32; + + let read = unsafe { db_read(key_ptr) }; + if read == 0 { + // key does not exist in external storage + return None; + } + + let value_ptr = read as *mut Region; + let data = unsafe { Region::from_heap_ptr(ptr::NonNull::new(value_ptr).unwrap()) }; + + Some(data.into_vec()) + } + + fn set(&mut self, key: &[u8], value: &[u8]) { + if value.is_empty() { + panic!("TL;DR: Value must not be empty in Storage::set but in most cases you can use Storage::remove instead. Long story: Getting empty values from storage is not well supported at the moment. Some of our internal interfaces cannot differentiate between a non-existent key and an empty value. Right now, you cannot rely on the behaviour of empty values. To protect you from trouble later on, we stop here. Sorry for the inconvenience! We highly welcome you to contribute to CosmWasm, making this more solid one way or the other."); + } + + let key = Region::from_slice(key); + let key_ptr = key.as_ptr() as u32; + + let value = Region::from_slice(value); + let value_ptr = value.as_ptr() as u32; + + unsafe { db_write(key_ptr, value_ptr) }; + } + + fn remove(&mut self, key: &[u8]) { + let key = Region::from_slice(key); + let key_ptr = key.as_ptr() as u32; + + unsafe { db_remove(key_ptr) }; + } + + #[cfg(feature = "iterator")] + fn range( + &self, + start: Option<&[u8]>, + end: Option<&[u8]>, + order: Order, + ) -> Box> { + let iterator_id = create_iter(start, end, order); + let iter = ExternalIterator { iterator_id }; + Box::new(iter) + } + + #[cfg(all(feature = "cosmwasm_1_4", feature = "iterator"))] + fn range_keys<'a>( + &'a self, + start: Option<&[u8]>, + end: Option<&[u8]>, + order: Order, + ) -> Box> + 'a> { + let iterator_id = create_iter(start, end, order); + let iter = ExternalPartialIterator { + iterator_id, + partial_type: PartialType::Keys, + }; + Box::new(iter) + } + + #[cfg(all(feature = "cosmwasm_1_4", feature = "iterator"))] + fn range_values<'a>( + &'a self, + start: Option<&[u8]>, + end: Option<&[u8]>, + order: Order, + ) -> Box> + 'a> { + let iterator_id = create_iter(start, end, order); + let iter = ExternalPartialIterator { + iterator_id, + partial_type: PartialType::Values, + }; + Box::new(iter) + } +} + +#[cfg(feature = "iterator")] +fn create_iter(start: Option<&[u8]>, end: Option<&[u8]>, order: Order) -> u32 { + // There is lots of gotchas on turning options into regions for FFI, thus this design + // See: https://github.com/CosmWasm/cosmwasm/pull/509 + let start_region = start.map(Region::from_slice); + let end_region = end.map(Region::from_slice); + let start_region_addr = get_optional_region_address(&start_region.as_ref()); + let end_region_addr = get_optional_region_address(&end_region.as_ref()); + unsafe { db_scan(start_region_addr, end_region_addr, order as i32) } +} + +#[cfg(all(feature = "cosmwasm_1_4", feature = "iterator"))] +enum PartialType { + Keys, + Values, +} + +/// ExternalPartialIterator makes a call out to `next_key` or `next_value` +/// depending on its `partial_type`. +/// Compared to `ExternalIterator`, it allows iterating only over the keys or +/// values instead of both. +#[cfg(all(feature = "cosmwasm_1_4", feature = "iterator"))] +struct ExternalPartialIterator { + iterator_id: u32, + partial_type: PartialType, +} + +#[cfg(all(feature = "cosmwasm_1_4", feature = "iterator"))] +impl Iterator for ExternalPartialIterator { + type Item = Vec; + + /// The default implementation calls `next` repeatedly, + /// which we can do a little more efficiently by using `db_next_key` instead. + /// It is used by `skip`, so it allows cheaper skipping. + #[cfg(feature = "cosmwasm_1_4")] + fn nth(&mut self, n: usize) -> Option { + skip_iter(self.iterator_id, n); + self.next() + } + + fn next(&mut self) -> Option { + // here we differentiate between the two types + let next_result = match self.partial_type { + PartialType::Keys => unsafe { db_next_key(self.iterator_id) }, + PartialType::Values => unsafe { db_next_value(self.iterator_id) }, + }; + + if next_result == 0 { + // iterator is done + return None; + } + + let data_region = next_result as *mut Region; + let data = unsafe { Region::from_heap_ptr(ptr::NonNull::new(data_region).unwrap()) }; + + Some(data.into_vec()) + } +} + +#[cfg(feature = "iterator")] +/// ExternalIterator makes a call out to next. +/// We use the pointer to differentiate between multiple open iterators. +struct ExternalIterator { + iterator_id: u32, +} + +#[cfg(feature = "iterator")] +impl Iterator for ExternalIterator { + type Item = Record; + + /// The default implementation calls `next` repeatedly, + /// which we can do a little more efficiently by using `db_next_key` instead. + /// It is used by `skip`, so it allows cheaper skipping. + #[cfg(feature = "cosmwasm_1_4")] + fn nth(&mut self, n: usize) -> Option { + skip_iter(self.iterator_id, n); + self.next() + } + + fn next(&mut self) -> Option { + let next_result = unsafe { db_next(self.iterator_id) }; + let kv_region_ptr = next_result as *mut Region; + let kv = unsafe { Region::from_heap_ptr(ptr::NonNull::new(kv_region_ptr).unwrap()) }; + + let (key, value) = decode_sections2(kv.into_vec()); + + if key.len() == 0 { + None + } else { + Some((key, value)) + } + } +} + +/// Helper function to skip `count` elements of an iterator. +#[cfg(all(feature = "iterator", feature = "cosmwasm_1_4"))] +fn skip_iter(iter_id: u32, count: usize) { + for _ in 0..count { + let region = unsafe { db_next_key(iter_id) }; + if region == 0 { + // early return + return; + } + + // just deallocate the region + unsafe { Region::from_heap_ptr(ptr::NonNull::new(region as *mut Region).unwrap()) }; + } +} + +/// A stateless convenience wrapper around imports provided by the VM +#[derive(Copy, Clone)] +pub struct ExternalApi {} + +impl ExternalApi { + pub fn new() -> ExternalApi { + ExternalApi {} + } +} + +impl Api for ExternalApi { + fn addr_validate(&self, input: &str) -> StdResult { + let input_bytes = input.as_bytes(); + if input_bytes.len() > 256 { + // See MAX_LENGTH_HUMAN_ADDRESS in the VM. + // In this case, the VM will refuse to read the input from the contract. + // Stop here to allow handling the error in the contract. + return Err(StdError::msg("input too long for addr_validate")); + } + let source = Region::from_slice(input_bytes); + let source_ptr = source.as_ptr() as u32; + + let result = unsafe { addr_validate(source_ptr) }; + if result != 0 { + let error = + unsafe { consume_string_region_written_by_vm(result as *mut Region) }; + return Err(StdError::msg(format_args!( + "addr_validate errored: {}", + error + ))); + } + + Ok(Addr::unchecked(input)) + } + + fn addr_canonicalize(&self, input: &str) -> StdResult { + let input_bytes = input.as_bytes(); + if input_bytes.len() > 256 { + // See MAX_LENGTH_HUMAN_ADDRESS in the VM. + // In this case, the VM will refuse to read the input from the contract. + // Stop here to allow handling the error in the contract. + return Err(StdError::msg("input too long for addr_canonicalize")); + } + let send = Region::from_slice(input_bytes); + let send_ptr = send.as_ptr() as u32; + let canon = Region::with_capacity(CANONICAL_ADDRESS_BUFFER_LENGTH); + + let result = unsafe { addr_canonicalize(send_ptr, canon.as_ptr() as u32) }; + if result != 0 { + let error = + unsafe { consume_string_region_written_by_vm(result as *mut Region) }; + return Err(StdError::msg(format_args!( + "addr_canonicalize errored: {}", + error + ))); + } + + Ok(CanonicalAddr::from(canon.into_vec())) + } + + fn addr_humanize(&self, canonical: &CanonicalAddr) -> StdResult { + let send = Region::from_slice(canonical.as_slice()); + let send_ptr = send.as_ptr() as u32; + let human = Region::with_capacity(HUMAN_ADDRESS_BUFFER_LENGTH); + + let result = unsafe { addr_humanize(send_ptr, human.as_ptr() as u32) }; + if result != 0 { + let error = + unsafe { consume_string_region_written_by_vm(result as *mut Region) }; + return Err(StdError::msg(format_args!( + "addr_humanize errored: {}", + error + ))); + } + + let address = unsafe { String::from_utf8_unchecked(human.into_vec()) }; + Ok(Addr::unchecked(address)) + } + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_aggregate_g1(&self, g1s: &[u8]) -> Result<[u8; 48], VerificationError> { + let point = [0_u8; 48]; + + let send = Region::from_slice(g1s); + let send_ptr = send.as_ptr() as u32; + + let out = Region::from_slice(&point); + let out_ptr = out.as_ptr() as u32; + let result = unsafe { bls12_381_aggregate_g1(send_ptr, out_ptr) }; + match result { + 0 => Ok(point), + 8 => Err(VerificationError::InvalidPoint), + 16 => Err(VerificationError::Aggregation { + source: AggregationError::Empty, + }), + 17 => Err(VerificationError::Aggregation { + source: AggregationError::NotMultiple, + }), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_aggregate_g2(&self, g2s: &[u8]) -> Result<[u8; 96], VerificationError> { + let point = [0_u8; 96]; + + let send = Region::from_slice(g2s); + let send_ptr = send.as_ptr() as u32; + + let out = Region::from_slice(&point); + let out_ptr = out.as_ptr() as u32; + let result = unsafe { bls12_381_aggregate_g2(send_ptr, out_ptr) }; + match result { + 0 => Ok(point), + 8 => Err(VerificationError::InvalidPoint), + 14 => Err(VerificationError::Aggregation { + source: AggregationError::Empty, + }), + 15 => Err(VerificationError::Aggregation { + source: AggregationError::NotMultiple, + }), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_pairing_equality( + &self, + ps: &[u8], + qs: &[u8], + r: &[u8], + s: &[u8], + ) -> Result { + let send_ps = Region::from_slice(ps); + let send_qs = Region::from_slice(qs); + let send_r = Region::from_slice(r); + let send_s = Region::from_slice(s); + + let send_ps_ptr = send_ps.as_ptr() as u32; + let send_qs_ptr = send_qs.as_ptr() as u32; + let send_r_ptr = send_r.as_ptr() as u32; + let send_s_ptr = send_s.as_ptr() as u32; + + let result = + unsafe { bls12_381_pairing_equality(send_ps_ptr, send_qs_ptr, send_r_ptr, send_s_ptr) }; + match result { + 0 => Ok(true), + 1 => Ok(false), + 8 => Err(VerificationError::InvalidPoint), + 11 => Err(VerificationError::PairingEquality { + source: PairingEqualityError::NotMultipleG1, + }), + 12 => Err(VerificationError::PairingEquality { + source: PairingEqualityError::NotMultipleG2, + }), + 13 => Err(VerificationError::PairingEquality { + source: PairingEqualityError::UnequalPointAmount, + }), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_hash_to_g1( + &self, + hash_function: HashFunction, + msg: &[u8], + dst: &[u8], + ) -> Result<[u8; 48], VerificationError> { + let point = [0_u8; 48]; + + let send_msg = Region::from_slice(msg); + let send_msg_ptr = send_msg.as_ptr() as u32; + + let send_dst = Region::from_slice(dst); + let send_dst_ptr = send_dst.as_ptr() as u32; + + let out = Region::from_slice(&point); + let out_ptr = out.as_ptr() as u32; + let result = unsafe { + bls12_381_hash_to_g1(hash_function as u32, send_msg_ptr, send_dst_ptr, out_ptr) + }; + + match result { + 0 => Ok(point), + 9 => Err(VerificationError::UnknownHashFunction), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + #[cfg(feature = "cosmwasm_2_1")] + fn bls12_381_hash_to_g2( + &self, + hash_function: HashFunction, + msg: &[u8], + dst: &[u8], + ) -> Result<[u8; 96], VerificationError> { + let point = [0_u8; 96]; + + let send_msg = Region::from_slice(msg); + let send_msg_ptr = send_msg.as_ptr() as u32; + + let send_dst = Region::from_slice(dst); + let send_dst_ptr = send_dst.as_ptr() as u32; + + let out = Region::from_slice(&point); + let out_ptr = out.as_ptr() as u32; + let result = unsafe { + bls12_381_hash_to_g2(hash_function as u32, send_msg_ptr, send_dst_ptr, out_ptr) + }; + + match result { + 0 => Ok(point), + 9 => Err(VerificationError::UnknownHashFunction), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + fn secp256k1_verify( + &self, + message_hash: &[u8], + signature: &[u8], + public_key: &[u8], + ) -> Result { + let hash_send = Region::from_slice(message_hash); + let hash_send_ptr = hash_send.as_ptr() as u32; + let sig_send = Region::from_slice(signature); + let sig_send_ptr = sig_send.as_ptr() as u32; + let pubkey_send = Region::from_slice(public_key); + let pubkey_send_ptr = pubkey_send.as_ptr() as u32; + + let result = unsafe { secp256k1_verify(hash_send_ptr, sig_send_ptr, pubkey_send_ptr) }; + match result { + 0 => Ok(true), + 1 => Ok(false), + 2 => panic!("MessageTooLong must not happen. This is a bug in the VM."), + 3 => Err(VerificationError::InvalidHashFormat), + 4 => Err(VerificationError::InvalidSignatureFormat), + 5 => Err(VerificationError::InvalidPubkeyFormat), + 10 => Err(VerificationError::GenericErr), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + fn secp256k1_recover_pubkey( + &self, + message_hash: &[u8], + signature: &[u8], + recover_param: u8, + ) -> Result, RecoverPubkeyError> { + let hash_send = Region::from_slice(message_hash); + let hash_send_ptr = hash_send.as_ptr() as u32; + let sig_send = Region::from_slice(signature); + let sig_send_ptr = sig_send.as_ptr() as u32; + + let result = + unsafe { secp256k1_recover_pubkey(hash_send_ptr, sig_send_ptr, recover_param.into()) }; + let error_code = from_high_half(result); + let pubkey_ptr = from_low_half(result); + match error_code { + 0 => { + let pubkey = unsafe { + Region::from_heap_ptr( + ptr::NonNull::new(pubkey_ptr as *mut Region).unwrap(), + ) + .into_vec() + }; + Ok(pubkey) + } + 2 => panic!("MessageTooLong must not happen. This is a bug in the VM."), + 3 => Err(RecoverPubkeyError::InvalidHashFormat), + 4 => Err(RecoverPubkeyError::InvalidSignatureFormat), + 6 => Err(RecoverPubkeyError::InvalidRecoveryParam), + error_code => Err(RecoverPubkeyError::unknown_err(error_code)), + } + } + + #[cfg(feature = "cosmwasm_2_1")] + fn secp256r1_verify( + &self, + message_hash: &[u8], + signature: &[u8], + public_key: &[u8], + ) -> Result { + let hash_send = Region::from_slice(message_hash); + let hash_send_ptr = hash_send.as_ptr() as u32; + let sig_send = Region::from_slice(signature); + let sig_send_ptr = sig_send.as_ptr() as u32; + let pubkey_send = Region::from_slice(public_key); + let pubkey_send_ptr = pubkey_send.as_ptr() as u32; + + let result = unsafe { secp256r1_verify(hash_send_ptr, sig_send_ptr, pubkey_send_ptr) }; + match result { + 0 => Ok(true), + 1 => Ok(false), + 2 => panic!("MessageTooLong must not happen. This is a bug in the VM."), + 3 => Err(VerificationError::InvalidHashFormat), + 4 => Err(VerificationError::InvalidSignatureFormat), + 5 => Err(VerificationError::InvalidPubkeyFormat), + 10 => Err(VerificationError::GenericErr), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + #[cfg(feature = "cosmwasm_2_1")] + fn secp256r1_recover_pubkey( + &self, + message_hash: &[u8], + signature: &[u8], + recover_param: u8, + ) -> Result, RecoverPubkeyError> { + let hash_send = Region::from_slice(message_hash); + let hash_send_ptr = hash_send.as_ptr() as u32; + let sig_send = Region::from_slice(signature); + let sig_send_ptr = sig_send.as_ptr() as u32; + + let result = + unsafe { secp256r1_recover_pubkey(hash_send_ptr, sig_send_ptr, recover_param.into()) }; + let error_code = from_high_half(result); + let pubkey_ptr = from_low_half(result); + match error_code { + 0 => { + let pubkey = unsafe { + Region::from_heap_ptr( + ptr::NonNull::new(pubkey_ptr as *mut Region).unwrap(), + ) + .into_vec() + }; + Ok(pubkey) + } + 2 => panic!("MessageTooLong must not happen. This is a bug in the VM."), + 3 => Err(RecoverPubkeyError::InvalidHashFormat), + 4 => Err(RecoverPubkeyError::InvalidSignatureFormat), + 6 => Err(RecoverPubkeyError::InvalidRecoveryParam), + error_code => Err(RecoverPubkeyError::unknown_err(error_code)), + } + } + + fn ed25519_verify( + &self, + message: &[u8], + signature: &[u8], + public_key: &[u8], + ) -> Result { + let msg_send = Region::from_slice(message); + let msg_send_ptr = msg_send.as_ptr() as u32; + let sig_send = Region::from_slice(signature); + let sig_send_ptr = sig_send.as_ptr() as u32; + let pubkey_send = Region::from_slice(public_key); + let pubkey_send_ptr = pubkey_send.as_ptr() as u32; + + let result = unsafe { ed25519_verify(msg_send_ptr, sig_send_ptr, pubkey_send_ptr) }; + match result { + 0 => Ok(true), + 1 => Ok(false), + 2 => panic!("Error code 2 unused since CosmWasm 0.15. This is a bug in the VM."), + 3 => panic!("InvalidHashFormat must not happen. This is a bug in the VM."), + 4 => Err(VerificationError::InvalidSignatureFormat), + 5 => Err(VerificationError::InvalidPubkeyFormat), + 10 => Err(VerificationError::GenericErr), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + fn ed25519_batch_verify( + &self, + messages: &[&[u8]], + signatures: &[&[u8]], + public_keys: &[&[u8]], + ) -> Result { + let msgs_encoded = encode_sections(messages); + let msgs_send = Region::from_vec(msgs_encoded); + let msgs_send_ptr = msgs_send.as_ptr() as u32; + + let sigs_encoded = encode_sections(signatures); + let sig_sends = Region::from_vec(sigs_encoded); + let sigs_send_ptr = sig_sends.as_ptr() as u32; + + let pubkeys_encoded = encode_sections(public_keys); + let pubkeys_send = Region::from_vec(pubkeys_encoded); + let pubkeys_send_ptr = pubkeys_send.as_ptr() as u32; + + let result = + unsafe { ed25519_batch_verify(msgs_send_ptr, sigs_send_ptr, pubkeys_send_ptr) }; + match result { + 0 => Ok(true), + 1 => Ok(false), + 2 => panic!("Error code 2 unused since CosmWasm 0.15. This is a bug in the VM."), + 3 => panic!("InvalidHashFormat must not happen. This is a bug in the VM."), + 4 => Err(VerificationError::InvalidSignatureFormat), + 5 => Err(VerificationError::InvalidPubkeyFormat), + 10 => Err(VerificationError::GenericErr), + error_code => Err(VerificationError::unknown_err(error_code)), + } + } + + fn debug(&self, message: &str) { + // keep the boxes in scope, so we free it at the end (don't cast to pointers same line as Region::from_slice) + let region = Region::from_slice(message.as_bytes()); + let region_ptr = region.as_ptr() as u32; + unsafe { debug(region_ptr) }; + } +} + +/// Takes a pointer to a Region and reads the data into a String. +/// This is for trusted string sources only. +unsafe fn consume_string_region_written_by_vm(from: *mut Region) -> String { + let data = Region::from_heap_ptr(ptr::NonNull::new(from).unwrap()).into_vec(); + // We trust the VM/chain to return correct UTF-8, so let's save some gas + String::from_utf8_unchecked(data) +} + +/// A stateless convenience wrapper around imports provided by the VM +pub struct ExternalQuerier {} + +impl ExternalQuerier { + pub fn new() -> ExternalQuerier { + ExternalQuerier {} + } +} + +impl Querier for ExternalQuerier { + fn raw_query(&self, bin_request: &[u8]) -> QuerierResult { + let req = Region::from_slice(bin_request); + let request_ptr = req.as_ptr() as u32; + + let response_ptr = unsafe { query_chain(request_ptr) }; + let response = unsafe { + Region::from_heap_ptr(ptr::NonNull::new(response_ptr as *mut Region).unwrap()) + .into_vec() + }; + + from_json(&response).unwrap_or_else(|parsing_err| { + SystemResult::Err(SystemError::InvalidResponse { + error: parsing_err.to_string(), + response: response.into(), + }) + }) + } +} + +pub fn handle_panic(message: &str) { + let region = Region::from_slice(message.as_bytes()); + let region_ptr = region.as_ptr() as u32; + unsafe { abort(region_ptr) }; +} diff --git a/packages/std/src/exports/memory.rs b/packages/std/src/exports/memory.rs new file mode 100644 index 0000000000..d0a3bf90d3 --- /dev/null +++ b/packages/std/src/exports/memory.rs @@ -0,0 +1,181 @@ +use alloc::vec::Vec; +use core::{any::TypeId, marker::PhantomData, mem, ops::Deref, ptr, slice}; + +/// This trait is used to indicate whether a region is borrowed or owned +pub trait Ownership: 'static {} + +impl Ownership for Borrowed {} + +impl Ownership for Owned {} + +/// This type is used to indicate that the region is borrowed and must not be deallocated +pub struct Borrowed; + +/// This type is used to indicate that the region is owned by the region and must be deallocated +pub struct Owned; + +/// Describes some data allocated in Wasm's linear memory. +/// A pointer to an instance of this can be returned over FFI boundaries. +/// +/// This struct is crate internal since the cosmwasm-vm defines the same type independently. +#[repr(C)] +pub struct Region { + /// The beginning of the region expressed as bytes from the beginning of the linear memory + pub offset: u32, + /// The number of bytes available in this region + pub capacity: u32, + /// The number of bytes used in this region + pub length: u32, + + _marker: PhantomData, +} + +const _: () = { + assert!(mem::size_of::>() == 12); + assert!(mem::size_of::>() == 12); +}; + +impl Region { + pub fn from_slice(slice: &[u8]) -> Self { + // SAFETY: A slice upholds all the safety variants we need to construct a borrowed Region + unsafe { + let ptr: ptr::NonNull = ptr::NonNull::from(slice).cast(); + Self::from_parts(ptr, slice.len(), slice.len()) + } + } +} + +impl Region { + /// Construct a region from an existing vector + pub fn from_vec(mut vec: Vec) -> Self { + // SAFETY: The `std::vec::Vec` type upholds all the safety invariants required to call `from_parts` + let region = unsafe { + let ptr = ptr::NonNull::new_unchecked(vec.as_mut_ptr()); + Self::from_parts(ptr, vec.capacity(), vec.len()) + }; + // Important and load bearing: call `mem::forget` to prevent memory from being freed + mem::forget(vec); + region + } + + /// Reconstruct a region from a raw pointer pointing to a `Box`. + /// You'll want to use this when you received a region from the VM and want to dereference its contents. + /// + /// # Safety + /// + /// - The pointer must be heap allocated + /// - This region must point to a valid memory region + /// - The memory region this region points to must be heap allocated as well + pub unsafe fn from_heap_ptr(ptr: ptr::NonNull) -> Box { + Box::from_raw(ptr.as_ptr()) + } + + /// Construct a new empty region with *at least* a capacity of what you passed in and a length of 0 + pub fn with_capacity(cap: usize) -> Self { + let data = Vec::with_capacity(cap); + let region = Self::from_vec(data); + region + } + + /// Transform the region into a vector + pub fn into_vec(self) -> Vec { + // SAFETY: Invariants are covered by the safety contract of the constructor + let vector = unsafe { + Vec::from_raw_parts( + self.offset as *mut u8, + self.length as usize, + self.capacity as usize, + ) + }; + mem::forget(self); + vector + } +} + +impl Region +where + O: Ownership, +{ + /// # Safety + /// + /// This function requires the following invariants to be upheld: + /// - `length` is smaller or equal to `capacity` + /// - The number of bytes allocated by the pointer must be equal to `capacity` (if the `Ownership` is `Owned`) + /// - The byte range covered by `length` must be initialized + /// - If the generic `Ownership` parameter is set to `Owned`, the `ptr` must point to a memory region allocated by a `Vec` + unsafe fn from_parts(ptr: ptr::NonNull, capacity: usize, length: usize) -> Self { + // Well, this technically violates pointer provenance rules. + // But there isn't a stable API for it, so that's the best we can do, I guess. + Region { + offset: u32::try_from(ptr.as_ptr() as usize).expect("pointer doesn't fit in u32"), + capacity: u32::try_from(capacity).expect("capacity doesn't fit in u32"), + length: u32::try_from(length).expect("length doesn't fit in u32"), + + _marker: PhantomData, + } + } + + /// Access the memory region this region points to in form of a byte slice + pub fn as_bytes(&self) -> &[u8] { + // SAFETY: Safety contract of constructor requires `length` bytes to be initialized + unsafe { slice::from_raw_parts(self.offset as *const u8, self.length as usize) } + } + + /// Obtain the pointer to the region + /// + /// This is nothing but `&self as *const Region` but makes sure the correct generic parameter is used + pub fn as_ptr(&self) -> *const Self { + self + } + + /// Transform the region into an unmanaged mutable pointer + /// + /// This means we move this regions onto the heap (note, only the *structure* of the region, not the *contents of the pointer* we manage internally). + /// To then deallocate this structure, you'll have to reconstruct the region via [`Region::from_heap_ptr`] and drop it. + pub fn to_heap_ptr(self) -> *mut Self { + let boxed = Box::new(self); + Box::into_raw(boxed) + } +} + +impl Deref for Region +where + O: Ownership, +{ + type Target = [u8]; + + fn deref(&self) -> &Self::Target { + self.as_bytes() + } +} + +impl Drop for Region +where + O: Ownership, +{ + fn drop(&mut self) { + // Since we can't specialize the drop impl we need to perform a runtime check + if TypeId::of::() == TypeId::of::() { + let region_start = ptr::NonNull::new(self.offset as *mut u8).unwrap(); + + // SAFETY: Since `from_parts` was required to uphold the invariant that if the parameter is `Owned` + // the memory has been allocated through a `Vec`, we can safely reconstruct the `Vec` and deallocate it. + unsafe { + let data = Vec::from_raw_parts( + region_start.as_ptr(), + self.length as usize, + self.capacity as usize, + ); + + drop(data); + } + } + } +} + +/// Returns the address of the optional Region as an offset in linear memory, +/// or zero if not present +#[cfg(feature = "iterator")] +pub fn get_optional_region_address(region: &Option<&Region>) -> u32 { + region.map(|r| r.as_ptr() as u32).unwrap_or(0) +} diff --git a/packages/std/src/exports/mod.rs b/packages/std/src/exports/mod.rs new file mode 100644 index 0000000000..0a38899879 --- /dev/null +++ b/packages/std/src/exports/mod.rs @@ -0,0 +1,20 @@ +mod exports; +mod imports; +mod memory; // Used by exports and imports only. This assumes pointers are 32 bit long, which makes it untestable on dev machines. +mod panic; + +#[cfg(feature = "cosmwasm_2_2")] +pub use exports::do_migrate_with_info; +pub use exports::{ + do_execute, do_ibc_destination_callback, do_ibc_source_callback, do_instantiate, do_migrate, + do_query, do_reply, do_sudo, +}; +#[cfg(feature = "ibc2")] +pub use exports::{ + do_ibc2_packet_ack, do_ibc2_packet_receive, do_ibc2_packet_send, do_ibc2_packet_timeout, +}; +#[cfg(feature = "stargate")] +pub use exports::{ + do_ibc_channel_close, do_ibc_channel_connect, do_ibc_channel_open, do_ibc_packet_ack, + do_ibc_packet_receive, do_ibc_packet_timeout, +}; diff --git a/packages/std/src/panic.rs b/packages/std/src/exports/panic.rs similarity index 90% rename from packages/std/src/panic.rs rename to packages/std/src/exports/panic.rs index 7ca619e31a..adfab4f34a 100644 --- a/packages/std/src/panic.rs +++ b/packages/std/src/exports/panic.rs @@ -3,7 +3,6 @@ /// /// This overrides any previous panic handler. See /// for details. -#[cfg(all(feature = "abort", target_arch = "wasm32"))] pub fn install_panic_handler() { use super::imports::handle_panic; std::panic::set_hook(Box::new(|info| { diff --git a/packages/std/src/forward_ref.rs b/packages/std/src/forward_ref.rs new file mode 100644 index 0000000000..7be5b91686 --- /dev/null +++ b/packages/std/src/forward_ref.rs @@ -0,0 +1,84 @@ +/// # ⚠ THIS IS AN INTERNAL IMPLEMENTATION DETAIL. DO NOT USE. +/// +/// Given an implementation of `T == U`, implements: +/// - `&T == U` +/// - `T == &U` +/// +/// We don't need to add `&T == &U` here because this is implemented automatically. +#[doc(hidden)] +#[macro_export] +macro_rules! __internal__forward_ref_partial_eq { + ($t:ty, $u:ty) => { + // `&T == U` + impl<'a> PartialEq<$u> for &'a $t { + #[inline] + fn eq(&self, rhs: &$u) -> bool { + **self == *rhs // Implement via T == U + } + } + + // `T == &U` + impl PartialEq<&$u> for $t { + #[inline] + fn eq(&self, rhs: &&$u) -> bool { + *self == **rhs // Implement via T == U + } + } + }; +} + +/// implements binary operators "&T op U", "T op &U", "&T op &U" +/// based on "T op U" where T and U are expected to be `Copy`able +/// +/// Copied from `libcore` +macro_rules! forward_ref_binop { + (impl $imp:ident, $method:ident for $t:ty, $u:ty) => { + impl<'a> $imp<$u> for &'a $t { + type Output = <$t as $imp<$u>>::Output; + + #[inline] + #[track_caller] + fn $method(self, other: $u) -> <$t as $imp<$u>>::Output { + $imp::$method(*self, other) + } + } + + impl $imp<&$u> for $t { + type Output = <$t as $imp<$u>>::Output; + + #[inline] + #[track_caller] + fn $method(self, other: &$u) -> <$t as $imp<$u>>::Output { + $imp::$method(self, *other) + } + } + + impl $imp<&$u> for &$t { + type Output = <$t as $imp<$u>>::Output; + + #[inline] + #[track_caller] + fn $method(self, other: &$u) -> <$t as $imp<$u>>::Output { + $imp::$method(*self, *other) + } + } + }; +} + +/// implements "T op= &U", based on "T op= U" +/// where U is expected to be `Copy`able +/// +/// Copied from `libcore` +macro_rules! forward_ref_op_assign { + (impl $imp:ident, $method:ident for $t:ty, $u:ty) => { + impl $imp<&$u> for $t { + #[inline] + #[track_caller] + fn $method(&mut self, other: &$u) { + $imp::$method(self, *other); + } + } + }; +} + +pub(crate) use {forward_ref_binop, forward_ref_op_assign}; diff --git a/packages/std/src/hex_binary.rs b/packages/std/src/hex_binary.rs index 4aa5f7cc8e..2a78a7739c 100644 --- a/packages/std/src/hex_binary.rs +++ b/packages/std/src/hex_binary.rs @@ -1,27 +1,40 @@ -use std::fmt; -use std::ops::Deref; +use alloc::{string::String, vec::Vec}; +use core::fmt; +use core::ops::Deref; -use schemars::JsonSchema; use serde::{de, ser, Deserialize, Deserializer, Serialize}; -use crate::{Binary, StdError, StdResult}; +use crate::{ + encoding::{from_hex, to_hex}, + Binary, StdError, StdResult, +}; /// This is a wrapper around Vec to add hex de/serialization /// with serde. It also adds some helper methods to help encode inline. /// /// This is similar to `cosmwasm_std::Binary` but uses hex. /// See also . -#[derive(Clone, Default, PartialEq, Eq, Hash, PartialOrd, Ord, JsonSchema)] +#[derive( + Clone, + Default, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::HexBinary)] pub struct HexBinary(#[schemars(with = "String")] Vec); impl HexBinary { pub fn from_hex(input: &str) -> StdResult { - let vec = hex::decode(input).map_err(StdError::invalid_hex)?; - Ok(Self(vec)) + from_hex(input).map(Self) } pub fn to_hex(&self) -> String { - hex::encode(&self.0) + to_hex(&self.0) } pub fn as_slice(&self) -> &[u8] { @@ -51,7 +64,10 @@ impl HexBinary { /// ``` pub fn to_array(&self) -> StdResult<[u8; LENGTH]> { if self.len() != LENGTH { - return Err(StdError::invalid_data_size(LENGTH, self.len())); + return Err(StdError::msg(format_args!( + "invalid length. expected {LENGTH}, got {}", + self.len() + ))); } let mut out: [u8; LENGTH] = [0; LENGTH]; @@ -69,22 +85,16 @@ impl fmt::Display for HexBinary { impl fmt::Debug for HexBinary { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Use an output inspired by tuples (https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_tuple) - // but with a custom implementation to avoid the need for an intemediate hex string. + // but with a custom implementation to avoid the need for an intermediate hex string. write!(f, "HexBinary(")?; for byte in self.0.iter() { - write!(f, "{:02x}", byte)?; + write!(f, "{byte:02x}")?; } write!(f, ")")?; Ok(()) } } -impl From<&[u8]> for HexBinary { - fn from(binary: &[u8]) -> Self { - Self(binary.to_vec()) - } -} - /// Just like Vec, HexBinary is a smart pointer to [u8]. /// This implements `*data` for us and allows us to /// do `&*data`, returning a `&[u8]` from a `&HexBinary`. @@ -98,14 +108,27 @@ impl Deref for HexBinary { } } -// Reference +impl AsRef<[u8]> for HexBinary { + fn as_ref(&self) -> &[u8] { + self.as_slice() + } +} + +// Slice +impl From<&[u8]> for HexBinary { + fn from(binary: &[u8]) -> Self { + Self(binary.to_vec()) + } +} + +// Array reference impl From<&[u8; LENGTH]> for HexBinary { fn from(source: &[u8; LENGTH]) -> Self { Self(source.to_vec()) } } -// Owned +// Owned array impl From<[u8; LENGTH]> for HexBinary { fn from(source: [u8; LENGTH]) -> Self { Self(source.into()) @@ -136,7 +159,7 @@ impl From for Binary { } } -/// Implement `HexBinary == std::vec::Vec` +/// Implement `HexBinary == alloc::vec::Vec` impl PartialEq> for HexBinary { fn eq(&self, rhs: &Vec) -> bool { // Use Vec == Vec @@ -144,7 +167,7 @@ impl PartialEq> for HexBinary { } } -/// Implement `std::vec::Vec == HexBinary` +/// Implement `alloc::vec::Vec == HexBinary` impl PartialEq for Vec { fn eq(&self, rhs: &HexBinary) -> bool { // Use Vec == Vec @@ -202,7 +225,11 @@ impl Serialize for HexBinary { where S: ser::Serializer, { - serializer.serialize_str(&self.to_hex()) + if serializer.is_human_readable() { + serializer.serialize_str(&self.to_hex()) + } else { + serializer.serialize_bytes(&self.0) + } } } @@ -212,13 +239,17 @@ impl<'de> Deserialize<'de> for HexBinary { where D: Deserializer<'de>, { - deserializer.deserialize_str(HexVisitor) + if deserializer.is_human_readable() { + deserializer.deserialize_str(HexVisitor) + } else { + deserializer.deserialize_bytes(BytesVisitor) + } } } struct HexVisitor; -impl<'de> de::Visitor<'de> for HexVisitor { +impl de::Visitor<'_> for HexVisitor { type Value = HexBinary; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -231,19 +262,33 @@ impl<'de> de::Visitor<'de> for HexVisitor { { match HexBinary::from_hex(v) { Ok(data) => Ok(data), - Err(_) => Err(E::custom(format!("invalid hex: {}", v))), + Err(_) => Err(E::custom(format!("invalid hex: {v}"))), } } } +struct BytesVisitor; + +impl de::Visitor<'_> for BytesVisitor { + type Value = HexBinary; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("byte array") + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: de::Error, + { + Ok(HexBinary(v.to_vec())) + } +} + #[cfg(test)] mod tests { use super::*; - use crate::{from_slice, to_vec, StdError}; - use std::collections::hash_map::DefaultHasher; - use std::collections::HashSet; - use std::hash::{Hash, Hasher}; + use crate::{assert_hash_works, errors::ErrorKind}; #[test] fn from_hex_works() { @@ -262,42 +307,36 @@ mod tests { assert_eq!(data.as_slice(), b"randomiZ"); // odd - match HexBinary::from_hex("123").unwrap_err() { - StdError::InvalidHex { msg, .. } => { - assert_eq!(msg, "Odd number of digits") - } - _ => panic!("Unexpected error type"), - } + assert!(HexBinary::from_hex("123") + .unwrap_err() + .to_string() + .ends_with("Odd number of digits")); // non-hex - match HexBinary::from_hex("efgh").unwrap_err() { - StdError::InvalidHex { msg, .. } => { - assert_eq!(msg, "Invalid character 'g' at position 2") - } - _ => panic!("Unexpected error type"), - } + assert!(HexBinary::from_hex("efgh") + .unwrap_err() + .to_string() + .ends_with("Invalid character 'g' at position 2")); // 0x prefixed - match HexBinary::from_hex("0xaa").unwrap_err() { - StdError::InvalidHex { msg, .. } => { - assert_eq!(msg, "Invalid character 'x' at position 1") - } - _ => panic!("Unexpected error type"), - } + assert!(HexBinary::from_hex("0xaa") + .unwrap_err() + .to_string() + .ends_with("Invalid character 'x' at position 1")); // spaces assert!(matches!( - HexBinary::from_hex("aa ").unwrap_err(), - StdError::InvalidHex { .. } + HexBinary::from_hex("aa ").unwrap_err().kind(), + ErrorKind::Encoding, )); assert!(matches!( - HexBinary::from_hex(" aa").unwrap_err(), - StdError::InvalidHex { .. } + HexBinary::from_hex(" aa").unwrap_err().kind(), + ErrorKind::Encoding, )); assert!(matches!( - HexBinary::from_hex("a a").unwrap_err(), - StdError::InvalidHex { .. } + HexBinary::from_hex("a a").unwrap_err().kind(), + ErrorKind::Encoding, )); assert!(matches!( - HexBinary::from_hex(" aa ").unwrap_err(), - StdError::InvalidHex { .. } + HexBinary::from_hex(" aa ").unwrap_err().kind(), + ErrorKind::Encoding, )); } @@ -331,15 +370,9 @@ mod tests { // invalid size let binary = HexBinary::from(&[1, 2, 3]); let error = binary.to_array::<8>().unwrap_err(); - match error { - StdError::InvalidDataSize { - expected, actual, .. - } => { - assert_eq!(expected, 8); - assert_eq!(actual, 3); - } - err => panic!("Unexpected error: {:?}", err), - } + assert!(error + .to_string() + .ends_with("invalid length. expected 8, got 3")); // long array (32 bytes) let binary = @@ -372,7 +405,7 @@ mod tests { } #[test] - fn from_slice_works() { + fn from_json_works() { let original: &[u8] = &[0u8, 187, 61, 11, 250, 0]; let binary: HexBinary = original.into(); assert_eq!(binary.as_slice(), [0u8, 187, 61, 11, 250, 0]); @@ -511,8 +544,8 @@ mod tests { fn serialization_works() { let binary = HexBinary(vec![0u8, 187, 61, 11, 250, 0]); - let json = to_vec(&binary).unwrap(); - let deserialized: HexBinary = from_slice(&json).unwrap(); + let json = serde_json::to_vec(&binary).unwrap(); + let deserialized: HexBinary = serde_json::from_slice(&json).unwrap(); assert_eq!(binary, deserialized); } @@ -523,16 +556,42 @@ mod tests { // this is the binary behind above string let expected = vec![0u8, 187, 61, 11, 250, 0]; - let serialized = to_vec(&hex).unwrap(); - let deserialized: HexBinary = from_slice(&serialized).unwrap(); + let serialized = serde_json::to_vec(&hex).unwrap(); + let deserialized: HexBinary = serde_json::from_slice(&serialized).unwrap(); assert_eq!(expected, deserialized.as_slice()); } #[test] fn deserialize_from_invalid_string() { let invalid_str = "**BAD!**"; - let serialized = to_vec(&invalid_str).unwrap(); - let res = from_slice::(&serialized); + let serialized = serde_json::to_vec(&invalid_str).unwrap(); + let res = serde_json::from_slice::(&serialized); + assert!(res.is_err()); + } + + #[test] + fn msgpack_serialization_works() { + let data = HexBinary(vec![0u8, 187, 61, 11, 250, 0]); + // see: https://github.com/msgpack/msgpack/blob/8aa09e2/spec.md#bin-format-family + let expected = [196, 6, 0, 187, 61, 11, 250, 0]; + + assert_eq!(rmp_serde::to_vec(&data).unwrap(), expected); + } + + #[test] + fn msgpack_deserialize_from_valid_data() { + // see: https://github.com/msgpack/msgpack/blob/8aa09e2/spec.md#bin-format-family + let serialized = vec![196, 6, 0, 187, 61, 11, 250, 0]; + let expected = vec![0u8, 187, 61, 11, 250, 0]; + + let deserialized: HexBinary = rmp_serde::from_slice(&serialized).unwrap(); + assert_eq!(expected, deserialized.as_slice()); + } + + #[test] + fn msgpack_deserialize_from_invalid_data() { + let invalid_data = vec![0, 1, 2, 3, 4, 5]; + let res = rmp_serde::from_slice::(&invalid_data); assert!(res.is_err()); } @@ -540,11 +599,11 @@ mod tests { fn hex_binary_implements_debug() { // Some data let data = HexBinary(vec![0x07, 0x35, 0xAA, 0xcb, 0x00, 0xff]); - assert_eq!(format!("{:?}", data), "HexBinary(0735aacb00ff)",); + assert_eq!(format!("{data:?}"), "HexBinary(0735aacb00ff)",); // Empty let data = HexBinary(vec![]); - assert_eq!(format!("{:?}", data), "HexBinary()",); + assert_eq!(format!("{data:?}"), "HexBinary()",); } #[test] @@ -561,42 +620,20 @@ mod tests { } #[test] - fn hex_binary_implements_hash() { - let a1 = HexBinary::from([0, 187, 61, 11, 250, 0]); - let mut hasher = DefaultHasher::new(); - a1.hash(&mut hasher); - let a1_hash = hasher.finish(); - - let a2 = HexBinary::from([0, 187, 61, 11, 250, 0]); - let mut hasher = DefaultHasher::new(); - a2.hash(&mut hasher); - let a2_hash = hasher.finish(); - - let b = HexBinary::from([16, 21, 33, 0, 255, 9]); - let mut hasher = DefaultHasher::new(); - b.hash(&mut hasher); - let b_hash = hasher.finish(); - - assert_eq!(a1_hash, a2_hash); - assert_ne!(a1_hash, b_hash); + fn hex_binary_implements_as_ref() { + let want = &[7u8, 35, 49, 101, 0, 255]; + let data = HexBinary(want.to_vec()); + assert_eq!(want, AsRef::<[u8]>::as_ref(&data)); + assert_eq!(want, AsRef::<[u8]>::as_ref(&&data)); } - /// This requires Hash and Eq to be implemented + /// Tests that `HexBinary` implements `EQ` and `Hash` correctly and thus can + /// be used with hash maps and sets. #[test] - fn hex_binary_can_be_used_in_hash_set() { - let a1 = HexBinary::from([0, 187, 61, 11, 250, 0]); - let a2 = HexBinary::from([0, 187, 61, 11, 250, 0]); + fn hex_binary_implements_hash_eq() { + let a = HexBinary::from([0, 187, 61, 11, 250, 0]); let b = HexBinary::from([16, 21, 33, 0, 255, 9]); - - let mut set = HashSet::new(); - set.insert(a1.clone()); - set.insert(a2.clone()); - set.insert(b.clone()); - assert_eq!(set.len(), 2); - - let set1 = HashSet::::from_iter(vec![b.clone(), a1.clone()]); - let set2 = HashSet::from_iter(vec![a1, a2, b]); - assert_eq!(set1, set2); + assert_hash_works!(a, b); } #[test] diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index 1ce06432a6..e83d73c46d 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -1,24 +1,29 @@ -#![cfg(feature = "stargate")] // The CosmosMsg variants are defined in results/cosmos_msg.rs // The rest of the IBC related functionality is defined here +use core::cmp::{Ord, Ordering, PartialOrd}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use std::cmp::{Ord, Ordering, PartialOrd}; -#[cfg(feature = "ibc3")] -use crate::addresses::Addr; -use crate::binary::Binary; use crate::coin::Coin; -use crate::errors::StdResult; +use crate::prelude::*; use crate::results::{Attribute, CosmosMsg, Empty, Event, SubMsg}; -use crate::serde::to_binary; -use crate::timestamp::Timestamp; +use crate::StdResult; +use crate::{to_json_binary, Binary}; +use crate::{Addr, Timestamp}; + +mod callbacks; +mod transfer_msg_builder; + +pub use callbacks::*; +pub use transfer_msg_builder::*; /// These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts /// (contracts that directly speak the IBC protocol via 6 entry points) #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum IbcMsg { /// Sends bank tokens owned by the contract to the given address on another chain. @@ -27,7 +32,7 @@ pub enum IbcMsg { /// We cannot select the port_id, this is whatever the local chain has bound the ibctransfer /// module to. Transfer { - /// exisiting channel to send the tokens over + /// existing channel to send the tokens over channel_id: String, /// address on the remote chain to receive these tokens to_address: String, @@ -36,6 +41,18 @@ pub enum IbcMsg { amount: Coin, /// when packet times out, measured on remote chain timeout: IbcTimeout, + /// An optional memo. See the blog post + /// ["Moving Beyond Simple Token Transfers"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) + /// for more information. + /// + /// There is no difference between setting this to `None` or an empty string. + /// + /// This field is only supported on chains with CosmWasm >= 2.0 and silently + /// ignored on older chains. + /// If you need support for both 1.x and 2.x chain with the same codebase, + /// it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer + /// protobuf encoder instead. + memo: Option, }, /// Sends an IBC packet with given data over the existing channel. /// Data should be encoded in a format defined by the channel version, @@ -46,12 +63,25 @@ pub enum IbcMsg { /// when packet times out, measured on remote chain timeout: IbcTimeout, }, + /// Acknowledges a packet that this contract received over IBC. + /// This allows acknowledging a packet that was not acknowledged yet in the `ibc_packet_receive` call. + #[cfg(feature = "cosmwasm_2_1")] + WriteAcknowledgement { + /// Existing channel where the packet was received + channel_id: String, + /// Sequence number of the packet that was received + packet_sequence: u64, + /// The acknowledgement to send back + ack: IbcAcknowledgement, + }, /// This will close an existing channel that is owned by this contract. /// Port is auto-assigned to the contract's IBC port CloseChannel { channel_id: String }, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct IbcEndpoint { pub port_id: String, pub channel_id: String, @@ -60,7 +90,9 @@ pub struct IbcEndpoint { /// In IBC each package must set at least one type of timeout: /// the timestamp or the block height. Using this rather complex enum instead of /// two timeout fields we ensure that at least one timeout is set. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub struct IbcTimeout { // use private fields to enforce the use of constructors, which ensure that at least one is set @@ -115,7 +147,9 @@ impl From for IbcTimeout { /// IbcChannel defines all information on a channel. /// This is generally used in the hand-shake process, but can be queried directly. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct IbcChannel { pub endpoint: IbcEndpoint, @@ -150,7 +184,9 @@ impl IbcChannel { /// IbcOrder defines if a channel is ORDERED or UNORDERED /// Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 /// Naming comes from the protobuf files and go translations. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub enum IbcOrder { #[serde(rename = "ORDER_UNORDERED")] Unordered, @@ -162,10 +198,12 @@ pub enum IbcOrder { /// that can be compared against another Height for the purposes of updating and /// freezing clients. /// Ordering is (revision_number, timeout_height) -#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct IbcTimeoutBlock { /// the version that the client is currently on - /// (eg. after reseting the chain this could increment 1 as height drops to 0) + /// (e.g. after resetting the chain this could increment 1 as height drops to 0) pub revision: u64, /// block height after which the packet times out. /// the height within the given revision @@ -193,7 +231,9 @@ impl Ord for IbcTimeoutBlock { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct IbcPacket { /// The raw data sent from the other side in the packet @@ -226,7 +266,9 @@ impl IbcPacket { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct IbcAcknowledgement { pub data: Binary, @@ -241,13 +283,15 @@ impl IbcAcknowledgement { pub fn encode_json(data: &impl Serialize) -> StdResult { Ok(IbcAcknowledgement { - data: to_binary(data)?, + data: to_json_binary(data)?, }) } } /// The message that is passed into `ibc_channel_open` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum IbcChannelOpenMsg { /// The ChanOpenInit step from https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#channel-lifecycle-management @@ -298,21 +342,23 @@ impl From for IbcChannel { } } -/// Note that this serializes as "null". -#[cfg(not(feature = "ibc3"))] -pub type IbcChannelOpenResponse = (); -/// This serializes either as "null" or a JSON object. -#[cfg(feature = "ibc3")] +/// This serializes either as `null` or a JSON object. +/// Within the response, a channel version can be specified. +/// If `null` is provided instead, the incoming channel version is accepted. pub type IbcChannelOpenResponse = Option; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct Ibc3ChannelOpenResponse { /// We can set the channel version to a different one than we were called with pub version: String, } /// The message that is passed into `ibc_channel_connect` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum IbcChannelConnectMsg { /// The ChanOpenAck step from https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#channel-lifecycle-management @@ -364,7 +410,9 @@ impl From for IbcChannel { } /// The message that is passed into `ibc_channel_close` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum IbcChannelCloseMsg { /// The ChanCloseInit step from https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#channel-lifecycle-management @@ -400,46 +448,33 @@ impl From for IbcChannel { } /// The message that is passed into `ibc_packet_receive` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct IbcPacketReceiveMsg { pub packet: IbcPacket, - #[cfg(feature = "ibc3")] pub relayer: Addr, } impl IbcPacketReceiveMsg { - #[cfg(not(feature = "ibc3"))] - pub fn new(packet: IbcPacket) -> Self { - Self { packet } - } - - #[cfg(feature = "ibc3")] pub fn new(packet: IbcPacket, relayer: Addr) -> Self { Self { packet, relayer } } } /// The message that is passed into `ibc_packet_ack` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct IbcPacketAckMsg { pub acknowledgement: IbcAcknowledgement, pub original_packet: IbcPacket, - #[cfg(feature = "ibc3")] pub relayer: Addr, } impl IbcPacketAckMsg { - #[cfg(not(feature = "ibc3"))] - pub fn new(acknowledgement: IbcAcknowledgement, original_packet: IbcPacket) -> Self { - Self { - acknowledgement, - original_packet, - } - } - - #[cfg(feature = "ibc3")] pub fn new( acknowledgement: IbcAcknowledgement, original_packet: IbcPacket, @@ -454,21 +489,16 @@ impl IbcPacketAckMsg { } /// The message that is passed into `ibc_packet_timeout` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct IbcPacketTimeoutMsg { pub packet: IbcPacket, - #[cfg(feature = "ibc3")] pub relayer: Addr, } impl IbcPacketTimeoutMsg { - #[cfg(not(feature = "ibc3"))] - pub fn new(packet: IbcPacket) -> Self { - Self { packet } - } - - #[cfg(feature = "ibc3")] pub fn new(packet: IbcPacket, relayer: Addr) -> Self { Self { packet, relayer } } @@ -481,7 +511,9 @@ impl IbcPacketTimeoutMsg { /// Callbacks that have return values (like receive_packet) /// or that cannot redispatch messages (like the handshake callbacks) /// will use other Response types -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct IbcBasicResponse { /// Optional list of messages to pass. These will be executed in order. @@ -493,18 +525,18 @@ pub struct IbcBasicResponse { /// /// More info about events (and their attributes) can be found in [*Cosmos SDK* docs]. /// - /// [*Cosmos SDK* docs]: https://docs.cosmos.network/v0.42/core/events.html + /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events pub attributes: Vec, /// Extra, custom events separate from the main `wasm` one. These will have /// `wasm-` prepended to the type. /// /// More info about events can be found in [*Cosmos SDK* docs]. /// - /// [*Cosmos SDK* docs]: https://docs.cosmos.network/v0.42/core/events.html + /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events pub events: Vec, } -// Custom imlementation in order to implement it for all `T`, even if `T` is not `Default`. +// Custom implementation in order to implement it for all `T`, even if `T` is not `Default`. impl Default for IbcBasicResponse { fn default() -> Self { IbcBasicResponse { @@ -533,7 +565,7 @@ impl IbcBasicResponse { self } - /// This takes an explicit SubMsg (creates via eg. `reply_on_error`) + /// This takes an explicit SubMsg (creates via e.g. `reply_on_error`) /// and adds it to the list of messages to process. pub fn add_submessage(mut self, msg: SubMsg) -> Self { self.messages.push(msg); @@ -603,7 +635,7 @@ impl IbcBasicResponse { /// } /// ``` pub fn add_submessages(mut self, msgs: impl IntoIterator>) -> Self { - self.messages.extend(msgs.into_iter()); + self.messages.extend(msgs); self } @@ -613,22 +645,25 @@ impl IbcBasicResponse { /// The `wasm-` prefix will be appended by the runtime to the provided types /// of events. pub fn add_events(mut self, events: impl IntoIterator) -> Self { - self.events.extend(events.into_iter()); + self.events.extend(events); self } } -// This defines the return value on packet response processing. -// This "success" case should be returned even in application-level errors, -// Where the acknowledgement bytes contain an encoded error message to be returned to -// the calling chain. (Returning ContractResult::Err will abort processing of this packet -// and not inform the calling chain). -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +/// This defines the return value on packet response processing. +/// This "success" case should be returned even in application-level errors, +/// Where the acknowledgement bytes contain an encoded error message to be returned to +/// the calling chain. (Returning ContractResult::Err will abort processing of this packet +/// and not inform the calling chain). +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct IbcReceiveResponse { /// The bytes we return to the contract that sent the packet. - /// This may represent a success or error of exection - pub acknowledgement: Binary, + /// This may represent a success or error of execution. + /// In case of `None`, no acknowledgement is written. + pub acknowledgement: Option, /// Optional list of messages to pass. These will be executed in order. /// If the ReplyOn member is set, they will invoke this contract's `reply` entry point /// after execution. Otherwise, they act like "fire and forget". @@ -638,38 +673,83 @@ pub struct IbcReceiveResponse { /// /// More info about events (and their attributes) can be found in [*Cosmos SDK* docs]. /// - /// [*Cosmos SDK* docs]: https://docs.cosmos.network/v0.42/core/events.html + /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events pub attributes: Vec, /// Extra, custom events separate from the main `wasm` one. These will have /// `wasm-` prepended to the type. /// /// More info about events can be found in [*Cosmos SDK* docs]. /// - /// [*Cosmos SDK* docs]: https://docs.cosmos.network/v0.42/core/events.html + /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events pub events: Vec, } -// Custom imlementation in order to implement it for all `T`, even if `T` is not `Default`. -impl Default for IbcReceiveResponse { - fn default() -> Self { - IbcReceiveResponse { - acknowledgement: Binary(vec![]), +impl IbcReceiveResponse { + /// Create a new response with the given acknowledgement. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{ + /// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, + /// # Never, Response, QueryResponse, StdAck, IbcPacketReceiveMsg + /// # }; + /// use cosmwasm_std::IbcReceiveResponse; + /// + /// #[entry_point] + /// pub fn ibc_packet_receive( + /// deps: DepsMut, + /// env: Env, + /// msg: IbcPacketReceiveMsg, + /// ) -> Result { + /// // ... + /// + /// // 0x01 is a FungibleTokenPacketSuccess from ICS-20. + /// Ok(IbcReceiveResponse::new(StdAck::success(b"\x01"))) + /// } + /// ``` + pub fn new(ack: impl Into) -> Self { + Self { + acknowledgement: Some(ack.into()), messages: vec![], attributes: vec![], events: vec![], } } -} -impl IbcReceiveResponse { - pub fn new() -> Self { - Self::default() - } - - /// Set the acknowledgement for this response. - pub fn set_ack(mut self, ack: impl Into) -> Self { - self.acknowledgement = ack.into(); - self + /// Creates a new response without an acknowledgement. + /// + /// This allows you to send the acknowledgement asynchronously later using + /// [`IbcMsg::WriteAcknowledgement`][self::IbcMsg#variant.WriteAcknowledgement]. + /// If you want to send the acknowledgement immediately, use [`IbcReceiveResponse::new`]. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{ + /// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, + /// # Never, Response, QueryResponse, StdAck, IbcPacketReceiveMsg + /// # }; + /// use cosmwasm_std::IbcReceiveResponse; + /// + /// #[entry_point] + /// pub fn ibc_packet_receive( + /// deps: DepsMut, + /// env: Env, + /// msg: IbcPacketReceiveMsg, + /// ) -> Result { + /// // ... + /// + /// Ok(IbcReceiveResponse::without_ack()) + /// } + /// ``` + pub fn without_ack() -> Self { + Self { + acknowledgement: None, + messages: vec![], + attributes: vec![], + events: vec![], + } } /// Add an attribute included in the main `wasm` event. @@ -685,7 +765,7 @@ impl IbcReceiveResponse { self } - /// This takes an explicit SubMsg (creates via eg. `reply_on_error`) + /// This takes an explicit SubMsg (creates via e.g. `reply_on_error`) /// and adds it to the list of messages to process. pub fn add_submessage(mut self, msg: SubMsg) -> Self { self.messages.push(msg); @@ -710,14 +790,14 @@ impl IbcReceiveResponse { /// ## Examples /// /// ``` - /// use cosmwasm_std::{attr, IbcReceiveResponse}; + /// use cosmwasm_std::{attr, IbcReceiveResponse, StdAck}; /// /// let attrs = vec![ /// ("action", "reaction"), /// ("answer", "42"), /// ("another", "attribute"), /// ]; - /// let res: IbcReceiveResponse = IbcReceiveResponse::new().add_attributes(attrs.clone()); + /// let res: IbcReceiveResponse = IbcReceiveResponse::new(StdAck::success(b"\x01")).add_attributes(attrs.clone()); /// assert_eq!(res.attributes, attrs); /// ``` pub fn add_attributes>( @@ -733,10 +813,10 @@ impl IbcReceiveResponse { /// ## Examples /// /// ``` - /// use cosmwasm_std::{CosmosMsg, IbcReceiveResponse}; + /// use cosmwasm_std::{CosmosMsg, IbcReceiveResponse, StdAck}; /// /// fn make_response_with_msgs(msgs: Vec) -> IbcReceiveResponse { - /// IbcReceiveResponse::new().add_messages(msgs) + /// IbcReceiveResponse::new(StdAck::success(b"\x01")).add_messages(msgs) /// } /// ``` pub fn add_messages>>(self, msgs: impl IntoIterator) -> Self { @@ -748,14 +828,14 @@ impl IbcReceiveResponse { /// ## Examples /// /// ``` - /// use cosmwasm_std::{SubMsg, IbcReceiveResponse}; + /// use cosmwasm_std::{SubMsg, StdAck, IbcReceiveResponse}; /// /// fn make_response_with_submsgs(msgs: Vec) -> IbcReceiveResponse { - /// IbcReceiveResponse::new().add_submessages(msgs) + /// IbcReceiveResponse::new(StdAck::success(b"\x01")).add_submessages(msgs) /// } /// ``` pub fn add_submessages(mut self, msgs: impl IntoIterator>) -> Self { - self.messages.extend(msgs.into_iter()); + self.messages.extend(msgs); self } @@ -765,7 +845,7 @@ impl IbcReceiveResponse { /// The `wasm-` prefix will be appended by the runtime to the provided types /// of events. pub fn add_events(mut self, events: impl IntoIterator) -> Self { - self.events.extend(events.into_iter()); + self.events.extend(events); self } } @@ -773,7 +853,7 @@ impl IbcReceiveResponse { #[cfg(test)] mod tests { use super::*; - use serde_json_wasm::to_string; + use crate::to_json_string; #[test] // added this to check json format for go compat, as I was unsure how some messages are snake encoded @@ -781,11 +861,12 @@ mod tests { let msg = IbcMsg::Transfer { channel_id: "channel-123".to_string(), to_address: "my-special-addr".into(), - amount: Coin::new(12345678, "uatom"), + amount: Coin::new(12345678u128, "uatom"), timeout: IbcTimeout::with_timestamp(Timestamp::from_nanos(1234567890)), + memo: None, }; - let encoded = to_string(&msg).unwrap(); - let expected = r#"{"transfer":{"channel_id":"channel-123","to_address":"my-special-addr","amount":{"denom":"uatom","amount":"12345678"},"timeout":{"block":null,"timestamp":"1234567890"}}}"#; + let encoded = to_json_string(&msg).unwrap(); + let expected = r#"{"transfer":{"channel_id":"channel-123","to_address":"my-special-addr","amount":{"denom":"uatom","amount":"12345678"},"timeout":{"block":null,"timestamp":"1234567890"},"memo":null}}"#; assert_eq!(encoded.as_str(), expected); } @@ -793,14 +874,14 @@ mod tests { fn ibc_timeout_serialize() { let timestamp = IbcTimeout::with_timestamp(Timestamp::from_nanos(684816844)); let expected = r#"{"block":null,"timestamp":"684816844"}"#; - assert_eq!(to_string(×tamp).unwrap(), expected); + assert_eq!(to_json_string(×tamp).unwrap(), expected); let block = IbcTimeout::with_block(IbcTimeoutBlock { revision: 12, height: 129, }); let expected = r#"{"block":{"revision":12,"height":129},"timestamp":null}"#; - assert_eq!(to_string(&block).unwrap(), expected); + assert_eq!(to_json_string(&block).unwrap(), expected); let both = IbcTimeout::with_both( IbcTimeoutBlock { @@ -810,7 +891,7 @@ mod tests { Timestamp::from_nanos(684816844), ); let expected = r#"{"block":{"revision":12,"height":129},"timestamp":"684816844"}"#; - assert_eq!(to_string(&both).unwrap(), expected); + assert_eq!(to_json_string(&both).unwrap(), expected); } #[test] @@ -834,7 +915,7 @@ mod tests { }; // basic checks - assert!(epoch1a == epoch1a); + assert_eq!(epoch1a, epoch1a); assert!(epoch1a < epoch1b); assert!(epoch1b > epoch1a); assert!(epoch2a > epoch1a); @@ -874,7 +955,7 @@ mod tests { ), }; let expected = r#"{"data":"Zm9v","src":{"port_id":"their-port","channel_id":"channel-1234"},"dest":{"port_id":"our-port","channel_id":"chan33"},"sequence":27,"timeout":{"block":{"revision":1,"height":12345678},"timestamp":"4611686018427387904"}}"#; - assert_eq!(to_string(&packet).unwrap(), expected); + assert_eq!(to_json_string(&packet).unwrap(), expected); let no_timestamp = IbcPacket { data: b"foo".into(), @@ -893,6 +974,6 @@ mod tests { }), }; let expected = r#"{"data":"Zm9v","src":{"port_id":"their-port","channel_id":"channel-1234"},"dest":{"port_id":"our-port","channel_id":"chan33"},"sequence":27,"timeout":{"block":{"revision":1,"height":12345678},"timestamp":null}}"#; - assert_eq!(to_string(&no_timestamp).unwrap(), expected); + assert_eq!(to_json_string(&no_timestamp).unwrap(), expected); } } diff --git a/packages/std/src/ibc/callbacks.rs b/packages/std/src/ibc/callbacks.rs new file mode 100644 index 0000000000..b86e3011ab --- /dev/null +++ b/packages/std/src/ibc/callbacks.rs @@ -0,0 +1,272 @@ +//! This module contains types for the IBC callbacks defined in +//! [ADR-8](https://github.com/cosmos/ibc-go/blob/main/docs/architecture/adr-008-app-caller-cbs.md). + +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +use crate::{Addr, Coin, IbcAcknowledgement, IbcPacket, Uint64}; + +/// This is just a type representing the data that has to be sent with the IBC message to receive +/// callbacks. It should be serialized and sent with the IBC message. +/// The specific field and format to send it in can vary depending on the IBC message, +/// but is usually the `memo` field by convention. +/// +/// See [`IbcSourceCallbackMsg`] and [`IbcDestinationCallbackMsg`] for more details. +/// +/// # Example +/// +/// Using [`TransferMsgBuilder`](crate::TransferMsgBuilder): +/// ```rust +/// use cosmwasm_std::{ +/// to_json_string, Coin, IbcCallbackRequest, TransferMsgBuilder, IbcSrcCallback, IbcTimeout, Response, +/// Timestamp, +/// }; +/// # use cosmwasm_std::testing::mock_env; +/// # let env = mock_env(); +/// +/// let _msg = TransferMsgBuilder::new( +/// "channel-0".to_string(), +/// "cosmos1example".to_string(), +/// Coin::new(10u32, "ucoin"), +/// Timestamp::from_seconds(12345), +/// ) +/// .with_src_callback(IbcSrcCallback { +/// address: env.contract.address, +/// gas_limit: None, +/// }) +/// .build(); +/// ``` +/// +/// Manual serialization: +/// ```rust +/// use cosmwasm_std::{ +/// to_json_string, Coin, IbcCallbackRequest, IbcMsg, IbcSrcCallback, IbcTimeout, Response, +/// Timestamp, +/// }; +/// # use cosmwasm_std::testing::mock_env; +/// # let env = mock_env(); +/// +/// let _transfer = IbcMsg::Transfer { +/// to_address: "cosmos1example".to_string(), +/// channel_id: "channel-0".to_string(), +/// amount: Coin::new(10u32, "ucoin"), +/// timeout: Timestamp::from_seconds(12345).into(), +/// memo: Some(to_json_string(&IbcCallbackRequest::source(IbcSrcCallback { +/// address: env.contract.address, +/// gas_limit: None, +/// })).unwrap()), +/// }; +/// ``` +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct IbcCallbackRequest { + // using private fields to force use of the constructors + #[serde(skip_serializing_if = "Option::is_none")] + src_callback: Option, + #[serde(skip_serializing_if = "Option::is_none")] + dest_callback: Option, +} + +impl IbcCallbackRequest { + /// Use this if you want to execute callbacks on both the source and destination chain. + pub fn both(src_callback: IbcSrcCallback, dest_callback: IbcDstCallback) -> Self { + IbcCallbackRequest { + src_callback: Some(src_callback), + dest_callback: Some(dest_callback), + } + } + + /// Use this if you want to execute callbacks on the source chain, but not the destination chain. + pub fn source(src_callback: IbcSrcCallback) -> Self { + IbcCallbackRequest { + src_callback: Some(src_callback), + dest_callback: None, + } + } + + /// Use this if you want to execute callbacks on the destination chain, but not the source chain. + pub fn destination(dest_callback: IbcDstCallback) -> Self { + IbcCallbackRequest { + src_callback: None, + dest_callback: Some(dest_callback), + } + } +} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct IbcSrcCallback { + /// The source chain address that should receive the callback. + /// For CosmWasm contracts, this *must* be `env.contract.address`. + /// Other addresses are not allowed and will effectively be ignored. + pub address: Addr, + /// Optional gas limit for the callback (in Cosmos SDK gas units) + #[serde(skip_serializing_if = "Option::is_none")] + pub gas_limit: Option, +} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct IbcDstCallback { + /// The destination chain address that should receive the callback. + pub address: String, + /// Optional gas limit for the callback (in Cosmos SDK gas units) + #[serde(skip_serializing_if = "Option::is_none")] + pub gas_limit: Option, +} + +/// The type of IBC source callback that is being called. +/// +/// IBC source callbacks are needed for cases where your contract triggers the sending of an +/// IBC packet through some other message (i.e. not through [`crate::IbcMsg::SendPacket`]) and needs to +/// know whether or not the packet was successfully received on the other chain. +/// A prominent example is the [`crate::IbcMsg::Transfer`] message. Without callbacks, you cannot know +/// whether the transfer was successful or not. +/// +/// Note that there are some prerequisites that need to be fulfilled to receive source callbacks: +/// - The contract must implement the `ibc_source_callback` entrypoint. +/// - The IBC application in the source chain must have support for the callbacks middleware. +/// - You have to add serialized [`IbcCallbackRequest`] to a specific field of the message. +/// For `IbcMsg::Transfer`, this is the `memo` field and it needs to be json-encoded. +/// - The receiver of the callback must also be the sender of the message. +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[serde(rename_all = "snake_case")] +pub enum IbcSourceCallbackMsg { + Acknowledgement(IbcAckCallbackMsg), + Timeout(IbcTimeoutCallbackMsg), +} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] +pub struct IbcAckCallbackMsg { + pub acknowledgement: IbcAcknowledgement, + pub original_packet: IbcPacket, + pub relayer: Addr, +} + +impl IbcAckCallbackMsg { + pub fn new( + acknowledgement: IbcAcknowledgement, + original_packet: IbcPacket, + relayer: Addr, + ) -> Self { + Self { + acknowledgement, + original_packet, + relayer, + } + } +} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] +pub struct IbcTimeoutCallbackMsg { + pub packet: IbcPacket, + pub relayer: Addr, +} + +impl IbcTimeoutCallbackMsg { + pub fn new(packet: IbcPacket, relayer: Addr) -> Self { + Self { packet, relayer } + } +} + +/// The message type of the IBC destination callback. +/// +/// The IBC destination callback is needed for cases where someone triggers the sending of an +/// IBC packet through some other message (i.e. not through [`crate::IbcMsg::SendPacket`]) and +/// your contract needs to know that it received this. +/// A prominent example is the [`crate::IbcMsg::Transfer`] message. Without callbacks, you cannot know +/// that someone sent you IBC coins. +/// +/// It is important to validate that the packet and acknowledgement are what you expect them to be. +/// For example for a transfer message, the receiver is not necessarily the contract itself. +/// +/// The callback is called when the packet is being acknowledged on the destination chain. +/// This happens for both synchronous and asynchronous acknowledgements. +/// +/// Note that there are some prerequisites that need to be fulfilled to receive destination callbacks: +/// - The contract must implement the `ibc_destination_callback` entrypoint. +/// - The IBC application in the destination chain must have support for the callbacks middleware. +/// - You have to add serialized [`IbcCallbackRequest`] to a specific field of the message. +/// For `IbcMsg::Transfer`, this is the `memo` field and it needs to be json-encoded. +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct IbcDestinationCallbackMsg { + pub packet: IbcPacket, + pub ack: IbcAcknowledgement, + /// When the underlying packet is a successful transfer message, + /// this field contains information about the transfer. Otherwise it is empty. + /// + /// This is always empty on chains using CosmWasm < 3.0 + #[serde(default)] + pub transfer: Option, +} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, cw_schema::Schemaifier, JsonSchema, +)] +pub struct IbcTransferCallback { + /// Address of the sender of the transfer. + /// Note that this is *not* a valid address on the destination chain. + pub sender: String, + /// Address of the receiver of the transfer. + /// Since this is on the destination chain, this is a valid address. + pub receiver: Addr, + /// The funds that were transferred. + /// + /// When the callback is executed, the transfer is completed already and the coins are now owned + /// by the receiver. + pub funds: Vec, +} + +#[cfg(test)] +mod tests { + use crate::to_json_string; + + use super::*; + + #[test] + fn ibc_callback_data_serialization() { + let mut data = IbcCallbackRequest::both( + IbcSrcCallback { + address: Addr::unchecked("src_address"), + gas_limit: Some(123u64.into()), + }, + IbcDstCallback { + address: "dst_address".to_string(), + gas_limit: Some(1234u64.into()), + }, + ); + + // both + let json = to_json_string(&data).unwrap(); + assert_eq!( + json, + r#"{"src_callback":{"address":"src_address","gas_limit":"123"},"dest_callback":{"address":"dst_address","gas_limit":"1234"}}"# + ); + + // dst only, without gas limit + let mut src = data.src_callback.take().unwrap(); + data.dest_callback.as_mut().unwrap().gas_limit = None; + let json = to_json_string(&data).unwrap(); + assert_eq!(json, r#"{"dest_callback":{"address":"dst_address"}}"#); + + // source only, without gas limit + src.gas_limit = None; + data.src_callback = Some(src); + data.dest_callback = None; + let json = to_json_string(&data).unwrap(); + assert_eq!(json, r#"{"src_callback":{"address":"src_address"}}"#); + } +} diff --git a/packages/std/src/ibc/transfer_msg_builder.rs b/packages/std/src/ibc/transfer_msg_builder.rs new file mode 100644 index 0000000000..484ef4038b --- /dev/null +++ b/packages/std/src/ibc/transfer_msg_builder.rs @@ -0,0 +1,298 @@ +use crate::{ + to_json_string, Coin, IbcCallbackRequest, IbcDstCallback, IbcMsg, IbcSrcCallback, IbcTimeout, +}; + +// these are the different memo types and at the same time the states +// the TransferMsgBuilder can be in +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct EmptyMemo; +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct WithMemo { + memo: String, +} +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct WithSrcCallback { + src_callback: IbcSrcCallback, +} +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct WithDstCallback { + dst_callback: IbcDstCallback, +} +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct WithCallbacks { + src_callback: IbcSrcCallback, + dst_callback: IbcDstCallback, +} + +pub trait MemoSource { + fn into_memo(self) -> Option; +} + +impl MemoSource for EmptyMemo { + fn into_memo(self) -> Option { + None + } +} + +impl MemoSource for WithMemo { + fn into_memo(self) -> Option { + Some(self.memo) + } +} + +impl MemoSource for WithSrcCallback { + fn into_memo(self) -> Option { + Some(to_json_string(&IbcCallbackRequest::source(self.src_callback)).unwrap()) + } +} + +impl MemoSource for WithDstCallback { + fn into_memo(self) -> Option { + Some(to_json_string(&IbcCallbackRequest::destination(self.dst_callback)).unwrap()) + } +} + +impl MemoSource for WithCallbacks { + fn into_memo(self) -> Option { + Some( + to_json_string(&IbcCallbackRequest::both( + self.src_callback, + self.dst_callback, + )) + .unwrap(), + ) + } +} + +impl TransferMsgBuilder { + pub fn build(self) -> IbcMsg { + IbcMsg::Transfer { + channel_id: self.channel_id, + to_address: self.to_address, + amount: self.amount, + timeout: self.timeout, + memo: self.memo.into_memo(), + } + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct TransferMsgBuilder { + channel_id: String, + to_address: String, + amount: Coin, + timeout: IbcTimeout, + memo: MemoData, +} + +impl TransferMsgBuilder { + /// Creates a new transfer message with the given parameters and no memo. + pub fn new( + channel_id: impl Into, + to_address: impl Into, + amount: Coin, + timeout: impl Into, + ) -> Self { + Self { + channel_id: channel_id.into(), + to_address: to_address.into(), + amount, + timeout: timeout.into(), + memo: EmptyMemo, + } + } + + /// Adds a memo text to the transfer message. + pub fn with_memo(self, memo: impl Into) -> TransferMsgBuilder { + TransferMsgBuilder { + channel_id: self.channel_id, + to_address: self.to_address, + amount: self.amount, + timeout: self.timeout, + memo: WithMemo { memo: memo.into() }, + } + } + + /// Adds an IBC source callback entry to the memo field. + /// Use this if you want to receive IBC callbacks on the source chain. + /// + /// For more info check out [`crate::IbcSourceCallbackMsg`]. + pub fn with_src_callback( + self, + src_callback: IbcSrcCallback, + ) -> TransferMsgBuilder { + TransferMsgBuilder { + channel_id: self.channel_id, + to_address: self.to_address, + amount: self.amount, + timeout: self.timeout, + memo: WithSrcCallback { src_callback }, + } + } + + /// Adds an IBC destination callback entry to the memo field. + /// Use this if you want to receive IBC callbacks on the destination chain. + /// + /// For more info check out [`crate::IbcDestinationCallbackMsg`]. + pub fn with_dst_callback( + self, + dst_callback: IbcDstCallback, + ) -> TransferMsgBuilder { + TransferMsgBuilder { + channel_id: self.channel_id, + to_address: self.to_address, + amount: self.amount, + timeout: self.timeout, + memo: WithDstCallback { dst_callback }, + } + } +} + +impl TransferMsgBuilder { + /// Adds an IBC destination callback entry to the memo field. + /// Use this if you want to receive IBC callbacks on the destination chain. + /// + /// For more info check out [`crate::IbcDestinationCallbackMsg`]. + pub fn with_dst_callback( + self, + dst_callback: IbcDstCallback, + ) -> TransferMsgBuilder { + TransferMsgBuilder { + channel_id: self.channel_id, + to_address: self.to_address, + amount: self.amount, + timeout: self.timeout, + memo: WithCallbacks { + src_callback: self.memo.src_callback, + dst_callback, + }, + } + } +} + +impl TransferMsgBuilder { + /// Adds an IBC source callback entry to the memo field. + /// Use this if you want to receive IBC callbacks on the source chain. + /// + /// For more info check out [`crate::IbcSourceCallbackMsg`]. + pub fn with_src_callback( + self, + src_callback: IbcSrcCallback, + ) -> TransferMsgBuilder { + TransferMsgBuilder { + channel_id: self.channel_id, + to_address: self.to_address, + amount: self.amount, + timeout: self.timeout, + memo: WithCallbacks { + src_callback, + dst_callback: self.memo.dst_callback, + }, + } + } +} + +#[cfg(test)] +mod tests { + use crate::{coin, Addr, Timestamp, Uint64}; + + use super::*; + + #[test] + fn test_transfer_msg_builder() { + let src_callback = IbcSrcCallback { + address: Addr::unchecked("src"), + gas_limit: Some(Uint64::new(12345)), + }; + let dst_callback = IbcDstCallback { + address: "dst".to_string(), + gas_limit: None, + }; + + let empty_memo_builder = TransferMsgBuilder::new( + "channel-0", + "cosmos1example", + coin(10, "ucoin"), + Timestamp::from_seconds(12345), + ); + + let empty = empty_memo_builder.clone().build(); + let with_memo = empty_memo_builder.clone().with_memo("memo").build(); + + let with_src_callback_builder = empty_memo_builder + .clone() + .with_src_callback(src_callback.clone()); + let with_src_callback = with_src_callback_builder.clone().build(); + let with_dst_callback_builder = empty_memo_builder + .clone() + .with_dst_callback(dst_callback.clone()); + let with_dst_callback = with_dst_callback_builder.clone().build(); + + let with_both_callbacks1 = with_src_callback_builder + .with_dst_callback(dst_callback.clone()) + .build(); + + let with_both_callbacks2 = with_dst_callback_builder + .with_src_callback(src_callback.clone()) + .build(); + + // assert all the different messages + assert_eq!( + empty, + IbcMsg::Transfer { + channel_id: "channel-0".to_string(), + to_address: "cosmos1example".to_string(), + amount: coin(10, "ucoin"), + timeout: Timestamp::from_seconds(12345).into(), + memo: None, + } + ); + assert_eq!( + with_memo, + IbcMsg::Transfer { + channel_id: "channel-0".to_string(), + to_address: "cosmos1example".to_string(), + amount: coin(10, "ucoin"), + timeout: Timestamp::from_seconds(12345).into(), + memo: Some("memo".to_string()), + } + ); + assert_eq!( + with_src_callback, + IbcMsg::Transfer { + channel_id: "channel-0".to_string(), + to_address: "cosmos1example".to_string(), + amount: coin(10, "ucoin"), + timeout: Timestamp::from_seconds(12345).into(), + memo: Some( + to_json_string(&IbcCallbackRequest::source(src_callback.clone())).unwrap() + ), + } + ); + assert_eq!( + with_dst_callback, + IbcMsg::Transfer { + channel_id: "channel-0".to_string(), + to_address: "cosmos1example".to_string(), + amount: coin(10, "ucoin"), + timeout: Timestamp::from_seconds(12345).into(), + memo: Some( + to_json_string(&IbcCallbackRequest::destination(dst_callback.clone())).unwrap() + ), + } + ); + assert_eq!( + with_both_callbacks1, + IbcMsg::Transfer { + channel_id: "channel-0".to_string(), + to_address: "cosmos1example".to_string(), + amount: coin(10, "ucoin"), + timeout: Timestamp::from_seconds(12345).into(), + memo: Some( + to_json_string(&IbcCallbackRequest::both(src_callback, dst_callback)).unwrap() + ), + } + ); + assert_eq!(with_both_callbacks1, with_both_callbacks2); + } +} diff --git a/packages/std/src/ibc2.rs b/packages/std/src/ibc2.rs new file mode 100644 index 0000000000..17c513ffa9 --- /dev/null +++ b/packages/std/src/ibc2.rs @@ -0,0 +1,234 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +use crate::{Addr, Binary, IbcAcknowledgement, Timestamp}; + +/// Payload value should be encoded in a format defined by the channel version, +/// and the module on the other side should know how to parse this. +#[non_exhaustive] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, cw_schema::Schemaifier, JsonSchema, +)] +#[serde(rename_all = "snake_case")] +pub struct Ibc2Payload { + /// The port id on the chain where the packet is sent from. + pub source_port: String, + /// The port id on the chain where the packet is sent to. + pub destination_port: String, + /// Version of the receiving contract. + pub version: String, + /// Encoding used to serialize the [Ibc2Payload::value]. + pub encoding: String, + /// Encoded payload data. + pub value: Binary, +} + +impl Ibc2Payload { + pub fn new( + source_port: String, + destination_port: String, + version: String, + encoding: String, + value: Binary, + ) -> Self { + Self { + source_port, + destination_port, + version, + encoding, + value, + } + } +} + +/// These are messages in the IBC lifecycle using the new Ibc2 approach. +/// Only usable by Ibc2-enabled contracts +#[non_exhaustive] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, cw_schema::Schemaifier, JsonSchema, +)] +#[serde(rename_all = "snake_case")] +pub enum Ibc2Msg { + /// Sends an Ibc2 packet with given payloads over the existing channel. + SendPacket { + source_client: String, + timeout: Timestamp, + payloads: Vec, + }, + /// Acknowledges a packet that this contract received over IBC. + /// This allows acknowledging a packet that was not acknowledged yet in the `ibc2_packet_receive` call. + WriteAcknowledgement { + /// Existing channel where the packet was received + source_client: String, + /// Sequence number of the packet that was received + packet_sequence: u64, + /// The acknowledgement to send back + ack: IbcAcknowledgement, + }, +} + +/// IBC2PacketReceiveMsg represents a message received via the IBC2 protocol. +/// The message that is passed into `ibc2_packet_receive`. +/// It contains the payload data along with metadata about the source and relayer. +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, cw_schema::Schemaifier, JsonSchema, +)] +#[non_exhaustive] +pub struct Ibc2PacketReceiveMsg { + /// The actual data being transmitted via IBC2. + pub payload: Ibc2Payload, + /// The address of the entity that relayed the packet. + pub relayer: Addr, + /// The identifier of the source IBC client. + pub source_client: String, + /// The unique sequence number of the received packet. + pub packet_sequence: u64, +} + +impl Ibc2PacketReceiveMsg { + pub fn new( + payload: Ibc2Payload, + relayer: Addr, + source_client: String, + packet_sequence: u64, + ) -> Self { + Self { + payload, + relayer, + source_client, + packet_sequence, + } + } +} + +/// IBC2PacketTimeoutMsg represents a timeout event for a packet that was not +/// successfully delivered within the expected timeframe in the IBC2 protocol. +/// It includes details about the source and destination clients, and the sequence +/// number of the timed-out packet. +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, cw_schema::Schemaifier, JsonSchema, +)] +#[non_exhaustive] +pub struct Ibc2PacketTimeoutMsg { + /// The data associated with the timed-out packet. + pub payload: Ibc2Payload, + /// The identifier of the client that originally sent the packet. + pub source_client: String, + /// The identifier of the client that was the intended recipient. + pub destination_client: String, + /// The sequence number of the timed-out packet. + pub packet_sequence: u64, + /// The address of the relayer responsible for the packet. + pub relayer: Addr, +} + +impl Ibc2PacketTimeoutMsg { + pub fn new( + payload: Ibc2Payload, + source_client: String, + destination_client: String, + packet_sequence: u64, + relayer: Addr, + ) -> Self { + Self { + payload, + source_client, + destination_client, + packet_sequence, + relayer, + } + } +} + +/// Message sent to the IBCv2 app upon receiving an acknowledgement packet +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, cw_schema::Schemaifier, JsonSchema, +)] +#[non_exhaustive] +pub struct Ibc2PacketAckMsg { + pub source_client: String, + pub destination_client: String, + pub data: Ibc2Payload, + pub acknowledgement: Binary, + pub relayer: Addr, +} + +impl Ibc2PacketAckMsg { + pub fn new( + source_client: String, + destination_client: String, + data: Ibc2Payload, + acknowledgement: Binary, + relayer: Addr, + ) -> Self { + Self { + source_client, + destination_client, + data, + acknowledgement, + relayer, + } + } +} + +/// Ibc2PacketSendMsg represents a payload sent event in the IBC2 protocol. +/// Since sending IBCv2 packet is permissionless, the IBC protocol introduces +/// an extra entry point, in which the application can verify the message sent from +/// a port ID belonging to the contract. +/// +/// It includes details about the source and destination clients, the sequence +/// number of the packet and the signer that sent the message. +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, cw_schema::Schemaifier, JsonSchema, +)] +#[non_exhaustive] +pub struct Ibc2PacketSendMsg { + /// The payload to be sent. + pub payload: Ibc2Payload, + /// The identifier of the client that originally sent the packet. + pub source_client: String, + /// The identifier of the client that was the intended recipient. + pub destination_client: String, + /// The sequence number of the sent packet. + pub packet_sequence: u64, + /// The address of the signer that sent the packet. + pub signer: Addr, +} + +impl Ibc2PacketSendMsg { + pub fn new( + payload: Ibc2Payload, + source_client: String, + destination_client: String, + packet_sequence: u64, + signer: Addr, + ) -> Self { + Self { + payload, + source_client, + destination_client, + packet_sequence, + signer, + } + } +} + +#[cfg(test)] +mod tests { + use serde_json::to_string; + + use crate::Ibc2Payload; + + #[test] + fn ibc2_payload_serialize() { + let packet = Ibc2Payload { + source_port: "sending-contractr-port".to_string(), + destination_port: "receiving-contract-port".to_string(), + version: "v1".to_string(), + encoding: "json".to_string(), + value: b"foo".into(), + }; + let expected = r#"{"source_port":"sending-contractr-port","destination_port":"receiving-contract-port","version":"v1","encoding":"json","value":"Zm9v"}"#; + assert_eq!(to_string(&packet).unwrap(), expected); + } +} diff --git a/packages/std/src/imports.rs b/packages/std/src/imports.rs deleted file mode 100644 index f7438a9df0..0000000000 --- a/packages/std/src/imports.rs +++ /dev/null @@ -1,407 +0,0 @@ -use std::vec::Vec; - -use crate::addresses::{Addr, CanonicalAddr}; -use crate::errors::{RecoverPubkeyError, StdError, StdResult, SystemError, VerificationError}; -use crate::import_helpers::{from_high_half, from_low_half}; -use crate::memory::{alloc, build_region, consume_region, Region}; -use crate::results::SystemResult; -#[cfg(feature = "iterator")] -use crate::sections::decode_sections2; -use crate::sections::encode_sections; -use crate::serde::from_slice; -use crate::traits::{Api, Querier, QuerierResult, Storage}; -#[cfg(feature = "iterator")] -use crate::{ - iterator::{Order, Record}, - memory::get_optional_region_address, -}; - -/// An upper bound for typical canonical address lengths (e.g. 20 in Cosmos SDK/Ethereum or 32 in Nano/Substrate) -const CANONICAL_ADDRESS_BUFFER_LENGTH: usize = 64; -/// An upper bound for typical human readable address formats (e.g. 42 for Ethereum hex addresses or 90 for bech32) -const HUMAN_ADDRESS_BUFFER_LENGTH: usize = 90; - -// This interface will compile into required Wasm imports. -// A complete documentation those functions is available in the VM that provides them: -// https://github.com/CosmWasm/cosmwasm/blob/v1.0.0-beta/packages/vm/src/instance.rs#L89-L206 -extern "C" { - #[cfg(feature = "abort")] - fn abort(source_ptr: u32); - - fn db_read(key: u32) -> u32; - fn db_write(key: u32, value: u32); - fn db_remove(key: u32); - - // scan creates an iterator, which can be read by consecutive next() calls - #[cfg(feature = "iterator")] - fn db_scan(start_ptr: u32, end_ptr: u32, order: i32) -> u32; - #[cfg(feature = "iterator")] - fn db_next(iterator_id: u32) -> u32; - - fn addr_validate(source_ptr: u32) -> u32; - fn addr_canonicalize(source_ptr: u32, destination_ptr: u32) -> u32; - fn addr_humanize(source_ptr: u32, destination_ptr: u32) -> u32; - - /// Verifies message hashes against a signature with a public key, using the - /// secp256k1 ECDSA parametrization. - /// Returns 0 on verification success, 1 on verification failure, and values - /// greater than 1 in case of error. - fn secp256k1_verify(message_hash_ptr: u32, signature_ptr: u32, public_key_ptr: u32) -> u32; - - fn secp256k1_recover_pubkey( - message_hash_ptr: u32, - signature_ptr: u32, - recovery_param: u32, - ) -> u64; - - /// Verifies a message against a signature with a public key, using the - /// ed25519 EdDSA scheme. - /// Returns 0 on verification success, 1 on verification failure, and values - /// greater than 1 in case of error. - fn ed25519_verify(message_ptr: u32, signature_ptr: u32, public_key_ptr: u32) -> u32; - - /// Verifies a batch of messages against a batch of signatures and public keys, using the - /// ed25519 EdDSA scheme. - /// Returns 0 on verification success, 1 on verification failure, and values - /// greater than 1 in case of error. - fn ed25519_batch_verify(messages_ptr: u32, signatures_ptr: u32, public_keys_ptr: u32) -> u32; - - /// Writes a debug message (UFT-8 encoded) to the host for debugging purposes. - /// The host is free to log or process this in any way it considers appropriate. - /// In production environments it is expected that those messages are discarded. - fn debug(source_ptr: u32); - - /// Executes a query on the chain (import). Not to be confused with the - /// query export, which queries the state of the contract. - fn query_chain(request: u32) -> u32; -} - -/// A stateless convenience wrapper around database imports provided by the VM. -/// This cannot be cloned as it would not copy any data. If you need to clone this, it indicates a flaw in your logic. -pub struct ExternalStorage {} - -impl ExternalStorage { - pub fn new() -> ExternalStorage { - ExternalStorage {} - } -} - -impl Storage for ExternalStorage { - fn get(&self, key: &[u8]) -> Option> { - let key = build_region(key); - let key_ptr = &*key as *const Region as u32; - - let read = unsafe { db_read(key_ptr) }; - if read == 0 { - // key does not exist in external storage - return None; - } - - let value_ptr = read as *mut Region; - let data = unsafe { consume_region(value_ptr) }; - Some(data) - } - - fn set(&mut self, key: &[u8], value: &[u8]) { - if value.is_empty() { - panic!("TL;DR: Value must not be empty in Storage::set but in most cases you can use Storage::remove instead. Long story: Getting empty values from storage is not well supported at the moment. Some of our internal interfaces cannot differentiate between a non-existent key and an empty value. Right now, you cannot rely on the behaviour of empty values. To protect you from trouble later on, we stop here. Sorry for the inconvenience! We highly welcome you to contribute to CosmWasm, making this more solid one way or the other."); - } - - // keep the boxes in scope, so we free it at the end (don't cast to pointers same line as build_region) - let key = build_region(key); - let key_ptr = &*key as *const Region as u32; - let mut value = build_region(value); - let value_ptr = &mut *value as *mut Region as u32; - unsafe { db_write(key_ptr, value_ptr) }; - } - - fn remove(&mut self, key: &[u8]) { - // keep the boxes in scope, so we free it at the end (don't cast to pointers same line as build_region) - let key = build_region(key); - let key_ptr = &*key as *const Region as u32; - unsafe { db_remove(key_ptr) }; - } - - #[cfg(feature = "iterator")] - fn range( - &self, - start: Option<&[u8]>, - end: Option<&[u8]>, - order: Order, - ) -> Box> { - // There is lots of gotchas on turning options into regions for FFI, thus this design - // See: https://github.com/CosmWasm/cosmwasm/pull/509 - let start_region = start.map(build_region); - let end_region = end.map(build_region); - let start_region_addr = get_optional_region_address(&start_region.as_ref()); - let end_region_addr = get_optional_region_address(&end_region.as_ref()); - let iterator_id = unsafe { db_scan(start_region_addr, end_region_addr, order as i32) }; - let iter = ExternalIterator { iterator_id }; - Box::new(iter) - } -} - -#[cfg(feature = "iterator")] -/// ExternalIterator makes a call out to next. -/// We use the pointer to differentiate between multiple open iterators. -struct ExternalIterator { - iterator_id: u32, -} - -#[cfg(feature = "iterator")] -impl Iterator for ExternalIterator { - type Item = Record; - - fn next(&mut self) -> Option { - let next_result = unsafe { db_next(self.iterator_id) }; - let kv_region_ptr = next_result as *mut Region; - let kv = unsafe { consume_region(kv_region_ptr) }; - let (key, value) = decode_sections2(kv); - if key.len() == 0 { - None - } else { - Some((key, value)) - } - } -} - -/// A stateless convenience wrapper around imports provided by the VM -#[derive(Copy, Clone)] -pub struct ExternalApi {} - -impl ExternalApi { - pub fn new() -> ExternalApi { - ExternalApi {} - } -} - -impl Api for ExternalApi { - fn addr_validate(&self, input: &str) -> StdResult { - let input_bytes = input.as_bytes(); - if input_bytes.len() > 256 { - // See MAX_LENGTH_HUMAN_ADDRESS in the VM. - // In this case, the VM will refuse to read the input from the contract. - // Stop here to allow handling the error in the contract. - return Err(StdError::generic_err("input too long for addr_validate")); - } - let source = build_region(input_bytes); - let source_ptr = &*source as *const Region as u32; - - let result = unsafe { addr_validate(source_ptr) }; - if result != 0 { - let error = unsafe { consume_string_region_written_by_vm(result as *mut Region) }; - return Err(StdError::generic_err(format!( - "addr_validate errored: {}", - error - ))); - } - - Ok(Addr::unchecked(input)) - } - - fn addr_canonicalize(&self, input: &str) -> StdResult { - let input_bytes = input.as_bytes(); - if input_bytes.len() > 256 { - // See MAX_LENGTH_HUMAN_ADDRESS in the VM. - // In this case, the VM will refuse to read the input from the contract. - // Stop here to allow handling the error in the contract. - return Err(StdError::generic_err( - "input too long for addr_canonicalize", - )); - } - let send = build_region(input_bytes); - let send_ptr = &*send as *const Region as u32; - let canon = alloc(CANONICAL_ADDRESS_BUFFER_LENGTH); - - let result = unsafe { addr_canonicalize(send_ptr, canon as u32) }; - if result != 0 { - let error = unsafe { consume_string_region_written_by_vm(result as *mut Region) }; - return Err(StdError::generic_err(format!( - "addr_canonicalize errored: {}", - error - ))); - } - - let out = unsafe { consume_region(canon) }; - Ok(CanonicalAddr::from(out)) - } - - fn addr_humanize(&self, canonical: &CanonicalAddr) -> StdResult { - let send = build_region(&canonical); - let send_ptr = &*send as *const Region as u32; - let human = alloc(HUMAN_ADDRESS_BUFFER_LENGTH); - - let result = unsafe { addr_humanize(send_ptr, human as u32) }; - if result != 0 { - let error = unsafe { consume_string_region_written_by_vm(result as *mut Region) }; - return Err(StdError::generic_err(format!( - "addr_humanize errored: {}", - error - ))); - } - - let address = unsafe { consume_string_region_written_by_vm(human) }; - Ok(Addr::unchecked(address)) - } - - fn secp256k1_verify( - &self, - message_hash: &[u8], - signature: &[u8], - public_key: &[u8], - ) -> Result { - let hash_send = build_region(message_hash); - let hash_send_ptr = &*hash_send as *const Region as u32; - let sig_send = build_region(signature); - let sig_send_ptr = &*sig_send as *const Region as u32; - let pubkey_send = build_region(public_key); - let pubkey_send_ptr = &*pubkey_send as *const Region as u32; - - let result = unsafe { secp256k1_verify(hash_send_ptr, sig_send_ptr, pubkey_send_ptr) }; - match result { - 0 => Ok(true), - 1 => Ok(false), - 2 => panic!("MessageTooLong must not happen. This is a bug in the VM."), - 3 => Err(VerificationError::InvalidHashFormat), - 4 => Err(VerificationError::InvalidSignatureFormat), - 5 => Err(VerificationError::InvalidPubkeyFormat), - 10 => Err(VerificationError::GenericErr), - error_code => Err(VerificationError::unknown_err(error_code)), - } - } - - fn secp256k1_recover_pubkey( - &self, - message_hash: &[u8], - signature: &[u8], - recover_param: u8, - ) -> Result, RecoverPubkeyError> { - let hash_send = build_region(message_hash); - let hash_send_ptr = &*hash_send as *const Region as u32; - let sig_send = build_region(signature); - let sig_send_ptr = &*sig_send as *const Region as u32; - - let result = - unsafe { secp256k1_recover_pubkey(hash_send_ptr, sig_send_ptr, recover_param.into()) }; - let error_code = from_high_half(result); - let pubkey_ptr = from_low_half(result); - match error_code { - 0 => { - let pubkey = unsafe { consume_region(pubkey_ptr as *mut Region) }; - Ok(pubkey) - } - 2 => panic!("MessageTooLong must not happen. This is a bug in the VM."), - 3 => Err(RecoverPubkeyError::InvalidHashFormat), - 4 => Err(RecoverPubkeyError::InvalidSignatureFormat), - 6 => Err(RecoverPubkeyError::InvalidRecoveryParam), - error_code => Err(RecoverPubkeyError::unknown_err(error_code)), - } - } - - fn ed25519_verify( - &self, - message: &[u8], - signature: &[u8], - public_key: &[u8], - ) -> Result { - let msg_send = build_region(message); - let msg_send_ptr = &*msg_send as *const Region as u32; - let sig_send = build_region(signature); - let sig_send_ptr = &*sig_send as *const Region as u32; - let pubkey_send = build_region(public_key); - let pubkey_send_ptr = &*pubkey_send as *const Region as u32; - - let result = unsafe { ed25519_verify(msg_send_ptr, sig_send_ptr, pubkey_send_ptr) }; - match result { - 0 => Ok(true), - 1 => Ok(false), - 2 => panic!("Error code 2 unused since CosmWasm 0.15. This is a bug in the VM."), - 3 => panic!("InvalidHashFormat must not happen. This is a bug in the VM."), - 4 => Err(VerificationError::InvalidSignatureFormat), - 5 => Err(VerificationError::InvalidPubkeyFormat), - 10 => Err(VerificationError::GenericErr), - error_code => Err(VerificationError::unknown_err(error_code)), - } - } - - fn ed25519_batch_verify( - &self, - messages: &[&[u8]], - signatures: &[&[u8]], - public_keys: &[&[u8]], - ) -> Result { - let msgs_encoded = encode_sections(messages); - let msgs_send = build_region(&msgs_encoded); - let msgs_send_ptr = &*msgs_send as *const Region as u32; - - let sigs_encoded = encode_sections(signatures); - let sig_sends = build_region(&sigs_encoded); - let sigs_send_ptr = &*sig_sends as *const Region as u32; - - let pubkeys_encoded = encode_sections(public_keys); - let pubkeys_send = build_region(&pubkeys_encoded); - let pubkeys_send_ptr = &*pubkeys_send as *const Region as u32; - - let result = - unsafe { ed25519_batch_verify(msgs_send_ptr, sigs_send_ptr, pubkeys_send_ptr) }; - match result { - 0 => Ok(true), - 1 => Ok(false), - 2 => panic!("Error code 2 unused since CosmWasm 0.15. This is a bug in the VM."), - 3 => panic!("InvalidHashFormat must not happen. This is a bug in the VM."), - 4 => Err(VerificationError::InvalidSignatureFormat), - 5 => Err(VerificationError::InvalidPubkeyFormat), - 10 => Err(VerificationError::GenericErr), - error_code => Err(VerificationError::unknown_err(error_code)), - } - } - - fn debug(&self, message: &str) { - // keep the boxes in scope, so we free it at the end (don't cast to pointers same line as build_region) - let region = build_region(message.as_bytes()); - let region_ptr = region.as_ref() as *const Region as u32; - unsafe { debug(region_ptr) }; - } -} - -/// Takes a pointer to a Region and reads the data into a String. -/// This is for trusted string sources only. -unsafe fn consume_string_region_written_by_vm(from: *mut Region) -> String { - let data = consume_region(from); - // We trust the VM/chain to return correct UTF-8, so let's save some gas - String::from_utf8_unchecked(data) -} - -/// A stateless convenience wrapper around imports provided by the VM -pub struct ExternalQuerier {} - -impl ExternalQuerier { - pub fn new() -> ExternalQuerier { - ExternalQuerier {} - } -} - -impl Querier for ExternalQuerier { - fn raw_query(&self, bin_request: &[u8]) -> QuerierResult { - let req = build_region(bin_request); - let request_ptr = &*req as *const Region as u32; - - let response_ptr = unsafe { query_chain(request_ptr) }; - let response = unsafe { consume_region(response_ptr as *mut Region) }; - - from_slice(&response).unwrap_or_else(|parsing_err| { - SystemResult::Err(SystemError::InvalidResponse { - error: parsing_err.to_string(), - response: response.into(), - }) - }) - } -} - -#[cfg(feature = "abort")] -pub fn handle_panic(message: &str) { - // keep the boxes in scope, so we free it at the end (don't cast to pointers same line as build_region) - let region = build_region(message.as_bytes()); - let region_ptr = region.as_ref() as *const Region as u32; - unsafe { abort(region_ptr) }; -} diff --git a/packages/std/src/iterator.rs b/packages/std/src/iterator.rs index e747581606..2726159963 100644 --- a/packages/std/src/iterator.rs +++ b/packages/std/src/iterator.rs @@ -1,4 +1,6 @@ -use crate::errors::StdError; +use crate::StdError; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; /// A record of a key-value storage that is created through an iterator API. /// The first element (key) is always raw binary data. The second element @@ -6,7 +8,10 @@ use crate::errors::StdError; /// allows contracts to reuse the type when deserializing database records. pub type Record> = (Vec, V); -#[derive(Copy, Clone)] +#[derive( + Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[serde(rename_all = "snake_case")] // We assign these to integers to provide a stable API for passing over FFI (to wasm and Go) pub enum Order { Ascending = 1, @@ -20,7 +25,7 @@ impl TryFrom for Order { match value { 1 => Ok(Order::Ascending), 2 => Ok(Order::Descending), - _ => Err(StdError::generic_err("Order must be 1 or 2")), + _ => Err(StdError::msg("Order must be 1 or 2")), } } } @@ -30,3 +35,29 @@ impl From for i32 { original as _ } } + +#[cfg(test)] +mod tests { + use crate::{from_json, to_json_vec}; + + use super::*; + + #[test] + fn order_serde() { + let ascending_bytes = br#""ascending""#; + let descending_bytes = br#""descending""#; + + assert_eq!(to_json_vec(&Order::Ascending).unwrap(), ascending_bytes); + assert_eq!(to_json_vec(&Order::Descending).unwrap(), descending_bytes); + + assert_eq!( + from_json::(ascending_bytes).unwrap(), + Order::Ascending + ); + + assert_eq!( + from_json::(descending_bytes).unwrap(), + Order::Descending + ); + } +} diff --git a/packages/std/src/lib.rs b/packages/std/src/lib.rs index 1f37bed1d6..025429f58a 100644 --- a/packages/std/src/lib.rs +++ b/packages/std/src/lib.rs @@ -1,107 +1,242 @@ -#![cfg_attr(feature = "backtraces", feature(backtrace))] +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! This crate provides the standard library for Wasm-based smart contracts on Cosmos blockchains. +//! +//! For more information, see: + +#[cfg(not(feature = "std"))] +core::compile_error!( + r#"Please enable `cosmwasm-std`'s `std` feature, as we might move existing functionality to that feature in the future. +Builds without the std feature are currently not expected to work. If you need no_std support see #1484. +"# +); + +#[macro_use] +extern crate alloc; // Exposed on all platforms +mod __internal; mod addresses; mod assertions; mod binary; +mod checksum; mod coin; +mod coins; mod conversion; mod deps; +mod encoding; mod errors; +mod forward_ref; mod hex_binary; mod ibc; +mod ibc2; mod import_helpers; #[cfg(feature = "iterator")] mod iterator; mod math; -mod panic; +mod metadata; +mod msgpack; +mod never; +mod pagination; mod query; mod results; mod sections; mod serde; -mod storage; +mod stdack; mod timestamp; mod traits; mod types; +mod utils; + +/// This module is to simplify no_std imports +pub(crate) mod prelude; + +/// This modules is very advanced and will not be used directly by the vast majority of users. +/// We want to offer it to ensure a stable storage key composition system but don't encourage +/// contract devs to use it directly. +pub mod storage_keys; -pub use crate::addresses::{Addr, CanonicalAddr}; +pub use crate::addresses::{ + instantiate2_address, instantiate2_address_impl, Addr, CanonicalAddr, Instantiate2AddressError, +}; pub use crate::binary::Binary; +pub use crate::checksum::{Checksum, ChecksumError}; pub use crate::coin::{coin, coins, has_coins, Coin}; +pub use crate::coins::Coins; pub use crate::deps::{Deps, DepsMut, OwnedDeps}; +pub use crate::encoding::{from_base64, from_hex, to_base64, to_hex}; pub use crate::errors::{ - CheckedFromRatioError, CheckedMultiplyRatioError, ConversionOverflowError, DivideByZeroError, - OverflowError, OverflowOperation, RecoverPubkeyError, StdError, StdResult, SystemError, - VerificationError, + AggregationError, CheckedFromRatioError, CheckedMultiplyFractionError, + CheckedMultiplyRatioError, CoinFromStrError, CoinsError, ConversionOverflowError, + DivideByZeroError, DivisionError, ErrorKind as StdErrorKind, OverflowError, OverflowOperation, + PairingEqualityError, RecoverPubkeyError, RoundDownOverflowError, RoundUpOverflowError, + StdError, StdResult, StdResultExt, SystemError, VerificationError, }; pub use crate::hex_binary::HexBinary; -#[cfg(feature = "stargate")] +pub use crate::ibc::IbcChannelOpenResponse; pub use crate::ibc::{ - Ibc3ChannelOpenResponse, IbcAcknowledgement, IbcBasicResponse, IbcChannel, IbcChannelCloseMsg, - IbcChannelConnectMsg, IbcChannelOpenMsg, IbcChannelOpenResponse, IbcEndpoint, IbcMsg, IbcOrder, - IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, - IbcTimeout, IbcTimeoutBlock, + Ibc3ChannelOpenResponse, IbcAckCallbackMsg, IbcAcknowledgement, IbcBasicResponse, + IbcCallbackRequest, IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, + IbcDestinationCallbackMsg, IbcDstCallback, IbcEndpoint, IbcMsg, IbcOrder, IbcPacket, + IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, + IbcSourceCallbackMsg, IbcSrcCallback, IbcTimeout, IbcTimeoutBlock, IbcTimeoutCallbackMsg, + IbcTransferCallback, TransferMsgBuilder, +}; +pub use crate::ibc2::{ + Ibc2Msg, Ibc2PacketAckMsg, Ibc2PacketReceiveMsg, Ibc2PacketSendMsg, Ibc2PacketTimeoutMsg, + Ibc2Payload, }; #[cfg(feature = "iterator")] pub use crate::iterator::{Order, Record}; pub use crate::math::{ - Decimal, Decimal256, Decimal256RangeExceeded, DecimalRangeExceeded, Fraction, Isqrt, Uint128, - Uint256, Uint512, Uint64, -}; -#[cfg(feature = "cosmwasm_1_1")] -pub use crate::query::SupplyResponse; -pub use crate::query::{ - AllBalanceResponse, BalanceResponse, BankQuery, ContractInfoResponse, CustomQuery, - QueryRequest, WasmQuery, + Decimal, Decimal256, Decimal256RangeExceeded, DecimalRangeExceeded, Fraction, Int128, Int256, + Int512, Int64, Isqrt, SignedDecimal, SignedDecimal256, SignedDecimal256RangeExceeded, + SignedDecimalRangeExceeded, Uint128, Uint256, Uint512, Uint64, }; -#[cfg(feature = "staking")] +pub use crate::metadata::{DenomMetadata, DenomUnit}; +pub use crate::msgpack::{from_msgpack, to_msgpack_binary, to_msgpack_vec}; +pub use crate::never::Never; +pub use crate::pagination::PageRequest; pub use crate::query::{ - AllDelegationsResponse, AllValidatorsResponse, BondedDenomResponse, Delegation, - DelegationResponse, FullDelegation, StakingQuery, Validator, ValidatorResponse, + AllDelegationsResponse, AllDenomMetadataResponse, AllValidatorsResponse, BalanceResponse, + BankQuery, BondedDenomResponse, ChannelResponse, CodeInfoResponse, ContractInfoResponse, + CustomQuery, DecCoin, Delegation, DelegationResponse, DelegationRewardsResponse, + DelegationTotalRewardsResponse, DelegatorReward, DelegatorValidatorsResponse, + DelegatorWithdrawAddressResponse, DenomMetadataResponse, DistributionQuery, FullDelegation, + GrpcQuery, IbcQuery, PortIdResponse, QueryRequest, RawRangeEntry, RawRangeResponse, + StakingQuery, SupplyResponse, Validator, ValidatorMetadata, ValidatorResponse, WasmQuery, }; -#[cfg(feature = "stargate")] -pub use crate::query::{ChannelResponse, IbcQuery, ListChannelsResponse, PortIdResponse}; -#[allow(deprecated)] -pub use crate::results::SubMsgExecutionResponse; + +#[cfg(all(feature = "stargate", feature = "cosmwasm_1_2"))] +pub use crate::results::WeightedVoteOption; pub use crate::results::{ - attr, wasm_execute, wasm_instantiate, Attribute, BankMsg, ContractResult, CosmosMsg, CustomMsg, - Empty, Event, QueryResponse, Reply, ReplyOn, Response, SubMsg, SubMsgResponse, SubMsgResult, - SystemResult, WasmMsg, + attr, wasm_execute, wasm_instantiate, AnyMsg, Attribute, BankMsg, ContractResult, CosmosMsg, + CustomMsg, Empty, Event, MsgResponse, QueryResponse, Reply, ReplyOn, Response, SubMsg, + SubMsgResponse, SubMsgResult, SystemResult, WasmMsg, }; #[cfg(feature = "staking")] pub use crate::results::{DistributionMsg, StakingMsg}; #[cfg(feature = "stargate")] pub use crate::results::{GovMsg, VoteOption}; -pub use crate::serde::{from_binary, from_slice, to_binary, to_vec}; -pub use crate::storage::MemoryStorage; +pub use crate::serde::{from_json, to_json_binary, to_json_string, to_json_vec}; +pub use crate::stdack::StdAck; pub use crate::timestamp::Timestamp; -pub use crate::traits::{Api, Querier, QuerierResult, QuerierWrapper, Storage}; -pub use crate::types::{BlockInfo, ContractInfo, Env, MessageInfo, TransactionInfo}; +pub use crate::traits::{Api, HashFunction, Querier, QuerierResult, QuerierWrapper, Storage}; +pub use crate::types::{BlockInfo, ContractInfo, Env, MessageInfo, MigrateInfo, TransactionInfo}; -// Exposed in wasm build only +// +// Exports +// -#[cfg(target_arch = "wasm32")] +#[cfg(all(feature = "exports", target_arch = "wasm32"))] mod exports; -#[cfg(target_arch = "wasm32")] -mod imports; -#[cfg(target_arch = "wasm32")] -mod memory; // Used by exports and imports only. This assumes pointers are 32 bit long, which makes it untestable on dev machines. -#[cfg(target_arch = "wasm32")] -pub use crate::exports::{do_execute, do_instantiate, do_migrate, do_query, do_reply, do_sudo}; -#[cfg(all(feature = "stargate", target_arch = "wasm32"))] +#[cfg(all(feature = "exports", target_arch = "wasm32", feature = "cosmwasm_2_2"))] +pub use crate::exports::do_migrate_with_info; +#[cfg(all(feature = "exports", target_arch = "wasm32"))] +pub use crate::exports::{ + do_execute, do_ibc_destination_callback, do_ibc_source_callback, do_instantiate, do_migrate, + do_query, do_reply, do_sudo, +}; +#[cfg(all(feature = "exports", target_arch = "wasm32", feature = "ibc2"))] +pub use crate::exports::{ + do_ibc2_packet_ack, do_ibc2_packet_receive, do_ibc2_packet_send, do_ibc2_packet_timeout, +}; +#[cfg(all(feature = "exports", target_arch = "wasm32", feature = "stargate"))] pub use crate::exports::{ do_ibc_channel_close, do_ibc_channel_connect, do_ibc_channel_open, do_ibc_packet_ack, do_ibc_packet_receive, do_ibc_packet_timeout, }; -#[cfg(target_arch = "wasm32")] -pub use crate::imports::{ExternalApi, ExternalQuerier, ExternalStorage}; -// Exposed for testing only -// Both unit tests and integration tests are compiled to native code, so everything in here does not need to compile to Wasm. +/// Exposed for testing only +/// Both unit tests and integration tests are compiled to native code, so everything in here does not need to compile to Wasm. #[cfg(not(target_arch = "wasm32"))] pub mod testing; -// Re-exports +pub use cosmwasm_core::{BLS12_381_G1_GENERATOR, BLS12_381_G2_GENERATOR}; +/// This attribute macro generates the boilerplate required to call into the +/// contract-specific logic from the entry-points to the Wasm module. +/// +/// It should be added to the contract's init, handle, migrate and query implementations +/// like this: +/// ``` +/// # use cosmwasm_std::{ +/// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, +/// # Response, QueryResponse, +/// # }; +/// # +/// # type InstantiateMsg = (); +/// # type ExecuteMsg = (); +/// # type QueryMsg = (); +/// +/// #[entry_point] +/// pub fn instantiate( +/// deps: DepsMut, +/// env: Env, +/// info: MessageInfo, +/// msg: InstantiateMsg, +/// ) -> Result { +/// # Ok(Default::default()) +/// } +/// +/// #[entry_point] +/// pub fn execute( +/// deps: DepsMut, +/// env: Env, +/// info: MessageInfo, +/// msg: ExecuteMsg, +/// ) -> Result { +/// # Ok(Default::default()) +/// } +/// +/// #[entry_point] +/// pub fn query( +/// deps: Deps, +/// env: Env, +/// msg: QueryMsg, +/// ) -> Result { +/// # Ok(Default::default()) +/// } +/// ``` +/// +/// where `InstantiateMsg`, `ExecuteMsg`, and `QueryMsg` are contract defined +/// types that implement `DeserializeOwned`. +/// +/// ## Set the version of the state of your contract +/// +/// The VM will use this as a hint whether it needs to run the migrate function of your contract or not. +/// +/// ``` +/// # use cosmwasm_std::{ +/// # DepsMut, entry_point, Env, MigrateInfo, +/// # Response, StdResult, +/// # }; +/// # +/// # type MigrateMsg = (); +/// #[entry_point] +/// #[migrate_version(2)] +/// pub fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg, migrate_info: MigrateInfo) -> StdResult { +/// todo!(); +/// } +/// ``` +/// +/// It is also possible to assign the migrate version number to +/// a given constant name: +/// +/// ``` +/// # use cosmwasm_std::{ +/// # DepsMut, entry_point, Env, MigrateInfo, +/// # Response, StdResult, +/// # }; +/// # +/// # type MigrateMsg = (); +/// const CONTRACT_VERSION: u64 = 66; +/// +/// #[entry_point] +/// #[migrate_version(CONTRACT_VERSION)] +/// pub fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg, migrate_info: MigrateInfo) -> StdResult { +/// todo!(); +/// } +/// ``` pub use cosmwasm_derive::entry_point; diff --git a/packages/std/src/math/conversion.rs b/packages/std/src/math/conversion.rs new file mode 100644 index 0000000000..c98bd5dfa3 --- /dev/null +++ b/packages/std/src/math/conversion.rs @@ -0,0 +1,424 @@ +#[cfg(test)] +use alloc::string::String; + +/// Grows a big endian signed integer to a bigger size. +/// See +pub const fn grow_be_int( + input: [u8; INPUT_SIZE], +) -> [u8; OUTPUT_SIZE] { + debug_assert!(INPUT_SIZE <= OUTPUT_SIZE); + // check if sign bit is set + let mut output = if input[0] & 0b10000000 != 0 { + // negative number is filled up with 1s + [0b11111111u8; OUTPUT_SIZE] + } else { + [0u8; OUTPUT_SIZE] + }; + let mut i = 0; + + // copy input to the end of output + // copy_from_slice is not const, so we have to do this manually + while i < INPUT_SIZE { + output[OUTPUT_SIZE - INPUT_SIZE + i] = input[i]; + i += 1; + } + output +} + +/// Shrinks a big endian signed integer to a smaller size. +/// This is the opposite operation of sign extension. +pub fn shrink_be_int( + input: [u8; INPUT_SIZE], +) -> Option<[u8; OUTPUT_SIZE]> { + debug_assert!(INPUT_SIZE >= OUTPUT_SIZE); + + // check bounds + if input[0] & 0b10000000 != 0 { + // a negative number should start with only 1s, otherwise it's too small + for i in &input[0..(INPUT_SIZE - OUTPUT_SIZE)] { + if *i != 0b11111111u8 { + return None; + } + } + // the sign bit also has to be 1 + if input[INPUT_SIZE - OUTPUT_SIZE] & 0b10000000 == 0 { + return None; + } + } else { + // a positive number should start with only 0s, otherwise it's too large + for i in &input[0..(INPUT_SIZE - OUTPUT_SIZE)] { + if *i != 0u8 { + return None; + } + } + // the sign bit also has to be 0 + if input[INPUT_SIZE - OUTPUT_SIZE] & 0b10000000 != 0 { + return None; + } + } + + // Now, we can just copy the last bytes + let mut output = [0u8; OUTPUT_SIZE]; + output.copy_from_slice(&input[(INPUT_SIZE - OUTPUT_SIZE)..]); + Some(output) +} + +/// Helper macro to implement `TryFrom` for a type that is just a wrapper around another type. +/// This can be used for all our integer conversions where `bnum` implements `TryFrom`. +macro_rules! forward_try_from { + ($input: ty, $output: ty) => { + impl TryFrom<$input> for $output { + type Error = $crate::ConversionOverflowError; + + fn try_from(value: $input) -> Result { + value + .0 + .try_into() + .map(Self) + .map_err(|_| Self::Error::new(stringify!($input), stringify!($output))) + } + } + }; +} +pub(crate) use forward_try_from; + +/// Helper macro to implement `From` for a type that is just a wrapper around another type. +/// This can be used for all our integer conversions where `bnum` implements `From`. +macro_rules! wrapped_int_to_primitive { + ($input: ty, $output: ty) => { + impl From<$input> for $output { + fn from(value: $input) -> Self { + // By convention all our Uint*/Int* types store the value in .0 + value.0.into() + } + } + }; +} +pub(crate) use wrapped_int_to_primitive; + +/// Helper macro to implement `From` for a type that is just a wrapper around another type. +/// This can be used for all our integer conversions where `bnum` implements `From`. +macro_rules! primitive_to_wrapped_int { + ($input: ty, $output: ty) => { + impl From<$input> for $output { + fn from(value: $input) -> Self { + // By convention all our Uint*/Int* types store the value in .0 + Self(value.into()) + } + } + }; +} +pub(crate) use primitive_to_wrapped_int; + +/// Helper macro to implement `TryFrom` for a conversion from a bigger signed int to a smaller one. +/// This is needed because `bnum` does not implement `TryFrom` for those conversions +/// because of limitations of const generics. +macro_rules! try_from_int_to_int { + ($input: ty, $output: ty) => { + // statically assert that the input is bigger than the output + static_assertions::const_assert!( + core::mem::size_of::<$input>() > core::mem::size_of::<$output>() + ); + impl TryFrom<$input> for $output { + type Error = $crate::ConversionOverflowError; + + fn try_from(value: $input) -> Result { + $crate::math::conversion::shrink_be_int(value.to_be_bytes()) + .ok_or_else(|| Self::Error::new(stringify!($input), stringify!($output))) + .map(Self::from_be_bytes) + } + } + }; +} +pub(crate) use try_from_int_to_int; + +/// Helper macro to implement `TryFrom` for a conversion from an unsigned int to a smaller or +/// equal sized signed int. +/// This is needed because `bnum` does not implement `TryFrom` for all of those conversions. +macro_rules! try_from_uint_to_int { + ($input: ty, $output: ty) => { + // statically assert that... + // input is unsigned + static_assertions::const_assert_eq!(stringify!($input).as_bytes()[0], b'U'); + // output is signed + static_assertions::const_assert_eq!(stringify!($output).as_bytes()[0], b'I'); + // input is bigger than output (otherwise we would not need a `TryFrom` impl) + static_assertions::const_assert!( + core::mem::size_of::<$input>() >= core::mem::size_of::<$output>() + ); + + impl TryFrom<$input> for $output { + type Error = $crate::ConversionOverflowError; + + fn try_from(value: $input) -> Result { + use bnum::prelude::As; + // $input::MAX has to be bigger than $output::MAX, so we can just cast it + if value.0 > Self::MAX.0.as_() { + return Err(Self::Error::new(stringify!($input), stringify!($output))); + } + + // at this point we know it fits + Ok(Self(value.0.as_())) + } + } + }; +} +pub(crate) use try_from_uint_to_int; + +#[cfg(test)] +pub(crate) fn test_try_from_uint_to_int(input_type: &'static str, output_type: &'static str) +where + I: super::num_consts::NumConsts + + From + + Copy + + TryFrom + + core::fmt::Debug + + core::ops::Add, + O: TryFrom + + From + + super::num_consts::NumConsts + + core::cmp::PartialEq + + core::fmt::Debug, + String: From, +{ + let v = I::MAX; + assert_eq!( + O::try_from(v), + Err(crate::ConversionOverflowError::new(input_type, output_type)), + "input::MAX value should not fit" + ); + + let max = I::try_from(O::MAX).unwrap(); + assert_eq!(O::try_from(max), Ok(O::MAX), "output::MAX value should fit"); + + // but $output::MAX + 1 should not fit + let v = max + I::ONE; + assert_eq!( + O::try_from(v), + Err(crate::ConversionOverflowError::new(input_type, output_type)), + "output::MAX + 1 should not fit" + ); + + // zero should work + let v = I::ZERO; + assert_eq!(O::try_from(v), Ok(O::ZERO), "zero should fit"); + + // 42 should work + assert_eq!( + O::try_from(I::from(42u32)), + Ok(O::from(42u32)), + "42 should fit" + ) +} + +#[cfg(test)] +pub(crate) fn test_try_from_int_to_uint(input_type: &'static str, output_type: &'static str) +where + I: super::num_consts::NumConsts + + From + + Copy + + TryFrom + + core::fmt::Debug + + core::ops::Add, + O: TryFrom + + From + + super::num_consts::NumConsts + + core::cmp::PartialEq + + core::fmt::Debug, + String: From, + >::Error: core::fmt::Debug, +{ + if core::mem::size_of::() <= core::mem::size_of::() { + // if the input type is smaller than the output type, then `I::MAX` should fit into `O` + let v = I::MAX; + assert_eq!( + O::try_from(v), + Ok(O::try_from(v).unwrap()), + "input::MAX value should fit" + ); + } else { + // if the input is bigger than the output, then `I::MAX` should not fit into `O` + let v = I::MAX; + assert_eq!( + O::try_from(v), + Err(crate::ConversionOverflowError::new(input_type, output_type)), + "input::MAX value should not fit" + ); + // but `O::MAX` should fit + let max = I::try_from(O::MAX).unwrap(); + assert_eq!( + O::try_from(max), + Ok(O::try_from(max).unwrap()), + "output::MAX value should fit" + ); + // while `O::MAX + 1` should not + let v = max + I::ONE; + assert_eq!( + O::try_from(v), + Err(crate::ConversionOverflowError::new(input_type, output_type)), + "output::MAX + 1 should not fit" + ); + } + + // negative numbers should fail + let v = I::from(-42i32); + assert_eq!( + O::try_from(v), + Err(crate::ConversionOverflowError::new(input_type, output_type,)), + "negative numbers should not fit" + ); + + // zero should work + let v = I::ZERO; + assert_eq!(O::try_from(v), Ok(O::ZERO), "zero should fit"); + + // 42 should work + assert_eq!( + O::try_from(I::from(42i32)), + Ok(O::from(42u32)), + "42 should fit" + ) +} + +/// Helper macro to implement `TryFrom` for a conversion from a signed int to an unsigned int. +/// This is needed because `bnum` does not implement `TryFrom` for all of those conversions. +macro_rules! try_from_int_to_uint { + ($input: ty, $output: ty) => { + // statically assert that... + // input is signed + static_assertions::const_assert_eq!(stringify!($input).as_bytes()[0], b'I'); + // output is unsigned + static_assertions::const_assert_eq!(stringify!($output).as_bytes()[0], b'U'); + + impl TryFrom<$input> for $output { + type Error = ConversionOverflowError; + + fn try_from(value: $input) -> Result { + use bnum::prelude::As; + // if $input::MAX is smaller than $output::MAX, we only need to check the sign + if core::mem::size_of::<$input>() <= core::mem::size_of::<$output>() { + if value.is_negative() { + return Err(ConversionOverflowError::new( + stringify!($input), + stringify!($output), + )); + } + + // otherwise we can just cast it + Ok(Self(value.0.as_())) + } else { + // $output::MAX is smaller than $input::MAX. + // If it is negative or too big, we error. + // We can safely cast $output::MAX to $input size + if value.is_negative() || value.0 > <$output>::MAX.0.as_() { + return Err(ConversionOverflowError::new( + stringify!($input), + stringify!($output), + )); + } + + // at this point we know it fits + Ok(Self(value.0.as_())) + } + } + } + }; +} +pub(crate) use try_from_int_to_uint; + +macro_rules! from_and_to_bytes { + ($inner: ty, $byte_size: literal) => { + /// Constructs new value from big endian bytes + #[must_use] + pub const fn from_be_bytes(data: [u8; $byte_size]) -> Self { + Self(<$inner>::from_be_bytes(data)) + } + + /// Constructs new value from little endian bytes + #[must_use] + pub const fn from_le_bytes(data: [u8; $byte_size]) -> Self { + Self(<$inner>::from_le_bytes(data)) + } + + /// Returns a copy of the number as big endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn to_be_bytes(self) -> [u8; $byte_size] { + self.0.to_be_bytes() + } + + /// Returns a copy of the number as little endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn to_le_bytes(self) -> [u8; $byte_size] { + self.0.to_le_bytes() + } + }; +} +pub(crate) use from_and_to_bytes; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn grow_be_int_works() { + // test against rust std's integers + let i32s = [i32::MIN, -1, 0, 1, 42, i32::MAX]; + for i in i32s { + assert_eq!(grow_be_int(i.to_be_bytes()), (i as i64).to_be_bytes()); + assert_eq!(grow_be_int(i.to_be_bytes()), (i as i128).to_be_bytes()); + } + let i8s = [i8::MIN, -1, 0, 1, 42, i8::MAX]; + for i in i8s { + assert_eq!(grow_be_int(i.to_be_bytes()), (i as i16).to_be_bytes()); + assert_eq!(grow_be_int(i.to_be_bytes()), (i as i32).to_be_bytes()); + assert_eq!(grow_be_int(i.to_be_bytes()), (i as i64).to_be_bytes()); + assert_eq!(grow_be_int(i.to_be_bytes()), (i as i128).to_be_bytes()); + } + } + + #[test] + fn shrink_be_int_works() { + // test against rust std's integers + let i32s = [-42, -1, 0i32, 1, 42]; + for i in i32s { + assert_eq!( + shrink_be_int(i.to_be_bytes()), + Some((i as i16).to_be_bytes()) + ); + assert_eq!( + shrink_be_int(i.to_be_bytes()), + Some((i as i8).to_be_bytes()) + ); + } + // these should be too big to fit into an i16 or i8 + let oob = [ + i32::MIN, + i32::MIN + 10, + i32::MIN + 1234, + i32::MAX - 1234, + i32::MAX - 10, + i32::MAX, + ]; + for i in oob { + // 32 -> 16 bit + assert_eq!(shrink_be_int::<4, 2>(i.to_be_bytes()), None); + // 32 -> 8 bit + assert_eq!(shrink_be_int::<4, 1>(i.to_be_bytes()), None); + } + + // compare against whole i16 range + for i in i16::MIN..=i16::MAX { + let cast = i as i8 as i16; + if i == cast { + // if the cast is lossless, `shrink_be_int` should get the same result + assert_eq!( + shrink_be_int::<2, 1>(i.to_be_bytes()), + Some((i as i8).to_be_bytes()) + ); + } else { + // otherwise, we should get None + assert_eq!(shrink_be_int::<2, 1>(i.to_be_bytes()), None); + } + } + } +} diff --git a/packages/std/src/math/decimal.rs b/packages/std/src/math/decimal.rs index 72975e22e3..36c45a24ca 100644 --- a/packages/std/src/math/decimal.rs +++ b/packages/std/src/math/decimal.rs @@ -1,16 +1,16 @@ -use forward_ref::{forward_ref_binop, forward_ref_op_assign}; -use schemars::JsonSchema; +use alloc::string::ToString; +use core::cmp::Ordering; +use core::fmt::{self, Write}; +use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Sub, SubAssign}; +use core::str::FromStr; use serde::{de, ser, Deserialize, Deserializer, Serialize}; -use std::cmp::Ordering; -use std::fmt::{self, Write}; -use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Sub, SubAssign}; -use std::str::FromStr; -use thiserror::Error; use crate::errors::{ - CheckedFromRatioError, CheckedMultiplyRatioError, DivideByZeroError, OverflowError, + CheckedFromRatioError, CheckedMultiplyRatioError, DivideByZeroError, ErrorKind, OverflowError, OverflowOperation, RoundUpOverflowError, StdError, }; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{Decimal256, SignedDecimal, SignedDecimal256, __internal::forward_ref_partial_eq}; use super::Fraction; use super::Isqrt; @@ -19,10 +19,23 @@ use super::{Uint128, Uint256}; /// A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0 /// /// The greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18) -#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, JsonSchema)] +#[derive( + Copy, + Clone, + Default, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Decimal { precision: 128, signed: false })] pub struct Decimal(#[schemars(with = "String")] Uint128); -#[derive(Error, Debug, PartialEq, Eq)] +forward_ref_partial_eq!(Decimal, Decimal); + +#[derive(Debug, PartialEq, Eq, thiserror::Error)] #[error("Decimal range exceeded")] pub struct DecimalRangeExceeded; @@ -41,12 +54,27 @@ impl Decimal { /// Creates a Decimal(value) /// This is equivalent to `Decimal::from_atomics(value, 18)` but usable in a const context. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{Uint128, Decimal}; + /// let atoms = Uint128::new(141_183_460_469_231_731_687_303_715_884_105_727_125); + /// let value = Decimal::new(atoms); + /// assert_eq!(value.to_string(), "141183460469231731687.303715884105727125"); + /// ``` + #[inline] + #[must_use] pub const fn new(value: Uint128) -> Self { Self(value) } /// Creates a Decimal(Uint128(value)) /// This is equivalent to `Decimal::from_atomics(value, 18)` but usable in a const context. + #[deprecated( + since = "3.0.0", + note = "Use Decimal::new(Uint128::new(value)) instead" + )] pub const fn raw(value: u128) -> Self { Self(Uint128::new(value)) } @@ -64,13 +92,56 @@ impl Decimal { } /// Convert x% into Decimal - pub fn percent(x: u64) -> Self { - Self(((x as u128) * 10_000_000_000_000_000).into()) + /// + /// ## Examples + /// + /// ``` + /// # use std::str::FromStr; + /// # use cosmwasm_std::Decimal; + /// const HALF: Decimal = Decimal::percent(50); + /// + /// assert_eq!(HALF, Decimal::from_str("0.5").unwrap()); + /// ``` + pub const fn percent(x: u64) -> Self { + // multiplication does not overflow since `u64::MAX` * 10**16 is well in u128 range + let atomics = (x as u128) * 10_000_000_000_000_000; + Self(Uint128::new(atomics)) } /// Convert permille (x/1000) into Decimal - pub fn permille(x: u64) -> Self { - Self(((x as u128) * 1_000_000_000_000_000).into()) + /// + /// ## Examples + /// + /// ``` + /// # use std::str::FromStr; + /// # use cosmwasm_std::Decimal; + /// const HALF: Decimal = Decimal::permille(500); + /// + /// assert_eq!(HALF, Decimal::from_str("0.5").unwrap()); + /// ``` + pub const fn permille(x: u64) -> Self { + // multiplication does not overflow since `u64::MAX` * 10**15 is well in u128 range + let atomics = (x as u128) * 1_000_000_000_000_000; + Self(Uint128::new(atomics)) + } + + /// Convert basis points (x/10000) into Decimal + /// + /// ## Examples + /// + /// ``` + /// # use std::str::FromStr; + /// # use cosmwasm_std::Decimal; + /// const TWO_BPS: Decimal = Decimal::bps(2); + /// const HALF: Decimal = Decimal::bps(5000); + /// + /// assert_eq!(TWO_BPS, Decimal::from_str("0.0002").unwrap()); + /// assert_eq!(HALF, Decimal::from_str("0.5").unwrap()); + /// ``` + pub const fn bps(x: u64) -> Self { + // multiplication does not overflow since `u64::MAX` * 10**14 is well in u128 range + let atomics = (x as u128) * 100_000_000_000_000; + Self(Uint128::new(atomics)) } /// Creates a decimal from a number of atomic units and the number @@ -100,7 +171,7 @@ impl Decimal { ) -> Result { let atomics = atomics.into(); const TEN: Uint128 = Uint128::new(10); - Ok(match decimal_places.cmp(&(Self::DECIMAL_PLACES)) { + Ok(match decimal_places.cmp(&Self::DECIMAL_PLACES) { Ordering::Less => { let digits = (Self::DECIMAL_PLACES) - decimal_places; // No overflow because decimal_places < DECIMAL_PLACES let factor = TEN.checked_pow(digits).unwrap(); // Safe because digits <= 17 @@ -155,6 +226,7 @@ impl Decimal { } } + #[must_use] pub const fn is_zero(&self) -> bool { self.0.is_zero() } @@ -166,7 +238,7 @@ impl Decimal { /// /// ``` /// # use cosmwasm_std::{Decimal, Uint128}; - /// # use std::str::FromStr; + /// # use core::str::FromStr; /// // Value with whole and fractional part /// let a = Decimal::from_str("1.234").unwrap(); /// assert_eq!(a.decimal_places(), 18); @@ -177,6 +249,7 @@ impl Decimal { /// assert_eq!(b.decimal_places(), 18); /// assert_eq!(b.atomics(), Uint128::new(1)); /// ``` + #[must_use] #[inline] pub const fn atomics(&self) -> Uint128 { self.0 @@ -186,17 +259,20 @@ impl Decimal { /// but this could potentially change as the type evolves. /// /// See also [`Decimal::atomics()`]. + #[must_use] #[inline] pub const fn decimal_places(&self) -> u32 { Self::DECIMAL_PLACES } /// Rounds value down after decimal places. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn floor(&self) -> Self { Self((self.0 / Self::DECIMAL_FRACTIONAL) * Self::DECIMAL_FRACTIONAL) } /// Rounds value up after decimal places. Panics on overflow. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn ceil(&self) -> Self { match self.checked_ceil() { Ok(value) => value, @@ -220,14 +296,14 @@ impl Decimal { self.0 .checked_add(other.0) .map(Self) - .map_err(|_| OverflowError::new(OverflowOperation::Add, self, other)) + .map_err(|_| OverflowError::new(OverflowOperation::Add)) } pub fn checked_sub(self, other: Self) -> Result { self.0 .checked_sub(other.0) .map(Self) - .map_err(|_| OverflowError::new(OverflowOperation::Sub, self, other)) + .map_err(|_| OverflowError::new(OverflowOperation::Sub)) } /// Multiplies one `Decimal` by another, returning an `OverflowError` if an overflow occurred. @@ -237,14 +313,11 @@ impl Decimal { result_as_uint256 .try_into() .map(Self) - .map_err(|_| OverflowError { - operation: crate::OverflowOperation::Mul, - operand1: self.to_string(), - operand2: other.to_string(), - }) + .map_err(|_| OverflowError::new(OverflowOperation::Mul)) } /// Raises a value to the power of `exp`, panics if an overflow occurred. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn pow(self, exp: u32) -> Self { match self.checked_pow(exp) { Ok(value) => value, @@ -278,11 +351,7 @@ impl Decimal { Ok(x * y) } - inner(self, exp).map_err(|_| OverflowError { - operation: crate::OverflowOperation::Pow, - operand1: self.to_string(), - operand2: exp.to_string(), - }) + inner(self, exp).map_err(|_| OverflowError::new(OverflowOperation::Pow)) } pub fn checked_div(self, other: Self) -> Result { @@ -293,12 +362,13 @@ impl Decimal { self.0 .checked_rem(other.0) .map(Self) - .map_err(|_| DivideByZeroError::new(self)) + .map_err(|_| DivideByZeroError) } /// Returns the approximate square root as a Decimal. /// /// This should not overflow or panic. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn sqrt(&self) -> Self { // Algorithm described in https://hackmd.io/@webmaster128/SJThlukj_ // We start with the highest precision possible and lower it until @@ -318,6 +388,7 @@ impl Decimal { /// Precision *must* be a number between 0 and 9 (inclusive). /// /// Returns `None` if the internal multiplication overflows. + #[must_use = "this returns the result of the operation, without modifying the original"] fn sqrt_with_precision(&self, precision: u32) -> Option { let inner_mul = 100u128.pow(precision); self.0.checked_mul(inner_mul.into()).ok().map(|inner| { @@ -326,10 +397,12 @@ impl Decimal { }) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn abs_diff(self, other: Self) -> Self { Self(self.0.abs_diff(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_add(self, other: Self) -> Self { match self.checked_add(other) { Ok(value) => value, @@ -337,6 +410,7 @@ impl Decimal { } } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_sub(self, other: Self) -> Self { match self.checked_sub(other) { Ok(value) => value, @@ -344,6 +418,7 @@ impl Decimal { } } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_mul(self, other: Self) -> Self { match self.checked_mul(other) { Ok(value) => value, @@ -351,12 +426,67 @@ impl Decimal { } } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_pow(self, exp: u32) -> Self { match self.checked_pow(exp) { Ok(value) => value, Err(_) => Self::MAX, } } + + /// Converts this decimal to an unsigned integer by truncating + /// the fractional part, e.g. 22.5 becomes 22. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{Decimal, Uint128}; + /// + /// let d = Decimal::from_str("12.345").unwrap(); + /// assert_eq!(d.to_uint_floor(), Uint128::new(12)); + /// + /// let d = Decimal::from_str("12.999").unwrap(); + /// assert_eq!(d.to_uint_floor(), Uint128::new(12)); + /// + /// let d = Decimal::from_str("75.0").unwrap(); + /// assert_eq!(d.to_uint_floor(), Uint128::new(75)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_uint_floor(self) -> Uint128 { + self.0 / Self::DECIMAL_FRACTIONAL + } + + /// Converts this decimal to an unsigned integer by rounting up + /// to the next integer, e.g. 22.3 becomes 23. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{Decimal, Uint128}; + /// + /// let d = Decimal::from_str("12.345").unwrap(); + /// assert_eq!(d.to_uint_ceil(), Uint128::new(13)); + /// + /// let d = Decimal::from_str("12.999").unwrap(); + /// assert_eq!(d.to_uint_ceil(), Uint128::new(13)); + /// + /// let d = Decimal::from_str("75.0").unwrap(); + /// assert_eq!(d.to_uint_ceil(), Uint128::new(75)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_uint_ceil(self) -> Uint128 { + // Using `q = 1 + ((x - 1) / y); // if x != 0` with unsigned integers x, y, q + // from https://stackoverflow.com/a/2745086/2013738. We know `x + y` CAN overflow. + let x = self.0; + let y = Self::DECIMAL_FRACTIONAL; + if x.is_zero() { + Uint128::zero() + } else { + Uint128::one() + ((x - Uint128::one()) / y) + } + } } impl Fraction for Decimal { @@ -385,6 +515,51 @@ impl Fraction for Decimal { } } +impl TryFrom for Decimal { + type Error = DecimalRangeExceeded; + + fn try_from(value: Decimal256) -> Result { + value + .atomics() + .try_into() + .map(Decimal) + .map_err(|_| DecimalRangeExceeded) + } +} + +impl TryFrom for Decimal { + type Error = DecimalRangeExceeded; + + fn try_from(value: SignedDecimal) -> Result { + value + .atomics() + .try_into() + .map(Decimal) + .map_err(|_| DecimalRangeExceeded) + } +} + +impl TryFrom for Decimal { + type Error = DecimalRangeExceeded; + + fn try_from(value: SignedDecimal256) -> Result { + value + .atomics() + .try_into() + .map(Decimal) + .map_err(|_| DecimalRangeExceeded) + } +} + +impl TryFrom for Decimal { + type Error = DecimalRangeExceeded; + + #[inline] + fn try_from(value: Uint128) -> Result { + Self::from_atomics(value, 0) + } +} + impl FromStr for Decimal { type Err = StdError; @@ -398,20 +573,14 @@ impl FromStr for Decimal { let mut parts_iter = input.split('.'); let whole_part = parts_iter.next().unwrap(); // split always returns at least one element - let whole = whole_part - .parse::() - .map_err(|_| StdError::generic_err("Error parsing whole"))?; - let mut atomics = whole - .checked_mul(Self::DECIMAL_FRACTIONAL) - .map_err(|_| StdError::generic_err("Value too big"))?; + let whole = whole_part.parse::()?; + let mut atomics = whole.checked_mul(Self::DECIMAL_FRACTIONAL)?; if let Some(fractional_part) = parts_iter.next() { - let fractional = fractional_part - .parse::() - .map_err(|_| StdError::generic_err("Error parsing fractional"))?; + let fractional = fractional_part.parse::()?; let exp = (Self::DECIMAL_PLACES.checked_sub(fractional_part.len() as u32)).ok_or_else( || { - StdError::generic_err(format!( + StdError::msg(format_args!( "Cannot parse more than {} fractional digits", Self::DECIMAL_PLACES )) @@ -419,17 +588,15 @@ impl FromStr for Decimal { )?; debug_assert!(exp <= Self::DECIMAL_PLACES); let fractional_factor = Uint128::from(10u128.pow(exp)); - atomics = atomics - .checked_add( - // The inner multiplication can't overflow because - // fractional < 10^DECIMAL_PLACES && fractional_factor <= 10^DECIMAL_PLACES - fractional.checked_mul(fractional_factor).unwrap(), - ) - .map_err(|_| StdError::generic_err("Value too big"))?; + atomics = atomics.checked_add( + // The inner multiplication can't overflow because + // fractional < 10^DECIMAL_PLACES && fractional_factor <= 10^DECIMAL_PLACES + fractional.checked_mul(fractional_factor).unwrap(), + )?; } if parts_iter.next().is_some() { - return Err(StdError::generic_err("Unexpected number of dots")); + return Err(StdError::msg("Unexpected number of dots").with_kind(ErrorKind::Parsing)); } Ok(Decimal(atomics)) @@ -442,7 +609,7 @@ impl fmt::Display for Decimal { let fractional = (self.0).checked_rem(Self::DECIMAL_FRACTIONAL).unwrap(); if fractional.is_zero() { - write!(f, "{}", whole) + write!(f, "{whole}") } else { let fractional_string = format!( "{:0>padding$}", @@ -457,6 +624,12 @@ impl fmt::Display for Decimal { } } +impl fmt::Debug for Decimal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Decimal({self})") + } +} + impl Add for Decimal { type Output = Self; @@ -516,30 +689,6 @@ impl MulAssign for Decimal { } forward_ref_op_assign!(impl MulAssign, mul_assign for Decimal, Decimal); -/// Both d*u and u*d with d: Decimal and u: Uint128 returns an Uint128. There is no -/// specific reason for this decision other than the initial use cases we have. If you -/// need a Decimal result for the same calculation, use Decimal(d*u) or Decimal(u*d). -impl Mul for Uint128 { - type Output = Self; - - #[allow(clippy::suspicious_arithmetic_impl)] - fn mul(self, rhs: Decimal) -> Self::Output { - // 0*a and b*0 is always 0 - if self.is_zero() || rhs.is_zero() { - return Uint128::zero(); - } - self.multiply_ratio(rhs.0, Decimal::DECIMAL_FRACTIONAL) - } -} - -impl Mul for Decimal { - type Output = Uint128; - - fn mul(self, rhs: Uint128) -> Self::Output { - rhs * self - } -} - impl Div for Decimal { type Output = Self; @@ -598,7 +747,7 @@ impl RemAssign for Decimal { } forward_ref_op_assign!(impl RemAssign, rem_assign for Decimal, Decimal); -impl std::iter::Sum for Decimal +impl core::iter::Sum for Decimal where Self: Add, { @@ -629,7 +778,7 @@ impl<'de> Deserialize<'de> for Decimal { struct DecimalVisitor; -impl<'de> de::Visitor<'de> for DecimalVisitor { +impl de::Visitor<'_> for DecimalVisitor { type Value = Decimal; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -642,27 +791,16 @@ impl<'de> de::Visitor<'de> for DecimalVisitor { { match Decimal::from_str(v) { Ok(d) => Ok(d), - Err(e) => Err(E::custom(format!("Error parsing decimal '{}': {}", v, e))), + Err(e) => Err(E::custom(format_args!("Error parsing decimal '{v}': {e}"))), } } } -impl PartialEq<&Decimal> for Decimal { - fn eq(&self, rhs: &&Decimal) -> bool { - self == *rhs - } -} - -impl PartialEq for &Decimal { - fn eq(&self, rhs: &Decimal) -> bool { - *self == rhs - } -} - #[cfg(test)] mod tests { use super::*; - use crate::{from_slice, to_vec}; + + use alloc::vec::Vec; fn dec(input: &str) -> Decimal { Decimal::from_str(input).unwrap() @@ -675,6 +813,7 @@ mod tests { } #[test] + #[allow(deprecated)] fn decimal_raw() { let value = 300u128; assert_eq!(Decimal::raw(value).0.u128(), value); @@ -704,6 +843,63 @@ mod tests { assert_eq!(value.0, Decimal::DECIMAL_FRACTIONAL / Uint128::from(8u8)); } + #[test] + fn decimal_bps() { + let value = Decimal::bps(125); + assert_eq!(value.0, Decimal::DECIMAL_FRACTIONAL / Uint128::from(80u8)); + } + + #[test] + fn decimal_from_decimal256_works() { + let too_big = Decimal256::new(Uint256::from(Uint128::MAX) + Uint256::one()); + assert_eq!(Decimal::try_from(too_big), Err(DecimalRangeExceeded)); + + let just_right = Decimal256::new(Uint256::from(Uint128::MAX)); + assert_eq!(Decimal::try_from(just_right), Ok(Decimal::MAX)); + + assert_eq!(Decimal::try_from(Decimal256::zero()), Ok(Decimal::zero())); + assert_eq!(Decimal::try_from(Decimal256::one()), Ok(Decimal::one())); + assert_eq!( + Decimal::try_from(Decimal256::percent(50)), + Ok(Decimal::percent(50)) + ); + } + + #[test] + fn decimal_try_from_integer() { + let int = Uint128::new(0xDEADBEEF); + let decimal = Decimal::try_from(int).unwrap(); + assert_eq!(int.to_string(), decimal.to_string()); + } + + #[test] + fn decimal_try_from_signed_works() { + assert_eq!( + Decimal::try_from(SignedDecimal::MAX).unwrap(), + Decimal::new(Uint128::new(SignedDecimal::MAX.atomics().i128() as u128)) + ); + assert_eq!( + Decimal::try_from(SignedDecimal::zero()).unwrap(), + Decimal::zero() + ); + assert_eq!( + Decimal::try_from(SignedDecimal::one()).unwrap(), + Decimal::one() + ); + assert_eq!( + Decimal::try_from(SignedDecimal::percent(50)).unwrap(), + Decimal::percent(50) + ); + assert_eq!( + Decimal::try_from(SignedDecimal::negative_one()), + Err(DecimalRangeExceeded) + ); + assert_eq!( + Decimal::try_from(SignedDecimal::MIN), + Err(DecimalRangeExceeded) + ); + } + #[test] fn decimal_from_atomics_works() { let one = Decimal::one(); @@ -911,93 +1107,47 @@ mod tests { #[test] fn decimal_from_str_errors_for_broken_whole_part() { - match Decimal::from_str("").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing whole"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal::from_str(" ").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing whole"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal::from_str("-1").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing whole"), - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal::from_str("").is_err()); + assert!(Decimal::from_str(" ").is_err()); + assert!(Decimal::from_str("-1").is_err()); } #[test] - fn decimal_from_str_errors_for_broken_fractinal_part() { - match Decimal::from_str("1.").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing fractional"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal::from_str("1. ").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing fractional"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal::from_str("1.e").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing fractional"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal::from_str("1.2e3").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing fractional"), - e => panic!("Unexpected error: {:?}", e), - } + fn decimal_from_str_errors_for_broken_fractional_part() { + assert!(Decimal::from_str("1.").is_err()); + assert!(Decimal::from_str("1. ").is_err()); + assert!(Decimal::from_str("1.e").is_err()); + assert!(Decimal::from_str("1.2e3").is_err()); } #[test] fn decimal_from_str_errors_for_more_than_18_fractional_digits() { - match Decimal::from_str("7.1234567890123456789").unwrap_err() { - StdError::GenericErr { msg, .. } => { - assert_eq!(msg, "Cannot parse more than 18 fractional digits",) - } - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal::from_str("7.1234567890123456789") + .unwrap_err() + .to_string() + .ends_with("Cannot parse more than 18 fractional digits")); // No special rules for trailing zeros. This could be changed but adds gas cost for the happy path. - match Decimal::from_str("7.1230000000000000000").unwrap_err() { - StdError::GenericErr { msg, .. } => { - assert_eq!(msg, "Cannot parse more than 18 fractional digits") - } - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal::from_str("7.1230000000000000000") + .unwrap_err() + .to_string() + .ends_with("Cannot parse more than 18 fractional digits")); } #[test] fn decimal_from_str_errors_for_invalid_number_of_dots() { - match Decimal::from_str("1.2.3").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Unexpected number of dots"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal::from_str("1.2.3.4").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Unexpected number of dots"), - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal::from_str("1.2.3").is_err()); + assert!(Decimal::from_str("1.2.3.4").is_err()); } #[test] fn decimal_from_str_errors_for_more_than_max_value() { // Integer - match Decimal::from_str("340282366920938463464").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Value too big"), - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal::from_str("340282366920938463464").is_err()); // Decimal - match Decimal::from_str("340282366920938463464.0").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Value too big"), - e => panic!("Unexpected error: {:?}", e), - } - match Decimal::from_str("340282366920938463463.374607431768211456").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Value too big"), - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal::from_str("340282366920938463464.0").is_err()); + assert!(Decimal::from_str("340282366920938463463.374607431768211456").is_err()); } #[test] @@ -1333,7 +1483,7 @@ mod tests { (Decimal::permille(6), Decimal::permille(13)), ]; - // The regular std::ops::Mul is our source of truth for these tests. + // The regular core::ops::Mul is our source of truth for these tests. for (x, y) in test_data.into_iter() { assert_eq!(x * y, x.checked_mul(y).unwrap()); } @@ -1343,52 +1493,10 @@ mod tests { fn decimal_checked_mul_overflow() { assert_eq!( Decimal::MAX.checked_mul(Decimal::percent(200)), - Err(OverflowError { - operation: crate::OverflowOperation::Mul, - operand1: Decimal::MAX.to_string(), - operand2: Decimal::percent(200).to_string(), - }) + Err(OverflowError::new(OverflowOperation::Mul)) ); } - #[test] - // in this test the Decimal is on the right - fn uint128_decimal_multiply() { - // a*b - let left = Uint128::new(300); - let right = Decimal::one() + Decimal::percent(50); // 1.5 - assert_eq!(left * right, Uint128::new(450)); - - // a*0 - let left = Uint128::new(300); - let right = Decimal::zero(); - assert_eq!(left * right, Uint128::new(0)); - - // 0*a - let left = Uint128::new(0); - let right = Decimal::one() + Decimal::percent(50); // 1.5 - assert_eq!(left * right, Uint128::new(0)); - } - - #[test] - // in this test the Decimal is on the left - fn decimal_uint128_multiply() { - // a*b - let left = Decimal::one() + Decimal::percent(50); // 1.5 - let right = Uint128::new(300); - assert_eq!(left * right, Uint128::new(450)); - - // 0*a - let left = Decimal::zero(); - let right = Uint128::new(300); - assert_eq!(left * right, Uint128::new(0)); - - // a*0 - let left = Decimal::one() + Decimal::percent(50); // 1.5 - let right = Uint128::new(0); - assert_eq!(left * right, Uint128::new(0)); - } - #[test] #[allow(clippy::op_ref)] fn decimal_implements_div() { @@ -1586,7 +1694,7 @@ mod tests { assert_eq!(Decimal::one().checked_pow(exp).unwrap(), Decimal::one()); } - // This case is mathematically undefined but we ensure consistency with Rust stdandard types + // This case is mathematically undefined but we ensure consistency with Rust standard types // https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=20df6716048e77087acd40194b233494 assert_eq!(Decimal::zero().checked_pow(0).unwrap(), Decimal::one()); @@ -1657,11 +1765,7 @@ mod tests { fn decimal_checked_pow_overflow() { assert_eq!( Decimal::MAX.checked_pow(2), - Err(OverflowError { - operation: crate::OverflowOperation::Pow, - operand1: Decimal::MAX.to_string(), - operand2: "2".to_string(), - }) + Err(OverflowError::new(OverflowOperation::Pow)) ); } @@ -1767,35 +1871,59 @@ mod tests { #[test] fn decimal_serialize() { - assert_eq!(to_vec(&Decimal::zero()).unwrap(), br#""0""#); - assert_eq!(to_vec(&Decimal::one()).unwrap(), br#""1""#); - assert_eq!(to_vec(&Decimal::percent(8)).unwrap(), br#""0.08""#); - assert_eq!(to_vec(&Decimal::percent(87)).unwrap(), br#""0.87""#); - assert_eq!(to_vec(&Decimal::percent(876)).unwrap(), br#""8.76""#); - assert_eq!(to_vec(&Decimal::percent(8765)).unwrap(), br#""87.65""#); + assert_eq!(serde_json::to_vec(&Decimal::zero()).unwrap(), br#""0""#); + assert_eq!(serde_json::to_vec(&Decimal::one()).unwrap(), br#""1""#); + assert_eq!( + serde_json::to_vec(&Decimal::percent(8)).unwrap(), + br#""0.08""# + ); + assert_eq!( + serde_json::to_vec(&Decimal::percent(87)).unwrap(), + br#""0.87""# + ); + assert_eq!( + serde_json::to_vec(&Decimal::percent(876)).unwrap(), + br#""8.76""# + ); + assert_eq!( + serde_json::to_vec(&Decimal::percent(8765)).unwrap(), + br#""87.65""# + ); } #[test] fn decimal_deserialize() { - assert_eq!(from_slice::(br#""0""#).unwrap(), Decimal::zero()); - assert_eq!(from_slice::(br#""1""#).unwrap(), Decimal::one()); - assert_eq!(from_slice::(br#""000""#).unwrap(), Decimal::zero()); - assert_eq!(from_slice::(br#""001""#).unwrap(), Decimal::one()); + assert_eq!( + serde_json::from_slice::(br#""0""#).unwrap(), + Decimal::zero() + ); + assert_eq!( + serde_json::from_slice::(br#""1""#).unwrap(), + Decimal::one() + ); + assert_eq!( + serde_json::from_slice::(br#""000""#).unwrap(), + Decimal::zero() + ); + assert_eq!( + serde_json::from_slice::(br#""001""#).unwrap(), + Decimal::one() + ); assert_eq!( - from_slice::(br#""0.08""#).unwrap(), + serde_json::from_slice::(br#""0.08""#).unwrap(), Decimal::percent(8) ); assert_eq!( - from_slice::(br#""0.87""#).unwrap(), + serde_json::from_slice::(br#""0.87""#).unwrap(), Decimal::percent(87) ); assert_eq!( - from_slice::(br#""8.76""#).unwrap(), + serde_json::from_slice::(br#""8.76""#).unwrap(), Decimal::percent(876) ); assert_eq!( - from_slice::(br#""87.65""#).unwrap(), + serde_json::from_slice::(br#""87.65""#).unwrap(), Decimal::percent(8765) ); } @@ -1892,11 +2020,11 @@ mod tests { ); assert!(matches!( Decimal::MAX.checked_div(Decimal::zero()), - Err(CheckedFromRatioError::DivideByZero {}) + Err(CheckedFromRatioError::DivideByZero) )); assert!(matches!( Decimal::MAX.checked_div(Decimal::percent(1)), - Err(CheckedFromRatioError::Overflow {}) + Err(CheckedFromRatioError::Overflow) )); // checked rem @@ -1927,7 +2055,7 @@ mod tests { #[test] #[should_panic] fn decimal_pow_overflow_panics() { - Decimal::MAX.pow(2u32); + _ = Decimal::MAX.pow(2u32); } #[test] @@ -1996,6 +2124,57 @@ mod tests { )); } + #[test] + fn decimal_to_uint_floor_works() { + let d = Decimal::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_uint_floor(), Uint128::new(12)); + let d = Decimal::from_str("12.345").unwrap(); + assert_eq!(d.to_uint_floor(), Uint128::new(12)); + let d = Decimal::from_str("12.999").unwrap(); + assert_eq!(d.to_uint_floor(), Uint128::new(12)); + let d = Decimal::from_str("0.98451384").unwrap(); + assert_eq!(d.to_uint_floor(), Uint128::new(0)); + + let d = Decimal::from_str("75.0").unwrap(); + assert_eq!(d.to_uint_floor(), Uint128::new(75)); + let d = Decimal::from_str("0.0").unwrap(); + assert_eq!(d.to_uint_floor(), Uint128::new(0)); + + let d = Decimal::MAX; + assert_eq!(d.to_uint_floor(), Uint128::new(340282366920938463463)); + + // Does the same as the old workaround `Uint128::one() * my_decimal`. + // This block can be deleted as part of https://github.com/CosmWasm/cosmwasm/issues/1485. + let tests = vec![ + (Decimal::from_str("12.345").unwrap(), 12u128), + (Decimal::from_str("0.98451384").unwrap(), 0u128), + (Decimal::from_str("178.0").unwrap(), 178u128), + (Decimal::MIN, 0u128), + (Decimal::MAX, u128::MAX / Decimal::DECIMAL_FRACTIONAL.u128()), + ]; + for (my_decimal, expected) in tests.into_iter() { + assert_eq!(my_decimal.to_uint_floor(), Uint128::new(expected)); + } + } + + #[test] + fn decimal_to_uint_ceil_works() { + let d = Decimal::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint128::new(13)); + let d = Decimal::from_str("12.345").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint128::new(13)); + let d = Decimal::from_str("12.999").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint128::new(13)); + + let d = Decimal::from_str("75.0").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint128::new(75)); + let d = Decimal::from_str("0.0").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint128::new(0)); + + let d = Decimal::MAX; + assert_eq!(d.to_uint_ceil(), Uint128::new(340282366920938463464)); + } + #[test] fn decimal_partial_eq() { let test_cases = [ @@ -2015,4 +2194,17 @@ mod tests { assert_eq!(&lhs == &rhs, expected); } } + + #[test] + fn decimal_implements_debug() { + let decimal = Decimal::from_str("123.45").unwrap(); + assert_eq!(format!("{decimal:?}"), "Decimal(123.45)"); + + let test_cases = ["5", "5.01", "42", "0", "2"]; + for s in test_cases { + let decimal = Decimal::from_str(s).unwrap(); + let expected = format!("Decimal({s})"); + assert_eq!(format!("{decimal:?}"), expected); + } + } } diff --git a/packages/std/src/math/decimal256.rs b/packages/std/src/math/decimal256.rs index 0c2b134b5b..6d0fa7cb67 100644 --- a/packages/std/src/math/decimal256.rs +++ b/packages/std/src/math/decimal256.rs @@ -1,17 +1,18 @@ -use forward_ref::{forward_ref_binop, forward_ref_op_assign}; -use schemars::JsonSchema; +use alloc::string::ToString; +use core::cmp::Ordering; +use core::fmt::{self, Write}; +use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Sub, SubAssign}; +use core::str::FromStr; use serde::{de, ser, Deserialize, Deserializer, Serialize}; -use std::cmp::Ordering; -use std::fmt::{self, Write}; -use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Sub, SubAssign}; -use std::str::FromStr; -use thiserror::Error; use crate::errors::{ - CheckedFromRatioError, CheckedMultiplyRatioError, DivideByZeroError, OverflowError, + CheckedFromRatioError, CheckedMultiplyRatioError, DivideByZeroError, ErrorKind, OverflowError, OverflowOperation, RoundUpOverflowError, StdError, }; -use crate::{Decimal, Uint512}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + Decimal, SignedDecimal, SignedDecimal256, Uint512, __internal::forward_ref_partial_eq, +}; use super::Fraction; use super::Isqrt; @@ -22,24 +23,31 @@ use super::Uint256; /// The greatest possible value that can be represented is /// 115792089237316195423570985008687907853269984665640564039457.584007913129639935 /// (which is (2^256 - 1) / 10^18) -#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, JsonSchema)] +#[derive( + Copy, + Clone, + Default, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Decimal { precision: 256, signed: false })] pub struct Decimal256(#[schemars(with = "String")] Uint256); -#[derive(Error, Debug, PartialEq, Eq)] +forward_ref_partial_eq!(Decimal256, Decimal256); + +#[derive(Debug, PartialEq, Eq, thiserror::Error)] #[error("Decimal256 range exceeded")] pub struct Decimal256RangeExceeded; impl Decimal256 { const DECIMAL_FRACTIONAL: Uint256 = // 1*10**18 - Uint256::from_be_bytes([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 224, 182, - 179, 167, 100, 0, 0, - ]); + Uint256::new(1_000_000_000_000_000_000); const DECIMAL_FRACTIONAL_SQUARED: Uint256 = // 1*10**36 - Uint256::from_be_bytes([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 151, 206, 123, 201, 7, 21, 179, - 75, 159, 16, 0, 0, 0, 0, - ]); + Uint256::new(1_000_000_000_000_000_000_000_000_000_000_000_000); /// The number of decimal places. Since decimal types are fixed-point rather than /// floating-point, this is a constant. @@ -51,14 +59,29 @@ impl Decimal256 { /// Creates a Decimal256 from Uint256 /// This is equivalent to `Decimal256::from_atomics(value, 18)` but usable in a const context. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{Uint256, Decimal256}; + /// let atoms = Uint256::new(141_183_460_469_231_731_687_303_715_884_105_727_125); + /// let value = Decimal256::new(atoms); + /// assert_eq!(value.to_string(), "141183460469231731687.303715884105727125"); + /// ``` + #[inline] + #[must_use] pub const fn new(value: Uint256) -> Self { Self(value) } /// Creates a Decimal256 from u128 /// This is equivalent to `Decimal256::from_atomics(value, 18)` but usable in a const context. + #[deprecated( + since = "3.0.0", + note = "Use Decimal256::new(Uint256::new(value)) instead" + )] pub const fn raw(value: u128) -> Self { - Self(Uint256::from_u128(value)) + Self(Uint256::new(value)) } /// Create a 1.0 Decimal256 @@ -74,13 +97,56 @@ impl Decimal256 { } /// Convert x% into Decimal256 - pub fn percent(x: u64) -> Self { - Self(Uint256::from(x) * Uint256::from(10_000_000_000_000_000u128)) + /// + /// ## Examples + /// + /// ``` + /// # use std::str::FromStr; + /// # use cosmwasm_std::Decimal256; + /// const HALF: Decimal256 = Decimal256::percent(50); + /// + /// assert_eq!(HALF, Decimal256::from_str("0.5").unwrap()); + /// ``` + pub const fn percent(x: u64) -> Self { + // multiplication does not overflow since `u64::MAX` * 10**16 is well in u128 range + let atomics = (x as u128) * 10_000_000_000_000_000; + Self(Uint256::new(atomics)) } /// Convert permille (x/1000) into Decimal256 - pub fn permille(x: u64) -> Self { - Self(Uint256::from(x) * Uint256::from(1_000_000_000_000_000u128)) + /// + /// ## Examples + /// + /// ``` + /// # use std::str::FromStr; + /// # use cosmwasm_std::Decimal256; + /// const HALF: Decimal256 = Decimal256::permille(500); + /// + /// assert_eq!(HALF, Decimal256::from_str("0.5").unwrap()); + /// ``` + pub const fn permille(x: u64) -> Self { + // multiplication does not overflow since `u64::MAX` * 10**15 is well in u128 range + let atomics = (x as u128) * 1_000_000_000_000_000; + Self(Uint256::new(atomics)) + } + + /// Convert basis points (x/10000) into Decimal256 + /// + /// ## Examples + /// + /// ``` + /// # use std::str::FromStr; + /// # use cosmwasm_std::Decimal256; + /// const TWO_BPS: Decimal256 = Decimal256::bps(2); + /// const HALF: Decimal256 = Decimal256::bps(5000); + /// + /// assert_eq!(TWO_BPS, Decimal256::from_str("0.0002").unwrap()); + /// assert_eq!(HALF, Decimal256::from_str("0.5").unwrap()); + /// ``` + pub const fn bps(x: u64) -> Self { + // multiplication does not overflow since `u64::MAX` * 10**14 is well in u128 range + let atomics = (x as u128) * 100_000_000_000_000; + Self(Uint256::new(atomics)) } /// Creates a decimal from a number of atomic units and the number @@ -112,11 +178,14 @@ impl Decimal256 { decimal_places: u32, ) -> Result { let atomics = atomics.into(); - let ten = Uint256::from(10u64); // TODO: make const - Ok(match decimal_places.cmp(&(Self::DECIMAL_PLACES)) { + const TEN: Uint256 = Uint256::from_be_bytes([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 10, + ]); + Ok(match decimal_places.cmp(&Self::DECIMAL_PLACES) { Ordering::Less => { let digits = (Self::DECIMAL_PLACES) - decimal_places; // No overflow because decimal_places < DECIMAL_PLACES - let factor = ten.checked_pow(digits).unwrap(); // Safe because digits <= 17 + let factor = TEN.checked_pow(digits).unwrap(); // Safe because digits <= 17 Self( atomics .checked_mul(factor) @@ -126,7 +195,7 @@ impl Decimal256 { Ordering::Equal => Self(atomics), Ordering::Greater => { let digits = decimal_places - (Self::DECIMAL_PLACES); // No overflow because decimal_places > DECIMAL_PLACES - if let Ok(factor) = ten.checked_pow(digits) { + if let Ok(factor) = TEN.checked_pow(digits) { Self(atomics.checked_div(factor).unwrap()) // Safe because factor cannot be zero } else { // In this case `factor` exceeds the Uint256 range. @@ -168,6 +237,7 @@ impl Decimal256 { } } + #[must_use] pub const fn is_zero(&self) -> bool { self.0.is_zero() } @@ -179,7 +249,7 @@ impl Decimal256 { /// /// ``` /// # use cosmwasm_std::{Decimal256, Uint256}; - /// # use std::str::FromStr; + /// # use core::str::FromStr; /// // Value with whole and fractional part /// let a = Decimal256::from_str("1.234").unwrap(); /// assert_eq!(a.decimal_places(), 18); @@ -190,6 +260,7 @@ impl Decimal256 { /// assert_eq!(b.decimal_places(), 18); /// assert_eq!(b.atomics(), Uint256::from(1u128)); /// ``` + #[must_use] #[inline] pub const fn atomics(&self) -> Uint256 { self.0 @@ -199,17 +270,20 @@ impl Decimal256 { /// but this could potentially change as the type evolves. /// /// See also [`Decimal256::atomics()`]. + #[must_use] #[inline] pub const fn decimal_places(&self) -> u32 { Self::DECIMAL_PLACES } /// Rounds value down after decimal places. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn floor(&self) -> Self { Self((self.0 / Self::DECIMAL_FRACTIONAL) * Self::DECIMAL_FRACTIONAL) } /// Rounds value up after decimal places. Panics on overflow. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn ceil(&self) -> Self { match self.checked_ceil() { Ok(value) => value, @@ -233,14 +307,14 @@ impl Decimal256 { self.0 .checked_add(other.0) .map(Self) - .map_err(|_| OverflowError::new(OverflowOperation::Add, self, other)) + .map_err(|_| OverflowError::new(OverflowOperation::Add)) } pub fn checked_sub(self, other: Self) -> Result { self.0 .checked_sub(other.0) .map(Self) - .map_err(|_| OverflowError::new(OverflowOperation::Sub, self, other)) + .map_err(|_| OverflowError::new(OverflowOperation::Sub)) } /// Multiplies one `Decimal256` by another, returning an `OverflowError` if an overflow occurred. @@ -250,14 +324,11 @@ impl Decimal256 { result_as_uint512 .try_into() .map(Self) - .map_err(|_| OverflowError { - operation: crate::OverflowOperation::Mul, - operand1: self.to_string(), - operand2: other.to_string(), - }) + .map_err(|_| OverflowError::new(OverflowOperation::Mul)) } /// Raises a value to the power of `exp`, panics if an overflow occurred. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn pow(self, exp: u32) -> Self { match self.checked_pow(exp) { Ok(value) => value, @@ -291,11 +362,7 @@ impl Decimal256 { Ok(x * y) } - inner(self, exp).map_err(|_| OverflowError { - operation: crate::OverflowOperation::Pow, - operand1: self.to_string(), - operand2: exp.to_string(), - }) + inner(self, exp).map_err(|_| OverflowError::new(OverflowOperation::Pow)) } pub fn checked_div(self, other: Self) -> Result { @@ -306,12 +373,13 @@ impl Decimal256 { self.0 .checked_rem(other.0) .map(Self) - .map_err(|_| DivideByZeroError::new(self)) + .map_err(|_| DivideByZeroError) } /// Returns the approximate square root as a Decimal256. /// /// This should not overflow or panic. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn sqrt(&self) -> Self { // Algorithm described in https://hackmd.io/@webmaster128/SJThlukj_ // We start with the highest precision possible and lower it until @@ -331,6 +399,7 @@ impl Decimal256 { /// Precision *must* be a number between 0 and 9 (inclusive). /// /// Returns `None` if the internal multiplication overflows. + #[must_use = "this returns the result of the operation, without modifying the original"] fn sqrt_with_precision(&self, precision: u32) -> Option { let inner_mul = Uint256::from(100u128).pow(precision); self.0.checked_mul(inner_mul).ok().map(|inner| { @@ -339,6 +408,7 @@ impl Decimal256 { }) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn abs_diff(self, other: Self) -> Self { if self < other { other - self @@ -347,6 +417,7 @@ impl Decimal256 { } } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_add(self, other: Self) -> Self { match self.checked_add(other) { Ok(value) => value, @@ -354,6 +425,7 @@ impl Decimal256 { } } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_sub(self, other: Self) -> Self { match self.checked_sub(other) { Ok(value) => value, @@ -361,6 +433,7 @@ impl Decimal256 { } } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_mul(self, other: Self) -> Self { match self.checked_mul(other) { Ok(value) => value, @@ -368,12 +441,67 @@ impl Decimal256 { } } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_pow(self, exp: u32) -> Self { match self.checked_pow(exp) { Ok(value) => value, Err(_) => Self::MAX, } } + + /// Converts this decimal to an unsigned integer by truncating + /// the fractional part, e.g. 22.5 becomes 22. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{Decimal256, Uint256}; + /// + /// let d = Decimal256::from_str("12.345").unwrap(); + /// assert_eq!(d.to_uint_floor(), Uint256::from(12u64)); + /// + /// let d = Decimal256::from_str("12.999").unwrap(); + /// assert_eq!(d.to_uint_floor(), Uint256::from(12u64)); + /// + /// let d = Decimal256::from_str("75.0").unwrap(); + /// assert_eq!(d.to_uint_floor(), Uint256::from(75u64)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_uint_floor(self) -> Uint256 { + self.0 / Self::DECIMAL_FRACTIONAL + } + + /// Converts this decimal to an unsigned integer by rounting up + /// to the next integer, e.g. 22.3 becomes 23. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{Decimal256, Uint256}; + /// + /// let d = Decimal256::from_str("12.345").unwrap(); + /// assert_eq!(d.to_uint_ceil(), Uint256::from(13u64)); + /// + /// let d = Decimal256::from_str("12.999").unwrap(); + /// assert_eq!(d.to_uint_ceil(), Uint256::from(13u64)); + /// + /// let d = Decimal256::from_str("75.0").unwrap(); + /// assert_eq!(d.to_uint_ceil(), Uint256::from(75u64)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_uint_ceil(self) -> Uint256 { + // Using `q = 1 + ((x - 1) / y); // if x != 0` with unsigned integers x, y, q + // from https://stackoverflow.com/a/2745086/2013738. We know `x + y` CAN overflow. + let x = self.0; + let y = Self::DECIMAL_FRACTIONAL; + if x.is_zero() { + Uint256::zero() + } else { + Uint256::one() + ((x - Uint256::one()) / y) + } + } } impl Fraction for Decimal256 { @@ -410,6 +538,30 @@ impl From for Decimal256 { } } +impl TryFrom for Decimal256 { + type Error = Decimal256RangeExceeded; + + fn try_from(value: SignedDecimal) -> Result { + value + .atomics() + .try_into() + .map(Decimal256) + .map_err(|_| Decimal256RangeExceeded) + } +} + +impl TryFrom for Decimal256 { + type Error = Decimal256RangeExceeded; + + fn try_from(value: SignedDecimal256) -> Result { + value + .atomics() + .try_into() + .map(Decimal256) + .map_err(|_| Decimal256RangeExceeded) + } +} + impl FromStr for Decimal256 { type Err = StdError; @@ -423,20 +575,14 @@ impl FromStr for Decimal256 { let mut parts_iter = input.split('.'); let whole_part = parts_iter.next().unwrap(); // split always returns at least one element - let whole = whole_part - .parse::() - .map_err(|_| StdError::generic_err("Error parsing whole"))?; - let mut atomics = whole - .checked_mul(Self::DECIMAL_FRACTIONAL) - .map_err(|_| StdError::generic_err("Value too big"))?; + let whole = whole_part.parse::()?; + let mut atomics = whole.checked_mul(Self::DECIMAL_FRACTIONAL)?; if let Some(fractional_part) = parts_iter.next() { - let fractional = fractional_part - .parse::() - .map_err(|_| StdError::generic_err("Error parsing fractional"))?; + let fractional = fractional_part.parse::()?; let exp = (Self::DECIMAL_PLACES.checked_sub(fractional_part.len() as u32)).ok_or_else( || { - StdError::generic_err(format!( + StdError::msg(format_args!( "Cannot parse more than {} fractional digits", Self::DECIMAL_PLACES )) @@ -444,17 +590,15 @@ impl FromStr for Decimal256 { )?; debug_assert!(exp <= Self::DECIMAL_PLACES); let fractional_factor = Uint256::from(10u128).pow(exp); - atomics = atomics - .checked_add( - // The inner multiplication can't overflow because - // fractional < 10^DECIMAL_PLACES && fractional_factor <= 10^DECIMAL_PLACES - fractional.checked_mul(fractional_factor).unwrap(), - ) - .map_err(|_| StdError::generic_err("Value too big"))?; + atomics = atomics.checked_add( + // The inner multiplication can't overflow because + // fractional < 10^DECIMAL_PLACES && fractional_factor <= 10^DECIMAL_PLACES + fractional.checked_mul(fractional_factor).unwrap(), + )?; } if parts_iter.next().is_some() { - return Err(StdError::generic_err("Unexpected number of dots")); + return Err(StdError::msg("Unexpected number of dots").with_kind(ErrorKind::Parsing)); } Ok(Self(atomics)) @@ -467,7 +611,7 @@ impl fmt::Display for Decimal256 { let fractional = (self.0).checked_rem(Self::DECIMAL_FRACTIONAL).unwrap(); if fractional.is_zero() { - write!(f, "{}", whole) + write!(f, "{whole}") } else { let fractional_string = format!( "{:0>padding$}", @@ -482,6 +626,12 @@ impl fmt::Display for Decimal256 { } } +impl fmt::Debug for Decimal256 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Decimal256({self})") + } +} + impl Add for Decimal256 { type Output = Self; @@ -541,30 +691,6 @@ impl MulAssign for Decimal256 { } forward_ref_op_assign!(impl MulAssign, mul_assign for Decimal256, Decimal256); -/// Both d*u and u*d with d: Decimal256 and u: Uint256 returns an Uint256. There is no -/// specific reason for this decision other than the initial use cases we have. If you -/// need a Decimal256 result for the same calculation, use Decimal256(d*u) or Decimal256(u*d). -impl Mul for Uint256 { - type Output = Self; - - #[allow(clippy::suspicious_arithmetic_impl)] - fn mul(self, rhs: Decimal256) -> Self::Output { - // 0*a and b*0 is always 0 - if self.is_zero() || rhs.is_zero() { - return Uint256::zero(); - } - self.multiply_ratio(rhs.0, Decimal256::DECIMAL_FRACTIONAL) - } -} - -impl Mul for Decimal256 { - type Output = Uint256; - - fn mul(self, rhs: Uint256) -> Self::Output { - rhs * self - } -} - impl Div for Decimal256 { type Output = Self; @@ -623,7 +749,7 @@ impl RemAssign for Decimal256 { } forward_ref_op_assign!(impl RemAssign, rem_assign for Decimal256, Decimal256); -impl std::iter::Sum for Decimal256 +impl core::iter::Sum for Decimal256 where Self: Add, { @@ -654,7 +780,7 @@ impl<'de> Deserialize<'de> for Decimal256 { struct Decimal256Visitor; -impl<'de> de::Visitor<'de> for Decimal256Visitor { +impl de::Visitor<'_> for Decimal256Visitor { type Value = Decimal256; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -667,28 +793,16 @@ impl<'de> de::Visitor<'de> for Decimal256Visitor { { match Self::Value::from_str(v) { Ok(d) => Ok(d), - Err(e) => Err(E::custom(format!("Error parsing decimal '{}': {}", v, e))), + Err(e) => Err(E::custom(format_args!("Error parsing decimal '{v}': {e}"))), } } } -impl PartialEq<&Decimal256> for Decimal256 { - fn eq(&self, rhs: &&Decimal256) -> bool { - self == *rhs - } -} - -impl PartialEq for &Decimal256 { - fn eq(&self, rhs: &Decimal256) -> bool { - *self == rhs - } -} - #[cfg(test)] mod tests { use super::*; - use crate::errors::StdError; - use crate::{from_slice, to_vec}; + + use alloc::vec::Vec; fn dec(input: &str) -> Decimal256 { Decimal256::from_str(input).unwrap() @@ -701,6 +815,7 @@ mod tests { } #[test] + #[allow(deprecated)] fn decimal256_raw() { let value = 300u128; let expected = Uint256::from(value); @@ -731,6 +846,15 @@ mod tests { assert_eq!(value.0, Decimal256::DECIMAL_FRACTIONAL / Uint256::from(8u8)); } + #[test] + fn decimal256_bps() { + let value = Decimal256::bps(125); + assert_eq!( + value.0, + Decimal256::DECIMAL_FRACTIONAL / Uint256::from(80u8) + ); + } + #[test] fn decimal256_from_atomics_works() { let one = Decimal256::one(); @@ -1010,101 +1134,56 @@ mod tests { #[test] fn decimal256_from_str_errors_for_broken_whole_part() { - match Decimal256::from_str("").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing whole"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal256::from_str(" ").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing whole"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal256::from_str("-1").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing whole"), - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal256::from_str("").is_err()); + assert!(Decimal256::from_str(" ").is_err()); + assert!(Decimal256::from_str("-1").is_err()); } #[test] - fn decimal256_from_str_errors_for_broken_fractinal_part() { - match Decimal256::from_str("1.").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing fractional"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal256::from_str("1. ").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing fractional"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal256::from_str("1.e").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing fractional"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal256::from_str("1.2e3").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Error parsing fractional"), - e => panic!("Unexpected error: {:?}", e), - } + fn decimal256_from_str_errors_for_broken_fractional_part() { + assert!(Decimal256::from_str("1.").is_err()); + assert!(Decimal256::from_str("1. ").is_err()); + assert!(Decimal256::from_str("1.e").is_err()); + assert!(Decimal256::from_str("1.2e3").is_err()); } #[test] fn decimal256_from_str_errors_for_more_than_36_fractional_digits() { - match Decimal256::from_str("7.1234567890123456789").unwrap_err() { - StdError::GenericErr { msg, .. } => { - assert_eq!(msg, "Cannot parse more than 18 fractional digits") - } - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal256::from_str("7.1234567890123456789") + .unwrap_err() + .to_string() + .ends_with("Cannot parse more than 18 fractional digits")); // No special rules for trailing zeros. This could be changed but adds gas cost for the happy path. - match Decimal256::from_str("7.1230000000000000000").unwrap_err() { - StdError::GenericErr { msg, .. } => { - assert_eq!(msg, "Cannot parse more than 18 fractional digits") - } - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal256::from_str("7.1230000000000000000") + .unwrap_err() + .to_string() + .ends_with("Cannot parse more than 18 fractional digits")); } #[test] fn decimal256_from_str_errors_for_invalid_number_of_dots() { - match Decimal256::from_str("1.2.3").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Unexpected number of dots"), - e => panic!("Unexpected error: {:?}", e), - } - - match Decimal256::from_str("1.2.3.4").unwrap_err() { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Unexpected number of dots"), - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal256::from_str("1.2.3").is_err()); + assert!(Decimal256::from_str("1.2.3.4").is_err()); } #[test] fn decimal256_from_str_errors_for_more_than_max_value() { // Integer - match Decimal256::from_str("115792089237316195423570985008687907853269984665640564039458") - .unwrap_err() - { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Value too big"), - e => panic!("Unexpected error: {:?}", e), - } + assert!(Decimal256::from_str( + "115792089237316195423570985008687907853269984665640564039458" + ) + .is_err()); // Decimal - match Decimal256::from_str("115792089237316195423570985008687907853269984665640564039458.0") - .unwrap_err() - { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Value too big"), - e => panic!("Unexpected error: {:?}", e), - } - match Decimal256::from_str( + assert!(Decimal256::from_str( + "115792089237316195423570985008687907853269984665640564039458.0" + ) + .is_err()); + assert!(Decimal256::from_str( "115792089237316195423570985008687907853269984665640564039457.584007913129639936", ) - .unwrap_err() - { - StdError::GenericErr { msg, .. } => assert_eq!(msg, "Value too big"), - e => panic!("Unexpected error: {:?}", e), - } + .is_err()); } #[test] @@ -1452,7 +1531,7 @@ mod tests { (Decimal256::permille(6), Decimal256::permille(13)), ]; - // The regular std::ops::Mul is our source of truth for these tests. + // The regular core::ops::Mul is our source of truth for these tests. for (x, y) in test_data.into_iter() { assert_eq!(x * y, x.checked_mul(y).unwrap()); } @@ -1462,52 +1541,10 @@ mod tests { fn decimal256_checked_mul_overflow() { assert_eq!( Decimal256::MAX.checked_mul(Decimal256::percent(200)), - Err(OverflowError { - operation: crate::OverflowOperation::Mul, - operand1: Decimal256::MAX.to_string(), - operand2: Decimal256::percent(200).to_string(), - }) + Err(OverflowError::new(OverflowOperation::Mul)) ); } - #[test] - // in this test the Decimal256 is on the right - fn uint128_decimal_multiply() { - // a*b - let left = Uint256::from(300u128); - let right = Decimal256::one() + Decimal256::percent(50); // 1.5 - assert_eq!(left * right, Uint256::from(450u32)); - - // a*0 - let left = Uint256::from(300u128); - let right = Decimal256::zero(); - assert_eq!(left * right, Uint256::from(0u128)); - - // 0*a - let left = Uint256::from(0u128); - let right = Decimal256::one() + Decimal256::percent(50); // 1.5 - assert_eq!(left * right, Uint256::from(0u128)); - } - - #[test] - // in this test the Decimal256 is on the left - fn decimal256_uint128_multiply() { - // a*b - let left = Decimal256::one() + Decimal256::percent(50); // 1.5 - let right = Uint256::from(300u128); - assert_eq!(left * right, Uint256::from(450u128)); - - // 0*a - let left = Decimal256::zero(); - let right = Uint256::from(300u128); - assert_eq!(left * right, Uint256::from(0u128)); - - // a*0 - let left = Decimal256::one() + Decimal256::percent(50); // 1.5 - let right = Uint256::from(0u128); - assert_eq!(left * right, Uint256::from(0u128)); - } - #[test] #[allow(clippy::op_ref)] fn decimal256_implements_div() { @@ -1712,7 +1749,7 @@ mod tests { ); } - // This case is mathematically undefined but we ensure consistency with Rust stdandard types + // This case is mathematically undefined but we ensure consistency with Rust standard types // https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=20df6716048e77087acd40194b233494 assert_eq!( Decimal256::zero().checked_pow(0).unwrap(), @@ -1789,11 +1826,7 @@ mod tests { fn decimal256_checked_pow_overflow() { assert_eq!( Decimal256::MAX.checked_pow(2), - Err(OverflowError { - operation: crate::OverflowOperation::Pow, - operand1: Decimal256::MAX.to_string(), - operand2: "2".to_string(), - }) + Err(OverflowError::new(OverflowOperation::Pow)) ); } @@ -1902,47 +1935,59 @@ mod tests { #[test] fn decimal256_serialize() { - assert_eq!(to_vec(&Decimal256::zero()).unwrap(), br#""0""#); - assert_eq!(to_vec(&Decimal256::one()).unwrap(), br#""1""#); - assert_eq!(to_vec(&Decimal256::percent(8)).unwrap(), br#""0.08""#); - assert_eq!(to_vec(&Decimal256::percent(87)).unwrap(), br#""0.87""#); - assert_eq!(to_vec(&Decimal256::percent(876)).unwrap(), br#""8.76""#); - assert_eq!(to_vec(&Decimal256::percent(8765)).unwrap(), br#""87.65""#); + assert_eq!(serde_json::to_vec(&Decimal256::zero()).unwrap(), br#""0""#); + assert_eq!(serde_json::to_vec(&Decimal256::one()).unwrap(), br#""1""#); + assert_eq!( + serde_json::to_vec(&Decimal256::percent(8)).unwrap(), + br#""0.08""# + ); + assert_eq!( + serde_json::to_vec(&Decimal256::percent(87)).unwrap(), + br#""0.87""# + ); + assert_eq!( + serde_json::to_vec(&Decimal256::percent(876)).unwrap(), + br#""8.76""# + ); + assert_eq!( + serde_json::to_vec(&Decimal256::percent(8765)).unwrap(), + br#""87.65""# + ); } #[test] fn decimal256_deserialize() { assert_eq!( - from_slice::(br#""0""#).unwrap(), + serde_json::from_slice::(br#""0""#).unwrap(), Decimal256::zero() ); assert_eq!( - from_slice::(br#""1""#).unwrap(), + serde_json::from_slice::(br#""1""#).unwrap(), Decimal256::one() ); assert_eq!( - from_slice::(br#""000""#).unwrap(), + serde_json::from_slice::(br#""000""#).unwrap(), Decimal256::zero() ); assert_eq!( - from_slice::(br#""001""#).unwrap(), + serde_json::from_slice::(br#""001""#).unwrap(), Decimal256::one() ); assert_eq!( - from_slice::(br#""0.08""#).unwrap(), + serde_json::from_slice::(br#""0.08""#).unwrap(), Decimal256::percent(8) ); assert_eq!( - from_slice::(br#""0.87""#).unwrap(), + serde_json::from_slice::(br#""0.87""#).unwrap(), Decimal256::percent(87) ); assert_eq!( - from_slice::(br#""8.76""#).unwrap(), + serde_json::from_slice::(br#""8.76""#).unwrap(), Decimal256::percent(876) ); assert_eq!( - from_slice::(br#""87.65""#).unwrap(), + serde_json::from_slice::(br#""87.65""#).unwrap(), Decimal256::percent(8765) ); } @@ -1993,7 +2038,7 @@ mod tests { } #[test] - #[should_panic(expected = "division by zero")] + #[should_panic(expected = "divisor of zero")] fn decimal256_rem_panics_for_zero() { let _ = Decimal256::percent(777) % Decimal256::zero(); } @@ -2039,11 +2084,11 @@ mod tests { ); assert!(matches!( Decimal256::MAX.checked_div(Decimal256::zero()), - Err(CheckedFromRatioError::DivideByZero { .. }) + Err(CheckedFromRatioError::DivideByZero) )); assert!(matches!( Decimal256::MAX.checked_div(Decimal256::percent(1)), - Err(CheckedFromRatioError::Overflow { .. }) + Err(CheckedFromRatioError::Overflow) )); // checked rem @@ -2077,7 +2122,7 @@ mod tests { #[test] #[should_panic] fn decimal256_pow_overflow_panics() { - Decimal256::MAX.pow(2u32); + _ = Decimal256::MAX.pow(2u32); } #[test] @@ -2143,6 +2188,77 @@ mod tests { assert_eq!(Decimal256::MAX.checked_ceil(), Err(RoundUpOverflowError)); } + #[test] + fn decimal256_to_uint_floor_works() { + let d = Decimal256::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_uint_floor(), Uint256::new(12)); + let d = Decimal256::from_str("12.345").unwrap(); + assert_eq!(d.to_uint_floor(), Uint256::new(12)); + let d = Decimal256::from_str("12.999").unwrap(); + assert_eq!(d.to_uint_floor(), Uint256::new(12)); + let d = Decimal256::from_str("0.98451384").unwrap(); + assert_eq!(d.to_uint_floor(), Uint256::new(0)); + + let d = Decimal256::from_str("75.0").unwrap(); + assert_eq!(d.to_uint_floor(), Uint256::new(75)); + let d = Decimal256::from_str("0.0").unwrap(); + assert_eq!(d.to_uint_floor(), Uint256::new(0)); + + let d = Decimal256::MAX; + assert_eq!( + d.to_uint_floor(), + Uint256::from_str("115792089237316195423570985008687907853269984665640564039457") + .unwrap() + ); + + // Does the same as the old workaround `Uint256::one() * my_decimal`. + // This block can be deleted as part of https://github.com/CosmWasm/cosmwasm/issues/1485. + let tests = vec![ + ( + Decimal256::from_str("12.345").unwrap(), + Uint256::from(12u128), + ), + ( + Decimal256::from_str("0.98451384").unwrap(), + Uint256::from(0u128), + ), + ( + Decimal256::from_str("178.0").unwrap(), + Uint256::from(178u128), + ), + (Decimal256::MIN, Uint256::from(0u128)), + ( + Decimal256::MAX, + Uint256::MAX / Decimal256::DECIMAL_FRACTIONAL, + ), + ]; + for (my_decimal, expected) in tests.into_iter() { + assert_eq!(my_decimal.to_uint_floor(), expected); + } + } + + #[test] + fn decimal256_to_uint_ceil_works() { + let d = Decimal256::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint256::new(13)); + let d = Decimal256::from_str("12.345").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint256::new(13)); + let d = Decimal256::from_str("12.999").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint256::new(13)); + + let d = Decimal256::from_str("75.0").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint256::new(75)); + let d = Decimal256::from_str("0.0").unwrap(); + assert_eq!(d.to_uint_ceil(), Uint256::new(0)); + + let d = Decimal256::MAX; + assert_eq!( + d.to_uint_ceil(), + Uint256::from_str("115792089237316195423570985008687907853269984665640564039458") + .unwrap() + ); + } + #[test] fn decimal256_partial_eq() { let test_cases = [ @@ -2162,4 +2278,17 @@ mod tests { assert_eq!(&lhs == &rhs, expected); } } + + #[test] + fn decimal256_implements_debug() { + let decimal = Decimal256::from_str("123.45").unwrap(); + assert_eq!(format!("{decimal:?}"), "Decimal256(123.45)"); + + let test_cases = ["5", "5.01", "42", "0", "2"]; + for s in test_cases { + let decimal256 = Decimal256::from_str(s).unwrap(); + let expected = format!("Decimal256({s})"); + assert_eq!(format!("{decimal256:?}"), expected); + } + } } diff --git a/packages/std/src/math/fraction.rs b/packages/std/src/math/fraction.rs index ca187ad78c..c13c746182 100644 --- a/packages/std/src/math/fraction.rs +++ b/packages/std/src/math/fraction.rs @@ -10,5 +10,182 @@ pub trait Fraction: Sized { /// Returns the multiplicative inverse `q/p` for fraction `p/q`. /// /// If `p` is zero, None is returned. + #[must_use = "this returns the result of the operation, without modifying the original"] fn inv(&self) -> Option; } + +impl + PartialEq> Fraction for (T, T) { + fn numerator(&self) -> T { + self.0 + } + + fn denominator(&self) -> T { + self.1 + } + + fn inv(&self) -> Option { + if self.numerator() == 0u8.into() { + None + } else { + Some((self.1, self.0)) + } + } +} + +#[macro_export] +macro_rules! impl_mul_fraction { + ($Uint:ident) => { + impl $Uint { + /// Multiply `self` with a struct implementing [`Fraction`] (e.g. [`crate::Decimal`]). + /// Result is rounded down. + /// + /// ## Examples + /// + /// ``` + /// use cosmwasm_std::Uint128; + /// let fraction = (8u128, 21u128); + /// let res = Uint128::new(123456).checked_mul_floor(fraction).unwrap(); + /// assert_eq!(Uint128::new(47030), res); // 47030.8571 rounds down + /// ``` + pub fn checked_mul_floor, T: Into<$Uint>>( + self, + rhs: F, + ) -> Result { + let divisor = rhs.denominator().into(); + let res = self + .full_mul(rhs.numerator().into()) + .checked_div(divisor.into())?; + Ok(res.try_into()?) + } + + /// Same operation as `checked_mul_floor` except unwrapped + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn mul_floor, T: Into<$Uint>>(self, rhs: F) -> Self { + self.checked_mul_floor(rhs).unwrap() + } + + /// Multiply `self` with a struct implementing [`Fraction`] (e.g. [`crate::Decimal`]). + /// Result is rounded up. + /// + /// ## Examples + /// + /// ``` + /// use cosmwasm_std::Uint128; + /// let fraction = (8u128, 21u128); + /// let res = Uint128::new(123456).checked_mul_ceil(fraction).unwrap(); + /// assert_eq!(Uint128::new(47031), res); // 47030.8571 rounds up + /// ``` + pub fn checked_mul_ceil, T: Into<$Uint>>( + self, + rhs: F, + ) -> Result { + let dividend = self.full_mul(rhs.numerator().into()); + let divisor = rhs.denominator().into().into(); + let floor_result = dividend.checked_div(divisor)?.try_into()?; + let remainder = dividend.checked_rem(divisor)?; + if !remainder.is_zero() { + Ok($Uint::one().checked_add(floor_result)?) + } else { + Ok(floor_result) + } + } + + /// Same operation as `checked_mul_ceil` except unwrapped + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn mul_ceil, T: Into<$Uint>>(self, rhs: F) -> Self { + self.checked_mul_ceil(rhs).unwrap() + } + + /// Divide `self` with a struct implementing [`Fraction`] (e.g. [`crate::Decimal`]). + /// Result is rounded down. + /// + /// ## Examples + /// + /// ``` + /// use cosmwasm_std::Uint128; + /// let fraction = (4u128, 5u128); + /// let res = Uint128::new(789).checked_div_floor(fraction).unwrap(); + /// assert_eq!(Uint128::new(986), res); // 986.25 rounds down + /// ``` + pub fn checked_div_floor, T: Into<$Uint>>( + self, + rhs: F, + ) -> Result + where + Self: Sized, + { + let divisor = rhs.numerator().into(); + let res = self + .full_mul(rhs.denominator().into()) + .checked_div(divisor.into())?; + Ok(res.try_into()?) + } + + /// Same operation as `checked_div_floor` except unwrapped + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn div_floor, T: Into<$Uint>>(self, rhs: F) -> Self + where + Self: Sized, + { + self.checked_div_floor(rhs).unwrap() + } + + /// Divide `self` with a struct implementing [`Fraction`] (e.g. [`crate::Decimal`]). + /// Result is rounded up. + /// + /// ## Examples + /// + /// ``` + /// use cosmwasm_std::Uint128; + /// let fraction = (4u128, 5u128); + /// let res = Uint128::new(789).checked_div_ceil(fraction).unwrap(); + /// assert_eq!(Uint128::new(987), res); // 986.25 rounds up + /// ``` + pub fn checked_div_ceil, T: Into<$Uint>>( + self, + rhs: F, + ) -> Result + where + Self: Sized, + { + let dividend = self.full_mul(rhs.denominator().into()); + let divisor = rhs.numerator().into().into(); + let floor_result = dividend.checked_div(divisor)?.try_into()?; + let remainder = dividend.checked_rem(divisor)?; + if !remainder.is_zero() { + Ok($Uint::one().checked_add(floor_result)?) + } else { + Ok(floor_result) + } + } + + /// Same operation as `checked_div_ceil` except unwrapped + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn div_ceil, T: Into<$Uint>>(self, rhs: F) -> Self + where + Self: Sized, + { + self.checked_div_ceil(rhs).unwrap() + } + } + }; +} + +#[cfg(test)] +mod tests { + use crate::{Fraction, Uint128, Uint64}; + + #[test] + fn fraction_tuple_methods() { + let fraction = (Uint64::one(), Uint64::new(2)); + assert_eq!(Uint64::one(), fraction.numerator()); + assert_eq!(Uint64::new(2), fraction.denominator()); + assert_eq!(Some((Uint64::new(2), Uint64::one())), fraction.inv()); + } + + #[test] + fn inverse_with_zero_denominator() { + let fraction = (Uint128::zero(), Uint128::one()); + assert_eq!(None, fraction.inv()); + } +} diff --git a/packages/std/src/math/int128.rs b/packages/std/src/math/int128.rs new file mode 100644 index 0000000000..be84333aa4 --- /dev/null +++ b/packages/std/src/math/int128.rs @@ -0,0 +1,1292 @@ +use alloc::string::{String, ToString}; +use core::fmt; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Not, Rem, RemAssign, Shl, ShlAssign, Shr, + ShrAssign, Sub, SubAssign, +}; +use core::str::FromStr; + +use crate::errors::{ + DivideByZeroError, DivisionError, ErrorKind, OverflowError, OverflowOperation, StdError, +}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + CheckedMultiplyRatioError, Int256, Int512, Int64, Uint128, Uint256, Uint512, Uint64, + __internal::forward_ref_partial_eq, +}; + +use super::conversion::{ + forward_try_from, from_and_to_bytes, primitive_to_wrapped_int, try_from_int_to_int, + wrapped_int_to_primitive, +}; +use super::impl_int_serde; +use super::num_consts::NumConsts; + +/// An implementation of i128 that is using strings for JSON encoding/decoding, +/// such that the full i128 range can be used for clients that convert JSON numbers to floats, +/// like JavaScript and jq. +/// +/// # Examples +/// +/// Use `from` to create instances of this and `i128` to get the value out: +/// +/// ``` +/// # use cosmwasm_std::Int128; +/// let a = Int128::from(258i128); +/// assert_eq!(a.i128(), 258); +/// ``` +#[derive( + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Integer { precision: 128, signed: true })] +pub struct Int128(#[schemars(with = "String")] pub(crate) i128); + +impl_int_serde!(Int128); +forward_ref_partial_eq!(Int128, Int128); + +impl Int128 { + pub const MAX: Int128 = Int128(i128::MAX); + pub const MIN: Int128 = Int128(i128::MIN); + + /// Creates a Int128(value). + /// + /// This method is less flexible than `from` but can be called in a const context. + #[inline] + #[must_use] + pub const fn new(value: i128) -> Self { + Self(value) + } + + /// Creates a Int128(0) + #[inline] + pub const fn zero() -> Self { + Int128(0) + } + + /// Creates a Int128(1) + #[inline] + pub const fn one() -> Self { + Self(1) + } + + /// Returns a copy of the internal data + pub const fn i128(&self) -> i128 { + self.0 + } + + from_and_to_bytes!(i128, 16); + + #[must_use] + pub const fn is_zero(&self) -> bool { + self.0 == 0 + } + + #[must_use] + pub const fn is_negative(&self) -> bool { + self.0.is_negative() + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn pow(self, exp: u32) -> Self { + match self.0.checked_pow(exp) { + Some(val) => Self(val), + None => panic!("attempt to exponentiate with overflow"), + } + } + + /// Returns `self * numerator / denominator`. + /// + /// Due to the nature of the integer division involved, the result is always floored. + /// E.g. 5 * 99/100 = 4. + pub fn checked_multiply_ratio, B: Into>( + &self, + numerator: A, + denominator: B, + ) -> Result { + let numerator = numerator.into(); + let denominator = denominator.into(); + if denominator.is_zero() { + return Err(CheckedMultiplyRatioError::DivideByZero); + } + match (self.full_mul(numerator) / Int256::from(denominator)).try_into() { + Ok(ratio) => Ok(ratio), + Err(_) => Err(CheckedMultiplyRatioError::Overflow), + } + } + + /// Multiplies two [`Int128`] values without overflow, producing an + /// [`Int256`]. + /// + /// # Examples + /// + /// ``` + /// use cosmwasm_std::Int128; + /// + /// let a = Int128::MAX; + /// let result = a.full_mul(2i32); + /// assert_eq!(result.to_string(), "340282366920938463463374607431768211454"); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn full_mul(self, rhs: impl Into) -> Int256 { + Int256::from(self) + .checked_mul(Int256::from(rhs.into())) + .unwrap() + } + + pub fn checked_add(self, other: Self) -> Result { + self.0 + .checked_add(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Add)) + } + + pub fn checked_sub(self, other: Self) -> Result { + self.0 + .checked_sub(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Sub)) + } + + pub fn checked_mul(self, other: Self) -> Result { + self.0 + .checked_mul(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Mul)) + } + + pub fn checked_pow(self, exp: u32) -> Result { + self.0 + .checked_pow(exp) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Pow)) + } + + pub fn checked_div(self, other: Self) -> Result { + if other.is_zero() { + return Err(DivisionError::DivideByZero); + } + self.0 + .checked_div(other.0) + .map(Self) + .ok_or(DivisionError::Overflow) + } + + pub fn checked_div_euclid(self, other: Self) -> Result { + if other.is_zero() { + return Err(DivisionError::DivideByZero); + } + self.0 + .checked_div_euclid(other.0) + .map(Self) + .ok_or(DivisionError::Overflow) + } + + pub fn checked_rem(self, other: Self) -> Result { + self.0 + .checked_rem(other.0) + .map(Self) + .ok_or(DivideByZeroError) + } + + pub fn checked_shr(self, other: u32) -> Result { + if other >= 128 { + return Err(OverflowError::new(OverflowOperation::Shr)); + } + + Ok(Self(self.0.shr(other))) + } + + pub fn checked_shl(self, other: u32) -> Result { + if other >= 128 { + return Err(OverflowError::new(OverflowOperation::Shl)); + } + + Ok(Self(self.0.shl(other))) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_add(self, other: Self) -> Self { + Self(self.0.wrapping_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_sub(self, other: Self) -> Self { + Self(self.0.wrapping_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_mul(self, other: Self) -> Self { + Self(self.0.wrapping_mul(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_pow(self, other: u32) -> Self { + Self(self.0.wrapping_pow(other)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_add(self, other: Self) -> Self { + Self(self.0.saturating_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_sub(self, other: Self) -> Self { + Self(self.0.saturating_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_mul(self, other: Self) -> Self { + Self(self.0.saturating_mul(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_pow(self, exp: u32) -> Self { + Self(self.0.saturating_pow(exp)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs_diff(self, other: Self) -> Uint128 { + Uint128(self.0.abs_diff(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs(self) -> Self { + match self.0.checked_abs() { + Some(val) => Self(val), + None => panic!("attempt to calculate absolute value with overflow"), + } + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn unsigned_abs(self) -> Uint128 { + Uint128(self.0.unsigned_abs()) + } + + /// Strict negation. Computes -self, panicking if self == MIN. + /// + /// This is the same as [`Int128::neg`] but const. + pub const fn strict_neg(self) -> Self { + match self.0.checked_neg() { + Some(val) => Self(val), + None => panic!("attempt to negate with overflow"), + } + } +} + +impl NumConsts for Int128 { + const ZERO: Self = Self::zero(); + const ONE: Self = Self::one(); + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; +} + +// Uint to Int +impl From for Int128 { + fn from(val: Uint64) -> Self { + val.u64().into() + } +} +forward_try_from!(Uint128, Int128); +forward_try_from!(Uint256, Int128); +forward_try_from!(Uint512, Int128); + +// uint to Int +primitive_to_wrapped_int!(u8, Int128); +primitive_to_wrapped_int!(u16, Int128); +primitive_to_wrapped_int!(u32, Int128); +primitive_to_wrapped_int!(u64, Int128); + +// Int to Int +impl From for Int128 { + fn from(val: Int64) -> Self { + val.i64().into() + } +} + +try_from_int_to_int!(Int256, Int128); +try_from_int_to_int!(Int512, Int128); + +// int to Int +primitive_to_wrapped_int!(i8, Int128); +primitive_to_wrapped_int!(i16, Int128); +primitive_to_wrapped_int!(i32, Int128); +primitive_to_wrapped_int!(i64, Int128); +primitive_to_wrapped_int!(i128, Int128); + +// Int to int +wrapped_int_to_primitive!(Int128, i128); + +impl TryFrom<&str> for Int128 { + type Error = StdError; + + fn try_from(val: &str) -> Result { + Self::from_str(val) + } +} + +impl FromStr for Int128 { + type Err = StdError; + + fn from_str(s: &str) -> Result { + match s.parse::() { + Ok(u) => Ok(Self(u)), + Err(e) => { + Err(StdError::msg(format_args!("Parsing Int128: {e}")) + .with_kind(ErrorKind::Parsing)) + } + } + } +} + +impl From for String { + fn from(original: Int128) -> Self { + original.to_string() + } +} + +impl fmt::Display for Int128 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +impl Add for Int128 { + type Output = Self; + + fn add(self, rhs: Self) -> Self { + Int128(self.0.checked_add(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Add, add for Int128, Int128); + +impl Sub for Int128 { + type Output = Self; + + fn sub(self, rhs: Self) -> Self { + Int128(self.0.checked_sub(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Sub, sub for Int128, Int128); + +impl SubAssign for Int128 { + fn sub_assign(&mut self, rhs: Int128) { + self.0 = self.0.checked_sub(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl SubAssign, sub_assign for Int128, Int128); + +impl Div for Int128 { + type Output = Self; + + fn div(self, rhs: Self) -> Self::Output { + Self(self.0.checked_div(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Div, div for Int128, Int128); + +impl Rem for Int128 { + type Output = Self; + + /// # Panics + /// + /// This operation will panic if `rhs` is zero. + #[inline] + fn rem(self, rhs: Self) -> Self { + Self(self.0.rem(rhs.0)) + } +} +forward_ref_binop!(impl Rem, rem for Int128, Int128); + +impl Not for Int128 { + type Output = Self; + + fn not(self) -> Self::Output { + Self(!self.0) + } +} + +impl Neg for Int128 { + type Output = Self; + + fn neg(self) -> Self::Output { + self.strict_neg() + } +} + +impl RemAssign for Int128 { + fn rem_assign(&mut self, rhs: Int128) { + *self = *self % rhs; + } +} +forward_ref_op_assign!(impl RemAssign, rem_assign for Int128, Int128); + +impl Mul for Int128 { + type Output = Self; + + fn mul(self, rhs: Self) -> Self::Output { + Self(self.0.checked_mul(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Mul, mul for Int128, Int128); + +impl MulAssign for Int128 { + fn mul_assign(&mut self, rhs: Self) { + self.0 = self.0.checked_mul(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl MulAssign, mul_assign for Int128, Int128); + +impl Shr for Int128 { + type Output = Self; + + fn shr(self, rhs: u32) -> Self::Output { + self.checked_shr(rhs).unwrap_or_else(|_| { + panic!("right shift error: {rhs} is larger or equal than the number of bits in Int128",) + }) + } +} +forward_ref_binop!(impl Shr, shr for Int128, u32); + +impl Shl for Int128 { + type Output = Self; + + fn shl(self, rhs: u32) -> Self::Output { + self.checked_shl(rhs).unwrap_or_else(|_| { + panic!("left shift error: {rhs} is larger or equal than the number of bits in Int128",) + }) + } +} +forward_ref_binop!(impl Shl, shl for Int128, u32); + +impl AddAssign for Int128 { + fn add_assign(&mut self, rhs: Int128) { + self.0 = self.0.checked_add(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl AddAssign, add_assign for Int128, Int128); + +impl DivAssign for Int128 { + fn div_assign(&mut self, rhs: Self) { + self.0 = self.0.checked_div(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl DivAssign, div_assign for Int128, Int128); + +impl ShrAssign for Int128 { + fn shr_assign(&mut self, rhs: u32) { + *self = Shr::::shr(*self, rhs); + } +} +forward_ref_op_assign!(impl ShrAssign, shr_assign for Int128, u32); + +impl ShlAssign for Int128 { + fn shl_assign(&mut self, rhs: u32) { + *self = Shl::::shl(*self, rhs); + } +} +forward_ref_op_assign!(impl ShlAssign, shl_assign for Int128, u32); + +impl core::iter::Sum for Int128 +where + Self: Add, +{ + fn sum>(iter: I) -> Self { + iter.fold(Self::zero(), Add::add) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::math::conversion::test_try_from_uint_to_int; + + #[test] + fn size_of_works() { + assert_eq!(core::mem::size_of::(), 16); + } + + #[test] + fn int128_from_be_bytes_works() { + // zero + let original = [0; 16]; + let num = Int128::from_be_bytes(original); + assert!(num.is_zero()); + + // one + let original = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]; + let num = Int128::from_be_bytes(original); + assert_eq!(num.i128(), 1); + + // 258 + let original = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2]; + let num = Int128::from_be_bytes(original); + assert_eq!(num.i128(), 258); + + // 2x roundtrip + let original = [1; 16]; + let num = Int128::from_be_bytes(original); + let a: [u8; 16] = num.to_be_bytes(); + assert_eq!(a, original); + + let original = [ + 0u8, 222u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let num = Int128::from_be_bytes(original); + let resulting_bytes: [u8; 16] = num.to_be_bytes(); + assert_eq!(resulting_bytes, original); + } + + #[test] + fn int128_from_le_bytes_works() { + // zero + let original = [0; 16]; + let num = Int128::from_le_bytes(original); + assert!(num.is_zero()); + + // one + let original = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + let num = Int128::from_le_bytes(original); + assert_eq!(num.i128(), 1); + + // 258 + let original = [2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + let num = Int128::from_le_bytes(original); + assert_eq!(num.i128(), 258); + + // 2x roundtrip + let original = [1; 16]; + let num = Int128::from_le_bytes(original); + let a: [u8; 16] = num.to_le_bytes(); + assert_eq!(a, original); + + let original = [ + 0u8, 222u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let num = Int128::from_le_bytes(original); + let resulting_bytes: [u8; 16] = num.to_le_bytes(); + assert_eq!(resulting_bytes, original); + } + + #[test] + fn int128_new_works() { + let num = Int128::new(222); + assert_eq!(num.i128(), 222); + + let num = Int128::new(-222); + assert_eq!(num.i128(), -222); + + let num = Int128::new(i128::MAX); + assert_eq!(num.i128(), i128::MAX); + + let num = Int128::new(i128::MIN); + assert_eq!(num.i128(), i128::MIN); + } + + #[test] + fn int128_not_works() { + assert_eq!(!Int128::new(222), Int128::new(!222)); + assert_eq!(!Int128::new(-222), Int128::new(!-222)); + + assert_eq!(!Int128::MAX, Int128::new(!i128::MAX)); + assert_eq!(!Int128::MIN, Int128::new(!i128::MIN)); + } + + #[test] + fn int128_zero_works() { + let zero = Int128::zero(); + assert_eq!(zero.to_be_bytes(), [0; 16]); + } + + #[test] + fn uint128_one_works() { + let one = Int128::one(); + let mut one_be = [0; 16]; + one_be[15] = 1; + + assert_eq!(one.to_be_bytes(), one_be); + } + + #[test] + fn int128_endianness() { + let be_bytes = [ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let le_bytes = [ + 3u8, 2u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ]; + + // These should all be the same. + let num1 = Int128::from_be_bytes(be_bytes); + let num2 = Int128::from_le_bytes(le_bytes); + assert_eq!(num1, Int128::from(65536u32 + 512 + 3)); + assert_eq!(num1, num2); + } + + #[test] + fn int128_convert_to() { + let a = Int128::new(5); + assert_eq!(i128::from(a), 5); + } + + #[test] + fn int128_convert_from() { + let a = Int128::from(5i128); + assert_eq!(a.0, i128::from(5u32)); + + let a = Int128::from(5u64); + assert_eq!(a.0, i128::from(5u32)); + + let a = Int128::from(5u32); + assert_eq!(a.0, i128::from(5u32)); + + let a = Int128::from(5u16); + assert_eq!(a.0, i128::from(5u32)); + + let a = Int128::from(5u8); + assert_eq!(a.0, i128::from(5u32)); + + let a = Int128::from(-5i128); + assert_eq!(a.0, i128::from(-5i32)); + + let a = Int128::from(-5i64); + assert_eq!(a.0, i128::from(-5i32)); + + let a = Int128::from(-5i32); + assert_eq!(a.0, i128::from(-5i32)); + + let a = Int128::from(-5i16); + assert_eq!(a.0, i128::from(-5i32)); + + let a = Int128::from(-5i8); + assert_eq!(a.0, i128::from(-5i32)); + + let result = Int128::try_from("34567"); + assert_eq!(result.unwrap().0, "34567".parse::().unwrap()); + + let result = Int128::try_from("1.23"); + assert!(result.is_err()); + } + + #[test] + fn int128_try_from_unsigned_works() { + test_try_from_uint_to_int::("Uint128", "Int128"); + test_try_from_uint_to_int::("Uint256", "Int128"); + test_try_from_uint_to_int::("Uint512", "Int128"); + } + + #[test] + fn int128_implements_display() { + let a = Int128::from(12345u32); + assert_eq!(format!("Embedded: {a}"), "Embedded: 12345"); + assert_eq!(a.to_string(), "12345"); + + let a = Int128::from(-12345i32); + assert_eq!(format!("Embedded: {a}"), "Embedded: -12345"); + assert_eq!(a.to_string(), "-12345"); + + let a = Int128::zero(); + assert_eq!(format!("Embedded: {a}"), "Embedded: 0"); + assert_eq!(a.to_string(), "0"); + } + + #[test] + fn int128_display_padding_works() { + // width > natural representation + let a = Int128::from(123u64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: 00123"); + let a = Int128::from(-123i64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: -0123"); + + // width < natural representation + let a = Int128::from(123u64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: 123"); + let a = Int128::from(-123i64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: -123"); + } + + #[test] + fn int128_to_be_bytes_works() { + assert_eq!(Int128::zero().to_be_bytes(), [0; 16]); + + let mut max = [0xff; 16]; + max[0] = 0x7f; + assert_eq!(Int128::MAX.to_be_bytes(), max); + + let mut one = [0; 16]; + one[15] = 1; + assert_eq!(Int128::from(1i128).to_be_bytes(), one); + // Python: `[b for b in (70141183460469231731687303715884018880).to_bytes(16, "big")]` + assert_eq!( + Int128::from(70141183460469231731687303715884018880i128).to_be_bytes(), + [52, 196, 179, 87, 165, 121, 59, 133, 246, 117, 221, 191, 255, 254, 172, 192] + ); + assert_eq!( + Int128::from_be_bytes([17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78]) + .to_be_bytes(), + [17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78] + ); + } + + #[test] + fn int128_to_le_bytes_works() { + assert_eq!(Int128::zero().to_le_bytes(), [0; 16]); + + let mut max = [0xff; 16]; + max[15] = 0x7f; + assert_eq!(Int128::MAX.to_le_bytes(), max); + + let mut one = [0; 16]; + one[0] = 1; + assert_eq!(Int128::from(1i128).to_le_bytes(), one); + // Python: `[b for b in (70141183460469231731687303715884018880).to_bytes(16, "little")]` + assert_eq!( + Int128::from(70141183460469231731687303715884018880i128).to_le_bytes(), + [192, 172, 254, 255, 191, 221, 117, 246, 133, 59, 121, 165, 87, 179, 196, 52] + ); + assert_eq!( + Int128::from_be_bytes([17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78]) + .to_le_bytes(), + [78, 67, 21, 33, 38, 0, 91, 58, 200, 123, 67, 87, 32, 23, 4, 17] + ); + } + + #[test] + fn int128_is_zero_works() { + assert!(Int128::zero().is_zero()); + assert!(Int128(i128::from(0u32)).is_zero()); + + assert!(!Int128::from(1u32).is_zero()); + assert!(!Int128::from(123u32).is_zero()); + assert!(!Int128::from(-123i32).is_zero()); + } + + #[test] + fn int128_is_negative_works() { + assert!(Int128::MIN.is_negative()); + assert!(Int128::from(-123i32).is_negative()); + + assert!(!Int128::MAX.is_negative()); + assert!(!Int128::zero().is_negative()); + assert!(!Int128::from(123u32).is_negative()); + } + + #[test] + fn int128_wrapping_methods() { + // wrapping_add + assert_eq!( + Int128::from(2u32).wrapping_add(Int128::from(2u32)), + Int128::from(4u32) + ); // non-wrapping + assert_eq!(Int128::MAX.wrapping_add(Int128::from(1u32)), Int128::MIN); // wrapping + + // wrapping_sub + assert_eq!( + Int128::from(7u32).wrapping_sub(Int128::from(5u32)), + Int128::from(2u32) + ); // non-wrapping + assert_eq!(Int128::MIN.wrapping_sub(Int128::from(1u32)), Int128::MAX); // wrapping + + // wrapping_mul + assert_eq!( + Int128::from(3u32).wrapping_mul(Int128::from(2u32)), + Int128::from(6u32) + ); // non-wrapping + assert_eq!( + Int128::MAX.wrapping_mul(Int128::from(2u32)), + Int128::from(-2i32) + ); // wrapping + + // wrapping_pow + assert_eq!(Int128::from(2u32).wrapping_pow(3), Int128::from(8u32)); // non-wrapping + assert_eq!(Int128::MAX.wrapping_pow(2), Int128::from(1u32)); // wrapping + } + + #[test] + fn int128_json() { + let orig = Int128::from(1234567890987654321i128); + let serialized = serde_json::to_vec(&orig).unwrap(); + assert_eq!(serialized.as_slice(), b"\"1234567890987654321\""); + let parsed: Int128 = serde_json::from_slice(&serialized).unwrap(); + assert_eq!(parsed, orig); + } + + #[test] + fn int128_compare() { + let a = Int128::from(12345u32); + let b = Int128::from(23456u32); + + assert!(a < b); + assert!(b > a); + assert_eq!(a, Int128::from(12345u32)); + } + + #[test] + #[allow(clippy::op_ref)] + fn int128_math() { + let a = Int128::from(-12345i32); + let b = Int128::from(23456u32); + + // test + with owned and reference right hand side + assert_eq!(a + b, Int128::from(11111u32)); + assert_eq!(a + &b, Int128::from(11111u32)); + + // test - with owned and reference right hand side + assert_eq!(b - a, Int128::from(35801u32)); + assert_eq!(b - &a, Int128::from(35801u32)); + + // test += with owned and reference right hand side + let mut c = Int128::from(300000u32); + c += b; + assert_eq!(c, Int128::from(323456u32)); + let mut d = Int128::from(300000u32); + d += &b; + assert_eq!(d, Int128::from(323456u32)); + + // test -= with owned and reference right hand side + let mut c = Int128::from(300000u32); + c -= b; + assert_eq!(c, Int128::from(276544u32)); + let mut d = Int128::from(300000u32); + d -= &b; + assert_eq!(d, Int128::from(276544u32)); + + // test - with negative result + assert_eq!(a - b, Int128::from(-35801i32)); + } + + #[test] + #[should_panic] + fn int128_add_overflow_panics() { + let _ = Int128::MAX + Int128::from(12u32); + } + + #[test] + #[allow(clippy::op_ref)] + fn int128_sub_works() { + assert_eq!(Int128::from(2u32) - Int128::from(1u32), Int128::from(1u32)); + assert_eq!(Int128::from(2u32) - Int128::from(0u32), Int128::from(2u32)); + assert_eq!(Int128::from(2u32) - Int128::from(2u32), Int128::from(0u32)); + assert_eq!(Int128::from(2u32) - Int128::from(3u32), Int128::from(-1i32)); + + // works for refs + let a = Int128::from(10u32); + let b = Int128::from(3u32); + let expected = Int128::from(7u32); + assert_eq!(a - b, expected); + assert_eq!(a - &b, expected); + assert_eq!(&a - b, expected); + assert_eq!(&a - &b, expected); + } + + #[test] + #[should_panic] + fn int128_sub_overflow_panics() { + let _ = Int128::MIN + Int128::one() - Int128::from(2u32); + } + + #[test] + fn int128_sub_assign_works() { + let mut a = Int128::from(14u32); + a -= Int128::from(2u32); + assert_eq!(a, Int128::from(12u32)); + + // works for refs + let mut a = Int128::from(10u32); + let b = Int128::from(3u32); + let expected = Int128::from(7u32); + a -= &b; + assert_eq!(a, expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn int128_mul_works() { + assert_eq!(Int128::from(2u32) * Int128::from(3u32), Int128::from(6u32)); + assert_eq!(Int128::from(2u32) * Int128::zero(), Int128::zero()); + + // works for refs + let a = Int128::from(11u32); + let b = Int128::from(3u32); + let expected = Int128::from(33u32); + assert_eq!(a * b, expected); + assert_eq!(a * &b, expected); + assert_eq!(&a * b, expected); + assert_eq!(&a * &b, expected); + } + + #[test] + fn int128_mul_assign_works() { + let mut a = Int128::from(14u32); + a *= Int128::from(2u32); + assert_eq!(a, Int128::from(28u32)); + + // works for refs + let mut a = Int128::from(10u32); + let b = Int128::from(3u32); + a *= &b; + assert_eq!(a, Int128::from(30u32)); + } + + #[test] + fn int128_pow_works() { + assert_eq!(Int128::from(2u32).pow(2), Int128::from(4u32)); + assert_eq!(Int128::from(2u32).pow(10), Int128::from(1024u32)); + } + + #[test] + #[should_panic] + fn int128_pow_overflow_panics() { + _ = Int128::MAX.pow(2u32); + } + + #[test] + fn int128_checked_multiply_ratio_works() { + let base = Int128(500); + + // factor 1/1 + assert_eq!(base.checked_multiply_ratio(1i128, 1i128).unwrap(), base); + assert_eq!(base.checked_multiply_ratio(3i128, 3i128).unwrap(), base); + assert_eq!( + base.checked_multiply_ratio(654321i128, 654321i128).unwrap(), + base + ); + assert_eq!( + base.checked_multiply_ratio(i128::MAX, i128::MAX).unwrap(), + base + ); + + // factor 3/2 + assert_eq!( + base.checked_multiply_ratio(3i128, 2i128).unwrap(), + Int128(750) + ); + assert_eq!( + base.checked_multiply_ratio(333333i128, 222222i128).unwrap(), + Int128(750) + ); + + // factor 2/3 (integer division always floors the result) + assert_eq!( + base.checked_multiply_ratio(2i128, 3i128).unwrap(), + Int128(333) + ); + assert_eq!( + base.checked_multiply_ratio(222222i128, 333333i128).unwrap(), + Int128(333) + ); + + // factor 5/6 (integer division always floors the result) + assert_eq!( + base.checked_multiply_ratio(5i128, 6i128).unwrap(), + Int128(416) + ); + assert_eq!( + base.checked_multiply_ratio(100i128, 120i128).unwrap(), + Int128(416) + ); + } + + #[test] + fn int128_checked_multiply_ratio_does_not_panic() { + assert_eq!( + Int128(500i128).checked_multiply_ratio(1i128, 0i128), + Err(CheckedMultiplyRatioError::DivideByZero), + ); + assert_eq!( + Int128(500i128).checked_multiply_ratio(i128::MAX, 1i128), + Err(CheckedMultiplyRatioError::Overflow), + ); + } + + #[test] + fn int128_shr_works() { + let original = Int128::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8, 0u8, 4u8, 2u8, + ]); + + let shifted = Int128::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 128u8, 1u8, 0u8, + ]); + + assert_eq!(original >> 2u32, shifted); + } + + #[test] + #[should_panic] + fn int128_shr_overflow_panics() { + let _ = Int128::from(1u32) >> 128u32; + } + + #[test] + fn sum_works() { + let nums = vec![ + Int128::from(17u32), + Int128::from(123u32), + Int128::from(540u32), + Int128::from(82u32), + ]; + let expected = Int128::from(762u32); + + let sum_as_ref: Int128 = nums.iter().sum(); + assert_eq!(expected, sum_as_ref); + + let sum_as_owned: Int128 = nums.into_iter().sum(); + assert_eq!(expected, sum_as_owned); + } + + #[test] + fn int128_methods() { + // checked_* + assert!(matches!( + Int128::MAX.checked_add(Int128::from(1u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int128::from(1u32).checked_add(Int128::from(1u32)), + Ok(Int128::from(2u32)), + ); + assert!(matches!( + Int128::MIN.checked_sub(Int128::from(1u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int128::from(2u32).checked_sub(Int128::from(1u32)), + Ok(Int128::from(1u32)), + ); + assert!(matches!( + Int128::MAX.checked_mul(Int128::from(2u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int128::from(2u32).checked_mul(Int128::from(2u32)), + Ok(Int128::from(4u32)), + ); + assert!(matches!( + Int128::MAX.checked_pow(2u32), + Err(OverflowError { .. }) + )); + assert_eq!(Int128::from(2u32).checked_pow(3u32), Ok(Int128::from(8u32)),); + assert_eq!( + Int128::MAX.checked_div(Int128::from(0u32)), + Err(DivisionError::DivideByZero) + ); + assert_eq!( + Int128::from(6u32).checked_div(Int128::from(2u32)), + Ok(Int128::from(3u32)), + ); + assert_eq!( + Int128::MAX.checked_div_euclid(Int128::from(0u32)), + Err(DivisionError::DivideByZero) + ); + assert_eq!( + Int128::from(6u32).checked_div_euclid(Int128::from(2u32)), + Ok(Int128::from(3u32)), + ); + assert_eq!( + Int128::from(7u32).checked_div_euclid(Int128::from(2u32)), + Ok(Int128::from(3u32)), + ); + assert!(matches!( + Int128::MAX.checked_rem(Int128::from(0u32)), + Err(DivideByZeroError { .. }) + )); + // checked_* with negative numbers + assert_eq!( + Int128::from(-12i32).checked_div(Int128::from(10i32)), + Ok(Int128::from(-1i32)), + ); + assert_eq!( + Int128::from(-2i32).checked_pow(3u32), + Ok(Int128::from(-8i32)), + ); + assert_eq!( + Int128::from(-6i32).checked_mul(Int128::from(-7i32)), + Ok(Int128::from(42i32)), + ); + assert_eq!( + Int128::from(-2i32).checked_add(Int128::from(3i32)), + Ok(Int128::from(1i32)), + ); + assert_eq!( + Int128::from(-1i32).checked_div_euclid(Int128::from(-2i32)), + Ok(Int128::from(1u32)), + ); + + // saturating_* + assert_eq!(Int128::MAX.saturating_add(Int128::from(1u32)), Int128::MAX); + assert_eq!(Int128::MIN.saturating_sub(Int128::from(1u32)), Int128::MIN); + assert_eq!(Int128::MAX.saturating_mul(Int128::from(2u32)), Int128::MAX); + assert_eq!(Int128::from(4u32).saturating_pow(2u32), Int128::from(16u32)); + assert_eq!(Int128::MAX.saturating_pow(2u32), Int128::MAX); + } + + #[test] + #[allow(clippy::op_ref)] + fn int128_implements_rem() { + let a = Int128::from(10u32); + assert_eq!(a % Int128::from(10u32), Int128::zero()); + assert_eq!(a % Int128::from(2u32), Int128::zero()); + assert_eq!(a % Int128::from(1u32), Int128::zero()); + assert_eq!(a % Int128::from(3u32), Int128::from(1u32)); + assert_eq!(a % Int128::from(4u32), Int128::from(2u32)); + + assert_eq!( + Int128::from(-12i32) % Int128::from(10i32), + Int128::from(-2i32) + ); + assert_eq!( + Int128::from(12i32) % Int128::from(-10i32), + Int128::from(2i32) + ); + assert_eq!( + Int128::from(-12i32) % Int128::from(-10i32), + Int128::from(-2i32) + ); + + // works for refs + let a = Int128::from(10u32); + let b = Int128::from(3u32); + let expected = Int128::from(1u32); + assert_eq!(a % b, expected); + assert_eq!(a % &b, expected); + assert_eq!(&a % b, expected); + assert_eq!(&a % &b, expected); + } + + #[test] + #[should_panic(expected = "divisor of zero")] + fn int128_rem_panics_for_zero() { + let _ = Int128::from(10u32) % Int128::zero(); + } + + #[test] + fn int128_rem_assign_works() { + let mut a = Int128::from(30u32); + a %= Int128::from(4u32); + assert_eq!(a, Int128::from(2u32)); + + // works for refs + let mut a = Int128::from(25u32); + let b = Int128::from(6u32); + a %= &b; + assert_eq!(a, Int128::from(1u32)); + } + + #[test] + fn int128_shr() { + let x: Int128 = 0x4000_0000_0000_0000_0000_0000_0000_0000i128.into(); + assert_eq!(x >> 0, x); // right shift by 0 should be no-op + assert_eq!( + x >> 1, + Int128::from(0x2000_0000_0000_0000_0000_0000_0000_0000i128) + ); + assert_eq!( + x >> 4, + Int128::from(0x0400_0000_0000_0000_0000_0000_0000_0000i128) + ); + // right shift of MIN value by the maximum shift value should result in -1 (filled with 1s) + assert_eq!( + Int128::MIN >> (core::mem::size_of::() as u32 * 8 - 1), + -Int128::one() + ); + } + + #[test] + fn int128_shl() { + let x: Int128 = 0x0800_0000_0000_0000_0000_0000_0000_0000i128.into(); + assert_eq!(x << 0, x); // left shift by 0 should be no-op + assert_eq!( + x << 1, + Int128::from(0x1000_0000_0000_0000_0000_0000_0000_0000i128) + ); + assert_eq!( + x << 4, + Int128::from(0x0800_0000_0000_0000_0000_0000_0000_0000i128 << 4) + ); + // left shift by by the maximum shift value should result in MIN + assert_eq!( + Int128::one() << (core::mem::size_of::() as u32 * 8 - 1), + Int128::MIN + ); + } + + #[test] + fn int128_abs_diff_works() { + let a = Int128::from(42u32); + let b = Int128::from(5u32); + let expected = Uint128::from(37u32); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + + let c = Int128::from(-5i32); + assert_eq!(b.abs_diff(c), Uint128::from(10u32)); + assert_eq!(c.abs_diff(b), Uint128::from(10u32)); + } + + #[test] + fn int128_abs_works() { + let a = Int128::from(42i32); + assert_eq!(a.abs(), a); + + let b = Int128::from(-42i32); + assert_eq!(b.abs(), a); + + assert_eq!(Int128::zero().abs(), Int128::zero()); + assert_eq!((Int128::MIN + Int128::one()).abs(), Int128::MAX); + } + + #[test] + fn int128_unsigned_abs_works() { + assert_eq!(Int128::zero().unsigned_abs(), Uint128::zero()); + assert_eq!(Int128::one().unsigned_abs(), Uint128::one()); + assert_eq!( + Int128::MIN.unsigned_abs(), + Uint128::new(Int128::MAX.0 as u128) + Uint128::one() + ); + + let v = Int128::from(-42i32); + assert_eq!(v.unsigned_abs(), v.abs_diff(Int128::zero())); + } + + #[test] + #[should_panic = "attempt to calculate absolute value with overflow"] + fn int128_abs_min_panics() { + _ = Int128::MIN.abs(); + } + + #[test] + #[should_panic = "attempt to negate with overflow"] + fn int128_neg_min_panics() { + _ = -Int128::MIN; + } + + #[test] + fn int128_partial_eq() { + let test_cases = [(1, 1, true), (42, 42, true), (42, 24, false), (0, 0, true)] + .into_iter() + .map(|(lhs, rhs, expected): (u64, u64, bool)| { + (Int128::from(lhs), Int128::from(rhs), expected) + }); + + #[allow(clippy::op_ref)] + for (lhs, rhs, expected) in test_cases { + assert_eq!(lhs == rhs, expected); + assert_eq!(&lhs == rhs, expected); + assert_eq!(lhs == &rhs, expected); + assert_eq!(&lhs == &rhs, expected); + } + } +} diff --git a/packages/std/src/math/int256.rs b/packages/std/src/math/int256.rs new file mode 100644 index 0000000000..3e850ea298 --- /dev/null +++ b/packages/std/src/math/int256.rs @@ -0,0 +1,1393 @@ +use alloc::string::{String, ToString}; +use core::fmt; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Not, Rem, RemAssign, Shl, ShlAssign, Shr, + ShrAssign, Sub, SubAssign, +}; +use core::str::FromStr; + +use crate::errors::{ + DivideByZeroError, DivisionError, ErrorKind, OverflowError, OverflowOperation, StdError, +}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + CheckedMultiplyRatioError, Int128, Int512, Int64, Uint128, Uint256, Uint512, Uint64, + __internal::forward_ref_partial_eq, +}; + +/// Used internally - we don't want to leak this type since we might change +/// the implementation in the future. +use bnum::types::{I256, U256}; + +use super::conversion::{ + grow_be_int, primitive_to_wrapped_int, try_from_int_to_int, try_from_uint_to_int, +}; +use super::impl_int_serde; +use super::num_consts::NumConsts; + +/// An implementation of i256 that is using strings for JSON encoding/decoding, +/// such that the full i256 range can be used for clients that convert JSON numbers to floats, +/// like JavaScript and jq. +/// +/// # Examples +/// +/// Use `new` to create instances out of i128, `from` for other primitive uint/int types +/// or `from_be_bytes` to provide big endian bytes: +/// +/// ``` +/// # use cosmwasm_std::Int256; +/// let a = Int256::new(258i128); +/// let b = Int256::from(258u16); +/// let c = Int256::from_be_bytes([ +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, +/// ]); +/// assert_eq!(a, b); +/// assert_eq!(a, c); +/// ``` +#[derive( + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Integer { precision: 256, signed: true })] +pub struct Int256(#[schemars(with = "String")] pub(crate) I256); + +impl_int_serde!(Int256); +forward_ref_partial_eq!(Int256, Int256); + +impl Int256 { + pub const MAX: Int256 = Int256(I256::MAX); + pub const MIN: Int256 = Int256(I256::MIN); + + /// Creates a Int256(value). + /// + /// This method is less flexible than `from` but can be called in a const context. + /// + /// Before CosmWasm 3 this took a byte array as an argument. You can get this behaviour + /// with [`from_be_bytes`]. + /// + /// [`from_be_bytes`]: Self::from_be_bytes + #[inline] + #[must_use] + pub const fn new(value: i128) -> Self { + Self::from_be_bytes(grow_be_int(value.to_be_bytes())) + } + + /// Creates a Int256(0) + #[inline] + pub const fn zero() -> Self { + Int256(I256::ZERO) + } + + /// Creates a Int256(1) + #[inline] + pub const fn one() -> Self { + Self(I256::ONE) + } + + /// A conversion from `i128` that, unlike the one provided by the `From` trait, + /// can be used in a `const` context. + #[deprecated(since = "3.0.0", note = "Use Int256::new(value) instead")] + pub const fn from_i128(value: i128) -> Self { + Self::new(value) + } + + #[must_use] + pub const fn from_be_bytes(data: [u8; 32]) -> Self { + let words: [u64; 4] = [ + u64::from_le_bytes([ + data[31], data[30], data[29], data[28], data[27], data[26], data[25], data[24], + ]), + u64::from_le_bytes([ + data[23], data[22], data[21], data[20], data[19], data[18], data[17], data[16], + ]), + u64::from_le_bytes([ + data[15], data[14], data[13], data[12], data[11], data[10], data[9], data[8], + ]), + u64::from_le_bytes([ + data[7], data[6], data[5], data[4], data[3], data[2], data[1], data[0], + ]), + ]; + Self(I256::from_bits(U256::from_digits(words))) + } + + #[must_use] + pub const fn from_le_bytes(data: [u8; 32]) -> Self { + let words: [u64; 4] = [ + u64::from_le_bytes([ + data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], + ]), + u64::from_le_bytes([ + data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15], + ]), + u64::from_le_bytes([ + data[16], data[17], data[18], data[19], data[20], data[21], data[22], data[23], + ]), + u64::from_le_bytes([ + data[24], data[25], data[26], data[27], data[28], data[29], data[30], data[31], + ]), + ]; + Self(I256::from_bits(U256::from_digits(words))) + } + + /// Returns a copy of the number as big endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn to_be_bytes(self) -> [u8; 32] { + let bits = self.0.to_bits(); + let words = bits.digits(); + let words = [ + words[3].to_be_bytes(), + words[2].to_be_bytes(), + words[1].to_be_bytes(), + words[0].to_be_bytes(), + ]; + unsafe { core::mem::transmute::<[[u8; 8]; 4], [u8; 32]>(words) } + } + + /// Returns a copy of the number as little endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn to_le_bytes(self) -> [u8; 32] { + let bits = self.0.to_bits(); + let words = bits.digits(); + let words = [ + words[0].to_le_bytes(), + words[1].to_le_bytes(), + words[2].to_le_bytes(), + words[3].to_le_bytes(), + ]; + unsafe { core::mem::transmute::<[[u8; 8]; 4], [u8; 32]>(words) } + } + + #[must_use] + pub const fn is_zero(&self) -> bool { + self.0.is_zero() + } + + #[must_use] + pub const fn is_negative(&self) -> bool { + self.0.is_negative() + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn pow(self, exp: u32) -> Self { + match self.0.checked_pow(exp) { + Some(val) => Self(val), + None => panic!("attempt to exponentiate with overflow"), + } + } + + /// Returns `self * numerator / denominator`. + /// + /// Due to the nature of the integer division involved, the result is always floored. + /// E.g. 5 * 99/100 = 4. + pub fn checked_multiply_ratio, B: Into>( + &self, + numerator: A, + denominator: B, + ) -> Result { + let numerator = numerator.into(); + let denominator = denominator.into(); + if denominator.is_zero() { + return Err(CheckedMultiplyRatioError::DivideByZero); + } + match (self.full_mul(numerator) / Int512::from(denominator)).try_into() { + Ok(ratio) => Ok(ratio), + Err(_) => Err(CheckedMultiplyRatioError::Overflow), + } + } + + /// Multiplies two [`Int256`] values without overflow, producing an + /// [`Int512`]. + /// + /// # Examples + /// + /// ``` + /// use cosmwasm_std::Int256; + /// + /// let a = Int256::MAX; + /// let result = a.full_mul(2i32); + /// assert_eq!( + /// result.to_string(), + /// "115792089237316195423570985008687907853269984665640564039457584007913129639934" + /// ); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn full_mul(self, rhs: impl Into) -> Int512 { + Int512::from(self) + .checked_mul(Int512::from(rhs.into())) + .unwrap() + } + + pub fn checked_add(self, other: Self) -> Result { + self.0 + .checked_add(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Add)) + } + + pub fn checked_sub(self, other: Self) -> Result { + self.0 + .checked_sub(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Sub)) + } + + pub fn checked_mul(self, other: Self) -> Result { + self.0 + .checked_mul(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Mul)) + } + + pub fn checked_pow(self, exp: u32) -> Result { + self.0 + .checked_pow(exp) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Pow)) + } + + pub fn checked_div(self, other: Self) -> Result { + if other.is_zero() { + return Err(DivisionError::DivideByZero); + } + self.0 + .checked_div(other.0) + .map(Self) + .ok_or(DivisionError::Overflow) + } + + pub fn checked_div_euclid(self, other: Self) -> Result { + if other.is_zero() { + return Err(DivisionError::DivideByZero); + } + self.0 + .checked_div_euclid(other.0) + .map(Self) + .ok_or(DivisionError::Overflow) + } + + pub fn checked_rem(self, other: Self) -> Result { + self.0 + .checked_rem(other.0) + .map(Self) + .ok_or(DivideByZeroError) + } + + pub fn checked_shr(self, other: u32) -> Result { + if other >= 256 { + return Err(OverflowError::new(OverflowOperation::Shr)); + } + + Ok(Self(self.0.shr(other))) + } + + pub fn checked_shl(self, other: u32) -> Result { + if other >= 256 { + return Err(OverflowError::new(OverflowOperation::Shl)); + } + + Ok(Self(self.0.shl(other))) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_add(self, other: Self) -> Self { + Self(self.0.wrapping_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_sub(self, other: Self) -> Self { + Self(self.0.wrapping_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_mul(self, other: Self) -> Self { + Self(self.0.wrapping_mul(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_pow(self, other: u32) -> Self { + Self(self.0.wrapping_pow(other)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_add(self, other: Self) -> Self { + Self(self.0.saturating_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_sub(self, other: Self) -> Self { + Self(self.0.saturating_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_mul(self, other: Self) -> Self { + Self(self.0.saturating_mul(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_pow(self, exp: u32) -> Self { + Self(self.0.saturating_pow(exp)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs_diff(self, other: Self) -> Uint256 { + Uint256(self.0.abs_diff(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs(self) -> Self { + match self.0.checked_abs() { + Some(val) => Self(val), + None => panic!("attempt to calculate absolute value with overflow"), + } + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn unsigned_abs(self) -> Uint256 { + Uint256(self.0.unsigned_abs()) + } + + /// Strict negation. Computes -self, panicking if self == MIN. + /// + /// This is the same as [`Int256::neg`] but const. + pub const fn strict_neg(self) -> Self { + match self.0.checked_neg() { + Some(val) => Self(val), + None => panic!("attempt to negate with overflow"), + } + } +} + +impl NumConsts for Int256 { + const ZERO: Self = Self::zero(); + const ONE: Self = Self::one(); + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; +} + +// Uint to Int +try_from_uint_to_int!(Uint512, Int256); +try_from_uint_to_int!(Uint256, Int256); + +impl From for Int256 { + fn from(val: Uint128) -> Self { + val.u128().into() + } +} + +impl From for Int256 { + fn from(val: Uint64) -> Self { + val.u64().into() + } +} + +// uint to Int +primitive_to_wrapped_int!(u8, Int256); +primitive_to_wrapped_int!(u16, Int256); +primitive_to_wrapped_int!(u32, Int256); +primitive_to_wrapped_int!(u64, Int256); +primitive_to_wrapped_int!(u128, Int256); + +// Int to Int +try_from_int_to_int!(Int512, Int256); + +impl From for Int256 { + fn from(val: Int128) -> Self { + val.i128().into() + } +} + +impl From for Int256 { + fn from(val: Int64) -> Self { + val.i64().into() + } +} + +// int to Int +primitive_to_wrapped_int!(i8, Int256); +primitive_to_wrapped_int!(i16, Int256); +primitive_to_wrapped_int!(i32, Int256); +primitive_to_wrapped_int!(i64, Int256); +primitive_to_wrapped_int!(i128, Int256); + +impl TryFrom<&str> for Int256 { + type Error = StdError; + + fn try_from(val: &str) -> Result { + Self::from_str(val) + } +} + +impl FromStr for Int256 { + type Err = StdError; + + fn from_str(s: &str) -> Result { + match I256::from_str_radix(s, 10) { + Ok(u) => Ok(Self(u)), + Err(e) => { + Err(StdError::msg(format_args!("Parsing Int256: {e}")) + .with_kind(ErrorKind::Parsing)) + } + } + } +} + +impl From for String { + fn from(original: Int256) -> Self { + original.to_string() + } +} + +impl fmt::Display for Int256 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +impl Add for Int256 { + type Output = Self; + + fn add(self, rhs: Self) -> Self { + Int256(self.0.checked_add(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Add, add for Int256, Int256); + +impl Sub for Int256 { + type Output = Self; + + fn sub(self, rhs: Self) -> Self { + Int256(self.0.checked_sub(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Sub, sub for Int256, Int256); + +impl SubAssign for Int256 { + fn sub_assign(&mut self, rhs: Int256) { + self.0 = self.0.checked_sub(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl SubAssign, sub_assign for Int256, Int256); + +impl Div for Int256 { + type Output = Self; + + fn div(self, rhs: Self) -> Self::Output { + Self(self.0.checked_div(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Div, div for Int256, Int256); + +impl Rem for Int256 { + type Output = Self; + + /// # Panics + /// + /// This operation will panic if `rhs` is zero. + #[inline] + fn rem(self, rhs: Self) -> Self { + Self(self.0.rem(rhs.0)) + } +} +forward_ref_binop!(impl Rem, rem for Int256, Int256); + +impl Not for Int256 { + type Output = Self; + + fn not(self) -> Self::Output { + Self(!self.0) + } +} + +impl Neg for Int256 { + type Output = Self; + + fn neg(self) -> Self::Output { + self.strict_neg() + } +} + +impl RemAssign for Int256 { + fn rem_assign(&mut self, rhs: Int256) { + *self = *self % rhs; + } +} +forward_ref_op_assign!(impl RemAssign, rem_assign for Int256, Int256); + +impl Mul for Int256 { + type Output = Self; + + fn mul(self, rhs: Self) -> Self::Output { + Self(self.0.checked_mul(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Mul, mul for Int256, Int256); + +impl MulAssign for Int256 { + fn mul_assign(&mut self, rhs: Self) { + self.0 = self.0.checked_mul(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl MulAssign, mul_assign for Int256, Int256); + +impl Shr for Int256 { + type Output = Self; + + fn shr(self, rhs: u32) -> Self::Output { + self.checked_shr(rhs).unwrap_or_else(|_| { + panic!("right shift error: {rhs} is larger or equal than the number of bits in Int256",) + }) + } +} +forward_ref_binop!(impl Shr, shr for Int256, u32); + +impl Shl for Int256 { + type Output = Self; + + fn shl(self, rhs: u32) -> Self::Output { + self.checked_shl(rhs).unwrap_or_else(|_| { + panic!("left shift error: {rhs} is larger or equal than the number of bits in Int256",) + }) + } +} +forward_ref_binop!(impl Shl, shl for Int256, u32); + +impl AddAssign for Int256 { + fn add_assign(&mut self, rhs: Int256) { + self.0 = self.0.checked_add(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl AddAssign, add_assign for Int256, Int256); + +impl DivAssign for Int256 { + fn div_assign(&mut self, rhs: Self) { + self.0 = self.0.checked_div(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl DivAssign, div_assign for Int256, Int256); + +impl ShrAssign for Int256 { + fn shr_assign(&mut self, rhs: u32) { + *self = Shr::::shr(*self, rhs); + } +} +forward_ref_op_assign!(impl ShrAssign, shr_assign for Int256, u32); + +impl ShlAssign for Int256 { + fn shl_assign(&mut self, rhs: u32) { + *self = Shl::::shl(*self, rhs); + } +} +forward_ref_op_assign!(impl ShlAssign, shl_assign for Int256, u32); + +impl core::iter::Sum for Int256 +where + Self: Add, +{ + fn sum>(iter: I) -> Self { + iter.fold(Self::zero(), Add::add) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::math::conversion::test_try_from_uint_to_int; + + #[test] + fn size_of_works() { + assert_eq!(core::mem::size_of::(), 32); + } + + #[test] + fn int256_new_works() { + let num = Int256::new(1); + assert_eq!( + num.to_be_bytes(), + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1 + ] + ); + + let num = Int256::new(-1); + assert_eq!( + num.to_be_bytes(), + [ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + ] + ); + + for v in [0, 1, -4, 18, 875786576, -11763498739, i128::MAX, i128::MIN] { + // From is implemented by bnum, so we test two independent implementations against each other + let uut = Int256::new(v); + assert_eq!(uut, Int256::from(v)); + } + } + + #[test] + fn int256_from_be_bytes_works() { + let num = Int256::from_be_bytes([1; 32]); + let a: [u8; 32] = num.to_be_bytes(); + assert_eq!(a, [1; 32]); + + let be_bytes = [ + 0u8, 222u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let num = Int256::from_be_bytes(be_bytes); + let resulting_bytes: [u8; 32] = num.to_be_bytes(); + assert_eq!(be_bytes, resulting_bytes); + } + + #[test] + fn int256_not_works() { + let num = Int256::from_be_bytes([1; 32]); + let a = (!num).to_be_bytes(); + assert_eq!(a, [254; 32]); + + assert_eq!(!Int256::from(-1234806i128), Int256::from(!-1234806i128)); + + assert_eq!(!Int256::MAX, Int256::MIN); + assert_eq!(!Int256::MIN, Int256::MAX); + } + + #[test] + fn int256_zero_works() { + let zero = Int256::zero(); + assert_eq!(zero.to_be_bytes(), [0; 32]); + } + + #[test] + fn uint256_one_works() { + let one = Int256::one(); + let mut one_be = [0; 32]; + one_be[31] = 1; + + assert_eq!(one.to_be_bytes(), one_be); + } + + #[test] + fn int256_endianness() { + let be_bytes = [ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let le_bytes = [ + 3u8, 2u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ]; + + // These should all be the same. + let a = Int256::from_be_bytes(be_bytes); + let b = Int256::from_le_bytes(le_bytes); + assert_eq!(a, Int256::from(65536u32 + 512 + 3)); + assert_eq!(a, b); + } + + #[test] + fn int256_convert_from() { + let a = Int256::from(5u128); + assert_eq!(a.0, I256::from(5u32)); + + let a = Int256::from(5u64); + assert_eq!(a.0, I256::from(5u32)); + + let a = Int256::from(5u32); + assert_eq!(a.0, I256::from(5u32)); + + let a = Int256::from(5u16); + assert_eq!(a.0, I256::from(5u32)); + + let a = Int256::from(5u8); + assert_eq!(a.0, I256::from(5u32)); + + let a = Int256::from(-5i128); + assert_eq!(a.0, I256::from(-5i32)); + + let a = Int256::from(-5i64); + assert_eq!(a.0, I256::from(-5i32)); + + let a = Int256::from(-5i32); + assert_eq!(a.0, I256::from(-5i32)); + + let a = Int256::from(-5i16); + assert_eq!(a.0, I256::from(-5i32)); + + let a = Int256::from(-5i8); + assert_eq!(a.0, I256::from(-5i32)); + + let result = Int256::try_from("34567"); + assert_eq!( + result.unwrap().0, + I256::from_str_radix("34567", 10).unwrap() + ); + + let result = Int256::try_from("1.23"); + assert!(result.is_err()); + } + + #[test] + fn int256_try_from_unsigned_works() { + test_try_from_uint_to_int::("Uint256", "Int256"); + test_try_from_uint_to_int::("Uint512", "Int256"); + } + + #[test] + #[allow(deprecated)] + fn int256_from_i128() { + assert_eq!(Int256::from_i128(123i128), Int256::from_str("123").unwrap()); + + assert_eq!( + Int256::from_i128(9785746283745i128), + Int256::from_str("9785746283745").unwrap() + ); + + assert_eq!( + Int256::from_i128(i128::MAX).to_string(), + i128::MAX.to_string() + ); + assert_eq!( + Int256::from_i128(i128::MIN).to_string(), + i128::MIN.to_string() + ); + } + + #[test] + fn int256_implements_display() { + let a = Int256::from(12345u32); + assert_eq!(format!("Embedded: {a}"), "Embedded: 12345"); + assert_eq!(a.to_string(), "12345"); + + let a = Int256::from(-12345i32); + assert_eq!(format!("Embedded: {a}"), "Embedded: -12345"); + assert_eq!(a.to_string(), "-12345"); + + let a = Int256::zero(); + assert_eq!(format!("Embedded: {a}"), "Embedded: 0"); + assert_eq!(a.to_string(), "0"); + } + + #[test] + fn int256_display_padding_works() { + // width > natural representation + let a = Int256::from(123u64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: 00123"); + let a = Int256::from(-123i64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: -0123"); + + // width < natural representation + let a = Int256::from(123u64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: 123"); + let a = Int256::from(-123i64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: -123"); + } + + #[test] + fn int256_to_be_bytes_works() { + assert_eq!(Int256::zero().to_be_bytes(), [0; 32]); + + let mut max = [0xff; 32]; + max[0] = 0x7f; + assert_eq!(Int256::MAX.to_be_bytes(), max); + + let mut one = [0; 32]; + one[31] = 1; + assert_eq!(Int256::from(1u128).to_be_bytes(), one); + // Python: `[b for b in (240282366920938463463374607431768124608).to_bytes(32, "big")]` + assert_eq!( + Int256::from(240282366920938463463374607431768124608u128).to_be_bytes(), + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 196, 179, 87, 165, 121, 59, + 133, 246, 117, 221, 191, 255, 254, 172, 192 + ] + ); + assert_eq!( + Int256::from_be_bytes([ + 17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78, 87, 76, 65, 54, + 211, 201, 192, 7, 42, 233, 2, 240, 200, 115, 150, 240 + ]) + .to_be_bytes(), + [ + 17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78, 87, 76, 65, 54, + 211, 201, 192, 7, 42, 233, 2, 240, 200, 115, 150, 240 + ] + ); + } + + #[test] + fn int256_to_le_bytes_works() { + assert_eq!(Int256::zero().to_le_bytes(), [0; 32]); + + let mut max = [0xff; 32]; + max[31] = 0x7f; + assert_eq!(Int256::MAX.to_le_bytes(), max); + + let mut one = [0; 32]; + one[0] = 1; + assert_eq!(Int256::from(1u128).to_le_bytes(), one); + // Python: `[b for b in (240282366920938463463374607431768124608).to_bytes(64, "little")]` + assert_eq!( + Int256::from(240282366920938463463374607431768124608u128).to_le_bytes(), + [ + 192, 172, 254, 255, 191, 221, 117, 246, 133, 59, 121, 165, 87, 179, 196, 180, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ] + ); + assert_eq!( + Int256::from_be_bytes([ + 17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78, 87, 76, 65, 54, + 211, 201, 192, 7, 42, 233, 2, 240, 200, 115, 150, 240 + ]) + .to_le_bytes(), + [ + 240, 150, 115, 200, 240, 2, 233, 42, 7, 192, 201, 211, 54, 65, 76, 87, 78, 67, 21, + 33, 38, 0, 91, 58, 200, 123, 67, 87, 32, 23, 4, 17 + ] + ); + } + + #[test] + fn int256_is_zero_works() { + assert!(Int256::zero().is_zero()); + assert!(Int256(I256::from(0u32)).is_zero()); + + assert!(!Int256::from(1u32).is_zero()); + assert!(!Int256::from(123u32).is_zero()); + assert!(!Int256::from(-123i32).is_zero()); + } + + #[test] + fn int256_is_negative_works() { + assert!(Int256::MIN.is_negative()); + assert!(Int256::from(-123i32).is_negative()); + + assert!(!Int256::MAX.is_negative()); + assert!(!Int256::zero().is_negative()); + assert!(!Int256::from(123u32).is_negative()); + } + + #[test] + fn int256_wrapping_methods() { + // wrapping_add + assert_eq!( + Int256::from(2u32).wrapping_add(Int256::from(2u32)), + Int256::from(4u32) + ); // non-wrapping + assert_eq!(Int256::MAX.wrapping_add(Int256::from(1u32)), Int256::MIN); // wrapping + + // wrapping_sub + assert_eq!( + Int256::from(7u32).wrapping_sub(Int256::from(5u32)), + Int256::from(2u32) + ); // non-wrapping + assert_eq!(Int256::MIN.wrapping_sub(Int256::from(1u32)), Int256::MAX); // wrapping + + // wrapping_mul + assert_eq!( + Int256::from(3u32).wrapping_mul(Int256::from(2u32)), + Int256::from(6u32) + ); // non-wrapping + assert_eq!( + Int256::MAX.wrapping_mul(Int256::from(2u32)), + Int256::from(-2i32) + ); // wrapping + + // wrapping_pow + assert_eq!(Int256::from(2u32).wrapping_pow(3), Int256::from(8u32)); // non-wrapping + assert_eq!(Int256::MAX.wrapping_pow(2), Int256::from(1u32)); // wrapping + } + + #[test] + fn int256_json() { + let orig = Int256::from(1234567890987654321u128); + let serialized = serde_json::to_vec(&orig).unwrap(); + assert_eq!(serialized.as_slice(), b"\"1234567890987654321\""); + let parsed: Int256 = serde_json::from_slice(&serialized).unwrap(); + assert_eq!(parsed, orig); + } + + #[test] + fn int256_compare() { + let a = Int256::from(12345u32); + let b = Int256::from(23456u32); + + assert!(a < b); + assert!(b > a); + assert_eq!(a, Int256::from(12345u32)); + } + + #[test] + #[allow(clippy::op_ref)] + fn int256_math() { + let a = Int256::from(-12345i32); + let b = Int256::from(23456u32); + + // test + with owned and reference right hand side + assert_eq!(a + b, Int256::from(11111u32)); + assert_eq!(a + &b, Int256::from(11111u32)); + + // test - with owned and reference right hand side + assert_eq!(b - a, Int256::from(35801u32)); + assert_eq!(b - &a, Int256::from(35801u32)); + + // test += with owned and reference right hand side + let mut c = Int256::from(300000u32); + c += b; + assert_eq!(c, Int256::from(323456u32)); + let mut d = Int256::from(300000u32); + d += &b; + assert_eq!(d, Int256::from(323456u32)); + + // test -= with owned and reference right hand side + let mut c = Int256::from(300000u32); + c -= b; + assert_eq!(c, Int256::from(276544u32)); + let mut d = Int256::from(300000u32); + d -= &b; + assert_eq!(d, Int256::from(276544u32)); + + // test - with negative result + assert_eq!(a - b, Int256::from(-35801i32)); + } + + #[test] + #[should_panic] + fn int256_add_overflow_panics() { + let _ = Int256::MAX + Int256::from(12u32); + } + + #[test] + #[allow(clippy::op_ref)] + fn int256_sub_works() { + assert_eq!(Int256::from(2u32) - Int256::from(1u32), Int256::from(1u32)); + assert_eq!(Int256::from(2u32) - Int256::from(0u32), Int256::from(2u32)); + assert_eq!(Int256::from(2u32) - Int256::from(2u32), Int256::from(0u32)); + assert_eq!(Int256::from(2u32) - Int256::from(3u32), Int256::from(-1i32)); + + // works for refs + let a = Int256::from(10u32); + let b = Int256::from(3u32); + let expected = Int256::from(7u32); + assert_eq!(a - b, expected); + assert_eq!(a - &b, expected); + assert_eq!(&a - b, expected); + assert_eq!(&a - &b, expected); + } + + #[test] + #[should_panic] + fn int256_sub_overflow_panics() { + let _ = Int256::MIN + Int256::one() - Int256::from(2u32); + } + + #[test] + fn int256_sub_assign_works() { + let mut a = Int256::from(14u32); + a -= Int256::from(2u32); + assert_eq!(a, Int256::from(12u32)); + + // works for refs + let mut a = Int256::from(10u32); + let b = Int256::from(3u32); + let expected = Int256::from(7u32); + a -= &b; + assert_eq!(a, expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn int256_mul_works() { + assert_eq!(Int256::from(2u32) * Int256::from(3u32), Int256::from(6u32)); + assert_eq!(Int256::from(2u32) * Int256::zero(), Int256::zero()); + + // works for refs + let a = Int256::from(11u32); + let b = Int256::from(3u32); + let expected = Int256::from(33u32); + assert_eq!(a * b, expected); + assert_eq!(a * &b, expected); + assert_eq!(&a * b, expected); + assert_eq!(&a * &b, expected); + } + + #[test] + fn int256_mul_assign_works() { + let mut a = Int256::from(14u32); + a *= Int256::from(2u32); + assert_eq!(a, Int256::from(28u32)); + + // works for refs + let mut a = Int256::from(10u32); + let b = Int256::from(3u32); + a *= &b; + assert_eq!(a, Int256::from(30u32)); + } + + #[test] + fn int256_pow_works() { + assert_eq!(Int256::from(2u32).pow(2), Int256::from(4u32)); + assert_eq!(Int256::from(2u32).pow(10), Int256::from(1024u32)); + } + + #[test] + #[should_panic] + fn int256_pow_overflow_panics() { + _ = Int256::MAX.pow(2u32); + } + + #[test] + fn int256_checked_multiply_ratio_works() { + let base = Int256::new(500); + + // factor 1/1 + assert_eq!(base.checked_multiply_ratio(1i128, 1i128).unwrap(), base); + assert_eq!(base.checked_multiply_ratio(3i128, 3i128).unwrap(), base); + assert_eq!( + base.checked_multiply_ratio(654321i128, 654321i128).unwrap(), + base + ); + assert_eq!( + base.checked_multiply_ratio(i128::MAX, i128::MAX).unwrap(), + base + ); + + // factor 3/2 + assert_eq!( + base.checked_multiply_ratio(3i128, 2i128).unwrap(), + Int256::new(750) + ); + assert_eq!( + base.checked_multiply_ratio(333333i128, 222222i128).unwrap(), + Int256::new(750) + ); + + // factor 2/3 (integer division always floors the result) + assert_eq!( + base.checked_multiply_ratio(2i128, 3i128).unwrap(), + Int256::new(333) + ); + assert_eq!( + base.checked_multiply_ratio(222222i128, 333333i128).unwrap(), + Int256::new(333) + ); + + // factor 5/6 (integer division always floors the result) + assert_eq!( + base.checked_multiply_ratio(5i128, 6i128).unwrap(), + Int256::new(416) + ); + assert_eq!( + base.checked_multiply_ratio(100i128, 120i128).unwrap(), + Int256::new(416) + ); + } + + #[test] + fn int256_checked_multiply_ratio_does_not_panic() { + assert_eq!( + Int256::new(500i128).checked_multiply_ratio(1i128, 0i128), + Err(CheckedMultiplyRatioError::DivideByZero), + ); + assert_eq!( + Int256::MAX.checked_multiply_ratio(Int256::MAX, 1i128), + Err(CheckedMultiplyRatioError::Overflow), + ); + } + + #[test] + fn int256_shr_works() { + let original = Int256::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8, 0u8, 4u8, 2u8, + ]); + + let shifted = Int256::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 128u8, 1u8, 0u8, + ]); + + assert_eq!(original >> 2u32, shifted); + } + + #[test] + #[should_panic] + fn int256_shr_overflow_panics() { + let _ = Int256::from(1u32) >> 256u32; + } + + #[test] + fn sum_works() { + let nums = vec![ + Int256::from(17u32), + Int256::from(123u32), + Int256::from(540u32), + Int256::from(82u32), + ]; + let expected = Int256::from(762u32); + + let sum_as_ref: Int256 = nums.iter().sum(); + assert_eq!(expected, sum_as_ref); + + let sum_as_owned: Int256 = nums.into_iter().sum(); + assert_eq!(expected, sum_as_owned); + } + + #[test] + fn int256_methods() { + // checked_* + assert!(matches!( + Int256::MAX.checked_add(Int256::from(1u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int256::from(1u32).checked_add(Int256::from(1u32)), + Ok(Int256::from(2u32)), + ); + assert!(matches!( + Int256::MIN.checked_sub(Int256::from(1u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int256::from(2u32).checked_sub(Int256::from(1u32)), + Ok(Int256::from(1u32)), + ); + assert!(matches!( + Int256::MAX.checked_mul(Int256::from(2u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int256::from(2u32).checked_mul(Int256::from(2u32)), + Ok(Int256::from(4u32)), + ); + assert!(matches!( + Int256::MAX.checked_pow(2u32), + Err(OverflowError { .. }) + )); + assert_eq!(Int256::from(2u32).checked_pow(3u32), Ok(Int256::from(8u32)),); + assert_eq!( + Int256::MAX.checked_div(Int256::from(0u32)), + Err(DivisionError::DivideByZero) + ); + assert_eq!( + Int256::from(6u32).checked_div(Int256::from(2u32)), + Ok(Int256::from(3u32)), + ); + assert_eq!( + Int256::MAX.checked_div_euclid(Int256::from(0u32)), + Err(DivisionError::DivideByZero) + ); + assert_eq!( + Int256::from(6u32).checked_div_euclid(Int256::from(2u32)), + Ok(Int256::from(3u32)), + ); + assert_eq!( + Int256::from(7u32).checked_div_euclid(Int256::from(2u32)), + Ok(Int256::from(3u32)), + ); + assert!(matches!( + Int256::MAX.checked_rem(Int256::from(0u32)), + Err(DivideByZeroError { .. }) + )); + // checked_* with negative numbers + assert_eq!( + Int256::from(-12i32).checked_div(Int256::from(10i32)), + Ok(Int256::from(-1i32)), + ); + assert_eq!( + Int256::from(-2i32).checked_pow(3u32), + Ok(Int256::from(-8i32)), + ); + assert_eq!( + Int256::from(-6i32).checked_mul(Int256::from(-7i32)), + Ok(Int256::from(42i32)), + ); + assert_eq!( + Int256::from(-2i32).checked_add(Int256::from(3i32)), + Ok(Int256::from(1i32)), + ); + assert_eq!( + Int256::from(-1i32).checked_div_euclid(Int256::from(-2i32)), + Ok(Int256::from(1u32)), + ); + + // saturating_* + assert_eq!(Int256::MAX.saturating_add(Int256::from(1u32)), Int256::MAX); + assert_eq!(Int256::MIN.saturating_sub(Int256::from(1u32)), Int256::MIN); + assert_eq!(Int256::MAX.saturating_mul(Int256::from(2u32)), Int256::MAX); + assert_eq!(Int256::from(4u32).saturating_pow(2u32), Int256::from(16u32)); + assert_eq!(Int256::MAX.saturating_pow(2u32), Int256::MAX); + } + + #[test] + #[allow(clippy::op_ref)] + fn int256_implements_rem() { + let a = Int256::from(10u32); + assert_eq!(a % Int256::from(10u32), Int256::zero()); + assert_eq!(a % Int256::from(2u32), Int256::zero()); + assert_eq!(a % Int256::from(1u32), Int256::zero()); + assert_eq!(a % Int256::from(3u32), Int256::from(1u32)); + assert_eq!(a % Int256::from(4u32), Int256::from(2u32)); + + assert_eq!( + Int256::from(-12i32) % Int256::from(10i32), + Int256::from(-2i32) + ); + assert_eq!( + Int256::from(12i32) % Int256::from(-10i32), + Int256::from(2i32) + ); + assert_eq!( + Int256::from(-12i32) % Int256::from(-10i32), + Int256::from(-2i32) + ); + + // works for refs + let a = Int256::from(10u32); + let b = Int256::from(3u32); + let expected = Int256::from(1u32); + assert_eq!(a % b, expected); + assert_eq!(a % &b, expected); + assert_eq!(&a % b, expected); + assert_eq!(&a % &b, expected); + } + + #[test] + #[should_panic(expected = "divisor of zero")] + fn int256_rem_panics_for_zero() { + let _ = Int256::from(10u32) % Int256::zero(); + } + + #[test] + fn int256_rem_assign_works() { + let mut a = Int256::from(30u32); + a %= Int256::from(4u32); + assert_eq!(a, Int256::from(2u32)); + + // works for refs + let mut a = Int256::from(25u32); + let b = Int256::from(6u32); + a %= &b; + assert_eq!(a, Int256::from(1u32)); + } + + #[test] + fn int256_shr() { + let x: Int256 = 0x8000_0000_0000_0000_0000_0000_0000_0000u128.into(); + assert_eq!(x >> 0, x); // right shift by 0 should be no-op + assert_eq!( + x >> 1, + Int256::from(0x4000_0000_0000_0000_0000_0000_0000_0000u128) + ); + assert_eq!( + x >> 4, + Int256::from(0x0800_0000_0000_0000_0000_0000_0000_0000u128) + ); + // right shift of MIN value by the maximum shift value should result in -1 (filled with 1s) + assert_eq!( + Int256::MIN >> (core::mem::size_of::() as u32 * 8 - 1), + -Int256::one() + ); + } + + #[test] + fn int256_shl() { + let x: Int256 = 0x0800_0000_0000_0000_0000_0000_0000_0000u128.into(); + assert_eq!(x << 0, x); // left shift by 0 should be no-op + assert_eq!( + x << 1, + Int256::from(0x1000_0000_0000_0000_0000_0000_0000_0000u128) + ); + assert_eq!( + x << 4, + Int256::from(0x8000_0000_0000_0000_0000_0000_0000_0000u128) + ); + // left shift by by the maximum shift value should result in MIN + assert_eq!( + Int256::one() << (core::mem::size_of::() as u32 * 8 - 1), + Int256::MIN + ); + } + + #[test] + fn int256_abs_diff_works() { + let a = Int256::from(42u32); + let b = Int256::from(5u32); + let expected = Uint256::from(37u32); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + + let c = Int256::from(-5i32); + assert_eq!(b.abs_diff(c), Uint256::from(10u32)); + assert_eq!(c.abs_diff(b), Uint256::from(10u32)); + } + + #[test] + fn int256_abs_works() { + let a = Int256::from(42i32); + assert_eq!(a.abs(), a); + + let b = Int256::from(-42i32); + assert_eq!(b.abs(), a); + + assert_eq!(Int256::zero().abs(), Int256::zero()); + assert_eq!((Int256::MIN + Int256::one()).abs(), Int256::MAX); + } + + #[test] + fn int256_unsigned_abs_works() { + assert_eq!(Int256::zero().unsigned_abs(), Uint256::zero()); + assert_eq!(Int256::one().unsigned_abs(), Uint256::one()); + assert_eq!( + Int256::MIN.unsigned_abs(), + Uint256::from_be_bytes(Int256::MAX.to_be_bytes()) + Uint256::one() + ); + + let v = Int256::from(-42i32); + assert_eq!(v.unsigned_abs(), v.abs_diff(Int256::zero())); + } + + #[test] + #[should_panic = "attempt to calculate absolute value with overflow"] + fn int256_abs_min_panics() { + _ = Int256::MIN.abs(); + } + + #[test] + #[should_panic = "attempt to negate with overflow"] + fn int256_neg_min_panics() { + _ = -Int256::MIN; + } + + #[test] + fn int256_partial_eq() { + let test_cases = [(1, 1, true), (42, 42, true), (42, 24, false), (0, 0, true)] + .into_iter() + .map(|(lhs, rhs, expected): (u64, u64, bool)| { + (Int256::from(lhs), Int256::from(rhs), expected) + }); + + #[allow(clippy::op_ref)] + for (lhs, rhs, expected) in test_cases { + assert_eq!(lhs == rhs, expected); + assert_eq!(&lhs == rhs, expected); + assert_eq!(lhs == &rhs, expected); + assert_eq!(&lhs == &rhs, expected); + } + } +} diff --git a/packages/std/src/math/int512.rs b/packages/std/src/math/int512.rs new file mode 100644 index 0000000000..d96de8e6da --- /dev/null +++ b/packages/std/src/math/int512.rs @@ -0,0 +1,1367 @@ +use alloc::string::{String, ToString}; +use core::fmt; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Not, Rem, RemAssign, Shl, ShlAssign, Shr, + ShrAssign, Sub, SubAssign, +}; +use core::str::FromStr; + +use crate::errors::{ + DivideByZeroError, DivisionError, ErrorKind, OverflowError, OverflowOperation, StdError, +}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + Int128, Int256, Int64, Uint128, Uint256, Uint512, Uint64, __internal::forward_ref_partial_eq, +}; + +/// Used internally - we don't want to leak this type since we might change +/// the implementation in the future. +use bnum::types::{I512, U512}; + +use super::conversion::{grow_be_int, primitive_to_wrapped_int, try_from_uint_to_int}; +use super::impl_int_serde; +use super::num_consts::NumConsts; + +/// An implementation of i512 that is using strings for JSON encoding/decoding, +/// such that the full i512 range can be used for clients that convert JSON numbers to floats, +/// like JavaScript and jq. +/// +/// # Examples +/// +/// Use `new` to create instances out of i128, `from` for other primitive uint/int types +/// or `from_be_bytes` to provide big endian bytes: +/// +/// ``` +/// # use cosmwasm_std::Int512; +/// let a = Int512::new(258i128); +/// let b = Int512::from(258u128); +/// let c = Int512::from_be_bytes([ +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, +/// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, +/// ]); +/// assert_eq!(a, b); +/// assert_eq!(a, c); +/// ``` +#[derive( + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Integer { precision: 512, signed: true })] +pub struct Int512(#[schemars(with = "String")] pub(crate) I512); + +impl_int_serde!(Int512); +forward_ref_partial_eq!(Int512, Int512); + +impl Int512 { + pub const MAX: Int512 = Int512(I512::MAX); + pub const MIN: Int512 = Int512(I512::MIN); + + /// Creates a Int512(value). + /// + /// This method is less flexible than `from` but can be called in a const context. + /// + /// Before CosmWasm 3 this took a byte array as an argument. You can get this behaviour + /// with [`from_be_bytes`]. + /// + /// [`from_be_bytes`]: Self::from_be_bytes + #[inline] + #[must_use] + pub const fn new(value: i128) -> Self { + Self::from_be_bytes(grow_be_int(value.to_be_bytes())) + } + + /// Creates a Int512(0) + #[inline] + pub const fn zero() -> Self { + Int512(I512::ZERO) + } + + /// Creates a Int512(1) + #[inline] + pub const fn one() -> Self { + Self(I512::ONE) + } + + #[must_use] + pub const fn from_be_bytes(data: [u8; 64]) -> Self { + let words: [u64; 8] = [ + u64::from_le_bytes([ + data[63], data[62], data[61], data[60], data[59], data[58], data[57], data[56], + ]), + u64::from_le_bytes([ + data[55], data[54], data[53], data[52], data[51], data[50], data[49], data[48], + ]), + u64::from_le_bytes([ + data[47], data[46], data[45], data[44], data[43], data[42], data[41], data[40], + ]), + u64::from_le_bytes([ + data[39], data[38], data[37], data[36], data[35], data[34], data[33], data[32], + ]), + u64::from_le_bytes([ + data[31], data[30], data[29], data[28], data[27], data[26], data[25], data[24], + ]), + u64::from_le_bytes([ + data[23], data[22], data[21], data[20], data[19], data[18], data[17], data[16], + ]), + u64::from_le_bytes([ + data[15], data[14], data[13], data[12], data[11], data[10], data[9], data[8], + ]), + u64::from_le_bytes([ + data[7], data[6], data[5], data[4], data[3], data[2], data[1], data[0], + ]), + ]; + Self(I512::from_bits(U512::from_digits(words))) + } + + #[must_use] + pub const fn from_le_bytes(data: [u8; 64]) -> Self { + let words: [u64; 8] = [ + u64::from_le_bytes([ + data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], + ]), + u64::from_le_bytes([ + data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15], + ]), + u64::from_le_bytes([ + data[16], data[17], data[18], data[19], data[20], data[21], data[22], data[23], + ]), + u64::from_le_bytes([ + data[24], data[25], data[26], data[27], data[28], data[29], data[30], data[31], + ]), + u64::from_le_bytes([ + data[32], data[33], data[34], data[35], data[36], data[37], data[38], data[39], + ]), + u64::from_le_bytes([ + data[40], data[41], data[42], data[43], data[44], data[45], data[46], data[47], + ]), + u64::from_le_bytes([ + data[48], data[49], data[50], data[51], data[52], data[53], data[54], data[55], + ]), + u64::from_le_bytes([ + data[56], data[57], data[58], data[59], data[60], data[61], data[62], data[63], + ]), + ]; + Self(I512::from_bits(U512::from_digits(words))) + } + + /// Returns a copy of the number as big endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn to_be_bytes(self) -> [u8; 64] { + let bits = self.0.to_bits(); + let words = bits.digits(); + let words = [ + words[7].to_be_bytes(), + words[6].to_be_bytes(), + words[5].to_be_bytes(), + words[4].to_be_bytes(), + words[3].to_be_bytes(), + words[2].to_be_bytes(), + words[1].to_be_bytes(), + words[0].to_be_bytes(), + ]; + unsafe { core::mem::transmute::<[[u8; 8]; 8], [u8; 64]>(words) } + } + + /// Returns a copy of the number as little endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn to_le_bytes(self) -> [u8; 64] { + let bits = self.0.to_bits(); + let words = bits.digits(); + let words = [ + words[0].to_le_bytes(), + words[1].to_le_bytes(), + words[2].to_le_bytes(), + words[3].to_le_bytes(), + words[4].to_le_bytes(), + words[5].to_le_bytes(), + words[6].to_le_bytes(), + words[7].to_le_bytes(), + ]; + unsafe { core::mem::transmute::<[[u8; 8]; 8], [u8; 64]>(words) } + } + + #[must_use] + pub const fn is_zero(&self) -> bool { + self.0.is_zero() + } + + #[must_use] + pub const fn is_negative(&self) -> bool { + self.0.is_negative() + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn pow(self, exp: u32) -> Self { + match self.0.checked_pow(exp) { + Some(val) => Self(val), + None => panic!("attempt to exponentiate with overflow"), + } + } + + pub fn checked_add(self, other: Self) -> Result { + self.0 + .checked_add(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Add)) + } + + pub fn checked_sub(self, other: Self) -> Result { + self.0 + .checked_sub(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Sub)) + } + + pub fn checked_mul(self, other: Self) -> Result { + self.0 + .checked_mul(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Mul)) + } + + pub fn checked_pow(self, exp: u32) -> Result { + self.0 + .checked_pow(exp) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Pow)) + } + + pub fn checked_div(self, other: Self) -> Result { + if other.is_zero() { + return Err(DivisionError::DivideByZero); + } + self.0 + .checked_div(other.0) + .map(Self) + .ok_or(DivisionError::Overflow) + } + + pub fn checked_div_euclid(self, other: Self) -> Result { + if other.is_zero() { + return Err(DivisionError::DivideByZero); + } + self.0 + .checked_div_euclid(other.0) + .map(Self) + .ok_or(DivisionError::Overflow) + } + + pub fn checked_rem(self, other: Self) -> Result { + self.0 + .checked_rem(other.0) + .map(Self) + .ok_or(DivideByZeroError) + } + + pub fn checked_shr(self, other: u32) -> Result { + if other >= 512 { + return Err(OverflowError::new(OverflowOperation::Shr)); + } + + Ok(Self(self.0.shr(other))) + } + + pub fn checked_shl(self, other: u32) -> Result { + if other >= 512 { + return Err(OverflowError::new(OverflowOperation::Shl)); + } + + Ok(Self(self.0.shl(other))) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_add(self, other: Self) -> Self { + Self(self.0.wrapping_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_sub(self, other: Self) -> Self { + Self(self.0.wrapping_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_mul(self, other: Self) -> Self { + Self(self.0.wrapping_mul(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_pow(self, other: u32) -> Self { + Self(self.0.wrapping_pow(other)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_add(self, other: Self) -> Self { + Self(self.0.saturating_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_sub(self, other: Self) -> Self { + Self(self.0.saturating_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_mul(self, other: Self) -> Self { + Self(self.0.saturating_mul(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_pow(self, exp: u32) -> Self { + Self(self.0.saturating_pow(exp)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs_diff(self, other: Self) -> Uint512 { + Uint512(self.0.abs_diff(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs(self) -> Self { + match self.0.checked_abs() { + Some(val) => Self(val), + None => panic!("attempt to calculate absolute value with overflow"), + } + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn unsigned_abs(self) -> Uint512 { + Uint512(self.0.unsigned_abs()) + } + + /// Strict negation. Computes -self, panicking if self == MIN. + /// + /// This is the same as [`Int512::neg`] but const. + pub const fn strict_neg(self) -> Self { + match self.0.checked_neg() { + Some(val) => Self(val), + None => panic!("attempt to negate with overflow"), + } + } +} + +impl NumConsts for Int512 { + const ZERO: Self = Self::zero(); + const ONE: Self = Self::one(); + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; +} + +// Uint to Int +try_from_uint_to_int!(Uint512, Int512); + +impl From for Int512 { + fn from(val: Uint256) -> Self { + let mut bytes = [0u8; 64]; + bytes[32..].copy_from_slice(&val.to_be_bytes()); + + Self::from_be_bytes(bytes) + } +} + +impl From for Int512 { + fn from(val: Uint128) -> Self { + val.u128().into() + } +} + +impl From for Int512 { + fn from(val: Uint64) -> Self { + val.u64().into() + } +} + +// uint to Int +primitive_to_wrapped_int!(u8, Int512); +primitive_to_wrapped_int!(u16, Int512); +primitive_to_wrapped_int!(u32, Int512); +primitive_to_wrapped_int!(u64, Int512); +primitive_to_wrapped_int!(u128, Int512); + +// int to Int +primitive_to_wrapped_int!(i8, Int512); +primitive_to_wrapped_int!(i16, Int512); +primitive_to_wrapped_int!(i32, Int512); +primitive_to_wrapped_int!(i64, Int512); +primitive_to_wrapped_int!(i128, Int512); + +// Int to Int +impl From for Int512 { + fn from(val: Int64) -> Self { + Int512(val.i64().into()) + } +} + +impl From for Int512 { + fn from(val: Int128) -> Self { + Int512(val.i128().into()) + } +} + +impl From for Int512 { + fn from(val: Int256) -> Self { + Self::from_be_bytes(grow_be_int(val.to_be_bytes())) + } +} + +impl TryFrom<&str> for Int512 { + type Error = StdError; + + fn try_from(val: &str) -> Result { + Self::from_str(val) + } +} + +impl FromStr for Int512 { + type Err = StdError; + + fn from_str(s: &str) -> Result { + match I512::from_str_radix(s, 10) { + Ok(u) => Ok(Self(u)), + Err(e) => { + Err(StdError::msg(format_args!("Parsing Int512: {e}")) + .with_kind(ErrorKind::Parsing)) + } + } + } +} + +impl From for String { + fn from(original: Int512) -> Self { + original.to_string() + } +} + +impl fmt::Display for Int512 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +impl Add for Int512 { + type Output = Self; + + fn add(self, rhs: Self) -> Self { + Int512(self.0.checked_add(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Add, add for Int512, Int512); + +impl Sub for Int512 { + type Output = Self; + + fn sub(self, rhs: Self) -> Self { + Int512(self.0.checked_sub(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Sub, sub for Int512, Int512); + +impl SubAssign for Int512 { + fn sub_assign(&mut self, rhs: Int512) { + self.0 = self.0.checked_sub(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl SubAssign, sub_assign for Int512, Int512); + +impl Div for Int512 { + type Output = Self; + + fn div(self, rhs: Self) -> Self::Output { + Self(self.0.checked_div(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Div, div for Int512, Int512); + +impl Rem for Int512 { + type Output = Self; + + /// # Panics + /// + /// This operation will panic if `rhs` is zero. + #[inline] + fn rem(self, rhs: Self) -> Self { + Self(self.0.rem(rhs.0)) + } +} +forward_ref_binop!(impl Rem, rem for Int512, Int512); + +impl Not for Int512 { + type Output = Self; + + fn not(self) -> Self::Output { + Self(!self.0) + } +} + +impl Neg for Int512 { + type Output = Self; + + fn neg(self) -> Self::Output { + self.strict_neg() + } +} + +impl RemAssign for Int512 { + fn rem_assign(&mut self, rhs: Int512) { + *self = *self % rhs; + } +} +forward_ref_op_assign!(impl RemAssign, rem_assign for Int512, Int512); + +impl Mul for Int512 { + type Output = Self; + + fn mul(self, rhs: Self) -> Self::Output { + Self(self.0.checked_mul(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Mul, mul for Int512, Int512); + +impl MulAssign for Int512 { + fn mul_assign(&mut self, rhs: Self) { + self.0 = self.0.checked_mul(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl MulAssign, mul_assign for Int512, Int512); + +impl Shr for Int512 { + type Output = Self; + + fn shr(self, rhs: u32) -> Self::Output { + self.checked_shr(rhs).unwrap_or_else(|_| { + panic!("right shift error: {rhs} is larger or equal than the number of bits in Int512",) + }) + } +} +forward_ref_binop!(impl Shr, shr for Int512, u32); + +impl Shl for Int512 { + type Output = Self; + + fn shl(self, rhs: u32) -> Self::Output { + self.checked_shl(rhs).unwrap_or_else(|_| { + panic!("left shift error: {rhs} is larger or equal than the number of bits in Int512",) + }) + } +} +forward_ref_binop!(impl Shl, shl for Int512, u32); + +impl AddAssign for Int512 { + fn add_assign(&mut self, rhs: Int512) { + self.0 = self.0.checked_add(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl AddAssign, add_assign for Int512, Int512); + +impl DivAssign for Int512 { + fn div_assign(&mut self, rhs: Self) { + self.0 = self.0.checked_div(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl DivAssign, div_assign for Int512, Int512); + +impl ShrAssign for Int512 { + fn shr_assign(&mut self, rhs: u32) { + *self = Shr::::shr(*self, rhs); + } +} +forward_ref_op_assign!(impl ShrAssign, shr_assign for Int512, u32); + +impl ShlAssign for Int512 { + fn shl_assign(&mut self, rhs: u32) { + *self = Shl::::shl(*self, rhs); + } +} +forward_ref_op_assign!(impl ShlAssign, shl_assign for Int512, u32); + +impl core::iter::Sum for Int512 +where + Self: Add, +{ + fn sum>(iter: I) -> Self { + iter.fold(Self::zero(), Add::add) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::math::conversion::test_try_from_uint_to_int; + + #[test] + fn size_of_works() { + assert_eq!(core::mem::size_of::(), 64); + } + + #[test] + fn int512_new_works() { + let num = Int512::new(1); + assert_eq!( + num.to_be_bytes(), + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1 + ] + ); + + let num = Int512::new(-1); + assert_eq!( + num.to_be_bytes(), + [ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + ] + ); + + for v in [0, 1, -4, 18, 875786576, -11763498739, i128::MAX, i128::MIN] { + // From is implemented by bnum, so we test two independent implementations against each other + let uut = Int512::new(v); + assert_eq!(uut, Int512::from(v)); + } + } + + #[test] + fn int512_from_be_bytes_works() { + let num = Int512::from_be_bytes([1; 64]); + let a: [u8; 64] = num.to_be_bytes(); + assert_eq!(a, [1; 64]); + + let be_bytes = [ + 0u8, 222u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let num = Int512::from_be_bytes(be_bytes); + let resulting_bytes: [u8; 64] = num.to_be_bytes(); + assert_eq!(be_bytes, resulting_bytes); + } + + #[test] + fn int512_not_works() { + let num = Int512::from_be_bytes([1; 64]); + let a = (!num).to_be_bytes(); + assert_eq!(a, [254; 64]); + + assert_eq!(!Int512::from(-1234806i128), Int512::from(!-1234806i128)); + + assert_eq!(!Int512::MAX, Int512::MIN); + assert_eq!(!Int512::MIN, Int512::MAX); + } + + #[test] + fn int512_zero_works() { + let zero = Int512::zero(); + assert_eq!(zero.to_be_bytes(), [0; 64]); + } + + #[test] + fn uint512_one_works() { + let one = Int512::one(); + let mut one_be = [0; 64]; + one_be[63] = 1; + + assert_eq!(one.to_be_bytes(), one_be); + } + + #[test] + fn int512_endianness() { + let be_bytes = [ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let le_bytes = [ + 3u8, 2u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ]; + + // These should all be the same. + let a = Int512::from_be_bytes(be_bytes); + let b = Int512::from_le_bytes(le_bytes); + assert_eq!(a, Int512::from(65536u32 + 512 + 3)); + assert_eq!(a, b); + } + + #[test] + fn int512_convert_from() { + let a = Int512::from(5u128); + assert_eq!(a.0, I512::from(5u32)); + + let a = Int512::from(5u64); + assert_eq!(a.0, I512::from(5u32)); + + let a = Int512::from(5u32); + assert_eq!(a.0, I512::from(5u32)); + + let a = Int512::from(5u16); + assert_eq!(a.0, I512::from(5u32)); + + let a = Int512::from(5u8); + assert_eq!(a.0, I512::from(5u32)); + + let a = Int512::from(-5i128); + assert_eq!(a.0, I512::from(-5i32)); + + let a = Int512::from(-5i64); + assert_eq!(a.0, I512::from(-5i32)); + + let a = Int512::from(-5i32); + assert_eq!(a.0, I512::from(-5i32)); + + let a = Int512::from(-5i16); + assert_eq!(a.0, I512::from(-5i32)); + + let a = Int512::from(-5i8); + assert_eq!(a.0, I512::from(-5i32)); + + // other big signed integers + let values = [ + Int64::MAX, + Int64::MIN, + Int64::one(), + -Int64::one(), + Int64::zero(), + ]; + for v in values { + assert_eq!(Int512::from(v).to_string(), v.to_string()); + } + + let values = [ + Int128::MAX, + Int128::MIN, + Int128::one(), + -Int128::one(), + Int128::zero(), + ]; + for v in values { + assert_eq!(Int512::from(v).to_string(), v.to_string()); + } + + let values = [ + Int256::MAX, + Int256::MIN, + Int256::one(), + -Int256::one(), + Int256::zero(), + ]; + for v in values { + assert_eq!(Int512::from(v).to_string(), v.to_string()); + } + + let result = Int512::try_from("34567"); + assert_eq!( + result.unwrap().0, + I512::from_str_radix("34567", 10).unwrap() + ); + + let result = Int512::try_from("1.23"); + assert!(result.is_err()); + } + + #[test] + fn int512_try_from_unsigned_works() { + test_try_from_uint_to_int::("Uint256", "Int256"); + test_try_from_uint_to_int::("Uint512", "Int256"); + } + + #[test] + fn int512_implements_display() { + let a = Int512::from(12345u32); + assert_eq!(format!("Embedded: {a}"), "Embedded: 12345"); + assert_eq!(a.to_string(), "12345"); + + let a = Int512::from(-12345i32); + assert_eq!(format!("Embedded: {a}"), "Embedded: -12345"); + assert_eq!(a.to_string(), "-12345"); + + let a = Int512::zero(); + assert_eq!(format!("Embedded: {a}"), "Embedded: 0"); + assert_eq!(a.to_string(), "0"); + } + + #[test] + fn int512_display_padding_works() { + // width > natural representation + let a = Int512::from(123u64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: 00123"); + let a = Int512::from(-123i64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: -0123"); + + // width < natural representation + let a = Int512::from(123u64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: 123"); + let a = Int512::from(-123i64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: -123"); + } + + #[test] + fn int512_to_be_bytes_works() { + assert_eq!(Int512::zero().to_be_bytes(), [0; 64]); + + let mut max = [0xff; 64]; + max[0] = 0x7f; + assert_eq!(Int512::MAX.to_be_bytes(), max); + + let mut one = [0; 64]; + one[63] = 1; + assert_eq!(Int512::from(1u128).to_be_bytes(), one); + // Python: `[b for b in (240282366920938463463374607431768124608).to_bytes(64, "big")]` + assert_eq!( + Int512::from(240282366920938463463374607431768124608u128).to_be_bytes(), + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 196, 179, 87, 165, + 121, 59, 133, 246, 117, 221, 191, 255, 254, 172, 192 + ] + ); + assert_eq!( + Int512::from_be_bytes([ + 17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78, 87, 76, 65, 54, + 211, 201, 192, 7, 42, 233, 2, 240, 200, 115, 150, 240, 218, 88, 106, 45, 208, 134, + 238, 119, 85, 22, 14, 88, 166, 195, 154, 73, 64, 10, 44, 59, 13, 22, 47, 12, 99, 8, + 252, 96, 230, 187, 38, 29 + ]) + .to_be_bytes(), + [ + 17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78, 87, 76, 65, 54, + 211, 201, 192, 7, 42, 233, 2, 240, 200, 115, 150, 240, 218, 88, 106, 45, 208, 134, + 238, 119, 85, 22, 14, 88, 166, 195, 154, 73, 64, 10, 44, 59, 13, 22, 47, 12, 99, 8, + 252, 96, 230, 187, 38, 29 + ] + ); + } + + #[test] + fn int512_to_le_bytes_works() { + assert_eq!(Int512::zero().to_le_bytes(), [0; 64]); + + let mut max = [0xff; 64]; + max[63] = 0x7f; + assert_eq!(Int512::MAX.to_le_bytes(), max); + + let mut one = [0; 64]; + one[0] = 1; + assert_eq!(Int512::from(1u128).to_le_bytes(), one); + // Python: `[b for b in (240282366920938463463374607431768124608).to_bytes(64, "little")]` + assert_eq!( + Int512::from(240282366920938463463374607431768124608u128).to_le_bytes(), + [ + 192, 172, 254, 255, 191, 221, 117, 246, 133, 59, 121, 165, 87, 179, 196, 180, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + ] + ); + assert_eq!( + Int512::from_be_bytes([ + 17, 4, 23, 32, 87, 67, 123, 200, 58, 91, 0, 38, 33, 21, 67, 78, 87, 76, 65, 54, + 211, 201, 192, 7, 42, 233, 2, 240, 200, 115, 150, 240, 218, 88, 106, 45, 208, 134, + 238, 119, 85, 22, 14, 88, 166, 195, 154, 73, 64, 10, 44, 59, 13, 22, 47, 12, 99, 8, + 252, 96, 230, 187, 38, 29 + ]) + .to_le_bytes(), + [ + 29, 38, 187, 230, 96, 252, 8, 99, 12, 47, 22, 13, 59, 44, 10, 64, 73, 154, 195, + 166, 88, 14, 22, 85, 119, 238, 134, 208, 45, 106, 88, 218, 240, 150, 115, 200, 240, + 2, 233, 42, 7, 192, 201, 211, 54, 65, 76, 87, 78, 67, 21, 33, 38, 0, 91, 58, 200, + 123, 67, 87, 32, 23, 4, 17 + ] + ); + } + + #[test] + fn int512_is_zero_works() { + assert!(Int512::zero().is_zero()); + assert!(Int512(I512::from(0u32)).is_zero()); + + assert!(!Int512::from(1u32).is_zero()); + assert!(!Int512::from(123u32).is_zero()); + assert!(!Int512::from(-123i32).is_zero()); + } + + #[test] + fn int512_is_negative_works() { + assert!(Int512::MIN.is_negative()); + assert!(Int512::from(-123i32).is_negative()); + + assert!(!Int512::MAX.is_negative()); + assert!(!Int512::zero().is_negative()); + assert!(!Int512::from(123u32).is_negative()); + } + + #[test] + fn int512_wrapping_methods() { + // wrapping_add + assert_eq!( + Int512::from(2u32).wrapping_add(Int512::from(2u32)), + Int512::from(4u32) + ); // non-wrapping + assert_eq!(Int512::MAX.wrapping_add(Int512::from(1u32)), Int512::MIN); // wrapping + + // wrapping_sub + assert_eq!( + Int512::from(7u32).wrapping_sub(Int512::from(5u32)), + Int512::from(2u32) + ); // non-wrapping + assert_eq!(Int512::MIN.wrapping_sub(Int512::from(1u32)), Int512::MAX); // wrapping + + // wrapping_mul + assert_eq!( + Int512::from(3u32).wrapping_mul(Int512::from(2u32)), + Int512::from(6u32) + ); // non-wrapping + assert_eq!( + Int512::MAX.wrapping_mul(Int512::from(2u32)), + Int512::from(-2i32) + ); // wrapping + + // wrapping_pow + assert_eq!(Int512::from(2u32).wrapping_pow(3), Int512::from(8u32)); // non-wrapping + assert_eq!(Int512::MAX.wrapping_pow(2), Int512::from(1u32)); // wrapping + } + + #[test] + fn int512_json() { + let orig = Int512::from(1234567890987654321u128); + let serialized = serde_json::to_vec(&orig).unwrap(); + assert_eq!(serialized.as_slice(), b"\"1234567890987654321\""); + let parsed: Int512 = serde_json::from_slice(&serialized).unwrap(); + assert_eq!(parsed, orig); + } + + #[test] + fn int512_compare() { + let a = Int512::from(12345u32); + let b = Int512::from(23456u32); + + assert!(a < b); + assert!(b > a); + assert_eq!(a, Int512::from(12345u32)); + } + + #[test] + #[allow(clippy::op_ref)] + fn int512_math() { + let a = Int512::from(-12345i32); + let b = Int512::from(23456u32); + + // test + with owned and reference right hand side + assert_eq!(a + b, Int512::from(11111u32)); + assert_eq!(a + &b, Int512::from(11111u32)); + + // test - with owned and reference right hand side + assert_eq!(b - a, Int512::from(35801u32)); + assert_eq!(b - &a, Int512::from(35801u32)); + + // test += with owned and reference right hand side + let mut c = Int512::from(300000u32); + c += b; + assert_eq!(c, Int512::from(323456u32)); + let mut d = Int512::from(300000u32); + d += &b; + assert_eq!(d, Int512::from(323456u32)); + + // test -= with owned and reference right hand side + let mut c = Int512::from(300000u32); + c -= b; + assert_eq!(c, Int512::from(276544u32)); + let mut d = Int512::from(300000u32); + d -= &b; + assert_eq!(d, Int512::from(276544u32)); + + // test - with negative result + assert_eq!(a - b, Int512::from(-35801i32)); + } + + #[test] + #[should_panic] + fn int512_add_overflow_panics() { + let _ = Int512::MAX + Int512::from(12u32); + } + + #[test] + #[allow(clippy::op_ref)] + fn int512_sub_works() { + assert_eq!(Int512::from(2u32) - Int512::from(1u32), Int512::from(1u32)); + assert_eq!(Int512::from(2u32) - Int512::from(0u32), Int512::from(2u32)); + assert_eq!(Int512::from(2u32) - Int512::from(2u32), Int512::from(0u32)); + assert_eq!(Int512::from(2u32) - Int512::from(3u32), Int512::from(-1i32)); + + // works for refs + let a = Int512::from(10u32); + let b = Int512::from(3u32); + let expected = Int512::from(7u32); + assert_eq!(a - b, expected); + assert_eq!(a - &b, expected); + assert_eq!(&a - b, expected); + assert_eq!(&a - &b, expected); + } + + #[test] + #[should_panic] + fn int512_sub_overflow_panics() { + let _ = Int512::MIN + Int512::one() - Int512::from(2u32); + } + + #[test] + fn int512_sub_assign_works() { + let mut a = Int512::from(14u32); + a -= Int512::from(2u32); + assert_eq!(a, Int512::from(12u32)); + + // works for refs + let mut a = Int512::from(10u32); + let b = Int512::from(3u32); + let expected = Int512::from(7u32); + a -= &b; + assert_eq!(a, expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn int512_mul_works() { + assert_eq!(Int512::from(2u32) * Int512::from(3u32), Int512::from(6u32)); + assert_eq!(Int512::from(2u32) * Int512::zero(), Int512::zero()); + + // works for refs + let a = Int512::from(11u32); + let b = Int512::from(3u32); + let expected = Int512::from(33u32); + assert_eq!(a * b, expected); + assert_eq!(a * &b, expected); + assert_eq!(&a * b, expected); + assert_eq!(&a * &b, expected); + } + + #[test] + fn int512_mul_assign_works() { + let mut a = Int512::from(14u32); + a *= Int512::from(2u32); + assert_eq!(a, Int512::from(28u32)); + + // works for refs + let mut a = Int512::from(10u32); + let b = Int512::from(3u32); + a *= &b; + assert_eq!(a, Int512::from(30u32)); + } + + #[test] + fn int512_pow_works() { + assert_eq!(Int512::from(2u32).pow(2), Int512::from(4u32)); + assert_eq!(Int512::from(2u32).pow(10), Int512::from(1024u32)); + } + + #[test] + #[should_panic] + fn int512_pow_overflow_panics() { + _ = Int512::MAX.pow(2u32); + } + + #[test] + fn int512_shr_works() { + let original = Int512::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8, 0u8, 4u8, 2u8, + ]); + + let shifted = Int512::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 128u8, 1u8, 0u8, + ]); + + assert_eq!(original >> 2u32, shifted); + } + + #[test] + #[should_panic] + fn int512_shr_overflow_panics() { + let _ = Int512::from(1u32) >> 512u32; + } + + #[test] + fn sum_works() { + let nums = vec![ + Int512::from(17u32), + Int512::from(123u32), + Int512::from(540u32), + Int512::from(82u32), + ]; + let expected = Int512::from(762u32); + + let sum_as_ref: Int512 = nums.iter().sum(); + assert_eq!(expected, sum_as_ref); + + let sum_as_owned: Int512 = nums.into_iter().sum(); + assert_eq!(expected, sum_as_owned); + } + + #[test] + fn int512_methods() { + // checked_* + assert!(matches!( + Int512::MAX.checked_add(Int512::from(1u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int512::from(1u32).checked_add(Int512::from(1u32)), + Ok(Int512::from(2u32)), + ); + assert!(matches!( + Int512::MIN.checked_sub(Int512::from(1u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int512::from(2u32).checked_sub(Int512::from(1u32)), + Ok(Int512::from(1u32)), + ); + assert!(matches!( + Int512::MAX.checked_mul(Int512::from(2u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int512::from(2u32).checked_mul(Int512::from(2u32)), + Ok(Int512::from(4u32)), + ); + assert!(matches!( + Int512::MAX.checked_pow(2u32), + Err(OverflowError { .. }) + )); + assert_eq!(Int512::from(2u32).checked_pow(3u32), Ok(Int512::from(8u32)),); + assert_eq!( + Int512::MAX.checked_div(Int512::from(0u32)), + Err(DivisionError::DivideByZero) + ); + assert_eq!( + Int512::from(6u32).checked_div(Int512::from(2u32)), + Ok(Int512::from(3u32)), + ); + assert_eq!( + Int512::MAX.checked_div_euclid(Int512::from(0u32)), + Err(DivisionError::DivideByZero) + ); + assert_eq!( + Int512::from(6u32).checked_div_euclid(Int512::from(2u32)), + Ok(Int512::from(3u32)), + ); + assert_eq!( + Int512::from(7u32).checked_div_euclid(Int512::from(2u32)), + Ok(Int512::from(3u32)), + ); + assert!(matches!( + Int512::MAX.checked_rem(Int512::from(0u32)), + Err(DivideByZeroError { .. }) + )); + // checked_* with negative numbers + assert_eq!( + Int512::from(-12i32).checked_div(Int512::from(10i32)), + Ok(Int512::from(-1i32)), + ); + assert_eq!( + Int512::from(-2i32).checked_pow(3u32), + Ok(Int512::from(-8i32)), + ); + assert_eq!( + Int512::from(-6i32).checked_mul(Int512::from(-7i32)), + Ok(Int512::from(42i32)), + ); + assert_eq!( + Int512::from(-2i32).checked_add(Int512::from(3i32)), + Ok(Int512::from(1i32)), + ); + assert_eq!( + Int512::from(-1i32).checked_div_euclid(Int512::from(-2i32)), + Ok(Int512::from(1u32)), + ); + + // saturating_* + assert_eq!(Int512::MAX.saturating_add(Int512::from(1u32)), Int512::MAX); + assert_eq!(Int512::MIN.saturating_sub(Int512::from(1u32)), Int512::MIN); + assert_eq!(Int512::MAX.saturating_mul(Int512::from(2u32)), Int512::MAX); + assert_eq!(Int512::from(4u32).saturating_pow(2u32), Int512::from(16u32)); + assert_eq!(Int512::MAX.saturating_pow(2u32), Int512::MAX); + } + + #[test] + #[allow(clippy::op_ref)] + fn int512_implements_rem() { + let a = Int512::from(10u32); + assert_eq!(a % Int512::from(10u32), Int512::zero()); + assert_eq!(a % Int512::from(2u32), Int512::zero()); + assert_eq!(a % Int512::from(1u32), Int512::zero()); + assert_eq!(a % Int512::from(3u32), Int512::from(1u32)); + assert_eq!(a % Int512::from(4u32), Int512::from(2u32)); + + assert_eq!( + Int512::from(-12i32) % Int512::from(10i32), + Int512::from(-2i32) + ); + assert_eq!( + Int512::from(12i32) % Int512::from(-10i32), + Int512::from(2i32) + ); + assert_eq!( + Int512::from(-12i32) % Int512::from(-10i32), + Int512::from(-2i32) + ); + + // works for refs + let a = Int512::from(10u32); + let b = Int512::from(3u32); + let expected = Int512::from(1u32); + assert_eq!(a % b, expected); + assert_eq!(a % &b, expected); + assert_eq!(&a % b, expected); + assert_eq!(&a % &b, expected); + } + + #[test] + #[should_panic(expected = "divisor of zero")] + fn int512_rem_panics_for_zero() { + let _ = Int512::from(10u32) % Int512::zero(); + } + + #[test] + fn int512_rem_assign_works() { + let mut a = Int512::from(30u32); + a %= Int512::from(4u32); + assert_eq!(a, Int512::from(2u32)); + + // works for refs + let mut a = Int512::from(25u32); + let b = Int512::from(6u32); + a %= &b; + assert_eq!(a, Int512::from(1u32)); + } + + #[test] + fn int512_shr() { + let x: Int512 = 0x8000_0000_0000_0000_0000_0000_0000_0000u128.into(); + assert_eq!(x >> 0, x); // right shift by 0 should be no-op + assert_eq!( + x >> 1, + Int512::from(0x4000_0000_0000_0000_0000_0000_0000_0000u128) + ); + assert_eq!( + x >> 4, + Int512::from(0x0800_0000_0000_0000_0000_0000_0000_0000u128) + ); + // right shift of MIN value by the maximum shift value should result in -1 (filled with 1s) + assert_eq!( + Int512::MIN >> (core::mem::size_of::() as u32 * 8 - 1), + -Int512::one() + ); + } + + #[test] + fn int512_shl() { + let x: Int512 = 0x0800_0000_0000_0000_0000_0000_0000_0000u128.into(); + assert_eq!(x << 0, x); // left shift by 0 should be no-op + assert_eq!( + x << 1, + Int512::from(0x1000_0000_0000_0000_0000_0000_0000_0000u128) + ); + assert_eq!( + x << 4, + Int512::from(0x8000_0000_0000_0000_0000_0000_0000_0000u128) + ); + // left shift by by the maximum shift value should result in MIN + assert_eq!( + Int512::one() << (core::mem::size_of::() as u32 * 8 - 1), + Int512::MIN + ); + } + + #[test] + fn int512_abs_diff_works() { + let a = Int512::from(42u32); + let b = Int512::from(5u32); + let expected = Uint512::from(37u32); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + + let c = Int512::from(-5i32); + assert_eq!(b.abs_diff(c), Uint512::from(10u32)); + assert_eq!(c.abs_diff(b), Uint512::from(10u32)); + } + + #[test] + fn int512_abs_works() { + let a = Int512::from(42i32); + assert_eq!(a.abs(), a); + + let b = Int512::from(-42i32); + assert_eq!(b.abs(), a); + + assert_eq!(Int512::zero().abs(), Int512::zero()); + assert_eq!((Int512::MIN + Int512::one()).abs(), Int512::MAX); + } + + #[test] + fn int512_unsigned_abs_works() { + assert_eq!(Int512::zero().unsigned_abs(), Uint512::zero()); + assert_eq!(Int512::one().unsigned_abs(), Uint512::one()); + assert_eq!( + Int512::MIN.unsigned_abs(), + Uint512::from_be_bytes(Int512::MAX.to_be_bytes()) + Uint512::one() + ); + + let v = Int512::from(-42i32); + assert_eq!(v.unsigned_abs(), v.abs_diff(Int512::zero())); + } + + #[test] + #[should_panic = "attempt to calculate absolute value with overflow"] + fn int512_abs_min_panics() { + _ = Int512::MIN.abs(); + } + + #[test] + #[should_panic = "attempt to negate with overflow"] + fn int512_neg_min_panics() { + _ = -Int512::MIN; + } + + #[test] + fn int512_partial_eq() { + let test_cases = [(1, 1, true), (42, 42, true), (42, 24, false), (0, 0, true)] + .into_iter() + .map(|(lhs, rhs, expected): (u64, u64, bool)| { + (Int512::from(lhs), Int512::from(rhs), expected) + }); + + #[allow(clippy::op_ref)] + for (lhs, rhs, expected) in test_cases { + assert_eq!(lhs == rhs, expected); + assert_eq!(&lhs == rhs, expected); + assert_eq!(lhs == &rhs, expected); + assert_eq!(&lhs == &rhs, expected); + } + } +} diff --git a/packages/std/src/math/int64.rs b/packages/std/src/math/int64.rs new file mode 100644 index 0000000000..b1cc0b68fb --- /dev/null +++ b/packages/std/src/math/int64.rs @@ -0,0 +1,1241 @@ +use alloc::string::{String, ToString}; +use core::fmt; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Not, Rem, RemAssign, Shl, ShlAssign, Shr, + ShrAssign, Sub, SubAssign, +}; +use core::str::FromStr; + +use crate::errors::{ + DivideByZeroError, DivisionError, ErrorKind, OverflowError, OverflowOperation, StdError, +}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + CheckedMultiplyRatioError, Int128, Int256, Int512, Uint128, Uint256, Uint512, Uint64, + __internal::forward_ref_partial_eq, +}; + +use super::conversion::{ + forward_try_from, from_and_to_bytes, primitive_to_wrapped_int, try_from_int_to_int, + wrapped_int_to_primitive, +}; +use super::impl_int_serde; +use super::num_consts::NumConsts; + +/// An implementation of i64 that is using strings for JSON encoding/decoding, +/// such that the full i64 range can be used for clients that convert JSON numbers to floats, +/// like JavaScript and jq. +/// +/// # Examples +/// +/// Use `from` to create instances of this and `i64` to get the value out: +/// +/// ``` +/// # use cosmwasm_std::Int64; +/// let a = Int64::from(258i64); +/// assert_eq!(a.i64(), 258); +/// ``` +#[derive( + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Integer { precision: 64, signed: true })] +pub struct Int64(#[schemars(with = "String")] pub(crate) i64); + +impl_int_serde!(Int64); +forward_ref_partial_eq!(Int64, Int64); + +impl Int64 { + pub const MAX: Int64 = Int64(i64::MAX); + pub const MIN: Int64 = Int64(i64::MIN); + + /// Creates a Int64(value). + /// + /// This method is less flexible than `from` but can be called in a const context. + #[inline] + #[must_use] + pub const fn new(value: i64) -> Self { + Self(value) + } + + /// Creates a Int64(0) + #[inline] + pub const fn zero() -> Self { + Int64(0) + } + + /// Creates a Int64(1) + #[inline] + pub const fn one() -> Self { + Self(1) + } + + /// Returns a copy of the internal data + pub const fn i64(&self) -> i64 { + self.0 + } + + from_and_to_bytes!(i64, 8); + + #[must_use] + pub const fn is_zero(&self) -> bool { + self.0 == 0 + } + + #[must_use] + pub const fn is_negative(&self) -> bool { + self.0.is_negative() + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn pow(self, exp: u32) -> Self { + match self.0.checked_pow(exp) { + Some(val) => Self(val), + None => panic!("attempt to exponentiate with overflow"), + } + } + + /// Returns `self * numerator / denominator`. + /// + /// Due to the nature of the integer division involved, the result is always floored. + /// E.g. 5 * 99/100 = 4. + pub fn checked_multiply_ratio, B: Into>( + &self, + numerator: A, + denominator: B, + ) -> Result { + let numerator = numerator.into(); + let denominator = denominator.into(); + if denominator.is_zero() { + return Err(CheckedMultiplyRatioError::DivideByZero); + } + match (self.full_mul(numerator) / Int128::from(denominator)).try_into() { + Ok(ratio) => Ok(ratio), + Err(_) => Err(CheckedMultiplyRatioError::Overflow), + } + } + + /// Multiplies two [`Int64`] values without overflow, producing an + /// [`Int128`]. + /// + /// # Examples + /// + /// ``` + /// use cosmwasm_std::Int64; + /// + /// let a = Int64::MAX; + /// let result = a.full_mul(2i32); + /// assert_eq!(result.to_string(), "18446744073709551614"); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn full_mul(self, rhs: impl Into) -> Int128 { + Int128::from(self) + .checked_mul(Int128::from(rhs.into())) + .unwrap() + } + + pub fn checked_add(self, other: Self) -> Result { + self.0 + .checked_add(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Add)) + } + + pub fn checked_sub(self, other: Self) -> Result { + self.0 + .checked_sub(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Sub)) + } + + pub fn checked_mul(self, other: Self) -> Result { + self.0 + .checked_mul(other.0) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Mul)) + } + + pub fn checked_pow(self, exp: u32) -> Result { + self.0 + .checked_pow(exp) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Pow)) + } + + pub fn checked_div(self, other: Self) -> Result { + if other.is_zero() { + return Err(DivisionError::DivideByZero); + } + self.0 + .checked_div(other.0) + .map(Self) + .ok_or(DivisionError::Overflow) + } + + pub fn checked_div_euclid(self, other: Self) -> Result { + if other.is_zero() { + return Err(DivisionError::DivideByZero); + } + self.0 + .checked_div_euclid(other.0) + .map(Self) + .ok_or(DivisionError::Overflow) + } + + pub fn checked_rem(self, other: Self) -> Result { + self.0 + .checked_rem(other.0) + .map(Self) + .ok_or(DivideByZeroError) + } + + pub fn checked_shr(self, other: u32) -> Result { + if other >= 64 { + return Err(OverflowError::new(OverflowOperation::Shr)); + } + + Ok(Self(self.0.shr(other))) + } + + pub fn checked_shl(self, other: u32) -> Result { + if other >= 64 { + return Err(OverflowError::new(OverflowOperation::Shl)); + } + + Ok(Self(self.0.shl(other))) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_add(self, other: Self) -> Self { + Self(self.0.wrapping_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_sub(self, other: Self) -> Self { + Self(self.0.wrapping_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_mul(self, other: Self) -> Self { + Self(self.0.wrapping_mul(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub fn wrapping_pow(self, other: u32) -> Self { + Self(self.0.wrapping_pow(other)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_add(self, other: Self) -> Self { + Self(self.0.saturating_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_sub(self, other: Self) -> Self { + Self(self.0.saturating_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_mul(self, other: Self) -> Self { + Self(self.0.saturating_mul(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_pow(self, exp: u32) -> Self { + Self(self.0.saturating_pow(exp)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs_diff(self, other: Self) -> Uint64 { + Uint64(self.0.abs_diff(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs(self) -> Self { + match self.0.checked_abs() { + Some(val) => Self(val), + None => panic!("attempt to calculate absolute value with overflow"), + } + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn unsigned_abs(self) -> Uint64 { + Uint64(self.0.unsigned_abs()) + } + + /// Strict negation. Computes -self, panicking if self == MIN. + /// + /// This is the same as [`Int64::neg`] but const. + pub const fn strict_neg(self) -> Self { + match self.0.checked_neg() { + Some(val) => Self(val), + None => panic!("attempt to negate with overflow"), + } + } +} + +impl NumConsts for Int64 { + const ZERO: Self = Self::zero(); + const ONE: Self = Self::one(); + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; +} + +// uint to Int +primitive_to_wrapped_int!(u8, Int64); +primitive_to_wrapped_int!(u16, Int64); +primitive_to_wrapped_int!(u32, Int64); + +// int to Int +primitive_to_wrapped_int!(i8, Int64); +primitive_to_wrapped_int!(i16, Int64); +primitive_to_wrapped_int!(i32, Int64); +primitive_to_wrapped_int!(i64, Int64); + +// Int to int +wrapped_int_to_primitive!(Int64, i64); +wrapped_int_to_primitive!(Int64, i128); + +// Int to Int +try_from_int_to_int!(Int128, Int64); +try_from_int_to_int!(Int256, Int64); +try_from_int_to_int!(Int512, Int64); + +// Uint to Int +forward_try_from!(Uint64, Int64); +forward_try_from!(Uint128, Int64); +forward_try_from!(Uint256, Int64); +forward_try_from!(Uint512, Int64); + +impl TryFrom<&str> for Int64 { + type Error = StdError; + + fn try_from(val: &str) -> Result { + Self::from_str(val) + } +} + +impl FromStr for Int64 { + type Err = StdError; + + fn from_str(s: &str) -> Result { + match s.parse::() { + Ok(u) => Ok(Self(u)), + Err(e) => { + Err(StdError::msg(format_args!("Parsing Int64: {e}")).with_kind(ErrorKind::Parsing)) + } + } + } +} + +impl From for String { + fn from(original: Int64) -> Self { + original.to_string() + } +} + +impl fmt::Display for Int64 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +impl Add for Int64 { + type Output = Self; + + fn add(self, rhs: Self) -> Self { + Int64(self.0.checked_add(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Add, add for Int64, Int64); + +impl Sub for Int64 { + type Output = Self; + + fn sub(self, rhs: Self) -> Self { + Int64(self.0.checked_sub(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Sub, sub for Int64, Int64); + +impl SubAssign for Int64 { + fn sub_assign(&mut self, rhs: Int64) { + self.0 = self.0.checked_sub(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl SubAssign, sub_assign for Int64, Int64); + +impl Div for Int64 { + type Output = Self; + + fn div(self, rhs: Self) -> Self::Output { + Self(self.0.checked_div(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Div, div for Int64, Int64); + +impl Rem for Int64 { + type Output = Self; + + /// # Panics + /// + /// This operation will panic if `rhs` is zero. + #[inline] + fn rem(self, rhs: Self) -> Self { + Self(self.0.rem(rhs.0)) + } +} +forward_ref_binop!(impl Rem, rem for Int64, Int64); + +impl Not for Int64 { + type Output = Self; + + fn not(self) -> Self::Output { + Self(!self.0) + } +} + +impl Neg for Int64 { + type Output = Self; + + fn neg(self) -> Self::Output { + self.strict_neg() + } +} + +impl RemAssign for Int64 { + fn rem_assign(&mut self, rhs: Int64) { + *self = *self % rhs; + } +} +forward_ref_op_assign!(impl RemAssign, rem_assign for Int64, Int64); + +impl Mul for Int64 { + type Output = Self; + + fn mul(self, rhs: Self) -> Self::Output { + Self(self.0.checked_mul(rhs.0).unwrap()) + } +} +forward_ref_binop!(impl Mul, mul for Int64, Int64); + +impl MulAssign for Int64 { + fn mul_assign(&mut self, rhs: Self) { + self.0 = self.0.checked_mul(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl MulAssign, mul_assign for Int64, Int64); + +impl Shr for Int64 { + type Output = Self; + + fn shr(self, rhs: u32) -> Self::Output { + self.checked_shr(rhs).unwrap_or_else(|_| { + panic!("right shift error: {rhs} is larger or equal than the number of bits in Int64",) + }) + } +} +forward_ref_binop!(impl Shr, shr for Int64, u32); + +impl Shl for Int64 { + type Output = Self; + + fn shl(self, rhs: u32) -> Self::Output { + self.checked_shl(rhs).unwrap_or_else(|_| { + panic!("left shift error: {rhs} is larger or equal than the number of bits in Int64",) + }) + } +} +forward_ref_binop!(impl Shl, shl for Int64, u32); + +impl AddAssign for Int64 { + fn add_assign(&mut self, rhs: Int64) { + self.0 = self.0.checked_add(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl AddAssign, add_assign for Int64, Int64); + +impl DivAssign for Int64 { + fn div_assign(&mut self, rhs: Self) { + self.0 = self.0.checked_div(rhs.0).unwrap(); + } +} +forward_ref_op_assign!(impl DivAssign, div_assign for Int64, Int64); + +impl ShrAssign for Int64 { + fn shr_assign(&mut self, rhs: u32) { + *self = Shr::::shr(*self, rhs); + } +} +forward_ref_op_assign!(impl ShrAssign, shr_assign for Int64, u32); + +impl ShlAssign for Int64 { + fn shl_assign(&mut self, rhs: u32) { + *self = Shl::::shl(*self, rhs); + } +} +forward_ref_op_assign!(impl ShlAssign, shl_assign for Int64, u32); + +impl core::iter::Sum for Int64 +where + Self: Add, +{ + fn sum>(iter: I) -> Self { + iter.fold(Self::zero(), Add::add) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::math::conversion::test_try_from_uint_to_int; + + #[test] + fn size_of_works() { + assert_eq!(core::mem::size_of::(), 8); + } + + #[test] + fn int64_from_be_bytes_works() { + // zero + let original = [0; 8]; + let num = Int64::from_be_bytes(original); + assert!(num.is_zero()); + + // one + let original = [0, 0, 0, 0, 0, 0, 0, 1]; + let num = Int64::from_be_bytes(original); + assert_eq!(num.i64(), 1); + + // 258 + let original = [0, 0, 0, 0, 0, 0, 1, 2]; + let num = Int64::from_be_bytes(original); + assert_eq!(num.i64(), 258); + + // 2x roundtrip + let original = [1; 8]; + let num = Int64::from_be_bytes(original); + let a: [u8; 8] = num.to_be_bytes(); + assert_eq!(a, original); + + let original = [0u8, 222u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8]; + let num = Int64::from_be_bytes(original); + let a: [u8; 8] = num.to_be_bytes(); + assert_eq!(a, original); + } + + #[test] + fn int64_from_le_bytes_works() { + // zero + let original = [0; 8]; + let num = Int64::from_le_bytes(original); + assert!(num.is_zero()); + + // one + let original = [1, 0, 0, 0, 0, 0, 0, 0]; + let num = Int64::from_le_bytes(original); + assert_eq!(num.i64(), 1); + + // 258 + let original = [2, 1, 0, 0, 0, 0, 0, 0]; + let num = Int64::from_le_bytes(original); + assert_eq!(num.i64(), 258); + + // 2x roundtrip + let original = [1; 8]; + let num = Int64::from_le_bytes(original); + let a: [u8; 8] = num.to_le_bytes(); + assert_eq!(a, original); + + let original = [0u8, 222u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8]; + let num = Int64::from_le_bytes(original); + let a: [u8; 8] = num.to_le_bytes(); + assert_eq!(a, original); + } + + #[test] + fn int64_new_works() { + let num = Int64::new(222); + assert_eq!(num.i64(), 222); + + let num = Int64::new(-222); + assert_eq!(num.i64(), -222); + + let num = Int64::new(i64::MAX); + assert_eq!(num.i64(), i64::MAX); + + let num = Int64::new(i64::MIN); + assert_eq!(num.i64(), i64::MIN); + } + + #[test] + fn int64_not_works() { + assert_eq!(!Int64::new(222), Int64::new(!222)); + assert_eq!(!Int64::new(-222), Int64::new(!-222)); + + assert_eq!(!Int64::MAX, Int64::new(!i64::MAX)); + assert_eq!(!Int64::MIN, Int64::new(!i64::MIN)); + } + + #[test] + fn int64_zero_works() { + let zero = Int64::zero(); + assert_eq!(zero.to_be_bytes(), [0; 8]); + } + + #[test] + fn uint64_one_works() { + let one = Int64::one(); + let mut one_be = [0; 8]; + one_be[7] = 1; + + assert_eq!(one.to_be_bytes(), one_be); + } + + #[test] + fn int64_endianness() { + let be_bytes = [0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8]; + let le_bytes = [3u8, 2u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8]; + + // These should all be the same. + let num1 = Int64::from_be_bytes(be_bytes); + let num2 = Int64::from_le_bytes(le_bytes); + assert_eq!(num1, Int64::from(65536u32 + 512 + 3)); + assert_eq!(num1, num2); + } + + #[test] + fn int64_convert_to() { + let a = Int64::new(5); + assert_eq!(i64::from(a), 5); + + let a = Int64::new(5); + assert_eq!(i128::from(a), 5); + } + + #[test] + fn int64_convert_from() { + let a = Int64::from(5i64); + assert_eq!(a.0, i64::from(5u32)); + + let a = Int64::from(5i64); + assert_eq!(a.0, i64::from(5u32)); + + let a = Int64::from(5u32); + assert_eq!(a.0, i64::from(5u32)); + + let a = Int64::from(5u16); + assert_eq!(a.0, i64::from(5u32)); + + let a = Int64::from(5u8); + assert_eq!(a.0, i64::from(5u32)); + + let a = Int64::from(-5i64); + assert_eq!(a.0, i64::from(-5i32)); + + let a = Int64::from(-5i64); + assert_eq!(a.0, i64::from(-5i32)); + + let a = Int64::from(-5i32); + assert_eq!(a.0, i64::from(-5i32)); + + let a = Int64::from(-5i16); + assert_eq!(a.0, i64::from(-5i32)); + + let a = Int64::from(-5i8); + assert_eq!(a.0, i64::from(-5i32)); + + let result = Int64::try_from("34567"); + assert_eq!(result.unwrap().0, "34567".parse::().unwrap()); + + let result = Int64::try_from("1.23"); + assert!(result.is_err()); + } + + #[test] + fn int64_try_from_unsigned_works() { + test_try_from_uint_to_int::("Uint64", "Int64"); + test_try_from_uint_to_int::("Uint128", "Int64"); + test_try_from_uint_to_int::("Uint256", "Int64"); + test_try_from_uint_to_int::("Uint512", "Int64"); + } + + #[test] + fn int64_implements_display() { + let a = Int64::from(12345u32); + assert_eq!(format!("Embedded: {a}"), "Embedded: 12345"); + assert_eq!(a.to_string(), "12345"); + + let a = Int64::from(-12345i32); + assert_eq!(format!("Embedded: {a}"), "Embedded: -12345"); + assert_eq!(a.to_string(), "-12345"); + + let a = Int64::zero(); + assert_eq!(format!("Embedded: {a}"), "Embedded: 0"); + assert_eq!(a.to_string(), "0"); + } + + #[test] + fn int64_display_padding_works() { + // width > natural representation + let a = Int64::from(123i64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: 00123"); + let a = Int64::from(-123i64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: -0123"); + + // width < natural representation + let a = Int64::from(123i64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: 123"); + let a = Int64::from(-123i64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: -123"); + } + + #[test] + fn int64_to_be_bytes_works() { + assert_eq!(Int64::zero().to_be_bytes(), [0; 8]); + + let mut max = [0xff; 8]; + max[0] = 0x7f; + assert_eq!(Int64::MAX.to_be_bytes(), max); + + let mut one = [0; 8]; + one[7] = 1; + assert_eq!(Int64::from(1i64).to_be_bytes(), one); + // Python: `[b for b in (8535972485454015680).to_bytes(8, "big")]` + assert_eq!( + Int64::from(8535972485454015680i64).to_be_bytes(), + [118, 117, 221, 191, 255, 254, 172, 192] + ); + assert_eq!( + Int64::from_be_bytes([17, 4, 23, 32, 87, 67, 123, 200]).to_be_bytes(), + [17, 4, 23, 32, 87, 67, 123, 200] + ); + } + + #[test] + fn int64_to_le_bytes_works() { + assert_eq!(Int64::zero().to_le_bytes(), [0; 8]); + + let mut max = [0xff; 8]; + max[7] = 0x7f; + assert_eq!(Int64::MAX.to_le_bytes(), max); + + let mut one = [0; 8]; + one[0] = 1; + assert_eq!(Int64::from(1i64).to_le_bytes(), one); + // Python: `[b for b in (8535972485454015680).to_bytes(8, "little")]` + assert_eq!( + Int64::from(8535972485454015680i64).to_le_bytes(), + [192, 172, 254, 255, 191, 221, 117, 118] + ); + assert_eq!( + Int64::from_be_bytes([17, 4, 23, 32, 87, 67, 123, 200]).to_le_bytes(), + [200, 123, 67, 87, 32, 23, 4, 17] + ); + } + + #[test] + fn int64_is_zero_works() { + assert!(Int64::zero().is_zero()); + assert!(Int64(i64::from(0u32)).is_zero()); + + assert!(!Int64::from(1u32).is_zero()); + assert!(!Int64::from(123u32).is_zero()); + assert!(!Int64::from(-123i32).is_zero()); + } + + #[test] + fn int64_is_negative_works() { + assert!(Int64::MIN.is_negative()); + assert!(Int64::from(-123i32).is_negative()); + + assert!(!Int64::MAX.is_negative()); + assert!(!Int64::zero().is_negative()); + assert!(!Int64::from(123u32).is_negative()); + } + + #[test] + fn int64_wrapping_methods() { + // wrapping_add + assert_eq!( + Int64::from(2u32).wrapping_add(Int64::from(2u32)), + Int64::from(4u32) + ); // non-wrapping + assert_eq!(Int64::MAX.wrapping_add(Int64::from(1u32)), Int64::MIN); // wrapping + + // wrapping_sub + assert_eq!( + Int64::from(7u32).wrapping_sub(Int64::from(5u32)), + Int64::from(2u32) + ); // non-wrapping + assert_eq!(Int64::MIN.wrapping_sub(Int64::from(1u32)), Int64::MAX); // wrapping + + // wrapping_mul + assert_eq!( + Int64::from(3u32).wrapping_mul(Int64::from(2u32)), + Int64::from(6u32) + ); // non-wrapping + assert_eq!( + Int64::MAX.wrapping_mul(Int64::from(2u32)), + Int64::from(-2i32) + ); // wrapping + + // wrapping_pow + assert_eq!(Int64::from(2u32).wrapping_pow(3), Int64::from(8u32)); // non-wrapping + assert_eq!(Int64::MAX.wrapping_pow(2), Int64::from(1u32)); // wrapping + } + + #[test] + fn int64_json() { + let orig = Int64::from(1234567890987654321i64); + let serialized = serde_json::to_vec(&orig).unwrap(); + assert_eq!(serialized.as_slice(), b"\"1234567890987654321\""); + let parsed: Int64 = serde_json::from_slice(&serialized).unwrap(); + assert_eq!(parsed, orig); + } + + #[test] + fn int64_compare() { + let a = Int64::from(12345u32); + let b = Int64::from(23456u32); + + assert!(a < b); + assert!(b > a); + assert_eq!(a, Int64::from(12345u32)); + } + + #[test] + #[allow(clippy::op_ref)] + fn int64_math() { + let a = Int64::from(-12345i32); + let b = Int64::from(23456u32); + + // test + with owned and reference right hand side + assert_eq!(a + b, Int64::from(11111u32)); + assert_eq!(a + &b, Int64::from(11111u32)); + + // test - with owned and reference right hand side + assert_eq!(b - a, Int64::from(35801u32)); + assert_eq!(b - &a, Int64::from(35801u32)); + + // test += with owned and reference right hand side + let mut c = Int64::from(300000u32); + c += b; + assert_eq!(c, Int64::from(323456u32)); + let mut d = Int64::from(300000u32); + d += &b; + assert_eq!(d, Int64::from(323456u32)); + + // test -= with owned and reference right hand side + let mut c = Int64::from(300000u32); + c -= b; + assert_eq!(c, Int64::from(276544u32)); + let mut d = Int64::from(300000u32); + d -= &b; + assert_eq!(d, Int64::from(276544u32)); + + // test - with negative result + assert_eq!(a - b, Int64::from(-35801i32)); + } + + #[test] + #[should_panic] + fn int64_add_overflow_panics() { + let _ = Int64::MAX + Int64::from(12u32); + } + + #[test] + #[allow(clippy::op_ref)] + fn int64_sub_works() { + assert_eq!(Int64::from(2u32) - Int64::from(1u32), Int64::from(1u32)); + assert_eq!(Int64::from(2u32) - Int64::from(0u32), Int64::from(2u32)); + assert_eq!(Int64::from(2u32) - Int64::from(2u32), Int64::from(0u32)); + assert_eq!(Int64::from(2u32) - Int64::from(3u32), Int64::from(-1i32)); + + // works for refs + let a = Int64::from(10u32); + let b = Int64::from(3u32); + let expected = Int64::from(7u32); + assert_eq!(a - b, expected); + assert_eq!(a - &b, expected); + assert_eq!(&a - b, expected); + assert_eq!(&a - &b, expected); + } + + #[test] + #[should_panic] + fn int64_sub_overflow_panics() { + let _ = Int64::MIN + Int64::one() - Int64::from(2u32); + } + + #[test] + fn int64_sub_assign_works() { + let mut a = Int64::from(14u32); + a -= Int64::from(2u32); + assert_eq!(a, Int64::from(12u32)); + + // works for refs + let mut a = Int64::from(10u32); + let b = Int64::from(3u32); + let expected = Int64::from(7u32); + a -= &b; + assert_eq!(a, expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn int64_mul_works() { + assert_eq!(Int64::from(2u32) * Int64::from(3u32), Int64::from(6u32)); + assert_eq!(Int64::from(2u32) * Int64::zero(), Int64::zero()); + + // works for refs + let a = Int64::from(11u32); + let b = Int64::from(3u32); + let expected = Int64::from(33u32); + assert_eq!(a * b, expected); + assert_eq!(a * &b, expected); + assert_eq!(&a * b, expected); + assert_eq!(&a * &b, expected); + } + + #[test] + fn int64_mul_assign_works() { + let mut a = Int64::from(14u32); + a *= Int64::from(2u32); + assert_eq!(a, Int64::from(28u32)); + + // works for refs + let mut a = Int64::from(10u32); + let b = Int64::from(3u32); + a *= &b; + assert_eq!(a, Int64::from(30u32)); + } + + #[test] + fn int64_pow_works() { + assert_eq!(Int64::from(2u32).pow(2), Int64::from(4u32)); + assert_eq!(Int64::from(2u32).pow(10), Int64::from(1024u32)); + } + + #[test] + #[should_panic] + fn int64_pow_overflow_panics() { + _ = Int64::MAX.pow(2u32); + } + + #[test] + fn int64_checked_multiply_ratio_works() { + let base = Int64(500); + + // factor 1/1 + assert_eq!(base.checked_multiply_ratio(1i64, 1i64).unwrap(), base); + assert_eq!(base.checked_multiply_ratio(3i64, 3i64).unwrap(), base); + assert_eq!( + base.checked_multiply_ratio(654321i64, 654321i64).unwrap(), + base + ); + assert_eq!( + base.checked_multiply_ratio(i64::MAX, i64::MAX).unwrap(), + base + ); + + // factor 3/2 + assert_eq!(base.checked_multiply_ratio(3i64, 2i64).unwrap(), Int64(750)); + assert_eq!( + base.checked_multiply_ratio(333333i64, 222222i64).unwrap(), + Int64(750) + ); + + // factor 2/3 (integer division always floors the result) + assert_eq!(base.checked_multiply_ratio(2i64, 3i64).unwrap(), Int64(333)); + assert_eq!( + base.checked_multiply_ratio(222222i64, 333333i64).unwrap(), + Int64(333) + ); + + // factor 5/6 (integer division always floors the result) + assert_eq!(base.checked_multiply_ratio(5i64, 6i64).unwrap(), Int64(416)); + assert_eq!( + base.checked_multiply_ratio(100i64, 120i64).unwrap(), + Int64(416) + ); + } + + #[test] + fn int64_checked_multiply_ratio_does_not_panic() { + assert_eq!( + Int64(500i64).checked_multiply_ratio(1i64, 0i64), + Err(CheckedMultiplyRatioError::DivideByZero), + ); + assert_eq!( + Int64(500i64).checked_multiply_ratio(i64::MAX, 1i64), + Err(CheckedMultiplyRatioError::Overflow), + ); + } + + #[test] + fn int64_shr_works() { + let original = Int64::from_be_bytes([0u8, 0u8, 0u8, 0u8, 2u8, 0u8, 4u8, 2u8]); + + let shifted = Int64::from_be_bytes([0u8, 0u8, 0u8, 0u8, 0u8, 128u8, 1u8, 0u8]); + + assert_eq!(original >> 2u32, shifted); + } + + #[test] + #[should_panic] + fn int64_shr_overflow_panics() { + let _ = Int64::from(1u32) >> 64u32; + } + + #[test] + fn sum_works() { + let nums = vec![ + Int64::from(17u32), + Int64::from(123u32), + Int64::from(540u32), + Int64::from(82u32), + ]; + let expected = Int64::from(762u32); + + let sum_as_ref: Int64 = nums.iter().sum(); + assert_eq!(expected, sum_as_ref); + + let sum_as_owned: Int64 = nums.into_iter().sum(); + assert_eq!(expected, sum_as_owned); + } + + #[test] + fn int64_methods() { + // checked_* + assert!(matches!( + Int64::MAX.checked_add(Int64::from(1u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int64::from(1u32).checked_add(Int64::from(1u32)), + Ok(Int64::from(2u32)), + ); + assert!(matches!( + Int64::MIN.checked_sub(Int64::from(1u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int64::from(2u32).checked_sub(Int64::from(1u32)), + Ok(Int64::from(1u32)), + ); + assert!(matches!( + Int64::MAX.checked_mul(Int64::from(2u32)), + Err(OverflowError { .. }) + )); + assert_eq!( + Int64::from(2u32).checked_mul(Int64::from(2u32)), + Ok(Int64::from(4u32)), + ); + assert!(matches!( + Int64::MAX.checked_pow(2u32), + Err(OverflowError { .. }) + )); + assert_eq!(Int64::from(2u32).checked_pow(3u32), Ok(Int64::from(8u32)),); + assert_eq!( + Int64::MAX.checked_div(Int64::from(0u32)), + Err(DivisionError::DivideByZero) + ); + assert_eq!( + Int64::from(6u32).checked_div(Int64::from(2u32)), + Ok(Int64::from(3u32)), + ); + assert_eq!( + Int64::MAX.checked_div_euclid(Int64::from(0u32)), + Err(DivisionError::DivideByZero) + ); + assert_eq!( + Int64::from(6u32).checked_div_euclid(Int64::from(2u32)), + Ok(Int64::from(3u32)), + ); + assert_eq!( + Int64::from(7u32).checked_div_euclid(Int64::from(2u32)), + Ok(Int64::from(3u32)), + ); + assert!(matches!( + Int64::MAX.checked_rem(Int64::from(0u32)), + Err(DivideByZeroError { .. }) + )); + // checked_* with negative numbers + assert_eq!( + Int64::from(-12i32).checked_div(Int64::from(10i32)), + Ok(Int64::from(-1i32)), + ); + assert_eq!(Int64::from(-2i32).checked_pow(3u32), Ok(Int64::from(-8i32)),); + assert_eq!( + Int64::from(-6i32).checked_mul(Int64::from(-7i32)), + Ok(Int64::from(42i32)), + ); + assert_eq!( + Int64::from(-2i32).checked_add(Int64::from(3i32)), + Ok(Int64::from(1i32)), + ); + assert_eq!( + Int64::from(-1i32).checked_div_euclid(Int64::from(-2i32)), + Ok(Int64::from(1u32)), + ); + + // saturating_* + assert_eq!(Int64::MAX.saturating_add(Int64::from(1u32)), Int64::MAX); + assert_eq!(Int64::MIN.saturating_sub(Int64::from(1u32)), Int64::MIN); + assert_eq!(Int64::MAX.saturating_mul(Int64::from(2u32)), Int64::MAX); + assert_eq!(Int64::from(4u32).saturating_pow(2u32), Int64::from(16u32)); + assert_eq!(Int64::MAX.saturating_pow(2u32), Int64::MAX); + } + + #[test] + #[allow(clippy::op_ref)] + fn int64_implements_rem() { + let a = Int64::from(10u32); + assert_eq!(a % Int64::from(10u32), Int64::zero()); + assert_eq!(a % Int64::from(2u32), Int64::zero()); + assert_eq!(a % Int64::from(1u32), Int64::zero()); + assert_eq!(a % Int64::from(3u32), Int64::from(1u32)); + assert_eq!(a % Int64::from(4u32), Int64::from(2u32)); + + assert_eq!(Int64::from(-12i32) % Int64::from(10i32), Int64::from(-2i32)); + assert_eq!(Int64::from(12i32) % Int64::from(-10i32), Int64::from(2i32)); + assert_eq!( + Int64::from(-12i32) % Int64::from(-10i32), + Int64::from(-2i32) + ); + + // works for refs + let a = Int64::from(10u32); + let b = Int64::from(3u32); + let expected = Int64::from(1u32); + assert_eq!(a % b, expected); + assert_eq!(a % &b, expected); + assert_eq!(&a % b, expected); + assert_eq!(&a % &b, expected); + } + + #[test] + #[should_panic(expected = "divisor of zero")] + fn int64_rem_panics_for_zero() { + let _ = Int64::from(10u32) % Int64::zero(); + } + + #[test] + fn int64_rem_assign_works() { + let mut a = Int64::from(30u32); + a %= Int64::from(4u32); + assert_eq!(a, Int64::from(2u32)); + + // works for refs + let mut a = Int64::from(25u32); + let b = Int64::from(6u32); + a %= &b; + assert_eq!(a, Int64::from(1u32)); + } + + #[test] + fn int64_shr() { + let x: Int64 = 0x4000_0000_0000_0000i64.into(); + assert_eq!(x >> 0, x); // right shift by 0 should be no-op + assert_eq!(x >> 1, Int64::from(0x2000_0000_0000_0000i64)); + assert_eq!(x >> 4, Int64::from(0x0400_0000_0000_0000i64)); + // right shift of MIN value by the maximum shift value should result in -1 (filled with 1s) + assert_eq!( + Int64::MIN >> (core::mem::size_of::() as u32 * 8 - 1), + -Int64::one() + ); + } + + #[test] + fn int64_shl() { + let x: Int64 = 0x0800_0000_0000_0000i64.into(); + assert_eq!(x << 0, x); // left shift by 0 should be no-op + assert_eq!(x << 1, Int64::from(0x1000_0000_0000_0000i64)); + assert_eq!(x << 4, Int64::from(0x0800_0000_0000_0000i64 << 4)); + // left shift by by the maximum shift value should result in MIN + assert_eq!( + Int64::one() << (core::mem::size_of::() as u32 * 8 - 1), + Int64::MIN + ); + } + + #[test] + fn int64_abs_diff_works() { + let a = Int64::from(42u32); + let b = Int64::from(5u32); + let expected = Uint64::from(37u32); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + + let c = Int64::from(-5i32); + assert_eq!(b.abs_diff(c), Uint64::from(10u32)); + assert_eq!(c.abs_diff(b), Uint64::from(10u32)); + } + + #[test] + fn int64_abs_works() { + let a = Int64::from(42i32); + assert_eq!(a.abs(), a); + + let b = Int64::from(-42i32); + assert_eq!(b.abs(), a); + + assert_eq!(Int64::zero().abs(), Int64::zero()); + assert_eq!((Int64::MIN + Int64::one()).abs(), Int64::MAX); + } + + #[test] + fn int64_unsigned_abs_works() { + assert_eq!(Int64::zero().unsigned_abs(), Uint64::zero()); + assert_eq!(Int64::one().unsigned_abs(), Uint64::one()); + assert_eq!( + Int64::MIN.unsigned_abs(), + Uint64::new(Int64::MAX.0 as u64) + Uint64::one() + ); + + let v = Int64::from(-42i32); + assert_eq!(v.unsigned_abs(), v.abs_diff(Int64::zero())); + } + + #[test] + #[should_panic = "attempt to calculate absolute value with overflow"] + fn int64_abs_min_panics() { + _ = Int64::MIN.abs(); + } + + #[test] + #[should_panic = "attempt to negate with overflow"] + fn int64_neg_min_panics() { + _ = -Int64::MIN; + } + + #[test] + fn int64_partial_eq() { + let test_cases = [(1, 1, true), (42, 42, true), (42, 24, false), (0, 0, true)] + .into_iter() + .map(|(lhs, rhs, expected): (i64, i64, bool)| { + (Int64::from(lhs), Int64::from(rhs), expected) + }); + + #[allow(clippy::op_ref)] + for (lhs, rhs, expected) in test_cases { + assert_eq!(lhs == rhs, expected); + assert_eq!(&lhs == rhs, expected); + assert_eq!(lhs == &rhs, expected); + assert_eq!(&lhs == &rhs, expected); + } + } +} diff --git a/packages/std/src/math/isqrt.rs b/packages/std/src/math/isqrt.rs index 6bf4b01f64..64d730f12f 100644 --- a/packages/std/src/math/isqrt.rs +++ b/packages/std/src/math/isqrt.rs @@ -1,4 +1,4 @@ -use std::{cmp, ops}; +use core::{cmp, ops}; use crate::{Uint128, Uint256, Uint512, Uint64}; @@ -6,6 +6,7 @@ use crate::{Uint128, Uint256, Uint512, Uint64}; /// [integer square root](https://en.wikipedia.org/wiki/Integer_square_root). pub trait Isqrt { /// The [integer square root](https://en.wikipedia.org/wiki/Integer_square_root). + #[must_use = "this returns the result of the operation, without modifying the original"] fn isqrt(self) -> Self; } @@ -14,17 +15,22 @@ where I: Unsigned + ops::Add + ops::Div + + ops::Shl + ops::Shr + cmp::PartialOrd - + Copy - + From, + + Copy, { /// Algorithm adapted from /// [Wikipedia](https://en.wikipedia.org/wiki/Integer_square_root#Example_implementation_in_C). fn isqrt(self) -> Self { - let mut x0 = self >> 1; + // sqrt(0) = 0, sqrt(1) = 1 + if self <= Self::ONE { + return self; + } + + let mut x0 = Self::ONE << ((self.log_2() / 2) + 1); - if x0 > 0.into() { + if x0 > Self::ZERO { let mut x1 = (x0 + self / x0) >> 1; while x1 < x0 { @@ -39,17 +45,35 @@ where } /// Marker trait for types that represent unsigned integers. -pub trait Unsigned {} -impl Unsigned for u8 {} -impl Unsigned for u16 {} -impl Unsigned for u32 {} -impl Unsigned for u64 {} -impl Unsigned for u128 {} -impl Unsigned for Uint64 {} -impl Unsigned for Uint128 {} -impl Unsigned for Uint256 {} -impl Unsigned for Uint512 {} -impl Unsigned for usize {} +pub trait Unsigned { + const ZERO: Self; + const ONE: Self; + + fn log_2(self) -> u32; +} + +macro_rules! impl_unsigned { + ($type:ty, $zero:expr, $one:expr) => { + impl Unsigned for $type { + const ZERO: Self = $zero; + const ONE: Self = $one; + + fn log_2(self) -> u32 { + self.ilog2() + } + } + }; +} +impl_unsigned!(u8, 0, 1); +impl_unsigned!(u16, 0, 1); +impl_unsigned!(u32, 0, 1); +impl_unsigned!(u64, 0, 1); +impl_unsigned!(u128, 0, 1); +impl_unsigned!(usize, 0, 1); +impl_unsigned!(Uint64, Self::zero(), Self::one()); +impl_unsigned!(Uint128, Self::zero(), Self::one()); +impl_unsigned!(Uint256, Self::zero(), Self::one()); +impl_unsigned!(Uint512, Self::zero(), Self::one()); #[cfg(test)] mod tests { @@ -58,19 +82,19 @@ mod tests { #[test] fn isqrt_primitives() { // Let's check correctness. - assert_eq!(0u8.isqrt(), 0); - assert_eq!(1u8.isqrt(), 1); - assert_eq!(24u8.isqrt(), 4); - assert_eq!(25u8.isqrt(), 5); - assert_eq!(26u8.isqrt(), 5); - assert_eq!(36u8.isqrt(), 6); + assert_eq!(super::Isqrt::isqrt(0u8), 0); + assert_eq!(super::Isqrt::isqrt(1u8), 1); + assert_eq!(super::Isqrt::isqrt(24u8), 4); + assert_eq!(super::Isqrt::isqrt(25u8), 5); + assert_eq!(super::Isqrt::isqrt(26u8), 5); + assert_eq!(super::Isqrt::isqrt(36u8), 6); // Let's also check different types. - assert_eq!(26u8.isqrt(), 5); - assert_eq!(26u16.isqrt(), 5); - assert_eq!(26u32.isqrt(), 5); - assert_eq!(26u64.isqrt(), 5); - assert_eq!(26u128.isqrt(), 5); + assert_eq!(super::Isqrt::isqrt(26u8), 5); + assert_eq!(super::Isqrt::isqrt(26u16), 5); + assert_eq!(super::Isqrt::isqrt(26u32), 5); + assert_eq!(super::Isqrt::isqrt(26u64), 5); + assert_eq!(super::Isqrt::isqrt(26u128), 5); } #[test] diff --git a/packages/std/src/math/mod.rs b/packages/std/src/math/mod.rs index 706d23005d..dd4d0309ce 100644 --- a/packages/std/src/math/mod.rs +++ b/packages/std/src/math/mod.rs @@ -1,7 +1,15 @@ +mod conversion; mod decimal; mod decimal256; mod fraction; +mod int128; +mod int256; +mod int512; +mod int64; mod isqrt; +mod num_consts; +mod signed_decimal; +mod signed_decimal_256; mod uint128; mod uint256; mod uint512; @@ -10,18 +18,106 @@ mod uint64; pub use decimal::{Decimal, DecimalRangeExceeded}; pub use decimal256::{Decimal256, Decimal256RangeExceeded}; pub use fraction::Fraction; +pub use int128::Int128; +pub use int256::Int256; +pub use int512::Int512; +pub use int64::Int64; pub use isqrt::Isqrt; +pub use signed_decimal::{SignedDecimal, SignedDecimalRangeExceeded}; +pub use signed_decimal_256::{SignedDecimal256, SignedDecimal256RangeExceeded}; pub use uint128::Uint128; pub use uint256::Uint256; pub use uint512::Uint512; pub use uint64::Uint64; +macro_rules! impl_int_serde { + ($ty:ty) => { + impl ::serde::Serialize for $ty { + /// Serializes as an integer string using base 10. + /// + /// We consistently serialize all `UintXXX` and `IntYYY` types as strings in JSON + /// to ensure the best possible compatibility with clients. E.g. JavaScript and jq + /// only support up to ~53bit numbers without losing precision, making it hard to use + /// serialized `u64`s on other systems than Rust or Go. `Uint64`/`Int64` ensure the full + /// 64 bit range is supported. For larger integers, the use of strings is pretty much the + /// only reasonable way to store them in JSON. + /// + /// For binary encodings (notably MessagePack) strings are used too. The reason is that + /// in MessagePack integers are limited to 64 bit and we strive for consistent encoding + /// within the `UintXXX`/`IntYYY` family. Also for small to mid sized values, decimal strings + /// are often more compact than a fixed-length binary encoding. + /// + /// ## Examples + /// + /// Serialize to JSON: + /// + /// ``` + /// # use cosmwasm_std::{to_json_vec, Uint64}; + /// let value = Uint64::new(17); + /// let serialized = to_json_vec(&value).unwrap(); + /// assert_eq!(serialized, b"\"17\""); + /// ``` + /// + /// Serialize to MessagePack: + /// + /// ``` + /// # use cosmwasm_std::{to_msgpack_vec, Uint64}; + /// let value = Uint64::new(17); + /// let serialized = to_msgpack_vec(&value).unwrap(); + /// assert_eq!(serialized, [0b10100000 ^ 2, b'1', b'7']); // string of lengths 2 with value "17" + /// ``` + fn serialize(&self, serializer: S) -> Result + where + S: ::serde::ser::Serializer, + { + serializer.serialize_str(&self.to_string()) + } + } + + impl<'de> ::serde::Deserialize<'de> for $ty { + /// Deserializes from an integer string using base 10. + /// + /// See the [`Serialize` documentation](#method.serialize) for a few more words + /// on the encoding of the `UintXXX`/`IntYYY` family. + fn deserialize(deserializer: D) -> Result + where + D: ::serde::de::Deserializer<'de>, + { + struct IntVisitor; + + impl<'de> ::serde::de::Visitor<'de> for IntVisitor { + type Value = $ty; + + fn expecting( + &self, + formatter: &mut ::core::fmt::Formatter, + ) -> ::core::fmt::Result { + formatter.write_str("string-encoded integer") + } + + fn visit_str(self, v: &str) -> Result + where + E: ::serde::de::Error, + { + <_>::try_from(v).map_err(|e| { + E::custom(format_args!("invalid {} '{v}' - {e}", stringify!($t))) + }) + } + } + + deserializer.deserialize_str(IntVisitor) + } + } + }; +} +use impl_int_serde; + #[cfg(test)] mod tests { use super::*; - use std::ops::*; + use core::ops::*; - /// An trait that ensures other traits are implemented for our number types + /// A trait that ensures other traits are implemented for our number types trait AllImpl<'a>: Add + Add<&'a Self> @@ -50,10 +146,48 @@ mod tests { { } + /// A trait that ensures other traits are implemented for our integer types + trait IntImpl<'a>: + AllImpl<'a> + + Shl + + Shl<&'a u32> + + ShlAssign + + ShlAssign<&'a u32> + + Shr + + Shr<&'a u32> + + ShrAssign + + ShrAssign<&'a u32> + + Not + + super::num_consts::NumConsts + { + } + + #[allow(dead_code)] // This is used to statically ensure all the integers have a shared set of traits + trait SignedImpl<'a>: IntImpl<'a> + Neg {} + impl AllImpl<'_> for Uint64 {} impl AllImpl<'_> for Uint128 {} impl AllImpl<'_> for Uint256 {} impl AllImpl<'_> for Uint512 {} + impl AllImpl<'_> for Int64 {} + impl AllImpl<'_> for Int128 {} + impl AllImpl<'_> for Int256 {} + impl AllImpl<'_> for Int512 {} + + impl IntImpl<'_> for Int64 {} + impl IntImpl<'_> for Int128 {} + impl IntImpl<'_> for Int256 {} + impl IntImpl<'_> for Int512 {} + impl IntImpl<'_> for Uint64 {} + impl IntImpl<'_> for Uint128 {} + impl IntImpl<'_> for Uint256 {} + impl IntImpl<'_> for Uint512 {} + impl AllImpl<'_> for Decimal {} impl AllImpl<'_> for Decimal256 {} + + impl SignedImpl<'_> for Int64 {} + impl SignedImpl<'_> for Int128 {} + impl SignedImpl<'_> for Int256 {} + impl SignedImpl<'_> for Int512 {} } diff --git a/packages/std/src/math/num_consts.rs b/packages/std/src/math/num_consts.rs new file mode 100644 index 0000000000..b8eeb0089e --- /dev/null +++ b/packages/std/src/math/num_consts.rs @@ -0,0 +1,8 @@ +/// Crate internal trait for all our signed and unsigned number types +#[allow(dead_code)] // only used in tests for now +pub(crate) trait NumConsts { + const MAX: Self; + const MIN: Self; + const ZERO: Self; + const ONE: Self; +} diff --git a/packages/std/src/math/signed_decimal.rs b/packages/std/src/math/signed_decimal.rs new file mode 100644 index 0000000000..6643f3c121 --- /dev/null +++ b/packages/std/src/math/signed_decimal.rs @@ -0,0 +1,3100 @@ +use alloc::string::ToString; +use core::cmp::Ordering; +use core::fmt::{self, Write}; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Rem, RemAssign, Sub, SubAssign, +}; +use core::str::FromStr; +use serde::{de, ser, Deserialize, Deserializer, Serialize}; + +use crate::errors::{ + CheckedFromRatioError, CheckedMultiplyRatioError, DivideByZeroError, ErrorKind, OverflowError, + OverflowOperation, RoundDownOverflowError, RoundUpOverflowError, StdError, +}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{Decimal, Decimal256, Int256, SignedDecimal256, __internal::forward_ref_partial_eq}; + +use super::Fraction; +use super::Int128; + +/// A signed fixed-point decimal value with 18 fractional digits, i.e. SignedDecimal(1_000_000_000_000_000_000) == 1.0 +/// +/// The greatest possible value that can be represented is 170141183460469231731.687303715884105727 (which is (2^127 - 1) / 10^18) +/// and the smallest is -170141183460469231731.687303715884105728 (which is -2^127 / 10^18). +#[derive( + Copy, + Clone, + Default, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Decimal { precision: 128, signed: true })] +pub struct SignedDecimal(#[schemars(with = "String")] Int128); + +forward_ref_partial_eq!(SignedDecimal, SignedDecimal); + +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +#[error("SignedDecimal range exceeded")] +pub struct SignedDecimalRangeExceeded; + +impl SignedDecimal { + const DECIMAL_FRACTIONAL: Int128 = Int128::new(1_000_000_000_000_000_000i128); // 1*10**18 + const DECIMAL_FRACTIONAL_SQUARED: Int128 = + Int128::new(1_000_000_000_000_000_000_000_000_000_000_000_000i128); // (1*10**18)**2 = 1*10**36 + + /// The number of decimal places. Since decimal types are fixed-point rather than + /// floating-point, this is a constant. + pub const DECIMAL_PLACES: u32 = 18; // This needs to be an even number. + + /// The largest value that can be represented by this signed decimal type. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal; + /// assert_eq!(SignedDecimal::MAX.to_string(), "170141183460469231731.687303715884105727"); + /// ``` + pub const MAX: Self = Self(Int128::MAX); + + /// The smallest value that can be represented by this signed decimal type. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal; + /// assert_eq!(SignedDecimal::MIN.to_string(), "-170141183460469231731.687303715884105728"); + /// ``` + pub const MIN: Self = Self(Int128::MIN); + + /// Creates a SignedDecimal(value) + /// This is equivalent to `SignedDecimal::from_atomics(value, 18)` but usable in a const context. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::{SignedDecimal, Int128}; + /// assert_eq!(SignedDecimal::new(Int128::one()).to_string(), "0.000000000000000001"); + /// + /// let atoms = Int128::new(-141_183_460_469_231_731_687_303_715_884_105_727_125); + /// let value = SignedDecimal::new(atoms); + /// assert_eq!(value.to_string(), "-141183460469231731687.303715884105727125"); + /// ``` + #[inline] + #[must_use] + pub const fn new(value: Int128) -> Self { + Self(value) + } + + /// Creates a SignedDecimal(Int128(value)) + /// This is equivalent to `SignedDecimal::from_atomics(value, 18)` but usable in a const context. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal; + /// assert_eq!(SignedDecimal::raw(1234i128).to_string(), "0.000000000000001234"); + /// ``` + #[deprecated( + since = "3.0.0", + note = "Use SignedDecimal::new(Int128::new(value)) instead" + )] + pub const fn raw(value: i128) -> Self { + Self(Int128::new(value)) + } + + /// Create a 1.0 SignedDecimal + #[inline] + pub const fn one() -> Self { + Self(Self::DECIMAL_FRACTIONAL) + } + + /// Create a -1.0 SignedDecimal + #[inline] + pub const fn negative_one() -> Self { + Self(Int128::new(-Self::DECIMAL_FRACTIONAL.i128())) + } + + /// Create a 0.0 SignedDecimal + #[inline] + pub const fn zero() -> Self { + Self(Int128::zero()) + } + + /// Convert x% into SignedDecimal + pub fn percent(x: i64) -> Self { + Self(((x as i128) * 10_000_000_000_000_000).into()) + } + + /// Convert permille (x/1000) into SignedDecimal + pub fn permille(x: i64) -> Self { + Self(((x as i128) * 1_000_000_000_000_000).into()) + } + + /// Convert basis points (x/10000) into SignedDecimal + pub fn bps(x: i64) -> Self { + Self(((x as i128) * 100_000_000_000_000).into()) + } + + /// Creates a signed decimal from a number of atomic units and the number + /// of decimal places. The inputs will be converted internally to form + /// a signed decimal with 18 decimal places. So the input 123 and 2 will create + /// the decimal 1.23. + /// + /// Using 18 decimal places is slightly more efficient than other values + /// as no internal conversion is necessary. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{SignedDecimal, Int128}; + /// let a = SignedDecimal::from_atomics(Int128::new(1234), 3).unwrap(); + /// assert_eq!(a.to_string(), "1.234"); + /// + /// let a = SignedDecimal::from_atomics(1234i128, 0).unwrap(); + /// assert_eq!(a.to_string(), "1234"); + /// + /// let a = SignedDecimal::from_atomics(1i64, 18).unwrap(); + /// assert_eq!(a.to_string(), "0.000000000000000001"); + /// + /// let a = SignedDecimal::from_atomics(-1i64, 18).unwrap(); + /// assert_eq!(a.to_string(), "-0.000000000000000001"); + /// ``` + pub fn from_atomics( + atomics: impl Into, + decimal_places: u32, + ) -> Result { + let atomics = atomics.into(); + const TEN: Int128 = Int128::new(10); + Ok(match decimal_places.cmp(&(Self::DECIMAL_PLACES)) { + Ordering::Less => { + let digits = (Self::DECIMAL_PLACES) - decimal_places; // No overflow because decimal_places < DECIMAL_PLACES + let factor = TEN.checked_pow(digits).unwrap(); // Safe because digits <= 17 + Self( + atomics + .checked_mul(factor) + .map_err(|_| SignedDecimalRangeExceeded)?, + ) + } + Ordering::Equal => Self(atomics), + Ordering::Greater => { + let digits = decimal_places - (Self::DECIMAL_PLACES); // No overflow because decimal_places > DECIMAL_PLACES + if let Ok(factor) = TEN.checked_pow(digits) { + Self(atomics.checked_div(factor).unwrap()) // Safe because factor cannot be zero + } else { + // In this case `factor` exceeds the Int128 range. + // Any Int128 `x` divided by `factor` with `factor > Int128::MAX` is 0. + // Try e.g. Python3: `(2**128-1) // 2**128` + Self(Int128::zero()) + } + } + }) + } + + /// Returns the ratio (numerator / denominator) as a SignedDecimal + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal; + /// assert_eq!( + /// SignedDecimal::from_ratio(1, 3).to_string(), + /// "0.333333333333333333" + /// ); + /// ``` + pub fn from_ratio(numerator: impl Into, denominator: impl Into) -> Self { + match SignedDecimal::checked_from_ratio(numerator, denominator) { + Ok(value) => value, + Err(CheckedFromRatioError::DivideByZero) => { + panic!("Denominator must not be zero") + } + Err(CheckedFromRatioError::Overflow) => panic!("Multiplication overflow"), + } + } + + /// Returns the ratio (numerator / denominator) as a SignedDecimal + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::{SignedDecimal, CheckedFromRatioError}; + /// assert_eq!( + /// SignedDecimal::checked_from_ratio(1, 3).unwrap().to_string(), + /// "0.333333333333333333" + /// ); + /// assert_eq!( + /// SignedDecimal::checked_from_ratio(1, 0), + /// Err(CheckedFromRatioError::DivideByZero) + /// ); + /// ``` + pub fn checked_from_ratio( + numerator: impl Into, + denominator: impl Into, + ) -> Result { + let numerator: Int128 = numerator.into(); + let denominator: Int128 = denominator.into(); + match numerator.checked_multiply_ratio(Self::DECIMAL_FRACTIONAL, denominator) { + Ok(ratio) => { + // numerator * DECIMAL_FRACTIONAL / denominator + Ok(SignedDecimal(ratio)) + } + Err(CheckedMultiplyRatioError::Overflow) => Err(CheckedFromRatioError::Overflow), + Err(CheckedMultiplyRatioError::DivideByZero) => { + Err(CheckedFromRatioError::DivideByZero) + } + } + } + + /// Returns `true` if the number is 0 + #[must_use] + pub const fn is_zero(&self) -> bool { + self.0.is_zero() + } + + /// Returns `true` if the number is negative (< 0) + #[must_use] + pub const fn is_negative(&self) -> bool { + self.0.i128() < 0 + } + + /// A decimal is an integer of atomic units plus a number that specifies the + /// position of the decimal dot. So any decimal can be expressed as two numbers. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{SignedDecimal, Int128}; + /// # use core::str::FromStr; + /// // Value with whole and fractional part + /// let a = SignedDecimal::from_str("1.234").unwrap(); + /// assert_eq!(a.decimal_places(), 18); + /// assert_eq!(a.atomics(), Int128::new(1234000000000000000)); + /// + /// // Smallest possible value + /// let b = SignedDecimal::from_str("0.000000000000000001").unwrap(); + /// assert_eq!(b.decimal_places(), 18); + /// assert_eq!(b.atomics(), Int128::new(1)); + /// ``` + #[must_use] + #[inline] + pub const fn atomics(&self) -> Int128 { + self.0 + } + + /// The number of decimal places. This is a constant value for now + /// but this could potentially change as the type evolves. + /// + /// See also [`SignedDecimal::atomics()`]. + #[must_use] + #[inline] + pub const fn decimal_places(&self) -> u32 { + Self::DECIMAL_PLACES + } + + /// Rounds value by truncating the decimal places. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal; + /// # use core::str::FromStr; + /// assert!(SignedDecimal::from_str("0.6").unwrap().trunc().is_zero()); + /// assert_eq!(SignedDecimal::from_str("-5.8").unwrap().trunc().to_string(), "-5"); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn trunc(&self) -> Self { + Self((self.0 / Self::DECIMAL_FRACTIONAL) * Self::DECIMAL_FRACTIONAL) + } + + /// Rounds value down after decimal places. Panics on overflow. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal; + /// # use core::str::FromStr; + /// assert!(SignedDecimal::from_str("0.6").unwrap().floor().is_zero()); + /// assert_eq!(SignedDecimal::from_str("-5.2").unwrap().floor().to_string(), "-6"); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn floor(&self) -> Self { + match self.checked_floor() { + Ok(value) => value, + Err(_) => panic!("attempt to floor with overflow"), + } + } + + /// Rounds value down after decimal places. + pub fn checked_floor(&self) -> Result { + if self.is_negative() { + let truncated = self.trunc(); + + if truncated != self { + truncated + .checked_sub(SignedDecimal::one()) + .map_err(|_| RoundDownOverflowError) + } else { + Ok(truncated) + } + } else { + Ok(self.trunc()) + } + } + + /// Rounds value up after decimal places. Panics on overflow. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal; + /// # use core::str::FromStr; + /// assert_eq!(SignedDecimal::from_str("0.2").unwrap().ceil(), SignedDecimal::one()); + /// assert_eq!(SignedDecimal::from_str("-5.8").unwrap().ceil().to_string(), "-5"); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn ceil(&self) -> Self { + match self.checked_ceil() { + Ok(value) => value, + Err(_) => panic!("attempt to ceil with overflow"), + } + } + + /// Rounds value up after decimal places. Returns OverflowError on overflow. + pub fn checked_ceil(&self) -> Result { + let floor = self.floor(); + if floor == self { + Ok(floor) + } else { + floor + .checked_add(SignedDecimal::one()) + .map_err(|_| RoundUpOverflowError) + } + } + + /// Computes `self + other`, returning an `OverflowError` if an overflow occurred. + pub fn checked_add(self, other: Self) -> Result { + self.0 + .checked_add(other.0) + .map(Self) + .map_err(|_| OverflowError::new(OverflowOperation::Add)) + } + + /// Computes `self - other`, returning an `OverflowError` if an overflow occurred. + pub fn checked_sub(self, other: Self) -> Result { + self.0 + .checked_sub(other.0) + .map(Self) + .map_err(|_| OverflowError::new(OverflowOperation::Sub)) + } + + /// Multiplies one `SignedDecimal` by another, returning an `OverflowError` if an overflow occurred. + pub fn checked_mul(self, other: Self) -> Result { + let result_as_int256 = + self.numerator().full_mul(other.numerator()) / Int256::from(Self::DECIMAL_FRACTIONAL); + result_as_int256 + .try_into() + .map(Self) + .map_err(|_| OverflowError::new(OverflowOperation::Mul)) + } + + /// Raises a value to the power of `exp`, panics if an overflow occurred. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn pow(self, exp: u32) -> Self { + match self.checked_pow(exp) { + Ok(value) => value, + Err(_) => panic!("Multiplication overflow"), + } + } + + /// Raises a value to the power of `exp`, returning an `OverflowError` if an overflow occurred. + pub fn checked_pow(self, exp: u32) -> Result { + // This uses the exponentiation by squaring algorithm: + // https://en.wikipedia.org/wiki/Exponentiation_by_squaring#Basic_method + + fn inner(mut x: SignedDecimal, mut n: u32) -> Result { + if n == 0 { + return Ok(SignedDecimal::one()); + } + + let mut y = SignedDecimal::one(); + + while n > 1 { + if n % 2 == 0 { + x = x.checked_mul(x)?; + n /= 2; + } else { + y = x.checked_mul(y)?; + x = x.checked_mul(x)?; + n = (n - 1) / 2; + } + } + + Ok(x * y) + } + + inner(self, exp).map_err(|_| OverflowError::new(OverflowOperation::Pow)) + } + + pub fn checked_div(self, other: Self) -> Result { + SignedDecimal::checked_from_ratio(self.numerator(), other.numerator()) + } + + /// Computes `self % other`, returning an `DivideByZeroError` if `other == 0`. + pub fn checked_rem(self, other: Self) -> Result { + self.0 + .checked_rem(other.0) + .map(Self) + .map_err(|_| DivideByZeroError) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs_diff(self, other: Self) -> Decimal { + Decimal::new(self.0.abs_diff(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_add(self, other: Self) -> Self { + Self(self.0.saturating_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_sub(self, other: Self) -> Self { + Self(self.0.saturating_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_mul(self, other: Self) -> Self { + match self.checked_mul(other) { + Ok(value) => value, + Err(_) => { + // both negative or both positive results in positive number, otherwise negative + if self.is_negative() == other.is_negative() { + Self::MAX + } else { + Self::MIN + } + } + } + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_pow(self, exp: u32) -> Self { + match self.checked_pow(exp) { + Ok(value) => value, + Err(_) => { + // odd exponent of negative number results in negative number + // everything else results in positive number + if self.is_negative() && exp % 2 == 1 { + Self::MIN + } else { + Self::MAX + } + } + } + } + + /// Converts this decimal to a signed integer by rounding down + /// to the next integer, e.g. 22.5 becomes 22 and -1.2 becomes -2. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{SignedDecimal, Int128}; + /// + /// let d = SignedDecimal::from_str("12.345").unwrap(); + /// assert_eq!(d.to_int_floor(), Int128::new(12)); + /// + /// let d = SignedDecimal::from_str("-12.999").unwrap(); + /// assert_eq!(d.to_int_floor(), Int128::new(-13)); + /// + /// let d = SignedDecimal::from_str("-0.05").unwrap(); + /// assert_eq!(d.to_int_floor(), Int128::new(-1)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_int_floor(self) -> Int128 { + if self.is_negative() { + // Using `x.to_int_floor() = -(-x).to_int_ceil()` for a negative `x`, + // but avoiding overflow by implementing the formula from `to_int_ceil` directly. + let x = self.0; + let y = Self::DECIMAL_FRACTIONAL; + // making sure not to negate `x`, as this would overflow + -Int128::one() - ((-Int128::one() - x) / y) + } else { + self.to_int_trunc() + } + } + + /// Converts this decimal to a signed integer by truncating + /// the fractional part, e.g. 22.5 becomes 22. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{SignedDecimal, Int128}; + /// + /// let d = SignedDecimal::from_str("12.345").unwrap(); + /// assert_eq!(d.to_int_trunc(), Int128::new(12)); + /// + /// let d = SignedDecimal::from_str("-12.999").unwrap(); + /// assert_eq!(d.to_int_trunc(), Int128::new(-12)); + /// + /// let d = SignedDecimal::from_str("75.0").unwrap(); + /// assert_eq!(d.to_int_trunc(), Int128::new(75)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_int_trunc(self) -> Int128 { + self.0 / Self::DECIMAL_FRACTIONAL + } + + /// Converts this decimal to a signed integer by rounding up + /// to the next integer, e.g. 22.3 becomes 23 and -1.2 becomes -1. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{SignedDecimal, Int128}; + /// + /// let d = SignedDecimal::from_str("12.345").unwrap(); + /// assert_eq!(d.to_int_ceil(), Int128::new(13)); + /// + /// let d = SignedDecimal::from_str("-12.999").unwrap(); + /// assert_eq!(d.to_int_ceil(), Int128::new(-12)); + /// + /// let d = SignedDecimal::from_str("75.0").unwrap(); + /// assert_eq!(d.to_int_ceil(), Int128::new(75)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_int_ceil(self) -> Int128 { + if self.is_negative() { + self.to_int_trunc() + } else { + // Using `q = 1 + ((x - 1) / y); // if x != 0` with unsigned integers x, y, q + // from https://stackoverflow.com/a/2745086/2013738. We know `x + y` CAN overflow. + let x = self.0; + let y = Self::DECIMAL_FRACTIONAL; + if x.is_zero() { + Int128::zero() + } else { + Int128::one() + ((x - Int128::one()) / y) + } + } + } +} + +impl Fraction for SignedDecimal { + #[inline] + fn numerator(&self) -> Int128 { + self.0 + } + + #[inline] + fn denominator(&self) -> Int128 { + Self::DECIMAL_FRACTIONAL + } + + /// Returns the multiplicative inverse `1/d` for decimal `d`. + /// + /// If `d` is zero, none is returned. + fn inv(&self) -> Option { + if self.is_zero() { + None + } else { + // Let self be p/q with p = self.0 and q = DECIMAL_FRACTIONAL. + // Now we calculate the inverse a/b = q/p such that b = DECIMAL_FRACTIONAL. Then + // `a = DECIMAL_FRACTIONAL*DECIMAL_FRACTIONAL / self.0`. + Some(SignedDecimal(Self::DECIMAL_FRACTIONAL_SQUARED / self.0)) + } + } +} + +impl Neg for SignedDecimal { + type Output = Self; + + fn neg(self) -> Self::Output { + Self(-self.0) + } +} + +impl TryFrom for SignedDecimal { + type Error = SignedDecimalRangeExceeded; + + fn try_from(value: SignedDecimal256) -> Result { + value + .atomics() + .try_into() + .map(SignedDecimal) + .map_err(|_| SignedDecimalRangeExceeded) + } +} + +impl TryFrom for SignedDecimal { + type Error = SignedDecimalRangeExceeded; + + fn try_from(value: Decimal) -> Result { + value + .atomics() + .try_into() + .map(SignedDecimal) + .map_err(|_| SignedDecimalRangeExceeded) + } +} + +impl TryFrom for SignedDecimal { + type Error = SignedDecimalRangeExceeded; + + fn try_from(value: Decimal256) -> Result { + value + .atomics() + .try_into() + .map(SignedDecimal) + .map_err(|_| SignedDecimalRangeExceeded) + } +} + +impl TryFrom for SignedDecimal { + type Error = SignedDecimalRangeExceeded; + + #[inline] + fn try_from(value: Int128) -> Result { + Self::from_atomics(value, 0) + } +} + +impl FromStr for SignedDecimal { + type Err = StdError; + + /// Converts the decimal string to a SignedDecimal + /// Possible inputs: "1.23", "1", "000012", "1.123000000", "-1.12300" + /// Disallowed: "", ".23" + /// + /// This never performs any kind of rounding. + /// More than DECIMAL_PLACES fractional digits, even zeros, result in an error. + fn from_str(input: &str) -> Result { + let mut parts_iter = input.split('.'); + + let whole_part = parts_iter.next().unwrap(); // split always returns at least one element + let is_neg = whole_part.starts_with('-'); + + let whole = whole_part.parse::()?; + let mut atomics = whole.checked_mul(Self::DECIMAL_FRACTIONAL)?; + + if let Some(fractional_part) = parts_iter.next() { + let fractional = fractional_part.parse::()?; // u64 is enough for 18 decimal places + let exp = (Self::DECIMAL_PLACES.checked_sub(fractional_part.len() as u32)).ok_or_else( + || { + StdError::msg(format_args!( + "Cannot parse more than {} fractional digits", + Self::DECIMAL_PLACES + )) + }, + )?; + debug_assert!(exp <= Self::DECIMAL_PLACES); + let fractional_factor = Int128::from(10i128.pow(exp)); + + // This multiplication can't overflow because + // fractional < 10^DECIMAL_PLACES && fractional_factor <= 10^DECIMAL_PLACES + let fractional_part = Int128::from(fractional) + .checked_mul(fractional_factor) + .unwrap(); + + // for negative numbers, we need to subtract the fractional part + atomics = if is_neg { + atomics.checked_sub(fractional_part) + } else { + atomics.checked_add(fractional_part) + }?; + } + + if parts_iter.next().is_some() { + return Err(StdError::msg("Unexpected number of dots").with_kind(ErrorKind::Parsing)); + } + + Ok(SignedDecimal(atomics)) + } +} + +impl fmt::Display for SignedDecimal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let whole = (self.0) / Self::DECIMAL_FRACTIONAL; + let fractional = (self.0).checked_rem(Self::DECIMAL_FRACTIONAL).unwrap(); + + if fractional.is_zero() { + write!(f, "{whole}") + } else { + let fractional_string = format!( + "{:0>padding$}", + fractional.abs(), // fractional should always be printed as positive + padding = Self::DECIMAL_PLACES as usize + ); + if self.is_negative() { + f.write_char('-')?; + } + write!( + f, + "{whole}.{fractional}", + whole = whole.abs(), + fractional = fractional_string.trim_end_matches('0') + ) + } + } +} + +impl fmt::Debug for SignedDecimal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SignedDecimal({self})") + } +} + +impl Add for SignedDecimal { + type Output = Self; + + fn add(self, other: Self) -> Self { + SignedDecimal(self.0 + other.0) + } +} +forward_ref_binop!(impl Add, add for SignedDecimal, SignedDecimal); + +impl AddAssign for SignedDecimal { + fn add_assign(&mut self, rhs: SignedDecimal) { + *self = *self + rhs; + } +} +forward_ref_op_assign!(impl AddAssign, add_assign for SignedDecimal, SignedDecimal); + +impl Sub for SignedDecimal { + type Output = Self; + + fn sub(self, other: Self) -> Self { + SignedDecimal(self.0 - other.0) + } +} +forward_ref_binop!(impl Sub, sub for SignedDecimal, SignedDecimal); + +impl SubAssign for SignedDecimal { + fn sub_assign(&mut self, rhs: SignedDecimal) { + *self = *self - rhs; + } +} +forward_ref_op_assign!(impl SubAssign, sub_assign for SignedDecimal, SignedDecimal); + +impl Mul for SignedDecimal { + type Output = Self; + + #[allow(clippy::suspicious_arithmetic_impl)] + fn mul(self, other: Self) -> Self { + // SignedDecimals are fractions. We can multiply two decimals a and b + // via + // (a.numerator() * b.numerator()) / (a.denominator() * b.denominator()) + // = (a.numerator() * b.numerator()) / a.denominator() / b.denominator() + + let result_as_int256 = + self.numerator().full_mul(other.numerator()) / Int256::from(Self::DECIMAL_FRACTIONAL); + match result_as_int256.try_into() { + Ok(result) => Self(result), + Err(_) => panic!("attempt to multiply with overflow"), + } + } +} +forward_ref_binop!(impl Mul, mul for SignedDecimal, SignedDecimal); + +impl MulAssign for SignedDecimal { + fn mul_assign(&mut self, rhs: SignedDecimal) { + *self = *self * rhs; + } +} +forward_ref_op_assign!(impl MulAssign, mul_assign for SignedDecimal, SignedDecimal); + +impl Div for SignedDecimal { + type Output = Self; + + fn div(self, other: Self) -> Self { + match SignedDecimal::checked_from_ratio(self.numerator(), other.numerator()) { + Ok(ratio) => ratio, + Err(CheckedFromRatioError::DivideByZero) => { + panic!("Division failed - denominator must not be zero") + } + Err(CheckedFromRatioError::Overflow) => { + panic!("Division failed - multiplication overflow") + } + } + } +} +forward_ref_binop!(impl Div, div for SignedDecimal, SignedDecimal); + +impl DivAssign for SignedDecimal { + fn div_assign(&mut self, rhs: SignedDecimal) { + *self = *self / rhs; + } +} +forward_ref_op_assign!(impl DivAssign, div_assign for SignedDecimal, SignedDecimal); + +impl Div for SignedDecimal { + type Output = Self; + + fn div(self, rhs: Int128) -> Self::Output { + SignedDecimal(self.0 / rhs) + } +} + +impl DivAssign for SignedDecimal { + fn div_assign(&mut self, rhs: Int128) { + self.0 /= rhs; + } +} + +impl Rem for SignedDecimal { + type Output = Self; + + /// # Panics + /// + /// This operation will panic if `rhs` is zero + #[inline] + fn rem(self, rhs: Self) -> Self { + Self(self.0.rem(rhs.0)) + } +} +forward_ref_binop!(impl Rem, rem for SignedDecimal, SignedDecimal); + +impl RemAssign for SignedDecimal { + fn rem_assign(&mut self, rhs: SignedDecimal) { + *self = *self % rhs; + } +} +forward_ref_op_assign!(impl RemAssign, rem_assign for SignedDecimal, SignedDecimal); + +impl core::iter::Sum for SignedDecimal +where + Self: Add, +{ + fn sum>(iter: I) -> Self { + iter.fold(Self::zero(), Add::add) + } +} + +/// Serializes as a decimal string +impl Serialize for SignedDecimal { + fn serialize(&self, serializer: S) -> Result + where + S: ser::Serializer, + { + serializer.serialize_str(&self.to_string()) + } +} + +/// Deserializes as a base64 string +impl<'de> Deserialize<'de> for SignedDecimal { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(SignedDecimalVisitor) + } +} + +struct SignedDecimalVisitor; + +impl de::Visitor<'_> for SignedDecimalVisitor { + type Value = SignedDecimal; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("string-encoded decimal") + } + + fn visit_str(self, v: &str) -> Result + where + E: de::Error, + { + match SignedDecimal::from_str(v) { + Ok(d) => Ok(d), + Err(e) => Err(E::custom(format_args!("Error parsing decimal '{v}': {e}"))), + } + } +} + +#[cfg(test)] +mod tests { + use crate::Uint128; + + use super::*; + + use alloc::vec::Vec; + + fn dec(input: &str) -> SignedDecimal { + SignedDecimal::from_str(input).unwrap() + } + + #[test] + fn signed_decimal_new() { + let expected = Int128::from(300i128); + assert_eq!(SignedDecimal::new(expected).0, expected); + + let expected = Int128::from(-300i128); + assert_eq!(SignedDecimal::new(expected).0, expected); + } + + #[test] + #[allow(deprecated)] + fn signed_decimal_raw() { + let value = 300i128; + assert_eq!(SignedDecimal::raw(value).0.i128(), value); + + let value = -300i128; + assert_eq!(SignedDecimal::raw(value).0.i128(), value); + } + + #[test] + fn signed_decimal_one() { + let value = SignedDecimal::one(); + assert_eq!(value.0, SignedDecimal::DECIMAL_FRACTIONAL); + } + + #[test] + fn signed_decimal_zero() { + let value = SignedDecimal::zero(); + assert!(value.0.is_zero()); + } + + #[test] + fn signed_decimal_percent() { + let value = SignedDecimal::percent(50); + assert_eq!( + value.0, + SignedDecimal::DECIMAL_FRACTIONAL / Int128::from(2u8) + ); + + let value = SignedDecimal::percent(-50); + assert_eq!( + value.0, + SignedDecimal::DECIMAL_FRACTIONAL / Int128::from(-2i8) + ); + } + + #[test] + fn signed_decimal_permille() { + let value = SignedDecimal::permille(125); + assert_eq!( + value.0, + SignedDecimal::DECIMAL_FRACTIONAL / Int128::from(8u8) + ); + + let value = SignedDecimal::permille(-125); + assert_eq!( + value.0, + SignedDecimal::DECIMAL_FRACTIONAL / Int128::from(-8i8) + ); + } + + #[test] + fn signed_decimal_bps() { + let value = SignedDecimal::bps(125); + assert_eq!( + value.0, + SignedDecimal::DECIMAL_FRACTIONAL / Int128::from(80u8) + ); + + let value = SignedDecimal::bps(-125); + assert_eq!( + value.0, + SignedDecimal::DECIMAL_FRACTIONAL / Int128::from(-80i8) + ); + } + + #[test] + fn try_from_integer() { + let int = Int128::new(0xDEADBEEF); + let decimal = SignedDecimal::try_from(int).unwrap(); + assert_eq!(int.to_string(), decimal.to_string()); + } + + #[test] + fn signed_decimal_from_atomics_works() { + let one = SignedDecimal::one(); + let two = one + one; + let neg_one = SignedDecimal::negative_one(); + + assert_eq!(SignedDecimal::from_atomics(1i128, 0).unwrap(), one); + assert_eq!(SignedDecimal::from_atomics(10i128, 1).unwrap(), one); + assert_eq!(SignedDecimal::from_atomics(100i128, 2).unwrap(), one); + assert_eq!(SignedDecimal::from_atomics(1000i128, 3).unwrap(), one); + assert_eq!( + SignedDecimal::from_atomics(1000000000000000000i128, 18).unwrap(), + one + ); + assert_eq!( + SignedDecimal::from_atomics(10000000000000000000i128, 19).unwrap(), + one + ); + assert_eq!( + SignedDecimal::from_atomics(100000000000000000000i128, 20).unwrap(), + one + ); + + assert_eq!(SignedDecimal::from_atomics(2i128, 0).unwrap(), two); + assert_eq!(SignedDecimal::from_atomics(20i128, 1).unwrap(), two); + assert_eq!(SignedDecimal::from_atomics(200i128, 2).unwrap(), two); + assert_eq!(SignedDecimal::from_atomics(2000i128, 3).unwrap(), two); + assert_eq!( + SignedDecimal::from_atomics(2000000000000000000i128, 18).unwrap(), + two + ); + assert_eq!( + SignedDecimal::from_atomics(20000000000000000000i128, 19).unwrap(), + two + ); + assert_eq!( + SignedDecimal::from_atomics(200000000000000000000i128, 20).unwrap(), + two + ); + + assert_eq!(SignedDecimal::from_atomics(-1i128, 0).unwrap(), neg_one); + assert_eq!(SignedDecimal::from_atomics(-10i128, 1).unwrap(), neg_one); + assert_eq!( + SignedDecimal::from_atomics(-100000000000000000000i128, 20).unwrap(), + neg_one + ); + + // Cuts decimal digits (20 provided but only 18 can be stored) + assert_eq!( + SignedDecimal::from_atomics(4321i128, 20).unwrap(), + SignedDecimal::from_str("0.000000000000000043").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(-4321i128, 20).unwrap(), + SignedDecimal::from_str("-0.000000000000000043").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(6789i128, 20).unwrap(), + SignedDecimal::from_str("0.000000000000000067").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(i128::MAX, 38).unwrap(), + SignedDecimal::from_str("1.701411834604692317").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(i128::MAX, 39).unwrap(), + SignedDecimal::from_str("0.170141183460469231").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(i128::MAX, 45).unwrap(), + SignedDecimal::from_str("0.000000170141183460").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(i128::MAX, 51).unwrap(), + SignedDecimal::from_str("0.000000000000170141").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(i128::MAX, 56).unwrap(), + SignedDecimal::from_str("0.000000000000000001").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(i128::MAX, 57).unwrap(), + SignedDecimal::from_str("0.000000000000000000").unwrap() + ); + assert_eq!( + SignedDecimal::from_atomics(i128::MAX, u32::MAX).unwrap(), + SignedDecimal::from_str("0.000000000000000000").unwrap() + ); + + // Can be used with max value + let max = SignedDecimal::MAX; + assert_eq!( + SignedDecimal::from_atomics(max.atomics(), max.decimal_places()).unwrap(), + max + ); + + // Can be used with min value + let min = SignedDecimal::MIN; + assert_eq!( + SignedDecimal::from_atomics(min.atomics(), min.decimal_places()).unwrap(), + min + ); + + // Overflow is only possible with digits < 18 + let result = SignedDecimal::from_atomics(i128::MAX, 17); + assert_eq!(result.unwrap_err(), SignedDecimalRangeExceeded); + } + + #[test] + fn signed_decimal_from_ratio_works() { + // 1.0 + assert_eq!( + SignedDecimal::from_ratio(1i128, 1i128), + SignedDecimal::one() + ); + assert_eq!( + SignedDecimal::from_ratio(53i128, 53i128), + SignedDecimal::one() + ); + assert_eq!( + SignedDecimal::from_ratio(125i128, 125i128), + SignedDecimal::one() + ); + + // -1.0 + assert_eq!( + SignedDecimal::from_ratio(-1i128, 1i128), + SignedDecimal::negative_one() + ); + assert_eq!( + SignedDecimal::from_ratio(-53i128, 53i128), + SignedDecimal::negative_one() + ); + assert_eq!( + SignedDecimal::from_ratio(125i128, -125i128), + SignedDecimal::negative_one() + ); + + // 1.5 + assert_eq!( + SignedDecimal::from_ratio(3i128, 2i128), + SignedDecimal::percent(150) + ); + assert_eq!( + SignedDecimal::from_ratio(150i128, 100i128), + SignedDecimal::percent(150) + ); + assert_eq!( + SignedDecimal::from_ratio(333i128, 222i128), + SignedDecimal::percent(150) + ); + + // 0.125 + assert_eq!( + SignedDecimal::from_ratio(1i64, 8i64), + SignedDecimal::permille(125) + ); + assert_eq!( + SignedDecimal::from_ratio(125i64, 1000i64), + SignedDecimal::permille(125) + ); + + // -0.125 + assert_eq!( + SignedDecimal::from_ratio(-1i64, 8i64), + SignedDecimal::permille(-125) + ); + assert_eq!( + SignedDecimal::from_ratio(125i64, -1000i64), + SignedDecimal::permille(-125) + ); + + // 1/3 (result floored) + assert_eq!( + SignedDecimal::from_ratio(1i64, 3i64), + SignedDecimal(Int128::from(333_333_333_333_333_333i128)) + ); + + // 2/3 (result floored) + assert_eq!( + SignedDecimal::from_ratio(2i64, 3i64), + SignedDecimal(Int128::from(666_666_666_666_666_666i128)) + ); + + // large inputs + assert_eq!( + SignedDecimal::from_ratio(0i128, i128::MAX), + SignedDecimal::zero() + ); + assert_eq!( + SignedDecimal::from_ratio(i128::MAX, i128::MAX), + SignedDecimal::one() + ); + // 170141183460469231731 is the largest integer <= SignedDecimal::MAX + assert_eq!( + SignedDecimal::from_ratio(170141183460469231731i128, 1i128), + SignedDecimal::from_str("170141183460469231731").unwrap() + ); + } + + #[test] + #[should_panic(expected = "Denominator must not be zero")] + fn signed_decimal_from_ratio_panics_for_zero_denominator() { + SignedDecimal::from_ratio(1i128, 0i128); + } + + #[test] + #[should_panic(expected = "Multiplication overflow")] + fn signed_decimal_from_ratio_panics_for_mul_overflow() { + SignedDecimal::from_ratio(i128::MAX, 1i128); + } + + #[test] + fn signed_decimal_checked_from_ratio_does_not_panic() { + assert_eq!( + SignedDecimal::checked_from_ratio(1i128, 0i128), + Err(CheckedFromRatioError::DivideByZero) + ); + + assert_eq!( + SignedDecimal::checked_from_ratio(i128::MAX, 1i128), + Err(CheckedFromRatioError::Overflow) + ); + } + + #[test] + fn signed_decimal_implements_fraction() { + let fraction = SignedDecimal::from_str("1234.567").unwrap(); + assert_eq!( + fraction.numerator(), + Int128::from(1_234_567_000_000_000_000_000i128) + ); + assert_eq!( + fraction.denominator(), + Int128::from(1_000_000_000_000_000_000i128) + ); + + let fraction = SignedDecimal::from_str("-1234.567").unwrap(); + assert_eq!( + fraction.numerator(), + Int128::from(-1_234_567_000_000_000_000_000i128) + ); + assert_eq!( + fraction.denominator(), + Int128::from(1_000_000_000_000_000_000i128) + ); + } + + #[test] + fn signed_decimal_from_str_works() { + // Integers + assert_eq!( + SignedDecimal::from_str("0").unwrap(), + SignedDecimal::percent(0) + ); + assert_eq!( + SignedDecimal::from_str("1").unwrap(), + SignedDecimal::percent(100) + ); + assert_eq!( + SignedDecimal::from_str("5").unwrap(), + SignedDecimal::percent(500) + ); + assert_eq!( + SignedDecimal::from_str("42").unwrap(), + SignedDecimal::percent(4200) + ); + assert_eq!( + SignedDecimal::from_str("000").unwrap(), + SignedDecimal::percent(0) + ); + assert_eq!( + SignedDecimal::from_str("001").unwrap(), + SignedDecimal::percent(100) + ); + assert_eq!( + SignedDecimal::from_str("005").unwrap(), + SignedDecimal::percent(500) + ); + assert_eq!( + SignedDecimal::from_str("0042").unwrap(), + SignedDecimal::percent(4200) + ); + + // Positive decimals + assert_eq!( + SignedDecimal::from_str("1.0").unwrap(), + SignedDecimal::percent(100) + ); + assert_eq!( + SignedDecimal::from_str("1.5").unwrap(), + SignedDecimal::percent(150) + ); + assert_eq!( + SignedDecimal::from_str("0.5").unwrap(), + SignedDecimal::percent(50) + ); + assert_eq!( + SignedDecimal::from_str("0.123").unwrap(), + SignedDecimal::permille(123) + ); + + assert_eq!( + SignedDecimal::from_str("40.00").unwrap(), + SignedDecimal::percent(4000) + ); + assert_eq!( + SignedDecimal::from_str("04.00").unwrap(), + SignedDecimal::percent(400) + ); + assert_eq!( + SignedDecimal::from_str("00.40").unwrap(), + SignedDecimal::percent(40) + ); + assert_eq!( + SignedDecimal::from_str("00.04").unwrap(), + SignedDecimal::percent(4) + ); + // Negative decimals + assert_eq!( + SignedDecimal::from_str("-00.04").unwrap(), + SignedDecimal::percent(-4) + ); + assert_eq!( + SignedDecimal::from_str("-00.40").unwrap(), + SignedDecimal::percent(-40) + ); + assert_eq!( + SignedDecimal::from_str("-04.00").unwrap(), + SignedDecimal::percent(-400) + ); + + // Can handle DECIMAL_PLACES fractional digits + assert_eq!( + SignedDecimal::from_str("7.123456789012345678").unwrap(), + SignedDecimal(Int128::from(7123456789012345678i128)) + ); + assert_eq!( + SignedDecimal::from_str("7.999999999999999999").unwrap(), + SignedDecimal(Int128::from(7999999999999999999i128)) + ); + + // Works for documented max value + assert_eq!( + SignedDecimal::from_str("170141183460469231731.687303715884105727").unwrap(), + SignedDecimal::MAX + ); + // Works for documented min value + assert_eq!( + SignedDecimal::from_str("-170141183460469231731.687303715884105728").unwrap(), + SignedDecimal::MIN + ); + assert_eq!( + SignedDecimal::from_str("-1").unwrap(), + SignedDecimal::negative_one() + ); + } + + #[test] + fn signed_decimal_from_str_errors_for_broken_whole_part() { + assert!(SignedDecimal::from_str("").is_err()); + assert!(SignedDecimal::from_str(" ").is_err()); + assert!(SignedDecimal::from_str("-").is_err()); + } + + #[test] + fn signed_decimal_from_str_errors_for_broken_fractional_part() { + assert!(SignedDecimal::from_str("1.").is_err()); + assert!(SignedDecimal::from_str("1. ").is_err()); + assert!(SignedDecimal::from_str("1.e").is_err()); + assert!(SignedDecimal::from_str("1.2e3").is_err()); + assert!(SignedDecimal::from_str("1.-2").is_err()); + } + + #[test] + fn signed_decimal_from_str_errors_for_more_than_18_fractional_digits() { + assert!(SignedDecimal::from_str("7.1234567890123456789").is_err()); + // No special rules for trailing zeros. This could be changed but adds gas cost for the happy path. + assert!(SignedDecimal::from_str("7.1230000000000000000").is_err()); + } + + #[test] + fn signed_decimal_from_str_errors_for_invalid_number_of_dots() { + assert!(SignedDecimal::from_str("1.2.3") + .unwrap_err() + .to_string() + .ends_with("Unexpected number of dots")); + + assert!(SignedDecimal::from_str("1.2.3.4") + .unwrap_err() + .to_string() + .ends_with("Unexpected number of dots")); + } + + #[test] + fn signed_decimal_from_str_errors_for_more_than_max_value() { + // Integer + assert!(SignedDecimal::from_str("170141183460469231732").is_err()); + assert!(SignedDecimal::from_str("-170141183460469231732").is_err()); + + // SignedDecimal + assert!(SignedDecimal::from_str("170141183460469231732.0").is_err()); + assert!(SignedDecimal::from_str("170141183460469231731.687303715884105728").is_err()); + assert!(SignedDecimal::from_str("-170141183460469231731.687303715884105729").is_err()); + } + + #[test] + fn signed_decimal_conversions_work() { + // signed decimal to signed decimal + assert_eq!( + SignedDecimal::try_from(SignedDecimal256::MAX).unwrap_err(), + SignedDecimalRangeExceeded + ); + assert_eq!( + SignedDecimal::try_from(SignedDecimal256::MIN).unwrap_err(), + SignedDecimalRangeExceeded + ); + assert_eq!( + SignedDecimal::try_from(SignedDecimal256::zero()).unwrap(), + SignedDecimal::zero() + ); + assert_eq!( + SignedDecimal::try_from(SignedDecimal256::one()).unwrap(), + SignedDecimal::one() + ); + assert_eq!( + SignedDecimal::try_from(SignedDecimal256::percent(50)).unwrap(), + SignedDecimal::percent(50) + ); + assert_eq!( + SignedDecimal::try_from(SignedDecimal256::percent(-200)).unwrap(), + SignedDecimal::percent(-200) + ); + + // unsigned to signed decimal + assert_eq!( + SignedDecimal::try_from(Decimal::MAX).unwrap_err(), + SignedDecimalRangeExceeded + ); + let max = Decimal::new(Uint128::new(SignedDecimal::MAX.atomics().i128() as u128)); + let too_big = max + Decimal::new(Uint128::one()); + assert_eq!( + SignedDecimal::try_from(too_big).unwrap_err(), + SignedDecimalRangeExceeded + ); + assert_eq!( + SignedDecimal::try_from(Decimal::zero()).unwrap(), + SignedDecimal::zero() + ); + assert_eq!(SignedDecimal::try_from(max).unwrap(), SignedDecimal::MAX); + } + + #[test] + fn signed_decimal_atomics_works() { + let zero = SignedDecimal::zero(); + let one = SignedDecimal::one(); + let half = SignedDecimal::percent(50); + let two = SignedDecimal::percent(200); + let max = SignedDecimal::MAX; + let neg_half = SignedDecimal::percent(-50); + let neg_two = SignedDecimal::percent(-200); + let min = SignedDecimal::MIN; + + assert_eq!(zero.atomics(), Int128::new(0)); + assert_eq!(one.atomics(), Int128::new(1000000000000000000)); + assert_eq!(half.atomics(), Int128::new(500000000000000000)); + assert_eq!(two.atomics(), Int128::new(2000000000000000000)); + assert_eq!(max.atomics(), Int128::MAX); + assert_eq!(neg_half.atomics(), Int128::new(-500000000000000000)); + assert_eq!(neg_two.atomics(), Int128::new(-2000000000000000000)); + assert_eq!(min.atomics(), Int128::MIN); + } + + #[test] + fn signed_decimal_decimal_places_works() { + let zero = SignedDecimal::zero(); + let one = SignedDecimal::one(); + let half = SignedDecimal::percent(50); + let two = SignedDecimal::percent(200); + let max = SignedDecimal::MAX; + let neg_one = SignedDecimal::negative_one(); + + assert_eq!(zero.decimal_places(), 18); + assert_eq!(one.decimal_places(), 18); + assert_eq!(half.decimal_places(), 18); + assert_eq!(two.decimal_places(), 18); + assert_eq!(max.decimal_places(), 18); + assert_eq!(neg_one.decimal_places(), 18); + } + + #[test] + fn signed_decimal_is_zero_works() { + assert!(SignedDecimal::zero().is_zero()); + assert!(SignedDecimal::percent(0).is_zero()); + assert!(SignedDecimal::permille(0).is_zero()); + + assert!(!SignedDecimal::one().is_zero()); + assert!(!SignedDecimal::percent(123).is_zero()); + assert!(!SignedDecimal::permille(-1234).is_zero()); + } + + #[test] + fn signed_decimal_inv_works() { + // d = 0 + assert_eq!(SignedDecimal::zero().inv(), None); + + // d == 1 + assert_eq!(SignedDecimal::one().inv(), Some(SignedDecimal::one())); + + // d == -1 + assert_eq!( + SignedDecimal::negative_one().inv(), + Some(SignedDecimal::negative_one()) + ); + + // d > 1 exact + assert_eq!( + SignedDecimal::from_str("2").unwrap().inv(), + Some(SignedDecimal::from_str("0.5").unwrap()) + ); + assert_eq!( + SignedDecimal::from_str("20").unwrap().inv(), + Some(SignedDecimal::from_str("0.05").unwrap()) + ); + assert_eq!( + SignedDecimal::from_str("200").unwrap().inv(), + Some(SignedDecimal::from_str("0.005").unwrap()) + ); + assert_eq!( + SignedDecimal::from_str("2000").unwrap().inv(), + Some(SignedDecimal::from_str("0.0005").unwrap()) + ); + + // d > 1 rounded + assert_eq!( + SignedDecimal::from_str("3").unwrap().inv(), + Some(SignedDecimal::from_str("0.333333333333333333").unwrap()) + ); + assert_eq!( + SignedDecimal::from_str("6").unwrap().inv(), + Some(SignedDecimal::from_str("0.166666666666666666").unwrap()) + ); + + // d < 1 exact + assert_eq!( + SignedDecimal::from_str("0.5").unwrap().inv(), + Some(SignedDecimal::from_str("2").unwrap()) + ); + assert_eq!( + SignedDecimal::from_str("0.05").unwrap().inv(), + Some(SignedDecimal::from_str("20").unwrap()) + ); + assert_eq!( + SignedDecimal::from_str("0.005").unwrap().inv(), + Some(SignedDecimal::from_str("200").unwrap()) + ); + assert_eq!( + SignedDecimal::from_str("0.0005").unwrap().inv(), + Some(SignedDecimal::from_str("2000").unwrap()) + ); + + // d < 0 + assert_eq!( + SignedDecimal::from_str("-0.5").unwrap().inv(), + Some(SignedDecimal::from_str("-2").unwrap()) + ); + // d < 0 rounded + assert_eq!( + SignedDecimal::from_str("-3").unwrap().inv(), + Some(SignedDecimal::from_str("-0.333333333333333333").unwrap()) + ); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_add_works() { + let value = SignedDecimal::one() + SignedDecimal::percent(50); // 1.5 + assert_eq!( + value.0, + SignedDecimal::DECIMAL_FRACTIONAL * Int128::from(3u8) / Int128::from(2u8) + ); + + assert_eq!( + SignedDecimal::percent(5) + SignedDecimal::percent(4), + SignedDecimal::percent(9) + ); + assert_eq!( + SignedDecimal::percent(5) + SignedDecimal::zero(), + SignedDecimal::percent(5) + ); + assert_eq!( + SignedDecimal::zero() + SignedDecimal::zero(), + SignedDecimal::zero() + ); + // negative numbers + assert_eq!( + SignedDecimal::percent(-5) + SignedDecimal::percent(-4), + SignedDecimal::percent(-9) + ); + assert_eq!( + SignedDecimal::percent(-5) + SignedDecimal::percent(4), + SignedDecimal::percent(-1) + ); + assert_eq!( + SignedDecimal::percent(5) + SignedDecimal::percent(-4), + SignedDecimal::percent(1) + ); + + // works for refs + let a = SignedDecimal::percent(15); + let b = SignedDecimal::percent(25); + let expected = SignedDecimal::percent(40); + assert_eq!(a + b, expected); + assert_eq!(&a + b, expected); + assert_eq!(a + &b, expected); + assert_eq!(&a + &b, expected); + } + + #[test] + #[should_panic] + fn signed_decimal_add_overflow_panics() { + let _value = SignedDecimal::MAX + SignedDecimal::percent(50); + } + + #[test] + fn signed_decimal_add_assign_works() { + let mut a = SignedDecimal::percent(30); + a += SignedDecimal::percent(20); + assert_eq!(a, SignedDecimal::percent(50)); + + // works for refs + let mut a = SignedDecimal::percent(15); + let b = SignedDecimal::percent(3); + let expected = SignedDecimal::percent(18); + a += &b; + assert_eq!(a, expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_sub_works() { + let value = SignedDecimal::one() - SignedDecimal::percent(50); // 0.5 + assert_eq!( + value.0, + SignedDecimal::DECIMAL_FRACTIONAL / Int128::from(2u8) + ); + + assert_eq!( + SignedDecimal::percent(9) - SignedDecimal::percent(4), + SignedDecimal::percent(5) + ); + assert_eq!( + SignedDecimal::percent(16) - SignedDecimal::zero(), + SignedDecimal::percent(16) + ); + assert_eq!( + SignedDecimal::percent(16) - SignedDecimal::percent(16), + SignedDecimal::zero() + ); + assert_eq!( + SignedDecimal::zero() - SignedDecimal::zero(), + SignedDecimal::zero() + ); + + // negative numbers + assert_eq!( + SignedDecimal::percent(-5) - SignedDecimal::percent(-4), + SignedDecimal::percent(-1) + ); + assert_eq!( + SignedDecimal::percent(-5) - SignedDecimal::percent(4), + SignedDecimal::percent(-9) + ); + assert_eq!( + SignedDecimal::percent(500) - SignedDecimal::percent(-4), + SignedDecimal::percent(504) + ); + + // works for refs + let a = SignedDecimal::percent(13); + let b = SignedDecimal::percent(6); + let expected = SignedDecimal::percent(7); + assert_eq!(a - b, expected); + assert_eq!(&a - b, expected); + assert_eq!(a - &b, expected); + assert_eq!(&a - &b, expected); + } + + #[test] + #[should_panic] + fn signed_decimal_sub_overflow_panics() { + let _value = SignedDecimal::MIN - SignedDecimal::percent(50); + } + + #[test] + fn signed_decimal_sub_assign_works() { + let mut a = SignedDecimal::percent(20); + a -= SignedDecimal::percent(2); + assert_eq!(a, SignedDecimal::percent(18)); + + // works for refs + let mut a = SignedDecimal::percent(33); + let b = SignedDecimal::percent(13); + let expected = SignedDecimal::percent(20); + a -= &b; + assert_eq!(a, expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_implements_mul() { + let one = SignedDecimal::one(); + let two = one + one; + let half = SignedDecimal::percent(50); + + // 1*x and x*1 + assert_eq!(one * SignedDecimal::percent(0), SignedDecimal::percent(0)); + assert_eq!(one * SignedDecimal::percent(1), SignedDecimal::percent(1)); + assert_eq!(one * SignedDecimal::percent(10), SignedDecimal::percent(10)); + assert_eq!( + one * SignedDecimal::percent(100), + SignedDecimal::percent(100) + ); + assert_eq!( + one * SignedDecimal::percent(1000), + SignedDecimal::percent(1000) + ); + assert_eq!(one * SignedDecimal::MAX, SignedDecimal::MAX); + assert_eq!(SignedDecimal::percent(0) * one, SignedDecimal::percent(0)); + assert_eq!(SignedDecimal::percent(1) * one, SignedDecimal::percent(1)); + assert_eq!(SignedDecimal::percent(10) * one, SignedDecimal::percent(10)); + assert_eq!( + SignedDecimal::percent(100) * one, + SignedDecimal::percent(100) + ); + assert_eq!( + SignedDecimal::percent(1000) * one, + SignedDecimal::percent(1000) + ); + assert_eq!(SignedDecimal::MAX * one, SignedDecimal::MAX); + assert_eq!(SignedDecimal::percent(-1) * one, SignedDecimal::percent(-1)); + assert_eq!( + one * SignedDecimal::percent(-10), + SignedDecimal::percent(-10) + ); + + // double + assert_eq!(two * SignedDecimal::percent(0), SignedDecimal::percent(0)); + assert_eq!(two * SignedDecimal::percent(1), SignedDecimal::percent(2)); + assert_eq!(two * SignedDecimal::percent(10), SignedDecimal::percent(20)); + assert_eq!( + two * SignedDecimal::percent(100), + SignedDecimal::percent(200) + ); + assert_eq!( + two * SignedDecimal::percent(1000), + SignedDecimal::percent(2000) + ); + assert_eq!(SignedDecimal::percent(0) * two, SignedDecimal::percent(0)); + assert_eq!(SignedDecimal::percent(1) * two, SignedDecimal::percent(2)); + assert_eq!(SignedDecimal::percent(10) * two, SignedDecimal::percent(20)); + assert_eq!( + SignedDecimal::percent(100) * two, + SignedDecimal::percent(200) + ); + assert_eq!( + SignedDecimal::percent(1000) * two, + SignedDecimal::percent(2000) + ); + assert_eq!(SignedDecimal::percent(-1) * two, SignedDecimal::percent(-2)); + assert_eq!( + two * SignedDecimal::new(Int128::MIN / Int128::new(2)), + SignedDecimal::MIN + ); + + // half + assert_eq!(half * SignedDecimal::percent(0), SignedDecimal::percent(0)); + assert_eq!(half * SignedDecimal::percent(1), SignedDecimal::permille(5)); + assert_eq!(half * SignedDecimal::percent(10), SignedDecimal::percent(5)); + assert_eq!( + half * SignedDecimal::percent(100), + SignedDecimal::percent(50) + ); + assert_eq!( + half * SignedDecimal::percent(1000), + SignedDecimal::percent(500) + ); + assert_eq!(SignedDecimal::percent(0) * half, SignedDecimal::percent(0)); + assert_eq!(SignedDecimal::percent(1) * half, SignedDecimal::permille(5)); + assert_eq!(SignedDecimal::percent(10) * half, SignedDecimal::percent(5)); + assert_eq!( + SignedDecimal::percent(100) * half, + SignedDecimal::percent(50) + ); + assert_eq!( + SignedDecimal::percent(1000) * half, + SignedDecimal::percent(500) + ); + + // Move left + let a = dec("123.127726548762582"); + assert_eq!(a * dec("1"), dec("123.127726548762582")); + assert_eq!(a * dec("10"), dec("1231.27726548762582")); + assert_eq!(a * dec("100"), dec("12312.7726548762582")); + assert_eq!(a * dec("1000"), dec("123127.726548762582")); + assert_eq!(a * dec("1000000"), dec("123127726.548762582")); + assert_eq!(a * dec("1000000000"), dec("123127726548.762582")); + assert_eq!(a * dec("1000000000000"), dec("123127726548762.582")); + assert_eq!(a * dec("1000000000000000"), dec("123127726548762582")); + assert_eq!(a * dec("1000000000000000000"), dec("123127726548762582000")); + assert_eq!(dec("1") * a, dec("123.127726548762582")); + assert_eq!(dec("10") * a, dec("1231.27726548762582")); + assert_eq!(dec("100") * a, dec("12312.7726548762582")); + assert_eq!(dec("1000") * a, dec("123127.726548762582")); + assert_eq!(dec("1000000") * a, dec("123127726.548762582")); + assert_eq!(dec("1000000000") * a, dec("123127726548.762582")); + assert_eq!(dec("1000000000000") * a, dec("123127726548762.582")); + assert_eq!(dec("1000000000000000") * a, dec("123127726548762582")); + assert_eq!(dec("1000000000000000000") * a, dec("123127726548762582000")); + assert_eq!( + dec("-1000000000000000000") * a, + dec("-123127726548762582000") + ); + + // Move right + let max = SignedDecimal::MAX; + assert_eq!( + max * dec("1.0"), + dec("170141183460469231731.687303715884105727") + ); + assert_eq!( + max * dec("0.1"), + dec("17014118346046923173.168730371588410572") + ); + assert_eq!( + max * dec("0.01"), + dec("1701411834604692317.316873037158841057") + ); + assert_eq!( + max * dec("0.001"), + dec("170141183460469231.731687303715884105") + ); + assert_eq!( + max * dec("0.000001"), + dec("170141183460469.231731687303715884") + ); + assert_eq!( + max * dec("0.000000001"), + dec("170141183460.469231731687303715") + ); + assert_eq!( + max * dec("0.000000000001"), + dec("170141183.460469231731687303") + ); + assert_eq!( + max * dec("0.000000000000001"), + dec("170141.183460469231731687") + ); + assert_eq!( + max * dec("0.000000000000000001"), + dec("170.141183460469231731") + ); + + // works for refs + let a = SignedDecimal::percent(20); + let b = SignedDecimal::percent(30); + let expected = SignedDecimal::percent(6); + assert_eq!(a * b, expected); + assert_eq!(&a * b, expected); + assert_eq!(a * &b, expected); + assert_eq!(&a * &b, expected); + } + + #[test] + fn signed_decimal_mul_assign_works() { + let mut a = SignedDecimal::percent(15); + a *= SignedDecimal::percent(60); + assert_eq!(a, SignedDecimal::percent(9)); + + // works for refs + let mut a = SignedDecimal::percent(50); + let b = SignedDecimal::percent(20); + a *= &b; + assert_eq!(a, SignedDecimal::percent(10)); + } + + #[test] + #[should_panic(expected = "attempt to multiply with overflow")] + fn signed_decimal_mul_overflow_panics() { + let _value = SignedDecimal::MAX * SignedDecimal::percent(101); + } + + #[test] + fn signed_decimal_checked_mul() { + let test_data = [ + (SignedDecimal::zero(), SignedDecimal::zero()), + (SignedDecimal::zero(), SignedDecimal::one()), + (SignedDecimal::one(), SignedDecimal::zero()), + (SignedDecimal::percent(10), SignedDecimal::zero()), + (SignedDecimal::percent(10), SignedDecimal::percent(5)), + (SignedDecimal::MAX, SignedDecimal::one()), + ( + SignedDecimal::MAX / Int128::new(2), + SignedDecimal::percent(200), + ), + (SignedDecimal::permille(6), SignedDecimal::permille(13)), + (SignedDecimal::permille(-6), SignedDecimal::permille(0)), + (SignedDecimal::MAX, SignedDecimal::negative_one()), + ]; + + // The regular core::ops::Mul is our source of truth for these tests. + for (x, y) in test_data.into_iter() { + assert_eq!(x * y, x.checked_mul(y).unwrap()); + } + } + + #[test] + fn signed_decimal_checked_mul_overflow() { + assert_eq!( + SignedDecimal::MAX.checked_mul(SignedDecimal::percent(200)), + Err(OverflowError::new(OverflowOperation::Mul)) + ); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_implements_div() { + let one = SignedDecimal::one(); + let two = one + one; + let half = SignedDecimal::percent(50); + + // 1/x and x/1 + assert_eq!( + one / SignedDecimal::percent(1), + SignedDecimal::percent(10_000) + ); + assert_eq!( + one / SignedDecimal::percent(10), + SignedDecimal::percent(1_000) + ); + assert_eq!( + one / SignedDecimal::percent(100), + SignedDecimal::percent(100) + ); + assert_eq!( + one / SignedDecimal::percent(1000), + SignedDecimal::percent(10) + ); + assert_eq!(SignedDecimal::percent(0) / one, SignedDecimal::percent(0)); + assert_eq!(SignedDecimal::percent(1) / one, SignedDecimal::percent(1)); + assert_eq!(SignedDecimal::percent(10) / one, SignedDecimal::percent(10)); + assert_eq!( + SignedDecimal::percent(100) / one, + SignedDecimal::percent(100) + ); + assert_eq!( + SignedDecimal::percent(1000) / one, + SignedDecimal::percent(1000) + ); + assert_eq!( + one / SignedDecimal::percent(-1), + SignedDecimal::percent(-10_000) + ); + assert_eq!( + one / SignedDecimal::percent(-10), + SignedDecimal::percent(-1_000) + ); + + // double + assert_eq!( + two / SignedDecimal::percent(1), + SignedDecimal::percent(20_000) + ); + assert_eq!( + two / SignedDecimal::percent(10), + SignedDecimal::percent(2_000) + ); + assert_eq!( + two / SignedDecimal::percent(100), + SignedDecimal::percent(200) + ); + assert_eq!( + two / SignedDecimal::percent(1000), + SignedDecimal::percent(20) + ); + assert_eq!(SignedDecimal::percent(0) / two, SignedDecimal::percent(0)); + assert_eq!(SignedDecimal::percent(1) / two, dec("0.005")); + assert_eq!(SignedDecimal::percent(10) / two, SignedDecimal::percent(5)); + assert_eq!( + SignedDecimal::percent(100) / two, + SignedDecimal::percent(50) + ); + assert_eq!( + SignedDecimal::percent(1000) / two, + SignedDecimal::percent(500) + ); + assert_eq!( + two / SignedDecimal::percent(-1), + SignedDecimal::percent(-20_000) + ); + assert_eq!( + SignedDecimal::percent(-10000) / two, + SignedDecimal::percent(-5000) + ); + + // half + assert_eq!( + half / SignedDecimal::percent(1), + SignedDecimal::percent(5_000) + ); + assert_eq!( + half / SignedDecimal::percent(10), + SignedDecimal::percent(500) + ); + assert_eq!( + half / SignedDecimal::percent(100), + SignedDecimal::percent(50) + ); + assert_eq!( + half / SignedDecimal::percent(1000), + SignedDecimal::percent(5) + ); + assert_eq!(SignedDecimal::percent(0) / half, SignedDecimal::percent(0)); + assert_eq!(SignedDecimal::percent(1) / half, SignedDecimal::percent(2)); + assert_eq!( + SignedDecimal::percent(10) / half, + SignedDecimal::percent(20) + ); + assert_eq!( + SignedDecimal::percent(100) / half, + SignedDecimal::percent(200) + ); + assert_eq!( + SignedDecimal::percent(1000) / half, + SignedDecimal::percent(2000) + ); + + // Move right + let a = dec("123127726548762582"); + assert_eq!(a / dec("1"), dec("123127726548762582")); + assert_eq!(a / dec("10"), dec("12312772654876258.2")); + assert_eq!(a / dec("100"), dec("1231277265487625.82")); + assert_eq!(a / dec("1000"), dec("123127726548762.582")); + assert_eq!(a / dec("1000000"), dec("123127726548.762582")); + assert_eq!(a / dec("1000000000"), dec("123127726.548762582")); + assert_eq!(a / dec("1000000000000"), dec("123127.726548762582")); + assert_eq!(a / dec("1000000000000000"), dec("123.127726548762582")); + assert_eq!(a / dec("1000000000000000000"), dec("0.123127726548762582")); + assert_eq!(dec("1") / a, dec("0.000000000000000008")); + assert_eq!(dec("10") / a, dec("0.000000000000000081")); + assert_eq!(dec("100") / a, dec("0.000000000000000812")); + assert_eq!(dec("1000") / a, dec("0.000000000000008121")); + assert_eq!(dec("1000000") / a, dec("0.000000000008121647")); + assert_eq!(dec("1000000000") / a, dec("0.000000008121647560")); + assert_eq!(dec("1000000000000") / a, dec("0.000008121647560868")); + assert_eq!(dec("1000000000000000") / a, dec("0.008121647560868164")); + assert_eq!(dec("1000000000000000000") / a, dec("8.121647560868164773")); + // negative + let a = dec("-123127726548762582"); + assert_eq!(a / dec("1"), dec("-123127726548762582")); + assert_eq!(a / dec("10"), dec("-12312772654876258.2")); + assert_eq!(a / dec("100"), dec("-1231277265487625.82")); + assert_eq!(a / dec("1000"), dec("-123127726548762.582")); + assert_eq!(a / dec("1000000"), dec("-123127726548.762582")); + assert_eq!(a / dec("1000000000"), dec("-123127726.548762582")); + assert_eq!(a / dec("1000000000000"), dec("-123127.726548762582")); + assert_eq!(a / dec("1000000000000000"), dec("-123.127726548762582")); + assert_eq!(a / dec("1000000000000000000"), dec("-0.123127726548762582")); + assert_eq!(dec("1") / a, dec("-0.000000000000000008")); + + // Move left + let a = dec("0.123127726548762582"); + assert_eq!(a / dec("1.0"), dec("0.123127726548762582")); + assert_eq!(a / dec("0.1"), dec("1.23127726548762582")); + assert_eq!(a / dec("0.01"), dec("12.3127726548762582")); + assert_eq!(a / dec("0.001"), dec("123.127726548762582")); + assert_eq!(a / dec("0.000001"), dec("123127.726548762582")); + assert_eq!(a / dec("0.000000001"), dec("123127726.548762582")); + assert_eq!(a / dec("0.000000000001"), dec("123127726548.762582")); + assert_eq!(a / dec("0.000000000000001"), dec("123127726548762.582")); + assert_eq!(a / dec("0.000000000000000001"), dec("123127726548762582")); + // negative + let a = dec("-0.123127726548762582"); + assert_eq!(a / dec("1.0"), dec("-0.123127726548762582")); + assert_eq!(a / dec("0.1"), dec("-1.23127726548762582")); + assert_eq!(a / dec("0.01"), dec("-12.3127726548762582")); + assert_eq!(a / dec("0.001"), dec("-123.127726548762582")); + assert_eq!(a / dec("0.000001"), dec("-123127.726548762582")); + assert_eq!(a / dec("0.000000001"), dec("-123127726.548762582")); + + assert_eq!( + SignedDecimal::percent(15) / SignedDecimal::percent(60), + SignedDecimal::percent(25) + ); + + // works for refs + let a = SignedDecimal::percent(100); + let b = SignedDecimal::percent(20); + let expected = SignedDecimal::percent(500); + assert_eq!(a / b, expected); + assert_eq!(&a / b, expected); + assert_eq!(a / &b, expected); + assert_eq!(&a / &b, expected); + } + + #[test] + fn signed_decimal_div_assign_works() { + let mut a = SignedDecimal::percent(15); + a /= SignedDecimal::percent(20); + assert_eq!(a, SignedDecimal::percent(75)); + + // works for refs + let mut a = SignedDecimal::percent(50); + let b = SignedDecimal::percent(20); + a /= &b; + assert_eq!(a, SignedDecimal::percent(250)); + } + + #[test] + #[should_panic(expected = "Division failed - multiplication overflow")] + fn signed_decimal_div_overflow_panics() { + let _value = SignedDecimal::MAX / SignedDecimal::percent(10); + } + + #[test] + #[should_panic(expected = "Division failed - denominator must not be zero")] + fn signed_decimal_div_by_zero_panics() { + let _value = SignedDecimal::one() / SignedDecimal::zero(); + } + + #[test] + fn signed_decimal_int128_division() { + // a/b + let left = SignedDecimal::percent(150); // 1.5 + let right = Int128::new(3); + assert_eq!(left / right, SignedDecimal::percent(50)); + + // negative + let left = SignedDecimal::percent(-150); // -1.5 + let right = Int128::new(3); + assert_eq!(left / right, SignedDecimal::percent(-50)); + + // 0/a + let left = SignedDecimal::zero(); + let right = Int128::new(300); + assert_eq!(left / right, SignedDecimal::zero()); + } + + #[test] + #[should_panic] + fn signed_decimal_int128_divide_by_zero() { + let left = SignedDecimal::percent(150); // 1.5 + let right = Int128::new(0); + let _result = left / right; + } + + #[test] + fn signed_decimal_int128_div_assign() { + // a/b + let mut dec = SignedDecimal::percent(150); // 1.5 + dec /= Int128::new(3); + assert_eq!(dec, SignedDecimal::percent(50)); + + // 0/a + let mut dec = SignedDecimal::zero(); + dec /= Int128::new(300); + assert_eq!(dec, SignedDecimal::zero()); + } + + #[test] + #[should_panic] + fn signed_decimal_int128_div_assign_by_zero() { + // a/0 + let mut dec = SignedDecimal::percent(50); + dec /= Int128::new(0); + } + + #[test] + fn signed_decimal_checked_pow() { + for exp in 0..10 { + assert_eq!( + SignedDecimal::one().checked_pow(exp).unwrap(), + SignedDecimal::one() + ); + } + + // This case is mathematically undefined but we ensure consistency with Rust standard types + // https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=20df6716048e77087acd40194b233494 + assert_eq!( + SignedDecimal::zero().checked_pow(0).unwrap(), + SignedDecimal::one() + ); + + for exp in 1..10 { + assert_eq!( + SignedDecimal::zero().checked_pow(exp).unwrap(), + SignedDecimal::zero() + ); + } + + for exp in 1..10 { + assert_eq!( + SignedDecimal::negative_one().checked_pow(exp).unwrap(), + // alternates between 1 and -1 + if exp % 2 == 0 { + SignedDecimal::one() + } else { + SignedDecimal::negative_one() + } + ) + } + + for num in &[ + SignedDecimal::percent(50), + SignedDecimal::percent(99), + SignedDecimal::percent(200), + ] { + assert_eq!(num.checked_pow(0).unwrap(), SignedDecimal::one()) + } + + assert_eq!( + SignedDecimal::percent(20).checked_pow(2).unwrap(), + SignedDecimal::percent(4) + ); + + assert_eq!( + SignedDecimal::percent(20).checked_pow(3).unwrap(), + SignedDecimal::permille(8) + ); + + assert_eq!( + SignedDecimal::percent(200).checked_pow(4).unwrap(), + SignedDecimal::percent(1600) + ); + + assert_eq!( + SignedDecimal::percent(200).checked_pow(4).unwrap(), + SignedDecimal::percent(1600) + ); + + assert_eq!( + SignedDecimal::percent(700).checked_pow(5).unwrap(), + SignedDecimal::percent(1680700) + ); + + assert_eq!( + SignedDecimal::percent(700).checked_pow(8).unwrap(), + SignedDecimal::percent(576480100) + ); + + assert_eq!( + SignedDecimal::percent(700).checked_pow(10).unwrap(), + SignedDecimal::percent(28247524900) + ); + + assert_eq!( + SignedDecimal::percent(120).checked_pow(123).unwrap(), + SignedDecimal(5486473221892422150877397607i128.into()) + ); + + assert_eq!( + SignedDecimal::percent(10).checked_pow(2).unwrap(), + SignedDecimal(10000000000000000i128.into()) + ); + + assert_eq!( + SignedDecimal::percent(10).checked_pow(18).unwrap(), + SignedDecimal(1i128.into()) + ); + + let decimals = [ + SignedDecimal::percent(-50), + SignedDecimal::percent(-99), + SignedDecimal::percent(-200), + ]; + let exponents = [1, 2, 3, 4, 5, 8, 10]; + + for d in decimals { + for e in exponents { + // use multiplication as source of truth + let mut mul = Ok(d); + for _ in 1..e { + mul = mul.and_then(|mul| mul.checked_mul(d)); + } + assert_eq!(mul, d.checked_pow(e)); + } + } + } + + #[test] + fn signed_decimal_checked_pow_overflow() { + assert_eq!( + SignedDecimal::MAX.checked_pow(2), + Err(OverflowError::new(OverflowOperation::Pow)) + ); + } + + #[test] + fn signed_decimal_to_string() { + // Integers + assert_eq!(SignedDecimal::zero().to_string(), "0"); + assert_eq!(SignedDecimal::one().to_string(), "1"); + assert_eq!(SignedDecimal::percent(500).to_string(), "5"); + assert_eq!(SignedDecimal::percent(-500).to_string(), "-5"); + + // SignedDecimals + assert_eq!(SignedDecimal::percent(125).to_string(), "1.25"); + assert_eq!(SignedDecimal::percent(42638).to_string(), "426.38"); + assert_eq!(SignedDecimal::percent(3).to_string(), "0.03"); + assert_eq!(SignedDecimal::permille(987).to_string(), "0.987"); + assert_eq!(SignedDecimal::percent(-125).to_string(), "-1.25"); + assert_eq!(SignedDecimal::percent(-42638).to_string(), "-426.38"); + assert_eq!(SignedDecimal::percent(-3).to_string(), "-0.03"); + assert_eq!(SignedDecimal::permille(-987).to_string(), "-0.987"); + + assert_eq!( + SignedDecimal(Int128::from(1i128)).to_string(), + "0.000000000000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(10i128)).to_string(), + "0.00000000000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(100i128)).to_string(), + "0.0000000000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(1000i128)).to_string(), + "0.000000000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(10000i128)).to_string(), + "0.00000000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(100000i128)).to_string(), + "0.0000000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(1000000i128)).to_string(), + "0.000000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(10000000i128)).to_string(), + "0.00000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(100000000i128)).to_string(), + "0.0000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(1000000000i128)).to_string(), + "0.000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(10000000000i128)).to_string(), + "0.00000001" + ); + assert_eq!( + SignedDecimal(Int128::from(100000000000i128)).to_string(), + "0.0000001" + ); + assert_eq!( + SignedDecimal(Int128::from(10000000000000i128)).to_string(), + "0.00001" + ); + assert_eq!( + SignedDecimal(Int128::from(100000000000000i128)).to_string(), + "0.0001" + ); + assert_eq!( + SignedDecimal(Int128::from(1000000000000000i128)).to_string(), + "0.001" + ); + assert_eq!( + SignedDecimal(Int128::from(10000000000000000i128)).to_string(), + "0.01" + ); + assert_eq!( + SignedDecimal(Int128::from(100000000000000000i128)).to_string(), + "0.1" + ); + assert_eq!( + SignedDecimal(Int128::from(-1i128)).to_string(), + "-0.000000000000000001" + ); + assert_eq!( + SignedDecimal(Int128::from(-100000000000000i128)).to_string(), + "-0.0001" + ); + assert_eq!( + SignedDecimal(Int128::from(-100000000000000000i128)).to_string(), + "-0.1" + ); + } + + #[test] + fn signed_decimal_iter_sum() { + let items = vec![ + SignedDecimal::zero(), + SignedDecimal(Int128::from(2i128)), + SignedDecimal(Int128::from(2i128)), + SignedDecimal(Int128::from(-2i128)), + ]; + assert_eq!( + items.iter().sum::(), + SignedDecimal(Int128::from(2i128)) + ); + assert_eq!( + items.into_iter().sum::(), + SignedDecimal(Int128::from(2i128)) + ); + + let empty: Vec = vec![]; + assert_eq!(SignedDecimal::zero(), empty.iter().sum::()); + } + + #[test] + fn signed_decimal_serialize() { + assert_eq!( + serde_json::to_vec(&SignedDecimal::zero()).unwrap(), + br#""0""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal::one()).unwrap(), + br#""1""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal::percent(8)).unwrap(), + br#""0.08""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal::percent(87)).unwrap(), + br#""0.87""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal::percent(876)).unwrap(), + br#""8.76""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal::percent(8765)).unwrap(), + br#""87.65""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal::percent(-87654)).unwrap(), + br#""-876.54""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal::negative_one()).unwrap(), + br#""-1""# + ); + assert_eq!( + serde_json::to_vec(&-SignedDecimal::percent(8)).unwrap(), + br#""-0.08""# + ); + } + + #[test] + fn signed_decimal_deserialize() { + assert_eq!( + serde_json::from_slice::(br#""0""#).unwrap(), + SignedDecimal::zero() + ); + assert_eq!( + serde_json::from_slice::(br#""1""#).unwrap(), + SignedDecimal::one() + ); + assert_eq!( + serde_json::from_slice::(br#""000""#).unwrap(), + SignedDecimal::zero() + ); + assert_eq!( + serde_json::from_slice::(br#""001""#).unwrap(), + SignedDecimal::one() + ); + + assert_eq!( + serde_json::from_slice::(br#""0.08""#).unwrap(), + SignedDecimal::percent(8) + ); + assert_eq!( + serde_json::from_slice::(br#""0.87""#).unwrap(), + SignedDecimal::percent(87) + ); + assert_eq!( + serde_json::from_slice::(br#""8.76""#).unwrap(), + SignedDecimal::percent(876) + ); + assert_eq!( + serde_json::from_slice::(br#""87.65""#).unwrap(), + SignedDecimal::percent(8765) + ); + + // negative numbers + assert_eq!( + serde_json::from_slice::(br#""-0""#).unwrap(), + SignedDecimal::zero() + ); + assert_eq!( + serde_json::from_slice::(br#""-1""#).unwrap(), + SignedDecimal::negative_one() + ); + assert_eq!( + serde_json::from_slice::(br#""-001""#).unwrap(), + SignedDecimal::negative_one() + ); + assert_eq!( + serde_json::from_slice::(br#""-0.08""#).unwrap(), + SignedDecimal::percent(-8) + ); + } + + #[test] + fn signed_decimal_abs_diff_works() { + let a = SignedDecimal::percent(285); + let b = SignedDecimal::percent(200); + let expected = Decimal::percent(85); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + + let a = SignedDecimal::percent(-200); + let b = SignedDecimal::percent(200); + let expected = Decimal::percent(400); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + + let a = SignedDecimal::percent(-200); + let b = SignedDecimal::percent(-240); + let expected = Decimal::percent(40); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_rem_works() { + // 4.02 % 1.11 = 0.69 + assert_eq!( + SignedDecimal::percent(402) % SignedDecimal::percent(111), + SignedDecimal::percent(69) + ); + + // 15.25 % 4 = 3.25 + assert_eq!( + SignedDecimal::percent(1525) % SignedDecimal::percent(400), + SignedDecimal::percent(325) + ); + + // -20.25 % 5 = -25 + assert_eq!( + SignedDecimal::percent(-2025) % SignedDecimal::percent(500), + SignedDecimal::percent(-25) + ); + + let a = SignedDecimal::percent(318); + let b = SignedDecimal::percent(317); + let expected = SignedDecimal::percent(1); + assert_eq!(a % b, expected); + assert_eq!(a % &b, expected); + assert_eq!(&a % b, expected); + assert_eq!(&a % &b, expected); + } + + #[test] + fn signed_decimal_rem_assign_works() { + let mut a = SignedDecimal::percent(17673); + a %= SignedDecimal::percent(2362); + assert_eq!(a, SignedDecimal::percent(1139)); // 176.73 % 23.62 = 11.39 + + let mut a = SignedDecimal::percent(4262); + let b = SignedDecimal::percent(1270); + a %= &b; + assert_eq!(a, SignedDecimal::percent(452)); // 42.62 % 12.7 = 4.52 + + let mut a = SignedDecimal::percent(-4262); + let b = SignedDecimal::percent(1270); + a %= &b; + assert_eq!(a, SignedDecimal::percent(-452)); // -42.62 % 12.7 = -4.52 + } + + #[test] + #[should_panic(expected = "divisor of zero")] + fn signed_decimal_rem_panics_for_zero() { + let _ = SignedDecimal::percent(777) % SignedDecimal::zero(); + } + + #[test] + fn signed_decimal_checked_methods() { + // checked add + assert_eq!( + SignedDecimal::percent(402) + .checked_add(SignedDecimal::percent(111)) + .unwrap(), + SignedDecimal::percent(513) + ); + assert!(matches!( + SignedDecimal::MAX.checked_add(SignedDecimal::percent(1)), + Err(OverflowError { .. }) + )); + assert!(matches!( + SignedDecimal::MIN.checked_add(SignedDecimal::percent(-1)), + Err(OverflowError { .. }) + )); + + // checked sub + assert_eq!( + SignedDecimal::percent(1111) + .checked_sub(SignedDecimal::percent(111)) + .unwrap(), + SignedDecimal::percent(1000) + ); + assert_eq!( + SignedDecimal::zero() + .checked_sub(SignedDecimal::percent(1)) + .unwrap(), + SignedDecimal::percent(-1) + ); + assert!(matches!( + SignedDecimal::MIN.checked_sub(SignedDecimal::percent(1)), + Err(OverflowError { .. }) + )); + assert!(matches!( + SignedDecimal::MAX.checked_sub(SignedDecimal::percent(-1)), + Err(OverflowError { .. }) + )); + + // checked div + assert_eq!( + SignedDecimal::percent(30) + .checked_div(SignedDecimal::percent(200)) + .unwrap(), + SignedDecimal::percent(15) + ); + assert_eq!( + SignedDecimal::percent(88) + .checked_div(SignedDecimal::percent(20)) + .unwrap(), + SignedDecimal::percent(440) + ); + assert!(matches!( + SignedDecimal::MAX.checked_div(SignedDecimal::zero()), + Err(CheckedFromRatioError::DivideByZero) + )); + assert!(matches!( + SignedDecimal::MAX.checked_div(SignedDecimal::percent(1)), + Err(CheckedFromRatioError::Overflow) + )); + assert_eq!( + SignedDecimal::percent(-88) + .checked_div(SignedDecimal::percent(20)) + .unwrap(), + SignedDecimal::percent(-440) + ); + assert_eq!( + SignedDecimal::percent(-88) + .checked_div(SignedDecimal::percent(-20)) + .unwrap(), + SignedDecimal::percent(440) + ); + + // checked rem + assert_eq!( + SignedDecimal::percent(402) + .checked_rem(SignedDecimal::percent(111)) + .unwrap(), + SignedDecimal::percent(69) + ); + assert_eq!( + SignedDecimal::percent(1525) + .checked_rem(SignedDecimal::percent(400)) + .unwrap(), + SignedDecimal::percent(325) + ); + assert_eq!( + SignedDecimal::percent(-1525) + .checked_rem(SignedDecimal::percent(400)) + .unwrap(), + SignedDecimal::percent(-325) + ); + assert_eq!( + SignedDecimal::percent(-1525) + .checked_rem(SignedDecimal::percent(-400)) + .unwrap(), + SignedDecimal::percent(-325) + ); + assert!(matches!( + SignedDecimal::MAX.checked_rem(SignedDecimal::zero()), + Err(DivideByZeroError { .. }) + )); + } + + #[test] + fn signed_decimal_pow_works() { + assert_eq!( + SignedDecimal::percent(200).pow(2), + SignedDecimal::percent(400) + ); + assert_eq!( + SignedDecimal::percent(-200).pow(2), + SignedDecimal::percent(400) + ); + assert_eq!( + SignedDecimal::percent(-200).pow(3), + SignedDecimal::percent(-800) + ); + assert_eq!( + SignedDecimal::percent(200).pow(10), + SignedDecimal::percent(102400) + ); + } + + #[test] + #[should_panic] + fn signed_decimal_pow_overflow_panics() { + _ = SignedDecimal::MAX.pow(2u32); + } + + #[test] + fn signed_decimal_saturating_works() { + assert_eq!( + SignedDecimal::percent(200).saturating_add(SignedDecimal::percent(200)), + SignedDecimal::percent(400) + ); + assert_eq!( + SignedDecimal::percent(-200).saturating_add(SignedDecimal::percent(200)), + SignedDecimal::zero() + ); + assert_eq!( + SignedDecimal::percent(-200).saturating_add(SignedDecimal::percent(-200)), + SignedDecimal::percent(-400) + ); + assert_eq!( + SignedDecimal::MAX.saturating_add(SignedDecimal::percent(200)), + SignedDecimal::MAX + ); + assert_eq!( + SignedDecimal::MIN.saturating_add(SignedDecimal::percent(-1)), + SignedDecimal::MIN + ); + assert_eq!( + SignedDecimal::percent(200).saturating_sub(SignedDecimal::percent(100)), + SignedDecimal::percent(100) + ); + assert_eq!( + SignedDecimal::percent(-200).saturating_sub(SignedDecimal::percent(100)), + SignedDecimal::percent(-300) + ); + assert_eq!( + SignedDecimal::percent(-200).saturating_sub(SignedDecimal::percent(-100)), + SignedDecimal::percent(-100) + ); + assert_eq!( + SignedDecimal::zero().saturating_sub(SignedDecimal::percent(200)), + SignedDecimal::from_str("-2").unwrap() + ); + assert_eq!( + SignedDecimal::MIN.saturating_sub(SignedDecimal::percent(200)), + SignedDecimal::MIN + ); + assert_eq!( + SignedDecimal::MAX.saturating_sub(SignedDecimal::percent(-200)), + SignedDecimal::MAX + ); + assert_eq!( + SignedDecimal::percent(200).saturating_mul(SignedDecimal::percent(50)), + SignedDecimal::percent(100) + ); + assert_eq!( + SignedDecimal::percent(-200).saturating_mul(SignedDecimal::percent(50)), + SignedDecimal::percent(-100) + ); + assert_eq!( + SignedDecimal::percent(-200).saturating_mul(SignedDecimal::percent(-50)), + SignedDecimal::percent(100) + ); + assert_eq!( + SignedDecimal::MAX.saturating_mul(SignedDecimal::percent(200)), + SignedDecimal::MAX + ); + assert_eq!( + SignedDecimal::MIN.saturating_mul(SignedDecimal::percent(200)), + SignedDecimal::MIN + ); + assert_eq!( + SignedDecimal::MIN.saturating_mul(SignedDecimal::percent(-200)), + SignedDecimal::MAX + ); + assert_eq!( + SignedDecimal::percent(400).saturating_pow(2u32), + SignedDecimal::percent(1600) + ); + assert_eq!(SignedDecimal::MAX.saturating_pow(2u32), SignedDecimal::MAX); + assert_eq!(SignedDecimal::MAX.saturating_pow(3u32), SignedDecimal::MAX); + assert_eq!(SignedDecimal::MIN.saturating_pow(2u32), SignedDecimal::MAX); + assert_eq!(SignedDecimal::MIN.saturating_pow(3u32), SignedDecimal::MIN); + } + + #[test] + fn signed_decimal_rounding() { + assert_eq!(SignedDecimal::one().floor(), SignedDecimal::one()); + assert_eq!(SignedDecimal::percent(150).floor(), SignedDecimal::one()); + assert_eq!(SignedDecimal::percent(199).floor(), SignedDecimal::one()); + assert_eq!( + SignedDecimal::percent(200).floor(), + SignedDecimal::percent(200) + ); + assert_eq!(SignedDecimal::percent(99).floor(), SignedDecimal::zero()); + assert_eq!( + SignedDecimal(Int128::from(1i128)).floor(), + SignedDecimal::zero() + ); + assert_eq!( + SignedDecimal(Int128::from(-1i128)).floor(), + SignedDecimal::negative_one() + ); + assert_eq!( + SignedDecimal::permille(-1234).floor(), + SignedDecimal::percent(-200) + ); + + assert_eq!(SignedDecimal::one().ceil(), SignedDecimal::one()); + assert_eq!( + SignedDecimal::percent(150).ceil(), + SignedDecimal::percent(200) + ); + assert_eq!( + SignedDecimal::percent(199).ceil(), + SignedDecimal::percent(200) + ); + assert_eq!(SignedDecimal::percent(99).ceil(), SignedDecimal::one()); + assert_eq!( + SignedDecimal(Int128::from(1i128)).ceil(), + SignedDecimal::one() + ); + assert_eq!( + SignedDecimal(Int128::from(-1i128)).ceil(), + SignedDecimal::zero() + ); + assert_eq!( + SignedDecimal::permille(-1234).ceil(), + SignedDecimal::negative_one() + ); + + assert_eq!(SignedDecimal::one().trunc(), SignedDecimal::one()); + assert_eq!(SignedDecimal::percent(150).trunc(), SignedDecimal::one()); + assert_eq!(SignedDecimal::percent(199).trunc(), SignedDecimal::one()); + assert_eq!( + SignedDecimal::percent(200).trunc(), + SignedDecimal::percent(200) + ); + assert_eq!(SignedDecimal::percent(99).trunc(), SignedDecimal::zero()); + assert_eq!( + SignedDecimal(Int128::from(1i128)).trunc(), + SignedDecimal::zero() + ); + assert_eq!( + SignedDecimal(Int128::from(-1i128)).trunc(), + SignedDecimal::zero() + ); + assert_eq!( + SignedDecimal::permille(-1234).trunc(), + SignedDecimal::negative_one() + ); + } + + #[test] + #[should_panic(expected = "attempt to ceil with overflow")] + fn signed_decimal_ceil_panics() { + let _ = SignedDecimal::MAX.ceil(); + } + + #[test] + #[should_panic(expected = "attempt to floor with overflow")] + fn signed_decimal_floor_panics() { + let _ = SignedDecimal::MIN.floor(); + } + + #[test] + fn signed_decimal_checked_ceil() { + assert_eq!( + SignedDecimal::percent(199).checked_ceil(), + Ok(SignedDecimal::percent(200)) + ); + assert_eq!(SignedDecimal::MAX.checked_ceil(), Err(RoundUpOverflowError)); + } + + #[test] + fn signed_decimal_checked_floor() { + assert_eq!( + SignedDecimal::percent(199).checked_floor(), + Ok(SignedDecimal::one()) + ); + assert_eq!( + SignedDecimal::percent(-199).checked_floor(), + Ok(SignedDecimal::percent(-200)) + ); + assert_eq!( + SignedDecimal::MIN.checked_floor(), + Err(RoundDownOverflowError) + ); + assert_eq!( + SignedDecimal::negative_one().checked_floor(), + Ok(SignedDecimal::negative_one()) + ); + } + + #[test] + fn signed_decimal_to_int_floor_works() { + let d = SignedDecimal::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(12)); + let d = SignedDecimal::from_str("12.345").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(12)); + let d = SignedDecimal::from_str("12.999").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(12)); + let d = SignedDecimal::from_str("0.98451384").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(0)); + let d = SignedDecimal::from_str("-12.000000000000000001").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(-13)); + let d = SignedDecimal::from_str("-12.345").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(-13)); + let d = SignedDecimal::from_str("75.0").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(75)); + let d = SignedDecimal::from_str("0.0001").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(0)); + let d = SignedDecimal::from_str("0.0").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(0)); + let d = SignedDecimal::from_str("-0.0").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(0)); + let d = SignedDecimal::from_str("-0.0001").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(-1)); + let d = SignedDecimal::from_str("-75.0").unwrap(); + assert_eq!(d.to_int_floor(), Int128::new(-75)); + let d = SignedDecimal::MAX; + assert_eq!(d.to_int_floor(), Int128::new(170141183460469231731)); + let d = SignedDecimal::MIN; + assert_eq!(d.to_int_floor(), Int128::new(-170141183460469231732)); + } + + #[test] + fn signed_decimal_to_int_ceil_works() { + let d = SignedDecimal::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_int_ceil(), Int128::new(13)); + let d = SignedDecimal::from_str("12.345").unwrap(); + assert_eq!(d.to_int_ceil(), Int128::new(13)); + let d = SignedDecimal::from_str("12.999").unwrap(); + assert_eq!(d.to_int_ceil(), Int128::new(13)); + let d = SignedDecimal::from_str("-12.000000000000000001").unwrap(); + assert_eq!(d.to_int_ceil(), Int128::new(-12)); + let d = SignedDecimal::from_str("-12.345").unwrap(); + assert_eq!(d.to_int_ceil(), Int128::new(-12)); + + let d = SignedDecimal::from_str("75.0").unwrap(); + assert_eq!(d.to_int_ceil(), Int128::new(75)); + let d = SignedDecimal::from_str("0.0").unwrap(); + assert_eq!(d.to_int_ceil(), Int128::new(0)); + let d = SignedDecimal::from_str("-75.0").unwrap(); + assert_eq!(d.to_int_ceil(), Int128::new(-75)); + + let d = SignedDecimal::MAX; + assert_eq!(d.to_int_ceil(), Int128::new(170141183460469231732)); + let d = SignedDecimal::MIN; + assert_eq!(d.to_int_ceil(), Int128::new(-170141183460469231731)); + } + + #[test] + fn signed_decimal_to_int_trunc_works() { + let d = SignedDecimal::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_int_trunc(), Int128::new(12)); + let d = SignedDecimal::from_str("12.345").unwrap(); + assert_eq!(d.to_int_trunc(), Int128::new(12)); + let d = SignedDecimal::from_str("12.999").unwrap(); + assert_eq!(d.to_int_trunc(), Int128::new(12)); + let d = SignedDecimal::from_str("-12.000000000000000001").unwrap(); + assert_eq!(d.to_int_trunc(), Int128::new(-12)); + let d = SignedDecimal::from_str("-12.345").unwrap(); + assert_eq!(d.to_int_trunc(), Int128::new(-12)); + + let d = SignedDecimal::from_str("75.0").unwrap(); + assert_eq!(d.to_int_trunc(), Int128::new(75)); + let d = SignedDecimal::from_str("0.0").unwrap(); + assert_eq!(d.to_int_trunc(), Int128::new(0)); + let d = SignedDecimal::from_str("-75.0").unwrap(); + assert_eq!(d.to_int_trunc(), Int128::new(-75)); + + let d = SignedDecimal::MAX; + assert_eq!(d.to_int_trunc(), Int128::new(170141183460469231731)); + let d = SignedDecimal::MIN; + assert_eq!(d.to_int_trunc(), Int128::new(-170141183460469231731)); + } + + #[test] + fn signed_decimal_neg_works() { + assert_eq!(-SignedDecimal::percent(50), SignedDecimal::percent(-50)); + assert_eq!(-SignedDecimal::one(), SignedDecimal::negative_one()); + } + + #[test] + fn signed_decimal_partial_eq() { + let test_cases = [ + ("1", "1", true), + ("0.5", "0.5", true), + ("0.5", "0.51", false), + ("0", "0.00000", true), + ("-1", "-1", true), + ("-0.5", "-0.5", true), + ("-0.5", "0.5", false), + ("-0.5", "-0.51", false), + ("-0", "-0.00000", true), + ] + .into_iter() + .map(|(lhs, rhs, expected)| (dec(lhs), dec(rhs), expected)); + + #[allow(clippy::op_ref)] + for (lhs, rhs, expected) in test_cases { + assert_eq!(lhs == rhs, expected); + assert_eq!(&lhs == rhs, expected); + assert_eq!(lhs == &rhs, expected); + assert_eq!(&lhs == &rhs, expected); + } + } + + #[test] + fn signed_decimal_implements_debug() { + let decimal = SignedDecimal::from_str("123.45").unwrap(); + assert_eq!(format!("{decimal:?}"), "SignedDecimal(123.45)"); + + let test_cases = ["5", "5.01", "42", "0", "2", "-0.000001"]; + for s in test_cases { + let decimal = SignedDecimal::from_str(s).unwrap(); + let expected = format!("SignedDecimal({s})"); + assert_eq!(format!("{decimal:?}"), expected); + } + } + + #[test] + fn signed_decimal_can_be_instantiated_from_decimal256() { + let d: SignedDecimal = Decimal256::zero().try_into().unwrap(); + assert_eq!(d, SignedDecimal::zero()); + } + + #[test] + fn signed_decimal_may_fail_when_instantiated_from_decimal256() { + let err = >::try_into(Decimal256::MAX).unwrap_err(); + assert_eq!("SignedDecimalRangeExceeded", format!("{err:?}")); + assert_eq!("SignedDecimal range exceeded", format!("{err}")); + } + + #[test] + fn signed_decimal_can_be_serialized_and_deserialized() { + // properly deserialized + let value: SignedDecimal = serde_json::from_str(r#""123""#).unwrap(); + assert_eq!(SignedDecimal::from_str("123").unwrap(), value); + + // properly serialized + let value = SignedDecimal::from_str("456").unwrap(); + assert_eq!(r#""456""#, serde_json::to_string(&value).unwrap()); + + // invalid: not a string encoded decimal + assert_eq!( + "invalid type: integer `123`, expected string-encoded decimal at line 1 column 3", + serde_json::from_str::("123") + .err() + .unwrap() + .to_string() + ); + + // invalid: not properly defined signed decimal value + assert_eq!( + "Error parsing decimal '1.e': kind: Parsing, error: invalid digit found in string at line 1 column 5", + serde_json::from_str::(r#""1.e""#) + .err() + .unwrap() + .to_string() + ); + } + + #[test] + fn signed_decimal_has_defined_json_schema() { + let schema = schemars::schema_for!(SignedDecimal); + assert_eq!( + "SignedDecimal", + schema.schema.metadata.unwrap().title.unwrap() + ); + } +} diff --git a/packages/std/src/math/signed_decimal_256.rs b/packages/std/src/math/signed_decimal_256.rs new file mode 100644 index 0000000000..bbd74b18b3 --- /dev/null +++ b/packages/std/src/math/signed_decimal_256.rs @@ -0,0 +1,3262 @@ +use alloc::string::ToString; +use core::cmp::Ordering; +use core::fmt::{self, Write}; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Rem, RemAssign, Sub, SubAssign, +}; +use core::str::FromStr; +use serde::{de, ser, Deserialize, Deserializer, Serialize}; + +use crate::errors::{ + CheckedFromRatioError, CheckedMultiplyRatioError, DivideByZeroError, ErrorKind, OverflowError, + OverflowOperation, RoundDownOverflowError, RoundUpOverflowError, StdError, +}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{Decimal, Decimal256, Int512, SignedDecimal, __internal::forward_ref_partial_eq}; + +use super::Fraction; +use super::Int256; + +/// A signed fixed-point decimal value with 18 fractional digits, +/// i.e. SignedDecimal256(1_000_000_000_000_000_000) == 1.0 +/// +/// The greatest possible value that can be represented is +/// 57896044618658097711785492504343953926634992332820282019728.792003956564819967 +/// (which is (2^255 - 1) / 10^18) +/// and the smallest is +/// -57896044618658097711785492504343953926634992332820282019728.792003956564819968 +/// (which is -2^255 / 10^18). +#[derive( + Copy, + Clone, + Default, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Decimal { precision: 256, signed: true })] +pub struct SignedDecimal256(#[schemars(with = "String")] Int256); + +forward_ref_partial_eq!(SignedDecimal256, SignedDecimal256); + +#[derive(Debug, PartialEq, Eq, thiserror::Error)] +#[error("SignedDecimal256 range exceeded")] +pub struct SignedDecimal256RangeExceeded; + +impl SignedDecimal256 { + const DECIMAL_FRACTIONAL: Int256 = // 1*10**18 + Int256::new(1_000_000_000_000_000_000); + const DECIMAL_FRACTIONAL_SQUARED: Int256 = // 1*10**36 + Int256::new(1_000_000_000_000_000_000_000_000_000_000_000_000); + + /// The number of decimal places. Since decimal types are fixed-point rather than + /// floating-point, this is a constant. + pub const DECIMAL_PLACES: u32 = 18; // This needs to be an even number. + + /// The largest value that can be represented by this signed decimal type. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal256; + /// assert_eq!( + /// SignedDecimal256::MAX.to_string(), + /// "57896044618658097711785492504343953926634992332820282019728.792003956564819967" + /// ); + /// ``` + pub const MAX: Self = Self(Int256::MAX); + + /// The smallest value that can be represented by this signed decimal type. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal256; + /// assert_eq!( + /// SignedDecimal256::MIN.to_string(), + /// "-57896044618658097711785492504343953926634992332820282019728.792003956564819968" + /// ); + /// ``` + pub const MIN: Self = Self(Int256::MIN); + + /// Creates a SignedDecimal256(value) + /// This is equivalent to `SignedDecimal256::from_atomics(value, 18)` but usable in a const context. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::{SignedDecimal256, Int256}; + /// assert_eq!(SignedDecimal256::new(Int256::one()).to_string(), "0.000000000000000001"); + /// + /// let atoms = Int256::new(-141_183_460_469_231_731_687_303_715_884_105_727_125); + /// let value = SignedDecimal256::new(atoms); + /// assert_eq!(value.to_string(), "-141183460469231731687.303715884105727125"); + /// ``` + #[inline] + #[must_use] + pub const fn new(value: Int256) -> Self { + Self(value) + } + + /// Creates a SignedDecimal256(Int256(value)) + /// This is equivalent to `SignedDecimal256::from_atomics(value, 18)` but usable in a const context. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal256; + /// assert_eq!(SignedDecimal256::raw(1234i128).to_string(), "0.000000000000001234"); + /// ``` + #[deprecated( + since = "3.0.0", + note = "Use SignedDecimal256::new(Int256::new(value)) instead" + )] + pub const fn raw(value: i128) -> Self { + Self(Int256::new(value)) + } + + /// Create a 1.0 SignedDecimal256 + #[inline] + pub const fn one() -> Self { + Self(Self::DECIMAL_FRACTIONAL) + } + + /// Create a -1.0 SignedDecimal256 + #[inline] + pub const fn negative_one() -> Self { + // -DECIMAL_FRACTIONAL + Self(Int256::new(-1_000_000_000_000_000_000)) + } + + /// Create a 0.0 SignedDecimal256 + #[inline] + pub const fn zero() -> Self { + Self(Int256::zero()) + } + + /// Convert x% into SignedDecimal256 + pub fn percent(x: i64) -> Self { + Self(((x as i128) * 10_000_000_000_000_000).into()) + } + + /// Convert permille (x/1000) into SignedDecimal256 + pub fn permille(x: i64) -> Self { + Self(((x as i128) * 1_000_000_000_000_000).into()) + } + + /// Convert basis points (x/10000) into SignedDecimal256 + pub fn bps(x: i64) -> Self { + Self(((x as i128) * 100_000_000_000_000).into()) + } + + /// Creates a signed decimal from a number of atomic units and the number + /// of decimal places. The inputs will be converted internally to form + /// a signed decimal with 18 decimal places. So the input 123 and 2 will create + /// the decimal 1.23. + /// + /// Using 18 decimal places is slightly more efficient than other values + /// as no internal conversion is necessary. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{SignedDecimal256, Int256}; + /// let a = SignedDecimal256::from_atomics(Int256::from(1234), 3).unwrap(); + /// assert_eq!(a.to_string(), "1.234"); + /// + /// let a = SignedDecimal256::from_atomics(1234i128, 0).unwrap(); + /// assert_eq!(a.to_string(), "1234"); + /// + /// let a = SignedDecimal256::from_atomics(1i64, 18).unwrap(); + /// assert_eq!(a.to_string(), "0.000000000000000001"); + /// + /// let a = SignedDecimal256::from_atomics(-1i64, 18).unwrap(); + /// assert_eq!(a.to_string(), "-0.000000000000000001"); + /// ``` + pub fn from_atomics( + atomics: impl Into, + decimal_places: u32, + ) -> Result { + let atomics = atomics.into(); + let ten = Int256::from(10u64); + Ok(match decimal_places.cmp(&(Self::DECIMAL_PLACES)) { + Ordering::Less => { + let digits = (Self::DECIMAL_PLACES) - decimal_places; // No overflow because decimal_places < DECIMAL_PLACES + let factor = ten.checked_pow(digits).unwrap(); // Safe because digits <= 17 + Self( + atomics + .checked_mul(factor) + .map_err(|_| SignedDecimal256RangeExceeded)?, + ) + } + Ordering::Equal => Self(atomics), + Ordering::Greater => { + let digits = decimal_places - (Self::DECIMAL_PLACES); // No overflow because decimal_places > DECIMAL_PLACES + if let Ok(factor) = ten.checked_pow(digits) { + Self(atomics.checked_div(factor).unwrap()) // Safe because factor cannot be zero + } else { + // In this case `factor` exceeds the Int256 range. + // Any Int256 `x` divided by `factor` with `factor > Int256::MAX` is 0. + // Try e.g. Python3: `(2**128-1) // 2**128` + Self(Int256::zero()) + } + } + }) + } + + /// Returns the ratio (numerator / denominator) as a SignedDecimal256 + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal256; + /// assert_eq!( + /// SignedDecimal256::from_ratio(1, 3).to_string(), + /// "0.333333333333333333" + /// ); + /// ``` + pub fn from_ratio(numerator: impl Into, denominator: impl Into) -> Self { + match SignedDecimal256::checked_from_ratio(numerator, denominator) { + Ok(value) => value, + Err(CheckedFromRatioError::DivideByZero) => { + panic!("Denominator must not be zero") + } + Err(CheckedFromRatioError::Overflow) => panic!("Multiplication overflow"), + } + } + + /// Returns the ratio (numerator / denominator) as a SignedDecimal256 + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::{SignedDecimal256, CheckedFromRatioError}; + /// assert_eq!( + /// SignedDecimal256::checked_from_ratio(1, 3).unwrap().to_string(), + /// "0.333333333333333333" + /// ); + /// assert_eq!( + /// SignedDecimal256::checked_from_ratio(1, 0), + /// Err(CheckedFromRatioError::DivideByZero) + /// ); + /// ``` + pub fn checked_from_ratio( + numerator: impl Into, + denominator: impl Into, + ) -> Result { + let numerator: Int256 = numerator.into(); + let denominator: Int256 = denominator.into(); + match numerator.checked_multiply_ratio(Self::DECIMAL_FRACTIONAL, denominator) { + Ok(ratio) => { + // numerator * DECIMAL_FRACTIONAL / denominator + Ok(SignedDecimal256(ratio)) + } + Err(CheckedMultiplyRatioError::Overflow) => Err(CheckedFromRatioError::Overflow), + Err(CheckedMultiplyRatioError::DivideByZero) => { + Err(CheckedFromRatioError::DivideByZero) + } + } + } + + /// Returns `true` if the number is 0 + #[must_use] + pub const fn is_zero(&self) -> bool { + self.0.is_zero() + } + + /// Returns `true` if the number is negative (< 0) + #[must_use] + pub const fn is_negative(&self) -> bool { + self.0.is_negative() + } + + /// A decimal is an integer of atomic units plus a number that specifies the + /// position of the decimal dot. So any decimal can be expressed as two numbers. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{SignedDecimal256, Int256}; + /// # use core::str::FromStr; + /// // Value with whole and fractional part + /// let a = SignedDecimal256::from_str("1.234").unwrap(); + /// assert_eq!(a.decimal_places(), 18); + /// assert_eq!(a.atomics(), Int256::from(1234000000000000000i128)); + /// + /// // Smallest possible value + /// let b = SignedDecimal256::from_str("0.000000000000000001").unwrap(); + /// assert_eq!(b.decimal_places(), 18); + /// assert_eq!(b.atomics(), Int256::from(1)); + /// ``` + #[must_use] + #[inline] + pub const fn atomics(&self) -> Int256 { + self.0 + } + + /// The number of decimal places. This is a constant value for now + /// but this could potentially change as the type evolves. + /// + /// See also [`SignedDecimal256::atomics()`]. + #[must_use] + #[inline] + pub const fn decimal_places(&self) -> u32 { + Self::DECIMAL_PLACES + } + + /// Rounds value by truncating the decimal places. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal256; + /// # use core::str::FromStr; + /// assert!(SignedDecimal256::from_str("0.6").unwrap().trunc().is_zero()); + /// assert_eq!(SignedDecimal256::from_str("-5.8").unwrap().trunc().to_string(), "-5"); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn trunc(&self) -> Self { + Self((self.0 / Self::DECIMAL_FRACTIONAL) * Self::DECIMAL_FRACTIONAL) + } + + /// Rounds value down after decimal places. Panics on overflow. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal256; + /// # use core::str::FromStr; + /// assert!(SignedDecimal256::from_str("0.6").unwrap().floor().is_zero()); + /// assert_eq!(SignedDecimal256::from_str("-5.2").unwrap().floor().to_string(), "-6"); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn floor(&self) -> Self { + match self.checked_floor() { + Ok(value) => value, + Err(_) => panic!("attempt to floor with overflow"), + } + } + + /// Rounds value down after decimal places. + pub fn checked_floor(&self) -> Result { + if self.is_negative() { + let truncated = self.trunc(); + + if truncated != self { + truncated + .checked_sub(SignedDecimal256::one()) + .map_err(|_| RoundDownOverflowError) + } else { + Ok(truncated) + } + } else { + Ok(self.trunc()) + } + } + + /// Rounds value up after decimal places. Panics on overflow. + /// + /// # Examples + /// + /// ``` + /// # use cosmwasm_std::SignedDecimal256; + /// # use core::str::FromStr; + /// assert_eq!(SignedDecimal256::from_str("0.2").unwrap().ceil(), SignedDecimal256::one()); + /// assert_eq!(SignedDecimal256::from_str("-5.8").unwrap().ceil().to_string(), "-5"); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn ceil(&self) -> Self { + match self.checked_ceil() { + Ok(value) => value, + Err(_) => panic!("attempt to ceil with overflow"), + } + } + + /// Rounds value up after decimal places. Returns OverflowError on overflow. + pub fn checked_ceil(&self) -> Result { + let floor = self.floor(); + if floor == self { + Ok(floor) + } else { + floor + .checked_add(SignedDecimal256::one()) + .map_err(|_| RoundUpOverflowError) + } + } + + /// Computes `self + other`, returning an `OverflowError` if an overflow occurred. + pub fn checked_add(self, other: Self) -> Result { + self.0 + .checked_add(other.0) + .map(Self) + .map_err(|_| OverflowError::new(OverflowOperation::Add)) + } + + /// Computes `self - other`, returning an `OverflowError` if an overflow occurred. + pub fn checked_sub(self, other: Self) -> Result { + self.0 + .checked_sub(other.0) + .map(Self) + .map_err(|_| OverflowError::new(OverflowOperation::Sub)) + } + + /// Multiplies one `SignedDecimal256` by another, returning an `OverflowError` if an overflow occurred. + pub fn checked_mul(self, other: Self) -> Result { + let result_as_int512 = + self.numerator().full_mul(other.numerator()) / Int512::from(Self::DECIMAL_FRACTIONAL); + result_as_int512 + .try_into() + .map(Self) + .map_err(|_| OverflowError::new(OverflowOperation::Mul)) + } + + /// Raises a value to the power of `exp`, panics if an overflow occurred. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn pow(self, exp: u32) -> Self { + match self.checked_pow(exp) { + Ok(value) => value, + Err(_) => panic!("Multiplication overflow"), + } + } + + /// Raises a value to the power of `exp`, returning an `OverflowError` if an overflow occurred. + pub fn checked_pow(self, exp: u32) -> Result { + // This uses the exponentiation by squaring algorithm: + // https://en.wikipedia.org/wiki/Exponentiation_by_squaring#Basic_method + + fn inner(mut x: SignedDecimal256, mut n: u32) -> Result { + if n == 0 { + return Ok(SignedDecimal256::one()); + } + + let mut y = SignedDecimal256::one(); + + while n > 1 { + if n % 2 == 0 { + x = x.checked_mul(x)?; + n /= 2; + } else { + y = x.checked_mul(y)?; + x = x.checked_mul(x)?; + n = (n - 1) / 2; + } + } + + Ok(x * y) + } + + inner(self, exp).map_err(|_| OverflowError::new(OverflowOperation::Pow)) + } + + pub fn checked_div(self, other: Self) -> Result { + SignedDecimal256::checked_from_ratio(self.numerator(), other.numerator()) + } + + /// Computes `self % other`, returning an `DivideByZeroError` if `other == 0`. + pub fn checked_rem(self, other: Self) -> Result { + self.0 + .checked_rem(other.0) + .map(Self) + .map_err(|_| DivideByZeroError) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs_diff(self, other: Self) -> Decimal256 { + Decimal256::new(self.0.abs_diff(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_add(self, other: Self) -> Self { + Self(self.0.saturating_add(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_sub(self, other: Self) -> Self { + Self(self.0.saturating_sub(other.0)) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_mul(self, other: Self) -> Self { + match self.checked_mul(other) { + Ok(value) => value, + Err(_) => { + // both negative or both positive results in positive number, otherwise negative + if self.is_negative() == other.is_negative() { + Self::MAX + } else { + Self::MIN + } + } + } + } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn saturating_pow(self, exp: u32) -> Self { + match self.checked_pow(exp) { + Ok(value) => value, + Err(_) => { + // odd exponent of negative number results in negative number + // everything else results in positive number + if self.is_negative() && exp % 2 == 1 { + Self::MIN + } else { + Self::MAX + } + } + } + } + + /// Converts this decimal to a signed integer by rounding down + /// to the next integer, e.g. 22.5 becomes 22 and -1.2 becomes -2. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{SignedDecimal256, Int256}; + /// + /// let d = SignedDecimal256::from_str("12.345").unwrap(); + /// assert_eq!(d.to_int_floor(), Int256::from(12)); + /// + /// let d = SignedDecimal256::from_str("-12.999").unwrap(); + /// assert_eq!(d.to_int_floor(), Int256::from(-13)); + /// + /// let d = SignedDecimal256::from_str("-0.05").unwrap(); + /// assert_eq!(d.to_int_floor(), Int256::from(-1)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_int_floor(self) -> Int256 { + if self.is_negative() { + // Using `x.to_int_floor() = -(-x).to_int_ceil()` for a negative `x`, + // but avoiding overflow by implementing the formula from `to_int_ceil` directly. + let x = self.0; + let y = Self::DECIMAL_FRACTIONAL; + // making sure not to negate `x`, as this would overflow + -Int256::one() - ((-Int256::one() - x) / y) + } else { + self.to_int_trunc() + } + } + + /// Converts this decimal to a signed integer by truncating + /// the fractional part, e.g. 22.5 becomes 22. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{SignedDecimal256, Int256}; + /// + /// let d = SignedDecimal256::from_str("12.345").unwrap(); + /// assert_eq!(d.to_int_trunc(), Int256::from(12)); + /// + /// let d = SignedDecimal256::from_str("-12.999").unwrap(); + /// assert_eq!(d.to_int_trunc(), Int256::from(-12)); + /// + /// let d = SignedDecimal256::from_str("75.0").unwrap(); + /// assert_eq!(d.to_int_trunc(), Int256::from(75)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_int_trunc(self) -> Int256 { + self.0 / Self::DECIMAL_FRACTIONAL + } + + /// Converts this decimal to a signed integer by rounding up + /// to the next integer, e.g. 22.3 becomes 23 and -1.2 becomes -1. + /// + /// ## Examples + /// + /// ``` + /// use core::str::FromStr; + /// use cosmwasm_std::{SignedDecimal256, Int256}; + /// + /// let d = SignedDecimal256::from_str("12.345").unwrap(); + /// assert_eq!(d.to_int_ceil(), Int256::from(13)); + /// + /// let d = SignedDecimal256::from_str("-12.999").unwrap(); + /// assert_eq!(d.to_int_ceil(), Int256::from(-12)); + /// + /// let d = SignedDecimal256::from_str("75.0").unwrap(); + /// assert_eq!(d.to_int_ceil(), Int256::from(75)); + /// ``` + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn to_int_ceil(self) -> Int256 { + if self.is_negative() { + self.to_int_trunc() + } else { + // Using `q = 1 + ((x - 1) / y); // if x != 0` with unsigned integers x, y, q + // from https://stackoverflow.com/a/2745086/2013738. We know `x + y` CAN overflow. + let x = self.0; + let y = Self::DECIMAL_FRACTIONAL; + if x.is_zero() { + Int256::zero() + } else { + Int256::one() + ((x - Int256::one()) / y) + } + } + } +} + +impl Fraction for SignedDecimal256 { + #[inline] + fn numerator(&self) -> Int256 { + self.0 + } + + #[inline] + fn denominator(&self) -> Int256 { + Self::DECIMAL_FRACTIONAL + } + + /// Returns the multiplicative inverse `1/d` for decimal `d`. + /// + /// If `d` is zero, none is returned. + fn inv(&self) -> Option { + if self.is_zero() { + None + } else { + // Let self be p/q with p = self.0 and q = DECIMAL_FRACTIONAL. + // Now we calculate the inverse a/b = q/p such that b = DECIMAL_FRACTIONAL. Then + // `a = DECIMAL_FRACTIONAL*DECIMAL_FRACTIONAL / self.0`. + Some(SignedDecimal256(Self::DECIMAL_FRACTIONAL_SQUARED / self.0)) + } + } +} + +impl Neg for SignedDecimal256 { + type Output = Self; + + fn neg(self) -> Self::Output { + Self(-self.0) + } +} + +impl From for SignedDecimal256 { + fn from(value: SignedDecimal) -> Self { + Self::new(value.atomics().into()) + } +} + +impl From for SignedDecimal256 { + fn from(value: Decimal) -> Self { + Self::new(value.atomics().into()) + } +} + +impl TryFrom for SignedDecimal256 { + type Error = SignedDecimal256RangeExceeded; + + fn try_from(value: Decimal256) -> Result { + value + .atomics() + .try_into() + .map(SignedDecimal256) + .map_err(|_| SignedDecimal256RangeExceeded) + } +} + +impl TryFrom for SignedDecimal256 { + type Error = SignedDecimal256RangeExceeded; + + #[inline] + fn try_from(value: Int256) -> Result { + Self::from_atomics(value, 0) + } +} + +impl FromStr for SignedDecimal256 { + type Err = StdError; + + /// Converts the decimal string to a SignedDecimal256 + /// Possible inputs: "1.23", "1", "000012", "1.123000000", "-1.12300" + /// Disallowed: "", ".23" + /// + /// This never performs any kind of rounding. + /// More than DECIMAL_PLACES fractional digits, even zeros, result in an error. + fn from_str(input: &str) -> Result { + let mut parts_iter = input.split('.'); + + let whole_part = parts_iter.next().unwrap(); // split always returns at least one element + let is_neg = whole_part.starts_with('-'); + + let whole = whole_part.parse::()?; + let mut atomics = whole.checked_mul(Self::DECIMAL_FRACTIONAL)?; + + if let Some(fractional_part) = parts_iter.next() { + let fractional = fractional_part.parse::()?; // u64 is enough for 18 decimal places + let exp = (Self::DECIMAL_PLACES.checked_sub(fractional_part.len() as u32)).ok_or_else( + || { + StdError::msg(format_args!( + "Cannot parse more than {} fractional digits", + Self::DECIMAL_PLACES + )) + }, + )?; + debug_assert!(exp <= Self::DECIMAL_PLACES); + let fractional_factor = Int256::from(10i128.pow(exp)); + + // This multiplication can't overflow because + // fractional < 10^DECIMAL_PLACES && fractional_factor <= 10^DECIMAL_PLACES + let fractional_part = Int256::from(fractional) + .checked_mul(fractional_factor) + .unwrap(); + + // for negative numbers, we need to subtract the fractional part + atomics = if is_neg { + atomics.checked_sub(fractional_part) + } else { + atomics.checked_add(fractional_part) + }?; + } + + if parts_iter.next().is_some() { + return Err(StdError::msg("Unexpected number of dots").with_kind(ErrorKind::Parsing)); + } + + Ok(SignedDecimal256(atomics)) + } +} + +impl fmt::Display for SignedDecimal256 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let whole = (self.0) / Self::DECIMAL_FRACTIONAL; + let fractional = (self.0).checked_rem(Self::DECIMAL_FRACTIONAL).unwrap(); + + if fractional.is_zero() { + write!(f, "{whole}") + } else { + let fractional_string = format!( + "{:0>padding$}", + fractional.abs(), // fractional should always be printed as positive + padding = Self::DECIMAL_PLACES as usize + ); + if self.is_negative() { + f.write_char('-')?; + } + write!( + f, + "{whole}.{fractional}", + whole = whole.abs(), + fractional = fractional_string.trim_end_matches('0') + ) + } + } +} + +impl fmt::Debug for SignedDecimal256 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "SignedDecimal256({self})") + } +} + +impl Add for SignedDecimal256 { + type Output = Self; + + fn add(self, other: Self) -> Self { + SignedDecimal256(self.0 + other.0) + } +} +forward_ref_binop!(impl Add, add for SignedDecimal256, SignedDecimal256); + +impl AddAssign for SignedDecimal256 { + fn add_assign(&mut self, rhs: SignedDecimal256) { + *self = *self + rhs; + } +} +forward_ref_op_assign!(impl AddAssign, add_assign for SignedDecimal256, SignedDecimal256); + +impl Sub for SignedDecimal256 { + type Output = Self; + + fn sub(self, other: Self) -> Self { + SignedDecimal256(self.0 - other.0) + } +} +forward_ref_binop!(impl Sub, sub for SignedDecimal256, SignedDecimal256); + +impl SubAssign for SignedDecimal256 { + fn sub_assign(&mut self, rhs: SignedDecimal256) { + *self = *self - rhs; + } +} +forward_ref_op_assign!(impl SubAssign, sub_assign for SignedDecimal256, SignedDecimal256); + +impl Mul for SignedDecimal256 { + type Output = Self; + + #[allow(clippy::suspicious_arithmetic_impl)] + fn mul(self, other: Self) -> Self { + // SignedDecimal256s are fractions. We can multiply two decimals a and b + // via + // (a.numerator() * b.numerator()) / (a.denominator() * b.denominator()) + // = (a.numerator() * b.numerator()) / a.denominator() / b.denominator() + + let result_as_int512 = + self.numerator().full_mul(other.numerator()) / Int512::from(Self::DECIMAL_FRACTIONAL); + match result_as_int512.try_into() { + Ok(result) => Self(result), + Err(_) => panic!("attempt to multiply with overflow"), + } + } +} +forward_ref_binop!(impl Mul, mul for SignedDecimal256, SignedDecimal256); + +impl MulAssign for SignedDecimal256 { + fn mul_assign(&mut self, rhs: SignedDecimal256) { + *self = *self * rhs; + } +} +forward_ref_op_assign!(impl MulAssign, mul_assign for SignedDecimal256, SignedDecimal256); + +impl Div for SignedDecimal256 { + type Output = Self; + + fn div(self, other: Self) -> Self { + match SignedDecimal256::checked_from_ratio(self.numerator(), other.numerator()) { + Ok(ratio) => ratio, + Err(CheckedFromRatioError::DivideByZero) => { + panic!("Division failed - denominator must not be zero") + } + Err(CheckedFromRatioError::Overflow) => { + panic!("Division failed - multiplication overflow") + } + } + } +} +forward_ref_binop!(impl Div, div for SignedDecimal256, SignedDecimal256); + +impl DivAssign for SignedDecimal256 { + fn div_assign(&mut self, rhs: SignedDecimal256) { + *self = *self / rhs; + } +} +forward_ref_op_assign!(impl DivAssign, div_assign for SignedDecimal256, SignedDecimal256); + +impl Div for SignedDecimal256 { + type Output = Self; + + fn div(self, rhs: Int256) -> Self::Output { + SignedDecimal256(self.0 / rhs) + } +} + +impl DivAssign for SignedDecimal256 { + fn div_assign(&mut self, rhs: Int256) { + self.0 /= rhs; + } +} + +impl Rem for SignedDecimal256 { + type Output = Self; + + /// # Panics + /// + /// This operation will panic if `rhs` is zero + #[inline] + fn rem(self, rhs: Self) -> Self { + Self(self.0.rem(rhs.0)) + } +} +forward_ref_binop!(impl Rem, rem for SignedDecimal256, SignedDecimal256); + +impl RemAssign for SignedDecimal256 { + fn rem_assign(&mut self, rhs: SignedDecimal256) { + *self = *self % rhs; + } +} +forward_ref_op_assign!(impl RemAssign, rem_assign for SignedDecimal256, SignedDecimal256); + +impl core::iter::Sum for SignedDecimal256 +where + Self: Add, +{ + fn sum>(iter: I) -> Self { + iter.fold(Self::zero(), Add::add) + } +} + +/// Serializes as a decimal string +impl Serialize for SignedDecimal256 { + fn serialize(&self, serializer: S) -> Result + where + S: ser::Serializer, + { + serializer.serialize_str(&self.to_string()) + } +} + +/// Deserializes as a base64 string +impl<'de> Deserialize<'de> for SignedDecimal256 { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(SignedDecimal256Visitor) + } +} + +struct SignedDecimal256Visitor; + +impl de::Visitor<'_> for SignedDecimal256Visitor { + type Value = SignedDecimal256; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("string-encoded decimal") + } + + fn visit_str(self, v: &str) -> Result + where + E: de::Error, + { + match SignedDecimal256::from_str(v) { + Ok(d) => Ok(d), + Err(e) => Err(E::custom(format_args!("Error parsing decimal '{v}': {e}"))), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + use alloc::vec::Vec; + + fn dec(input: &str) -> SignedDecimal256 { + SignedDecimal256::from_str(input).unwrap() + } + + #[test] + fn try_from_integer() { + let int = Int256::new(0xDEADBEEF); + let decimal = SignedDecimal256::try_from(int).unwrap(); + assert_eq!(int.to_string(), decimal.to_string()); + } + + #[test] + fn signed_decimal_256_new() { + let expected = Int256::from(300i128); + assert_eq!(SignedDecimal256::new(expected).0, expected); + + let expected = Int256::from(-300i128); + assert_eq!(SignedDecimal256::new(expected).0, expected); + } + + #[test] + #[allow(deprecated)] + fn signed_decimal_256_raw() { + let value = 300i128; + assert_eq!(SignedDecimal256::raw(value).0, Int256::from(value)); + + let value = -300i128; + assert_eq!(SignedDecimal256::raw(value).0, Int256::from(value)); + } + + #[test] + fn signed_decimal_256_one() { + let value = SignedDecimal256::one(); + assert_eq!(value.0, SignedDecimal256::DECIMAL_FRACTIONAL); + } + + #[test] + fn signed_decimal_256_zero() { + let value = SignedDecimal256::zero(); + assert!(value.0.is_zero()); + } + + #[test] + fn signed_decimal_256_percent() { + let value = SignedDecimal256::percent(50); + assert_eq!( + value.0, + SignedDecimal256::DECIMAL_FRACTIONAL / Int256::from(2u8) + ); + + let value = SignedDecimal256::percent(-50); + assert_eq!( + value.0, + SignedDecimal256::DECIMAL_FRACTIONAL / Int256::from(-2i8) + ); + } + + #[test] + fn signed_decimal_256_permille() { + let value = SignedDecimal256::permille(125); + assert_eq!( + value.0, + SignedDecimal256::DECIMAL_FRACTIONAL / Int256::from(8u8) + ); + + let value = SignedDecimal256::permille(-125); + assert_eq!( + value.0, + SignedDecimal256::DECIMAL_FRACTIONAL / Int256::from(-8i8) + ); + } + + #[test] + fn signed_decimal_256_bps() { + let value = SignedDecimal256::bps(125); + assert_eq!( + value.0, + SignedDecimal256::DECIMAL_FRACTIONAL / Int256::from(80u8) + ); + + let value = SignedDecimal256::bps(-125); + assert_eq!( + value.0, + SignedDecimal256::DECIMAL_FRACTIONAL / Int256::from(-80i8) + ); + } + + #[test] + fn signed_decimal_256_from_atomics_works() { + let one = SignedDecimal256::one(); + let two = one + one; + let neg_one = SignedDecimal256::negative_one(); + + assert_eq!(SignedDecimal256::from_atomics(1i128, 0).unwrap(), one); + assert_eq!(SignedDecimal256::from_atomics(10i128, 1).unwrap(), one); + assert_eq!(SignedDecimal256::from_atomics(100i128, 2).unwrap(), one); + assert_eq!(SignedDecimal256::from_atomics(1000i128, 3).unwrap(), one); + assert_eq!( + SignedDecimal256::from_atomics(1000000000000000000i128, 18).unwrap(), + one + ); + assert_eq!( + SignedDecimal256::from_atomics(10000000000000000000i128, 19).unwrap(), + one + ); + assert_eq!( + SignedDecimal256::from_atomics(100000000000000000000i128, 20).unwrap(), + one + ); + + assert_eq!(SignedDecimal256::from_atomics(2i128, 0).unwrap(), two); + assert_eq!(SignedDecimal256::from_atomics(20i128, 1).unwrap(), two); + assert_eq!(SignedDecimal256::from_atomics(200i128, 2).unwrap(), two); + assert_eq!(SignedDecimal256::from_atomics(2000i128, 3).unwrap(), two); + assert_eq!( + SignedDecimal256::from_atomics(2000000000000000000i128, 18).unwrap(), + two + ); + assert_eq!( + SignedDecimal256::from_atomics(20000000000000000000i128, 19).unwrap(), + two + ); + assert_eq!( + SignedDecimal256::from_atomics(200000000000000000000i128, 20).unwrap(), + two + ); + + assert_eq!(SignedDecimal256::from_atomics(-1i128, 0).unwrap(), neg_one); + assert_eq!(SignedDecimal256::from_atomics(-10i128, 1).unwrap(), neg_one); + assert_eq!( + SignedDecimal256::from_atomics(-100000000000000000000i128, 20).unwrap(), + neg_one + ); + + // Cuts decimal digits (20 provided but only 18 can be stored) + assert_eq!( + SignedDecimal256::from_atomics(4321i128, 20).unwrap(), + SignedDecimal256::from_str("0.000000000000000043").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(-4321i128, 20).unwrap(), + SignedDecimal256::from_str("-0.000000000000000043").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(6789i128, 20).unwrap(), + SignedDecimal256::from_str("0.000000000000000067").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(i128::MAX, 38).unwrap(), + SignedDecimal256::from_str("1.701411834604692317").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(i128::MAX, 39).unwrap(), + SignedDecimal256::from_str("0.170141183460469231").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(i128::MAX, 45).unwrap(), + SignedDecimal256::from_str("0.000000170141183460").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(i128::MAX, 51).unwrap(), + SignedDecimal256::from_str("0.000000000000170141").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(i128::MAX, 56).unwrap(), + SignedDecimal256::from_str("0.000000000000000001").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(i128::MAX, 57).unwrap(), + SignedDecimal256::from_str("0.000000000000000000").unwrap() + ); + assert_eq!( + SignedDecimal256::from_atomics(i128::MAX, u32::MAX).unwrap(), + SignedDecimal256::from_str("0.000000000000000000").unwrap() + ); + + // Can be used with max value + let max = SignedDecimal256::MAX; + assert_eq!( + SignedDecimal256::from_atomics(max.atomics(), max.decimal_places()).unwrap(), + max + ); + + // Can be used with min value + let min = SignedDecimal256::MIN; + assert_eq!( + SignedDecimal256::from_atomics(min.atomics(), min.decimal_places()).unwrap(), + min + ); + + // Overflow is only possible with digits < 18 + let result = SignedDecimal256::from_atomics(Int256::MAX, 17); + assert_eq!(result.unwrap_err(), SignedDecimal256RangeExceeded); + } + + #[test] + fn signed_decimal_256_from_ratio_works() { + // 1.0 + assert_eq!( + SignedDecimal256::from_ratio(1i128, 1i128), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256::from_ratio(53i128, 53i128), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256::from_ratio(125i128, 125i128), + SignedDecimal256::one() + ); + + // -1.0 + assert_eq!( + SignedDecimal256::from_ratio(-1i128, 1i128), + SignedDecimal256::negative_one() + ); + assert_eq!( + SignedDecimal256::from_ratio(-53i128, 53i128), + SignedDecimal256::negative_one() + ); + assert_eq!( + SignedDecimal256::from_ratio(125i128, -125i128), + SignedDecimal256::negative_one() + ); + + // 1.5 + assert_eq!( + SignedDecimal256::from_ratio(3i128, 2i128), + SignedDecimal256::percent(150) + ); + assert_eq!( + SignedDecimal256::from_ratio(150i128, 100i128), + SignedDecimal256::percent(150) + ); + assert_eq!( + SignedDecimal256::from_ratio(333i128, 222i128), + SignedDecimal256::percent(150) + ); + + // 0.125 + assert_eq!( + SignedDecimal256::from_ratio(1i64, 8i64), + SignedDecimal256::permille(125) + ); + assert_eq!( + SignedDecimal256::from_ratio(125i64, 1000i64), + SignedDecimal256::permille(125) + ); + + // -0.125 + assert_eq!( + SignedDecimal256::from_ratio(-1i64, 8i64), + SignedDecimal256::permille(-125) + ); + assert_eq!( + SignedDecimal256::from_ratio(125i64, -1000i64), + SignedDecimal256::permille(-125) + ); + + // 1/3 (result floored) + assert_eq!( + SignedDecimal256::from_ratio(1i64, 3i64), + SignedDecimal256(Int256::from(333_333_333_333_333_333i128)) + ); + + // 2/3 (result floored) + assert_eq!( + SignedDecimal256::from_ratio(2i64, 3i64), + SignedDecimal256(Int256::from(666_666_666_666_666_666i128)) + ); + + // large inputs + assert_eq!( + SignedDecimal256::from_ratio(0i128, i128::MAX), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256::from_ratio(i128::MAX, i128::MAX), + SignedDecimal256::one() + ); + // 170141183460469231731 is the largest integer <= SignedDecimal256::MAX + assert_eq!( + SignedDecimal256::from_ratio(170141183460469231731i128, 1i128), + SignedDecimal256::from_str("170141183460469231731").unwrap() + ); + } + + #[test] + #[should_panic(expected = "Denominator must not be zero")] + fn signed_decimal_256_from_ratio_panics_for_zero_denominator() { + SignedDecimal256::from_ratio(1i128, 0i128); + } + + #[test] + #[should_panic(expected = "Multiplication overflow")] + fn signed_decimal_256_from_ratio_panics_for_mul_overflow() { + SignedDecimal256::from_ratio(Int256::MAX, 1i128); + } + + #[test] + fn signed_decimal_256_checked_from_ratio_does_not_panic() { + assert_eq!( + SignedDecimal256::checked_from_ratio(1i128, 0i128), + Err(CheckedFromRatioError::DivideByZero) + ); + + assert_eq!( + SignedDecimal256::checked_from_ratio(Int256::MAX, 1i128), + Err(CheckedFromRatioError::Overflow) + ); + } + + #[test] + fn signed_decimal_256_implements_fraction() { + let fraction = SignedDecimal256::from_str("1234.567").unwrap(); + assert_eq!( + fraction.numerator(), + Int256::from(1_234_567_000_000_000_000_000i128) + ); + assert_eq!( + fraction.denominator(), + Int256::from(1_000_000_000_000_000_000i128) + ); + + let fraction = SignedDecimal256::from_str("-1234.567").unwrap(); + assert_eq!( + fraction.numerator(), + Int256::from(-1_234_567_000_000_000_000_000i128) + ); + assert_eq!( + fraction.denominator(), + Int256::from(1_000_000_000_000_000_000i128) + ); + } + + #[test] + fn signed_decimal_256_from_str_works() { + // Integers + assert_eq!( + SignedDecimal256::from_str("0").unwrap(), + SignedDecimal256::percent(0) + ); + assert_eq!( + SignedDecimal256::from_str("1").unwrap(), + SignedDecimal256::percent(100) + ); + assert_eq!( + SignedDecimal256::from_str("5").unwrap(), + SignedDecimal256::percent(500) + ); + assert_eq!( + SignedDecimal256::from_str("42").unwrap(), + SignedDecimal256::percent(4200) + ); + assert_eq!( + SignedDecimal256::from_str("000").unwrap(), + SignedDecimal256::percent(0) + ); + assert_eq!( + SignedDecimal256::from_str("001").unwrap(), + SignedDecimal256::percent(100) + ); + assert_eq!( + SignedDecimal256::from_str("005").unwrap(), + SignedDecimal256::percent(500) + ); + assert_eq!( + SignedDecimal256::from_str("0042").unwrap(), + SignedDecimal256::percent(4200) + ); + + // Positive decimals + assert_eq!( + SignedDecimal256::from_str("1.0").unwrap(), + SignedDecimal256::percent(100) + ); + assert_eq!( + SignedDecimal256::from_str("1.5").unwrap(), + SignedDecimal256::percent(150) + ); + assert_eq!( + SignedDecimal256::from_str("0.5").unwrap(), + SignedDecimal256::percent(50) + ); + assert_eq!( + SignedDecimal256::from_str("0.123").unwrap(), + SignedDecimal256::permille(123) + ); + + assert_eq!( + SignedDecimal256::from_str("40.00").unwrap(), + SignedDecimal256::percent(4000) + ); + assert_eq!( + SignedDecimal256::from_str("04.00").unwrap(), + SignedDecimal256::percent(400) + ); + assert_eq!( + SignedDecimal256::from_str("00.40").unwrap(), + SignedDecimal256::percent(40) + ); + assert_eq!( + SignedDecimal256::from_str("00.04").unwrap(), + SignedDecimal256::percent(4) + ); + // Negative decimals + assert_eq!( + SignedDecimal256::from_str("-00.04").unwrap(), + SignedDecimal256::percent(-4) + ); + assert_eq!( + SignedDecimal256::from_str("-00.40").unwrap(), + SignedDecimal256::percent(-40) + ); + assert_eq!( + SignedDecimal256::from_str("-04.00").unwrap(), + SignedDecimal256::percent(-400) + ); + + // Can handle DECIMAL_PLACES fractional digits + assert_eq!( + SignedDecimal256::from_str("7.123456789012345678").unwrap(), + SignedDecimal256(Int256::from(7123456789012345678i128)) + ); + assert_eq!( + SignedDecimal256::from_str("7.999999999999999999").unwrap(), + SignedDecimal256(Int256::from(7999999999999999999i128)) + ); + + // Works for documented max value + assert_eq!( + SignedDecimal256::from_str( + "57896044618658097711785492504343953926634992332820282019728.792003956564819967" + ) + .unwrap(), + SignedDecimal256::MAX + ); + // Works for documented min value + assert_eq!( + SignedDecimal256::from_str( + "-57896044618658097711785492504343953926634992332820282019728.792003956564819968" + ) + .unwrap(), + SignedDecimal256::MIN + ); + assert_eq!( + SignedDecimal256::from_str("-1").unwrap(), + SignedDecimal256::negative_one() + ); + } + + #[test] + fn signed_decimal_256_from_str_errors_for_broken_whole_part() { + assert!(SignedDecimal256::from_str("").is_err()); + assert!(SignedDecimal256::from_str(" ").is_err()); + assert!(SignedDecimal256::from_str("-").is_err()); + } + + #[test] + fn signed_decimal_256_from_str_errors_for_broken_fractional_part() { + assert!(SignedDecimal256::from_str("1.").is_err()); + assert!(SignedDecimal256::from_str("1. ").is_err()); + assert!(SignedDecimal256::from_str("1.e").is_err()); + assert!(SignedDecimal256::from_str("1.2e3").is_err()); + assert!(SignedDecimal256::from_str("1.-2").is_err()); + } + + #[test] + fn signed_decimal_256_from_str_errors_for_more_than_18_fractional_digits() { + assert!(SignedDecimal256::from_str("7.1234567890123456789").is_err()); + // No special rules for trailing zeros. This could be changed but adds gas cost for the happy path. + assert!(SignedDecimal256::from_str("7.1230000000000000000").is_err()); + } + + #[test] + fn signed_decimal_256_from_str_errors_for_invalid_number_of_dots() { + assert!(SignedDecimal256::from_str("1.2.3") + .unwrap_err() + .to_string() + .ends_with("Unexpected number of dots")); + + assert!(SignedDecimal256::from_str("1.2.3.4") + .unwrap_err() + .to_string() + .ends_with("Unexpected number of dots")); + } + + #[test] + fn signed_decimal_256_from_str_errors_for_more_than_max_value() { + // Integer + assert!(SignedDecimal256::from_str( + "57896044618658097711785492504343953926634992332820282019729", + ) + .is_err()); + assert!(SignedDecimal256::from_str( + "-57896044618658097711785492504343953926634992332820282019729", + ) + .is_err()); + + // SignedDecimal256 + assert!(SignedDecimal256::from_str( + "57896044618658097711785492504343953926634992332820282019729.0", + ) + .is_err()); + assert!(SignedDecimal256::from_str( + "57896044618658097711785492504343953926634992332820282019728.792003956564819968", + ) + .is_err()); + assert!(SignedDecimal256::from_str( + "-57896044618658097711785492504343953926634992332820282019728.792003956564819969", + ) + .is_err()); + } + + #[test] + fn signed_decimal_256_conversions_work() { + assert_eq!( + SignedDecimal256::from(SignedDecimal::zero()), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256::from(SignedDecimal::one()), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256::from(SignedDecimal::percent(50)), + SignedDecimal256::percent(50) + ); + assert_eq!( + SignedDecimal256::from(SignedDecimal::MAX), + SignedDecimal256::new(Int256::new(i128::MAX)) + ); + assert_eq!( + SignedDecimal256::from(SignedDecimal::percent(-50)), + SignedDecimal256::percent(-50) + ); + assert_eq!( + SignedDecimal256::from(SignedDecimal::MIN), + SignedDecimal256::new(Int256::new(i128::MIN)) + ); + } + + #[test] + fn signed_decimal_256_atomics_works() { + let zero = SignedDecimal256::zero(); + let one = SignedDecimal256::one(); + let half = SignedDecimal256::percent(50); + let two = SignedDecimal256::percent(200); + let max = SignedDecimal256::MAX; + let neg_half = SignedDecimal256::percent(-50); + let neg_two = SignedDecimal256::percent(-200); + let min = SignedDecimal256::MIN; + + assert_eq!(zero.atomics(), Int256::from(0)); + assert_eq!(one.atomics(), Int256::from(1000000000000000000i128)); + assert_eq!(half.atomics(), Int256::from(500000000000000000i128)); + assert_eq!(two.atomics(), Int256::from(2000000000000000000i128)); + assert_eq!(max.atomics(), Int256::MAX); + assert_eq!(neg_half.atomics(), Int256::from(-500000000000000000i128)); + assert_eq!(neg_two.atomics(), Int256::from(-2000000000000000000i128)); + assert_eq!(min.atomics(), Int256::MIN); + } + + #[test] + fn signed_decimal_256_decimal_places_works() { + let zero = SignedDecimal256::zero(); + let one = SignedDecimal256::one(); + let half = SignedDecimal256::percent(50); + let two = SignedDecimal256::percent(200); + let max = SignedDecimal256::MAX; + let neg_one = SignedDecimal256::negative_one(); + + assert_eq!(zero.decimal_places(), 18); + assert_eq!(one.decimal_places(), 18); + assert_eq!(half.decimal_places(), 18); + assert_eq!(two.decimal_places(), 18); + assert_eq!(max.decimal_places(), 18); + assert_eq!(neg_one.decimal_places(), 18); + } + + #[test] + fn signed_decimal_256_is_zero_works() { + assert!(SignedDecimal256::zero().is_zero()); + assert!(SignedDecimal256::percent(0).is_zero()); + assert!(SignedDecimal256::permille(0).is_zero()); + + assert!(!SignedDecimal256::one().is_zero()); + assert!(!SignedDecimal256::percent(123).is_zero()); + assert!(!SignedDecimal256::permille(-1234).is_zero()); + } + + #[test] + fn signed_decimal_256_inv_works() { + // d = 0 + assert_eq!(SignedDecimal256::zero().inv(), None); + + // d == 1 + assert_eq!(SignedDecimal256::one().inv(), Some(SignedDecimal256::one())); + + // d == -1 + assert_eq!( + SignedDecimal256::negative_one().inv(), + Some(SignedDecimal256::negative_one()) + ); + + // d > 1 exact + assert_eq!( + SignedDecimal256::from_str("2").unwrap().inv(), + Some(SignedDecimal256::from_str("0.5").unwrap()) + ); + assert_eq!( + SignedDecimal256::from_str("20").unwrap().inv(), + Some(SignedDecimal256::from_str("0.05").unwrap()) + ); + assert_eq!( + SignedDecimal256::from_str("200").unwrap().inv(), + Some(SignedDecimal256::from_str("0.005").unwrap()) + ); + assert_eq!( + SignedDecimal256::from_str("2000").unwrap().inv(), + Some(SignedDecimal256::from_str("0.0005").unwrap()) + ); + + // d > 1 rounded + assert_eq!( + SignedDecimal256::from_str("3").unwrap().inv(), + Some(SignedDecimal256::from_str("0.333333333333333333").unwrap()) + ); + assert_eq!( + SignedDecimal256::from_str("6").unwrap().inv(), + Some(SignedDecimal256::from_str("0.166666666666666666").unwrap()) + ); + + // d < 1 exact + assert_eq!( + SignedDecimal256::from_str("0.5").unwrap().inv(), + Some(SignedDecimal256::from_str("2").unwrap()) + ); + assert_eq!( + SignedDecimal256::from_str("0.05").unwrap().inv(), + Some(SignedDecimal256::from_str("20").unwrap()) + ); + assert_eq!( + SignedDecimal256::from_str("0.005").unwrap().inv(), + Some(SignedDecimal256::from_str("200").unwrap()) + ); + assert_eq!( + SignedDecimal256::from_str("0.0005").unwrap().inv(), + Some(SignedDecimal256::from_str("2000").unwrap()) + ); + + // d < 0 + assert_eq!( + SignedDecimal256::from_str("-0.5").unwrap().inv(), + Some(SignedDecimal256::from_str("-2").unwrap()) + ); + // d < 0 rounded + assert_eq!( + SignedDecimal256::from_str("-3").unwrap().inv(), + Some(SignedDecimal256::from_str("-0.333333333333333333").unwrap()) + ); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_256_add_works() { + let value = SignedDecimal256::one() + SignedDecimal256::percent(50); // 1.5 + assert_eq!( + value.0, + SignedDecimal256::DECIMAL_FRACTIONAL * Int256::from(3u8) / Int256::from(2u8) + ); + + assert_eq!( + SignedDecimal256::percent(5) + SignedDecimal256::percent(4), + SignedDecimal256::percent(9) + ); + assert_eq!( + SignedDecimal256::percent(5) + SignedDecimal256::zero(), + SignedDecimal256::percent(5) + ); + assert_eq!( + SignedDecimal256::zero() + SignedDecimal256::zero(), + SignedDecimal256::zero() + ); + // negative numbers + assert_eq!( + SignedDecimal256::percent(-5) + SignedDecimal256::percent(-4), + SignedDecimal256::percent(-9) + ); + assert_eq!( + SignedDecimal256::percent(-5) + SignedDecimal256::percent(4), + SignedDecimal256::percent(-1) + ); + assert_eq!( + SignedDecimal256::percent(5) + SignedDecimal256::percent(-4), + SignedDecimal256::percent(1) + ); + + // works for refs + let a = SignedDecimal256::percent(15); + let b = SignedDecimal256::percent(25); + let expected = SignedDecimal256::percent(40); + assert_eq!(a + b, expected); + assert_eq!(&a + b, expected); + assert_eq!(a + &b, expected); + assert_eq!(&a + &b, expected); + } + + #[test] + #[should_panic] + fn signed_decimal_256_add_overflow_panics() { + let _value = SignedDecimal256::MAX + SignedDecimal256::percent(50); + } + + #[test] + fn signed_decimal_256_add_assign_works() { + let mut a = SignedDecimal256::percent(30); + a += SignedDecimal256::percent(20); + assert_eq!(a, SignedDecimal256::percent(50)); + + // works for refs + let mut a = SignedDecimal256::percent(15); + let b = SignedDecimal256::percent(3); + let expected = SignedDecimal256::percent(18); + a += &b; + assert_eq!(a, expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_256_sub_works() { + let value = SignedDecimal256::one() - SignedDecimal256::percent(50); // 0.5 + assert_eq!( + value.0, + SignedDecimal256::DECIMAL_FRACTIONAL / Int256::from(2u8) + ); + + assert_eq!( + SignedDecimal256::percent(9) - SignedDecimal256::percent(4), + SignedDecimal256::percent(5) + ); + assert_eq!( + SignedDecimal256::percent(16) - SignedDecimal256::zero(), + SignedDecimal256::percent(16) + ); + assert_eq!( + SignedDecimal256::percent(16) - SignedDecimal256::percent(16), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256::zero() - SignedDecimal256::zero(), + SignedDecimal256::zero() + ); + + // negative numbers + assert_eq!( + SignedDecimal256::percent(-5) - SignedDecimal256::percent(-4), + SignedDecimal256::percent(-1) + ); + assert_eq!( + SignedDecimal256::percent(-5) - SignedDecimal256::percent(4), + SignedDecimal256::percent(-9) + ); + assert_eq!( + SignedDecimal256::percent(500) - SignedDecimal256::percent(-4), + SignedDecimal256::percent(504) + ); + + // works for refs + let a = SignedDecimal256::percent(13); + let b = SignedDecimal256::percent(6); + let expected = SignedDecimal256::percent(7); + assert_eq!(a - b, expected); + assert_eq!(&a - b, expected); + assert_eq!(a - &b, expected); + assert_eq!(&a - &b, expected); + } + + #[test] + #[should_panic] + fn signed_decimal_256_sub_overflow_panics() { + let _value = SignedDecimal256::MIN - SignedDecimal256::percent(50); + } + + #[test] + fn signed_decimal_256_sub_assign_works() { + let mut a = SignedDecimal256::percent(20); + a -= SignedDecimal256::percent(2); + assert_eq!(a, SignedDecimal256::percent(18)); + + // works for refs + let mut a = SignedDecimal256::percent(33); + let b = SignedDecimal256::percent(13); + let expected = SignedDecimal256::percent(20); + a -= &b; + assert_eq!(a, expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_256_implements_mul() { + let one = SignedDecimal256::one(); + let two = one + one; + let half = SignedDecimal256::percent(50); + + // 1*x and x*1 + assert_eq!( + one * SignedDecimal256::percent(0), + SignedDecimal256::percent(0) + ); + assert_eq!( + one * SignedDecimal256::percent(1), + SignedDecimal256::percent(1) + ); + assert_eq!( + one * SignedDecimal256::percent(10), + SignedDecimal256::percent(10) + ); + assert_eq!( + one * SignedDecimal256::percent(100), + SignedDecimal256::percent(100) + ); + assert_eq!( + one * SignedDecimal256::percent(1000), + SignedDecimal256::percent(1000) + ); + assert_eq!(one * SignedDecimal256::MAX, SignedDecimal256::MAX); + assert_eq!( + SignedDecimal256::percent(0) * one, + SignedDecimal256::percent(0) + ); + assert_eq!( + SignedDecimal256::percent(1) * one, + SignedDecimal256::percent(1) + ); + assert_eq!( + SignedDecimal256::percent(10) * one, + SignedDecimal256::percent(10) + ); + assert_eq!( + SignedDecimal256::percent(100) * one, + SignedDecimal256::percent(100) + ); + assert_eq!( + SignedDecimal256::percent(1000) * one, + SignedDecimal256::percent(1000) + ); + assert_eq!(SignedDecimal256::MAX * one, SignedDecimal256::MAX); + assert_eq!( + SignedDecimal256::percent(-1) * one, + SignedDecimal256::percent(-1) + ); + assert_eq!( + one * SignedDecimal256::percent(-10), + SignedDecimal256::percent(-10) + ); + + // double + assert_eq!( + two * SignedDecimal256::percent(0), + SignedDecimal256::percent(0) + ); + assert_eq!( + two * SignedDecimal256::percent(1), + SignedDecimal256::percent(2) + ); + assert_eq!( + two * SignedDecimal256::percent(10), + SignedDecimal256::percent(20) + ); + assert_eq!( + two * SignedDecimal256::percent(100), + SignedDecimal256::percent(200) + ); + assert_eq!( + two * SignedDecimal256::percent(1000), + SignedDecimal256::percent(2000) + ); + assert_eq!( + SignedDecimal256::percent(0) * two, + SignedDecimal256::percent(0) + ); + assert_eq!( + SignedDecimal256::percent(1) * two, + SignedDecimal256::percent(2) + ); + assert_eq!( + SignedDecimal256::percent(10) * two, + SignedDecimal256::percent(20) + ); + assert_eq!( + SignedDecimal256::percent(100) * two, + SignedDecimal256::percent(200) + ); + assert_eq!( + SignedDecimal256::percent(1000) * two, + SignedDecimal256::percent(2000) + ); + assert_eq!( + SignedDecimal256::percent(-1) * two, + SignedDecimal256::percent(-2) + ); + assert_eq!( + two * SignedDecimal256::new(Int256::MIN / Int256::from(2)), + SignedDecimal256::MIN + ); + + // half + assert_eq!( + half * SignedDecimal256::percent(0), + SignedDecimal256::percent(0) + ); + assert_eq!( + half * SignedDecimal256::percent(1), + SignedDecimal256::permille(5) + ); + assert_eq!( + half * SignedDecimal256::percent(10), + SignedDecimal256::percent(5) + ); + assert_eq!( + half * SignedDecimal256::percent(100), + SignedDecimal256::percent(50) + ); + assert_eq!( + half * SignedDecimal256::percent(1000), + SignedDecimal256::percent(500) + ); + assert_eq!( + SignedDecimal256::percent(0) * half, + SignedDecimal256::percent(0) + ); + assert_eq!( + SignedDecimal256::percent(1) * half, + SignedDecimal256::permille(5) + ); + assert_eq!( + SignedDecimal256::percent(10) * half, + SignedDecimal256::percent(5) + ); + assert_eq!( + SignedDecimal256::percent(100) * half, + SignedDecimal256::percent(50) + ); + assert_eq!( + SignedDecimal256::percent(1000) * half, + SignedDecimal256::percent(500) + ); + + // Move left + let a = dec("123.127726548762582"); + assert_eq!(a * dec("1"), dec("123.127726548762582")); + assert_eq!(a * dec("10"), dec("1231.27726548762582")); + assert_eq!(a * dec("100"), dec("12312.7726548762582")); + assert_eq!(a * dec("1000"), dec("123127.726548762582")); + assert_eq!(a * dec("1000000"), dec("123127726.548762582")); + assert_eq!(a * dec("1000000000"), dec("123127726548.762582")); + assert_eq!(a * dec("1000000000000"), dec("123127726548762.582")); + assert_eq!(a * dec("1000000000000000"), dec("123127726548762582")); + assert_eq!(a * dec("1000000000000000000"), dec("123127726548762582000")); + assert_eq!(dec("1") * a, dec("123.127726548762582")); + assert_eq!(dec("10") * a, dec("1231.27726548762582")); + assert_eq!(dec("100") * a, dec("12312.7726548762582")); + assert_eq!(dec("1000") * a, dec("123127.726548762582")); + assert_eq!(dec("1000000") * a, dec("123127726.548762582")); + assert_eq!(dec("1000000000") * a, dec("123127726548.762582")); + assert_eq!(dec("1000000000000") * a, dec("123127726548762.582")); + assert_eq!(dec("1000000000000000") * a, dec("123127726548762582")); + assert_eq!(dec("1000000000000000000") * a, dec("123127726548762582000")); + assert_eq!( + dec("-1000000000000000000") * a, + dec("-123127726548762582000") + ); + + // Move right + let max = SignedDecimal256::MAX; + assert_eq!( + max * dec("1.0"), + dec("57896044618658097711785492504343953926634992332820282019728.792003956564819967") + ); + assert_eq!( + max * dec("0.1"), + dec("5789604461865809771178549250434395392663499233282028201972.879200395656481996") + ); + assert_eq!( + max * dec("0.01"), + dec("578960446186580977117854925043439539266349923328202820197.287920039565648199") + ); + assert_eq!( + max * dec("0.001"), + dec("57896044618658097711785492504343953926634992332820282019.728792003956564819") + ); + assert_eq!( + max * dec("0.000001"), + dec("57896044618658097711785492504343953926634992332820282.019728792003956564") + ); + assert_eq!( + max * dec("0.000000001"), + dec("57896044618658097711785492504343953926634992332820.282019728792003956") + ); + assert_eq!( + max * dec("0.000000000001"), + dec("57896044618658097711785492504343953926634992332.820282019728792003") + ); + assert_eq!( + max * dec("0.000000000000001"), + dec("57896044618658097711785492504343953926634992.332820282019728792") + ); + assert_eq!( + max * dec("0.000000000000000001"), + dec("57896044618658097711785492504343953926634.992332820282019728") + ); + + // works for refs + let a = SignedDecimal256::percent(20); + let b = SignedDecimal256::percent(30); + let expected = SignedDecimal256::percent(6); + assert_eq!(a * b, expected); + assert_eq!(&a * b, expected); + assert_eq!(a * &b, expected); + assert_eq!(&a * &b, expected); + } + + #[test] + fn signed_decimal_256_mul_assign_works() { + let mut a = SignedDecimal256::percent(15); + a *= SignedDecimal256::percent(60); + assert_eq!(a, SignedDecimal256::percent(9)); + + // works for refs + let mut a = SignedDecimal256::percent(50); + let b = SignedDecimal256::percent(20); + a *= &b; + assert_eq!(a, SignedDecimal256::percent(10)); + } + + #[test] + #[should_panic(expected = "attempt to multiply with overflow")] + fn signed_decimal_256_mul_overflow_panics() { + let _value = SignedDecimal256::MAX * SignedDecimal256::percent(101); + } + + #[test] + fn signed_decimal_256_checked_mul() { + let test_data = [ + (SignedDecimal256::zero(), SignedDecimal256::zero()), + (SignedDecimal256::zero(), SignedDecimal256::one()), + (SignedDecimal256::one(), SignedDecimal256::zero()), + (SignedDecimal256::percent(10), SignedDecimal256::zero()), + (SignedDecimal256::percent(10), SignedDecimal256::percent(5)), + (SignedDecimal256::MAX, SignedDecimal256::one()), + ( + SignedDecimal256::MAX / Int256::from(2), + SignedDecimal256::percent(200), + ), + ( + SignedDecimal256::permille(6), + SignedDecimal256::permille(13), + ), + ( + SignedDecimal256::permille(-6), + SignedDecimal256::permille(0), + ), + (SignedDecimal256::MAX, SignedDecimal256::negative_one()), + ]; + + // The regular core::ops::Mul is our source of truth for these tests. + for (x, y) in test_data.into_iter() { + assert_eq!(x * y, x.checked_mul(y).unwrap()); + } + } + + #[test] + fn signed_decimal_256_checked_mul_overflow() { + assert_eq!( + SignedDecimal256::MAX.checked_mul(SignedDecimal256::percent(200)), + Err(OverflowError::new(OverflowOperation::Mul)) + ); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_256_implements_div() { + let one = SignedDecimal256::one(); + let two = one + one; + let half = SignedDecimal256::percent(50); + + // 1/x and x/1 + assert_eq!( + one / SignedDecimal256::percent(1), + SignedDecimal256::percent(10_000) + ); + assert_eq!( + one / SignedDecimal256::percent(10), + SignedDecimal256::percent(1_000) + ); + assert_eq!( + one / SignedDecimal256::percent(100), + SignedDecimal256::percent(100) + ); + assert_eq!( + one / SignedDecimal256::percent(1000), + SignedDecimal256::percent(10) + ); + assert_eq!( + SignedDecimal256::percent(0) / one, + SignedDecimal256::percent(0) + ); + assert_eq!( + SignedDecimal256::percent(1) / one, + SignedDecimal256::percent(1) + ); + assert_eq!( + SignedDecimal256::percent(10) / one, + SignedDecimal256::percent(10) + ); + assert_eq!( + SignedDecimal256::percent(100) / one, + SignedDecimal256::percent(100) + ); + assert_eq!( + SignedDecimal256::percent(1000) / one, + SignedDecimal256::percent(1000) + ); + assert_eq!( + one / SignedDecimal256::percent(-1), + SignedDecimal256::percent(-10_000) + ); + assert_eq!( + one / SignedDecimal256::percent(-10), + SignedDecimal256::percent(-1_000) + ); + + // double + assert_eq!( + two / SignedDecimal256::percent(1), + SignedDecimal256::percent(20_000) + ); + assert_eq!( + two / SignedDecimal256::percent(10), + SignedDecimal256::percent(2_000) + ); + assert_eq!( + two / SignedDecimal256::percent(100), + SignedDecimal256::percent(200) + ); + assert_eq!( + two / SignedDecimal256::percent(1000), + SignedDecimal256::percent(20) + ); + assert_eq!( + SignedDecimal256::percent(0) / two, + SignedDecimal256::percent(0) + ); + assert_eq!(SignedDecimal256::percent(1) / two, dec("0.005")); + assert_eq!( + SignedDecimal256::percent(10) / two, + SignedDecimal256::percent(5) + ); + assert_eq!( + SignedDecimal256::percent(100) / two, + SignedDecimal256::percent(50) + ); + assert_eq!( + SignedDecimal256::percent(1000) / two, + SignedDecimal256::percent(500) + ); + assert_eq!( + two / SignedDecimal256::percent(-1), + SignedDecimal256::percent(-20_000) + ); + assert_eq!( + SignedDecimal256::percent(-10000) / two, + SignedDecimal256::percent(-5000) + ); + + // half + assert_eq!( + half / SignedDecimal256::percent(1), + SignedDecimal256::percent(5_000) + ); + assert_eq!( + half / SignedDecimal256::percent(10), + SignedDecimal256::percent(500) + ); + assert_eq!( + half / SignedDecimal256::percent(100), + SignedDecimal256::percent(50) + ); + assert_eq!( + half / SignedDecimal256::percent(1000), + SignedDecimal256::percent(5) + ); + assert_eq!( + SignedDecimal256::percent(0) / half, + SignedDecimal256::percent(0) + ); + assert_eq!( + SignedDecimal256::percent(1) / half, + SignedDecimal256::percent(2) + ); + assert_eq!( + SignedDecimal256::percent(10) / half, + SignedDecimal256::percent(20) + ); + assert_eq!( + SignedDecimal256::percent(100) / half, + SignedDecimal256::percent(200) + ); + assert_eq!( + SignedDecimal256::percent(1000) / half, + SignedDecimal256::percent(2000) + ); + + // Move right + let a = dec("123127726548762582"); + assert_eq!(a / dec("1"), dec("123127726548762582")); + assert_eq!(a / dec("10"), dec("12312772654876258.2")); + assert_eq!(a / dec("100"), dec("1231277265487625.82")); + assert_eq!(a / dec("1000"), dec("123127726548762.582")); + assert_eq!(a / dec("1000000"), dec("123127726548.762582")); + assert_eq!(a / dec("1000000000"), dec("123127726.548762582")); + assert_eq!(a / dec("1000000000000"), dec("123127.726548762582")); + assert_eq!(a / dec("1000000000000000"), dec("123.127726548762582")); + assert_eq!(a / dec("1000000000000000000"), dec("0.123127726548762582")); + assert_eq!(dec("1") / a, dec("0.000000000000000008")); + assert_eq!(dec("10") / a, dec("0.000000000000000081")); + assert_eq!(dec("100") / a, dec("0.000000000000000812")); + assert_eq!(dec("1000") / a, dec("0.000000000000008121")); + assert_eq!(dec("1000000") / a, dec("0.000000000008121647")); + assert_eq!(dec("1000000000") / a, dec("0.000000008121647560")); + assert_eq!(dec("1000000000000") / a, dec("0.000008121647560868")); + assert_eq!(dec("1000000000000000") / a, dec("0.008121647560868164")); + assert_eq!(dec("1000000000000000000") / a, dec("8.121647560868164773")); + // negative + let a = dec("-123127726548762582"); + assert_eq!(a / dec("1"), dec("-123127726548762582")); + assert_eq!(a / dec("10"), dec("-12312772654876258.2")); + assert_eq!(a / dec("100"), dec("-1231277265487625.82")); + assert_eq!(a / dec("1000"), dec("-123127726548762.582")); + assert_eq!(a / dec("1000000"), dec("-123127726548.762582")); + assert_eq!(a / dec("1000000000"), dec("-123127726.548762582")); + assert_eq!(a / dec("1000000000000"), dec("-123127.726548762582")); + assert_eq!(a / dec("1000000000000000"), dec("-123.127726548762582")); + assert_eq!(a / dec("1000000000000000000"), dec("-0.123127726548762582")); + assert_eq!(dec("1") / a, dec("-0.000000000000000008")); + + // Move left + let a = dec("0.123127726548762582"); + assert_eq!(a / dec("1.0"), dec("0.123127726548762582")); + assert_eq!(a / dec("0.1"), dec("1.23127726548762582")); + assert_eq!(a / dec("0.01"), dec("12.3127726548762582")); + assert_eq!(a / dec("0.001"), dec("123.127726548762582")); + assert_eq!(a / dec("0.000001"), dec("123127.726548762582")); + assert_eq!(a / dec("0.000000001"), dec("123127726.548762582")); + assert_eq!(a / dec("0.000000000001"), dec("123127726548.762582")); + assert_eq!(a / dec("0.000000000000001"), dec("123127726548762.582")); + assert_eq!(a / dec("0.000000000000000001"), dec("123127726548762582")); + // negative + let a = dec("-0.123127726548762582"); + assert_eq!(a / dec("1.0"), dec("-0.123127726548762582")); + assert_eq!(a / dec("0.1"), dec("-1.23127726548762582")); + assert_eq!(a / dec("0.01"), dec("-12.3127726548762582")); + assert_eq!(a / dec("0.001"), dec("-123.127726548762582")); + assert_eq!(a / dec("0.000001"), dec("-123127.726548762582")); + assert_eq!(a / dec("0.000000001"), dec("-123127726.548762582")); + + assert_eq!( + SignedDecimal256::percent(15) / SignedDecimal256::percent(60), + SignedDecimal256::percent(25) + ); + + // works for refs + let a = SignedDecimal256::percent(100); + let b = SignedDecimal256::percent(20); + let expected = SignedDecimal256::percent(500); + assert_eq!(a / b, expected); + assert_eq!(&a / b, expected); + assert_eq!(a / &b, expected); + assert_eq!(&a / &b, expected); + } + + #[test] + fn signed_decimal_256_div_assign_works() { + let mut a = SignedDecimal256::percent(15); + a /= SignedDecimal256::percent(20); + assert_eq!(a, SignedDecimal256::percent(75)); + + // works for refs + let mut a = SignedDecimal256::percent(50); + let b = SignedDecimal256::percent(20); + a /= &b; + assert_eq!(a, SignedDecimal256::percent(250)); + } + + #[test] + #[should_panic(expected = "Division failed - multiplication overflow")] + fn signed_decimal_256_div_overflow_panics() { + let _value = SignedDecimal256::MAX / SignedDecimal256::percent(10); + } + + #[test] + #[should_panic(expected = "Division failed - denominator must not be zero")] + fn signed_decimal_256_div_by_zero_panics() { + let _value = SignedDecimal256::one() / SignedDecimal256::zero(); + } + + #[test] + fn signed_decimal_256_int128_division() { + // a/b + let left = SignedDecimal256::percent(150); // 1.5 + let right = Int256::from(3); + assert_eq!(left / right, SignedDecimal256::percent(50)); + + // negative + let left = SignedDecimal256::percent(-150); // -1.5 + let right = Int256::from(3); + assert_eq!(left / right, SignedDecimal256::percent(-50)); + + // 0/a + let left = SignedDecimal256::zero(); + let right = Int256::from(300); + assert_eq!(left / right, SignedDecimal256::zero()); + } + + #[test] + #[should_panic] + fn signed_decimal_256_int128_divide_by_zero() { + let left = SignedDecimal256::percent(150); // 1.5 + let right = Int256::from(0); + let _result = left / right; + } + + #[test] + fn signed_decimal_256_int128_div_assign() { + // a/b + let mut dec = SignedDecimal256::percent(150); // 1.5 + dec /= Int256::from(3); + assert_eq!(dec, SignedDecimal256::percent(50)); + + // 0/a + let mut dec = SignedDecimal256::zero(); + dec /= Int256::from(300); + assert_eq!(dec, SignedDecimal256::zero()); + } + + #[test] + #[should_panic] + fn signed_decimal_256_int128_div_assign_by_zero() { + // a/0 + let mut dec = SignedDecimal256::percent(50); + dec /= Int256::from(0); + } + + #[test] + fn signed_decimal_256_checked_pow() { + for exp in 0..10 { + assert_eq!( + SignedDecimal256::one().checked_pow(exp).unwrap(), + SignedDecimal256::one() + ); + } + + // This case is mathematically undefined but we ensure consistency with Rust standard types + // https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=20df6716048e77087acd40194b233494 + assert_eq!( + SignedDecimal256::zero().checked_pow(0).unwrap(), + SignedDecimal256::one() + ); + + for exp in 1..10 { + assert_eq!( + SignedDecimal256::zero().checked_pow(exp).unwrap(), + SignedDecimal256::zero() + ); + } + + for exp in 1..10 { + assert_eq!( + SignedDecimal256::negative_one().checked_pow(exp).unwrap(), + // alternates between 1 and -1 + if exp % 2 == 0 { + SignedDecimal256::one() + } else { + SignedDecimal256::negative_one() + } + ) + } + + for num in &[ + SignedDecimal256::percent(50), + SignedDecimal256::percent(99), + SignedDecimal256::percent(200), + ] { + assert_eq!(num.checked_pow(0).unwrap(), SignedDecimal256::one()) + } + + assert_eq!( + SignedDecimal256::percent(20).checked_pow(2).unwrap(), + SignedDecimal256::percent(4) + ); + + assert_eq!( + SignedDecimal256::percent(20).checked_pow(3).unwrap(), + SignedDecimal256::permille(8) + ); + + assert_eq!( + SignedDecimal256::percent(200).checked_pow(4).unwrap(), + SignedDecimal256::percent(1600) + ); + + assert_eq!( + SignedDecimal256::percent(200).checked_pow(4).unwrap(), + SignedDecimal256::percent(1600) + ); + + assert_eq!( + SignedDecimal256::percent(700).checked_pow(5).unwrap(), + SignedDecimal256::percent(1680700) + ); + + assert_eq!( + SignedDecimal256::percent(700).checked_pow(8).unwrap(), + SignedDecimal256::percent(576480100) + ); + + assert_eq!( + SignedDecimal256::percent(700).checked_pow(10).unwrap(), + SignedDecimal256::percent(28247524900) + ); + + assert_eq!( + SignedDecimal256::percent(120).checked_pow(123).unwrap(), + SignedDecimal256(5486473221892422150877397607i128.into()) + ); + + assert_eq!( + SignedDecimal256::percent(10).checked_pow(2).unwrap(), + SignedDecimal256(10000000000000000i128.into()) + ); + + assert_eq!( + SignedDecimal256::percent(10).checked_pow(18).unwrap(), + SignedDecimal256(1i128.into()) + ); + + let decimals = [ + SignedDecimal256::percent(-50), + SignedDecimal256::percent(-99), + SignedDecimal256::percent(-200), + ]; + let exponents = [1, 2, 3, 4, 5, 8, 10]; + + for d in decimals { + for e in exponents { + // use multiplication as source of truth + let mut mul = Ok(d); + for _ in 1..e { + mul = mul.and_then(|mul| mul.checked_mul(d)); + } + assert_eq!(mul, d.checked_pow(e)); + } + } + } + + #[test] + fn signed_decimal_256_checked_pow_overflow() { + assert_eq!( + SignedDecimal256::MAX.checked_pow(2), + Err(OverflowError::new(OverflowOperation::Pow)) + ); + } + + #[test] + fn signed_decimal_256_to_string() { + // Integers + assert_eq!(SignedDecimal256::zero().to_string(), "0"); + assert_eq!(SignedDecimal256::one().to_string(), "1"); + assert_eq!(SignedDecimal256::percent(500).to_string(), "5"); + assert_eq!(SignedDecimal256::percent(-500).to_string(), "-5"); + + // SignedDecimal256s + assert_eq!(SignedDecimal256::percent(125).to_string(), "1.25"); + assert_eq!(SignedDecimal256::percent(42638).to_string(), "426.38"); + assert_eq!(SignedDecimal256::percent(3).to_string(), "0.03"); + assert_eq!(SignedDecimal256::permille(987).to_string(), "0.987"); + assert_eq!(SignedDecimal256::percent(-125).to_string(), "-1.25"); + assert_eq!(SignedDecimal256::percent(-42638).to_string(), "-426.38"); + assert_eq!(SignedDecimal256::percent(-3).to_string(), "-0.03"); + assert_eq!(SignedDecimal256::permille(-987).to_string(), "-0.987"); + + assert_eq!( + SignedDecimal256(Int256::from(1i128)).to_string(), + "0.000000000000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(10i128)).to_string(), + "0.00000000000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(100i128)).to_string(), + "0.0000000000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(1000i128)).to_string(), + "0.000000000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(10000i128)).to_string(), + "0.00000000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(100000i128)).to_string(), + "0.0000000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(1000000i128)).to_string(), + "0.000000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(10000000i128)).to_string(), + "0.00000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(100000000i128)).to_string(), + "0.0000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(1000000000i128)).to_string(), + "0.000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(10000000000i128)).to_string(), + "0.00000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(100000000000i128)).to_string(), + "0.0000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(10000000000000i128)).to_string(), + "0.00001" + ); + assert_eq!( + SignedDecimal256(Int256::from(100000000000000i128)).to_string(), + "0.0001" + ); + assert_eq!( + SignedDecimal256(Int256::from(1000000000000000i128)).to_string(), + "0.001" + ); + assert_eq!( + SignedDecimal256(Int256::from(10000000000000000i128)).to_string(), + "0.01" + ); + assert_eq!( + SignedDecimal256(Int256::from(100000000000000000i128)).to_string(), + "0.1" + ); + assert_eq!( + SignedDecimal256(Int256::from(-1i128)).to_string(), + "-0.000000000000000001" + ); + assert_eq!( + SignedDecimal256(Int256::from(-100000000000000i128)).to_string(), + "-0.0001" + ); + assert_eq!( + SignedDecimal256(Int256::from(-100000000000000000i128)).to_string(), + "-0.1" + ); + } + + #[test] + fn signed_decimal_256_iter_sum() { + let items = vec![ + SignedDecimal256::zero(), + SignedDecimal256(Int256::from(2i128)), + SignedDecimal256(Int256::from(2i128)), + SignedDecimal256(Int256::from(-2i128)), + ]; + assert_eq!( + items.iter().sum::(), + SignedDecimal256(Int256::from(2i128)) + ); + assert_eq!( + items.into_iter().sum::(), + SignedDecimal256(Int256::from(2i128)) + ); + + let empty: Vec = vec![]; + assert_eq!( + SignedDecimal256::zero(), + empty.iter().sum::() + ); + } + + #[test] + fn signed_decimal_256_serialize() { + assert_eq!( + serde_json::to_vec(&SignedDecimal256::zero()).unwrap(), + br#""0""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal256::one()).unwrap(), + br#""1""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal256::percent(8)).unwrap(), + br#""0.08""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal256::percent(87)).unwrap(), + br#""0.87""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal256::percent(876)).unwrap(), + br#""8.76""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal256::percent(8765)).unwrap(), + br#""87.65""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal256::percent(-87654)).unwrap(), + br#""-876.54""# + ); + assert_eq!( + serde_json::to_vec(&SignedDecimal256::negative_one()).unwrap(), + br#""-1""# + ); + assert_eq!( + serde_json::to_vec(&-SignedDecimal256::percent(8)).unwrap(), + br#""-0.08""# + ); + } + + #[test] + fn signed_decimal_256_deserialize() { + assert_eq!( + serde_json::from_slice::(br#""0""#).unwrap(), + SignedDecimal256::zero() + ); + assert_eq!( + serde_json::from_slice::(br#""1""#).unwrap(), + SignedDecimal256::one() + ); + assert_eq!( + serde_json::from_slice::(br#""000""#).unwrap(), + SignedDecimal256::zero() + ); + assert_eq!( + serde_json::from_slice::(br#""001""#).unwrap(), + SignedDecimal256::one() + ); + + assert_eq!( + serde_json::from_slice::(br#""0.08""#).unwrap(), + SignedDecimal256::percent(8) + ); + assert_eq!( + serde_json::from_slice::(br#""0.87""#).unwrap(), + SignedDecimal256::percent(87) + ); + assert_eq!( + serde_json::from_slice::(br#""8.76""#).unwrap(), + SignedDecimal256::percent(876) + ); + assert_eq!( + serde_json::from_slice::(br#""87.65""#).unwrap(), + SignedDecimal256::percent(8765) + ); + + // negative numbers + assert_eq!( + serde_json::from_slice::(br#""-0""#).unwrap(), + SignedDecimal256::zero() + ); + assert_eq!( + serde_json::from_slice::(br#""-1""#).unwrap(), + SignedDecimal256::negative_one() + ); + assert_eq!( + serde_json::from_slice::(br#""-001""#).unwrap(), + SignedDecimal256::negative_one() + ); + assert_eq!( + serde_json::from_slice::(br#""-0.08""#).unwrap(), + SignedDecimal256::percent(-8) + ); + } + + #[test] + fn signed_decimal_256_abs_diff_works() { + let a = SignedDecimal256::percent(285); + let b = SignedDecimal256::percent(200); + let expected = Decimal256::percent(85); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + + let a = SignedDecimal256::percent(-200); + let b = SignedDecimal256::percent(200); + let expected = Decimal256::percent(400); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + + let a = SignedDecimal256::percent(-200); + let b = SignedDecimal256::percent(-240); + let expected = Decimal256::percent(40); + assert_eq!(a.abs_diff(b), expected); + assert_eq!(b.abs_diff(a), expected); + } + + #[test] + #[allow(clippy::op_ref)] + fn signed_decimal_256_rem_works() { + // 4.02 % 1.11 = 0.69 + assert_eq!( + SignedDecimal256::percent(402) % SignedDecimal256::percent(111), + SignedDecimal256::percent(69) + ); + + // 15.25 % 4 = 3.25 + assert_eq!( + SignedDecimal256::percent(1525) % SignedDecimal256::percent(400), + SignedDecimal256::percent(325) + ); + + // -20.25 % 5 = -25 + assert_eq!( + SignedDecimal256::percent(-2025) % SignedDecimal256::percent(500), + SignedDecimal256::percent(-25) + ); + + let a = SignedDecimal256::percent(318); + let b = SignedDecimal256::percent(317); + let expected = SignedDecimal256::percent(1); + assert_eq!(a % b, expected); + assert_eq!(a % &b, expected); + assert_eq!(&a % b, expected); + assert_eq!(&a % &b, expected); + } + + #[test] + fn signed_decimal_256_rem_assign_works() { + let mut a = SignedDecimal256::percent(17673); + a %= SignedDecimal256::percent(2362); + assert_eq!(a, SignedDecimal256::percent(1139)); // 176.73 % 23.62 = 11.39 + + let mut a = SignedDecimal256::percent(4262); + let b = SignedDecimal256::percent(1270); + a %= &b; + assert_eq!(a, SignedDecimal256::percent(452)); // 42.62 % 12.7 = 4.52 + + let mut a = SignedDecimal256::percent(-4262); + let b = SignedDecimal256::percent(1270); + a %= &b; + assert_eq!(a, SignedDecimal256::percent(-452)); // -42.62 % 12.7 = -4.52 + } + + #[test] + #[should_panic(expected = "divisor of zero")] + fn signed_decimal_256_rem_panics_for_zero() { + let _ = SignedDecimal256::percent(777) % SignedDecimal256::zero(); + } + + #[test] + fn signed_decimal_256_checked_methods() { + // checked add + assert_eq!( + SignedDecimal256::percent(402) + .checked_add(SignedDecimal256::percent(111)) + .unwrap(), + SignedDecimal256::percent(513) + ); + assert!(matches!( + SignedDecimal256::MAX.checked_add(SignedDecimal256::percent(1)), + Err(OverflowError { .. }) + )); + assert!(matches!( + SignedDecimal256::MIN.checked_add(SignedDecimal256::percent(-1)), + Err(OverflowError { .. }) + )); + + // checked sub + assert_eq!( + SignedDecimal256::percent(1111) + .checked_sub(SignedDecimal256::percent(111)) + .unwrap(), + SignedDecimal256::percent(1000) + ); + assert_eq!( + SignedDecimal256::zero() + .checked_sub(SignedDecimal256::percent(1)) + .unwrap(), + SignedDecimal256::percent(-1) + ); + assert!(matches!( + SignedDecimal256::MIN.checked_sub(SignedDecimal256::percent(1)), + Err(OverflowError { .. }) + )); + assert!(matches!( + SignedDecimal256::MAX.checked_sub(SignedDecimal256::percent(-1)), + Err(OverflowError { .. }) + )); + + // checked div + assert_eq!( + SignedDecimal256::percent(30) + .checked_div(SignedDecimal256::percent(200)) + .unwrap(), + SignedDecimal256::percent(15) + ); + assert_eq!( + SignedDecimal256::percent(88) + .checked_div(SignedDecimal256::percent(20)) + .unwrap(), + SignedDecimal256::percent(440) + ); + assert!(matches!( + SignedDecimal256::MAX.checked_div(SignedDecimal256::zero()), + Err(CheckedFromRatioError::DivideByZero) + )); + assert!(matches!( + SignedDecimal256::MAX.checked_div(SignedDecimal256::percent(1)), + Err(CheckedFromRatioError::Overflow) + )); + assert_eq!( + SignedDecimal256::percent(-88) + .checked_div(SignedDecimal256::percent(20)) + .unwrap(), + SignedDecimal256::percent(-440) + ); + assert_eq!( + SignedDecimal256::percent(-88) + .checked_div(SignedDecimal256::percent(-20)) + .unwrap(), + SignedDecimal256::percent(440) + ); + + // checked rem + assert_eq!( + SignedDecimal256::percent(402) + .checked_rem(SignedDecimal256::percent(111)) + .unwrap(), + SignedDecimal256::percent(69) + ); + assert_eq!( + SignedDecimal256::percent(1525) + .checked_rem(SignedDecimal256::percent(400)) + .unwrap(), + SignedDecimal256::percent(325) + ); + assert_eq!( + SignedDecimal256::percent(-1525) + .checked_rem(SignedDecimal256::percent(400)) + .unwrap(), + SignedDecimal256::percent(-325) + ); + assert_eq!( + SignedDecimal256::percent(-1525) + .checked_rem(SignedDecimal256::percent(-400)) + .unwrap(), + SignedDecimal256::percent(-325) + ); + assert!(matches!( + SignedDecimal256::MAX.checked_rem(SignedDecimal256::zero()), + Err(DivideByZeroError { .. }) + )); + } + + #[test] + fn signed_decimal_256_pow_works() { + assert_eq!( + SignedDecimal256::percent(200).pow(2), + SignedDecimal256::percent(400) + ); + assert_eq!( + SignedDecimal256::percent(-200).pow(2), + SignedDecimal256::percent(400) + ); + assert_eq!( + SignedDecimal256::percent(-200).pow(3), + SignedDecimal256::percent(-800) + ); + assert_eq!( + SignedDecimal256::percent(200).pow(10), + SignedDecimal256::percent(102400) + ); + } + + #[test] + #[should_panic] + fn signed_decimal_256_pow_overflow_panics() { + _ = SignedDecimal256::MAX.pow(2u32); + } + + #[test] + fn signed_decimal_256_saturating_works() { + assert_eq!( + SignedDecimal256::percent(200).saturating_add(SignedDecimal256::percent(200)), + SignedDecimal256::percent(400) + ); + assert_eq!( + SignedDecimal256::percent(-200).saturating_add(SignedDecimal256::percent(200)), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256::percent(-200).saturating_add(SignedDecimal256::percent(-200)), + SignedDecimal256::percent(-400) + ); + assert_eq!( + SignedDecimal256::MAX.saturating_add(SignedDecimal256::percent(200)), + SignedDecimal256::MAX + ); + assert_eq!( + SignedDecimal256::MIN.saturating_add(SignedDecimal256::percent(-1)), + SignedDecimal256::MIN + ); + assert_eq!( + SignedDecimal256::percent(200).saturating_sub(SignedDecimal256::percent(100)), + SignedDecimal256::percent(100) + ); + assert_eq!( + SignedDecimal256::percent(-200).saturating_sub(SignedDecimal256::percent(100)), + SignedDecimal256::percent(-300) + ); + assert_eq!( + SignedDecimal256::percent(-200).saturating_sub(SignedDecimal256::percent(-100)), + SignedDecimal256::percent(-100) + ); + assert_eq!( + SignedDecimal256::zero().saturating_sub(SignedDecimal256::percent(200)), + SignedDecimal256::from_str("-2").unwrap() + ); + assert_eq!( + SignedDecimal256::MIN.saturating_sub(SignedDecimal256::percent(200)), + SignedDecimal256::MIN + ); + assert_eq!( + SignedDecimal256::MAX.saturating_sub(SignedDecimal256::percent(-200)), + SignedDecimal256::MAX + ); + assert_eq!( + SignedDecimal256::percent(200).saturating_mul(SignedDecimal256::percent(50)), + SignedDecimal256::percent(100) + ); + assert_eq!( + SignedDecimal256::percent(-200).saturating_mul(SignedDecimal256::percent(50)), + SignedDecimal256::percent(-100) + ); + assert_eq!( + SignedDecimal256::percent(-200).saturating_mul(SignedDecimal256::percent(-50)), + SignedDecimal256::percent(100) + ); + assert_eq!( + SignedDecimal256::MAX.saturating_mul(SignedDecimal256::percent(200)), + SignedDecimal256::MAX + ); + assert_eq!( + SignedDecimal256::MIN.saturating_mul(SignedDecimal256::percent(200)), + SignedDecimal256::MIN + ); + assert_eq!( + SignedDecimal256::MIN.saturating_mul(SignedDecimal256::percent(-200)), + SignedDecimal256::MAX + ); + assert_eq!( + SignedDecimal256::percent(400).saturating_pow(2u32), + SignedDecimal256::percent(1600) + ); + assert_eq!( + SignedDecimal256::MAX.saturating_pow(2u32), + SignedDecimal256::MAX + ); + assert_eq!( + SignedDecimal256::MAX.saturating_pow(3u32), + SignedDecimal256::MAX + ); + assert_eq!( + SignedDecimal256::MIN.saturating_pow(2u32), + SignedDecimal256::MAX + ); + assert_eq!( + SignedDecimal256::MIN.saturating_pow(3u32), + SignedDecimal256::MIN + ); + } + + #[test] + fn signed_decimal_256_rounding() { + assert_eq!(SignedDecimal256::one().floor(), SignedDecimal256::one()); + assert_eq!( + SignedDecimal256::percent(150).floor(), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256::percent(199).floor(), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256::percent(200).floor(), + SignedDecimal256::percent(200) + ); + assert_eq!( + SignedDecimal256::percent(99).floor(), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256(Int256::from(1i128)).floor(), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256(Int256::from(-1i128)).floor(), + SignedDecimal256::negative_one() + ); + assert_eq!( + SignedDecimal256::permille(-1234).floor(), + SignedDecimal256::percent(-200) + ); + + assert_eq!(SignedDecimal256::one().ceil(), SignedDecimal256::one()); + assert_eq!( + SignedDecimal256::percent(150).ceil(), + SignedDecimal256::percent(200) + ); + assert_eq!( + SignedDecimal256::percent(199).ceil(), + SignedDecimal256::percent(200) + ); + assert_eq!( + SignedDecimal256::percent(99).ceil(), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256(Int256::from(1i128)).ceil(), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256(Int256::from(-1i128)).ceil(), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256::permille(-1234).ceil(), + SignedDecimal256::negative_one() + ); + + assert_eq!(SignedDecimal256::one().trunc(), SignedDecimal256::one()); + assert_eq!( + SignedDecimal256::percent(150).trunc(), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256::percent(199).trunc(), + SignedDecimal256::one() + ); + assert_eq!( + SignedDecimal256::percent(200).trunc(), + SignedDecimal256::percent(200) + ); + assert_eq!( + SignedDecimal256::percent(99).trunc(), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256(Int256::from(1i128)).trunc(), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256(Int256::from(-1i128)).trunc(), + SignedDecimal256::zero() + ); + assert_eq!( + SignedDecimal256::permille(-1234).trunc(), + SignedDecimal256::negative_one() + ); + } + + #[test] + #[should_panic(expected = "attempt to ceil with overflow")] + fn signed_decimal_256_ceil_panics() { + let _ = SignedDecimal256::MAX.ceil(); + } + + #[test] + #[should_panic(expected = "attempt to floor with overflow")] + fn signed_decimal_256_floor_panics() { + let _ = SignedDecimal256::MIN.floor(); + } + + #[test] + fn signed_decimal_256_checked_ceil() { + assert_eq!( + SignedDecimal256::percent(199).checked_ceil(), + Ok(SignedDecimal256::percent(200)) + ); + assert_eq!( + SignedDecimal256::MAX.checked_ceil(), + Err(RoundUpOverflowError) + ); + } + + #[test] + fn signed_decimal_256_checked_floor() { + assert_eq!( + SignedDecimal256::percent(199).checked_floor(), + Ok(SignedDecimal256::one()) + ); + assert_eq!( + SignedDecimal256::percent(-199).checked_floor(), + Ok(SignedDecimal256::percent(-200)) + ); + assert_eq!( + SignedDecimal256::MIN.checked_floor(), + Err(RoundDownOverflowError) + ); + assert_eq!( + SignedDecimal256::negative_one().checked_floor(), + Ok(SignedDecimal256::negative_one()) + ); + } + + #[test] + fn signed_decimal_256_to_int_floor_works() { + let d = SignedDecimal256::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(12)); + let d = SignedDecimal256::from_str("12.345").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(12)); + let d = SignedDecimal256::from_str("12.999").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(12)); + let d = SignedDecimal256::from_str("0.98451384").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(0)); + let d = SignedDecimal256::from_str("-12.000000000000000001").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(-13)); + let d = SignedDecimal256::from_str("-12.345").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(-13)); + let d = SignedDecimal256::from_str("0.0001").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(0)); + let d = SignedDecimal256::from_str("75.0").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(75)); + let d = SignedDecimal256::from_str("0.0").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(0)); + let d = SignedDecimal256::from_str("-0.0").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(0)); + let d = SignedDecimal256::from_str("-0.0001").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(-1)); + let d = SignedDecimal256::from_str("-75.0").unwrap(); + assert_eq!(d.to_int_floor(), Int256::from(-75)); + + let d = SignedDecimal256::MAX; + assert_eq!( + d.to_int_floor(), + Int256::from_str("57896044618658097711785492504343953926634992332820282019728") + .unwrap() + ); + let d = SignedDecimal256::MIN; + assert_eq!( + d.to_int_floor(), + Int256::from_str("-57896044618658097711785492504343953926634992332820282019729") + .unwrap() + ); + } + + #[test] + fn signed_decimal_256_to_int_ceil_works() { + let d = SignedDecimal256::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_int_ceil(), Int256::from(13)); + let d = SignedDecimal256::from_str("12.345").unwrap(); + assert_eq!(d.to_int_ceil(), Int256::from(13)); + let d = SignedDecimal256::from_str("12.999").unwrap(); + assert_eq!(d.to_int_ceil(), Int256::from(13)); + let d = SignedDecimal256::from_str("-12.000000000000000001").unwrap(); + assert_eq!(d.to_int_ceil(), Int256::from(-12)); + let d = SignedDecimal256::from_str("-12.345").unwrap(); + assert_eq!(d.to_int_ceil(), Int256::from(-12)); + + let d = SignedDecimal256::from_str("75.0").unwrap(); + assert_eq!(d.to_int_ceil(), Int256::from(75)); + let d = SignedDecimal256::from_str("0.0").unwrap(); + assert_eq!(d.to_int_ceil(), Int256::from(0)); + let d = SignedDecimal256::from_str("-75.0").unwrap(); + assert_eq!(d.to_int_ceil(), Int256::from(-75)); + + let d = SignedDecimal256::MAX; + assert_eq!( + d.to_int_ceil(), + Int256::from_str("57896044618658097711785492504343953926634992332820282019729") + .unwrap() + ); + let d = SignedDecimal256::MIN; + assert_eq!( + d.to_int_ceil(), + Int256::from_str("-57896044618658097711785492504343953926634992332820282019728") + .unwrap() + ); + } + + #[test] + fn signed_decimal_256_to_int_trunc_works() { + let d = SignedDecimal256::from_str("12.000000000000000001").unwrap(); + assert_eq!(d.to_int_trunc(), Int256::from(12)); + let d = SignedDecimal256::from_str("12.345").unwrap(); + assert_eq!(d.to_int_trunc(), Int256::from(12)); + let d = SignedDecimal256::from_str("12.999").unwrap(); + assert_eq!(d.to_int_trunc(), Int256::from(12)); + let d = SignedDecimal256::from_str("-12.000000000000000001").unwrap(); + assert_eq!(d.to_int_trunc(), Int256::from(-12)); + let d = SignedDecimal256::from_str("-12.345").unwrap(); + assert_eq!(d.to_int_trunc(), Int256::from(-12)); + + let d = SignedDecimal256::from_str("75.0").unwrap(); + assert_eq!(d.to_int_trunc(), Int256::from(75)); + let d = SignedDecimal256::from_str("0.0").unwrap(); + assert_eq!(d.to_int_trunc(), Int256::from(0)); + let d = SignedDecimal256::from_str("-75.0").unwrap(); + assert_eq!(d.to_int_trunc(), Int256::from(-75)); + + let d = SignedDecimal256::MAX; + assert_eq!( + d.to_int_trunc(), + Int256::from_str("57896044618658097711785492504343953926634992332820282019728") + .unwrap() + ); + let d = SignedDecimal256::MIN; + assert_eq!( + d.to_int_trunc(), + Int256::from_str("-57896044618658097711785492504343953926634992332820282019728") + .unwrap() + ); + } + + #[test] + fn signed_decimal_256_neg_works() { + assert_eq!( + -SignedDecimal256::percent(50), + SignedDecimal256::percent(-50) + ); + assert_eq!(-SignedDecimal256::one(), SignedDecimal256::negative_one()); + } + + #[test] + fn signed_decimal_256_partial_eq() { + let test_cases = [ + ("1", "1", true), + ("0.5", "0.5", true), + ("0.5", "0.51", false), + ("0", "0.00000", true), + ("-1", "-1", true), + ("-0.5", "-0.5", true), + ("-0.5", "0.5", false), + ("-0.5", "-0.51", false), + ("-0", "-0.00000", true), + ] + .into_iter() + .map(|(lhs, rhs, expected)| (dec(lhs), dec(rhs), expected)); + + #[allow(clippy::op_ref)] + for (lhs, rhs, expected) in test_cases { + assert_eq!(lhs == rhs, expected); + assert_eq!(&lhs == rhs, expected); + assert_eq!(lhs == &rhs, expected); + assert_eq!(&lhs == &rhs, expected); + } + } + + #[test] + fn signed_decimal_256_implements_debug() { + let decimal = SignedDecimal256::from_str("123.45").unwrap(); + assert_eq!(format!("{decimal:?}"), "SignedDecimal256(123.45)"); + + let test_cases = ["5", "5.01", "42", "0", "2", "-0.000001"]; + for s in test_cases { + let decimal = SignedDecimal256::from_str(s).unwrap(); + let expected = format!("SignedDecimal256({s})"); + assert_eq!(format!("{decimal:?}"), expected); + } + } + + #[test] + fn signed_decimal_256_can_be_instantiated_from_decimal() { + let d: SignedDecimal256 = Decimal::one().into(); + assert_eq!(d, SignedDecimal256::one()); + } + + #[test] + fn signed_decimal_256_can_be_instantiated_from_decimal_256() { + let d: SignedDecimal256 = Decimal256::zero().try_into().unwrap(); + assert_eq!(d, SignedDecimal256::zero()); + } + + #[test] + fn signed_decimal_256_may_fail_when_instantiated_from_decimal_256() { + let err = >::try_into(Decimal256::MAX).unwrap_err(); + assert_eq!("SignedDecimal256RangeExceeded", format!("{err:?}")); + assert_eq!("SignedDecimal256 range exceeded", format!("{err}")); + } + + #[test] + fn signed_decimal_256_can_be_serialized_and_deserialized() { + // properly deserialized + let value: SignedDecimal256 = serde_json::from_str(r#""123""#).unwrap(); + assert_eq!(SignedDecimal256::from_str("123").unwrap(), value); + + // properly serialized + let value = SignedDecimal256::from_str("456").unwrap(); + assert_eq!(r#""456""#, serde_json::to_string(&value).unwrap()); + + // invalid: not a string encoded decimal + assert_eq!( + "invalid type: integer `123`, expected string-encoded decimal at line 1 column 3", + serde_json::from_str::("123") + .err() + .unwrap() + .to_string() + ); + + // invalid: not properly defined signed decimal value + assert_eq!( + "Error parsing decimal '1.e': kind: Parsing, error: invalid digit found in string at line 1 column 5", + serde_json::from_str::(r#""1.e""#) + .err() + .unwrap() + .to_string() + ); + } + + #[test] + fn signed_decimal_256_has_defined_json_schema() { + let schema = schemars::schema_for!(SignedDecimal256); + assert_eq!( + "SignedDecimal256", + schema.schema.metadata.unwrap().title.unwrap() + ); + } +} diff --git a/packages/std/src/math/uint128.rs b/packages/std/src/math/uint128.rs index f6d8041184..7a41dea424 100644 --- a/packages/std/src/math/uint128.rs +++ b/packages/std/src/math/uint128.rs @@ -1,16 +1,26 @@ -use forward_ref::{forward_ref_binop, forward_ref_op_assign}; -use schemars::JsonSchema; -use serde::{de, ser, Deserialize, Deserializer, Serialize}; -use std::fmt::{self}; -use std::ops::{ - Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Shr, ShrAssign, Sub, SubAssign, +use alloc::string::{String, ToString}; +use core::fmt; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Not, Rem, RemAssign, Shl, ShlAssign, Shr, + ShrAssign, Sub, SubAssign, }; -use std::str::FromStr; +use core::str::FromStr; use crate::errors::{ - CheckedMultiplyRatioError, DivideByZeroError, OverflowError, OverflowOperation, StdError, + CheckedMultiplyFractionError, CheckedMultiplyRatioError, DivideByZeroError, ErrorKind, + OverflowError, OverflowOperation, StdError, }; -use crate::{ConversionOverflowError, Uint256, Uint64}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + __internal::forward_ref_partial_eq, impl_mul_fraction, Fraction, Int128, Int256, Int512, Int64, + Uint256, Uint64, +}; + +use super::conversion::{ + forward_try_from, from_and_to_bytes, primitive_to_wrapped_int, wrapped_int_to_primitive, +}; +use super::impl_int_serde; +use super::num_consts::NumConsts; /// A thin wrapper around u128 that is using strings for JSON encoding/decoding, /// such that the full u128 range can be used for clients that convert JSON numbers to floats, @@ -31,8 +41,23 @@ use crate::{ConversionOverflowError, Uint256, Uint64}; /// let c = Uint128::from(70u32); /// assert_eq!(c.u128(), 70); /// ``` -#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, JsonSchema)] -pub struct Uint128(#[schemars(with = "String")] u128); +#[derive( + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Integer { precision: 128, signed: false })] +pub struct Uint128(#[schemars(with = "String")] pub(crate) u128); + +impl_int_serde!(Uint128); +forward_ref_partial_eq!(Uint128, Uint128); impl Uint128 { pub const MAX: Self = Self(u128::MAX); @@ -41,6 +66,8 @@ impl Uint128 { /// Creates a Uint128(value). /// /// This method is less flexible than `from` but can be called in a const context. + #[inline] + #[must_use] pub const fn new(value: u128) -> Self { Uint128(value) } @@ -62,28 +89,36 @@ impl Uint128 { self.0 } - /// Returns a copy of the number as big endian bytes. - pub const fn to_be_bytes(self) -> [u8; 16] { - self.0.to_be_bytes() - } - - /// Returns a copy of the number as little endian bytes. - pub const fn to_le_bytes(self) -> [u8; 16] { - self.0.to_le_bytes() - } + from_and_to_bytes!(u128, 16); + #[must_use] pub const fn is_zero(&self) -> bool { self.0 == 0 } - pub fn pow(self, exp: u32) -> Self { - self.0.pow(exp).into() + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn pow(self, exp: u32) -> Self { + match self.0.checked_pow(exp) { + Some(val) => Self(val), + None => panic!("attempt to exponentiate with overflow"), + } + } + + /// Returns the base 2 logarithm of the number, rounded down. + /// + /// # Panics + /// + /// This function will panic if `self` is zero. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn ilog2(self) -> u32 { + self.0.checked_ilog2().unwrap() } /// Returns `self * numerator / denominator`. /// /// Due to the nature of the integer division involved, the result is always floored. /// E.g. 5 * 99/100 = 4. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn multiply_ratio, B: Into>( &self, numerator: A, @@ -130,8 +165,9 @@ impl Uint128 { /// let result = a.full_mul(2u32); /// assert_eq!(result.to_string(), "680564733841876926926749214863536422910"); /// ``` - pub fn full_mul(self, rhs: impl Into) -> Uint256 { - Uint256::from(self.u128()) + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn full_mul(self, rhs: impl Into) -> Uint256 { + Uint256::from(self) .checked_mul(Uint256::from(rhs.into())) .unwrap() } @@ -140,87 +176,134 @@ impl Uint128 { self.0 .checked_add(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Add, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Add)) } pub fn checked_sub(self, other: Self) -> Result { self.0 .checked_sub(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Sub, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Sub)) } pub fn checked_mul(self, other: Self) -> Result { self.0 .checked_mul(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Mul, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Mul)) } pub fn checked_pow(self, exp: u32) -> Result { self.0 .checked_pow(exp) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Pow, self, exp)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Pow)) } pub fn checked_div(self, other: Self) -> Result { self.0 .checked_div(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) } pub fn checked_div_euclid(self, other: Self) -> Result { self.0 .checked_div_euclid(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) } pub fn checked_rem(self, other: Self) -> Result { self.0 .checked_rem(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) + } + + pub fn checked_shr(self, other: u32) -> Result { + if other >= 128 { + return Err(OverflowError::new(OverflowOperation::Shr)); + } + + Ok(Self(self.0.shr(other))) + } + + pub fn checked_shl(self, other: u32) -> Result { + if other >= 128 { + return Err(OverflowError::new(OverflowOperation::Shl)); + } + + Ok(Self(self.0.shl(other))) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_add(self, other: Self) -> Self { Self(self.0.wrapping_add(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_sub(self, other: Self) -> Self { Self(self.0.wrapping_sub(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_mul(self, other: Self) -> Self { Self(self.0.wrapping_mul(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_pow(self, other: u32) -> Self { Self(self.0.wrapping_pow(other)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_add(self, other: Self) -> Self { Self(self.0.saturating_add(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_sub(self, other: Self) -> Self { Self(self.0.saturating_sub(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_mul(self, other: Self) -> Self { Self(self.0.saturating_mul(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_pow(self, exp: u32) -> Self { Self(self.0.saturating_pow(exp)) } + /// Strict integer addition. Computes `self + rhs`, panicking if overflow occurred. + /// + /// This is the same as [`Uint128::add`] but const. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn strict_add(self, rhs: Self) -> Self { + match self.0.checked_add(rhs.u128()) { + None => panic!("attempt to add with overflow"), + Some(sum) => Self(sum), + } + } + + /// Strict integer subtraction. Computes `self - rhs`, panicking if overflow occurred. + /// + /// This is the same as [`Uint128::sub`] but const. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn strict_sub(self, other: Self) -> Self { + match self.0.checked_sub(other.u128()) { + None => panic!("attempt to subtract with overflow"), + Some(diff) => Self(diff), + } + } + + #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn abs_diff(self, other: Self) -> Self { Self(if self.0 < other.0 { other.0 - self.0 @@ -230,56 +313,43 @@ impl Uint128 { } } +impl NumConsts for Uint128 { + const ZERO: Self = Self::zero(); + const ONE: Self = Self::one(); + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; +} + +impl_mul_fraction!(Uint128); + // `From` is implemented manually instead of // using `impl> From for Uint128` because // of the conflict with `TryFrom<&str>` as described here // https://stackoverflow.com/questions/63136970/how-do-i-work-around-the-upstream-crates-may-add-a-new-impl-of-trait-error +// uint to Uint +primitive_to_wrapped_int!(u8, Uint128); +primitive_to_wrapped_int!(u16, Uint128); +primitive_to_wrapped_int!(u32, Uint128); +primitive_to_wrapped_int!(u64, Uint128); +primitive_to_wrapped_int!(u128, Uint128); + +// Uint to uint +wrapped_int_to_primitive!(Uint128, u128); + impl From for Uint128 { fn from(val: Uint64) -> Self { val.u64().into() } } -impl From for Uint128 { - fn from(val: u128) -> Self { - Uint128(val) - } -} - -impl From for Uint128 { - fn from(val: u64) -> Self { - Uint128(val.into()) - } -} - -impl From for Uint128 { - fn from(val: u32) -> Self { - Uint128(val.into()) - } -} - -impl From for Uint128 { - fn from(val: u16) -> Self { - Uint128(val.into()) - } -} - -impl From for Uint128 { - fn from(val: u8) -> Self { - Uint128(val.into()) - } -} +forward_try_from!(Uint128, Uint64); -impl TryFrom for Uint64 { - type Error = ConversionOverflowError; - - fn try_from(value: Uint128) -> Result { - Ok(Uint64::new(value.0.try_into().map_err(|_| { - ConversionOverflowError::new("Uint128", "Uint64", value.to_string()) - })?)) - } -} +// Int to Uint +forward_try_from!(Int64, Uint128); +forward_try_from!(Int128, Uint128); +forward_try_from!(Int256, Uint128); +forward_try_from!(Int512, Uint128); impl TryFrom<&str> for Uint128 { type Error = StdError; @@ -295,7 +365,9 @@ impl FromStr for Uint128 { fn from_str(s: &str) -> Result { match s.parse::() { Ok(u) => Ok(Uint128(u)), - Err(e) => Err(StdError::generic_err(format!("Parsing u128: {}", e))), + Err(e) => { + Err(StdError::msg(format_args!("Parsing u128: {e}")).with_kind(ErrorKind::Parsing)) + } } } } @@ -306,12 +378,6 @@ impl From for String { } } -impl From for u128 { - fn from(original: Uint128) -> Self { - original.0 - } -} - impl fmt::Display for Uint128 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.0.fmt(f) @@ -322,31 +388,16 @@ impl Add for Uint128 { type Output = Self; fn add(self, rhs: Self) -> Self { - Uint128( - self.u128() - .checked_add(rhs.u128()) - .expect("attempt to add with overflow"), - ) - } -} - -impl<'a> Add<&'a Uint128> for Uint128 { - type Output = Self; - - fn add(self, rhs: &'a Uint128) -> Self { - self + *rhs + self.strict_add(rhs) } } +forward_ref_binop!(impl Add, add for Uint128, Uint128); impl Sub for Uint128 { type Output = Self; fn sub(self, rhs: Self) -> Self { - Uint128( - self.u128() - .checked_sub(rhs.u128()) - .expect("attempt to subtract with overflow"), - ) + self.strict_sub(rhs) } } forward_ref_binop!(impl Sub, sub for Uint128, Uint128); @@ -418,6 +469,26 @@ impl<'a> Shr<&'a u32> for Uint128 { } } +impl Shl for Uint128 { + type Output = Self; + + fn shl(self, rhs: u32) -> Self::Output { + Self( + self.u128() + .checked_shl(rhs) + .expect("attempt to shift left with overflow"), + ) + } +} + +impl<'a> Shl<&'a u32> for Uint128 { + type Output = Self; + + fn shl(self, rhs: &'a u32) -> Self::Output { + self.shl(*rhs) + } +} + impl AddAssign for Uint128 { fn add_assign(&mut self, rhs: Uint128) { *self = *self + rhs; @@ -455,6 +526,14 @@ impl Rem for Uint128 { } forward_ref_binop!(impl Rem, rem for Uint128, Uint128); +impl Not for Uint128 { + type Output = Self; + + fn not(self) -> Self::Output { + Self(!self.0) + } +} + impl RemAssign for Uint128 { fn rem_assign(&mut self, rhs: Uint128) { *self = *self % rhs; @@ -474,47 +553,19 @@ impl<'a> ShrAssign<&'a u32> for Uint128 { } } -impl Serialize for Uint128 { - /// Serializes as an integer string using base 10 - fn serialize(&self, serializer: S) -> Result - where - S: ser::Serializer, - { - serializer.serialize_str(&self.to_string()) +impl ShlAssign for Uint128 { + fn shl_assign(&mut self, rhs: u32) { + *self = Shl::::shl(*self, rhs); } } -impl<'de> Deserialize<'de> for Uint128 { - /// Deserialized from an integer string using base 10 - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - deserializer.deserialize_str(Uint128Visitor) +impl<'a> ShlAssign<&'a u32> for Uint128 { + fn shl_assign(&mut self, rhs: &'a u32) { + *self = Shl::::shl(*self, *rhs); } } -struct Uint128Visitor; - -impl<'de> de::Visitor<'de> for Uint128Visitor { - type Value = Uint128; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("string-encoded integer") - } - - fn visit_str(self, v: &str) -> Result - where - E: de::Error, - { - match v.parse::() { - Ok(u) => Ok(Uint128(u)), - Err(e) => Err(E::custom(format!("invalid Uint128 '{}' - {}", v, e))), - } - } -} - -impl std::iter::Sum for Uint128 +impl core::iter::Sum for Uint128 where Self: Add, { @@ -523,22 +574,26 @@ where } } -impl PartialEq<&Uint128> for Uint128 { - fn eq(&self, rhs: &&Uint128) -> bool { - self == *rhs - } -} - -impl PartialEq for &Uint128 { - fn eq(&self, rhs: &Uint128) -> bool { - *self == rhs - } -} - #[cfg(test)] mod tests { + use crate::errors::CheckedMultiplyFractionError::{ConversionOverflow, DivideByZero}; + use crate::math::conversion::test_try_from_int_to_uint; + use crate::{ConversionOverflowError, Decimal}; + use super::*; - use crate::{from_slice, to_vec}; + + #[test] + fn size_of_works() { + assert_eq!(core::mem::size_of::(), 16); + } + + #[test] + fn uint128_not_works() { + assert_eq!(!Uint128::new(1234806), Uint128::new(!1234806)); + + assert_eq!(!Uint128::MAX, Uint128::new(!u128::MAX)); + assert_eq!(!Uint128::MIN, Uint128::new(!u128::MIN)); + } #[test] fn uint128_zero_works() { @@ -558,6 +613,68 @@ mod tests { ); } + #[test] + fn uint128_from_be_bytes_works() { + // zero + let original = [0; 16]; + let num = Uint128::from_be_bytes(original); + assert!(num.is_zero()); + + // one + let original = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]; + let num = Uint128::from_be_bytes(original); + assert_eq!(num.u128(), 1); + + // 258 + let original = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2]; + let num = Uint128::from_be_bytes(original); + assert_eq!(num.u128(), 258); + + // 2x roundtrip + let original = [1; 16]; + let num = Uint128::from_be_bytes(original); + let a: [u8; 16] = num.to_be_bytes(); + assert_eq!(a, original); + + let original = [ + 0u8, 222u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let num = Uint128::from_be_bytes(original); + let resulting_bytes: [u8; 16] = num.to_be_bytes(); + assert_eq!(resulting_bytes, original); + } + + #[test] + fn uint128_from_le_bytes_works() { + // zero + let original = [0; 16]; + let num = Uint128::from_le_bytes(original); + assert!(num.is_zero()); + + // one + let original = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + let num = Uint128::from_le_bytes(original); + assert_eq!(num.u128(), 1); + + // 258 + let original = [2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + let num = Uint128::from_le_bytes(original); + assert_eq!(num.u128(), 258); + + // 2x roundtrip + let original = [1; 16]; + let num = Uint128::from_le_bytes(original); + let a: [u8; 16] = num.to_le_bytes(); + assert_eq!(a, original); + + let original = [ + 0u8, 222u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, + ]; + let num = Uint128::from_le_bytes(original); + let resulting_bytes: [u8; 16] = num.to_le_bytes(); + assert_eq!(resulting_bytes, original); + } + #[test] fn uint128_convert_into() { let original = Uint128(12345); @@ -593,21 +710,46 @@ mod tests { assert!(result.is_err()); } + #[test] + fn uint128_try_from_signed_works() { + test_try_from_int_to_uint::("Int64", "Uint128"); + test_try_from_int_to_uint::("Int128", "Uint128"); + test_try_from_int_to_uint::("Int256", "Uint128"); + test_try_from_int_to_uint::("Int512", "Uint128"); + } + + #[test] + fn uint128_try_into() { + assert!(Uint64::try_from(Uint128::MAX).is_err()); + + assert_eq!(Uint64::try_from(Uint128::zero()), Ok(Uint64::zero())); + + assert_eq!( + Uint64::try_from(Uint128::from(42u64)), + Ok(Uint64::from(42u64)) + ); + } + #[test] fn uint128_implements_display() { let a = Uint128(12345); - assert_eq!(format!("Embedded: {}", a), "Embedded: 12345"); + assert_eq!(format!("Embedded: {a}"), "Embedded: 12345"); assert_eq!(a.to_string(), "12345"); let a = Uint128(0); - assert_eq!(format!("Embedded: {}", a), "Embedded: 0"); + assert_eq!(format!("Embedded: {a}"), "Embedded: 0"); assert_eq!(a.to_string(), "0"); } #[test] fn uint128_display_padding_works() { + // width > natural representation + let a = Uint128::from(123u64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: 00123"); + + // width < natural representation let a = Uint128::from(123u64); - assert_eq!(format!("Embedded: {:05}", a), "Embedded: 00123"); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: 123"); } #[test] @@ -670,9 +812,9 @@ mod tests { #[test] fn uint128_json() { let orig = Uint128(1234567890987654321); - let serialized = to_vec(&orig).unwrap(); + let serialized = serde_json::to_vec(&orig).unwrap(); assert_eq!(serialized.as_slice(), b"\"1234567890987654321\""); - let parsed: Uint128 = from_slice(&serialized).unwrap(); + let parsed: Uint128 = serde_json::from_slice(&serialized).unwrap(); assert_eq!(parsed, orig); } @@ -692,10 +834,6 @@ mod tests { let a = Uint128(12345); let b = Uint128(23456); - // test + with owned and reference right hand side - assert_eq!(a + b, Uint128(35801)); - assert_eq!(a + &b, Uint128(35801)); - // test - with owned and reference right hand side assert_eq!(b - a, Uint128(11111)); assert_eq!(b - &a, Uint128(11111)); @@ -718,18 +856,37 @@ mod tests { // error result on underflow (- would produce negative result) let underflow_result = a.checked_sub(b); - let OverflowError { - operand1, operand2, .. - } = underflow_result.unwrap_err(); - assert_eq!((operand1, operand2), (a.to_string(), b.to_string())); + let OverflowError { operation } = underflow_result.unwrap_err(); + assert_eq!(operation, OverflowOperation::Sub); } #[test] - #[should_panic] + #[allow(clippy::op_ref)] + fn uint128_add_works() { + assert_eq!( + Uint128::from(2u32) + Uint128::from(1u32), + Uint128::from(3u32) + ); + assert_eq!( + Uint128::from(2u32) + Uint128::from(0u32), + Uint128::from(2u32) + ); + + // works for refs + let a = Uint128::from(10u32); + let b = Uint128::from(3u32); + let expected = Uint128::from(13u32); + assert_eq!(a + b, expected); + assert_eq!(a + &b, expected); + assert_eq!(&a + b, expected); + assert_eq!(&a + &b, expected); + } + + #[test] + #[should_panic(expected = "attempt to add with overflow")] fn uint128_add_overflow_panics() { - // almost_max is 2^128 - 10 - let almost_max = Uint128(340282366920938463463374607431768211446); - let _ = almost_max + Uint128(12); + let max = Uint128::MAX; + let _ = max + Uint128(12); } #[test] @@ -810,7 +967,7 @@ mod tests { #[test] #[should_panic] fn uint128_pow_overflow_panics() { - Uint128::MAX.pow(2u32); + _ = Uint128::MAX.pow(2u32); } #[test] @@ -827,11 +984,11 @@ mod tests { assert_eq!(base.multiply_ratio(3u128, 2u128), Uint128(750)); assert_eq!(base.multiply_ratio(333333u128, 222222u128), Uint128(750)); - // factor 2/3 (integer devision always floors the result) + // factor 2/3 (integer division always floors the result) assert_eq!(base.multiply_ratio(2u128, 3u128), Uint128(333)); assert_eq!(base.multiply_ratio(222222u128, 333333u128), Uint128(333)); - // factor 5/6 (integer devision always floors the result) + // factor 5/6 (integer division always floors the result) assert_eq!(base.multiply_ratio(5u128, 6u128), Uint128(416)); assert_eq!(base.multiply_ratio(100u128, 120u128), Uint128(416)); } @@ -856,7 +1013,7 @@ mod tests { #[test] #[should_panic(expected = "Denominator must not be zero")] fn uint128_multiply_ratio_panics_for_zero_denominator() { - Uint128(500).multiply_ratio(1u128, 0u128); + _ = Uint128(500).multiply_ratio(1u128, 0u128); } #[test] @@ -871,6 +1028,44 @@ mod tests { ); } + #[test] + fn uint128_shr_works() { + let original = Uint128::new(u128::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8, 0u8, 4u8, 2u8, + ])); + + let shifted = Uint128::new(u128::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 128u8, 1u8, 0u8, + ])); + + assert_eq!(original >> 2u32, shifted); + } + + #[test] + #[should_panic] + fn uint128_shr_overflow_panics() { + let _ = Uint128::from(1u32) >> 128u32; + } + + #[test] + fn uint128_shl_works() { + let original = Uint128::new(u128::from_be_bytes([ + 64u8, 128u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ])); + + let shifted = Uint128::new(u128::from_be_bytes([ + 2u8, 0u8, 4u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ])); + + assert_eq!(original << 2u32, shifted); + } + + #[test] + #[should_panic] + fn uint128_shl_overflow_panics() { + let _ = Uint128::from(1u32) << 128u32; + } + #[test] fn sum_works() { let nums = vec![Uint128(17), Uint128(123), Uint128(540), Uint128(82)]; @@ -1011,6 +1206,37 @@ mod tests { assert_eq!(a, Uint128::from(1u32)); } + #[test] + fn uint128_strict_add_works() { + let a = Uint128::new(5); + let b = Uint128::new(3); + assert_eq!(a.strict_add(b), Uint128::new(8)); + assert_eq!(b.strict_add(a), Uint128::new(8)); + } + + #[test] + #[should_panic(expected = "attempt to add with overflow")] + fn uint128_strict_add_panics_on_overflow() { + let a = Uint128::MAX; + let b = Uint128::ONE; + let _ = a.strict_add(b); + } + + #[test] + fn uint128_strict_sub_works() { + let a = Uint128::new(5); + let b = Uint128::new(3); + assert_eq!(a.strict_sub(b), Uint128::new(2)); + } + + #[test] + #[should_panic(expected = "attempt to subtract with overflow")] + fn uint128_strict_sub_panics_on_overflow() { + let a = Uint128::ZERO; + let b = Uint128::ONE; + let _ = a.strict_sub(b); + } + #[test] fn uint128_abs_diff_works() { let a = Uint128::from(42u32); @@ -1034,4 +1260,304 @@ mod tests { assert_eq!(&lhs == &rhs, expected); } } + + #[test] + fn mul_floor_works_with_zero() { + let fraction = (Uint128::zero(), Uint128::new(21)); + let res = Uint128::new(123456).mul_floor(fraction); + assert_eq!(Uint128::zero(), res) + } + + #[test] + fn mul_floor_does_nothing_with_one() { + let fraction = (Uint128::one(), Uint128::one()); + let res = Uint128::new(123456).mul_floor(fraction); + assert_eq!(Uint128::new(123456), res) + } + + #[test] + fn mul_floor_rounds_down_with_normal_case() { + let fraction = (8u128, 21u128); + let res = Uint128::new(123456).mul_floor(fraction); // 47030.8571 + assert_eq!(Uint128::new(47030), res) + } + + #[test] + fn mul_floor_does_not_round_on_even_divide() { + let fraction = (2u128, 5u128); + let res = Uint128::new(25).mul_floor(fraction); + assert_eq!(Uint128::new(10), res) + } + + #[test] + fn mul_floor_works_when_operation_temporarily_takes_above_max() { + let fraction = (8u128, 21u128); + let res = Uint128::MAX.mul_floor(fraction); // 129_631_377_874_643_224_176_523_659_974_006_937_697.14285 + assert_eq!( + Uint128::new(129_631_377_874_643_224_176_523_659_974_006_937_697), + res + ) + } + + #[test] + fn mul_floor_works_with_decimal() { + let decimal = Decimal::from_ratio(8u128, 21u128); + let res = Uint128::new(123456).mul_floor(decimal); // 47030.8571 + assert_eq!(Uint128::new(47030), res) + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn mul_floor_panics_on_overflow() { + let fraction = (21u128, 8u128); + _ = Uint128::MAX.mul_floor(fraction); + } + + #[test] + fn checked_mul_floor_does_not_panic_on_overflow() { + let fraction = (21u128, 8u128); + assert_eq!( + Uint128::MAX.checked_mul_floor(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint256", + target_type: "Uint128", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn mul_floor_panics_on_zero_div() { + let fraction = (21u128, 0u128); + _ = Uint128::new(123456).mul_floor(fraction); + } + + #[test] + fn checked_mul_floor_does_not_panic_on_zero_div() { + let fraction = (21u128, 0u128); + assert_eq!( + Uint128::new(123456).checked_mul_floor(fraction), + Err(DivideByZero(DivideByZeroError)), + ); + } + + #[test] + fn mul_ceil_works_with_zero() { + let fraction = (Uint128::zero(), Uint128::new(21)); + let res = Uint128::new(123456).mul_ceil(fraction); + assert_eq!(Uint128::zero(), res) + } + + #[test] + fn mul_ceil_does_nothing_with_one() { + let fraction = (Uint128::one(), Uint128::one()); + let res = Uint128::new(123456).mul_ceil(fraction); + assert_eq!(Uint128::new(123456), res) + } + + #[test] + fn mul_ceil_rounds_up_with_normal_case() { + let fraction = (8u128, 21u128); + let res = Uint128::new(123456).mul_ceil(fraction); // 47030.8571 + assert_eq!(Uint128::new(47031), res) + } + + #[test] + fn mul_ceil_does_not_round_on_even_divide() { + let fraction = (2u128, 5u128); + let res = Uint128::new(25).mul_ceil(fraction); + assert_eq!(Uint128::new(10), res) + } + + #[test] + fn mul_ceil_works_when_operation_temporarily_takes_above_max() { + let fraction = (8u128, 21u128); + let res = Uint128::MAX.mul_ceil(fraction); // 129_631_377_874_643_224_176_523_659_974_006_937_697.14285 + assert_eq!( + Uint128::new(129_631_377_874_643_224_176_523_659_974_006_937_698), + res + ) + } + + #[test] + fn mul_ceil_works_with_decimal() { + let decimal = Decimal::from_ratio(8u128, 21u128); + let res = Uint128::new(123456).mul_ceil(decimal); // 47030.8571 + assert_eq!(Uint128::new(47031), res) + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn mul_ceil_panics_on_overflow() { + let fraction = (21u128, 8u128); + _ = Uint128::MAX.mul_ceil(fraction); + } + + #[test] + fn checked_mul_ceil_does_not_panic_on_overflow() { + let fraction = (21u128, 8u128); + assert_eq!( + Uint128::MAX.checked_mul_ceil(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint256", + target_type: "Uint128", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn mul_ceil_panics_on_zero_div() { + let fraction = (21u128, 0u128); + _ = Uint128::new(123456).mul_ceil(fraction); + } + + #[test] + fn checked_mul_ceil_does_not_panic_on_zero_div() { + let fraction = (21u128, 0u128); + assert_eq!( + Uint128::new(123456).checked_mul_ceil(fraction), + Err(DivideByZero(DivideByZeroError)), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn div_floor_raises_with_zero() { + let fraction = (Uint128::zero(), Uint128::new(21)); + _ = Uint128::new(123456).div_floor(fraction); + } + + #[test] + fn div_floor_does_nothing_with_one() { + let fraction = (Uint128::one(), Uint128::one()); + let res = Uint128::new(123456).div_floor(fraction); + assert_eq!(Uint128::new(123456), res) + } + + #[test] + fn div_floor_rounds_down_with_normal_case() { + let fraction = (5u128, 21u128); + let res = Uint128::new(123456).div_floor(fraction); // 518515.2 + assert_eq!(Uint128::new(518515), res) + } + + #[test] + fn div_floor_does_not_round_on_even_divide() { + let fraction = (5u128, 2u128); + let res = Uint128::new(25).div_floor(fraction); + assert_eq!(Uint128::new(10), res) + } + + #[test] + fn div_floor_works_when_operation_temporarily_takes_above_max() { + let fraction = (21u128, 8u128); + let res = Uint128::MAX.div_floor(fraction); // 129_631_377_874_643_224_176_523_659_974_006_937_697.1428 + assert_eq!( + Uint128::new(129_631_377_874_643_224_176_523_659_974_006_937_697), + res + ) + } + + #[test] + fn div_floor_works_with_decimal() { + let decimal = Decimal::from_ratio(21u128, 8u128); + let res = Uint128::new(123456).div_floor(decimal); // 47030.8571 + assert_eq!(Uint128::new(47030), res) + } + + #[test] + fn div_floor_works_with_decimal_evenly() { + let res = Uint128::new(60).div_floor(Decimal::from_atomics(6u128, 0).unwrap()); + assert_eq!(res, Uint128::new(10)); + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn div_floor_panics_on_overflow() { + let fraction = (8u128, 21u128); + _ = Uint128::MAX.div_floor(fraction); + } + + #[test] + fn div_floor_does_not_panic_on_overflow() { + let fraction = (8u128, 21u128); + assert_eq!( + Uint128::MAX.checked_div_floor(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint256", + target_type: "Uint128", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn div_ceil_raises_with_zero() { + let fraction = (Uint128::zero(), Uint128::new(21)); + _ = Uint128::new(123456).div_ceil(fraction); + } + + #[test] + fn div_ceil_does_nothing_with_one() { + let fraction = (Uint128::one(), Uint128::one()); + let res = Uint128::new(123456).div_ceil(fraction); + assert_eq!(Uint128::new(123456), res) + } + + #[test] + fn div_ceil_rounds_up_with_normal_case() { + let fraction = (5u128, 21u128); + let res = Uint128::new(123456).div_ceil(fraction); // 518515.2 + assert_eq!(Uint128::new(518516), res) + } + + #[test] + fn div_ceil_does_not_round_on_even_divide() { + let fraction = (5u128, 2u128); + let res = Uint128::new(25).div_ceil(fraction); + assert_eq!(Uint128::new(10), res) + } + + #[test] + fn div_ceil_works_when_operation_temporarily_takes_above_max() { + let fraction = (21u128, 8u128); + let res = Uint128::MAX.div_ceil(fraction); // 129_631_377_874_643_224_176_523_659_974_006_937_697.1428 + assert_eq!( + Uint128::new(129_631_377_874_643_224_176_523_659_974_006_937_698), + res + ) + } + + #[test] + fn div_ceil_works_with_decimal() { + let decimal = Decimal::from_ratio(21u128, 8u128); + let res = Uint128::new(123456).div_ceil(decimal); // 47030.8571 + assert_eq!(Uint128::new(47031), res) + } + + #[test] + fn div_ceil_works_with_decimal_evenly() { + let res = Uint128::new(60).div_ceil(Decimal::from_atomics(6u128, 0).unwrap()); + assert_eq!(res, Uint128::new(10)); + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn div_ceil_panics_on_overflow() { + let fraction = (8u128, 21u128); + _ = Uint128::MAX.div_ceil(fraction); + } + + #[test] + fn div_ceil_does_not_panic_on_overflow() { + let fraction = (8u128, 21u128); + assert_eq!( + Uint128::MAX.checked_div_ceil(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint256", + target_type: "Uint128", + })), + ); + } } diff --git a/packages/std/src/math/uint256.rs b/packages/std/src/math/uint256.rs index 3469b1d80a..7329254164 100644 --- a/packages/std/src/math/uint256.rs +++ b/packages/std/src/math/uint256.rs @@ -1,31 +1,28 @@ -use forward_ref::{forward_ref_binop, forward_ref_op_assign}; -use schemars::JsonSchema; -use serde::{de, ser, Deserialize, Deserializer, Serialize}; -use std::fmt; -use std::ops::{ - Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Shl, Shr, ShrAssign, Sub, - SubAssign, +use alloc::string::{String, ToString}; +use core::fmt; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Not, Rem, RemAssign, Shl, ShlAssign, Shr, + ShrAssign, Sub, SubAssign, }; -use std::str::FromStr; +use core::str::FromStr; use crate::errors::{ - CheckedMultiplyRatioError, ConversionOverflowError, DivideByZeroError, OverflowError, - OverflowOperation, StdError, + CheckedMultiplyFractionError, CheckedMultiplyRatioError, ConversionOverflowError, + DivideByZeroError, ErrorKind, OverflowError, OverflowOperation, StdError, +}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + __internal::forward_ref_partial_eq, impl_mul_fraction, Fraction, Int128, Int256, Int512, Int64, + Uint128, Uint512, Uint64, }; -use crate::{Uint128, Uint512, Uint64}; - -/// This module is purely a workaround that lets us ignore lints for all the code -/// the `construct_uint!` macro generates. -#[allow(clippy::all)] -mod uints { - uint::construct_uint! { - pub struct U256(4); - } -} /// Used internally - we don't want to leak this type since we might change /// the implementation in the future. -use uints::U256; +use bnum::types::U256; + +use super::conversion::{forward_try_from, primitive_to_wrapped_int, try_from_int_to_uint}; +use super::impl_int_serde; +use super::num_consts::NumConsts; /// An implementation of u256 that is using strings for JSON encoding/decoding, /// such that the full u256 range can be used for clients that convert JSON numbers to floats, @@ -33,50 +30,74 @@ use uints::U256; /// /// # Examples /// -/// Use `from` to create instances out of primitive uint types or `new` to provide big -/// endian bytes: +/// Use `new` to create instances out of u128, `from` for other primitive uint types +/// or `from_be_bytes` to provide big endian bytes: /// /// ``` /// # use cosmwasm_std::Uint256; -/// let a = Uint256::from(258u128); -/// let b = Uint256::new([ +/// let a = Uint256::new(258u128); +/// let b = Uint256::from(258u16); +/// let c = Uint256::from_be_bytes([ /// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, /// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, /// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, /// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, /// ]); /// assert_eq!(a, b); +/// assert_eq!(a, c); /// ``` -#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, JsonSchema)] -pub struct Uint256(#[schemars(with = "String")] U256); +#[derive( + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Integer { precision: 256, signed: false })] +pub struct Uint256(#[schemars(with = "String")] pub(crate) U256); + +impl_int_serde!(Uint256); +forward_ref_partial_eq!(Uint256, Uint256); impl Uint256 { pub const MAX: Uint256 = Uint256(U256::MAX); - pub const MIN: Uint256 = Uint256(U256::zero()); + pub const MIN: Uint256 = Uint256(U256::ZERO); - /// Creates a Uint256(value) from a big endian representation. It's just an alias for - /// [`Uint256::from_be_bytes`]. + /// Creates a Uint256(value). /// /// This method is less flexible than `from` but can be called in a const context. - pub const fn new(value: [u8; 32]) -> Self { - Self::from_be_bytes(value) + /// + /// Before CosmWasm 3 this took a byte array as an argument. You can get this behaviour + /// with [`from_be_bytes`]. + /// + /// [`from_be_bytes`]: Self::from_be_bytes + #[must_use] + pub const fn new(value: u128) -> Self { + let b = value.to_be_bytes(); + Self::from_be_bytes([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, b[0], b[1], b[2], b[3], b[4], b[5], + b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], + ]) } /// Creates a Uint256(0) #[inline] pub const fn zero() -> Self { - Uint256(U256::zero()) + Self(U256::ZERO) } /// Creates a Uint256(1) #[inline] pub const fn one() -> Self { - Self::from_be_bytes([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, - ]) + Self(U256::ONE) } + #[must_use] pub const fn from_be_bytes(data: [u8; 32]) -> Self { let words: [u64; 4] = [ u64::from_le_bytes([ @@ -92,9 +113,10 @@ impl Uint256 { data[7], data[6], data[5], data[4], data[3], data[2], data[1], data[0], ]), ]; - Self(U256(words)) + Self(U256::from_digits(words)) } + #[must_use] pub const fn from_le_bytes(data: [u8; 32]) -> Self { let words: [u64; 4] = [ u64::from_le_bytes([ @@ -110,63 +132,78 @@ impl Uint256 { data[24], data[25], data[26], data[27], data[28], data[29], data[30], data[31], ]), ]; - Uint256(U256(words)) + Self(U256::from_digits(words)) } /// A conversion from `u128` that, unlike the one provided by the `From` trait, /// can be used in a `const` context. - pub const fn from_u128(num: u128) -> Self { - let bytes = num.to_le_bytes(); - - Self::from_le_bytes([ - bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6], bytes[7], - bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15], - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ]) + #[must_use] + #[deprecated(since = "3.0.0", note = "Use Uint256::new(value) instead")] + pub const fn from_u128(value: u128) -> Self { + Self::new(value) } /// A conversion from `Uint128` that, unlike the one provided by the `From` trait, /// can be used in a `const` context. + #[must_use] pub const fn from_uint128(num: Uint128) -> Self { - Self::from_u128(num.u128()) + Self::new(num.u128()) } /// Returns a copy of the number as big endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn to_be_bytes(self) -> [u8; 32] { + let words = self.0.digits(); let words = [ - (self.0).0[3].to_be_bytes(), - (self.0).0[2].to_be_bytes(), - (self.0).0[1].to_be_bytes(), - (self.0).0[0].to_be_bytes(), + words[3].to_be_bytes(), + words[2].to_be_bytes(), + words[1].to_be_bytes(), + words[0].to_be_bytes(), ]; - unsafe { std::mem::transmute::<[[u8; 8]; 4], [u8; 32]>(words) } + unsafe { core::mem::transmute::<[[u8; 8]; 4], [u8; 32]>(words) } } /// Returns a copy of the number as little endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn to_le_bytes(self) -> [u8; 32] { + let words = self.0.digits(); let words = [ - (self.0).0[0].to_le_bytes(), - (self.0).0[1].to_le_bytes(), - (self.0).0[2].to_le_bytes(), - (self.0).0[3].to_le_bytes(), + words[0].to_le_bytes(), + words[1].to_le_bytes(), + words[2].to_le_bytes(), + words[3].to_le_bytes(), ]; - unsafe { std::mem::transmute::<[[u8; 8]; 4], [u8; 32]>(words) } + unsafe { core::mem::transmute::<[[u8; 8]; 4], [u8; 32]>(words) } } + #[must_use] pub const fn is_zero(&self) -> bool { - let words = (self.0).0; - words[0] == 0 && words[1] == 0 && words[2] == 0 && words[3] == 0 + self.0.is_zero() } - pub fn pow(self, exp: u32) -> Self { - let res = self.0.pow(exp.into()); - Self(res) + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn pow(self, exp: u32) -> Self { + match self.0.checked_pow(exp) { + Some(val) => Self(val), + None => panic!("attempt to exponentiate with overflow"), + } + } + + /// Returns the base 2 logarithm of the number, rounded down. + /// + /// # Panics + /// + /// This function will panic if `self` is zero. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn ilog2(self) -> u32 { + self.0.checked_ilog2().unwrap() } /// Returns `self * numerator / denominator`. /// /// Due to the nature of the integer division involved, the result is always floored. /// E.g. 5 * 99/100 = 4. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn multiply_ratio, B: Into>( &self, numerator: A, @@ -216,7 +253,8 @@ impl Uint256 { /// "231584178474632390847141970017375815706539969331281128078915168015826259279870", /// ); /// ``` - pub fn full_mul(self, rhs: impl Into) -> Uint512 { + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn full_mul(self, rhs: impl Into) -> Uint512 { Uint512::from(self) .checked_mul(Uint512::from(rhs.into())) .unwrap() @@ -226,35 +264,35 @@ impl Uint256 { self.0 .checked_add(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Add, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Add)) } pub fn checked_sub(self, other: Self) -> Result { self.0 .checked_sub(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Sub, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Sub)) } pub fn checked_mul(self, other: Self) -> Result { self.0 .checked_mul(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Mul, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Mul)) } pub fn checked_pow(self, exp: u32) -> Result { self.0 - .checked_pow(exp.into()) + .checked_pow(exp) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Pow, self, exp)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Pow)) } pub fn checked_div(self, other: Self) -> Result { self.0 .checked_div(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) } pub fn checked_div_euclid(self, other: Self) -> Result { @@ -265,12 +303,12 @@ impl Uint256 { self.0 .checked_rem(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) } pub fn checked_shr(self, other: u32) -> Result { if other >= 256 { - return Err(OverflowError::new(OverflowOperation::Shr, self, other)); + return Err(OverflowError::new(OverflowOperation::Shr)); } Ok(Self(self.0.shr(other))) @@ -278,115 +316,120 @@ impl Uint256 { pub fn checked_shl(self, other: u32) -> Result { if other >= 256 { - return Err(OverflowError::new(OverflowOperation::Shl, self, other)); + return Err(OverflowError::new(OverflowOperation::Shl)); } Ok(Self(self.0.shl(other))) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_add(self, other: Self) -> Self { - let (value, _did_overflow) = self.0.overflowing_add(other.0); - Self(value) + Self(self.0.wrapping_add(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_sub(self, other: Self) -> Self { - let (value, _did_overflow) = self.0.overflowing_sub(other.0); - Self(value) + Self(self.0.wrapping_sub(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_mul(self, other: Self) -> Self { - let (value, _did_overflow) = self.0.overflowing_mul(other.0); - Self(value) + Self(self.0.wrapping_mul(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_pow(self, other: u32) -> Self { - let (value, _did_overflow) = self.0.overflowing_pow(other.into()); - Self(value) + Self(self.0.wrapping_pow(other)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_add(self, other: Self) -> Self { Self(self.0.saturating_add(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_sub(self, other: Self) -> Self { Self(self.0.saturating_sub(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_mul(self, other: Self) -> Self { Self(self.0.saturating_mul(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_pow(self, exp: u32) -> Self { - match self.checked_pow(exp) { - Ok(value) => value, - Err(_) => Self::MAX, - } + Self(self.0.saturating_pow(exp)) } - pub fn abs_diff(self, other: Self) -> Self { - if self < other { - other - self - } else { - self - other + /// Strict integer addition. Computes `self + rhs`, panicking if overflow occurred. + /// + /// This is the same as [`Uint256::add`] but const. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn strict_add(self, rhs: Self) -> Self { + match self.0.checked_add(rhs.0) { + None => panic!("attempt to add with overflow"), + Some(sum) => Self(sum), } } -} -impl From for Uint256 { - fn from(val: Uint128) -> Self { - val.u128().into() + /// Strict integer subtraction. Computes `self - rhs`, panicking if overflow occurred. + /// + /// This is the same as [`Uint256::sub`] but const. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn strict_sub(self, other: Self) -> Self { + match self.0.checked_sub(other.0) { + None => panic!("attempt to subtract with overflow"), + Some(diff) => Self(diff), + } } -} -impl From for Uint256 { - fn from(val: Uint64) -> Self { - val.u64().into() + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs_diff(self, other: Self) -> Self { + Self(self.0.abs_diff(other.0)) } } -impl From for Uint256 { - fn from(val: u128) -> Self { - Uint256(val.into()) - } +impl NumConsts for Uint256 { + const ZERO: Self = Self::zero(); + const ONE: Self = Self::one(); + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; } -impl From for Uint256 { - fn from(val: u64) -> Self { - Uint256(val.into()) - } -} +impl_mul_fraction!(Uint256); -impl From for Uint256 { - fn from(val: u32) -> Self { - Uint256(val.into()) - } -} +// uint to Uint +primitive_to_wrapped_int!(u8, Uint256); +primitive_to_wrapped_int!(u16, Uint256); +primitive_to_wrapped_int!(u32, Uint256); +primitive_to_wrapped_int!(u64, Uint256); +primitive_to_wrapped_int!(u128, Uint256); -impl From for Uint256 { - fn from(val: u16) -> Self { - Uint256(val.into()) +impl From for Uint256 { + fn from(val: Uint128) -> Self { + val.u128().into() } } -impl From for Uint256 { - fn from(val: u8) -> Self { - Uint256(val.into()) +impl From for Uint256 { + fn from(val: Uint64) -> Self { + val.u64().into() } } -impl TryFrom for Uint128 { - type Error = ConversionOverflowError; +forward_try_from!(Uint256, Uint128); +forward_try_from!(Uint256, Uint64); - fn try_from(value: Uint256) -> Result { - Ok(Uint128::new(value.0.try_into().map_err(|_| { - ConversionOverflowError::new("Uint256", "Uint128", value.to_string()) - })?)) - } -} +// Int to Uint +try_from_int_to_uint!(Int64, Uint256); +try_from_int_to_uint!(Int128, Uint256); +try_from_int_to_uint!(Int256, Uint256); +try_from_int_to_uint!(Int512, Uint256); impl TryFrom<&str> for Uint256 { type Error = StdError; @@ -401,12 +444,16 @@ impl FromStr for Uint256 { fn from_str(s: &str) -> Result { if s.is_empty() { - return Err(StdError::generic_err("Parsing u256: received empty string")); + return Err( + StdError::msg("Parsing u256: received empty string").with_kind(ErrorKind::Parsing) + ); } - match U256::from_dec_str(s) { + match U256::from_str_radix(s, 10) { Ok(u) => Ok(Uint256(u)), - Err(e) => Err(StdError::generic_err(format!("Parsing u256: {}", e))), + Err(e) => { + Err(StdError::msg(format_args!("Parsing u256: {e}")).with_kind(ErrorKind::Parsing)) + } } } } @@ -419,11 +466,7 @@ impl From for String { impl fmt::Display for Uint256 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // The inner type doesn't work as expected with padding, so we - // work around that. - let unpadded = self.0.to_string(); - - f.pad_integral(true, "", &unpadded) + self.0.fmt(f) } } @@ -431,31 +474,16 @@ impl Add for Uint256 { type Output = Self; fn add(self, rhs: Self) -> Self { - Self( - self.0 - .checked_add(rhs.0) - .expect("attempt to add with overflow"), - ) - } -} - -impl<'a> Add<&'a Uint256> for Uint256 { - type Output = Self; - - fn add(self, rhs: &'a Uint256) -> Self { - self + *rhs + self.strict_add(rhs) } } +forward_ref_binop!(impl Add, add for Uint256, Uint256); impl Sub for Uint256 { type Output = Self; fn sub(self, rhs: Self) -> Self { - Self( - self.0 - .checked_sub(rhs.0) - .expect("attempt to subtract with overflow"), - ) + self.strict_sub(rhs) } } forward_ref_binop!(impl Sub, sub for Uint256, Uint256); @@ -500,6 +528,14 @@ impl Rem for Uint256 { } forward_ref_binop!(impl Rem, rem for Uint256, Uint256); +impl Not for Uint256 { + type Output = Self; + + fn not(self) -> Self::Output { + Self(!self.0) + } +} + impl RemAssign for Uint256 { fn rem_assign(&mut self, rhs: Uint256) { *self = *self % rhs; @@ -533,8 +569,7 @@ impl Shr for Uint256 { fn shr(self, rhs: u32) -> Self::Output { self.checked_shr(rhs).unwrap_or_else(|_| { panic!( - "right shift error: {} is larger or equal than the number of bits in Uint256", - rhs, + "right shift error: {rhs} is larger or equal than the number of bits in Uint256", ) }) } @@ -552,12 +587,8 @@ impl Shl for Uint256 { type Output = Self; fn shl(self, rhs: u32) -> Self::Output { - self.checked_shl(rhs).unwrap_or_else(|_| { - panic!( - "left shift error: {} is larger or equal than the number of bits in Uint256", - rhs, - ) - }) + self.checked_shl(rhs) + .expect("attempt to shift left with overflow") } } @@ -605,44 +636,19 @@ impl<'a> ShrAssign<&'a u32> for Uint256 { } } -impl Serialize for Uint256 { - /// Serializes as an integer string using base 10 - fn serialize(&self, serializer: S) -> Result - where - S: ser::Serializer, - { - serializer.serialize_str(&self.to_string()) +impl ShlAssign for Uint256 { + fn shl_assign(&mut self, rhs: u32) { + *self = self.shl(rhs); } } -impl<'de> Deserialize<'de> for Uint256 { - /// Deserialized from an integer string using base 10 - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - deserializer.deserialize_str(Uint256Visitor) +impl<'a> ShlAssign<&'a u32> for Uint256 { + fn shl_assign(&mut self, rhs: &'a u32) { + *self = self.shl(*rhs); } } -struct Uint256Visitor; - -impl<'de> de::Visitor<'de> for Uint256Visitor { - type Value = Uint256; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("string-encoded integer") - } - - fn visit_str(self, v: &str) -> Result - where - E: de::Error, - { - Uint256::try_from(v).map_err(|e| E::custom(format!("invalid Uint256 '{}' - {}", v, e))) - } -} - -impl std::iter::Sum for Uint256 +impl core::iter::Sum for Uint256 where Self: Add, { @@ -651,26 +657,39 @@ where } } -impl PartialEq<&Uint256> for Uint256 { - fn eq(&self, rhs: &&Uint256) -> bool { - self == *rhs - } -} - -impl PartialEq for &Uint256 { - fn eq(&self, rhs: &Uint256) -> bool { - *self == rhs - } -} - #[cfg(test)] mod tests { use super::*; - use crate::{from_slice, to_vec}; + use crate::errors::CheckedMultiplyFractionError::{ConversionOverflow, DivideByZero}; + use crate::math::conversion::test_try_from_int_to_uint; + use crate::{Decimal, Decimal256}; + + #[test] + fn size_of_works() { + assert_eq!(core::mem::size_of::(), 32); + } #[test] fn uint256_new_works() { - let num = Uint256::new([1; 32]); + let num = Uint256::new(1); + assert_eq!( + num.to_be_bytes(), + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1 + ] + ); + + for v in [0, 1, 18, 875786576, u128::MAX] { + // From is implemented by bnum, so we test two independent implementations against each other + let uut = Uint256::new(v); + assert_eq!(uut, Uint256::from(v)); + } + } + + #[test] + fn uint256_from_be_bytes_works() { + let num = Uint256::from_be_bytes([1; 32]); let a: [u8; 32] = num.to_be_bytes(); assert_eq!(a, [1; 32]); @@ -678,11 +697,21 @@ mod tests { 0u8, 222u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, ]; - let num = Uint256::new(be_bytes); + let num = Uint256::from_be_bytes(be_bytes); let resulting_bytes: [u8; 32] = num.to_be_bytes(); assert_eq!(be_bytes, resulting_bytes); } + #[test] + fn uint256_not_works() { + let num = Uint256::from_be_bytes([1; 32]); + let a = (!num).to_be_bytes(); + assert_eq!(a, [254; 32]); + + assert_eq!(!Uint256::MAX, Uint256::MIN); + assert_eq!(!Uint256::MIN, Uint256::MAX); + } + #[test] fn uint256_zero_works() { let zero = Uint256::zero(); @@ -1011,38 +1040,65 @@ mod tests { ]; // These should all be the same. - let num1 = Uint256::new(be_bytes); - let num2 = Uint256::from_be_bytes(be_bytes); - let num3 = Uint256::from_le_bytes(le_bytes); - assert_eq!(num1, Uint256::from(65536u32 + 512 + 3)); - assert_eq!(num1, num2); - assert_eq!(num1, num3); + let a = Uint256::from_be_bytes(be_bytes); + let b = Uint256::from_le_bytes(le_bytes); + assert_eq!(a, Uint256::from(65536u32 + 512 + 3)); + assert_eq!(a, b); } #[test] fn uint256_convert_from() { let a = Uint256::from(5u128); - assert_eq!(a.0, U256::from(5)); + assert_eq!(a.0, U256::from(5u32)); let a = Uint256::from(5u64); - assert_eq!(a.0, U256::from(5)); + assert_eq!(a.0, U256::from(5u32)); let a = Uint256::from(5u32); - assert_eq!(a.0, U256::from(5)); + assert_eq!(a.0, U256::from(5u32)); let a = Uint256::from(5u16); - assert_eq!(a.0, U256::from(5)); + assert_eq!(a.0, U256::from(5u32)); let a = Uint256::from(5u8); - assert_eq!(a.0, U256::from(5)); + assert_eq!(a.0, U256::from(5u32)); let result = Uint256::try_from("34567"); - assert_eq!(result.unwrap().0, U256::from_dec_str("34567").unwrap()); + assert_eq!( + result.unwrap().0, + U256::from_str_radix("34567", 10).unwrap() + ); let result = Uint256::try_from("1.23"); assert!(result.is_err()); } + #[test] + fn uint256_try_from_signed_works() { + test_try_from_int_to_uint::("Int64", "Uint256"); + test_try_from_int_to_uint::("Int128", "Uint256"); + test_try_from_int_to_uint::("Int256", "Uint256"); + test_try_from_int_to_uint::("Int512", "Uint256"); + } + + #[test] + fn uint256_try_into() { + assert!(Uint64::try_from(Uint256::MAX).is_err()); + assert!(Uint128::try_from(Uint256::MAX).is_err()); + + assert_eq!(Uint64::try_from(Uint256::zero()), Ok(Uint64::zero())); + assert_eq!(Uint128::try_from(Uint256::zero()), Ok(Uint128::zero())); + + assert_eq!( + Uint64::try_from(Uint256::from(42u64)), + Ok(Uint64::from(42u64)) + ); + assert_eq!( + Uint128::try_from(Uint256::from(42u128)), + Ok(Uint128::from(42u128)) + ); + } + #[test] fn uint256_convert_to_uint128() { let source = Uint256::from(42u128); @@ -1053,15 +1109,12 @@ mod tests { let target = Uint128::try_from(source); assert_eq!( target, - Err(ConversionOverflowError::new( - "Uint256", - "Uint128", - Uint256::MAX.to_string() - )) + Err(ConversionOverflowError::new("Uint256", "Uint128")) ); } #[test] + #[allow(deprecated)] fn uint256_from_u128() { assert_eq!( Uint256::from_u128(123u128), @@ -1090,18 +1143,23 @@ mod tests { #[test] fn uint256_implements_display() { let a = Uint256::from(12345u32); - assert_eq!(format!("Embedded: {}", a), "Embedded: 12345"); + assert_eq!(format!("Embedded: {a}"), "Embedded: 12345"); assert_eq!(a.to_string(), "12345"); let a = Uint256::zero(); - assert_eq!(format!("Embedded: {}", a), "Embedded: 0"); + assert_eq!(format!("Embedded: {a}"), "Embedded: 0"); assert_eq!(a.to_string(), "0"); } #[test] fn uint256_display_padding_works() { + // width > natural representation + let a = Uint256::from(123u64); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: 00123"); + + // width < natural representation let a = Uint256::from(123u64); - assert_eq!(format!("Embedded: {:05}", a), "Embedded: 00123"); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: 123"); } #[test] @@ -1197,7 +1255,7 @@ mod tests { #[test] fn uint256_is_zero_works() { assert!(Uint256::zero().is_zero()); - assert!(Uint256(U256::from(0)).is_zero()); + assert!(Uint256(U256::from(0u32)).is_zero()); assert!(!Uint256::from(1u32).is_zero()); assert!(!Uint256::from(123u32).is_zero()); @@ -1243,9 +1301,9 @@ mod tests { #[test] fn uint256_json() { let orig = Uint256::from(1234567890987654321u128); - let serialized = to_vec(&orig).unwrap(); + let serialized = serde_json::to_vec(&orig).unwrap(); assert_eq!(serialized.as_slice(), b"\"1234567890987654321\""); - let parsed: Uint256 = from_slice(&serialized).unwrap(); + let parsed: Uint256 = serde_json::from_slice(&serialized).unwrap(); assert_eq!(parsed, orig); } @@ -1265,10 +1323,6 @@ mod tests { let a = Uint256::from(12345u32); let b = Uint256::from(23456u32); - // test + with owned and reference right hand side - assert_eq!(a + b, Uint256::from(35801u32)); - assert_eq!(a + &b, Uint256::from(35801u32)); - // test - with owned and reference right hand side assert_eq!(b - a, Uint256::from(11111u32)); assert_eq!(b - &a, Uint256::from(11111u32)); @@ -1291,16 +1345,36 @@ mod tests { // error result on underflow (- would produce negative result) let underflow_result = a.checked_sub(b); - let OverflowError { - operand1, operand2, .. - } = underflow_result.unwrap_err(); - assert_eq!((operand1, operand2), (a.to_string(), b.to_string())); + let OverflowError { operation } = underflow_result.unwrap_err(); + assert_eq!(operation, OverflowOperation::Sub); } #[test] - #[should_panic] + #[allow(clippy::op_ref)] + fn uint256_add_works() { + assert_eq!( + Uint256::from(2u32) + Uint256::from(1u32), + Uint256::from(3u32) + ); + assert_eq!( + Uint256::from(2u32) + Uint256::from(0u32), + Uint256::from(2u32) + ); + + // works for refs + let a = Uint256::from(10u32); + let b = Uint256::from(3u32); + let expected = Uint256::from(13u32); + assert_eq!(a + b, expected); + assert_eq!(a + &b, expected); + assert_eq!(&a + b, expected); + assert_eq!(&a + &b, expected); + } + + #[test] + #[should_panic(expected = "attempt to add with overflow")] fn uint256_add_overflow_panics() { - let max = Uint256::new([255u8; 32]); + let max = Uint256::from_be_bytes([255u8; 32]); let _ = max + Uint256::from(12u32); } @@ -1391,7 +1465,7 @@ mod tests { #[test] #[should_panic] fn uint256_pow_overflow_panics() { - Uint256::MAX.pow(2u32); + _ = Uint256::MAX.pow(2u32); } #[test] @@ -1411,14 +1485,14 @@ mod tests { Uint256::from(750u32) ); - // factor 2/3 (integer devision always floors the result) + // factor 2/3 (integer division always floors the result) assert_eq!(base.multiply_ratio(2u128, 3u128), Uint256::from(333u32)); assert_eq!( base.multiply_ratio(222222u128, 333333u128), Uint256::from(333u32) ); - // factor 5/6 (integer devision always floors the result) + // factor 5/6 (integer division always floors the result) assert_eq!(base.multiply_ratio(5u128, 6u128), Uint256::from(416u32)); assert_eq!(base.multiply_ratio(100u128, 120u128), Uint256::from(416u32)); } @@ -1443,7 +1517,7 @@ mod tests { #[test] #[should_panic(expected = "Denominator must not be zero")] fn uint256_multiply_ratio_panics_for_zero_denominator() { - Uint256::from(500u32).multiply_ratio(1u128, 0u128); + _ = Uint256::from(500u32).multiply_ratio(1u128, 0u128); } #[test] @@ -1460,12 +1534,12 @@ mod tests { #[test] fn uint256_shr_works() { - let original = Uint256::new([ + let original = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8, 0u8, 4u8, 2u8, ]); - let shifted = Uint256::new([ + let shifted = Uint256::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 128u8, 1u8, 0u8, ]); @@ -1479,6 +1553,27 @@ mod tests { let _ = Uint256::from(1u32) >> 256u32; } + #[test] + fn uint256_shl_works() { + let original = Uint256::from_be_bytes([ + 64u8, 128u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ]); + + let shifted = Uint256::from_be_bytes([ + 2u8, 0u8, 4u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ]); + + assert_eq!(original << 2u32, shifted); + } + + #[test] + #[should_panic] + fn uint256_shl_overflow_panics() { + let _ = Uint256::from(1u32) << 256u32; + } + #[test] fn sum_works() { let nums = vec![ @@ -1597,7 +1692,7 @@ mod tests { } #[test] - #[should_panic(expected = "division by zero")] + #[should_panic(expected = "divisor of zero")] fn uint256_rem_panics_for_zero() { let _ = Uint256::from(10u32) % Uint256::zero(); } @@ -1634,6 +1729,37 @@ mod tests { assert_eq!(a, Uint256::from(1u32)); } + #[test] + fn uint256_strict_add_works() { + let a = Uint256::from(5u32); + let b = Uint256::from(3u32); + assert_eq!(a.strict_add(b), Uint256::from(8u32)); + assert_eq!(b.strict_add(a), Uint256::from(8u32)); + } + + #[test] + #[should_panic(expected = "attempt to add with overflow")] + fn uint256_strict_add_panics_on_overflow() { + let a = Uint256::MAX; + let b = Uint256::ONE; + let _ = a.strict_add(b); + } + + #[test] + fn uint256_strict_sub_works() { + let a = Uint256::from(5u32); + let b = Uint256::from(3u32); + assert_eq!(a.strict_sub(b), Uint256::from(2u32)); + } + + #[test] + #[should_panic(expected = "attempt to subtract with overflow")] + fn uint256_strict_sub_panics_on_overflow() { + let a = Uint256::ZERO; + let b = Uint256::ONE; + let _ = a.strict_sub(b); + } + #[test] fn uint256_abs_diff_works() { let a = Uint256::from(42u32); @@ -1659,4 +1785,330 @@ mod tests { assert_eq!(&lhs == &rhs, expected); } } + + #[test] + fn mul_floor_works_with_zero() { + let fraction = (Uint256::zero(), Uint256::from(21u32)); + let res = Uint256::from(123456u32).mul_floor(fraction); + assert_eq!(Uint256::zero(), res) + } + + #[test] + fn mul_floor_does_nothing_with_one() { + let fraction = (Uint256::one(), Uint256::one()); + let res = Uint256::from(123456u32).mul_floor(fraction); + assert_eq!(Uint256::from(123456u32), res) + } + + #[test] + fn mul_floor_rounds_down_with_normal_case() { + let fraction = (Uint256::from(8u128), Uint256::from(21u128)); + let res = Uint256::from(123456u32).mul_floor(fraction); // 47030.8571 + assert_eq!(Uint256::from(47030u32), res) + } + + #[test] + fn mul_floor_does_not_round_on_even_divide() { + let fraction = (2u128, 5u128); + let res = Uint256::from(25u32).mul_floor(fraction); + assert_eq!(Uint256::from(10u32), res) + } + + #[test] + fn mul_floor_works_when_operation_temporarily_takes_above_max() { + let fraction = (8u128, 21u128); + let res = Uint256::MAX.mul_floor(fraction); // 44_111_272_090_406_169_685_169_899_050_928_726_801_245_708_444_053_548_205_507_651_050_633_573_196_165.71428571 + assert_eq!( + Uint256::from_str( + "44111272090406169685169899050928726801245708444053548205507651050633573196165" + ) + .unwrap(), + res + ) + } + + #[test] + fn mul_floor_works_with_decimal() { + let decimal = Decimal::from_ratio(8u128, 21u128); + let res = Uint256::from(123456u32).mul_floor(decimal); // 47030.8571 + assert_eq!(Uint256::from(47030u32), res) + } + + #[test] + fn mul_floor_works_with_decimal256() { + let decimal = Decimal256::from_ratio(8u128, 21u128); + let res = Uint256::from(123456u32).mul_floor(decimal); // 47030.8571 + assert_eq!(Uint256::from(47030u32), res) + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn mul_floor_panics_on_overflow() { + let fraction = (21u128, 8u128); + _ = Uint256::MAX.mul_floor(fraction); + } + + #[test] + fn checked_mul_floor_does_not_panic_on_overflow() { + let fraction = (21u128, 8u128); + assert_eq!( + Uint256::MAX.checked_mul_floor(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint512", + target_type: "Uint256", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn mul_floor_panics_on_zero_div() { + let fraction = (21u128, 0u128); + _ = Uint256::from(123456u32).mul_floor(fraction); + } + + #[test] + fn checked_mul_floor_does_not_panic_on_zero_div() { + let fraction = (21u128, 0u128); + assert_eq!( + Uint256::from(123456u32).checked_mul_floor(fraction), + Err(DivideByZero(DivideByZeroError)), + ); + } + + #[test] + fn mul_ceil_works_with_zero() { + let fraction = (Uint256::zero(), Uint256::from(21u32)); + let res = Uint256::from(123456u32).mul_ceil(fraction); + assert_eq!(Uint256::zero(), res) + } + + #[test] + fn mul_ceil_does_nothing_with_one() { + let fraction = (Uint256::one(), Uint256::one()); + let res = Uint256::from(123456u32).mul_ceil(fraction); + assert_eq!(Uint256::from(123456u32), res) + } + + #[test] + fn mul_ceil_rounds_up_with_normal_case() { + let fraction = (8u128, 21u128); + let res = Uint256::from(123456u32).mul_ceil(fraction); // 47030.8571 + assert_eq!(Uint256::from(47031u32), res) + } + + #[test] + fn mul_ceil_does_not_round_on_even_divide() { + let fraction = (2u128, 5u128); + let res = Uint256::from(25u32).mul_ceil(fraction); + assert_eq!(Uint256::from(10u32), res) + } + + #[test] + fn mul_ceil_works_when_operation_temporarily_takes_above_max() { + let fraction = (8u128, 21u128); + let res = Uint256::MAX.mul_ceil(fraction); // 44_111_272_090_406_169_685_169_899_050_928_726_801_245_708_444_053_548_205_507_651_050_633_573_196_165.71428571 + assert_eq!( + Uint256::from_str( + "44111272090406169685169899050928726801245708444053548205507651050633573196166" + ) + .unwrap(), + res + ) + } + + #[test] + fn mul_ceil_works_with_decimal() { + let decimal = Decimal::from_ratio(8u128, 21u128); + let res = Uint256::from(123456u32).mul_ceil(decimal); // 47030.8571 + assert_eq!(Uint256::from(47031u32), res) + } + + #[test] + fn mul_ceil_works_with_decimal256() { + let decimal = Decimal256::from_ratio(8u128, 21u128); + let res = Uint256::from(123456u32).mul_ceil(decimal); // 47030.8571 + assert_eq!(Uint256::from(47031u32), res) + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn mul_ceil_panics_on_overflow() { + let fraction = (21u128, 8u128); + _ = Uint256::MAX.mul_ceil(fraction); + } + + #[test] + fn checked_mul_ceil_does_not_panic_on_overflow() { + let fraction = (21u128, 8u128); + assert_eq!( + Uint256::MAX.checked_mul_ceil(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint512", + target_type: "Uint256", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn mul_ceil_panics_on_zero_div() { + let fraction = (21u128, 0u128); + _ = Uint256::from(123456u32).mul_ceil(fraction); + } + + #[test] + fn checked_mul_ceil_does_not_panic_on_zero_div() { + let fraction = (21u128, 0u128); + assert_eq!( + Uint256::from(123456u32).checked_mul_ceil(fraction), + Err(DivideByZero(DivideByZeroError)), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn div_floor_raises_with_zero() { + let fraction = (Uint256::zero(), Uint256::from(21u32)); + _ = Uint256::from(123456u128).div_floor(fraction); + } + + #[test] + fn div_floor_does_nothing_with_one() { + let fraction = (Uint256::one(), Uint256::one()); + let res = Uint256::from(123456u128).div_floor(fraction); + assert_eq!(Uint256::from(123456u128), res) + } + + #[test] + fn div_floor_rounds_down_with_normal_case() { + let fraction = (5u128, 21u128); + let res = Uint256::from(123456u128).div_floor(fraction); // 518515.2 + assert_eq!(Uint256::from(518515u128), res) + } + + #[test] + fn div_floor_does_not_round_on_even_divide() { + let fraction = (5u128, 2u128); + let res = Uint256::from(25u128).div_floor(fraction); + assert_eq!(Uint256::from(10u128), res) + } + + #[test] + fn div_floor_works_when_operation_temporarily_takes_above_max() { + let fraction = (21u128, 8u128); + let res = Uint256::MAX.div_floor(fraction); // 44_111_272_090_406_169_685_169_899_050_928_726_801_245_708_444_053_548_205_507_651_050_633_573_196_165.71428571 + assert_eq!( + Uint256::from_str( + "44111272090406169685169899050928726801245708444053548205507651050633573196165" + ) + .unwrap(), + res + ) + } + + #[test] + fn div_floor_works_with_decimal() { + let decimal = Decimal::from_ratio(21u128, 8u128); + let res = Uint256::from(123456u128).div_floor(decimal); // 47030.8571 + assert_eq!(Uint256::from(47030u128), res) + } + + #[test] + fn div_floor_works_with_decimal_evenly() { + let res = Uint256::from(60u128).div_floor(Decimal::from_atomics(6u128, 0).unwrap()); + assert_eq!(res, Uint256::from(10u128)); + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn div_floor_panics_on_overflow() { + let fraction = (8u128, 21u128); + _ = Uint256::MAX.div_floor(fraction); + } + + #[test] + fn div_floor_does_not_panic_on_overflow() { + let fraction = (8u128, 21u128); + assert_eq!( + Uint256::MAX.checked_div_floor(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint512", + target_type: "Uint256", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn div_ceil_raises_with_zero() { + let fraction = (Uint256::zero(), Uint256::from(21u128)); + _ = Uint256::from(123456u128).div_ceil(fraction); + } + + #[test] + fn div_ceil_does_nothing_with_one() { + let fraction = (Uint256::one(), Uint256::one()); + let res = Uint256::from(123456u128).div_ceil(fraction); + assert_eq!(Uint256::from(123456u128), res) + } + + #[test] + fn div_ceil_rounds_up_with_normal_case() { + let fraction = (5u128, 21u128); + let res = Uint256::from(123456u128).div_ceil(fraction); // 518515.2 + assert_eq!(Uint256::from(518516u128), res) + } + + #[test] + fn div_ceil_does_not_round_on_even_divide() { + let fraction = (5u128, 2u128); + let res = Uint256::from(25u128).div_ceil(fraction); + assert_eq!(Uint256::from(10u128), res) + } + + #[test] + fn div_ceil_works_when_operation_temporarily_takes_above_max() { + let fraction = (21u128, 8u128); + let res = Uint256::MAX.div_ceil(fraction); // 44_111_272_090_406_169_685_169_899_050_928_726_801_245_708_444_053_548_205_507_651_050_633_573_196_165.71428571 + assert_eq!( + Uint256::from_str( + "44111272090406169685169899050928726801245708444053548205507651050633573196166" + ) + .unwrap(), + res + ) + } + + #[test] + fn div_ceil_works_with_decimal() { + let decimal = Decimal::from_ratio(21u128, 8u128); + let res = Uint256::from(123456u128).div_ceil(decimal); // 47030.8571 + assert_eq!(Uint256::from(47031u128), res) + } + + #[test] + fn div_ceil_works_with_decimal_evenly() { + let res = Uint256::from(60u128).div_ceil(Decimal::from_atomics(6u128, 0).unwrap()); + assert_eq!(res, Uint256::from(10u128)); + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn div_ceil_panics_on_overflow() { + let fraction = (8u128, 21u128); + _ = Uint256::MAX.div_ceil(fraction); + } + + #[test] + fn div_ceil_does_not_panic_on_overflow() { + let fraction = (8u128, 21u128); + assert_eq!( + Uint256::MAX.checked_div_ceil(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint512", + target_type: "Uint256", + })), + ); + } } diff --git a/packages/std/src/math/uint512.rs b/packages/std/src/math/uint512.rs index fe7c1c7a2d..811f8cf5e5 100644 --- a/packages/std/src/math/uint512.rs +++ b/packages/std/src/math/uint512.rs @@ -1,29 +1,27 @@ -use forward_ref::{forward_ref_binop, forward_ref_op_assign}; -use schemars::JsonSchema; -use serde::{de, ser, Deserialize, Deserializer, Serialize}; -use std::fmt; -use std::ops::{ - Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Shr, ShrAssign, Sub, SubAssign, +use alloc::string::{String, ToString}; +use core::fmt; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Not, Rem, RemAssign, Shl, ShlAssign, Shr, + ShrAssign, Sub, SubAssign, }; -use std::str::FromStr; +use core::str::FromStr; use crate::errors::{ - ConversionOverflowError, DivideByZeroError, OverflowError, OverflowOperation, StdError, + ConversionOverflowError, DivideByZeroError, ErrorKind, OverflowError, OverflowOperation, + StdError, +}; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + Int128, Int256, Int512, Int64, Uint128, Uint256, Uint64, __internal::forward_ref_partial_eq, }; -use crate::{Uint128, Uint256, Uint64}; - -/// This module is purely a workaround that lets us ignore lints for all the code -/// the `construct_uint!` macro generates. -#[allow(clippy::all)] -mod uints { - uint::construct_uint! { - pub struct U512(8); - } -} /// Used internally - we don't want to leak this type since we might change /// the implementation in the future. -use uints::U512; +use bnum::types::U512; + +use super::conversion::{forward_try_from, primitive_to_wrapped_int, try_from_int_to_uint}; +use super::impl_int_serde; +use super::num_consts::NumConsts; /// An implementation of u512 that is using strings for JSON encoding/decoding, /// such that the full u512 range can be used for clients that convert JSON numbers to floats, @@ -31,13 +29,14 @@ use uints::U512; /// /// # Examples /// -/// Use `from` to create instances out of primitive uint types or `new` to provide big -/// endian bytes: +/// Use `new` to create instances out of u128, `from` for other primitive uint types +/// or `from_be_bytes` to provide big endian bytes: /// /// ``` /// # use cosmwasm_std::Uint512; -/// let a = Uint512::from(258u128); -/// let b = Uint512::new([ +/// let a = Uint512::new(258u128); +/// let b = Uint512::from(258u16); +/// let c = Uint512::from_be_bytes([ /// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, /// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, /// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, @@ -48,36 +47,61 @@ use uints::U512; /// 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, /// ]); /// assert_eq!(a, b); +/// assert_eq!(a, c); /// ``` -#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, JsonSchema)] -pub struct Uint512(#[schemars(with = "String")] U512); +#[derive( + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Integer { precision: 512, signed: false })] +pub struct Uint512(#[schemars(with = "String")] pub(crate) U512); + +impl_int_serde!(Uint512); +forward_ref_partial_eq!(Uint512, Uint512); impl Uint512 { pub const MAX: Uint512 = Uint512(U512::MAX); - pub const MIN: Uint512 = Uint512(U512::zero()); + pub const MIN: Uint512 = Uint512(U512::ZERO); - /// Creates a Uint512(value) from a big endian representation. It's just an alias for - /// `from_big_endian`. - pub const fn new(value: [u8; 64]) -> Self { - Self::from_be_bytes(value) + /// Creates a Uint512(value). + /// + /// This method is less flexible than `from` but can be called in a const context. + /// + /// Before CosmWasm 3 this took a byte array as an argument. You can get this behaviour + /// with [`from_be_bytes`]. + /// + /// [`from_be_bytes`]: Self::from_be_bytes + #[must_use] + pub const fn new(value: u128) -> Self { + let b = value.to_be_bytes(); + Self::from_be_bytes([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, b[0], b[1], b[2], b[3], b[4], + b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15], + ]) } /// Creates a Uint512(0) #[inline] pub const fn zero() -> Self { - Uint512(U512::zero()) + Uint512(U512::ZERO) } /// Creates a Uint512(1) #[inline] pub const fn one() -> Self { - Self::from_be_bytes([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, - ]) + Self(U512::ONE) } + #[must_use] pub const fn from_be_bytes(data: [u8; 64]) -> Self { let words: [u64; 8] = [ u64::from_le_bytes([ @@ -105,9 +129,10 @@ impl Uint512 { data[7], data[6], data[5], data[4], data[3], data[2], data[1], data[0], ]), ]; - Self(U512(words)) + Self(U512::from_digits(words)) } + #[must_use] pub const fn from_le_bytes(data: [u8; 64]) -> Self { let words: [u64; 8] = [ u64::from_le_bytes([ @@ -135,11 +160,12 @@ impl Uint512 { data[56], data[57], data[58], data[59], data[60], data[61], data[62], data[63], ]), ]; - Self(U512(words)) + Self(U512::from_digits(words)) } /// A conversion from `Uint256` that, unlike the one provided by the `From` trait, /// can be used in a `const` context. + #[must_use] pub const fn from_uint256(num: Uint256) -> Self { let bytes = num.to_le_bytes(); Self::from_le_bytes([ @@ -153,85 +179,95 @@ impl Uint512 { } /// Returns a copy of the number as big endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn to_be_bytes(self) -> [u8; 64] { + let words = self.0.digits(); let words = [ - (self.0).0[7].to_be_bytes(), - (self.0).0[6].to_be_bytes(), - (self.0).0[5].to_be_bytes(), - (self.0).0[4].to_be_bytes(), - (self.0).0[3].to_be_bytes(), - (self.0).0[2].to_be_bytes(), - (self.0).0[1].to_be_bytes(), - (self.0).0[0].to_be_bytes(), + words[7].to_be_bytes(), + words[6].to_be_bytes(), + words[5].to_be_bytes(), + words[4].to_be_bytes(), + words[3].to_be_bytes(), + words[2].to_be_bytes(), + words[1].to_be_bytes(), + words[0].to_be_bytes(), ]; - unsafe { std::mem::transmute::<[[u8; 8]; 8], [u8; 64]>(words) } + unsafe { core::mem::transmute::<[[u8; 8]; 8], [u8; 64]>(words) } } /// Returns a copy of the number as little endian bytes. + #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn to_le_bytes(self) -> [u8; 64] { + let words = self.0.digits(); let words = [ - (self.0).0[0].to_le_bytes(), - (self.0).0[1].to_le_bytes(), - (self.0).0[2].to_le_bytes(), - (self.0).0[3].to_le_bytes(), - (self.0).0[4].to_le_bytes(), - (self.0).0[5].to_le_bytes(), - (self.0).0[6].to_le_bytes(), - (self.0).0[7].to_le_bytes(), + words[0].to_le_bytes(), + words[1].to_le_bytes(), + words[2].to_le_bytes(), + words[3].to_le_bytes(), + words[4].to_le_bytes(), + words[5].to_le_bytes(), + words[6].to_le_bytes(), + words[7].to_le_bytes(), ]; - unsafe { std::mem::transmute::<[[u8; 8]; 8], [u8; 64]>(words) } + unsafe { core::mem::transmute::<[[u8; 8]; 8], [u8; 64]>(words) } } + #[must_use] pub const fn is_zero(&self) -> bool { - let words = (self.0).0; - words[0] == 0 - && words[1] == 0 - && words[2] == 0 - && words[3] == 0 - && words[4] == 0 - && words[5] == 0 - && words[6] == 0 - && words[7] == 0 + self.0.is_zero() } - pub fn pow(self, exp: u32) -> Self { - let res = self.0.pow(exp.into()); - Self(res) + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn pow(self, exp: u32) -> Self { + match self.0.checked_pow(exp) { + Some(val) => Self(val), + None => panic!("attempt to exponentiate with overflow"), + } + } + + /// Returns the base 2 logarithm of the number, rounded down. + /// + /// # Panics + /// + /// This function will panic if `self` is zero. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn ilog2(self) -> u32 { + self.0.checked_ilog2().unwrap() } pub fn checked_add(self, other: Self) -> Result { self.0 .checked_add(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Add, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Add)) } pub fn checked_sub(self, other: Self) -> Result { self.0 .checked_sub(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Sub, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Sub)) } pub fn checked_mul(self, other: Self) -> Result { self.0 .checked_mul(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Mul, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Mul)) } pub fn checked_pow(self, exp: u32) -> Result { self.0 - .checked_pow(exp.into()) + .checked_pow(exp) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Pow, self, exp)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Pow)) } pub fn checked_div(self, other: Self) -> Result { self.0 .checked_div(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) } pub fn checked_div_euclid(self, other: Self) -> Result { @@ -242,74 +278,116 @@ impl Uint512 { self.0 .checked_rem(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) } pub fn checked_shr(self, other: u32) -> Result { + self.0 + .checked_shr(other) + .map(Self) + .ok_or_else(|| OverflowError::new(OverflowOperation::Shr)) + } + + pub fn checked_shl(self, other: u32) -> Result { if other >= 512 { - return Err(OverflowError::new(OverflowOperation::Shr, self, other)); + return Err(OverflowError::new(OverflowOperation::Shl)); } - Ok(Self(self.0.shr(other))) + Ok(Self(self.0.shl(other))) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_add(self, other: Self) -> Self { - let (value, _did_overflow) = self.0.overflowing_add(other.0); - Self(value) + Self(self.0.wrapping_add(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_sub(self, other: Self) -> Self { - let (value, _did_overflow) = self.0.overflowing_sub(other.0); - Self(value) + Self(self.0.wrapping_sub(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_mul(self, other: Self) -> Self { - let (value, _did_overflow) = self.0.overflowing_mul(other.0); - Self(value) + Self(self.0.wrapping_mul(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_pow(self, other: u32) -> Self { - let (value, _did_overflow) = self.0.overflowing_pow(other.into()); - Self(value) + Self(self.0.wrapping_pow(other)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_add(self, other: Self) -> Self { Self(self.0.saturating_add(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_sub(self, other: Self) -> Self { Self(self.0.saturating_sub(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_mul(self, other: Self) -> Self { Self(self.0.saturating_mul(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_pow(self, exp: u32) -> Self { - match self.checked_pow(exp) { - Ok(value) => value, - Err(_) => Self::MAX, + Self(self.0.saturating_pow(exp)) + } + + /// Strict integer addition. Computes `self + rhs`, panicking if overflow occurred. + /// + /// This is the same as [`Uint512::add`] but const. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn strict_add(self, rhs: Self) -> Self { + match self.0.checked_add(rhs.0) { + None => panic!("attempt to add with overflow"), + Some(sum) => Self(sum), } } - pub fn abs_diff(self, other: Self) -> Self { - if self < other { - other - self - } else { - self - other + /// Strict integer subtraction. Computes `self - rhs`, panicking if overflow occurred. + /// + /// This is the same as [`Uint512::sub`] but const. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn strict_sub(self, other: Self) -> Self { + match self.0.checked_sub(other.0) { + None => panic!("attempt to subtract with overflow"), + Some(diff) => Self(diff), } } + + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn abs_diff(self, other: Self) -> Self { + Self(self.0.abs_diff(other.0)) + } +} + +impl NumConsts for Uint512 { + const ZERO: Self = Self::zero(); + const ONE: Self = Self::one(); + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; } +// uint to Uint +primitive_to_wrapped_int!(u8, Uint512); +primitive_to_wrapped_int!(u16, Uint512); +primitive_to_wrapped_int!(u32, Uint512); +primitive_to_wrapped_int!(u64, Uint512); +primitive_to_wrapped_int!(u128, Uint512); + impl From for Uint512 { fn from(val: Uint256) -> Self { - let bytes = [[0u8; 32], val.to_be_bytes()].concat(); + let mut bytes = [0u8; 64]; + bytes[32..].copy_from_slice(&val.to_be_bytes()); - Self::from_be_bytes(bytes.try_into().unwrap()) + Self::from_be_bytes(bytes) } } @@ -325,36 +403,6 @@ impl From for Uint512 { } } -impl From for Uint512 { - fn from(val: u128) -> Self { - Uint512(val.into()) - } -} - -impl From for Uint512 { - fn from(val: u64) -> Self { - Uint512(val.into()) - } -} - -impl From for Uint512 { - fn from(val: u32) -> Self { - Uint512(val.into()) - } -} - -impl From for Uint512 { - fn from(val: u16) -> Self { - Uint512(val.into()) - } -} - -impl From for Uint512 { - fn from(val: u8) -> Self { - Uint512(val.into()) - } -} - impl TryFrom for Uint256 { type Error = ConversionOverflowError; @@ -363,26 +411,21 @@ impl TryFrom for Uint256 { let (first_bytes, last_bytes) = bytes.split_at(32); if first_bytes != [0u8; 32] { - return Err(ConversionOverflowError::new( - "Uint512", - "Uint256", - value.to_string(), - )); + return Err(ConversionOverflowError::new("Uint512", "Uint256")); } Ok(Self::from_be_bytes(last_bytes.try_into().unwrap())) } } -impl TryFrom for Uint128 { - type Error = ConversionOverflowError; +forward_try_from!(Uint512, Uint128); +forward_try_from!(Uint512, Uint64); - fn try_from(value: Uint512) -> Result { - Ok(Uint128::new(value.0.try_into().map_err(|_| { - ConversionOverflowError::new("Uint512", "Uint128", value.to_string()) - })?)) - } -} +// Int to Uint +try_from_int_to_uint!(Int64, Uint512); +try_from_int_to_uint!(Int128, Uint512); +try_from_int_to_uint!(Int256, Uint512); +try_from_int_to_uint!(Int512, Uint512); impl TryFrom<&str> for Uint512 { type Error = StdError; @@ -396,9 +439,11 @@ impl FromStr for Uint512 { type Err = StdError; fn from_str(s: &str) -> Result { - match U512::from_dec_str(s) { + match U512::from_str_radix(s, 10) { Ok(u) => Ok(Self(u)), - Err(e) => Err(StdError::generic_err(format!("Parsing u512: {}", e))), + Err(e) => { + Err(StdError::msg(format_args!("Parsing u512: {e}")).with_kind(ErrorKind::Parsing)) + } } } } @@ -411,11 +456,7 @@ impl From for String { impl fmt::Display for Uint512 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - // The inner type doesn't work as expected with padding, so we - // work around that. - let unpadded = self.0.to_string(); - - f.pad_integral(true, "", &unpadded) + self.0.fmt(f) } } @@ -423,23 +464,16 @@ impl Add for Uint512 { type Output = Self; fn add(self, rhs: Self) -> Self { - Uint512(self.0.checked_add(rhs.0).unwrap()) - } -} - -impl<'a> Add<&'a Uint512> for Uint512 { - type Output = Self; - - fn add(self, rhs: &'a Uint512) -> Self { - Uint512(self.0.checked_add(rhs.0).unwrap()) + self.strict_add(rhs) } } +forward_ref_binop!(impl Add, add for Uint512, Uint512); impl Sub for Uint512 { type Output = Self; fn sub(self, rhs: Self) -> Self { - Uint512(self.0.checked_sub(rhs.0).unwrap()) + self.strict_sub(rhs) } } forward_ref_binop!(impl Sub, sub for Uint512, Uint512); @@ -480,6 +514,14 @@ impl Rem for Uint512 { } forward_ref_binop!(impl Rem, rem for Uint512, Uint512); +impl Not for Uint512 { + type Output = Self; + + fn not(self) -> Self::Output { + Self(!self.0) + } +} + impl RemAssign for Uint512 { fn rem_assign(&mut self, rhs: Uint512) { *self = *self % rhs; @@ -509,8 +551,7 @@ impl Shr for Uint512 { fn shr(self, rhs: u32) -> Self::Output { self.checked_shr(rhs).unwrap_or_else(|_| { panic!( - "right shift error: {} is larger or equal than the number of bits in Uint512", - rhs, + "right shift error: {rhs} is larger or equal than the number of bits in Uint512", ) }) } @@ -524,6 +565,23 @@ impl<'a> Shr<&'a u32> for Uint512 { } } +impl Shl for Uint512 { + type Output = Self; + + fn shl(self, rhs: u32) -> Self::Output { + self.checked_shl(rhs) + .expect("attempt to shift left with overflow") + } +} + +impl<'a> Shl<&'a u32> for Uint512 { + type Output = Self; + + fn shl(self, rhs: &'a u32) -> Self::Output { + self.shl(*rhs) + } +} + impl AddAssign for Uint512 { fn add_assign(&mut self, rhs: Uint512) { self.0 = self.0.checked_add(rhs.0).unwrap(); @@ -560,44 +618,19 @@ impl<'a> ShrAssign<&'a u32> for Uint512 { } } -impl Serialize for Uint512 { - /// Serializes as an integer string using base 10 - fn serialize(&self, serializer: S) -> Result - where - S: ser::Serializer, - { - serializer.serialize_str(&self.to_string()) +impl ShlAssign for Uint512 { + fn shl_assign(&mut self, rhs: u32) { + *self = self.shl(rhs); } } -impl<'de> Deserialize<'de> for Uint512 { - /// Deserialized from an integer string using base 10 - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - deserializer.deserialize_str(Uint512Visitor) +impl<'a> ShlAssign<&'a u32> for Uint512 { + fn shl_assign(&mut self, rhs: &'a u32) { + *self = self.shl(*rhs); } } -struct Uint512Visitor; - -impl<'de> de::Visitor<'de> for Uint512Visitor { - type Value = Uint512; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("string-encoded integer") - } - - fn visit_str(self, v: &str) -> Result - where - E: de::Error, - { - Uint512::try_from(v).map_err(|e| E::custom(format!("invalid Uint512 '{}' - {}", v, e))) - } -} - -impl std::iter::Sum for Uint512 +impl core::iter::Sum for Uint512 where Self: Add, { @@ -606,26 +639,38 @@ where } } -impl PartialEq<&Uint512> for Uint512 { - fn eq(&self, rhs: &&Uint512) -> bool { - self == *rhs - } -} - -impl PartialEq for &Uint512 { - fn eq(&self, rhs: &Uint512) -> bool { - *self == rhs - } -} - #[cfg(test)] mod tests { use super::*; - use crate::{from_slice, to_vec}; + use crate::math::conversion::test_try_from_int_to_uint; + + #[test] + fn size_of_works() { + assert_eq!(core::mem::size_of::(), 64); + } #[test] fn uint512_new_works() { - let num = Uint512::new([1; 64]); + let num = Uint512::new(1); + assert_eq!( + num.to_be_bytes(), + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1 + ] + ); + + for v in [0, 1, 18, 875786576, u128::MAX] { + // From is implemented by bnum, so we test two independent implementations against each other + let uut = Uint512::new(v); + assert_eq!(uut, Uint512::from(v)); + } + } + + #[test] + fn uint512_from_be_bytes_works() { + let num = Uint512::from_be_bytes([1; 64]); let a: [u8; 64] = num.to_be_bytes(); assert_eq!(a, [1; 64]); @@ -635,11 +680,21 @@ mod tests { 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8, ]; - let num = Uint512::new(be_bytes); + let num = Uint512::from_be_bytes(be_bytes); let resulting_bytes: [u8; 64] = num.to_be_bytes(); assert_eq!(be_bytes, resulting_bytes); } + #[test] + fn uint512_not_works() { + let num = Uint512::from_be_bytes([1; 64]); + let a = (!num).to_be_bytes(); + assert_eq!(a, [254; 64]); + + assert_eq!(!Uint512::MAX, Uint512::MIN); + assert_eq!(!Uint512::MIN, Uint512::MAX); + } + #[test] fn uint512_zero_works() { let zero = Uint512::zero(); @@ -682,38 +737,71 @@ mod tests { ]; // These should all be the same. - let num1 = Uint512::new(be_bytes); - let num2 = Uint512::from_be_bytes(be_bytes); - let num3 = Uint512::from_le_bytes(le_bytes); - assert_eq!(num1, Uint512::from(65536u32 + 512 + 3)); - assert_eq!(num1, num2); - assert_eq!(num1, num3); + let a = Uint512::from_be_bytes(be_bytes); + let b = Uint512::from_le_bytes(le_bytes); + assert_eq!(a, Uint512::from(65536u32 + 512 + 3)); + assert_eq!(a, b); } #[test] fn uint512_convert_from() { let a = Uint512::from(5u128); - assert_eq!(a.0, U512::from(5)); + assert_eq!(a.0, U512::from(5u32)); let a = Uint512::from(5u64); - assert_eq!(a.0, U512::from(5)); + assert_eq!(a.0, U512::from(5u32)); let a = Uint512::from(5u32); - assert_eq!(a.0, U512::from(5)); + assert_eq!(a.0, U512::from(5u32)); let a = Uint512::from(5u16); - assert_eq!(a.0, U512::from(5)); + assert_eq!(a.0, U512::from(5u32)); let a = Uint512::from(5u8); - assert_eq!(a.0, U512::from(5)); + assert_eq!(a.0, U512::from(5u32)); let result = Uint512::try_from("34567"); - assert_eq!(result.unwrap().0, U512::from_dec_str("34567").unwrap()); + assert_eq!( + result.unwrap().0, + U512::from_str_radix("34567", 10).unwrap() + ); let result = Uint512::try_from("1.23"); assert!(result.is_err()); } + #[test] + fn uint512_try_from_signed_works() { + test_try_from_int_to_uint::("Int64", "Uint512"); + test_try_from_int_to_uint::("Int128", "Uint512"); + test_try_from_int_to_uint::("Int256", "Uint512"); + test_try_from_int_to_uint::("Int512", "Uint512"); + } + + #[test] + fn uint512_try_into() { + assert!(Uint64::try_from(Uint512::MAX).is_err()); + assert!(Uint128::try_from(Uint512::MAX).is_err()); + assert!(Uint256::try_from(Uint512::MAX).is_err()); + + assert_eq!(Uint64::try_from(Uint512::zero()), Ok(Uint64::zero())); + assert_eq!(Uint128::try_from(Uint512::zero()), Ok(Uint128::zero())); + assert_eq!(Uint256::try_from(Uint512::zero()), Ok(Uint256::zero())); + + assert_eq!( + Uint64::try_from(Uint512::from(42u64)), + Ok(Uint64::from(42u64)) + ); + assert_eq!( + Uint128::try_from(Uint512::from(42u128)), + Ok(Uint128::from(42u128)) + ); + assert_eq!( + Uint256::try_from(Uint512::from(42u128)), + Ok(Uint256::from(42u128)) + ); + } + #[test] fn uint512_convert_to_uint128() { let source = Uint512::from(42u128); @@ -724,11 +812,7 @@ mod tests { let target = Uint128::try_from(source); assert_eq!( target, - Err(ConversionOverflowError::new( - "Uint512", - "Uint128", - Uint512::MAX.to_string() - )) + Err(ConversionOverflowError::new("Uint512", "Uint128")) ); } @@ -761,18 +845,23 @@ mod tests { #[test] fn uint512_implements_display() { let a = Uint512::from(12345u32); - assert_eq!(format!("Embedded: {}", a), "Embedded: 12345"); + assert_eq!(format!("Embedded: {a}"), "Embedded: 12345"); assert_eq!(a.to_string(), "12345"); let a = Uint512::zero(); - assert_eq!(format!("Embedded: {}", a), "Embedded: 0"); + assert_eq!(format!("Embedded: {a}"), "Embedded: 0"); assert_eq!(a.to_string(), "0"); } #[test] fn uint512_display_padding_works() { + // width > natural representation let a = Uint512::from(123u64); - assert_eq!(format!("Embedded: {:05}", a), "Embedded: 00123"); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: 00123"); + + // width < natural representation + let a = Uint512::from(123u64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: 123"); } #[test] @@ -886,7 +975,7 @@ mod tests { #[test] fn uint512_is_zero_works() { assert!(Uint512::zero().is_zero()); - assert!(Uint512(U512::from(0)).is_zero()); + assert!(Uint512(U512::from(0u32)).is_zero()); assert!(!Uint512::from(1u32).is_zero()); assert!(!Uint512::from(123u32).is_zero()); @@ -932,9 +1021,9 @@ mod tests { #[test] fn uint512_json() { let orig = Uint512::from(1234567890987654321u128); - let serialized = to_vec(&orig).unwrap(); + let serialized = serde_json::to_vec(&orig).unwrap(); assert_eq!(serialized.as_slice(), b"\"1234567890987654321\""); - let parsed: Uint512 = from_slice(&serialized).unwrap(); + let parsed: Uint512 = serde_json::from_slice(&serialized).unwrap(); assert_eq!(parsed, orig); } @@ -954,14 +1043,6 @@ mod tests { let a = Uint512::from(12345u32); let b = Uint512::from(23456u32); - // test + with owned and reference right hand side - assert_eq!(a + b, Uint512::from(35801u32)); - assert_eq!(a + &b, Uint512::from(35801u32)); - - // test - with owned and reference right hand side - assert_eq!(b - a, Uint512::from(11111u32)); - assert_eq!(b - &a, Uint512::from(11111u32)); - // test += with owned and reference right hand side let mut c = Uint512::from(300000u32); c += b; @@ -980,16 +1061,36 @@ mod tests { // error result on underflow (- would produce negative result) let underflow_result = a.checked_sub(b); - let OverflowError { - operand1, operand2, .. - } = underflow_result.unwrap_err(); - assert_eq!((operand1, operand2), (a.to_string(), b.to_string())); + let OverflowError { operation } = underflow_result.unwrap_err(); + assert_eq!(operation, OverflowOperation::Sub); } #[test] - #[should_panic] + #[allow(clippy::op_ref)] + fn uint512_add_works() { + assert_eq!( + Uint512::from(2u32) + Uint512::from(1u32), + Uint512::from(3u32) + ); + assert_eq!( + Uint512::from(2u32) + Uint512::from(0u32), + Uint512::from(2u32) + ); + + // works for refs + let a = Uint512::from(10u32); + let b = Uint512::from(3u32); + let expected = Uint512::from(13u32); + assert_eq!(a + b, expected); + assert_eq!(a + &b, expected); + assert_eq!(&a + b, expected); + assert_eq!(&a + &b, expected); + } + + #[test] + #[should_panic(expected = "attempt to add with overflow")] fn uint512_add_overflow_panics() { - let max = Uint512::new([255u8; 64]); + let max = Uint512::MAX; let _ = max + Uint512::from(12u32); } @@ -1080,19 +1181,19 @@ mod tests { #[test] #[should_panic] fn uint512_pow_overflow_panics() { - Uint512::MAX.pow(2u32); + _ = Uint512::MAX.pow(2u32); } #[test] fn uint512_shr_works() { - let original = Uint512::new([ + let original = Uint512::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 2u8, 0u8, 4u8, 2u8, ]); - let shifted = Uint512::new([ + let shifted = Uint512::from_be_bytes([ 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, @@ -1108,6 +1209,31 @@ mod tests { let _ = Uint512::from(1u32) >> 512u32; } + #[test] + fn uint512_shl_works() { + let original = Uint512::from_be_bytes([ + 64u8, 128u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ]); + + let shifted = Uint512::from_be_bytes([ + 2u8, 0u8, 4u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ]); + + assert_eq!(original << 2u32, shifted); + } + + #[test] + #[should_panic] + fn uint512_shl_overflow_panics() { + let _ = Uint512::from(1u32) << 512u32; + } + #[test] fn sum_works() { let nums = vec![ @@ -1226,7 +1352,7 @@ mod tests { } #[test] - #[should_panic(expected = "division by zero")] + #[should_panic(expected = "divisor of zero")] fn uint512_rem_panics_for_zero() { let _ = Uint512::from(10u32) % Uint512::zero(); } @@ -1263,6 +1389,37 @@ mod tests { assert_eq!(a, Uint512::from(1u32)); } + #[test] + fn uint512_strict_add_works() { + let a = Uint512::from(5u32); + let b = Uint512::from(3u32); + assert_eq!(a.strict_add(b), Uint512::from(8u32)); + assert_eq!(b.strict_add(a), Uint512::from(8u32)); + } + + #[test] + #[should_panic(expected = "attempt to add with overflow")] + fn uint512_strict_add_panics_on_overflow() { + let a = Uint512::MAX; + let b = Uint512::ONE; + let _ = a.strict_add(b); + } + + #[test] + fn uint512_strict_sub_works() { + let a = Uint512::from(5u32); + let b = Uint512::from(3u32); + assert_eq!(a.strict_sub(b), Uint512::from(2u32)); + } + + #[test] + #[should_panic(expected = "attempt to subtract with overflow")] + fn uint512_strict_sub_panics_on_overflow() { + let a = Uint512::ZERO; + let b = Uint512::ONE; + let _ = a.strict_sub(b); + } + #[test] fn uint512_abs_diff_works() { let a = Uint512::from(42u32); diff --git a/packages/std/src/math/uint64.rs b/packages/std/src/math/uint64.rs index 57cf1154f4..5d2ab9e810 100644 --- a/packages/std/src/math/uint64.rs +++ b/packages/std/src/math/uint64.rs @@ -1,15 +1,25 @@ -use forward_ref::{forward_ref_binop, forward_ref_op_assign}; -use schemars::JsonSchema; -use serde::{de, ser, Deserialize, Deserializer, Serialize}; -use std::fmt::{self}; -use std::ops::{ - Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Shr, ShrAssign, Sub, SubAssign, +use alloc::string::{String, ToString}; +use core::fmt; +use core::ops::{ + Add, AddAssign, Div, DivAssign, Mul, MulAssign, Not, Rem, RemAssign, Shl, ShlAssign, Shr, + ShrAssign, Sub, SubAssign, }; use crate::errors::{ - CheckedMultiplyRatioError, DivideByZeroError, OverflowError, OverflowOperation, StdError, + CheckedMultiplyFractionError, CheckedMultiplyRatioError, DivideByZeroError, ErrorKind, + OverflowError, OverflowOperation, StdError, }; -use crate::Uint128; +use crate::forward_ref::{forward_ref_binop, forward_ref_op_assign}; +use crate::{ + __internal::forward_ref_partial_eq, impl_mul_fraction, Fraction, Int128, Int256, Int512, Int64, + Uint128, +}; + +use super::conversion::{ + forward_try_from, from_and_to_bytes, primitive_to_wrapped_int, wrapped_int_to_primitive, +}; +use super::impl_int_serde; +use super::num_consts::NumConsts; /// A thin wrapper around u64 that is using strings for JSON encoding/decoding, /// such that the full u64 range can be used for clients that convert JSON numbers to floats, @@ -27,8 +37,23 @@ use crate::Uint128; /// let b = Uint64::from(70u32); /// assert_eq!(b.u64(), 70); /// ``` -#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, JsonSchema)] -pub struct Uint64(#[schemars(with = "String")] u64); +#[derive( + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, +)] +#[schemaifier(type = cw_schema::NodeType::Integer { precision: 64, signed: false })] +pub struct Uint64(#[schemars(with = "String")] pub(crate) u64); + +impl_int_serde!(Uint64); +forward_ref_partial_eq!(Uint64, Uint64); impl Uint64 { pub const MAX: Self = Self(u64::MAX); @@ -37,6 +62,8 @@ impl Uint64 { /// Creates a Uint64(value). /// /// This method is less flexible than `from` but can be called in a const context. + #[inline] + #[must_use] pub const fn new(value: u64) -> Self { Uint64(value) } @@ -58,28 +85,36 @@ impl Uint64 { self.0 } - /// Returns a copy of the number as big endian bytes. - pub const fn to_be_bytes(self) -> [u8; 8] { - self.0.to_be_bytes() - } - - /// Returns a copy of the number as little endian bytes. - pub const fn to_le_bytes(self) -> [u8; 8] { - self.0.to_le_bytes() - } + from_and_to_bytes!(u64, 8); + #[must_use] pub const fn is_zero(&self) -> bool { self.0 == 0 } - pub fn pow(self, exp: u32) -> Self { - self.0.pow(exp).into() + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn pow(self, exp: u32) -> Self { + match self.0.checked_pow(exp) { + Some(val) => Self(val), + None => panic!("attempt to exponentiate with overflow"), + } + } + + /// Returns the base 2 logarithm of the number, rounded down. + /// + /// # Panics + /// + /// This function will panic if `self` is zero. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn ilog2(self) -> u32 { + self.0.checked_ilog2().unwrap() } /// Returns `self * numerator / denominator`. /// /// Due to the nature of the integer division involved, the result is always floored. /// E.g. 5 * 99/100 = 4. + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn multiply_ratio, B: Into>( &self, numerator: A, @@ -126,8 +161,9 @@ impl Uint64 { /// let result = a.full_mul(2u32); /// assert_eq!(result.to_string(), "36893488147419103230"); /// ``` - pub fn full_mul(self, rhs: impl Into) -> Uint128 { - Uint128::from(self.u64()) + #[must_use = "this returns the result of the operation, without modifying the original"] + pub fn full_mul(self, rhs: impl Into) -> Uint128 { + Uint128::from(self) .checked_mul(Uint128::from(rhs.into())) .unwrap() } @@ -136,87 +172,134 @@ impl Uint64 { self.0 .checked_add(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Add, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Add)) } pub fn checked_sub(self, other: Self) -> Result { self.0 .checked_sub(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Sub, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Sub)) } pub fn checked_mul(self, other: Self) -> Result { self.0 .checked_mul(other.0) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Mul, self, other)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Mul)) } pub fn checked_pow(self, exp: u32) -> Result { self.0 .checked_pow(exp) .map(Self) - .ok_or_else(|| OverflowError::new(OverflowOperation::Pow, self, exp)) + .ok_or_else(|| OverflowError::new(OverflowOperation::Pow)) } pub fn checked_div(self, other: Self) -> Result { self.0 .checked_div(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) } pub fn checked_div_euclid(self, other: Self) -> Result { self.0 .checked_div_euclid(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) } pub fn checked_rem(self, other: Self) -> Result { self.0 .checked_rem(other.0) .map(Self) - .ok_or_else(|| DivideByZeroError::new(self)) + .ok_or(DivideByZeroError) + } + + pub fn checked_shr(self, other: u32) -> Result { + if other >= 64 { + return Err(OverflowError::new(OverflowOperation::Shr)); + } + + Ok(Self(self.0.shr(other))) } + pub fn checked_shl(self, other: u32) -> Result { + if other >= 64 { + return Err(OverflowError::new(OverflowOperation::Shl)); + } + + Ok(Self(self.0.shl(other))) + } + + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_add(self, other: Self) -> Self { Self(self.0.wrapping_add(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_sub(self, other: Self) -> Self { Self(self.0.wrapping_sub(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_mul(self, other: Self) -> Self { Self(self.0.wrapping_mul(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] #[inline] pub fn wrapping_pow(self, other: u32) -> Self { Self(self.0.wrapping_pow(other)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_add(self, other: Self) -> Self { Self(self.0.saturating_add(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_sub(self, other: Self) -> Self { Self(self.0.saturating_sub(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_mul(self, other: Self) -> Self { Self(self.0.saturating_mul(other.0)) } + #[must_use = "this returns the result of the operation, without modifying the original"] pub fn saturating_pow(self, exp: u32) -> Self { Self(self.0.saturating_pow(exp)) } + /// Strict integer addition. Computes `self + rhs`, panicking if overflow occurred. + /// + /// This is the same as [`Uint64::add`] but const. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn strict_add(self, rhs: Self) -> Self { + match self.0.checked_add(rhs.u64()) { + None => panic!("attempt to add with overflow"), + Some(sum) => Self(sum), + } + } + + /// Strict integer subtraction. Computes `self - rhs`, panicking if overflow occurred. + /// + /// This is the same as [`Uint64::sub`] but const. + #[must_use = "this returns the result of the operation, without modifying the original"] + pub const fn strict_sub(self, other: Self) -> Self { + match self.0.checked_sub(other.u64()) { + None => panic!("attempt to subtract with overflow"), + Some(diff) => Self(diff), + } + } + + #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn abs_diff(self, other: Self) -> Self { Self(if self.0 < other.0 { other.0 - self.0 @@ -226,34 +309,35 @@ impl Uint64 { } } +impl NumConsts for Uint64 { + const ZERO: Self = Self::zero(); + const ONE: Self = Self::one(); + const MAX: Self = Self::MAX; + const MIN: Self = Self::MIN; +} + +impl_mul_fraction!(Uint64); + // `From` is implemented manually instead of // using `impl> From for Uint64` because // of the conflict with `TryFrom<&str>` as described here // https://stackoverflow.com/questions/63136970/how-do-i-work-around-the-upstream-crates-may-add-a-new-impl-of-trait-error -impl From for Uint64 { - fn from(val: u64) -> Self { - Uint64(val) - } -} - -impl From for Uint64 { - fn from(val: u32) -> Self { - Uint64(val.into()) - } -} +// uint to Uint +primitive_to_wrapped_int!(u8, Uint64); +primitive_to_wrapped_int!(u16, Uint64); +primitive_to_wrapped_int!(u32, Uint64); +primitive_to_wrapped_int!(u64, Uint64); -impl From for Uint64 { - fn from(val: u16) -> Self { - Uint64(val.into()) - } -} +// Uint to uint +wrapped_int_to_primitive!(Uint64, u64); +wrapped_int_to_primitive!(Uint64, u128); -impl From for Uint64 { - fn from(val: u8) -> Self { - Uint64(val.into()) - } -} +// Int to Uint +forward_try_from!(Int64, Uint64); +forward_try_from!(Int128, Uint64); +forward_try_from!(Int256, Uint64); +forward_try_from!(Int512, Uint64); impl TryFrom<&str> for Uint64 { type Error = StdError; @@ -261,7 +345,9 @@ impl TryFrom<&str> for Uint64 { fn try_from(val: &str) -> Result { match val.parse::() { Ok(u) => Ok(Uint64(u)), - Err(e) => Err(StdError::generic_err(format!("Parsing u64: {}", e))), + Err(e) => { + Err(StdError::msg(format_args!("Parsing u64: {e}")).with_kind(ErrorKind::Parsing)) + } } } } @@ -272,12 +358,6 @@ impl From for String { } } -impl From for u64 { - fn from(original: Uint64) -> Self { - original.0 - } -} - impl fmt::Display for Uint64 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.0.fmt(f) @@ -288,27 +368,16 @@ impl Add for Uint64 { type Output = Self; fn add(self, rhs: Self) -> Self { - Uint64(self.u64().checked_add(rhs.u64()).unwrap()) - } -} - -impl<'a> Add<&'a Uint64> for Uint64 { - type Output = Self; - - fn add(self, rhs: &'a Uint64) -> Self { - Uint64(self.u64().checked_add(rhs.u64()).unwrap()) + self.strict_add(rhs) } } +forward_ref_binop!(impl Add, add for Uint64, Uint64); impl Sub for Uint64 { type Output = Self; fn sub(self, rhs: Self) -> Self { - Uint64( - self.u64() - .checked_sub(rhs.u64()) - .expect("attempt to subtract with overflow"), - ) + self.strict_sub(rhs) } } forward_ref_binop!(impl Sub, sub for Uint64, Uint64); @@ -369,6 +438,14 @@ impl Rem for Uint64 { } forward_ref_binop!(impl Rem, rem for Uint64, Uint64); +impl Not for Uint64 { + type Output = Self; + + fn not(self) -> Self::Output { + Self(!self.0) + } +} + impl RemAssign for Uint64 { fn rem_assign(&mut self, rhs: Uint64) { *self = *self % rhs; @@ -392,6 +469,26 @@ impl<'a> Shr<&'a u32> for Uint64 { } } +impl Shl for Uint64 { + type Output = Self; + + fn shl(self, rhs: u32) -> Self::Output { + Self( + self.u64() + .checked_shl(rhs) + .expect("attempt to shift left with overflow"), + ) + } +} + +impl<'a> Shl<&'a u32> for Uint64 { + type Output = Self; + + fn shl(self, rhs: &'a u32) -> Self::Output { + self.shl(*rhs) + } +} + impl AddAssign for Uint64 { fn add_assign(&mut self, rhs: Uint64) { self.0 = self.0.checked_add(rhs.u64()).unwrap(); @@ -428,47 +525,19 @@ impl<'a> ShrAssign<&'a u32> for Uint64 { } } -impl Serialize for Uint64 { - /// Serializes as an integer string using base 10 - fn serialize(&self, serializer: S) -> Result - where - S: ser::Serializer, - { - serializer.serialize_str(&self.to_string()) +impl ShlAssign for Uint64 { + fn shl_assign(&mut self, rhs: u32) { + *self = self.shl(rhs); } } -impl<'de> Deserialize<'de> for Uint64 { - /// Deserialized from an integer string using base 10 - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - deserializer.deserialize_str(Uint64Visitor) +impl<'a> ShlAssign<&'a u32> for Uint64 { + fn shl_assign(&mut self, rhs: &'a u32) { + *self = self.shl(*rhs); } } -struct Uint64Visitor; - -impl<'de> de::Visitor<'de> for Uint64Visitor { - type Value = Uint64; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - formatter.write_str("string-encoded integer") - } - - fn visit_str(self, v: &str) -> Result - where - E: de::Error, - { - match v.parse::() { - Ok(u) => Ok(Uint64(u)), - Err(e) => Err(E::custom(format!("invalid Uint64 '{}' - {}", v, e))), - } - } -} - -impl std::iter::Sum for Uint64 +impl core::iter::Sum for Uint64 where Self: Add, { @@ -477,22 +546,27 @@ where } } -impl PartialEq<&Uint64> for Uint64 { - fn eq(&self, rhs: &&Uint64) -> bool { - self == *rhs - } -} - -impl PartialEq for &Uint64 { - fn eq(&self, rhs: &Uint64) -> bool { - *self == rhs - } -} - #[cfg(test)] mod tests { use super::*; - use crate::{from_slice, to_vec}; + use crate::errors::CheckedMultiplyFractionError::{ConversionOverflow, DivideByZero}; + use crate::math::conversion::test_try_from_int_to_uint; + use crate::ConversionOverflowError; + + use alloc::string::ToString; + + #[test] + fn size_of_works() { + assert_eq!(core::mem::size_of::(), 8); + } + + #[test] + fn uint64_not_works() { + assert_eq!(!Uint64::new(1234806), Uint64::new(!1234806)); + + assert_eq!(!Uint64::MAX, Uint64::new(!u64::MAX)); + assert_eq!(!Uint64::MIN, Uint64::new(!u64::MIN)); + } #[test] fn uint64_zero_works() { @@ -506,12 +580,74 @@ mod tests { assert_eq!(one.to_be_bytes(), [0, 0, 0, 0, 0, 0, 0, 1]); } + #[test] + fn uint64_from_be_bytes_works() { + // zero + let original = [0; 8]; + let num = Uint64::from_be_bytes(original); + assert!(num.is_zero()); + + // one + let original = [0, 0, 0, 0, 0, 0, 0, 1]; + let num = Uint64::from_be_bytes(original); + assert_eq!(num.u64(), 1); + + // 258 + let original = [0, 0, 0, 0, 0, 0, 1, 2]; + let num = Uint64::from_be_bytes(original); + assert_eq!(num.u64(), 258); + + // 2x roundtrip + let original = [1; 8]; + let num = Uint64::from_be_bytes(original); + let a: [u8; 8] = num.to_be_bytes(); + assert_eq!(a, original); + + let original = [0u8, 222u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8]; + let num = Uint64::from_be_bytes(original); + let resulting_bytes: [u8; 8] = num.to_be_bytes(); + assert_eq!(resulting_bytes, original); + } + + #[test] + fn uint64_from_le_bytes_works() { + // zero + let original = [0; 8]; + let num = Uint64::from_le_bytes(original); + assert!(num.is_zero()); + + // one + let original = [1, 0, 0, 0, 0, 0, 0, 0]; + let num = Uint64::from_le_bytes(original); + assert_eq!(num.u64(), 1); + + // 258 + let original = [2, 1, 0, 0, 0, 0, 0, 0]; + let num = Uint64::from_le_bytes(original); + assert_eq!(num.u64(), 258); + + // 2x roundtrip + let original = [1; 8]; + let num = Uint64::from_le_bytes(original); + let a: [u8; 8] = num.to_le_bytes(); + assert_eq!(a, original); + + let original = [0u8, 222u8, 0u8, 0u8, 0u8, 1u8, 2u8, 3u8]; + let num = Uint64::from_le_bytes(original); + let resulting_bytes: [u8; 8] = num.to_le_bytes(); + assert_eq!(resulting_bytes, original); + } + #[test] fn uint64_convert_into() { let original = Uint64(12345); let a = u64::from(original); assert_eq!(a, 12345); + let original = Uint64(12345); + let a = u128::from(original); + assert_eq!(a, 12345); + let original = Uint64(12345); let a = String::from(original); assert_eq!(a, "12345"); @@ -538,21 +674,34 @@ mod tests { assert!(result.is_err()); } + #[test] + fn uint64_try_from_signed_works() { + test_try_from_int_to_uint::("Int64", "Uint64"); + test_try_from_int_to_uint::("Int128", "Uint64"); + test_try_from_int_to_uint::("Int256", "Uint64"); + test_try_from_int_to_uint::("Int512", "Uint64"); + } + #[test] fn uint64_implements_display() { let a = Uint64(12345); - assert_eq!(format!("Embedded: {}", a), "Embedded: 12345"); + assert_eq!(format!("Embedded: {a}"), "Embedded: 12345"); assert_eq!(a.to_string(), "12345"); let a = Uint64(0); - assert_eq!(format!("Embedded: {}", a), "Embedded: 0"); + assert_eq!(format!("Embedded: {a}"), "Embedded: 0"); assert_eq!(a.to_string(), "0"); } #[test] fn uint64_display_padding_works() { + // width > natural representation let a = Uint64::from(123u64); - assert_eq!(format!("Embedded: {:05}", a), "Embedded: 00123"); + assert_eq!(format!("Embedded: {a:05}"), "Embedded: 00123"); + + // width < natural representation + let a = Uint64::from(123u64); + assert_eq!(format!("Embedded: {a:02}"), "Embedded: 123"); } #[test] @@ -597,9 +746,9 @@ mod tests { #[test] fn uint64_json() { let orig = Uint64(1234567890987654321); - let serialized = to_vec(&orig).unwrap(); + let serialized = serde_json::to_vec(&orig).unwrap(); assert_eq!(serialized.as_slice(), b"\"1234567890987654321\""); - let parsed: Uint64 = from_slice(&serialized).unwrap(); + let parsed: Uint64 = serde_json::from_slice(&serialized).unwrap(); assert_eq!(parsed, orig); } @@ -619,10 +768,6 @@ mod tests { let a = Uint64(12345); let b = Uint64(23456); - // test + with owned and reference right hand side - assert_eq!(a + b, Uint64(35801)); - assert_eq!(a + &b, Uint64(35801)); - // test - with owned and reference right hand side assert_eq!((b.checked_sub(a)).unwrap(), Uint64(11111)); @@ -636,10 +781,31 @@ mod tests { // error result on underflow (- would produce negative result) let underflow_result = a.checked_sub(b); - let OverflowError { - operand1, operand2, .. - } = underflow_result.unwrap_err(); - assert_eq!((operand1, operand2), (a.to_string(), b.to_string())); + let OverflowError { operation } = underflow_result.unwrap_err(); + assert_eq!(operation, OverflowOperation::Sub); + } + + #[test] + #[allow(clippy::op_ref)] + fn uint64_add_works() { + assert_eq!(Uint64::from(2u32) + Uint64::from(1u32), Uint64::from(3u32)); + assert_eq!(Uint64::from(2u32) + Uint64::from(0u32), Uint64::from(2u32)); + + // works for refs + let a = Uint64::from(10u32); + let b = Uint64::from(3u32); + let expected = Uint64::from(13u32); + assert_eq!(a + b, expected); + assert_eq!(a + &b, expected); + assert_eq!(&a + b, expected); + assert_eq!(&a + &b, expected); + } + + #[test] + #[should_panic(expected = "attempt to add with overflow")] + fn uint64_add_overflow_panics() { + let max = Uint64::MAX; + let _ = max + Uint64(12); } #[test] @@ -717,7 +883,7 @@ mod tests { #[test] #[should_panic] fn uint64_pow_overflow_panics() { - Uint64::MAX.pow(2u32); + _ = Uint64::MAX.pow(2u32); } #[test] @@ -742,11 +908,11 @@ mod tests { assert_eq!(base.multiply_ratio(3u64, 2u64), Uint64(750)); assert_eq!(base.multiply_ratio(333333u64, 222222u64), Uint64(750)); - // factor 2/3 (integer devision always floors the result) + // factor 2/3 (integer division always floors the result) assert_eq!(base.multiply_ratio(2u64, 3u64), Uint64(333)); assert_eq!(base.multiply_ratio(222222u64, 333333u64), Uint64(333)); - // factor 5/6 (integer devision always floors the result) + // factor 5/6 (integer division always floors the result) assert_eq!(base.multiply_ratio(5u64, 6u64), Uint64(416)); assert_eq!(base.multiply_ratio(100u64, 120u64), Uint64(416)); } @@ -771,7 +937,7 @@ mod tests { #[test] #[should_panic(expected = "Denominator must not be zero")] fn uint64_multiply_ratio_panics_for_zero_denominator() { - Uint64(500).multiply_ratio(1u64, 0u64); + _ = Uint64(500).multiply_ratio(1u64, 0u64); } #[test] @@ -786,6 +952,40 @@ mod tests { ); } + #[test] + fn uint64_shr_works() { + let original = Uint64::new(u64::from_be_bytes([0u8, 0u8, 0u8, 0u8, 2u8, 0u8, 4u8, 2u8])); + + let shifted = Uint64::new(u64::from_be_bytes([ + 0u8, 0u8, 0u8, 0u8, 0u8, 128u8, 1u8, 0u8, + ])); + + assert_eq!(original >> 2u32, shifted); + } + + #[test] + #[should_panic] + fn uint64_shr_overflow_panics() { + let _ = Uint64::from(1u32) >> 64u32; + } + + #[test] + fn uint64_shl_works() { + let original = Uint64::new(u64::from_be_bytes([ + 64u8, 128u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, + ])); + + let shifted = Uint64::new(u64::from_be_bytes([2u8, 0u8, 4u8, 0u8, 0u8, 0u8, 0u8, 0u8])); + + assert_eq!(original << 2u32, shifted); + } + + #[test] + #[should_panic] + fn uint64_shl_overflow_panics() { + let _ = Uint64::from(1u32) << 64u32; + } + #[test] fn sum_works() { let nums = vec![Uint64(17), Uint64(123), Uint64(540), Uint64(82)]; @@ -927,6 +1127,37 @@ mod tests { assert_eq!(a, Uint64::from(1u32)); } + #[test] + fn uint64_strict_add_works() { + let a = Uint64::new(5); + let b = Uint64::new(3); + assert_eq!(a.strict_add(b), Uint64::new(8)); + assert_eq!(b.strict_add(a), Uint64::new(8)); + } + + #[test] + #[should_panic(expected = "attempt to add with overflow")] + fn uint64_strict_add_panics_on_overflow() { + let a = Uint64::MAX; + let b = Uint64::ONE; + let _ = a.strict_add(b); + } + + #[test] + fn uint64_strict_sub_works() { + let a = Uint64::new(5); + let b = Uint64::new(3); + assert_eq!(a.strict_sub(b), Uint64::new(2)); + } + + #[test] + #[should_panic(expected = "attempt to subtract with overflow")] + fn uint64_strict_sub_panics_on_overflow() { + let a = Uint64::ZERO; + let b = Uint64::ONE; + let _ = a.strict_sub(b); + } + #[test] fn uint64_abs_diff_works() { let a = Uint64::from(42u32); @@ -950,4 +1181,252 @@ mod tests { assert_eq!(&lhs == &rhs, expected); } } + + #[test] + fn mul_floor_works_with_zero() { + let fraction = (0u32, 21u32); + let res = Uint64::new(123456).mul_floor(fraction); + assert_eq!(Uint64::zero(), res) + } + + #[test] + fn mul_floor_does_nothing_with_one() { + let fraction = (Uint64::one(), Uint64::one()); + let res = Uint64::new(123456).mul_floor(fraction); + assert_eq!(Uint64::new(123456), res) + } + + #[test] + fn mul_floor_rounds_down_with_normal_case() { + let fraction = (8u64, 21u64); + let res = Uint64::new(123456).mul_floor(fraction); // 47030.8571 + assert_eq!(Uint64::new(47030), res) + } + + #[test] + fn mul_floor_does_not_round_on_even_divide() { + let fraction = (2u64, 5u64); + let res = Uint64::new(25).mul_floor(fraction); + assert_eq!(Uint64::new(10), res) + } + + #[test] + fn mul_floor_works_when_operation_temporarily_takes_above_max() { + let fraction = (8u64, 21u64); + let res = Uint64::MAX.mul_floor(fraction); // 7_027_331_075_698_876_805.71428571 + assert_eq!(Uint64::new(7_027_331_075_698_876_805), res) + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn mul_floor_panics_on_overflow() { + let fraction = (21u64, 8u64); + _ = Uint64::MAX.mul_floor(fraction); + } + + #[test] + fn checked_mul_floor_does_not_panic_on_overflow() { + let fraction = (21u64, 8u64); + assert_eq!( + Uint64::MAX.checked_mul_floor(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint128", + target_type: "Uint64", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn mul_floor_panics_on_zero_div() { + let fraction = (21u64, 0u64); + _ = Uint64::new(123456).mul_floor(fraction); + } + + #[test] + fn checked_mul_floor_does_not_panic_on_zero_div() { + let fraction = (21u64, 0u64); + assert_eq!( + Uint64::new(123456).checked_mul_floor(fraction), + Err(DivideByZero(DivideByZeroError)), + ); + } + + #[test] + fn mul_ceil_works_with_zero() { + let fraction = (Uint64::zero(), Uint64::new(21)); + let res = Uint64::new(123456).mul_ceil(fraction); + assert_eq!(Uint64::zero(), res) + } + + #[test] + fn mul_ceil_does_nothing_with_one() { + let fraction = (Uint64::one(), Uint64::one()); + let res = Uint64::new(123456).mul_ceil(fraction); + assert_eq!(Uint64::new(123456), res) + } + + #[test] + fn mul_ceil_rounds_up_with_normal_case() { + let fraction = (8u64, 21u64); + let res = Uint64::new(123456).mul_ceil(fraction); // 47030.8571 + assert_eq!(Uint64::new(47031), res) + } + + #[test] + fn mul_ceil_does_not_round_on_even_divide() { + let fraction = (2u64, 5u64); + let res = Uint64::new(25).mul_ceil(fraction); + assert_eq!(Uint64::new(10), res) + } + + #[test] + fn mul_ceil_works_when_operation_temporarily_takes_above_max() { + let fraction = (8u64, 21u64); + let res = Uint64::MAX.mul_ceil(fraction); // 7_027_331_075_698_876_805.71428571 + assert_eq!(Uint64::new(7_027_331_075_698_876_806), res) + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn mul_ceil_panics_on_overflow() { + let fraction = (21u64, 8u64); + _ = Uint64::MAX.mul_ceil(fraction); + } + + #[test] + fn checked_mul_ceil_does_not_panic_on_overflow() { + let fraction = (21u64, 8u64); + assert_eq!( + Uint64::MAX.checked_mul_ceil(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint128", + target_type: "Uint64", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn mul_ceil_panics_on_zero_div() { + let fraction = (21u64, 0u64); + _ = Uint64::new(123456).mul_ceil(fraction); + } + + #[test] + fn checked_mul_ceil_does_not_panic_on_zero_div() { + let fraction = (21u64, 0u64); + assert_eq!( + Uint64::new(123456).checked_mul_ceil(fraction), + Err(DivideByZero(DivideByZeroError)), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn div_floor_raises_with_zero() { + let fraction = (Uint64::zero(), Uint64::new(21)); + _ = Uint64::new(123456).div_floor(fraction); + } + + #[test] + fn div_floor_does_nothing_with_one() { + let fraction = (Uint64::one(), Uint64::one()); + let res = Uint64::new(123456).div_floor(fraction); + assert_eq!(Uint64::new(123456), res) + } + + #[test] + fn div_floor_rounds_down_with_normal_case() { + let fraction = (5u64, 21u64); + let res = Uint64::new(123456).div_floor(fraction); // 518515.2 + assert_eq!(Uint64::new(518515), res) + } + + #[test] + fn div_floor_does_not_round_on_even_divide() { + let fraction = (5u64, 2u64); + let res = Uint64::new(25).div_floor(fraction); + assert_eq!(Uint64::new(10), res) + } + + #[test] + fn div_floor_works_when_operation_temporarily_takes_above_max() { + let fraction = (21u64, 8u64); + let res = Uint64::MAX.div_floor(fraction); // 7_027_331_075_698_876_805.71428 + assert_eq!(Uint64::new(7_027_331_075_698_876_805), res) + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn div_floor_panics_on_overflow() { + let fraction = (8u64, 21u64); + _ = Uint64::MAX.div_floor(fraction); + } + + #[test] + fn div_floor_does_not_panic_on_overflow() { + let fraction = (8u64, 21u64); + assert_eq!( + Uint64::MAX.checked_div_floor(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint128", + target_type: "Uint64", + })), + ); + } + + #[test] + #[should_panic(expected = "DivideByZeroError")] + fn div_ceil_raises_with_zero() { + let fraction = (Uint64::zero(), Uint64::new(21)); + _ = Uint64::new(123456).div_ceil(fraction); + } + + #[test] + fn div_ceil_does_nothing_with_one() { + let fraction = (Uint64::one(), Uint64::one()); + let res = Uint64::new(123456).div_ceil(fraction); + assert_eq!(Uint64::new(123456), res) + } + + #[test] + fn div_ceil_rounds_up_with_normal_case() { + let fraction = (5u64, 21u64); + let res = Uint64::new(123456).div_ceil(fraction); // 518515.2 + assert_eq!(Uint64::new(518516), res) + } + + #[test] + fn div_ceil_does_not_round_on_even_divide() { + let fraction = (5u64, 2u64); + let res = Uint64::new(25).div_ceil(fraction); + assert_eq!(Uint64::new(10), res) + } + + #[test] + fn div_ceil_works_when_operation_temporarily_takes_above_max() { + let fraction = (21u64, 8u64); + let res = Uint64::MAX.div_ceil(fraction); // 7_027_331_075_698_876_805.71428 + assert_eq!(Uint64::new(7_027_331_075_698_876_806), res) + } + + #[test] + #[should_panic(expected = "ConversionOverflowError")] + fn div_ceil_panics_on_overflow() { + let fraction = (8u64, 21u64); + _ = Uint64::MAX.div_ceil(fraction); + } + + #[test] + fn div_ceil_does_not_panic_on_overflow() { + let fraction = (8u64, 21u64); + assert_eq!( + Uint64::MAX.checked_div_ceil(fraction), + Err(ConversionOverflow(ConversionOverflowError { + source_type: "Uint128", + target_type: "Uint64", + })), + ); + } } diff --git a/packages/std/src/memory.rs b/packages/std/src/memory.rs deleted file mode 100644 index c331a53c47..0000000000 --- a/packages/std/src/memory.rs +++ /dev/null @@ -1,103 +0,0 @@ -use std::mem; -use std::vec::Vec; - -/// Describes some data allocated in Wasm's linear memory. -/// A pointer to an instance of this can be returned over FFI boundaries. -/// -/// This struct is crate internal since the cosmwasm-vm defines the same type independently. -#[repr(C)] -pub struct Region { - /// The beginning of the region expressed as bytes from the beginning of the linear memory - pub offset: u32, - /// The number of bytes available in this region - pub capacity: u32, - /// The number of bytes used in this region - pub length: u32, -} - -/// Creates a memory region of capacity `size` and length 0. Returns a pointer to the Region. -/// This is the same as the `allocate` export, but designed to be called internally. -pub fn alloc(size: usize) -> *mut Region { - let data: Vec = Vec::with_capacity(size); - let data_ptr = data.as_ptr() as usize; - - let region = build_region_from_components( - u32::try_from(data_ptr).expect("pointer doesn't fit in u32"), - u32::try_from(data.capacity()).expect("capacity doesn't fit in u32"), - 0, - ); - mem::forget(data); - Box::into_raw(region) -} - -/// Similar to alloc, but instead of creating a new vector it consumes an existing one and returns -/// a pointer to the Region (preventing the memory from being freed until explicitly called later). -/// -/// The resulting Region has capacity = length, i.e. the buffer's capacity is ignored. -pub fn release_buffer(buffer: Vec) -> *mut Region { - let region = build_region(&buffer); - mem::forget(buffer); - Box::into_raw(region) -} - -/// Return the data referenced by the Region and -/// deallocates the Region (and the vector when finished). -/// Warning: only use this when you are sure the caller will never use (or free) the Region later -/// -/// # Safety -/// -/// The ptr must refer to a valid Region, which was previously returned by alloc, -/// and not yet deallocated. This call will deallocate the Region and return an owner vector -/// to the caller containing the referenced data. -/// -/// Naturally, calling this function twice on the same pointer will double deallocate data -/// and lead to a crash. Make sure to call it exactly once (either consuming the input in -/// the wasm code OR deallocating the buffer from the caller). -pub unsafe fn consume_region(ptr: *mut Region) -> Vec { - assert!(!ptr.is_null(), "Region pointer is null"); - let region = Box::from_raw(ptr); - - let region_start = region.offset as *mut u8; - // This case is explicitely disallowed by Vec - // "The pointer will never be null, so this type is null-pointer-optimized." - assert!(!region_start.is_null(), "Region starts at null pointer"); - - Vec::from_raw_parts( - region_start, - region.length as usize, - region.capacity as usize, - ) -} - -/// Returns a box of a Region, which can be sent over a call to extern -/// note that this DOES NOT take ownership of the data, and we MUST NOT consume_region -/// the resulting data. -/// The Box must be dropped (with scope), but not the data -pub fn build_region(data: &[u8]) -> Box { - let data_ptr = data.as_ptr() as usize; - build_region_from_components( - u32::try_from(data_ptr).expect("pointer doesn't fit in u32"), - u32::try_from(data.len()).expect("length doesn't fit in u32"), - u32::try_from(data.len()).expect("length doesn't fit in u32"), - ) -} - -fn build_region_from_components(offset: u32, capacity: u32, length: u32) -> Box { - Box::new(Region { - offset, - capacity, - length, - }) -} - -/// Returns the address of the optional Region as an offset in linear memory, -/// or zero if not present -#[cfg(feature = "iterator")] -pub fn get_optional_region_address(region: &Option<&Box>) -> u32 { - /// Returns the address of the Region as an offset in linear memory - fn get_region_address(region: &Box) -> u32 { - region.as_ref() as *const Region as u32 - } - - region.map(get_region_address).unwrap_or(0) -} diff --git a/packages/std/src/metadata.rs b/packages/std/src/metadata.rs new file mode 100644 index 0000000000..3ee1f48004 --- /dev/null +++ b/packages/std/src/metadata.rs @@ -0,0 +1,314 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Deserializer, Serialize}; + +use crate::prelude::*; + +/// Replicates the cosmos-sdk bank module Metadata type +#[derive( + Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[schemaifier(mute_warnings)] // missing support for `deserialize_with` +pub struct DenomMetadata { + pub description: String, + #[serde(deserialize_with = "deserialize_null_default")] + pub denom_units: Vec, + pub base: String, + pub display: String, + pub name: String, + pub symbol: String, + pub uri: String, + pub uri_hash: String, +} + +/// Replicates the cosmos-sdk bank module DenomUnit type +#[derive( + Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[schemaifier(mute_warnings)] // missing support for `deserialize_with` +pub struct DenomUnit { + pub denom: String, + pub exponent: u32, + #[serde(deserialize_with = "deserialize_null_default")] + pub aliases: Vec, +} + +// Deserialize a field that is null, defaulting to the type's default value. +// Panic if the field is missing. +fn deserialize_null_default<'de, D, T>(deserializer: D) -> Result +where + T: Default + Deserialize<'de>, + D: Deserializer<'de>, +{ + let opt = Option::deserialize(deserializer)?; + Ok(opt.unwrap_or_default()) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{DenomMetadata, DenomUnit}; + use serde_json::{json, Error}; + + #[test] + fn deserialize_denom_metadata_with_null_fields_works() { + // Test case with null denom_units - should deserialize as empty vec + let json_with_null_denom_units = json!({ + "description": "Test Token", + "denom_units": null, + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let metadata_null_denom_units: DenomMetadata = + serde_json::from_value(json_with_null_denom_units).unwrap(); + assert_eq!( + metadata_null_denom_units.denom_units, + Vec::::new() + ); + + // Test normal case with provided denom_units + let json_with_units = json!({ + "description": "Test Token", + "denom_units": [ + { + "denom": "utest", + "exponent": 6, + "aliases": ["microtest"] + } + ], + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let metadata_with_units: DenomMetadata = serde_json::from_value(json_with_units).unwrap(); + assert_eq!(metadata_with_units.denom_units.len(), 1); + assert_eq!(metadata_with_units.denom_units[0].denom, "utest"); + + // Test with null aliases inside denom_units - should deserialize as empty vec + let json_with_null_aliases = json!({ + "description": "Test Token", + "denom_units": [ + { + "denom": "utest", + "exponent": 6, + "aliases": null + } + ], + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let metadata_with_null_aliases: DenomMetadata = + serde_json::from_value(json_with_null_aliases).unwrap(); + assert_eq!(metadata_with_null_aliases.denom_units.len(), 1); + assert_eq!( + metadata_with_null_aliases.denom_units[0].aliases, + Vec::::new() + ); + } + + #[test] + fn deserialize_denom_metadata_with_missing_fields_fails() { + // Missing denom_units should be treated like null + let json_missing_denom_units = json!({ + "description": "Test Token", + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let metadata: Result = + serde_json::from_value(json_missing_denom_units); + assert!(metadata.is_err()); + + let json_missing_alias = json!({ + "description": "Test Token", + "base": "utest", + "denom_units": [ + { + "denom": "utest", + "exponent": 6, + } + ], + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let metadata_missing_alias: Result = + serde_json::from_value(json_missing_alias); + assert!(metadata_missing_alias.is_err()); + } + + #[test] + fn query_denom_metadata_with_null_denom_units_works() { + // Test case with null denom_units - should deserialize as empty vec + let json_with_null_denom_units = json!({ + "description": "Test Token", + "denom_units": null, + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let metadata_with_null_denom_units: DenomMetadata = + serde_json::from_value(json_with_null_denom_units).unwrap(); + assert_eq!( + metadata_with_null_denom_units.denom_units, + Vec::::new() + ); + + // Test normal case with provided denom_units + let json_with_units = json!({ + "description": "Test Token", + "denom_units": [ + { + "denom": "utest", + "exponent": 6, + "aliases": ["microtest"] + } + ], + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let metadata_with_units: DenomMetadata = serde_json::from_value(json_with_units).unwrap(); + assert_eq!(metadata_with_units.denom_units.len(), 1); + assert_eq!(metadata_with_units.denom_units[0].denom, "utest"); + assert_eq!(metadata_with_units.denom_units[0].aliases.len(), 1); + assert_eq!(metadata_with_units.denom_units[0].aliases[0], "microtest"); + + // Test with null aliases inside denom_units - should deserialize as empty vec + let json_with_null_aliases = json!({ + "description": "Test Token", + "denom_units": [ + { + "denom": "utest", + "exponent": 6, + "aliases": null + } + ], + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let metadata_with_null_aliases: DenomMetadata = + serde_json::from_value(json_with_null_aliases).unwrap(); + assert_eq!(metadata_with_null_aliases.denom_units.len(), 1); + assert_eq!( + metadata_with_null_aliases.denom_units[0].aliases, + Vec::::new() + ); + } + + #[test] + fn query_denom_metadata_with_missing_fields_fails() { + // Missing denom_units should throw an error + let json_missing_denom_units = json!({ + "description": "Test Token", + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let json_missing_denom_units_metadata: Result = + serde_json::from_value(json_missing_denom_units); + assert!(json_missing_denom_units_metadata.is_err()); + + // Missing aliases field should throw an error + let json_missing_aliases = json!({ + "description": "Test Token", + "denom_units": [ + { + "denom": "utest", + "exponent": 6 + } + ], + "base": "utest", + "display": "TEST", + "name": "Test Token", + "symbol": "TEST", + "uri": "https://test.com", + "uri_hash": "hash" + }); + + let missing_aliases_metadata: Result = + serde_json::from_value(json_missing_aliases); + assert!(missing_aliases_metadata.is_err()); + } + + #[test] + fn query_denom_metadata_with_mixed_null_and_value_works() { + // Test with multiple denom units, some with null aliases and some with values + let mixed_json = json!({ + "description": "Mixed Token", + "denom_units": [ + { + "denom": "unit1", + "exponent": 0, + "aliases": null + }, + { + "denom": "unit2", + "exponent": 6, + "aliases": ["microunit", "u"] + }, + { + "denom": "unit3", + "exponent": 9, + "aliases": [] + } + ], + "base": "unit1", + "display": "MIXED", + "name": "Mixed Token", + "symbol": "MIX", + "uri": "https://mixed.token", + "uri_hash": "hash123" + }); + + let metadata: DenomMetadata = serde_json::from_value(mixed_json).unwrap(); + + // First denom unit has null aliases, should be empty vec + assert!(metadata.denom_units[0].aliases.is_empty()); + + // Second has two aliases + assert_eq!(metadata.denom_units[1].aliases.len(), 2); + assert_eq!(metadata.denom_units[1].aliases[0], "microunit"); + assert_eq!(metadata.denom_units[1].aliases[1], "u"); + + // Third has explicitly empty aliases + assert!(metadata.denom_units[2].aliases.is_empty()); + } +} diff --git a/packages/std/src/msgpack.rs b/packages/std/src/msgpack.rs new file mode 100644 index 0000000000..e14513ada5 --- /dev/null +++ b/packages/std/src/msgpack.rs @@ -0,0 +1,519 @@ +// This file mostly re-exports some methods from rmp-serde +// The reason is two fold: +// 1. To easily ensure that all calling libraries use the same version (minimize code size) +// 2. To allow us to switch out to another MessagePack library if needed + +use serde::{de::DeserializeOwned, Serialize}; + +use crate::{Binary, StdResult}; + +/// Deserializes the given MessagePack bytes to a data structure. +/// +/// Errors if the input is not valid MessagePack or cannot be deserialized to the given type. +/// +/// ## Examples +/// +/// Encoding and decoding an enum using MessagePack. +/// +/// ``` +/// use cosmwasm_schema::cw_serde; +/// use cosmwasm_std::{to_msgpack_binary, from_msgpack}; +/// +/// #[cw_serde] +/// enum MyPacket { +/// Cowsay { +/// text: String, +/// }, +/// } +/// +/// let packet = MyPacket::Cowsay { text: "hi".to_string() }; +/// let encoded = to_msgpack_binary(&packet).unwrap(); +/// let decoded: MyPacket = from_msgpack(&encoded).unwrap(); +/// assert_eq!(decoded, packet); +pub fn from_msgpack(value: impl AsRef<[u8]>) -> StdResult { + Ok(rmp_serde::from_read(value.as_ref())?) +} + +/// Serializes the given data structure as a MessagePack byte vector. +/// +/// ## Examples +/// +/// Encoding and decoding an enum using MessagePack. +/// +/// ``` +/// use cosmwasm_schema::cw_serde; +/// use cosmwasm_std::{to_msgpack_vec, from_msgpack}; +/// +/// #[cw_serde] +/// enum MyPacket { +/// Cowsay { +/// text: String, +/// }, +/// } +/// +/// let packet = MyPacket::Cowsay { text: "hi".to_string() }; +/// let encoded = to_msgpack_vec(&packet).unwrap(); +/// let decoded: MyPacket = from_msgpack(&encoded).unwrap(); +/// assert_eq!(decoded, packet); +pub fn to_msgpack_vec(data: &T) -> StdResult> +where + T: Serialize + ?Sized, +{ + Ok(rmp_serde::to_vec_named(data)?) +} + +/// Serializes the given data structure as MessagePack bytes. +/// +/// ## Examples +/// +/// Encoding and decoding an enum using MessagePack. +/// +/// ``` +/// use cosmwasm_schema::cw_serde; +/// use cosmwasm_std::{to_msgpack_binary, from_msgpack}; +/// +/// #[cw_serde] +/// enum MyPacket { +/// Cowsay { +/// text: String, +/// }, +/// } +/// +/// let packet = MyPacket::Cowsay { text: "hi".to_string() }; +/// let encoded = to_msgpack_binary(&packet).unwrap(); +/// let decoded: MyPacket = from_msgpack(&encoded).unwrap(); +/// assert_eq!(decoded, packet); +/// ``` +pub fn to_msgpack_binary(data: &T) -> StdResult +where + T: Serialize + ?Sized, +{ + to_msgpack_vec(data).map(Binary::new) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::{Int128, Int256, Int512, Int64, Uint128, Uint256, Uint512, Uint64}; + use serde::Deserialize; + + #[derive(Serialize, Deserialize, Debug, PartialEq)] + #[serde(rename_all = "snake_case")] + enum SomeMsg { + Refund {}, + ReleaseAll { + image: String, + amount: u32, + time: u64, + karma: i32, + }, + Cowsay { + text: String, + }, + } + + fn refund_test_vector() -> (SomeMsg, &'static [u8]) { + let msg = SomeMsg::Refund {}; + let serialized = &[129, 166, 114, 101, 102, 117, 110, 100, 128]; + (msg, serialized) + } + + fn release_all_test_vector() -> (SomeMsg, &'static [u8]) { + let msg = SomeMsg::ReleaseAll { + image: "foo".to_string(), + amount: 42, + time: 18446744073709551615, + karma: -17, + }; + let serialized = &[ + 129, 171, 114, 101, 108, 101, 97, 115, 101, 95, 97, 108, 108, 132, 165, 105, 109, 97, + 103, 101, 163, 102, 111, 111, 166, 97, 109, 111, 117, 110, 116, 42, 164, 116, 105, 109, + 101, 207, 255, 255, 255, 255, 255, 255, 255, 255, 165, 107, 97, 114, 109, 97, 239, + ]; + (msg, serialized) + } + + fn special_chars_test_vector() -> (SomeMsg, &'static [u8]) { + let msg = SomeMsg::Cowsay { + text: "foo\"bar\\\"bla🦴👁🦶🏻".to_string(), + }; + let serialized = &[ + 129, 166, 99, 111, 119, 115, 97, 121, 129, 164, 116, 101, 120, 116, 188, 102, 111, 111, + 34, 98, 97, 114, 92, 34, 98, 108, 97, 240, 159, 166, 180, 240, 159, 145, 129, 240, 159, + 166, 182, 240, 159, 143, 187, + ]; + + (msg, serialized) + } + + #[test] + fn to_msgpack_vec_works() { + let (msg, expected) = refund_test_vector(); + let serialized = to_msgpack_vec(&msg).unwrap(); + assert_eq!(serialized, expected); + + let (msg, expected) = release_all_test_vector(); + let serialized = to_msgpack_vec(&msg).unwrap(); + assert_eq!(serialized, expected); + } + + #[test] + fn from_msgpack_works() { + let (msg, serialized) = refund_test_vector(); + let deserialized: SomeMsg = from_msgpack(serialized).unwrap(); + assert_eq!(deserialized, msg); + + let (msg, serialized) = release_all_test_vector(); + let deserialized: SomeMsg = from_msgpack(serialized).unwrap(); + assert_eq!(deserialized, msg); + } + + #[test] + fn from_msgpack_or_binary() { + let msg = SomeMsg::Refund {}; + let serialized: Binary = to_msgpack_binary(&msg).unwrap(); + + let parse_binary: SomeMsg = from_msgpack(&serialized).unwrap(); + assert_eq!(parse_binary, msg); + + let parse_slice: SomeMsg = from_msgpack(serialized.as_slice()).unwrap(); + assert_eq!(parse_slice, msg); + } + + #[test] + fn from_msgpack_works_for_special_chars() { + let (msg, serialized) = special_chars_test_vector(); + let deserialized: SomeMsg = from_msgpack(serialized).unwrap(); + assert_eq!(deserialized, msg); + } + + #[test] + fn deserialize_modified_field_order() { + // field order doesn't matter since we encode field names + + #[derive(Serialize, Deserialize, Debug, PartialEq)] + struct TestV1 { + a: String, + b: u32, + c: u64, + } + + #[derive(Serialize, Deserialize, Debug, PartialEq)] + struct TestV2 { + b: u32, + c: u64, + a: String, + } + + let v1 = TestV1 { + a: "foo".to_string(), + b: 42, + c: 18446744073709551615, + }; + + let v2: TestV2 = from_msgpack(to_msgpack_vec(&v1).unwrap()).unwrap(); + assert_eq!( + v2, + TestV2 { + b: 42, + c: 18446744073709551615, + a: "foo".to_string() + } + ); + } + + #[test] + fn deserialize_new_fields() { + // new fields can be added at the end + + #[derive(Serialize, Deserialize, Debug, PartialEq)] + struct TestV1 { + a: String, + } + + #[derive(Serialize, Deserialize, Debug, PartialEq)] + struct TestV2 { + a: String, + #[serde(default)] + b: u32, + } + + let v1 = TestV1 { + a: "foo".to_string(), + }; + let v2: TestV2 = from_msgpack(to_msgpack_vec(&v1).unwrap()).unwrap(); + + assert_eq!( + v2, + TestV2 { + a: "foo".to_string(), + b: 0 + } + ); + } + + #[test] + fn deserialize_new_fields_in_the_middle() { + // fields can be added even in the middle + #[derive(Serialize, Deserialize, Debug, PartialEq)] + struct TestV1 { + a: String, + b: u32, + } + + #[derive(Serialize, Deserialize, Debug, PartialEq)] + struct TestV2 { + a: String, + #[serde(default)] + c: u8, + b: u32, + } + + let v1 = TestV1 { + a: "foo".to_string(), + b: 999999, + }; + let v2: TestV2 = from_msgpack(to_msgpack_vec(&v1).unwrap()).unwrap(); + + assert_eq!( + v2, + TestV2 { + a: "foo".to_string(), + c: 0, + b: 999999, + } + ); + } + + #[test] + fn msgpack_serialization_for_boolean_types() { + // "Bool format family stores false or true in 1 byte." + let serialized = to_msgpack_vec(&false).unwrap(); + assert_eq!(serialized, [0xc2]); + let serialized = to_msgpack_vec(&true).unwrap(); + assert_eq!(serialized, [0xc3]); + } + + #[test] + fn msgpack_serialization_for_integer_types() { + // primitive integers up to 64bit + // similar to VARINT in protobuf or number in JSON, the encoding does not contain integer size + { + // "positive fixint stores 7-bit positive integer" + let serialized = to_msgpack_vec(&0u8).unwrap(); + assert_eq!(serialized, [0]); + let serialized = to_msgpack_vec(&0u16).unwrap(); + assert_eq!(serialized, [0]); + let serialized = to_msgpack_vec(&0u32).unwrap(); + assert_eq!(serialized, [0]); + let serialized = to_msgpack_vec(&0u64).unwrap(); + assert_eq!(serialized, [0]); + let serialized = to_msgpack_vec(&0i64).unwrap(); + assert_eq!(serialized, [0]); + let serialized = to_msgpack_vec(&7u8).unwrap(); + assert_eq!(serialized, [7]); + let serialized = to_msgpack_vec(&7u16).unwrap(); + assert_eq!(serialized, [7]); + let serialized = to_msgpack_vec(&7u32).unwrap(); + assert_eq!(serialized, [7]); + let serialized = to_msgpack_vec(&7u64).unwrap(); + assert_eq!(serialized, [7]); + let serialized = to_msgpack_vec(&127u32).unwrap(); + assert_eq!(serialized, [127]); + + // "negative fixint stores 5-bit negative integer" + let serialized = to_msgpack_vec(&-1i32).unwrap(); + assert_eq!(serialized, [255]); + let serialized = to_msgpack_vec(&-1i64).unwrap(); + assert_eq!(serialized, [255]); + let serialized = to_msgpack_vec(&-10i64).unwrap(); + assert_eq!(serialized, [246]); + let serialized = to_msgpack_vec(&-24i64).unwrap(); + assert_eq!(serialized, [232]); + + // "uint 8 stores an 8-bit unsigned integer" + let serialized = to_msgpack_vec(&128u32).unwrap(); + assert_eq!(serialized, [0xcc, 128]); + let serialized = to_msgpack_vec(&237u32).unwrap(); + assert_eq!(serialized, [0xcc, 237]); + + // "uint 16 stores a 16-bit big-endian unsigned integer" + let serialized = to_msgpack_vec(&1000u32).unwrap(); + assert_eq!(serialized, [0xcd, 3, 232]); + + // "uint 32 stores a 32-bit big-endian unsigned integer" + let serialized = to_msgpack_vec(&u32::MAX).unwrap(); + assert_eq!(serialized, [0xce, 255, 255, 255, 255]); + + // "uint 64 stores a 64-bit big-endian unsigned integer" + let serialized = to_msgpack_vec(&575747839886u64).unwrap(); + assert_eq!(serialized, [0xcf, 0, 0, 0, 134, 13, 62, 215, 142]); + let serialized = to_msgpack_vec(&u64::MAX).unwrap(); + assert_eq!(serialized, [0xcf, 255, 255, 255, 255, 255, 255, 255, 255]); + + // "int 8 stores an 8-bit signed integer" + let serialized = to_msgpack_vec(&i8::MIN).unwrap(); + assert_eq!(serialized, [0xd0, 128]); + let serialized = to_msgpack_vec(&-111i8).unwrap(); + assert_eq!(serialized, [0xd0, 145]); + + // "int 16 stores a 16-bit big-endian signed integer" + let serialized = to_msgpack_vec(&i16::MIN).unwrap(); + assert_eq!(serialized, [0xd1, 128, 0]); + + // "int 32 stores a 32-bit big-endian signed integer" + let serialized = to_msgpack_vec(&i32::MIN).unwrap(); + assert_eq!(serialized, [0xd2, 128, 0, 0, 0]); + + // "int 64 stores a 64-bit big-endian signed integer" + let serialized = to_msgpack_vec(&i64::MIN).unwrap(); + assert_eq!(serialized, [0xd3, 128, 0, 0, 0, 0, 0, 0, 0]); + } + + // u128/i128 + // cannot be serialized as integers in messagepack due to the limitation + // "a value of an Integer object is limited from -(2^63) upto (2^64)-1" + { + // encoded as 16 bytes big endian + // i.e. takes 18 bytes of storage + assert_eq!( + to_msgpack_vec(&0u128).unwrap(), + [0xc4, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ); + assert_eq!( + to_msgpack_vec(&1u128).unwrap(), + [0xc4, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] + ); + assert_eq!( + to_msgpack_vec(&17u128).unwrap(), + [0xc4, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17] + ); + assert_eq!( + to_msgpack_vec(&u128::MAX).unwrap(), + [ + 0xc4, 16, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255 + ] + ); + + assert_eq!( + to_msgpack_vec(&0i128).unwrap(), + [0xc4, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ); + assert_eq!( + to_msgpack_vec(&1i128).unwrap(), + [0xc4, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] + ); + assert_eq!( + to_msgpack_vec(&17i128).unwrap(), + [0xc4, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17] + ); + assert_eq!( + to_msgpack_vec(&-1i128).unwrap(), + [ + 0xc4, 16, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255 + ] + ); + assert_eq!( + to_msgpack_vec(&i128::MIN).unwrap(), + [0xc4, 16, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ); + assert_eq!( + to_msgpack_vec(&i128::MAX).unwrap(), + [ + 0xc4, 16, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255 + ] + ); + } + + // Uint64/Uint128/Uint256/Uint512 + { + let s = to_msgpack_vec(&Uint64::zero()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'0']); // string of lengths 1 with value "0" + let s = to_msgpack_vec(&Uint128::zero()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'0']); // string of lengths 1 with value "0" + let s = to_msgpack_vec(&Uint256::zero()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'0']); // string of lengths 1 with value "0" + let s = to_msgpack_vec(&Uint512::zero()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'0']); // string of lengths 1 with value "0" + + let s = to_msgpack_vec(&Uint64::one()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'1']); // string of lengths 1 with value "1" + let s = to_msgpack_vec(&Uint128::one()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'1']); // string of lengths 1 with value "1" + let s = to_msgpack_vec(&Uint256::one()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'1']); // string of lengths 1 with value "1" + let s = to_msgpack_vec(&Uint512::one()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'1']); // string of lengths 1 with value "1" + + let s = to_msgpack_vec(&Uint64::MAX).unwrap(); + assert_eq!( + s, + [ + 0b10100000 ^ 20, + b'1', + b'8', + b'4', + b'4', + b'6', + b'7', + b'4', + b'4', + b'0', + b'7', + b'3', + b'7', + b'0', + b'9', + b'5', + b'5', + b'1', + b'6', + b'1', + b'5' + ] + ); // string of lengths 1 with value "1" + } + + // Int64/Int128/Int256/Int512 + { + let s = to_msgpack_vec(&Int64::zero()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'0']); // string of lengths 1 with value "0" + let s = to_msgpack_vec(&Int128::zero()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'0']); // string of lengths 1 with value "0" + let s = to_msgpack_vec(&Int256::zero()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'0']); // string of lengths 1 with value "0" + let s = to_msgpack_vec(&Int512::zero()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'0']); // string of lengths 1 with value "0" + + let s = to_msgpack_vec(&Int64::one()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'1']); // string of lengths 1 with value "1" + let s = to_msgpack_vec(&Int128::one()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'1']); // string of lengths 1 with value "1" + let s = to_msgpack_vec(&Int256::one()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'1']); // string of lengths 1 with value "1" + let s = to_msgpack_vec(&Int512::one()).unwrap(); + assert_eq!(s, [0b10100000 ^ 1, b'1']); // string of lengths 1 with value "1" + + let s = to_msgpack_vec(&Int64::from(15i32)).unwrap(); + assert_eq!(s, [0b10100000 ^ 2, b'1', b'5']); // string of lengths 2 with value "15" + let s = to_msgpack_vec(&Int128::from(15i32)).unwrap(); + assert_eq!(s, [0b10100000 ^ 2, b'1', b'5']); // string of lengths 2 with value "15" + let s = to_msgpack_vec(&Int256::from(15i32)).unwrap(); + assert_eq!(s, [0b10100000 ^ 2, b'1', b'5']); // string of lengths 2 with value "15" + let s = to_msgpack_vec(&Int512::from(15i32)).unwrap(); + assert_eq!(s, [0b10100000 ^ 2, b'1', b'5']); // string of lengths 2 with value "15" + + let s = to_msgpack_vec(&Int64::from(-1i64)).unwrap(); + assert_eq!(s, [0b10100000 ^ 2, b'-', b'1']); // string of lengths 2 with value "-1" + let s = to_msgpack_vec(&Int128::from(-1i64)).unwrap(); + assert_eq!(s, [0b10100000 ^ 2, b'-', b'1']); // string of lengths 2 with value "-1" + let s = to_msgpack_vec(&Int256::from(-1i64)).unwrap(); + assert_eq!(s, [0b10100000 ^ 2, b'-', b'1']); // string of lengths 2 with value "-1" + let s = to_msgpack_vec(&Int512::from(-1i64)).unwrap(); + assert_eq!(s, [0b10100000 ^ 2, b'-', b'1']); // string of lengths 2 with value "-1" + } + } +} diff --git a/packages/std/src/never.rs b/packages/std/src/never.rs new file mode 100644 index 0000000000..f63eadac01 --- /dev/null +++ b/packages/std/src/never.rs @@ -0,0 +1,46 @@ +/// Never can never be instantiated. This can be used in places +/// where we want to ensure that no error is returned, such as +/// the `ibc_packet_receive` entry point. +/// +/// In contrast to `Empty`, this does not have a JSON schema +/// and cannot be used for message and query types. +/// +/// Once the ! type is stable, this is not needed anymore. +/// See . +/// +/// ## Examples +/// +/// When using `Never` in a `Result`, we can unwrap in a type-safe way: +/// +/// ``` +/// use cosmwasm_std::Never; +/// +/// pub fn safe_unwrap(res: Result) -> T { +/// match res { +/// Ok(value) => value, +/// Err(err) => match err {}, +/// } +/// } +/// +/// let res: Result = Ok(5); +/// assert_eq!(safe_unwrap(res), 5); +/// ``` +#[derive(cw_schema::Schemaifier)] +pub enum Never {} + +// The Debug implementation is needed to allow the use of `Result::unwrap`. +impl core::fmt::Debug for Never { + fn fmt(&self, _f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + // Unreachable because no instance of Never can exist + match *self {} + } +} + +// The Display implementation is needed to fulfill the ToString requirement of +// entry point errors: `Result, E>` with `E: ToString`. +impl core::fmt::Display for Never { + fn fmt(&self, _f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + // Unreachable because no instance of Never can exist + match *self {} + } +} diff --git a/packages/std/src/pagination.rs b/packages/std/src/pagination.rs new file mode 100644 index 0000000000..1b402d6169 --- /dev/null +++ b/packages/std/src/pagination.rs @@ -0,0 +1,14 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +use crate::Binary; + +/// Simplified version of the PageRequest type for pagination from the cosmos-sdk +#[derive( + Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct PageRequest { + pub key: Option, + pub limit: u32, + pub reverse: bool, +} diff --git a/packages/std/src/prelude.rs b/packages/std/src/prelude.rs new file mode 100644 index 0000000000..7a3311ad1a --- /dev/null +++ b/packages/std/src/prelude.rs @@ -0,0 +1,3 @@ +pub use alloc::boxed::Box; +pub use alloc::string::{String, ToString}; +pub use alloc::vec::Vec; diff --git a/packages/std/src/query/bank.rs b/packages/std/src/query/bank.rs index 9656ea6138..b40ab2d85c 100644 --- a/packages/std/src/query/bank.rs +++ b/packages/std/src/query/bank.rs @@ -3,8 +3,18 @@ use serde::{Deserialize, Serialize}; use crate::Coin; +use crate::prelude::*; +#[cfg(feature = "cosmwasm_1_3")] +use crate::PageRequest; +use crate::{Binary, DenomMetadata}; + +use super::query_response::QueryResponseType; +use crate::utils::impl_hidden_constructor; + #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum BankQuery { /// This calls into the native bank module for querying the total supply of one denomination. @@ -15,14 +25,19 @@ pub enum BankQuery { /// This calls into the native bank module for one denomination /// Return value is BalanceResponse Balance { address: String, denom: String }, - /// This calls into the native bank module for all denominations. - /// Note that this may be much more expensive than Balance and should be avoided if possible. - /// Return value is AllBalanceResponse. - AllBalances { address: String }, + /// This calls into the native bank module for querying metadata for a specific bank token. + /// Return value is DenomMetadataResponse + #[cfg(feature = "cosmwasm_1_3")] + DenomMetadata { denom: String }, + /// This calls into the native bank module for querying metadata for all bank tokens that have a metadata entry. + /// Return value is AllDenomMetadataResponse + #[cfg(feature = "cosmwasm_1_3")] + AllDenomMetadata { pagination: Option }, } -#[cfg(feature = "cosmwasm_1_1")] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] #[non_exhaustive] pub struct SupplyResponse { @@ -31,17 +46,70 @@ pub struct SupplyResponse { pub amount: Coin, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +impl_hidden_constructor!(SupplyResponse, amount: Coin); + +impl QueryResponseType for SupplyResponse {} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] +#[non_exhaustive] pub struct BalanceResponse { /// Always returns a Coin with the requested denom. /// This may be of 0 amount if no such funds. pub amount: Coin, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +impl_hidden_constructor!(BalanceResponse, amount: Coin); + +impl QueryResponseType for BalanceResponse {} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] -pub struct AllBalanceResponse { - /// Returns all non-zero coins held by this account. - pub amount: Vec, +#[non_exhaustive] +pub struct DenomMetadataResponse { + /// The metadata for the queried denom. + pub metadata: DenomMetadata, +} + +impl_hidden_constructor!(DenomMetadataResponse, metadata: DenomMetadata); + +impl QueryResponseType for DenomMetadataResponse {} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[serde(rename_all = "snake_case")] +#[non_exhaustive] +pub struct AllDenomMetadataResponse { + /// Always returns metadata for all token denoms on the base chain. + pub metadata: Vec, + pub next_key: Option, +} + +impl_hidden_constructor!( + AllDenomMetadataResponse, + metadata: Vec, + next_key: Option +); + +impl QueryResponseType for AllDenomMetadataResponse {} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn private_constructor_works() { + let response = BalanceResponse::new(Coin::new(1234u128, "uatom")); + assert_eq!( + response, + BalanceResponse { + amount: Coin::new(1234u128, "uatom") + } + ); + } } diff --git a/packages/std/src/query/distribution.rs b/packages/std/src/query/distribution.rs new file mode 100644 index 0000000000..68433eff9d --- /dev/null +++ b/packages/std/src/query/distribution.rs @@ -0,0 +1,130 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +use crate::prelude::*; +use crate::{Addr, Decimal256}; + +use super::query_response::QueryResponseType; +use crate::utils::impl_hidden_constructor; + +#[non_exhaustive] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[serde(rename_all = "snake_case")] +pub enum DistributionQuery { + /// See + DelegatorWithdrawAddress { delegator_address: String }, + /// See + #[cfg(feature = "cosmwasm_1_4")] + DelegationRewards { + delegator_address: String, + validator_address: String, + }, + /// See + #[cfg(feature = "cosmwasm_1_4")] + DelegationTotalRewards { delegator_address: String }, + /// See + #[cfg(feature = "cosmwasm_1_4")] + DelegatorValidators { delegator_address: String }, +} + +/// See +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[serde(rename_all = "snake_case")] +#[non_exhaustive] +pub struct DelegatorWithdrawAddressResponse { + pub withdraw_address: Addr, +} + +impl_hidden_constructor!(DelegatorWithdrawAddressResponse, withdraw_address: Addr); +impl QueryResponseType for DelegatorWithdrawAddressResponse {} + +/// See +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[serde(rename_all = "snake_case")] +#[non_exhaustive] +pub struct DelegationRewardsResponse { + pub rewards: Vec, +} + +impl_hidden_constructor!(DelegationRewardsResponse, rewards: Vec); +impl QueryResponseType for DelegationRewardsResponse {} + +/// A coin type with decimal amount. +/// Modeled after the Cosmos SDK's [DecCoin] type. +/// However, in contrast to the Cosmos SDK the `amount` string MUST always have a dot at JSON level, +/// see . +/// Also if Cosmos SDK chooses to migrate away from fixed point decimals +/// (as shown [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/x/group/internal/math/dec.go#L13-L21 and discussed [here](https://github.com/cosmos/cosmos-sdk/issues/11783)), +/// wasmd needs to truncate the decimal places to 18. +/// +/// [DecCoin]: (https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/proto/cosmos/base/v1beta1/coin.proto#L28-L38) +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[serde(rename_all = "snake_case")] +pub struct DecCoin { + pub denom: String, + /// An amount in the base denom of the distributed token. + /// + /// Some chains have chosen atto (10^-18) for their token's base denomination. If we used `Decimal` here, we could only store + /// 340282366920938463463.374607431768211455atoken which is 340.28 TOKEN. + pub amount: Decimal256, +} + +impl DecCoin { + pub fn new(amount: impl Into, denom: impl Into) -> Self { + Self { + denom: denom.into(), + amount: amount.into(), + } + } +} + +/// See +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] +pub struct DelegationTotalRewardsResponse { + pub rewards: Vec, + pub total: Vec, +} + +impl_hidden_constructor!( + DelegationTotalRewardsResponse, + rewards: Vec, + total: Vec +); +impl QueryResponseType for DelegationTotalRewardsResponse {} + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] +pub struct DelegatorReward { + pub validator_address: String, + pub reward: Vec, +} +impl_hidden_constructor!( + DelegatorReward, + validator_address: String, + reward: Vec +); + +/// See +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] +pub struct DelegatorValidatorsResponse { + pub validators: Vec, +} + +impl_hidden_constructor!(DelegatorValidatorsResponse, validators: Vec); +impl QueryResponseType for DelegatorValidatorsResponse {} diff --git a/packages/std/src/query/ibc.rs b/packages/std/src/query/ibc.rs index 0164de3301..424c0b17b4 100644 --- a/packages/std/src/query/ibc.rs +++ b/packages/std/src/query/ibc.rs @@ -1,25 +1,28 @@ -#![cfg(feature = "stargate")] - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::ibc::IbcChannel; +use crate::prelude::*; + +use crate::utils::impl_hidden_constructor; /// These are queries to the various IBC modules to see the state of the contract's -/// IBC connection. These will return errors if the contract is not "ibc enabled" +/// IBC connection. +/// Most of these will return errors if the contract is not "ibc enabled". #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum IbcQuery { /// Gets the Port ID the current contract is bound to. /// /// Returns a `PortIdResponse`. PortId {}, - /// Lists all channels that are bound to a given port. - /// If `port_id` is omitted, this list all channels bound to the contract's port. - /// - /// Returns a `ListChannelsResponse`. - ListChannels { port_id: Option }, + // + // ListChannels was removed in CosmWasm 3 due to potentially unbound number of results. + // See https://github.com/CosmWasm/cosmwasm/issues/2223 + // /// Lists all information for a (portID, channelID) pair. /// If port_id is omitted, it will default to the contract's own channel. /// (To save a PortId{} call) @@ -29,20 +32,22 @@ pub enum IbcQuery { channel_id: String, port_id: Option, }, - // TODO: Add more } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] pub struct PortIdResponse { pub port_id: String, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -pub struct ListChannelsResponse { - pub channels: Vec, -} +impl_hidden_constructor!(PortIdResponse, port_id: String); #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[non_exhaustive] pub struct ChannelResponse { pub channel: Option, } + +impl_hidden_constructor!(ChannelResponse, channel: Option); diff --git a/packages/std/src/query/mod.rs b/packages/std/src/query/mod.rs index 67a2fcdb0d..0acc4f8dcc 100644 --- a/packages/std/src/query/mod.rs +++ b/packages/std/src/query/mod.rs @@ -1,43 +1,47 @@ +// needed because the derive macros on QueryRequest use the deprecated `Stargate` variant +#![allow(deprecated)] + use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -#[cfg(feature = "stargate")] +use crate::prelude::*; use crate::Binary; use crate::Empty; mod bank; +mod distribution; mod ibc; +mod query_response; mod staking; mod wasm; -#[cfg(feature = "cosmwasm_1_1")] -pub use bank::SupplyResponse; -pub use bank::{AllBalanceResponse, BalanceResponse, BankQuery}; -#[cfg(feature = "stargate")] -pub use ibc::{ChannelResponse, IbcQuery, ListChannelsResponse, PortIdResponse}; -#[cfg(feature = "staking")] -pub use staking::{ - AllDelegationsResponse, AllValidatorsResponse, BondedDenomResponse, Delegation, - DelegationResponse, FullDelegation, StakingQuery, Validator, ValidatorResponse, -}; -pub use wasm::{ContractInfoResponse, WasmQuery}; +pub use bank::*; +pub use distribution::*; +pub use ibc::*; +pub use staking::*; +pub use wasm::*; #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] -pub enum QueryRequest { +pub enum QueryRequest { Bank(BankQuery), Custom(C), #[cfg(feature = "staking")] Staking(StakingQuery), + #[cfg(feature = "cosmwasm_1_3")] + Distribution(DistributionQuery), /// A Stargate query is encoded the same way as abci_query, with path and protobuf encoded request data. /// The format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md). /// The response is protobuf encoded data directly without a JSON response wrapper. /// The caller is responsible for compiling the proper protobuf definitions for both requests and responses. #[cfg(feature = "stargate")] + #[deprecated = "Please use the GrpcQuery instead"] Stargate { /// this is the fully qualified service path used for routing, - /// eg. custom/cosmos_sdk.x.bank.v1.Query/QueryBalance + /// eg. "/cosmos_sdk.x.bank.v1.Query/QueryBalance" path: String, /// this is the expected protobuf message type (not any), binary encoded data: Binary, @@ -45,6 +49,34 @@ pub enum QueryRequest { #[cfg(feature = "stargate")] Ibc(IbcQuery), Wasm(WasmQuery), + #[cfg(feature = "cosmwasm_2_0")] + Grpc(GrpcQuery), +} + +/// Queries the chain using a grpc query. +/// This allows to query information that is not exposed in our API. +/// The chain needs to allowlist the supported queries. +/// The drawback of this query is that you have to handle the protobuf encoding and decoding yourself. +/// +/// The returned data is protobuf encoded. The protobuf type depends on the query. +/// Because of this, using it with the [`query`](crate::QuerierWrapper::query) function will result +/// in a deserialization error. +/// Use [`raw_query`](crate::Querier::raw_query) or [`query_grpc`](crate::QuerierWrapper::query_grpc) +/// instead. +/// +/// To find the path, as well as the request and response types, +/// you can query the chain's gRPC endpoint using a tool like +/// [grpcurl](https://github.com/fullstorydev/grpcurl). +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct GrpcQuery { + /// The fully qualified endpoint path used for routing. + /// It follows the format `/service_path/method_name`, + /// eg. "/cosmos.authz.v1beta1.Query/Grants" + pub path: String, + /// The expected protobuf message type (not [Any](https://protobuf.dev/programming-guides/proto3/#any)), binary encoded + pub data: Binary, } /// A trait that is required to avoid conflicts with other query types like BankQuery and WasmQuery @@ -57,7 +89,7 @@ pub enum QueryRequest { /// # use cosmwasm_std::CustomQuery; /// # use schemars::JsonSchema; /// # use serde::{Deserialize, Serialize}; -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema, cw_schema::Schemaifier)] /// #[serde(rename_all = "snake_case")] /// pub enum MyCustomQuery { /// Ping {}, @@ -97,9 +129,23 @@ impl From for QueryRequest { } } +#[cfg(feature = "cosmwasm_2_0")] +impl From for QueryRequest { + fn from(msg: GrpcQuery) -> Self { + QueryRequest::Grpc(msg) + } +} + #[cfg(feature = "stargate")] impl From for QueryRequest { fn from(msg: IbcQuery) -> Self { QueryRequest::Ibc(msg) } } + +#[cfg(feature = "cosmwasm_1_3")] +impl From for QueryRequest { + fn from(msg: DistributionQuery) -> Self { + QueryRequest::Distribution(msg) + } +} diff --git a/packages/std/src/query/query_response.rs b/packages/std/src/query/query_response.rs new file mode 100644 index 0000000000..c8385f2fab --- /dev/null +++ b/packages/std/src/query/query_response.rs @@ -0,0 +1,19 @@ +use core::fmt::Debug; + +use serde::de::DeserializeOwned; + +/// A marker trait for query response types. +/// +/// Those types have in common that they should be `#[non_exhaustive]` in order +/// to allow adding fields in a backwards compatible way. In contracts they are +/// only constructed through deserialization. We want to make it hard for +/// contract developers to construct those types themselves as this is most likely +/// not what they should do. +/// +/// In hosts they are constructed as follows: +/// - wasmvm: Go types with the same JSON layout +/// - multi-test/cw-sdk: create a default instance and mutate the fields +/// +/// This trait is crate-internal and can change any time. +#[allow(dead_code)] // This is used to statically ensure all the types have a shared set of traits +pub(crate) trait QueryResponseType: DeserializeOwned + Debug + PartialEq + Clone {} diff --git a/packages/std/src/query/staking.rs b/packages/std/src/query/staking.rs index fa513ac52a..ecfb486562 100644 --- a/packages/std/src/query/staking.rs +++ b/packages/std/src/query/staking.rs @@ -1,12 +1,17 @@ -#![cfg(feature = "staking")] - use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +use crate::prelude::*; use crate::{Addr, Coin, Decimal}; +use super::query_response::QueryResponseType; + +use crate::utils::impl_hidden_constructor; + #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum StakingQuery { /// Returns the denomination that can be bonded (if there are multiple native tokens on the chain) @@ -28,29 +33,46 @@ pub enum StakingQuery { /// /// The query response type is `ValidatorResponse`. Validator { - /// The validator's address (e.g. (e.g. cosmosvaloper1...)) + /// The validator's address (e.g. cosmosvaloper1...) address: String, }, } /// BondedDenomResponse is data format returned from StakingRequest::BondedDenom query -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] +#[non_exhaustive] pub struct BondedDenomResponse { pub denom: String, } +impl QueryResponseType for BondedDenomResponse {} + +impl_hidden_constructor!(BondedDenomResponse, denom: String); + /// DelegationsResponse is data format returned from StakingRequest::AllDelegations query -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] +#[non_exhaustive] pub struct AllDelegationsResponse { pub delegations: Vec, } +impl QueryResponseType for AllDelegationsResponse {} + +impl_hidden_constructor!(AllDelegationsResponse, delegations: Vec); + /// Delegation is basic (cheap to query) data about a delegation. /// /// Instances are created in the querier. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] pub struct Delegation { pub delegator: Addr, /// A validator address (e.g. cosmosvaloper1...) @@ -59,6 +81,8 @@ pub struct Delegation { pub amount: Coin, } +impl_hidden_constructor!(Delegation, delegator: Addr, validator: String, amount: Coin); + impl From for Delegation { fn from(full: FullDelegation) -> Self { Delegation { @@ -70,17 +94,27 @@ impl From for Delegation { } /// DelegationResponse is data format returned from StakingRequest::Delegation query -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] +#[non_exhaustive] pub struct DelegationResponse { pub delegation: Option, } +impl QueryResponseType for DelegationResponse {} + +impl_hidden_constructor!(DelegationResponse, delegation: Option); + /// FullDelegation is all the info on the delegation, some (like accumulated_reward and can_redelegate) /// is expensive to query. /// /// Instances are created in the querier. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] pub struct FullDelegation { pub delegator: Addr, /// A validator address (e.g. cosmosvaloper1...) @@ -95,25 +129,146 @@ pub struct FullDelegation { pub accumulated_rewards: Vec, } +impl_hidden_constructor!( + FullDelegation, + delegator: Addr, + validator: String, + amount: Coin, + can_redelegate: Coin, + accumulated_rewards: Vec +); + +impl FullDelegation { + /// Creates a new delegation. + /// + /// If fields get added to the [`FullDelegation`] struct in the future, this constructor will + /// provide default values for them, but these default values may not be sensible. + pub fn create( + delegator: Addr, + validator: String, + amount: Coin, + can_redelegate: Coin, + accumulated_rewards: Vec, + ) -> Self { + Self { + delegator, + validator, + amount, + can_redelegate, + accumulated_rewards, + } + } +} + /// The data format returned from StakingRequest::AllValidators query -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] pub struct AllValidatorsResponse { - pub validators: Vec, + pub validators: Vec, } +impl QueryResponseType for AllValidatorsResponse {} + +impl_hidden_constructor!(AllValidatorsResponse, validators: Vec); + /// The data format returned from StakingRequest::Validator query -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] pub struct ValidatorResponse { pub validator: Option, } +impl QueryResponseType for ValidatorResponse {} + +impl_hidden_constructor!(ValidatorResponse, validator: Option); + /// Instances are created in the querier. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] +pub struct ValidatorMetadata { + /// The operator address of the validator (e.g. cosmosvaloper1...). + /// See https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/proto/cosmos/staking/v1beta1/staking.proto#L95-L96 + /// for more information. + /// + /// This uses `String` instead of `Addr` since the bech32 address prefix is different from + /// the ones that regular user accounts use. + pub address: String, + pub commission: Decimal, + pub max_commission: Decimal, + /// The maximum daily increase of the commission + pub max_change_rate: Decimal, +} + +impl_hidden_constructor!( + ValidatorMetadata, + address: String, + commission: Decimal, + max_commission: Decimal, + max_change_rate: Decimal +); + +/// Instances are created in the querier. +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] pub struct Validator { - /// A validator address (e.g. cosmosvaloper1...) + /// The operator address of the validator (e.g. cosmosvaloper1...). + /// See https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/proto/cosmos/staking/v1beta1/staking.proto#L95-L96 + /// for more information. + /// + /// This uses `String` instead of `Addr` since the bech32 address prefix is different from + /// the ones that regular user accounts use. pub address: String, pub commission: Decimal, pub max_commission: Decimal, - /// TODO: what units are these (in terms of time)? + /// The maximum daily increase of the commission pub max_change_rate: Decimal, } + +impl Validator { + /// Creates a new validator. + /// + /// If fields get added to the [`Validator`] struct in the future, this constructor will + /// provide default values for them, but these default values may not be sensible. + pub fn create( + address: String, + commission: Decimal, + max_commission: Decimal, + max_change_rate: Decimal, + ) -> Self { + Self { + address, + commission, + max_commission, + max_change_rate, + } + } +} + +impl_hidden_constructor!( + Validator, + address: String, + commission: Decimal, + max_commission: Decimal, + max_change_rate: Decimal +); + +// Validator should contain all data that ValidatorMetadata has + maybe some additional data +// that is expensive to query, so we can convert ValidatorMetadata to Validator easily. +impl From for ValidatorMetadata { + fn from(validator: Validator) -> Self { + ValidatorMetadata { + address: validator.address, + commission: validator.commission, + max_commission: validator.max_commission, + max_change_rate: validator.max_change_rate, + } + } +} diff --git a/packages/std/src/query/wasm.rs b/packages/std/src/query/wasm.rs index cbac899834..d34b3989ce 100644 --- a/packages/std/src/query/wasm.rs +++ b/packages/std/src/query/wasm.rs @@ -1,10 +1,21 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use crate::Binary; +use crate::prelude::*; +#[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] +use crate::storage_keys::{range_to_bounds, ToByteVec}; +use crate::{Addr, Binary, Checksum}; +#[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] +use core::ops::RangeBounds; + +use super::query_response::QueryResponseType; + +use crate::utils::impl_hidden_constructor; #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum WasmQuery { /// this queries the public API of another contract at a known address (with known ABI) @@ -22,34 +33,256 @@ pub enum WasmQuery { /// Key is the raw key used in the contracts Storage key: Binary, }, - /// returns a ContractInfoResponse with metadata on the contract from the runtime + /// Returns a [`ContractInfoResponse`] with metadata on the contract from the runtime ContractInfo { contract_addr: String }, + /// Returns a [`CodeInfoResponse`] with metadata of the code + #[cfg(feature = "cosmwasm_1_2")] + CodeInfo { code_id: u64 }, + /// Queries a range of keys from the storage of a (different) contract, + /// returning a [`RawRangeResponse`]. + /// + /// This is a low-level query that allows you to query the storage of another contract. + /// Please keep in mind that the contract you are querying might change its storage layout using + /// migrations, which could break your queries, so it is recommended to only use this for + /// contracts you control. + #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] + RawRange { + /// The address of the contract to query + contract_addr: String, + /// Inclusive start bound. This is the first key you would like to get data for. + /// + /// If `start` is lexicographically greater than or equal to `end`, + /// an empty range is described, mo matter of the order. + start: Option, + /// Exclusive end bound. This is the key after the last key you would like to get data for. + end: Option, + /// Maximum number of elements to return. + /// + /// Make sure to set a reasonable limit to avoid running out of memory or into + /// the deserialization limits of the VM. Also keep in mind that these limitations depend + /// on the full JSON size of the response type. + limit: u16, + /// The order in which you want to receive the key-value pairs. + order: crate::Order, + }, +} + +impl WasmQuery { + /// Creates a new [`WasmQuery::RawRange`] from the given parameters. + /// + /// This takes a [`RangeBounds`] to allow for specifying the range in a more idiomatic way. + #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] + pub fn raw_range<'a, R, B>( + contract_addr: impl Into, + range: R, + limit: u16, + order: crate::Order, + ) -> Self + where + R: RangeBounds<&'a B>, + B: ToByteVec + ?Sized + 'a, + { + let (start, end) = range_to_bounds(&range); + + WasmQuery::RawRange { + contract_addr: contract_addr.into(), + start: start.map(Binary::new), + end: end.map(Binary::new), + limit, + order, + } + } } #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct ContractInfoResponse { pub code_id: u64, /// address that instantiated this contract - pub creator: String, + pub creator: Addr, /// admin who can run migrations (if any) - pub admin: Option, + pub admin: Option, /// if set, the contract is pinned to the cache, and thus uses less gas when called pub pinned: bool, /// set if this contract has bound an IBC port pub ibc_port: Option, + /// set if this contract has bound an Ibc2 port + pub ibc2_port: Option, } -impl ContractInfoResponse { - /// Convenience constructor for tests / mocks - #[doc(hidden)] - pub fn new(code_id: u64, creator: impl Into) -> Self { - Self { - code_id, - creator: creator.into(), - admin: None, - pinned: false, - ibc_port: None, - } +impl QueryResponseType for ContractInfoResponse {} + +impl_hidden_constructor!( + ContractInfoResponse, + code_id: u64, + creator: Addr, + admin: Option, + pinned: bool, + ibc_port: Option, + ibc2_port: Option +); + +/// The essential data from wasmd's [CodeInfo]/[CodeInfoResponse]. +/// +/// `code_hash`/`data_hash` was renamed to `checksum` to follow the CosmWasm +/// convention and naming in `instantiate2_address`. +/// +/// [CodeInfo]: https://github.com/CosmWasm/wasmd/blob/v0.30.0/proto/cosmwasm/wasm/v1/types.proto#L62-L72 +/// [CodeInfoResponse]: https://github.com/CosmWasm/wasmd/blob/v0.30.0/proto/cosmwasm/wasm/v1/query.proto#L184-L199 +#[non_exhaustive] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct CodeInfoResponse { + pub code_id: u64, + /// The address that initially stored the code + pub creator: Addr, + /// The hash of the Wasm blob + pub checksum: Checksum, +} + +impl_hidden_constructor!( + CodeInfoResponse, + code_id: u64, + creator: Addr, + checksum: Checksum +); + +impl QueryResponseType for CodeInfoResponse {} + +#[non_exhaustive] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +pub struct RawRangeResponse { + /// The key-value pairs + pub data: Vec, + /// `None` if there are no more key-value pairs within the given key range. + pub next_key: Option, +} + +impl_hidden_constructor!( + RawRangeResponse, + data: Vec, + next_key: Option +); + +pub type RawRangeEntry = (Binary, Binary); + +#[cfg(test)] +mod tests { + use super::*; + use crate::to_json_binary; + + #[test] + fn wasm_query_contract_info_serialization() { + let query = WasmQuery::ContractInfo { + contract_addr: "aabbccdd456".into(), + }; + let json = to_json_binary(&query).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"contract_info":{"contract_addr":"aabbccdd456"}}"#, + ); + } + + #[test] + #[cfg(feature = "cosmwasm_1_2")] + fn wasm_query_code_info_serialization() { + let query = WasmQuery::CodeInfo { code_id: 70 }; + let json = to_json_binary(&query).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"code_info":{"code_id":70}}"#, + ); + } + + #[test] + fn contract_info_response_serialization() { + let response = ContractInfoResponse { + code_id: 67, + creator: Addr::unchecked("jane"), + admin: Some(Addr::unchecked("king")), + pinned: true, + ibc_port: Some("wasm.123".to_string()), + ibc2_port: Some("wasm.123".to_string()), + }; + let json = to_json_binary(&response).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"code_id":67,"creator":"jane","admin":"king","pinned":true,"ibc_port":"wasm.123","ibc2_port":"wasm.123"}"#, + ); + } + + #[test] + #[cfg(feature = "cosmwasm_1_2")] + fn code_info_response_serialization() { + use crate::Checksum; + + let response = CodeInfoResponse { + code_id: 67, + creator: Addr::unchecked("jane"), + checksum: Checksum::from_hex( + "f7bb7b18fb01bbf425cf4ed2cd4b7fb26a019a7fc75a4dc87e8a0b768c501f00", + ) + .unwrap(), + }; + let json = to_json_binary(&response).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"code_id":67,"creator":"jane","checksum":"f7bb7b18fb01bbf425cf4ed2cd4b7fb26a019a7fc75a4dc87e8a0b768c501f00"}"#, + ); + } + + #[test] + #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] + fn raw_range_constructor_works() { + use crate::Order; + + let query = WasmQuery::raw_range( + "contract_addr", + &b"asdf"[..]..&b"asdz"[..], + 100, + Order::Ascending, + ); + + assert_eq!( + query, + WasmQuery::RawRange { + contract_addr: "contract_addr".to_string(), + start: Some(Binary::from(b"asdf")), + end: Some(Binary::from(b"asdz")), + limit: 100, + order: Order::Ascending, + } + ); + + let query = WasmQuery::raw_range("contract_addr", b"asdf"..=b"asdz", 100, Order::Ascending); + assert_eq!( + query, + WasmQuery::RawRange { + contract_addr: "contract_addr".to_string(), + start: Some(Binary::from(b"asdf")), + end: Some(Binary::from(b"asdz\0")), + limit: 100, + order: Order::Ascending, + } + ); + } + + #[test] + fn raw_range_response_serialization() { + let response = RawRangeResponse { + data: vec![ + (Binary::from(b"key"), Binary::from(b"value")), + (Binary::from(b"foo"), Binary::from(b"bar")), + ], + next_key: Some(Binary::from(b"next")), + }; + let json = to_json_binary(&response).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"data":[["a2V5","dmFsdWU="],["Zm9v","YmFy"]],"next_key":"bmV4dA=="}"#, + ); } } diff --git a/packages/std/src/results/contract_result.rs b/packages/std/src/results/contract_result.rs index 380ecaeccb..6b181c6526 100644 --- a/packages/std/src/results/contract_result.rs +++ b/packages/std/src/results/contract_result.rs @@ -1,6 +1,8 @@ +use core::fmt; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use std::fmt; + +use crate::prelude::*; /// This is the final result type that is created and serialized in a contract for /// every init/execute/migrate call. The VM then deserializes this type to distinguish @@ -15,26 +17,28 @@ use std::fmt; /// Success: /// /// ``` -/// # use cosmwasm_std::{to_vec, ContractResult, Response}; +/// # use cosmwasm_std::{to_json_string, ContractResult, Response}; /// let response: Response = Response::default(); /// let result: ContractResult = ContractResult::Ok(response); -/// assert_eq!(to_vec(&result).unwrap(), br#"{"ok":{"messages":[],"attributes":[],"events":[],"data":null}}"#); +/// assert_eq!(to_json_string(&result).unwrap(), r#"{"ok":{"messages":[],"attributes":[],"events":[],"data":null}}"#); /// ``` /// /// Failure: /// /// ``` -/// # use cosmwasm_std::{to_vec, ContractResult, Response}; +/// # use cosmwasm_std::{to_json_string, ContractResult, Response}; /// let error_msg = String::from("Something went wrong"); /// let result: ContractResult = ContractResult::Err(error_msg); -/// assert_eq!(to_vec(&result).unwrap(), br#"{"error":"Something went wrong"}"#); +/// assert_eq!(to_json_string(&result).unwrap(), r#"{"error":"Something went wrong"}"#); /// ``` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum ContractResult { Ok(S), /// An error type that every custom error created by contract developers can be converted to. - /// This could potientially have more structure, but String is the easiest. + /// This could potentially have more structure, but String is the easiest. #[serde(rename = "error")] Err(String), } @@ -88,62 +92,62 @@ impl From> for Result { #[cfg(test)] mod tests { use super::*; - use crate::{from_slice, to_vec, Response, StdError, StdResult}; + use crate::{errors::ErrorKind, from_json, to_json_vec, Response, StdError, StdResult}; #[test] fn contract_result_serialization_works() { let result = ContractResult::Ok(12); - assert_eq!(&to_vec(&result).unwrap(), b"{\"ok\":12}"); + assert_eq!(&to_json_vec(&result).unwrap(), b"{\"ok\":12}"); let result = ContractResult::Ok("foo"); - assert_eq!(&to_vec(&result).unwrap(), b"{\"ok\":\"foo\"}"); + assert_eq!(&to_json_vec(&result).unwrap(), b"{\"ok\":\"foo\"}"); let result: ContractResult = ContractResult::Ok(Response::default()); assert_eq!( - to_vec(&result).unwrap(), + to_json_vec(&result).unwrap(), br#"{"ok":{"messages":[],"attributes":[],"events":[],"data":null}}"# ); let result: ContractResult = ContractResult::Err("broken".to_string()); - assert_eq!(&to_vec(&result).unwrap(), b"{\"error\":\"broken\"}"); + assert_eq!(&to_json_vec(&result).unwrap(), b"{\"error\":\"broken\"}"); } #[test] fn contract_result_deserialization_works() { - let result: ContractResult = from_slice(br#"{"ok":12}"#).unwrap(); + let result: ContractResult = from_json(br#"{"ok":12}"#).unwrap(); assert_eq!(result, ContractResult::Ok(12)); - let result: ContractResult = from_slice(br#"{"ok":"foo"}"#).unwrap(); + let result: ContractResult = from_json(br#"{"ok":"foo"}"#).unwrap(); assert_eq!(result, ContractResult::Ok("foo".to_string())); let result: ContractResult = - from_slice(br#"{"ok":{"messages":[],"attributes":[],"events":[],"data":null}}"#) + from_json(br#"{"ok":{"messages":[],"attributes":[],"events":[],"data":null}}"#) .unwrap(); assert_eq!(result, ContractResult::Ok(Response::default())); - let result: ContractResult = from_slice(br#"{"error":"broken"}"#).unwrap(); + let result: ContractResult = from_json(br#"{"error":"broken"}"#).unwrap(); assert_eq!(result, ContractResult::Err("broken".to_string())); // ignores whitespace - let result: ContractResult = from_slice(b" {\n\t \"ok\": 5898\n} ").unwrap(); + let result: ContractResult = from_json(b" {\n\t \"ok\": 5898\n} ").unwrap(); assert_eq!(result, ContractResult::Ok(5898)); // fails for additional attributes - let parse: StdResult> = from_slice(br#"{"unrelated":321,"ok":4554}"#); - match parse.unwrap_err() { - StdError::ParseErr { .. } => {} - err => panic!("Unexpected error: {:?}", err), + let parse: StdResult> = from_json(br#"{"unrelated":321,"ok":4554}"#); + match parse.unwrap_err().kind() { + ErrorKind::Serialization => {} + err => panic!("Unexpected error: {err:?}"), } - let parse: StdResult> = from_slice(br#"{"ok":4554,"unrelated":321}"#); - match parse.unwrap_err() { - StdError::ParseErr { .. } => {} - err => panic!("Unexpected error: {:?}", err), + let parse: StdResult> = from_json(br#"{"ok":4554,"unrelated":321}"#); + match parse.unwrap_err().kind() { + ErrorKind::Serialization => {} + err => panic!("Unexpected error: {err:?}"), } let parse: StdResult> = - from_slice(br#"{"ok":4554,"error":"What's up now?"}"#); - match parse.unwrap_err() { - StdError::ParseErr { .. } => {} - err => panic!("Unexpected error: {:?}", err), + from_json(br#"{"ok":4554,"error":"What's up now?"}"#); + match parse.unwrap_err().kind() { + ErrorKind::Serialization => {} + err => panic!("Unexpected error: {err:?}"), } } @@ -153,11 +157,11 @@ mod tests { let converted: ContractResult = original.into(); assert_eq!(converted, ContractResult::Ok(Response::default())); - let original: Result = Err(StdError::generic_err("broken")); + let original: Result = Err(StdError::msg("broken")); let converted: ContractResult = original.into(); assert_eq!( converted, - ContractResult::Err("Generic error: broken".to_string()) + ContractResult::Err("kind: Other, error: broken".to_string()) ); } diff --git a/packages/std/src/results/cosmos_msg.rs b/packages/std/src/results/cosmos_msg.rs index d72f98ddda..3ea314d5e2 100644 --- a/packages/std/src/results/cosmos_msg.rs +++ b/packages/std/src/results/cosmos_msg.rs @@ -1,25 +1,61 @@ -use derivative::Derivative; +#![allow(deprecated)] + +use core::fmt; +use derive_more::Debug; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use std::fmt; -use crate::binary::Binary; use crate::coin::Coin; -use crate::errors::StdResult; #[cfg(feature = "stargate")] use crate::ibc::IbcMsg; -use crate::serde::to_binary; +#[cfg(feature = "ibc2")] +use crate::ibc2::Ibc2Msg; +use crate::prelude::*; +#[cfg(all(feature = "stargate", feature = "cosmwasm_1_2"))] +use crate::Decimal; +use crate::StdResult; +use crate::{to_json_binary, Binary}; use super::Empty; -/// Like CustomQuery for better type clarity. -/// Also makes it shorter to use as a trait bound. -pub trait CustomMsg: Serialize + Clone + fmt::Debug + PartialEq + JsonSchema {} +/// A trait for custom message types which are embedded in `CosmosMsg::Custom(..)`. +/// Those are messages that the contract and the chain need +/// to agree on in advance as the chain must be able to deserialize and execute them. +/// +/// Custom messages are always JSON-encoded when sent from the contract to the environment. +/// +/// This trait is similar to [`CustomQuery`](crate::CustomQuery) for better type clarity and +/// makes it shorter to use as a trait bound. It does not require fields or functions to be implemented. +/// +/// An alternative approach is using [`CosmosMsg::Any`][crate::CosmosMsg#variant.Any] +/// which provides more flexibility but offers less type-safety. +/// +/// ## Examples +/// +/// Some real-world examples of such custom message types are +/// [TgradeMsg](https://github.com/confio/poe-contracts/blob/v0.17.1/packages/bindings/src/msg.rs#L13), +/// [ArchwayMsg](https://github.com/archway-network/arch3.rs/blob/bindings/v0.2.1/packages/bindings/src/msg.rs#L22) or +/// [NeutronMsg](https://github.com/neutron-org/neutron-sdk/blob/v0.11.0/packages/neutron-sdk/src/bindings/msg.rs#L33). +/// +/// ``` +/// use cosmwasm_schema::cw_serde; +/// use cosmwasm_std::CustomQuery; +/// +/// #[cw_serde] +/// pub enum MyMsg { +/// // ... +/// } +/// +/// impl CustomQuery for MyMsg {} +/// ``` +pub trait CustomMsg: Serialize + Clone + fmt::Debug + PartialEq {} impl CustomMsg for Empty {} #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] // See https://github.com/serde-rs/serde/issues/1296 why we cannot add De-Serialize trait bounds to T pub enum CosmosMsg { @@ -31,25 +67,66 @@ pub enum CosmosMsg { Staking(StakingMsg), #[cfg(feature = "staking")] Distribution(DistributionMsg), - /// A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). /// This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) #[cfg(feature = "stargate")] + #[deprecated = "Use `CosmosMsg::Any` instead (if you only target CosmWasm 2+ chains)"] Stargate { type_url: String, value: Binary, }, + /// `CosmosMsg::Any` replaces the "stargate message" – a message wrapped + /// in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) + /// that is supported by the chain. It behaves the same as + /// `CosmosMsg::Stargate` but has a better name and slightly improved syntax. + /// + /// This is feature-gated at compile time with `cosmwasm_2_0` because + /// a chain running CosmWasm < 2.0 cannot process this. + #[cfg(feature = "cosmwasm_2_0")] + Any(AnyMsg), #[cfg(feature = "stargate")] Ibc(IbcMsg), Wasm(WasmMsg), #[cfg(feature = "stargate")] Gov(GovMsg), + #[cfg(feature = "ibc2")] + Ibc2(Ibc2Msg), +} + +impl CosmosMsg { + /// Convert this [`CosmosMsg`] to a [`CosmosMsg`] with a different custom message type. + /// This allows easier interactions between code written for a specific chain and + /// code written for multiple chains. + /// If this is the [`CosmosMsg::Custom`] variant, the function returns `None`. + pub fn change_custom(self) -> Option> { + Some(match self { + CosmosMsg::Bank(msg) => CosmosMsg::Bank(msg), + CosmosMsg::Custom(_) => return None, + #[cfg(feature = "staking")] + CosmosMsg::Staking(msg) => CosmosMsg::Staking(msg), + #[cfg(feature = "staking")] + CosmosMsg::Distribution(msg) => CosmosMsg::Distribution(msg), + #[cfg(feature = "stargate")] + CosmosMsg::Stargate { type_url, value } => CosmosMsg::Stargate { type_url, value }, + #[cfg(feature = "cosmwasm_2_0")] + CosmosMsg::Any(msg) => CosmosMsg::Any(msg), + #[cfg(feature = "stargate")] + CosmosMsg::Ibc(msg) => CosmosMsg::Ibc(msg), + CosmosMsg::Wasm(msg) => CosmosMsg::Wasm(msg), + #[cfg(feature = "stargate")] + CosmosMsg::Gov(msg) => CosmosMsg::Gov(msg), + #[cfg(feature = "ibc2")] + CosmosMsg::Ibc2(msg) => CosmosMsg::Ibc2(msg), + }) + } } /// The message types of the bank module. /// /// See https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum BankMsg { /// Sends native tokens from the contract to the given address. @@ -71,7 +148,9 @@ pub enum BankMsg { /// See https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto #[cfg(feature = "staking")] #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum StakingMsg { /// This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). @@ -94,7 +173,9 @@ pub enum StakingMsg { /// See https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto #[cfg(feature = "staking")] #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum DistributionMsg { /// This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). @@ -103,18 +184,40 @@ pub enum DistributionMsg { /// The `withdraw_address` address: String, }, - /// This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). + /// This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). /// `delegator_address` is automatically filled with the current contract's address. WithdrawDelegatorReward { /// The `validator_address` validator: String, }, + /// This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). + /// `depositor` is automatically filled with the current contract's address. + #[cfg(feature = "cosmwasm_1_3")] + FundCommunityPool { + /// The amount to spend + amount: Vec, + }, +} + +/// A message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). +/// This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct AnyMsg { + pub type_url: String, + pub value: Binary, } -fn binary_to_string(data: &Binary, fmt: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { - match std::str::from_utf8(data.as_slice()) { - Ok(s) => fmt.write_str(s), - Err(_) => write!(fmt, "{:?}", data), +#[allow(dead_code)] +struct BinaryToStringEncoder<'a>(&'a Binary); + +impl fmt::Display for BinaryToStringEncoder<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match core::str::from_utf8(self.0.as_slice()) { + Ok(s) => f.write_str(s), + Err(_) => fmt::Debug::fmt(self.0, f), + } } } @@ -122,8 +225,9 @@ fn binary_to_string(data: &Binary, fmt: &mut std::fmt::Formatter) -> Result<(), /// /// See https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto #[non_exhaustive] -#[derive(Serialize, Deserialize, Clone, Derivative, PartialEq, Eq, JsonSchema)] -#[derivative(Debug)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum WasmMsg { /// Dispatches a call to another contract at a known address (with known ABI). @@ -133,24 +237,58 @@ pub enum WasmMsg { Execute { contract_addr: String, /// msg is the json-encoded ExecuteMsg struct (as raw Binary) - #[derivative(Debug(format_with = "binary_to_string"))] + #[debug("{}", BinaryToStringEncoder(msg))] msg: Binary, funds: Vec, }, /// Instantiates a new contracts from previously uploaded Wasm code. /// - /// This is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). + /// The contract address is non-predictable. But it is guaranteed that + /// when emitting the same Instantiate message multiple times, + /// multiple instances on different addresses will be generated. See also + /// Instantiate2. + /// + /// This is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). /// `sender` is automatically filled with the current contract's address. Instantiate { admin: Option, code_id: u64, /// msg is the JSON-encoded InstantiateMsg struct (as raw Binary) - #[derivative(Debug(format_with = "binary_to_string"))] + #[debug("{}", BinaryToStringEncoder(msg))] msg: Binary, funds: Vec, - /// A human-readbale label for the contract + /// A human-readable label for the contract. + /// + /// Valid values should: + /// - not be empty + /// - not be bigger than 128 bytes (or some chain-specific limit) + /// - not start / end with whitespace label: String, }, + /// Instantiates a new contracts from previously uploaded Wasm code + /// using a predictable address derivation algorithm implemented in + /// [`cosmwasm_std::instantiate2_address`]. + /// + /// This is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). + /// `sender` is automatically filled with the current contract's address. + /// `fix_msg` is automatically set to false. + #[cfg(feature = "cosmwasm_1_2")] + Instantiate2 { + admin: Option, + code_id: u64, + /// A human-readable label for the contract. + /// + /// Valid values should: + /// - not be empty + /// - not be bigger than 128 bytes (or some chain-specific limit) + /// - not start / end with whitespace + label: String, + /// msg is the JSON-encoded InstantiateMsg struct (as raw Binary) + #[debug("{}", BinaryToStringEncoder(msg))] + msg: Binary, + funds: Vec, + salt: Binary, + }, /// Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to /// customize behavior. /// @@ -163,7 +301,7 @@ pub enum WasmMsg { /// the code_id of the new logic to place in the given contract new_code_id: u64, /// msg is the json-encoded MigrateMsg struct that will be passed to the new code - #[derivative(Debug(format_with = "binary_to_string"))] + #[debug("{}", BinaryToStringEncoder(msg))] msg: Binary, }, /// Sets a new admin (for migrate) on the given contract. @@ -177,16 +315,102 @@ pub enum WasmMsg { ClearAdmin { contract_addr: String }, } +/// This message type allows the contract interact with the [x/gov] module in order +/// to cast votes. +/// +/// [x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov +/// +/// ## Examples +/// +/// Cast a simple vote: +/// +/// ``` +/// # use cosmwasm_std::{ +/// # HexBinary, +/// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, +/// # Response, QueryResponse, +/// # }; +/// # type ExecuteMsg = (); +/// use cosmwasm_std::{GovMsg, VoteOption}; +/// +/// #[entry_point] +/// pub fn execute( +/// deps: DepsMut, +/// env: Env, +/// info: MessageInfo, +/// msg: ExecuteMsg, +/// ) -> Result { +/// // ... +/// Ok(Response::new().add_message(GovMsg::Vote { +/// proposal_id: 4, +/// option: VoteOption::Yes, +/// })) +/// } +/// ``` +/// +/// Cast a weighted vote: +/// +/// ``` +/// # use cosmwasm_std::{ +/// # HexBinary, +/// # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, +/// # Response, QueryResponse, +/// # }; +/// # type ExecuteMsg = (); +/// # #[cfg(feature = "cosmwasm_1_2")] +/// use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption}; +/// +/// # #[cfg(feature = "cosmwasm_1_2")] +/// #[entry_point] +/// pub fn execute( +/// deps: DepsMut, +/// env: Env, +/// info: MessageInfo, +/// msg: ExecuteMsg, +/// ) -> Result { +/// // ... +/// Ok(Response::new().add_message(GovMsg::VoteWeighted { +/// proposal_id: 4, +/// options: vec![ +/// WeightedVoteOption { +/// option: VoteOption::Yes, +/// weight: Decimal::percent(65), +/// }, +/// WeightedVoteOption { +/// option: VoteOption::Abstain, +/// weight: Decimal::percent(35), +/// }, +/// ], +/// })) +/// } +/// ``` #[cfg(feature = "stargate")] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[non_exhaustive] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum GovMsg { /// This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address. - Vote { proposal_id: u64, vote: VoteOption }, + Vote { + proposal_id: u64, + /// The vote option. + /// + /// This used to be called "vote", but was changed for consistency with Cosmos SDK. + option: VoteOption, + }, + /// This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address. + #[cfg(feature = "cosmwasm_1_2")] + VoteWeighted { + proposal_id: u64, + options: Vec, + }, } #[cfg(feature = "stargate")] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum VoteOption { Yes, @@ -195,6 +419,15 @@ pub enum VoteOption { NoWithVeto, } +#[cfg(all(feature = "stargate", feature = "cosmwasm_1_2"))] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct WeightedVoteOption { + pub option: VoteOption, + pub weight: Decimal, +} + /// Shortcut helper as the construction of WasmMsg::Instantiate can be quite verbose in contract code. /// /// When using this, `admin` is always unset. If you need more flexibility, create the message directly. @@ -204,7 +437,7 @@ pub fn wasm_instantiate( funds: Vec, label: String, ) -> StdResult { - let payload = to_binary(msg)?; + let payload = to_json_binary(msg)?; Ok(WasmMsg::Instantiate { admin: None, code_id, @@ -214,13 +447,13 @@ pub fn wasm_instantiate( }) } -/// Shortcut helper as the construction of WasmMsg::Instantiate can be quite verbose in contract code +/// Shortcut helper as the construction of WasmMsg::Execute can be quite verbose in contract code pub fn wasm_execute( contract_addr: impl Into, msg: &impl Serialize, funds: Vec, ) -> StdResult { - let payload = to_binary(msg)?; + let payload = to_json_binary(msg)?; Ok(WasmMsg::Execute { contract_addr: contract_addr.into(), msg: payload, @@ -248,6 +481,15 @@ impl From for CosmosMsg { } } +// By implementing `From for cosmwasm_std::AnyMsg`, +// you automatically get a MyType -> CosmosMsg conversion. +#[cfg(feature = "cosmwasm_2_0")] +impl, T> From for CosmosMsg { + fn from(source: S) -> Self { + CosmosMsg::::Any(source.into()) + } +} + impl From for CosmosMsg { fn from(msg: WasmMsg) -> Self { CosmosMsg::Wasm(msg) @@ -268,10 +510,18 @@ impl From for CosmosMsg { } } +#[cfg(feature = "ibc2")] +impl From for CosmosMsg { + fn from(msg: Ibc2Msg) -> Self { + CosmosMsg::Ibc2(msg) + } +} + #[cfg(test)] mod tests { use super::*; use crate::{coin, coins}; + use fmt::Debug; #[test] fn from_bank_msg_works() { @@ -285,16 +535,157 @@ mod tests { } } - #[cosmwasm_schema::cw_serde] - enum ExecuteMsg { - Mint { coin: Coin }, + #[test] + #[cfg(feature = "cosmwasm_2_0")] + fn from_any_msg_works() { + // should work with AnyMsg + let any = AnyMsg { + type_url: "/cosmos.foo.v1beta.MsgBar".to_string(), + value: Binary::from_base64("5yu/rQ+HrMcxH1zdga7P5hpGMLE=").unwrap(), + }; + let msg: CosmosMsg = any.clone().into(); + assert!(matches!(msg, CosmosMsg::Any(a) if a == any)); + + // should work with Into + struct IntoAny; + + impl From for AnyMsg { + fn from(_: IntoAny) -> Self { + AnyMsg { + type_url: "/cosmos.foo.v1beta.MsgBar".to_string(), + value: Binary::from_base64("5yu/rQ+HrMcxH1zdga7P5hpGMLE=").unwrap(), + } + } + } + + let msg: CosmosMsg = IntoAny.into(); + assert!(matches!( + msg, + CosmosMsg::Any(a) if a == any + )); + } + + #[test] + fn wasm_msg_serializes_to_correct_json() { + // Instantiate with admin + let msg = WasmMsg::Instantiate { + admin: Some("king".to_string()), + code_id: 7897, + msg: br#"{"claim":{}}"#.into(), + funds: vec![], + label: "my instance".to_string(), + }; + let json = to_json_binary(&msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"instantiate":{"admin":"king","code_id":7897,"msg":"eyJjbGFpbSI6e319","funds":[],"label":"my instance"}}"#, + ); + + // Instantiate without admin + let msg = WasmMsg::Instantiate { + admin: None, + code_id: 7897, + msg: br#"{"claim":{}}"#.into(), + funds: vec![], + label: "my instance".to_string(), + }; + let json = to_json_binary(&msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"instantiate":{"admin":null,"code_id":7897,"msg":"eyJjbGFpbSI6e319","funds":[],"label":"my instance"}}"#, + ); + + // Instantiate with funds + let msg = WasmMsg::Instantiate { + admin: None, + code_id: 7897, + msg: br#"{"claim":{}}"#.into(), + funds: vec![coin(321, "stones")], + label: "my instance".to_string(), + }; + let json = to_json_binary(&msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"instantiate":{"admin":null,"code_id":7897,"msg":"eyJjbGFpbSI6e319","funds":[{"denom":"stones","amount":"321"}],"label":"my instance"}}"#, + ); + + // Instantiate2 + #[cfg(feature = "cosmwasm_1_2")] + { + let msg = WasmMsg::Instantiate2 { + admin: None, + code_id: 7897, + label: "my instance".to_string(), + msg: br#"{"claim":{}}"#.into(), + funds: vec![coin(321, "stones")], + salt: Binary::from_base64("UkOVazhiwoo=").unwrap(), + }; + let json = to_json_binary(&msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"instantiate2":{"admin":null,"code_id":7897,"label":"my instance","msg":"eyJjbGFpbSI6e319","funds":[{"denom":"stones","amount":"321"}],"salt":"UkOVazhiwoo="}}"#, + ); + } + } + + #[test] + #[cfg(feature = "cosmwasm_2_0")] + fn any_msg_serializes_to_correct_json() { + // Same serialization as CosmosMsg::Stargate (see above), except the top level key + let msg: CosmosMsg = CosmosMsg::Any(AnyMsg { + type_url: "/cosmos.foo.v1beta.MsgBar".to_string(), + value: Binary::from_base64("5yu/rQ+HrMcxH1zdga7P5hpGMLE=").unwrap(), + }); + let json = crate::to_json_string(&msg).unwrap(); + assert_eq!( + json, + r#"{"any":{"type_url":"/cosmos.foo.v1beta.MsgBar","value":"5yu/rQ+HrMcxH1zdga7P5hpGMLE="}}"#, + ); + } + + #[test] + #[cfg(all(feature = "cosmwasm_1_3", feature = "staking"))] + fn msg_distribution_serializes_to_correct_json() { + // FundCommunityPool + let fund_coins = vec![coin(200, "feathers"), coin(200, "stones")]; + let fund_msg = DistributionMsg::FundCommunityPool { amount: fund_coins }; + let fund_json = to_json_binary(&fund_msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&fund_json), + r#"{"fund_community_pool":{"amount":[{"denom":"feathers","amount":"200"},{"denom":"stones","amount":"200"}]}}"#, + ); + + // SetWithdrawAddress + let set_msg = DistributionMsg::SetWithdrawAddress { + address: String::from("withdrawer"), + }; + let set_json = to_json_binary(&set_msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&set_json), + r#"{"set_withdraw_address":{"address":"withdrawer"}}"#, + ); + + // WithdrawDelegatorRewards + let withdraw_msg = DistributionMsg::WithdrawDelegatorReward { + validator: String::from("fancyoperator"), + }; + let withdraw_json = to_json_binary(&withdraw_msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&withdraw_json), + r#"{"withdraw_delegator_reward":{"validator":"fancyoperator"}}"# + ); } #[test] fn wasm_msg_debug_decodes_binary_string_when_possible() { + #[cosmwasm_schema::cw_serde] + enum ExecuteMsg { + Mint { coin: Coin }, + } + let msg = WasmMsg::Execute { contract_addr: "joe".to_string(), - msg: to_binary(&ExecuteMsg::Mint { + msg: to_json_binary(&ExecuteMsg::Mint { coin: coin(10, "BTC"), }) .unwrap(), @@ -302,7 +693,7 @@ mod tests { }; assert_eq!( - format!("{:?}", msg), + format!("{msg:?}"), "Execute { contract_addr: \"joe\", msg: {\"mint\":{\"coin\":{\"denom\":\"BTC\",\"amount\":\"10\"}}}, funds: [] }" ); } @@ -316,8 +707,78 @@ mod tests { }; assert_eq!( - format!("{:?}", msg), + format!("{msg:?}"), "Execute { contract_addr: \"joe\", msg: Binary(009f9296), funds: [] }" ); } + + #[test] + #[cfg(feature = "stargate")] + fn gov_msg_serializes_to_correct_json() { + // Vote + let msg = GovMsg::Vote { + proposal_id: 4, + option: VoteOption::NoWithVeto, + }; + let json = to_json_binary(&msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"vote":{"proposal_id":4,"option":"no_with_veto"}}"#, + ); + + // VoteWeighted + #[cfg(feature = "cosmwasm_1_2")] + { + let msg = GovMsg::VoteWeighted { + proposal_id: 25, + options: vec![ + WeightedVoteOption { + weight: Decimal::percent(25), + option: VoteOption::Yes, + }, + WeightedVoteOption { + weight: Decimal::percent(25), + option: VoteOption::No, + }, + WeightedVoteOption { + weight: Decimal::percent(50), + option: VoteOption::Abstain, + }, + ], + }; + + let json = to_json_binary(&msg).unwrap(); + assert_eq!( + String::from_utf8_lossy(&json), + r#"{"vote_weighted":{"proposal_id":25,"options":[{"option":"yes","weight":"0.25"},{"option":"no","weight":"0.25"},{"option":"abstain","weight":"0.5"}]}}"#, + ); + } + } + + #[test] + fn change_custom_works() { + #[derive(Debug, PartialEq, Eq, Clone)] + struct Custom { + _a: i32, + } + let send = BankMsg::Send { + to_address: "you".to_string(), + amount: coins(1015, "earth"), + }; + // Custom to Empty + let msg: CosmosMsg = send.clone().into(); + let msg2: CosmosMsg = msg.change_custom().unwrap(); + assert_eq!(msg2, CosmosMsg::Bank(send.clone())); + let custom = CosmosMsg::Custom(Custom { _a: 5 }); + let converted = custom.change_custom::(); + assert_eq!(converted, None); + + // Empty to Custom + let msg: CosmosMsg = send.clone().into(); + let msg2: CosmosMsg = msg.change_custom().unwrap(); + assert_eq!(msg2, CosmosMsg::Bank(send)); + let empty = CosmosMsg::Custom(Empty {}); + let converted = empty.change_custom::(); + assert_eq!(converted, None); + } } diff --git a/packages/std/src/results/empty.rs b/packages/std/src/results/empty.rs index 56ccf35868..04c42b83f7 100644 --- a/packages/std/src/results/empty.rs +++ b/packages/std/src/results/empty.rs @@ -4,17 +4,19 @@ use serde::{Deserialize, Serialize}; /// An empty struct that serves as a placeholder in different places, /// such as contracts that don't set a custom message. /// -/// It is designed to be expressable in correct JSON and JSON Schema but +/// It is designed to be expressible in correct JSON and JSON Schema but /// contains no meaningful data. Previously we used enums without cases, /// but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451) -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, Default, cw_schema::Schemaifier, +)] pub struct Empty {} #[cfg(test)] mod tests { use super::*; - use crate::serde::{from_slice, to_vec}; + use crate::{from_json, to_json_vec}; #[test] fn empty_can_be_instantiated() { @@ -25,13 +27,13 @@ mod tests { #[test] fn empty_can_be_instantiated_serialized_and_deserialized() { let instance = Empty {}; - let serialized = to_vec(&instance).unwrap(); + let serialized = to_json_vec(&instance).unwrap(); assert_eq!(serialized, b"{}"); - let deserialized: Empty = from_slice(b"{}").unwrap(); + let deserialized: Empty = from_json(b"{}").unwrap(); assert_eq!(deserialized, instance); - let deserialized: Empty = from_slice(b"{\"stray\":\"data\"}").unwrap(); + let deserialized: Empty = from_json(b"{\"stray\":\"data\"}").unwrap(); assert_eq!(deserialized, instance); } } diff --git a/packages/std/src/results/events.rs b/packages/std/src/results/events.rs index 5cf0e8d2a2..fedc089567 100644 --- a/packages/std/src/results/events.rs +++ b/packages/std/src/results/events.rs @@ -1,15 +1,20 @@ +use crate::__internal::forward_ref_partial_eq; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +use crate::prelude::*; + /// A full [*Cosmos SDK* event]. /// /// This version uses string attributes (similar to [*Cosmos SDK* StringEvent]), /// which then get magically converted to bytes for Tendermint somewhere between /// the Rust-Go interface, JSON deserialization and the `NewEvent` call in Cosmos SDK. /// -/// [*Cosmos SDK* event]: https://docs.cosmos.network/main/core/events.html +/// [*Cosmos SDK* event]: https://docs.cosmos.network/main/learn/advanced/events /// [*Cosmos SDK* StringEvent]: https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/base/abci/v1beta1/abci.proto#L56-L70 -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct Event { /// The event type. This is renamed to "ty" because "type" is reserved in Rust. This sucks, we know. @@ -19,10 +24,12 @@ pub struct Event { /// /// You can learn more about these from [*Cosmos SDK* docs]. /// - /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/core/events.html + /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events pub attributes: Vec, } +forward_ref_partial_eq!(Event, Event); + impl Event { /// Create a new event with the given type and an empty list of attributes. pub fn new(ty: impl Into) -> Self { @@ -55,12 +62,16 @@ impl Event { } /// An key value pair that is used in the context of event attributes in logs -#[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct Attribute { pub key: String, pub value: String, } +forward_ref_partial_eq!(Attribute, Attribute); + impl Attribute { /// Creates a new Attribute. `attr` is just an alias for this. pub fn new(key: impl Into, value: impl Into) -> Self { @@ -69,8 +80,7 @@ impl Attribute { #[cfg(debug_assertions)] if key.starts_with('_') { panic!( - "attribute key `{}` is invalid - keys starting with an underscore are reserved", - key + "attribute key `{key}` is invalid - keys starting with an underscore are reserved" ); } @@ -111,18 +121,6 @@ impl, V: AsRef> PartialEq<&Attribute> for (K, V) { } } -impl PartialEq for &Attribute { - fn eq(&self, rhs: &Attribute) -> bool { - *self == rhs - } -} - -impl PartialEq<&Attribute> for Attribute { - fn eq(&self, rhs: &&Attribute) -> bool { - self == *rhs - } -} - /// Creates a new Attribute. `Attribute::new` is an alias for this. #[inline] pub fn attr(key: impl Into, value: impl Into) -> Attribute { diff --git a/packages/std/src/results/mod.rs b/packages/std/src/results/mod.rs index 95dd1dd8ef..effbf9ed73 100644 --- a/packages/std/src/results/mod.rs +++ b/packages/std/src/results/mod.rs @@ -10,7 +10,11 @@ mod submessages; mod system_result; pub use contract_result::ContractResult; -pub use cosmos_msg::{wasm_execute, wasm_instantiate, BankMsg, CosmosMsg, CustomMsg, WasmMsg}; +#[cfg(all(feature = "stargate", feature = "cosmwasm_1_2"))] +pub use cosmos_msg::WeightedVoteOption; +pub use cosmos_msg::{ + wasm_execute, wasm_instantiate, AnyMsg, BankMsg, CosmosMsg, CustomMsg, WasmMsg, +}; #[cfg(feature = "staking")] pub use cosmos_msg::{DistributionMsg, StakingMsg}; #[cfg(feature = "stargate")] @@ -19,7 +23,5 @@ pub use empty::Empty; pub use events::{attr, Attribute, Event}; pub use query::QueryResponse; pub use response::Response; -#[allow(deprecated)] -pub use submessages::SubMsgExecutionResponse; -pub use submessages::{Reply, ReplyOn, SubMsg, SubMsgResponse, SubMsgResult}; +pub use submessages::{MsgResponse, Reply, ReplyOn, SubMsg, SubMsgResponse, SubMsgResult}; pub use system_result::SystemResult; diff --git a/packages/std/src/results/query.rs b/packages/std/src/results/query.rs index 588bc7ffe5..8619ab7e4a 100644 --- a/packages/std/src/results/query.rs +++ b/packages/std/src/results/query.rs @@ -1,3 +1 @@ -use crate::binary::Binary; - -pub type QueryResponse = Binary; +pub type QueryResponse = crate::Binary; diff --git a/packages/std/src/results/response.rs b/packages/std/src/results/response.rs index 2fa5ed82d0..edcc4da35b 100644 --- a/packages/std/src/results/response.rs +++ b/packages/std/src/results/response.rs @@ -1,6 +1,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +use crate::prelude::*; use crate::Binary; use super::{Attribute, CosmosMsg, Empty, Event, SubMsg}; @@ -59,7 +60,9 @@ use super::{Attribute, CosmosMsg, Empty, Event, SubMsg}; /// Ok(response) /// } /// ``` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[non_exhaustive] pub struct Response { /// Optional list of messages to pass. These will be executed in order. @@ -72,14 +75,14 @@ pub struct Response { /// /// More info about events (and their attributes) can be found in [*Cosmos SDK* docs]. /// - /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/core/events.html + /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events pub attributes: Vec, /// Extra, custom events separate from the main `wasm` one. These will have /// `wasm-` prepended to the type. /// /// More info about events can be found in [*Cosmos SDK* docs]. /// - /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/core/events.html + /// [*Cosmos SDK* docs]: https://docs.cosmos.network/main/learn/advanced/events pub events: Vec, /// The binary payload to include in the response. pub data: Option, @@ -128,8 +131,8 @@ impl Response { /// /// The `wasm-` prefix will be appended by the runtime to the provided type /// of event. - pub fn add_event(mut self, event: Event) -> Self { - self.events.push(event); + pub fn add_event(mut self, event: impl Into) -> Self { + self.events.push(event.into()); self } @@ -209,7 +212,7 @@ impl Response { /// } /// ``` pub fn add_submessages(mut self, msgs: impl IntoIterator>) -> Self { - self.messages.extend(msgs.into_iter()); + self.messages.extend(msgs); self } @@ -218,8 +221,11 @@ impl Response { /// /// The `wasm-` prefix will be appended by the runtime to the provided types /// of events. - pub fn add_events(mut self, events: impl IntoIterator) -> Self { - self.events.extend(events.into_iter()); + pub fn add_events(mut self, events: impl IntoIterator) -> Self + where + E: Into, + { + self.events.extend(events.into_iter().map(|e| e.into())); self } @@ -228,6 +234,23 @@ impl Response { self.data = Some(data.into()); self } + + /// Convert this [`Response`] to a [`Response`] with a different custom message type. + /// This allows easier interactions between code written for a specific chain and + /// code written for multiple chains. + /// If this contains a [`CosmosMsg::Custom`] submessage, the function returns `None`. + pub fn change_custom(self) -> Option> { + Some(Response { + messages: self + .messages + .into_iter() + .map(|msg| msg.change_custom()) + .collect::>>()?, + attributes: self.attributes, + events: self.events, + data: self.data, + }) + } } #[cfg(test)] @@ -235,11 +258,11 @@ mod tests { use super::super::BankMsg; use super::*; use crate::results::submessages::{ReplyOn, UNUSED_MSG_ID}; - use crate::{coins, from_slice, to_vec, ContractResult}; + use crate::{coins, from_json, to_json_vec, ContractResult}; #[test] fn response_add_attributes_works() { - let res = Response::::new().add_attributes(std::iter::empty::()); + let res = Response::::new().add_attributes(core::iter::empty::()); assert_eq!(res.attributes.len(), 0); let res = Response::::new().add_attributes([Attribute::new("test", "ing")]); @@ -261,11 +284,11 @@ mod tests { assert_eq!(res.attributes, attrs); let optional = Option::::None; - let res: Response = Response::new().add_attributes(optional.into_iter()); + let res: Response = Response::new().add_attributes(optional); assert_eq!(res.attributes.len(), 0); let optional = Option::::Some(Attribute::new("test", "ing")); - let res: Response = Response::new().add_attributes(optional.into_iter()); + let res: Response = Response::new().add_attributes(optional); assert_eq!(res.attributes.len(), 1); assert_eq!( res.attributes[0], @@ -282,6 +305,7 @@ mod tests { messages: vec![ SubMsg { id: 12, + payload: Binary::new(vec![9, 8, 7, 6, 5]), msg: BankMsg::Send { to_address: String::from("checker"), amount: coins(888, "moon"), @@ -292,6 +316,7 @@ mod tests { }, SubMsg { id: UNUSED_MSG_ID, + payload: Binary::default(), msg: BankMsg::Send { to_address: String::from("you"), amount: coins(1015, "earth"), @@ -308,8 +333,8 @@ mod tests { events: vec![], data: Some(Binary::from([0xAA, 0xBB])), }; - let serialized = to_vec(&original).expect("encode contract result"); - let deserialized: Response = from_slice(&serialized).expect("decode contract result"); + let serialized = to_json_vec(&original).expect("encode contract result"); + let deserialized: Response = from_json(serialized).expect("decode contract result"); assert_eq!(deserialized, original); } @@ -328,4 +353,74 @@ mod tests { assert!(failure.is_err()); assert!(!success.is_err()); } + + // struct implements `Into` + #[derive(Clone)] + struct OurEvent { + msg: String, + } + + // allow define `into` rather than `from` to define `into` clearly + #[allow(clippy::from_over_into)] + impl Into for OurEvent { + fn into(self) -> Event { + Event::new("our_event").add_attribute("msg", self.msg) + } + } + + #[test] + fn add_event_takes_into_event() { + let msg = "message".to_string(); + let our_event = OurEvent { msg }; + let event: Event = our_event.clone().into(); + let actual = Response::::new().add_event(our_event); + let expected = Response::::new().add_event(event); + assert_eq!(expected, actual); + } + + #[test] + fn add_events_takes_into_event() { + let msg1 = "foo".to_string(); + let msg2 = "bare".to_string(); + let our_event1 = OurEvent { msg: msg1 }; + let our_event2 = OurEvent { msg: msg2 }; + let events: Vec = vec![our_event1.clone().into(), our_event2.clone().into()]; + let actual = Response::::new().add_events([our_event1, our_event2]); + let expected = Response::::new().add_events(events); + assert_eq!(expected, actual); + } + + #[test] + fn change_custom_works() { + let response: Response = Response { + messages: vec![SubMsg::new(BankMsg::Send { + to_address: "address".to_string(), + amount: coins(123, "earth"), + })], + attributes: vec![Attribute::new("foo", "bar")], + events: vec![Event::new("our_event").add_attribute("msg", "hello")], + data: None, + }; + let converted_resp: Response = response.clone().change_custom().unwrap(); + assert_eq!( + converted_resp.messages, + vec![SubMsg::new(BankMsg::Send { + to_address: "address".to_string(), + amount: coins(123, "earth"), + })] + ); + assert_eq!(converted_resp.attributes, response.attributes); + assert_eq!(converted_resp.events, response.events); + assert_eq!(converted_resp.data, response.data); + + // response with custom message + let response = Response { + messages: vec![SubMsg::new(CosmosMsg::Custom(Empty {}))], + attributes: vec![Attribute::new("foo", "bar")], + events: vec![Event::new("our_event").add_attribute("msg", "hello")], + data: None, + }; + + assert_eq!(response.change_custom::(), None); + } } diff --git a/packages/std/src/results/submessages.rs b/packages/std/src/results/submessages.rs index 138680c1e3..ee0a990bd8 100644 --- a/packages/std/src/results/submessages.rs +++ b/packages/std/src/results/submessages.rs @@ -1,6 +1,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +use crate::prelude::*; use crate::Binary; use super::{CosmosMsg, Empty, Event}; @@ -8,7 +9,9 @@ use super::{CosmosMsg, Empty, Event}; /// Use this to define when the contract gets a response callback. /// If you only need it for errors or success you can select just those in order /// to save gas. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum ReplyOn { /// Always perform a callback after SubMsg is processed @@ -27,13 +30,32 @@ pub enum ReplyOn { /// Note: On error the submessage execution will revert any partial state changes due to this message, /// but not revert any state changes in the calling contract. If this is required, it must be done /// manually in the `reply` entry point. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct SubMsg { /// An arbitrary ID chosen by the contract. /// This is typically used to match `Reply`s in the `reply` entry point to the submessage. pub id: u64, + /// Some arbitrary data that the contract can set in an application specific way. + /// This is just passed into the `reply` entry point and is not stored to state. + /// Any encoding can be used. If `id` is used to identify a particular action, + /// the encoding can also be different for each of those actions since you can match `id` + /// first and then start processing the `payload`. + /// + /// The environment restricts the length of this field in order to avoid abuse. The limit + /// is environment specific and can change over time. The initial default is 128 KiB. + /// + /// Unset/nil/null cannot be differentiated from empty data. + /// + /// On chains running CosmWasm 1.x this field will be ignored. + #[serde(default)] + pub payload: Binary, pub msg: CosmosMsg, /// Gas limit measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md). + /// + /// Setting this to `None` means unlimited. Then the submessage execution can consume all gas of the + /// current execution context. pub gas_limit: Option, pub reply_on: ReplyOn, } @@ -42,32 +64,50 @@ pub struct SubMsg { pub const UNUSED_MSG_ID: u64 = 0; impl SubMsg { - /// new creates a "fire and forget" message with the pre-0.14 semantics + /// Creates a "fire and forget" message with the pre-0.14 semantics. + /// Since this is just an alias for [`SubMsg::reply_never`] it is somewhat recommended + /// to use the latter in order to make the behaviour more explicit in the caller code. + /// But that's up to you for now. + /// + /// By default, the submessage's gas limit will be unlimited. Use [`SubMsg::with_gas_limit`] to change it. + /// Setting `payload` is not advised as this will never be used. pub fn new(msg: impl Into>) -> Self { - SubMsg { - id: UNUSED_MSG_ID, - msg: msg.into(), - reply_on: ReplyOn::Never, - gas_limit: None, - } + Self::reply_never(msg) } - /// create a `SubMsg` that will provide a `reply` with the given id if the message returns `Ok` + /// Creates a `SubMsg` that will provide a `reply` with the given `id` if the message returns `Ok`. + /// + /// By default, the submessage's `payload` will be empty and the gas limit will be unlimited. Use + /// [`SubMsg::with_payload`] and [`SubMsg::with_gas_limit`] to change those. pub fn reply_on_success(msg: impl Into>, id: u64) -> Self { Self::reply_on(msg.into(), id, ReplyOn::Success) } - /// create a `SubMsg` that will provide a `reply` with the given id if the message returns `Err` + /// Creates a `SubMsg` that will provide a `reply` with the given `id` if the message returns `Err`. + /// + /// By default, the submessage's `payload` will be empty and the gas limit will be unlimited. Use + /// [`SubMsg::with_payload`] and [`SubMsg::with_gas_limit`] to change those. pub fn reply_on_error(msg: impl Into>, id: u64) -> Self { Self::reply_on(msg.into(), id, ReplyOn::Error) } - /// create a `SubMsg` that will always provide a `reply` with the given id + /// Create a `SubMsg` that will always provide a `reply` with the given `id`. + /// + /// By default, the submessage's `payload` will be empty and the gas limit will be unlimited. Use + /// [`SubMsg::with_payload`] and [`SubMsg::with_gas_limit`] to change those. pub fn reply_always(msg: impl Into>, id: u64) -> Self { Self::reply_on(msg.into(), id, ReplyOn::Always) } - /// Add a gas limit to the message. + /// Create a `SubMsg` that will never `reply`. This is equivalent to standard message semantics. + /// + /// By default, the submessage's gas limit will be unlimited. Use [`SubMsg::with_gas_limit`] to change it. + /// Setting `payload` is not advised as this will never be used. + pub fn reply_never(msg: impl Into>) -> Self { + Self::reply_on(msg.into(), UNUSED_MSG_ID, ReplyOn::Never) + } + + /// Add a gas limit to the submessage. /// This gas limit measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md). /// /// ## Examples @@ -85,23 +125,73 @@ impl SubMsg { self } + /// Add a payload to the submessage. + /// + /// ## Examples + /// + /// ``` + /// # use cosmwasm_std::{coins, BankMsg, Binary, ReplyOn, SubMsg}; + /// # let msg = BankMsg::Send { to_address: String::from("you"), amount: coins(1015, "earth") }; + /// let sub_msg: SubMsg = SubMsg::reply_always(msg, 1234) + /// .with_payload(vec![1, 2, 3, 4]); + /// assert_eq!(sub_msg.id, 1234); + /// assert_eq!(sub_msg.payload, Binary::new(vec![1, 2, 3, 4])); + /// assert_eq!(sub_msg.reply_on, ReplyOn::Always); + /// ``` + pub fn with_payload(mut self, payload: impl Into) -> Self { + self.payload = payload.into(); + self + } + fn reply_on(msg: CosmosMsg, id: u64, reply_on: ReplyOn) -> Self { SubMsg { id, + payload: Default::default(), msg, reply_on, gas_limit: None, } } + + /// Convert this [`SubMsg`] to a [`SubMsg`] with a different generic type. + /// This allows easier interactions between code written for a specific chain and + /// code written for multiple chains. + /// If this is a [`CosmosMsg::Custom`] submessage, the function returns `None`. + pub fn change_custom(self) -> Option> { + Some(SubMsg { + id: self.id, + payload: self.payload, + msg: self.msg.change_custom::()?, + gas_limit: self.gas_limit, + reply_on: self.reply_on, + }) + } } /// The result object returned to `reply`. We always get the ID from the submessage /// back and then must handle success and error cases ourselves. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct Reply { /// The ID that the contract set when emitting the `SubMsg`. /// Use this to identify which submessage triggered the `reply`. pub id: u64, + /// Some arbitrary data that the contract set when emitting the `SubMsg`. + /// This is just passed into the `reply` entry point and is not stored to state. + /// + /// Unset/nil/null cannot be differentiated from empty data. + /// + /// On chains running CosmWasm 1.x this field is never filled. + #[serde(default)] + pub payload: Binary, + /// The amount of gas used by the submessage, + /// measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md). + /// + /// This only contains a useful value on chains running CosmWasm 2.0 or higher. + /// On older chains, this field is always 0. + #[serde(default)] + pub gas_used: u64, pub result: SubMsgResult, } @@ -113,36 +203,43 @@ pub struct Reply { /// /// Until version 1.0.0-beta5, `ContractResult` was used instead /// of this type. Once serialized, the two types are the same. However, in the Rust type -/// system we want different types for clarity and documenation reasons. +/// system we want different types for clarity and documentation reasons. /// /// # Examples /// /// Success: /// /// ``` -/// # use cosmwasm_std::{to_vec, Binary, Event, SubMsgResponse, SubMsgResult}; +/// # use cosmwasm_std::{to_json_string, Binary, Event, SubMsgResponse, SubMsgResult}; +/// #[allow(deprecated)] /// let response = SubMsgResponse { /// data: Some(Binary::from_base64("MTIzCg==").unwrap()), -/// events: vec![Event::new("wasm").add_attribute("fo", "ba")], +/// events: vec![Event::new("wasm").add_attribute("foo", "bar")], +/// msg_responses: vec![], /// }; /// let result: SubMsgResult = SubMsgResult::Ok(response); -/// assert_eq!(to_vec(&result).unwrap(), br#"{"ok":{"events":[{"type":"wasm","attributes":[{"key":"fo","value":"ba"}]}],"data":"MTIzCg=="}}"#); +/// assert_eq!( +/// to_json_string(&result).unwrap(), +/// r#"{"ok":{"events":[{"type":"wasm","attributes":[{"key":"foo","value":"bar"}]}],"data":"MTIzCg==","msg_responses":[]}}"#, +/// ); /// ``` /// /// Failure: /// /// ``` -/// # use cosmwasm_std::{to_vec, SubMsgResult, Response}; +/// # use cosmwasm_std::{to_json_string, SubMsgResult, Response}; /// let error_msg = String::from("Something went wrong"); /// let result = SubMsgResult::Err(error_msg); -/// assert_eq!(to_vec(&result).unwrap(), br#"{"error":"Something went wrong"}"#); +/// assert_eq!(to_json_string(&result).unwrap(), r#"{"error":"Something went wrong"}"#); /// ``` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum SubMsgResult { Ok(SubMsgResponse), /// An error type that every custom error created by contract developers can be converted to. - /// This could potientially have more structure, but String is the easiest. + /// This could potentially have more structure, but String is the easiest. #[serde(rename = "error")] Err(String), } @@ -191,80 +288,195 @@ impl From for Result { } } -/// The information we get back from a successful sub message execution, -/// with full Cosmos SDK events. -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +/// The information we get back from a successful sub message execution +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct SubMsgResponse { + /// The Cosmos SDK events emitted by the submessage. + /// + /// This is only filled if the submessage was itself a [`crate::WasmMsg`]. + /// The reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic, + /// so the VM only returns events of wasm messages, which we know are deterministic. + /// + /// [not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events pub events: Vec, + #[deprecated = "Deprecated in the Cosmos SDK in favor of msg_responses. If your chain is running on CosmWasm 2.0 or higher, msg_responses will be filled. For older versions, the data field is still needed since msg_responses is empty in those cases."] pub data: Option, + /// The responses from the messages emitted by the submessage. + /// In most cases, this is equivalent to the Cosmos SDK's [MsgResponses], which usually contains a [single message]. + /// However, wasmd allows chains to translate a single contract message into multiple SDK messages. + /// In that case all the MsgResponses from each are concatenated into this flattened `Vec`. + /// + /// [MsgResponses]: https://github.com/cosmos/cosmos-sdk/blob/316750cc8cd8b3296fa233f4da2e39cbcdc34517/proto/cosmos/base/abci/v1beta1/abci.proto#L106-L109 + /// [single message]: https://github.com/cosmos/cosmos-sdk/blob/v0.50.4/baseapp/baseapp.go#L1020-L1023 + #[serde(default)] + pub msg_responses: Vec, } -#[deprecated(note = "Renamed to SubMsgResponse")] -pub type SubMsgExecutionResponse = SubMsgResponse; +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct MsgResponse { + pub type_url: String, + pub value: Binary, +} #[cfg(test)] +#[allow(deprecated)] mod tests { use super::*; - use crate::{from_slice, to_vec, StdError, StdResult}; + use crate::{ + coins, errors::ErrorKind, from_json, to_json_vec, Attribute, BankMsg, StdError, StdResult, + }; + + #[test] + fn sub_msg_new_works() { + let msg = BankMsg::Send { + to_address: String::from("you"), + amount: coins(1015, "earth"), + }; + let sub_msg: SubMsg = SubMsg::new(msg.clone()); + // id and payload don't matter since there is no reply + assert_eq!(sub_msg.reply_on, ReplyOn::Never); + assert_eq!(sub_msg.gas_limit, None); + assert_eq!(sub_msg.msg, CosmosMsg::from(msg)); + } + + #[test] + fn sub_msg_reply_never_works() { + let msg = BankMsg::Send { + to_address: String::from("you"), + amount: coins(1015, "earth"), + }; + let sub_msg: SubMsg = SubMsg::reply_never(msg.clone()); + // id and payload don't matter since there is no reply + assert_eq!(sub_msg.reply_on, ReplyOn::Never); + assert_eq!(sub_msg.gas_limit, None); + assert_eq!(sub_msg.msg, CosmosMsg::from(msg)); + } + + #[test] + fn sub_msg_reply_always_works() { + let msg = BankMsg::Send { + to_address: String::from("you"), + amount: coins(1015, "earth"), + }; + let sub_msg: SubMsg = SubMsg::reply_always(msg.clone(), 54); + assert_eq!(sub_msg.id, 54); + assert_eq!(sub_msg.payload, Binary::default()); + assert_eq!(sub_msg.reply_on, ReplyOn::Always); + assert_eq!(sub_msg.gas_limit, None); + assert_eq!(sub_msg.msg, CosmosMsg::from(msg)); + } + + #[test] + fn sub_msg_with_gas_limit_works() { + let msg = BankMsg::Send { + to_address: String::from("you"), + amount: coins(1015, "earth"), + }; + let sub_msg: SubMsg = SubMsg::reply_never(msg); + assert_eq!(sub_msg.gas_limit, None); + let sub_msg = sub_msg.with_gas_limit(20); + assert_eq!(sub_msg.gas_limit, Some(20)); + } + + #[test] + fn sub_msg_with_payload_works() { + let msg = BankMsg::Send { + to_address: String::from("you"), + amount: coins(1015, "earth"), + }; + let sub_msg: SubMsg = SubMsg::reply_never(msg); + assert_eq!(sub_msg.payload, Binary::default()); + let sub_msg = sub_msg.with_payload(vec![0xAA, 3, 5, 1, 2]); + assert_eq!(sub_msg.payload, Binary::new(vec![0xAA, 3, 5, 1, 2])); + } #[test] fn sub_msg_result_serialization_works() { let result = SubMsgResult::Ok(SubMsgResponse { data: None, + msg_responses: vec![], events: vec![], }); assert_eq!( - &to_vec(&result).unwrap(), - br#"{"ok":{"events":[],"data":null}}"# + &to_json_vec(&result).unwrap(), + br#"{"ok":{"events":[],"data":null,"msg_responses":[]}}"# ); let result = SubMsgResult::Ok(SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), - events: vec![Event::new("wasm").add_attribute("fo", "ba")], + msg_responses: vec![MsgResponse { + type_url: "URL".to_string(), + value: Binary::from_base64("MTIzCg==").unwrap(), + }], + events: vec![Event::new("wasm").add_attribute("foo", "bar")], }); + println!("{}", &crate::to_json_string(&result).unwrap()); assert_eq!( - &to_vec(&result).unwrap(), - br#"{"ok":{"events":[{"type":"wasm","attributes":[{"key":"fo","value":"ba"}]}],"data":"MTIzCg=="}}"# + &to_json_vec(&result).unwrap(), + br#"{"ok":{"events":[{"type":"wasm","attributes":[{"key":"foo","value":"bar"}]}],"data":"MTIzCg==","msg_responses":[{"type_url":"URL","value":"MTIzCg=="}]}}"# ); let result: SubMsgResult = SubMsgResult::Err("broken".to_string()); - assert_eq!(&to_vec(&result).unwrap(), b"{\"error\":\"broken\"}"); + assert_eq!(&to_json_vec(&result).unwrap(), b"{\"error\":\"broken\"}"); } #[test] fn sub_msg_result_deserialization_works() { - let result: SubMsgResult = from_slice(br#"{"ok":{"events":[],"data":null}}"#).unwrap(); + // should work without `msg_responses` + let result: SubMsgResult = from_json(br#"{"ok":{"events":[]}}"#).unwrap(); assert_eq!( result, SubMsgResult::Ok(SubMsgResponse { events: vec![], data: None, + msg_responses: vec![] + }) + ); + + // should work with `data` and no `msg_responses` + // this is the case for pre-2.0 CosmWasm chains + let result: SubMsgResult = from_json(br#"{"ok":{"events":[],"data":"aGk="}}"#).unwrap(); + assert_eq!( + result, + SubMsgResult::Ok(SubMsgResponse { + events: vec![], + data: Some(Binary::from_base64("aGk=").unwrap()), + msg_responses: vec![] }) ); - let result: SubMsgResult = from_slice( - br#"{"ok":{"events":[{"type":"wasm","attributes":[{"key":"fo","value":"ba"}]}],"data":"MTIzCg=="}}"#).unwrap(); + let result: SubMsgResult = from_json( + br#"{"ok":{"events":[{"type":"wasm","attributes":[{"key":"foo","value":"bar"}]}],"data":"MTIzCg==", + "msg_responses":[{"type_url":"URL","value":"MTIzCg=="}]}}"#).unwrap(); assert_eq!( result, SubMsgResult::Ok(SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), - events: vec![Event::new("wasm").add_attribute("fo", "ba")], + msg_responses: vec![MsgResponse { + type_url: "URL".to_string(), + value: Binary::from_base64("MTIzCg==").unwrap(), + }], + events: vec![Event::new("wasm").add_attribute("foo", "bar")], }) ); - let result: SubMsgResult = from_slice(br#"{"error":"broken"}"#).unwrap(); + let result: SubMsgResult = from_json(br#"{"error":"broken"}"#).unwrap(); assert_eq!(result, SubMsgResult::Err("broken".to_string())); // fails for additional attributes - let parse: StdResult = from_slice(br#"{"unrelated":321,"error":"broken"}"#); - match parse.unwrap_err() { - StdError::ParseErr { .. } => {} - err => panic!("Unexpected error: {:?}", err), + let parse: StdResult = from_json(br#"{"unrelated":321,"error":"broken"}"#); + match parse.unwrap_err().kind() { + ErrorKind::Serialization => {} + err => panic!("Unexpected error: {err:?}"), } - let parse: StdResult = from_slice(br#"{"error":"broken","unrelated":321}"#); - match parse.unwrap_err() { - StdError::ParseErr { .. } => {} - err => panic!("Unexpected error: {:?}", err), + let parse: StdResult = from_json(br#"{"error":"broken","unrelated":321}"#); + match parse.unwrap_err().kind() { + ErrorKind::Serialization => {} + err => panic!("Unexpected error: {err:?}"), } } @@ -272,7 +484,11 @@ mod tests { fn sub_msg_result_unwrap_works() { let response = SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), - events: vec![Event::new("wasm").add_attribute("fo", "ba")], + msg_responses: vec![MsgResponse { + type_url: "URL".to_string(), + value: Binary::from_base64("MTIzCg==").unwrap(), + }], + events: vec![Event::new("wasm").add_attribute("foo", "bar")], }; let success = SubMsgResult::Ok(response.clone()); assert_eq!(success.unwrap(), response); @@ -296,7 +512,8 @@ mod tests { fn sub_msg_result_unwrap_err_panics_for_ok() { let response = SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), - events: vec![Event::new("wasm").add_attribute("fo", "ba")], + events: vec![Event::new("wasm").add_attribute("foo", "bar")], + msg_responses: vec![], }; let success = SubMsgResult::Ok(response); let _ = success.unwrap_err(); @@ -306,7 +523,8 @@ mod tests { fn sub_msg_result_is_ok_works() { let success = SubMsgResult::Ok(SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), - events: vec![Event::new("wasm").add_attribute("fo", "ba")], + events: vec![Event::new("wasm").add_attribute("foo", "bar")], + msg_responses: vec![], }); let failure = SubMsgResult::Err("broken".to_string()); assert!(success.is_ok()); @@ -317,7 +535,8 @@ mod tests { fn sub_msg_result_is_err_works() { let success = SubMsgResult::Ok(SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), - events: vec![Event::new("wasm").add_attribute("fo", "ba")], + events: vec![Event::new("wasm").add_attribute("foo", "bar")], + msg_responses: vec![], }); let failure = SubMsgResult::Err("broken".to_string()); assert!(failure.is_err()); @@ -329,6 +548,7 @@ mod tests { let original: Result = Ok(SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), events: vec![], + msg_responses: vec![], }); let converted: SubMsgResult = original.into(); assert_eq!( @@ -336,14 +556,15 @@ mod tests { SubMsgResult::Ok(SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), events: vec![], + msg_responses: vec![], }) ); - let original: Result = Err(StdError::generic_err("broken")); + let original: Result = Err(StdError::msg("broken")); let converted: SubMsgResult = original.into(); assert_eq!( converted, - SubMsgResult::Err("Generic error: broken".to_string()) + SubMsgResult::Err("kind: Other, error: broken".to_string()) ); } @@ -352,6 +573,7 @@ mod tests { let original = SubMsgResult::Ok(SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), events: vec![], + msg_responses: vec![], }); let converted: Result = original.into(); assert_eq!( @@ -359,6 +581,7 @@ mod tests { Ok(SubMsgResponse { data: Some(Binary::from_base64("MTIzCg==").unwrap()), events: vec![], + msg_responses: vec![], }) ); @@ -366,4 +589,76 @@ mod tests { let converted: Result = original.into(); assert_eq!(converted, Err("went wrong".to_string())); } + + #[test] + fn reply_deserialization_works() { + // 1.x reply without payload (from https://github.com/CosmWasm/cosmwasm/issues/1909) + let reply: Reply = from_json(r#"{"gas_used":4312324,"id":75,"result":{"ok":{"events":[{"type":"hi","attributes":[{"key":"si","value":"claro"}]}],"data":"PwCqXKs="}}}"#).unwrap(); + assert_eq!( + reply, + Reply { + id: 75, + payload: Binary::default(), + gas_used: 4312324, + result: SubMsgResult::Ok(SubMsgResponse { + data: Some(Binary::from_base64("PwCqXKs=").unwrap()), + events: vec![Event { + ty: "hi".to_string(), + attributes: vec![Attribute { + key: "si".to_string(), + value: "claro".to_string(), + }] + }], + msg_responses: vec![], + }) + } + ); + + // with payload (manually added to the above test) + let reply: Reply = from_json(r#"{"gas_used":4312324,"id":75,"payload":"3NxjC5U=","result":{"ok":{"events":[{"type":"hi","attributes":[{"key":"si","value":"claro"}]}],"data":"PwCqXKs="}}}"#).unwrap(); + assert_eq!( + reply, + Reply { + id: 75, + payload: Binary::from_base64("3NxjC5U=").unwrap(), + gas_used: 4312324, + result: SubMsgResult::Ok(SubMsgResponse { + data: Some(Binary::from_base64("PwCqXKs=").unwrap()), + events: vec![Event { + ty: "hi".to_string(), + attributes: vec![Attribute { + key: "si".to_string(), + value: "claro".to_string(), + }] + }], + msg_responses: vec![], + }) + } + ); + } + + #[test] + fn reply_serialization_cosmwasm_1() { + // json coming from wasmvm 1.5.0 + let json = r#"{"id":1234,"result":{"ok":{"events":[{"type":"message","attributes":[{"key":"signer","value":"caller-addr"}]}],"data":"Zm9vYmFy"}}}"#; + + let reply: Reply = from_json(json).unwrap(); + assert_eq!(reply.id, 1234); + assert_eq!(reply.payload, Binary::default()); + assert_eq!( + reply.result, + SubMsgResult::Ok(SubMsgResponse { + data: Some(Binary::from_base64("Zm9vYmFy").unwrap()), + events: vec![Event { + ty: "message".to_string(), + attributes: vec![Attribute { + key: "signer".to_string(), + value: "caller-addr".to_string() + }] + }], + msg_responses: vec![] + }) + ); + assert_eq!(reply.gas_used, 0); + } } diff --git a/packages/std/src/results/system_result.rs b/packages/std/src/results/system_result.rs index 9cc7a48582..332f383fe6 100644 --- a/packages/std/src/results/system_result.rs +++ b/packages/std/src/results/system_result.rs @@ -1,8 +1,9 @@ +use core::fmt; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use std::fmt; -use super::super::errors::SystemError; +use crate::prelude::*; +use crate::SystemError; /// This is the outer result type returned by a querier to the contract. /// @@ -15,21 +16,23 @@ use super::super::errors::SystemError; /// Success: /// /// ``` -/// # use cosmwasm_std::{to_vec, Binary, ContractResult, SystemResult}; +/// # use cosmwasm_std::{to_json_string, Binary, ContractResult, SystemResult}; /// let data = Binary::from(b"hello, world"); /// let result = SystemResult::Ok(ContractResult::Ok(data)); -/// assert_eq!(to_vec(&result).unwrap(), br#"{"ok":{"ok":"aGVsbG8sIHdvcmxk"}}"#); +/// assert_eq!(to_json_string(&result).unwrap(), r#"{"ok":{"ok":"aGVsbG8sIHdvcmxk"}}"#); /// ``` /// /// Failure: /// /// ``` -/// # use cosmwasm_std::{to_vec, Binary, ContractResult, SystemResult, SystemError}; +/// # use cosmwasm_std::{to_json_string, Binary, ContractResult, SystemResult, SystemError}; /// let error = SystemError::Unknown {}; /// let result: SystemResult = SystemResult::Err(error); -/// assert_eq!(to_vec(&result).unwrap(), br#"{"error":{"unknown":{}}}"#); +/// assert_eq!(to_json_string(&result).unwrap(), r#"{"error":{"unknown":{}}}"#); /// ``` -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] #[serde(rename_all = "snake_case")] pub enum SystemResult { Ok(S), diff --git a/packages/std/src/sections.rs b/packages/std/src/sections.rs index 89433f5537..8d613d45ca 100644 --- a/packages/std/src/sections.rs +++ b/packages/std/src/sections.rs @@ -1,4 +1,5 @@ use crate::conversion::force_to_u32; +use crate::prelude::*; /// A sections decoder for the special case of two elements #[allow(dead_code)] // used in Wasm and tests only @@ -37,7 +38,7 @@ pub fn encode_sections(sections: &[&[u8]]) -> Vec { /// Splits data into the last section ("tail") and the rest. /// The tail's length information is cut off, such that it is ready to use. -/// The rest is basically unparsed and contails the lengths of the remaining sections. +/// The rest is basically unparsed and contains the lengths of the remaining sections. /// /// While the tail is copied into a new vector, the rest is only truncated such that /// no re-allocation is necessary. diff --git a/packages/std/src/serde.rs b/packages/std/src/serde.rs index e58a51e6dd..0aae68dece 100644 --- a/packages/std/src/serde.rs +++ b/packages/std/src/serde.rs @@ -2,39 +2,54 @@ // The reason is two fold: // 1. To easily ensure that all calling libraries use the same version (minimize code size) // 2. To allow us to switch out to eg. serde-json-core more easily + use serde::{de::DeserializeOwned, Serialize}; -use std::any::type_name; -use crate::binary::Binary; -use crate::errors::{StdError, StdResult}; +use crate::{Binary, StdResult}; -pub fn from_slice(value: &[u8]) -> StdResult { - serde_json_wasm::from_slice(value).map_err(|e| StdError::parse_err(type_name::(), e)) +/// Deserializes the given JSON bytes to a data structure. +/// +/// Errors if the input is not valid JSON or cannot be deserialized to the given type. +pub fn from_json(value: impl AsRef<[u8]>) -> StdResult { + Ok(serde_json::from_slice(value.as_ref())?) } -pub fn from_binary(value: &Binary) -> StdResult { - from_slice(value.as_slice()) +/// Serializes the given data structure as a JSON byte vector. +pub fn to_json_vec(data: &T) -> StdResult> +where + T: Serialize + ?Sized, +{ + Ok(serde_json::to_vec(data)?) } -pub fn to_vec(data: &T) -> StdResult> +/// Serializes the given data structure as a JSON string. +pub fn to_json_string(data: &T) -> StdResult where T: Serialize + ?Sized, { - serde_json_wasm::to_vec(data).map_err(|e| StdError::serialize_err(type_name::(), e)) + Ok(serde_json::to_string(data)?) } -pub fn to_binary(data: &T) -> StdResult +/// Serializes the given data structure as JSON bytes. +pub fn to_json_binary(data: &T) -> StdResult where T: Serialize + ?Sized, { - to_vec(data).map(Binary) + to_json_vec(data).map(Binary::new) } #[cfg(test)] mod tests { use super::*; + use core::num::{ + NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroU128, NonZeroU16, + NonZeroU32, NonZeroU64, NonZeroU8, + }; + use proptest::{prop_assert_eq, property_test}; use serde::Deserialize; + use crate::msgpack::{from_msgpack, to_msgpack_vec}; + #[derive(Serialize, Deserialize, Debug, PartialEq)] #[serde(rename_all = "snake_case")] enum SomeMsg { @@ -51,9 +66,9 @@ mod tests { } #[test] - fn to_vec_works() { + fn to_json_vec_works() { let msg = SomeMsg::Refund {}; - let serialized = to_vec(&msg).unwrap(); + let serialized = to_json_vec(&msg).unwrap(); assert_eq!(serialized, br#"{"refund":{}}"#); let msg = SomeMsg::ReleaseAll { @@ -62,7 +77,7 @@ mod tests { time: 9007199254740999, // Number.MAX_SAFE_INTEGER + 7 karma: -17, }; - let serialized = String::from_utf8(to_vec(&msg).unwrap()).unwrap(); + let serialized = String::from_utf8(to_json_vec(&msg).unwrap()).unwrap(); assert_eq!( serialized, r#"{"release_all":{"image":"foo","amount":42,"time":9007199254740999,"karma":-17}}"# @@ -70,50 +85,55 @@ mod tests { } #[test] - fn from_slice_works() { - let deserialized: SomeMsg = from_slice(br#"{"refund":{}}"#).unwrap(); + fn from_json_works() { + let deserialized: SomeMsg = from_json(br#"{"refund":{}}"#).unwrap(); assert_eq!(deserialized, SomeMsg::Refund {}); - let deserialized: SomeMsg = from_slice( + let expected = SomeMsg::ReleaseAll { + image: "foo".to_string(), + amount: 42, + time: 18446744073709551615, + karma: -17, + }; + // &[u8] + let deserialized: SomeMsg = from_json( br#"{"release_all":{"image":"foo","amount":42,"time":18446744073709551615,"karma":-17}}"#, ) .unwrap(); - assert_eq!( - deserialized, - SomeMsg::ReleaseAll { - image: "foo".to_string(), - amount: 42, - time: 18446744073709551615, - karma: -17 - } - ); + assert_eq!(deserialized, expected); + + // &str + let deserialized: SomeMsg = from_json( + r#"{"release_all":{"image":"foo","amount":42,"time":18446744073709551615,"karma":-17}}"#, + ) + .unwrap(); + assert_eq!(deserialized, expected); } #[test] - fn from_slice_or_binary() { + fn from_json_or_binary() { let msg = SomeMsg::Refund {}; - let serialized: Binary = to_binary(&msg).unwrap(); + let serialized: Binary = to_json_binary(&msg).unwrap(); - let parse_binary: SomeMsg = from_binary(&serialized).unwrap(); + let parse_binary: SomeMsg = from_json(&serialized).unwrap(); assert_eq!(parse_binary, msg); - let parse_slice: SomeMsg = from_slice(&serialized).unwrap(); + let parse_slice: SomeMsg = from_json(serialized.as_slice()).unwrap(); assert_eq!(parse_slice, msg); } #[test] - fn to_vec_works_for_special_chars() { + fn to_json_vec_works_for_special_chars() { let msg = SomeMsg::Cowsay { text: "foo\"bar\\\"bla".to_string(), }; - let serialized = String::from_utf8(to_vec(&msg).unwrap()).unwrap(); + let serialized = String::from_utf8(to_json_vec(&msg).unwrap()).unwrap(); assert_eq!(serialized, r#"{"cowsay":{"text":"foo\"bar\\\"bla"}}"#); } #[test] - fn from_slice_works_for_special_chars() { - let deserialized: SomeMsg = - from_slice(br#"{"cowsay":{"text":"foo\"bar\\\"bla"}}"#).unwrap(); + fn from_json_works_for_special_chars() { + let deserialized: SomeMsg = from_json(br#"{"cowsay":{"text":"foo\"bar\\\"bla"}}"#).unwrap(); assert_eq!( deserialized, SomeMsg::Cowsay { @@ -121,4 +141,73 @@ mod tests { } ); } + + #[test] + fn to_json_string_works() { + let msg = SomeMsg::Refund {}; + let serialized = to_json_string(&msg).unwrap(); + assert_eq!(serialized, r#"{"refund":{}}"#); + + let msg = SomeMsg::ReleaseAll { + image: "foo".to_string(), + amount: 42, + time: 9007199254740999, // Number.MAX_SAFE_INTEGER + 7 + karma: -17, + }; + let serialized = to_json_string(&msg).unwrap(); + assert_eq!( + serialized, + r#"{"release_all":{"image":"foo","amount":42,"time":9007199254740999,"karma":-17}}"# + ); + } + + macro_rules! test_integer { + ($($ty:ty),+$(,)?) => { + $( + ::paste::paste! { + #[property_test] + fn [](input: $ty) { + let primitive = input.get(); + + // Verify that the serialization is the same as the primitive + let serialized = to_json_string(&input).unwrap(); + let serialized_primitive = to_json_string(&primitive).unwrap(); + prop_assert_eq!(serialized.as_str(), serialized_primitive.as_str()); + + // Verify that the serialized primitive can be deserialized + let deserialized: $ty = from_json(serialized_primitive).unwrap(); + assert_eq!(deserialized, input); + + // Verify that zero is not allowed + assert!(from_json::<$ty>("0").is_err()); + + // Verify that the msgpack encoding is the same as the primitive + let serialized = to_msgpack_vec(&input).unwrap(); + let serialized_primitive = to_msgpack_vec(&primitive).unwrap(); + prop_assert_eq!(serialized.as_slice(), serialized_primitive.as_slice()); + + // Verify that the serialized primitive can be deserialized + let deserialized: $ty = from_msgpack(&serialized_primitive).unwrap(); + prop_assert_eq!(deserialized, input); + } + } + )+ + }; + } + + test_integer! { + NonZeroU8, + NonZeroU16, + NonZeroU32, + NonZeroU64, + NonZeroU128, + } + + test_integer! { + NonZeroI8, + NonZeroI16, + NonZeroI32, + NonZeroI64, + NonZeroI128, + } } diff --git a/packages/std/src/stdack.rs b/packages/std/src/stdack.rs new file mode 100644 index 0000000000..e3c8919901 --- /dev/null +++ b/packages/std/src/stdack.rs @@ -0,0 +1,166 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +use crate::prelude::*; +use crate::to_json_binary; +use crate::Binary; + +/// This is a standard IBC acknowledgement type. IBC application are free +/// to use any acknowledgement format they want. However, for compatibility +/// purposes it is recommended to use this. +/// +/// The original proto definition can be found at +/// and . +/// +/// In contrast to the original idea, [ICS-20](https://github.com/cosmos/ibc/tree/ed849c7bacf16204e9509f0f0df325391f3ce25c/spec/app/ics-020-fungible-token-transfer#technical-specification) and CosmWasm IBC protocols +/// use JSON instead of a protobuf serialization. +/// +/// For compatibility, we use the field name "result" for the success case in JSON. +/// However, all Rust APIs use the term "success" for clarity and discriminability from [Result]. +/// +/// If ibc_receive_packet returns Err(), then x/wasm runtime will rollback the state and +/// return an error message in this format. +/// +/// ## Examples +/// +/// For your convenience, there are success and error constructors. +/// +/// ``` +/// use cosmwasm_std::StdAck; +/// +/// let ack1 = StdAck::success(b"\x01"); // 0x01 is a FungibleTokenPacketSuccess from ICS-20. +/// assert!(ack1.is_success()); +/// +/// let ack2 = StdAck::error("kaputt"); // Some free text error message +/// assert!(ack2.is_error()); +/// ``` +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[serde(rename_all = "snake_case")] +pub enum StdAck { + #[serde(rename = "result")] + Success(Binary), + Error(String), +} + +impl StdAck { + /// Creates a success ack with the given data + pub fn success(data: impl Into) -> Self { + StdAck::Success(data.into()) + } + + /// Creates an error ack + pub fn error(err: impl Into) -> Self { + StdAck::Error(err.into()) + } + + #[must_use = "if you intended to assert that this is a success, consider `.unwrap()` instead"] + #[inline] + pub const fn is_success(&self) -> bool { + matches!(*self, StdAck::Success(_)) + } + + #[must_use = "if you intended to assert that this is an error, consider `.unwrap_err()` instead"] + #[inline] + pub const fn is_error(&self) -> bool { + !self.is_success() + } + + /// Serialized the ack to binary using JSON. This used for setting the acknowledgement + /// field in IbcReceiveResponse. + /// + /// ## Examples + /// + /// Show how the acknowledgement looks on the write: + /// + /// ``` + /// # use cosmwasm_std::StdAck; + /// let ack1 = StdAck::success(b"\x01"); // 0x01 is a FungibleTokenPacketSuccess from ICS-20. + /// assert_eq!(ack1.to_binary(), br#"{"result":"AQ=="}"#); + /// + /// let ack2 = StdAck::error("kaputt"); // Some free text error message + /// assert_eq!(ack2.to_binary(), br#"{"error":"kaputt"}"#); + /// ``` + /// + /// Set acknowledgement field in `IbcReceiveResponse`: + /// + /// ``` + /// use cosmwasm_std::{StdAck, IbcReceiveResponse}; + /// + /// let ack = StdAck::success(b"\x01"); // 0x01 is a FungibleTokenPacketSuccess from ICS-20. + /// + /// let res: IbcReceiveResponse = IbcReceiveResponse::new(ack.to_binary()); + /// let res: IbcReceiveResponse = IbcReceiveResponse::new(ack); // Does the same but consumes the instance + /// ``` + pub fn to_binary(&self) -> Binary { + // We need a non-failing StdAck -> Binary conversion to allow using StdAck in + // `impl Into` arguments. + // Pretty sure this cannot fail. If that changes we can create a non-failing implementation here. + to_json_binary(&self).unwrap() + } + + pub fn unwrap(self) -> Binary { + match self { + StdAck::Success(data) => data, + StdAck::Error(err) => panic!("{}", err), + } + } + + pub fn unwrap_err(self) -> String { + match self { + StdAck::Success(_) => panic!("not an error"), + StdAck::Error(err) => err, + } + } +} + +impl From for Binary { + fn from(original: StdAck) -> Binary { + original.to_binary() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn stdack_success_works() { + let success = StdAck::success(b"foo"); + match success { + StdAck::Success(data) => assert_eq!(data, b"foo"), + StdAck::Error(_err) => panic!("must not be an error"), + } + } + + #[test] + fn stdack_error_works() { + let err = StdAck::error("bar"); + match err { + StdAck::Success(_data) => panic!("must not be a success"), + StdAck::Error(err) => assert_eq!(err, "bar"), + } + } + + #[test] + fn stdack_is_success_is_error_work() { + let success = StdAck::success(b"foo"); + let err = StdAck::error("bar"); + // is_success + assert!(success.is_success()); + assert!(!err.is_success()); + // is_error + assert!(!success.is_error()); + assert!(err.is_error()); + } + + #[test] + fn stdack_to_binary_works() { + let ack1 = StdAck::success(b"\x01"); + assert_eq!(ack1.to_binary(), br#"{"result":"AQ=="}"#); + + let ack2 = StdAck::error("kaputt"); + assert_eq!(ack2.to_binary(), br#"{"error":"kaputt"}"#); + } +} diff --git a/packages/storage/src/length_prefixed.rs b/packages/std/src/storage_keys/length_prefixed.rs similarity index 62% rename from packages/storage/src/length_prefixed.rs rename to packages/std/src/storage_keys/length_prefixed.rs index 5d97b3b419..f8f14c2e77 100644 --- a/packages/storage/src/length_prefixed.rs +++ b/packages/std/src/storage_keys/length_prefixed.rs @@ -1,43 +1,68 @@ -//! This module is an implemention of a namespacing scheme described +//! This module is an implementation of a namespacing scheme described //! in https://github.com/webmaster128/key-namespacing#length-prefixed-keys //! //! Everything in this file is only responsible for building such keys //! and is in no way specific to any kind of storage. +use crate::prelude::*; + /// Calculates the raw key prefix for a given namespace as documented /// in https://github.com/webmaster128/key-namespacing#length-prefixed-keys -pub fn to_length_prefixed(namespace: &[u8]) -> Vec { - let mut out = Vec::with_capacity(namespace.len() + 2); - out.extend_from_slice(&encode_length(namespace)); - out.extend_from_slice(namespace); +pub fn to_length_prefixed(namespace_component: &[u8]) -> Vec { + let mut out = Vec::with_capacity(namespace_component.len() + 2); + out.extend_from_slice(&encode_length(namespace_component)); + out.extend_from_slice(namespace_component); out } /// Calculates the raw key prefix for a given nested namespace /// as documented in https://github.com/webmaster128/key-namespacing#nesting -pub fn to_length_prefixed_nested(namespaces: &[&[u8]]) -> Vec { +pub fn to_length_prefixed_nested(namespace: &[&[u8]]) -> Vec { let mut size = 0; - for &namespace in namespaces { - size += namespace.len() + 2; + for component in namespace { + size += component.len() + 2; } let mut out = Vec::with_capacity(size); - for &namespace in namespaces { - out.extend_from_slice(&encode_length(namespace)); - out.extend_from_slice(namespace); + for component in namespace { + out.extend_from_slice(&encode_length(component)); + out.extend_from_slice(component); } out } -/// Encodes the length of a given namespace as a 2 byte big endian encoded integer -fn encode_length(namespace: &[u8]) -> [u8; 2] { - if namespace.len() > 0xFFFF { - panic!("only supports namespaces up to length 0xFFFF") +/// Encodes the length of a given namespace component +/// as a 2 byte big endian encoded integer +fn encode_length(namespace_component: &[u8]) -> [u8; 2] { + if namespace_component.len() > 0xFFFF { + panic!("only supports namespace components up to length 0xFFFF") } - let length_bytes = (namespace.len() as u32).to_be_bytes(); + let length_bytes = (namespace_component.len() as u32).to_be_bytes(); [length_bytes[2], length_bytes[3]] } +/// Encodes a namespace + key to a raw storage key. +/// +/// This is equivalent concat(to_length_prefixed_nested(namespace), key) +/// but more efficient when the namespace serialization is not persisted because +/// here we only need one vector allocation. +pub fn namespace_with_key(namespace: &[&[u8]], key: &[u8]) -> Vec { + // As documented in docs/STORAGE_KEYS.md, we know the final size of the key, + // which allows us to avoid reallocations of vectors. + let mut size = key.len(); + for component in namespace { + size += 2 /* encoded component length */ + component.len() /* the actual component data */; + } + + let mut out = Vec::with_capacity(size); + for component in namespace { + out.extend_from_slice(&encode_length(component)); + out.extend_from_slice(component); + } + out.extend_from_slice(key); + out +} + #[cfg(test)] mod tests { use super::*; @@ -69,7 +94,7 @@ mod tests { } #[test] - #[should_panic(expected = "only supports namespaces up to length 0xFFFF")] + #[should_panic(expected = "only supports namespace components up to length 0xFFFF")] fn to_length_prefixed_panics_for_too_long_prefix() { let limit = 0xFFFF; let long_namespace = vec![0; limit + 1]; @@ -79,7 +104,7 @@ mod tests { #[test] fn to_length_prefixed_calculates_capacity_correctly() { // Those tests cannot guarantee the required capacity was calculated correctly before - // the vector allocation but increase the likelyhood of a proper implementation. + // the vector allocation but increase the likelihood of a proper implementation. let key = to_length_prefixed(b""); assert_eq!(key.capacity(), key.len()); @@ -108,6 +133,15 @@ mod tests { ); } + #[test] + fn to_length_prefixed_nested_returns_the_same_as_to_length_prefixed_for_one_element() { + let tests = [b"" as &[u8], b"x" as &[u8], b"abababab" as &[u8]]; + + for test in tests { + assert_eq!(to_length_prefixed_nested(&[test]), to_length_prefixed(test)); + } + } + #[test] fn to_length_prefixed_nested_allows_many_long_namespaces() { // The 0xFFFF limit is for each namespace, not for the combination of them @@ -138,7 +172,7 @@ mod tests { #[test] fn to_length_prefixed_nested_calculates_capacity_correctly() { // Those tests cannot guarantee the required capacity was calculated correctly before - // the vector allocation but increase the likelyhood of a proper implementation. + // the vector allocation but increase the likelihood of a proper implementation. let key = to_length_prefixed_nested(&[]); assert_eq!(key.capacity(), key.len()); @@ -169,8 +203,29 @@ mod tests { } #[test] - #[should_panic(expected = "only supports namespaces up to length 0xFFFF")] + #[should_panic(expected = "only supports namespace components up to length 0xFFFF")] fn encode_length_panics_for_large_values() { encode_length(&vec![1; 65536]); } + + #[test] + fn namespace_with_key_works() { + // Empty namespace + let enc = namespace_with_key(&[], b"foo"); + assert_eq!(enc, b"foo"); + let enc = namespace_with_key(&[], b""); + assert_eq!(enc, b""); + + // One component namespace + let enc = namespace_with_key(&[b"bar"], b"foo"); + assert_eq!(enc, b"\x00\x03barfoo"); + let enc = namespace_with_key(&[b"bar"], b""); + assert_eq!(enc, b"\x00\x03bar"); + + // Multi component namespace + let enc = namespace_with_key(&[b"bar", b"cool"], b"foo"); + assert_eq!(enc, b"\x00\x03bar\x00\x04coolfoo"); + let enc = namespace_with_key(&[b"bar", b"cool"], b""); + assert_eq!(enc, b"\x00\x03bar\x00\x04cool"); + } } diff --git a/packages/std/src/storage_keys/mod.rs b/packages/std/src/storage_keys/mod.rs new file mode 100644 index 0000000000..415c2a605e --- /dev/null +++ b/packages/std/src/storage_keys/mod.rs @@ -0,0 +1,9 @@ +mod length_prefixed; +#[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] +mod range; + +// Please note that the entire storage_keys module is public. So be careful +// when adding elements here. +pub use length_prefixed::{namespace_with_key, to_length_prefixed, to_length_prefixed_nested}; +#[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] +pub(crate) use range::{range_to_bounds, ToByteVec}; diff --git a/packages/std/src/storage_keys/range.rs b/packages/std/src/storage_keys/range.rs new file mode 100644 index 0000000000..91b85e4547 --- /dev/null +++ b/packages/std/src/storage_keys/range.rs @@ -0,0 +1,141 @@ +use core::ops::{Bound, RangeBounds}; + +use crate::Binary; + +pub trait ToByteVec { + fn to_byte_vec(&self) -> Vec; +} +impl ToByteVec for Vec { + fn to_byte_vec(&self) -> Vec { + self.clone() + } +} +impl ToByteVec for [u8] { + fn to_byte_vec(&self) -> Vec { + self.to_vec() + } +} +impl ToByteVec for [u8; N] { + fn to_byte_vec(&self) -> Vec { + self.to_vec() + } +} +impl ToByteVec for Binary { + fn to_byte_vec(&self) -> Vec { + self.to_vec() + } +} + +/// Converts any range to start and end bounds for ranging through storage. +/// The start bound is inclusive, the end bound is exclusive. +pub fn range_to_bounds<'a, R, B>(range: &R) -> (Option>, Option>) +where + R: RangeBounds<&'a B>, + B: ToByteVec + 'a + ?Sized, +{ + let start = match range.start_bound() { + Bound::Included(start) => Some(start.to_byte_vec()), + Bound::Excluded(start) => Some(key_after(start.to_byte_vec())), + Bound::Unbounded => None, + }; + let end = match range.end_bound() { + Bound::Included(end) => Some(key_after(end.to_byte_vec())), + Bound::Excluded(end) => Some(end.to_byte_vec()), + Bound::Unbounded => None, + }; + (start, end) +} + +/// Returns the key after the given key. +/// +/// Reuses the given vector. +fn key_after(mut key: Vec) -> Vec { + key.push(0); + key +} + +#[cfg(test)] +mod tests { + use crate::{testing::MockStorage, Order, Storage}; + + use super::*; + + #[test] + fn range_to_bounds_works() { + let mut storage = MockStorage::new(); + + let keys: &[&[u8]] = &[ + &[1, 2, 3], + &[1, 2, 4], + &[1, 2, 5], + &[1, 2, 6], + &[1, 2, 7], + &[1, 2, 7, 0], + &[1, 2, 7, 1], + &[1, 2, 7, 2], + &[1, 2, 8], + &[1, 2, 8, 0], + &[1, 2, 8, 1], + ]; + // map every key to its index + for (i, &key) in keys.iter().enumerate() { + storage.set(key, &[i as u8]); + } + + // check the range between any two keys inside the storage + for (idx0, &key0) in keys.iter().enumerate() { + for (idx1, &key1) in keys.iter().enumerate() { + // key0..key1 should have idx0..idx1 as values + assert_range(&storage, key0..key1, (idx0..idx1).map(|idx| idx as u8)); + + // key0..=key1 should have idx0..=idx1 as values + assert_range(&storage, key0..=key1, (idx0..=idx1).map(|idx| idx as u8)); + } + + // key0.. should have idx0.. as values + assert_range(&storage, key0.., (idx0..keys.len()).map(|idx| idx as u8)); + // ..key0 should have 0..idx0 as values + assert_range(&storage, ..key0, (0..idx0).map(|idx| idx as u8)); + // ..=key0 should have 0..=idx0 as values + assert_range(&storage, ..=key0, (0..=idx0).map(|idx| idx as u8)); + } + + // 0..not_in_storage should have range from start to last key before not_in_storage + let zero: &[u8] = &[0u8]; + let not_in_storage = &[1u8, 2, 7, 3]; + assert_range(&storage, zero..not_in_storage, 0u8..=7); + assert_range(&storage, zero..=not_in_storage, 0u8..=7); + + // 0..after_last_key should have full range + let after_last_key: &[u8] = &[1u8, 2, 8, 2]; + assert_range(&storage, zero..after_last_key, 0u8..keys.len() as u8); + assert_range(&storage, zero..=after_last_key, 0u8..keys.len() as u8); + + // full range + assert_range(&storage, .., 0u8..keys.len() as u8); + + fn assert_range<'a>( + storage: &MockStorage, + range: impl RangeBounds<&'a [u8]>, + expected_values: impl DoubleEndedIterator + Clone, + ) { + let (s, e) = range_to_bounds(&range); + // ascending + let values = storage + .range_values(s.as_deref(), e.as_deref(), Order::Ascending) + .collect::>(); + assert_eq!( + values, + expected_values.clone().map(|v| vec![v]).collect::>() + ); + // descending + let values = storage + .range_values(s.as_deref(), e.as_deref(), Order::Descending) + .collect::>(); + assert_eq!( + values, + expected_values.rev().map(|v| vec![v]).collect::>() + ); + } + } +} diff --git a/packages/std/src/testing/assertions.rs b/packages/std/src/testing/assertions.rs index 3d5cf0a2d8..45d4d874c6 100644 --- a/packages/std/src/testing/assertions.rs +++ b/packages/std/src/testing/assertions.rs @@ -1,5 +1,9 @@ use crate::{Decimal, Uint128}; -use std::str::FromStr as _; + +use alloc::string::String; +#[cfg(test)] +use core::hash::{Hash, Hasher}; +use core::str::FromStr as _; /// Asserts that two expressions are approximately equal to each other. /// @@ -21,6 +25,25 @@ macro_rules! assert_approx_eq { }}; } +/// Tests that type `T` implements `Eq` and `Hash` traits correctly. +/// +/// `left` and `right` must be unequal objects. +/// +/// Some object pairs may produce the same hash causing test failure. +/// In those cases try different objects. The test uses stable hasher +/// so once working pair is identified, the test’s going to continue +/// passing. +#[macro_export] +#[cfg(test)] +macro_rules! assert_hash_works { + ($left:expr, $right:expr $(,)?) => {{ + $crate::testing::assert_hash_works_impl($left, $right, None); + }}; + ($left:expr, $right:expr, $($args:tt)+) => {{ + $crate::testing::assert_hash_works_impl($left, $right, Some(format!($($args)*))); + }}; +} + /// Implementation for the [`cosmwasm_std::assert_approx_eq`] macro. This does not provide any /// stability guarantees and may change any time. #[track_caller] @@ -33,22 +56,71 @@ pub fn assert_approx_eq_impl>( ) { let left = left.into(); let right = right.into(); + + if left == right { + // If both values are equal, we don't need to check the relative difference. + // We check this first to avoid division by zero below. + return; + } + let max_rel_diff = Decimal::from_str(max_rel_diff).unwrap(); - let largest = std::cmp::max(left, right); + let largest = core::cmp::max(left, right); let rel_diff = Decimal::from_ratio(left.abs_diff(right), largest); if rel_diff > max_rel_diff { - match panic_msg { - Some(panic_msg) => panic!( - "assertion failed: `(left ≈ right)`\nleft: {}\nright: {}\nrelative difference: {}\nmax allowed relative difference: {}\n: {}", - left, right, rel_diff, max_rel_diff, panic_msg - ), - None => panic!( - "assertion failed: `(left ≈ right)`\nleft: {}\nright: {}\nrelative difference: {}\nmax allowed relative difference: {}\n", - left, right, rel_diff, max_rel_diff - ), - } + do_panic(format_args!("assertion failed: `(left ≈ right)`\nleft: {left}\nright: {right}\nrelative difference: {rel_diff}\nmax allowed relative difference: {max_rel_diff}"), panic_msg); + } +} + +/// Tests that type `T` implements `Eq` and `Hash` traits correctly. +/// +/// `left` and `right` must be unequal objects. +/// +/// Some object pairs may produce the same hash causing test failure. In those +/// cases try different objects. The test uses stable hasher so once working +/// pair is identified, the test’s going to continue passing. +#[track_caller] +#[doc(hidden)] +#[cfg(test)] +pub fn assert_hash_works_impl(left: T, right: T, panic_msg: Option) { + fn hash(value: &impl Hash) -> u64 { + let mut hasher = crc32fast::Hasher::default(); + value.hash(&mut hasher); + hasher.finish() + } + + // Check clone + #[allow(clippy::redundant_clone)] + let clone = left.clone(); + if left != clone { + do_panic("assertion failed: `left == left.clone()`", panic_msg); + } + if hash(&left) != hash(&clone) { + do_panic( + "assertion failed: `hash(left) == hash(left.clone())`", + panic_msg, + ); + } + + // Check different object + if left == right { + do_panic("assertion failed: `left != right`", panic_msg); + } + if hash(&left) == hash(&right) { + do_panic("assertion failed: `hash(left) != hash(right)`", panic_msg); + } +} + +/// Panics concatenating both arguments. +/// +/// If second argument is `None` panics with just the first argument as message. +/// Otherwise, formats the panic message as `{reason}:\n{panic_msg}`. +#[track_caller] +fn do_panic(reason: impl core::fmt::Display, panic_msg: Option) -> ! { + match panic_msg { + Some(panic_msg) => panic!("{reason}:\n{panic_msg}"), + None => panic!("{reason}"), } } @@ -63,6 +135,11 @@ mod tests { 10_000_000_000_000_000_000_000_000_000_000_000_000_u128, "0.10" ); + assert_approx_eq!(0_u32, 0_u32, "0.12"); + assert_approx_eq!(1_u64, 0_u64, "1"); + assert_approx_eq!(0_u64, 1_u64, "1"); + assert_approx_eq!(5_u64, 0_u64, "1"); + assert_approx_eq!(0_u64, 5_u64, "1"); } #[test] @@ -82,7 +159,7 @@ mod tests { #[test] #[should_panic( - expected = "assertion failed: `(left ≈ right)`\nleft: 8\nright: 10\nrelative difference: 0.2\nmax allowed relative difference: 0.12\n" + expected = "assertion failed: `(left ≈ right)`\nleft: 8\nright: 10\nrelative difference: 0.2\nmax allowed relative difference: 0.12" )] fn assert_approx_fail() { assert_approx_eq!(8_u32, 10_u32, "0.12"); @@ -90,10 +167,11 @@ mod tests { #[test] #[should_panic( - expected = "assertion failed: `(left ≈ right)`\nleft: 17\nright: 20\nrelative difference: 0.15\nmax allowed relative difference: 0.12\n: some extra info about the error: Foo(8)" + expected = "assertion failed: `(left ≈ right)`\nleft: 17\nright: 20\nrelative difference: 0.15\nmax allowed relative difference: 0.12:\nsome extra info about the error: Foo(8)" )] fn assert_approx_with_custom_panic_msg() { let adjective = "extra"; + #[allow(dead_code)] #[derive(Debug)] struct Foo(u32); assert_approx_eq!( diff --git a/packages/std/src/testing/message_info.rs b/packages/std/src/testing/message_info.rs new file mode 100644 index 0000000000..8562d854ed --- /dev/null +++ b/packages/std/src/testing/message_info.rs @@ -0,0 +1,81 @@ +use crate::{Addr, Coin, MessageInfo}; + +/// A constructor function for [`MessageInfo`]. +/// +/// This is designed for writing contract tests. +/// It lives in `cosmwasm_std::testing` because constructing MessageInfo +/// objects is not something that you usually need in contract code. +/// +/// ## Examples +/// +/// ``` +/// # use cosmwasm_std::{DepsMut, Env, Response, MessageInfo, StdResult}; +/// # struct InstantiateMsg { +/// # pub verifier: String, +/// # pub beneficiary: String, +/// # } +/// # pub fn instantiate( +/// # _deps: DepsMut, +/// # _env: Env, +/// # _info: MessageInfo, +/// # _msg: InstantiateMsg, +/// # ) -> StdResult { +/// # Ok(Response::new().add_attribute("action", "instantiate")) +/// # } +/// use cosmwasm_std::coins; +/// use cosmwasm_std::testing::{message_info, mock_dependencies, mock_env}; +/// +/// let mut deps = mock_dependencies(); +/// +/// // Create some Addr instances for testing +/// let creator = deps.api.addr_make("creator"); +/// let verifier = deps.api.addr_make("verifies"); +/// let beneficiary = deps.api.addr_make("benefits"); +/// +/// let msg = InstantiateMsg { +/// verifier: verifier.to_string(), +/// beneficiary: beneficiary.to_string(), +/// }; +/// let info = message_info(&creator, &coins(1000, "earth")); +/// let response = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); +/// assert_eq!(response.messages.len(), 0); +/// ``` +pub fn message_info(sender: &Addr, funds: &[Coin]) -> MessageInfo { + MessageInfo { + sender: sender.clone(), + funds: funds.to_vec(), + } +} + +#[cfg(test)] +mod tests { + use crate::{coins, Uint256}; + + use super::*; + + #[test] + fn message_info_works() { + let addr = Addr::unchecked("cosmwasm1..."); + + let info = message_info(&addr, &[]); + assert_eq!( + info, + MessageInfo { + sender: addr.clone(), + funds: vec![], + } + ); + + let info = message_info(&addr, &coins(123, "foo")); + assert_eq!( + info, + MessageInfo { + sender: addr.clone(), + funds: vec![Coin { + amount: Uint256::new(123), + denom: "foo".to_string(), + }], + } + ); + } +} diff --git a/packages/std/src/testing/mock.rs b/packages/std/src/testing/mock.rs index 8639d8c7b9..55aa0a2c26 100644 --- a/packages/std/src/testing/mock.rs +++ b/packages/std/src/testing/mock.rs @@ -1,40 +1,62 @@ +use crate::prelude::*; +use crate::HashFunction; +use crate::{Addr, CanonicalAddr, Timestamp}; +use alloc::collections::BTreeMap; +#[cfg(feature = "cosmwasm_1_3")] +use alloc::collections::BTreeSet; +use bech32::primitives::decode::CheckedHrpstring; +use bech32::{encode, Bech32, Hrp}; +use core::marker::PhantomData; +#[cfg(feature = "cosmwasm_1_3")] +use core::ops::Bound; +use rand_core::OsRng; use serde::de::DeserializeOwned; -#[cfg(feature = "stargate")] +#[cfg(any(feature = "stargate", feature = "ibc2"))] use serde::Serialize; -use std::collections::HashMap; -use std::marker::PhantomData; +use sha2::{Digest, Sha256}; -use crate::addresses::{Addr, CanonicalAddr}; -use crate::binary::Binary; use crate::coin::Coin; use crate::deps::OwnedDeps; -use crate::errors::{RecoverPubkeyError, StdError, StdResult, SystemError, VerificationError}; #[cfg(feature = "stargate")] use crate::ibc::{ IbcAcknowledgement, IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, IbcEndpoint, IbcOrder, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcTimeoutBlock, }; -use crate::math::Uint128; +#[cfg(feature = "ibc2")] +use crate::ibc2::{ + Ibc2PacketAckMsg, Ibc2PacketReceiveMsg, Ibc2PacketSendMsg, Ibc2PacketTimeoutMsg, Ibc2Payload, +}; #[cfg(feature = "cosmwasm_1_1")] use crate::query::SupplyResponse; -use crate::query::{ - AllBalanceResponse, BalanceResponse, BankQuery, CustomQuery, QueryRequest, WasmQuery, -}; #[cfg(feature = "staking")] use crate::query::{ AllDelegationsResponse, AllValidatorsResponse, BondedDenomResponse, DelegationResponse, FullDelegation, StakingQuery, Validator, ValidatorResponse, }; +use crate::query::{BalanceResponse, BankQuery, CustomQuery, QueryRequest, WasmQuery}; +#[cfg(feature = "cosmwasm_1_3")] +use crate::query::{DelegatorWithdrawAddressResponse, DistributionQuery}; use crate::results::{ContractResult, Empty, SystemResult}; -use crate::serde::{from_slice, to_binary}; -use crate::storage::MemoryStorage; -use crate::timestamp::Timestamp; use crate::traits::{Api, Querier, QuerierResult}; -use crate::types::{BlockInfo, ContractInfo, Env, MessageInfo, TransactionInfo}; -use crate::Attribute; +use crate::types::{BlockInfo, ContractInfo, Env, TransactionInfo}; +use crate::{from_json, to_json_binary, Binary, Uint256}; +#[cfg(feature = "cosmwasm_1_3")] +use crate::{ + query::{AllDenomMetadataResponse, DecCoin, DenomMetadataResponse}, + PageRequest, +}; +use crate::{Attribute, DenomMetadata}; +#[cfg(feature = "stargate")] +use crate::{ChannelResponse, IbcQuery, PortIdResponse}; +#[cfg(feature = "cosmwasm_1_4")] +use crate::{Decimal256, DelegationRewardsResponse, DelegatorValidatorsResponse}; +use crate::{RecoverPubkeyError, StdError, StdResult, SystemError, VerificationError}; -pub const MOCK_CONTRACT_ADDR: &str = "cosmos2contract"; +use super::MockStorage; + +pub const MOCK_CONTRACT_ADDR: &str = + "cosmwasm1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922tscp8avs"; /// Creates all external requirements that can be injected for unit tests. /// @@ -71,32 +93,22 @@ pub fn mock_dependencies_with_balances( } } -// Use MemoryStorage implementation (which is valid in non-testcode) -// We can later make simplifications here if needed -pub type MockStorage = MemoryStorage; - -/// Length of canonical addresses created with this API. Contracts should not make any assumtions -/// what this value is. -/// The value here must be restorable with `SHUFFLES_ENCODE` + `SHUFFLES_DECODE` in-shuffles. -const CANONICAL_LENGTH: usize = 54; - -const SHUFFLES_ENCODE: usize = 18; -const SHUFFLES_DECODE: usize = 2; +/// Default prefix used when creating Bech32 encoded address. +const BECH32_PREFIX: &str = "cosmwasm"; -// MockPrecompiles zero pads all human addresses to make them fit the canonical_length +// MockApi zero pads all human addresses to make them fit the canonical_length // it trims off zeros for the reverse operation. -// not really smart, but allows us to see a difference (and consistent length for canonical adddresses) +// not really smart, but allows us to see a difference (and consistent length for canonical addresses) #[derive(Copy, Clone)] pub struct MockApi { - /// Length of canonical addresses created with this API. Contracts should not make any assumtions - /// what this value is. - canonical_length: usize, + /// Prefix used for creating addresses in Bech32 encoding. + bech32_prefix: &'static str, } impl Default for MockApi { fn default() -> Self { MockApi { - canonical_length: CANONICAL_LENGTH, + bech32_prefix: BECH32_PREFIX, } } } @@ -105,65 +117,77 @@ impl Api for MockApi { fn addr_validate(&self, input: &str) -> StdResult { let canonical = self.addr_canonicalize(input)?; let normalized = self.addr_humanize(&canonical)?; - if input != normalized { - return Err(StdError::generic_err( - "Invalid input: address not normalized", - )); + if input != normalized.as_str() { + return Err(StdError::msg("Invalid input: address not normalized")); } - Ok(Addr::unchecked(input)) } fn addr_canonicalize(&self, input: &str) -> StdResult { - // Dummy input validation. This is more sophisticated for formats like bech32, where format and checksum are validated. - if input.len() < 3 { - return Err(StdError::generic_err( - "Invalid input: human address too short", - )); - } - if input.len() > self.canonical_length { - return Err(StdError::generic_err( - "Invalid input: human address too long", - )); + let hrp_str = CheckedHrpstring::new::(input)?; + + if !hrp_str + .hrp() + .as_bytes() + .eq_ignore_ascii_case(self.bech32_prefix.as_bytes()) + { + return Err(StdError::msg("Wrong bech32 prefix")); } - // mimicks formats like hex or bech32 where different casings are valid for one address - let normalized = input.to_lowercase(); + let bytes: Vec = hrp_str.byte_iter().collect(); + validate_length(&bytes)?; + Ok(bytes.into()) + } + + fn addr_humanize(&self, canonical: &CanonicalAddr) -> StdResult { + validate_length(canonical.as_ref())?; - let mut out = Vec::from(normalized); + let prefix = Hrp::parse(self.bech32_prefix)?; + Ok(encode::(prefix, canonical.as_slice()).map(Addr::unchecked)?) + } - // pad to canonical length with NULL bytes - out.resize(self.canonical_length, 0x00); - // content-dependent rotate followed by shuffle to destroy - // the most obvious structure (https://github.com/CosmWasm/cosmwasm/issues/552) - let rotate_by = digit_sum(&out) % self.canonical_length; - out.rotate_left(rotate_by); - for _ in 0..SHUFFLES_ENCODE { - out = riffle_shuffle(&out); - } - Ok(out.into()) + fn bls12_381_aggregate_g1(&self, g1s: &[u8]) -> Result<[u8; 48], VerificationError> { + cosmwasm_crypto::bls12_381_aggregate_g1(g1s).map_err(Into::into) } - fn addr_humanize(&self, canonical: &CanonicalAddr) -> StdResult { - if canonical.len() != self.canonical_length { - return Err(StdError::generic_err( - "Invalid input: canonical address length not correct", - )); - } + fn bls12_381_aggregate_g2(&self, g2s: &[u8]) -> Result<[u8; 96], VerificationError> { + cosmwasm_crypto::bls12_381_aggregate_g2(g2s).map_err(Into::into) + } - let mut tmp: Vec = canonical.clone().into(); - // Shuffle two more times which restored the original value (24 elements are back to original after 20 rounds) - for _ in 0..SHUFFLES_DECODE { - tmp = riffle_shuffle(&tmp); - } - // Rotate back - let rotate_by = digit_sum(&tmp) % self.canonical_length; - tmp.rotate_right(rotate_by); - // Remove NULL bytes (i.e. the padding) - let trimmed = tmp.into_iter().filter(|&x| x != 0x00).collect(); - // decode UTF-8 bytes into string - let human = String::from_utf8(trimmed)?; - Ok(Addr::unchecked(human)) + fn bls12_381_pairing_equality( + &self, + ps: &[u8], + qs: &[u8], + r: &[u8], + s: &[u8], + ) -> Result { + cosmwasm_crypto::bls12_381_pairing_equality(ps, qs, r, s).map_err(Into::into) + } + + fn bls12_381_hash_to_g1( + &self, + hash_function: HashFunction, + msg: &[u8], + dst: &[u8], + ) -> Result<[u8; 48], VerificationError> { + Ok(cosmwasm_crypto::bls12_381_hash_to_g1( + hash_function.into(), + msg, + dst, + )) + } + + fn bls12_381_hash_to_g2( + &self, + hash_function: HashFunction, + msg: &[u8], + dst: &[u8], + ) -> Result<[u8; 96], VerificationError> { + Ok(cosmwasm_crypto::bls12_381_hash_to_g2( + hash_function.into(), + msg, + dst, + )) } fn secp256k1_verify( @@ -190,6 +214,30 @@ impl Api for MockApi { Ok(pubkey.to_vec()) } + fn secp256r1_verify( + &self, + message_hash: &[u8], + signature: &[u8], + public_key: &[u8], + ) -> Result { + Ok(cosmwasm_crypto::secp256r1_verify( + message_hash, + signature, + public_key, + )?) + } + + fn secp256r1_recover_pubkey( + &self, + message_hash: &[u8], + signature: &[u8], + recovery_param: u8, + ) -> Result, RecoverPubkeyError> { + let pubkey = + cosmwasm_crypto::secp256r1_recover_pubkey(message_hash, signature, recovery_param)?; + Ok(pubkey.to_vec()) + } + fn ed25519_verify( &self, message: &[u8], @@ -208,42 +256,302 @@ impl Api for MockApi { public_keys: &[&[u8]], ) -> Result { Ok(cosmwasm_crypto::ed25519_batch_verify( + &mut OsRng, messages, signatures, public_keys, )?) } - fn debug(&self, message: &str) { - println!("{}", message); + fn debug(&self, #[allow(unused)] message: &str) { + println!("{message}"); + } +} + +impl MockApi { + /// Returns [MockApi] with Bech32 prefix set to provided value. + /// + /// Bech32 prefix must not be empty. + /// + /// # Example + /// + /// ``` + /// # use cosmwasm_std::Addr; + /// # use cosmwasm_std::testing::MockApi; + /// # + /// let mock_api = MockApi::default().with_prefix("juno"); + /// let addr = mock_api.addr_make("creator"); + /// + /// assert_eq!(addr.to_string(), "juno1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqsksmtyp"); + /// ``` + pub fn with_prefix(mut self, prefix: &'static str) -> Self { + self.bech32_prefix = prefix; + self + } + + /// Returns an address built from provided input string. + /// + /// # Example + /// + /// ``` + /// # use cosmwasm_std::Addr; + /// # use cosmwasm_std::testing::MockApi; + /// # + /// let mock_api = MockApi::default(); + /// let addr = mock_api.addr_make("creator"); + /// + /// assert_eq!(addr.to_string(), "cosmwasm1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp"); + /// ``` + /// + /// # Panics + /// + /// This function panics when generating a valid address is not possible, + /// especially when Bech32 prefix set in function [with_prefix](Self::with_prefix) is empty. + /// + pub fn addr_make(&self, input: &str) -> Addr { + let digest = Sha256::digest(input); + + let prefix = match Hrp::parse(self.bech32_prefix) { + Ok(prefix) => prefix, + Err(reason) => panic!("Generating address failed with reason: {reason}"), + }; + + match encode::(prefix, &digest) { + Ok(address) => Addr::unchecked(address), + Err(reason) => panic!("Generating address failed with reason: {reason}"), + } + } +} + +/// Does basic validation of the number of bytes in a canonical address +fn validate_length(bytes: &[u8]) -> StdResult<()> { + match bytes.len() { + 1..=255 => Ok(()), + _ => Err(StdError::msg("Invalid canonical address length")), } } -/// Returns a default enviroment with height, time, chain_id, and contract address +/// Returns a default environment with height, time, chain_id, and contract address. /// You can submit as is to most contracts, or modify height/time if you want to /// test for expiration. /// /// This is intended for use in test code only. +/// +/// The contract address uses the same bech32 prefix as [`MockApi`](crate::testing::MockApi). While +/// this is good for the majority of users, you might need to create your `Env`s +/// differently if you need a valid address using a different prefix. +/// +/// ## Examples +/// +/// Create an env: +/// +/// ``` +/// # use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, Timestamp, TransactionInfo}; +/// use cosmwasm_std::testing::mock_env; +/// +/// let env = mock_env(); +/// assert_eq!(env, Env { +/// block: BlockInfo { +/// height: 12_345, +/// time: Timestamp::from_nanos(1_571_797_419_879_305_533), +/// chain_id: "cosmos-testnet-14002".to_string(), +/// }, +/// transaction: Some(TransactionInfo::new(3, Binary::from_hex("E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3").unwrap())), +/// contract: ContractInfo { +/// address: Addr::unchecked("cosmwasm1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922tscp8avs"), +/// }, +/// }); +/// ``` +/// +/// Mutate and reuse environment: +/// +/// ``` +/// # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, Timestamp, TransactionInfo}; +/// use cosmwasm_std::testing::mock_env; +/// +/// let env1 = mock_env(); +/// +/// // First test with `env1` +/// +/// let mut env2 = env1.clone(); +/// env2.block.height += 1; +/// env2.block.time = env1.block.time.plus_seconds(6); +/// +/// // `env2` is one block and 6 seconds later +/// +/// let mut env3 = env2.clone(); +/// env3.block.height += 1; +/// env3.block.time = env2.block.time.plus_nanos(5_500_000_000); +/// +/// // `env3` is one block and 5.5 seconds later +/// ``` pub fn mock_env() -> Env { - Env { - block: BlockInfo { - height: 12_345, - time: Timestamp::from_nanos(1_571_797_419_879_305_533), + let mut envs = Envs::new(BECH32_PREFIX); + envs.make() +} + +/// A factory type that stores chain information such as bech32 prefix and can make mock `Env`s from there. +/// +/// It increments height for each mock call and block time by 5 seconds but is otherwise dumb. +/// +/// In contrast to using `mock_env`, the bech32 prefix must always be specified. +/// +/// ## Examples +/// +/// Typical usage +/// +/// ``` +/// # use cosmwasm_std::Timestamp; +/// use cosmwasm_std::testing::Envs; +/// +/// let mut envs = Envs::new("food"); +/// +/// let env = envs.make(); +/// assert_eq!(env.contract.address.as_str(), "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj"); +/// assert_eq!(env.block.height, 12_345); +/// assert_eq!(env.block.time, Timestamp::from_nanos(1_571_797_419_879_305_533)); +/// +/// let env = envs.make(); +/// assert_eq!(env.contract.address.as_str(), "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj"); +/// assert_eq!(env.block.height, 12_346); +/// assert_eq!(env.block.time, Timestamp::from_nanos(1_571_797_424_879_305_533)); +/// +/// let env = envs.make(); +/// assert_eq!(env.contract.address.as_str(), "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj"); +/// assert_eq!(env.block.height, 12_347); +/// assert_eq!(env.block.time, Timestamp::from_nanos(1_571_797_429_879_305_533)); +/// ``` +/// +/// Or use with iterator +/// +/// ``` +/// # use cosmwasm_std::Timestamp; +/// use cosmwasm_std::testing::Envs; +/// +/// let mut envs = Envs::new("food"); +/// +/// for (index, env) in envs.take(100).enumerate() { +/// assert_eq!(env.contract.address.as_str(), "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj"); +/// assert_eq!(env.block.height, 12_345 + index as u64); +/// assert_eq!(env.block.time, Timestamp::from_nanos(1_571_797_419_879_305_533).plus_seconds((index*5) as u64)); +/// } +/// ``` +pub struct Envs { + chain_id: String, + contract_address: Addr, + /// The number of nanoseconds between two consecutive blocks + block_time: u64, + last_height: u64, + last_time: Timestamp, +} + +/// Options to create an `Envs` instance. +/// +/// ## Examples +/// +/// Must be constructed with the help of `Default` since new options might be added later. +/// +/// ``` +/// # use cosmwasm_std::Timestamp; +/// use cosmwasm_std::testing::{Envs, EnvsOptions}; +/// +/// let mut options = EnvsOptions::default(); +/// options.chain_id = "megachain".to_string(); +/// options.bech32_prefix = "mega"; +/// let mut envs = Envs::with_options(options); +/// +/// let env = envs.make(); +/// assert_eq!(env.block.chain_id, "megachain"); +/// assert_eq!(env.contract.address.as_str(), "mega1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts7vnj8h"); +/// ``` +#[derive(Clone, Debug)] +#[non_exhaustive] +pub struct EnvsOptions { + pub bech32_prefix: &'static str, /* static due to MockApi's Copy requirement. No better idea for now. */ + pub block_time: u64, + // The height before the first `make` call + pub initial_height: u64, + // The block time before the first `make` call + pub initial_time: Timestamp, + pub chain_id: String, +} + +impl Default for EnvsOptions { + fn default() -> Self { + EnvsOptions { + bech32_prefix: BECH32_PREFIX, + block_time: 5_000_000_000, // 5s + initial_height: 12_344, + initial_time: Timestamp::from_nanos(1_571_797_419_879_305_533).minus_seconds(5), chain_id: "cosmos-testnet-14002".to_string(), - }, - transaction: Some(TransactionInfo { index: 3 }), - contract: ContractInfo { - address: Addr::unchecked(MOCK_CONTRACT_ADDR), - }, + } } } -/// Just set sender and funds for the message. -/// This is intended for use in test code only. -pub fn mock_info(sender: &str, funds: &[Coin]) -> MessageInfo { - MessageInfo { - sender: Addr::unchecked(sender), - funds: funds.to_vec(), +impl Envs { + pub fn new(bech32_prefix: &'static str) -> Self { + Self::with_options(EnvsOptions { + bech32_prefix, + ..Default::default() + }) + } + + pub fn with_options(options: EnvsOptions) -> Self { + let api = MockApi::default().with_prefix(options.bech32_prefix); + Envs { + chain_id: options.chain_id, + // Default values here for compatibility with old `mock_env` function. They could be changed to anything else if there is a good reason. + contract_address: api.addr_make("cosmos2contract"), + block_time: options.block_time, + last_height: options.initial_height, + last_time: options.initial_time, + } + } + + pub fn make(&mut self) -> Env { + self.checked_make().unwrap() + } + + fn checked_make(&mut self) -> Option { + let height = self.last_height.checked_add(1)?; + let time = Timestamp::from_nanos(self.last_time.nanos().checked_add(self.block_time)?); + + self.last_height = height; + self.last_time = time; + + Some(Env { + block: BlockInfo { + height, + time, + chain_id: self.chain_id.clone(), + }, + transaction: Some(TransactionInfo::new( + 3, + Binary::from_hex( + "E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3", + ) + .unwrap(), + )), + contract: ContractInfo { + address: self.contract_address.clone(), + }, + }) + } +} + +impl Default for Envs { + fn default() -> Self { + Envs::with_options(EnvsOptions::default()) + } +} + +// The iterator implementation ends in case of overflows to avoid panics. +// Using this is recommended for very long running test suites. +impl Iterator for Envs { + type Item = Env; + + fn next(&mut self) -> Option { + self.checked_make() } } @@ -335,7 +643,7 @@ pub fn mock_ibc_packet_recv( ) -> StdResult { Ok(IbcPacketReceiveMsg::new( IbcPacket { - data: to_binary(data)?, + data: to_json_binary(data)?, src: IbcEndpoint { port_id: "their-port".to_string(), channel_id: "channel-1234".to_string(), @@ -351,18 +659,92 @@ pub fn mock_ibc_packet_recv( } .into(), }, - #[cfg(feature = "ibc3")] Addr::unchecked("relayer"), )) } +/// Creates a Ibc2PacketAckMsg for testing ibc2_packet_ack. You set a few key parameters that are +/// often parsed. If you want to set more, use this as a default and mutate other fields +#[cfg(feature = "ibc2")] +pub fn mock_ibc2_packet_ack(data: &impl Serialize) -> StdResult { + Ok(Ibc2PacketAckMsg::new( + "source_id23".to_string(), + "channel_id23".to_string(), + Ibc2Payload { + source_port: "wasm2srcport".to_string(), + destination_port: "wasm2destport".to_string(), + version: "v2".to_string(), + encoding: "json".to_string(), + value: to_json_binary(data)?, + }, + Binary::new(vec![]), + Addr::unchecked("relayer"), + )) +} + +/// Creates a IbcPacketReceiveMsg for testing ibc_packet_receive. You set a few key parameters that are +/// often parsed. If you want to set more, use this as a default and mutate other fields +#[cfg(feature = "ibc2")] +pub fn mock_ibc2_packet_recv(data: &impl Serialize) -> StdResult { + Ok(Ibc2PacketReceiveMsg::new( + Ibc2Payload { + source_port: "wasm2srcport".to_string(), + destination_port: "wasm2destport".to_string(), + version: "v2".to_string(), + encoding: "json".to_string(), + value: to_json_binary(data)?, + }, + Addr::unchecked("relayer"), + "channel_id23".to_string(), + 42, + )) +} + +/// Creates a Ibc2PacketTimeoutMsg for testing ibc2_packet_timeout. +#[cfg(feature = "ibc2")] +pub fn mock_ibc2_packet_timeout(data: &impl Serialize) -> StdResult { + let payload = Ibc2Payload { + source_port: "wasm2srcport".to_string(), + destination_port: "wasm2destport".to_string(), + version: "v2".to_string(), + encoding: "json".to_string(), + value: to_json_binary(data)?, + }; + Ok(Ibc2PacketTimeoutMsg::new( + payload, + "source_client".to_string(), + "destination_client".to_string(), + 1, + Addr::unchecked("relayer"), + )) +} + +/// Creates a Ibc2PacketTimeoutMsg for testing ibc2_packet_timeout. +#[cfg(feature = "ibc2")] +pub fn mock_ibc2_packet_send(data: &impl Serialize) -> StdResult { + let payload = Ibc2Payload { + source_port: "wasm2srcport".to_string(), + destination_port: "wasm2destport".to_string(), + version: "v2".to_string(), + encoding: "json".to_string(), + value: to_json_binary(data)?, + }; + Ok(Ibc2PacketSendMsg::new( + payload, + "source_client".to_string(), + "destination_client".to_string(), + 1, + Addr::unchecked("signer_contract"), + )) +} + /// Creates a IbcPacket for testing ibc_packet_{ack,timeout}. You set a few key parameters that are /// often parsed. If you want to set more, use this as a default and mutate other fields. /// The difference from mock_ibc_packet_recv is if `my_channel_id` is src or dest. #[cfg(feature = "stargate")] fn mock_ibc_packet(my_channel_id: &str, data: &impl Serialize) -> StdResult { Ok(IbcPacket { - data: to_binary(data)?, + data: to_json_binary(data)?, src: IbcEndpoint { port_id: "their-port".to_string(), channel_id: my_channel_id.into(), @@ -394,25 +776,20 @@ pub fn mock_ibc_packet_ack( Ok(IbcPacketAckMsg::new( ack, packet, - #[cfg(feature = "ibc3")] Addr::unchecked("relayer"), )) } /// Creates a IbcPacketTimeoutMsg for testing ibc_packet_timeout. You set a few key parameters that are /// often parsed. If you want to set more, use this as a default and mutate other fields. -/// The difference from mock_ibc_packet_recv is if `my_channel_id` is src or dest./ +/// The difference from mock_ibc_packet_recv is if `my_channel_id` is src or dest. #[cfg(feature = "stargate")] pub fn mock_ibc_packet_timeout( my_channel_id: &str, data: &impl Serialize, ) -> StdResult { let packet = mock_ibc_packet(my_channel_id, data)?; - Ok(IbcPacketTimeoutMsg::new( - packet, - #[cfg(feature = "ibc3")] - Addr::unchecked("relayer"), - )) + Ok(IbcPacketTimeoutMsg::new(packet, Addr::unchecked("relayer"))) } /// The same type as cosmwasm-std's QuerierResult, but easier to reuse in @@ -422,10 +799,14 @@ pub type MockQuerierCustomHandlerResult = SystemResult>; /// MockQuerier holds an immutable table of bank balances /// and configurable handlers for Wasm queries and custom queries. pub struct MockQuerier { - bank: BankQuerier, + pub bank: BankQuerier, #[cfg(feature = "staking")] - staking: StakingQuerier, + pub staking: StakingQuerier, + #[cfg(feature = "cosmwasm_1_3")] + pub distribution: DistributionQuerier, wasm: WasmQuerier, + #[cfg(feature = "stargate")] + pub ibc: IbcQuerier, /// A handler to handle custom queries. This is set to a dummy handler that /// always errors by default. Update it via `with_custom_handler`. /// @@ -437,9 +818,13 @@ impl MockQuerier { pub fn new(balances: &[(&str, &[Coin])]) -> Self { MockQuerier { bank: BankQuerier::new(balances), + #[cfg(feature = "cosmwasm_1_3")] + distribution: DistributionQuerier::default(), #[cfg(feature = "staking")] staking: StakingQuerier::default(), wasm: WasmQuerier::default(), + #[cfg(feature = "stargate")] + ibc: IbcQuerier::default(), // strange argument notation suggested as a workaround here: https://github.com/rust-lang/rust/issues/41078#issuecomment-294296365 custom_handler: Box::from(|_: &_| -> MockQuerierCustomHandlerResult { SystemResult::Err(SystemError::UnsupportedRequest { @@ -449,35 +834,16 @@ impl MockQuerier { } } - // set a new balance for the given address and return the old balance - pub fn update_balance( - &mut self, - addr: impl Into, - balance: Vec, - ) -> Option> { - self.bank.update_balance(addr, balance) - } - - #[cfg(feature = "staking")] - pub fn update_staking( - &mut self, - denom: &str, - validators: &[crate::query::Validator], - delegations: &[crate::query::FullDelegation], - ) { - self.staking = StakingQuerier::new(denom, validators, delegations); - } - - pub fn update_wasm(&mut self, handler: WH) + pub fn update_wasm(&mut self, handler: WH) where - WH: Fn(&WasmQuery) -> QuerierResult, + WH: Fn(&WasmQuery) -> QuerierResult + 'static, { self.wasm.update_handler(handler) } - pub fn with_custom_handler(mut self, handler: CH) -> Self + pub fn with_custom_handler(mut self, handler: CH) -> Self where - CH: Fn(&C) -> MockQuerierCustomHandlerResult, + CH: Fn(&C) -> MockQuerierCustomHandlerResult + 'static, { self.custom_handler = Box::from(handler); self @@ -492,11 +858,11 @@ impl Default for MockQuerier { impl Querier for MockQuerier { fn raw_query(&self, bin_request: &[u8]) -> QuerierResult { - let request: QueryRequest = match from_slice(bin_request) { + let request: QueryRequest = match from_json(bin_request) { Ok(v) => v, Err(e) => { return SystemResult::Err(SystemError::InvalidRequest { - error: format!("Parsing query request: {}", e), + error: format!("Parsing query request: {e}"), request: bin_request.into(), }) } @@ -512,15 +878,22 @@ impl MockQuerier { QueryRequest::Custom(custom_query) => (*self.custom_handler)(custom_query), #[cfg(feature = "staking")] QueryRequest::Staking(staking_query) => self.staking.query(staking_query), + #[cfg(feature = "cosmwasm_1_3")] + QueryRequest::Distribution(distribution_query) => { + self.distribution.query(distribution_query) + } QueryRequest::Wasm(msg) => self.wasm.query(msg), #[cfg(feature = "stargate")] + #[allow(deprecated)] QueryRequest::Stargate { .. } => SystemResult::Err(SystemError::UnsupportedRequest { kind: "Stargate".to_string(), }), - #[cfg(feature = "stargate")] - QueryRequest::Ibc(_) => SystemResult::Err(SystemError::UnsupportedRequest { - kind: "Ibc".to_string(), + #[cfg(feature = "cosmwasm_2_0")] + QueryRequest::Grpc(_) => SystemResult::Err(SystemError::UnsupportedRequest { + kind: "GRPC".to_string(), }), + #[cfg(feature = "stargate")] + QueryRequest::Ibc(msg) => self.ibc.query(msg), } } } @@ -538,9 +911,9 @@ impl WasmQuerier { Self { handler } } - fn update_handler(&mut self, handler: WH) + fn update_handler(&mut self, handler: WH) where - WH: Fn(&WasmQuery) -> QuerierResult, + WH: Fn(&WasmQuery) -> QuerierResult + 'static, { self.handler = Box::from(handler) } @@ -553,13 +926,26 @@ impl WasmQuerier { impl Default for WasmQuerier { fn default() -> Self { let handler = Box::from(|request: &WasmQuery| -> QuerierResult { - let addr = match request { - WasmQuery::Smart { contract_addr, .. } => contract_addr, - WasmQuery::Raw { contract_addr, .. } => contract_addr, - WasmQuery::ContractInfo { contract_addr, .. } => contract_addr, - } - .clone(); - SystemResult::Err(SystemError::NoSuchContract { addr }) + let err = match request { + WasmQuery::Smart { contract_addr, .. } => SystemError::NoSuchContract { + addr: contract_addr.clone(), + }, + WasmQuery::Raw { contract_addr, .. } => SystemError::NoSuchContract { + addr: contract_addr.clone(), + }, + WasmQuery::ContractInfo { contract_addr, .. } => SystemError::NoSuchContract { + addr: contract_addr.clone(), + }, + #[cfg(feature = "cosmwasm_1_2")] + WasmQuery::CodeInfo { code_id, .. } => { + SystemError::NoSuchCode { code_id: *code_id } + } + #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] + WasmQuery::RawRange { contract_addr, .. } => SystemError::NoSuchContract { + addr: contract_addr.clone(), + }, + }; + SystemResult::Err(err) }); Self::new(handler) } @@ -568,25 +954,30 @@ impl Default for WasmQuerier { #[derive(Clone, Default)] pub struct BankQuerier { #[allow(dead_code)] - /// HashMap - supplies: HashMap, - /// HashMap - balances: HashMap>, + /// BTreeMap + supplies: BTreeMap, + /// A map from address to balance. The address is the String conversion of `Addr`, + /// i.e. the bech32 encoded address. + balances: BTreeMap>, + /// Vec + denom_metadata: BTreeMap, DenomMetadata>, } impl BankQuerier { pub fn new(balances: &[(&str, &[Coin])]) -> Self { - let balances: HashMap<_, _> = balances + let balances: BTreeMap<_, _> = balances .iter() - .map(|(s, c)| (s.to_string(), c.to_vec())) + .map(|(address, balance)| (address.to_string(), balance.to_vec())) .collect(); BankQuerier { supplies: Self::calculate_supplies(&balances), balances, + denom_metadata: BTreeMap::new(), } } + /// set a new balance for the given address and return the old balance pub fn update_balance( &mut self, addr: impl Into, @@ -598,15 +989,22 @@ impl BankQuerier { result } - fn calculate_supplies(balances: &HashMap>) -> HashMap { - let mut supplies = HashMap::new(); + pub fn set_denom_metadata(&mut self, denom_metadata: &[DenomMetadata]) { + self.denom_metadata = denom_metadata + .iter() + .map(|d| (d.base.as_bytes().to_vec(), d.clone())) + .collect(); + } + + fn calculate_supplies(balances: &BTreeMap>) -> BTreeMap { + let mut supplies = BTreeMap::new(); let all_coins = balances.iter().flat_map(|(_, coins)| coins); for coin in all_coins { *supplies .entry(coin.denom.clone()) - .or_insert_with(Uint128::zero) += coin.amount; + .or_insert_with(Uint256::zero) += coin.amount; } supplies @@ -620,14 +1018,14 @@ impl BankQuerier { .supplies .get(denom) .cloned() - .unwrap_or_else(Uint128::zero); + .unwrap_or_else(Uint256::zero); let bank_res = SupplyResponse { amount: Coin { amount, denom: denom.to_string(), }, }; - to_binary(&bank_res).into() + to_json_binary(&bank_res).into() } BankQuery::Balance { address, denom } => { // proper error on not found, serialize result on found @@ -642,14 +1040,117 @@ impl BankQuerier { denom: denom.to_string(), }, }; - to_binary(&bank_res).into() + to_json_binary(&bank_res).into() } - BankQuery::AllBalances { address } => { - // proper error on not found, serialize result on found - let bank_res = AllBalanceResponse { - amount: self.balances.get(address).cloned().unwrap_or_default(), + #[cfg(feature = "cosmwasm_1_3")] + BankQuery::DenomMetadata { denom } => { + let denom_metadata = self.denom_metadata.get(denom.as_bytes()); + match denom_metadata { + Some(m) => { + let metadata_res = DenomMetadataResponse { + metadata: m.clone(), + }; + to_json_binary(&metadata_res).into() + } + None => return SystemResult::Err(SystemError::Unknown {}), + } + } + #[cfg(feature = "cosmwasm_1_3")] + BankQuery::AllDenomMetadata { pagination } => { + let default_pagination = PageRequest { + key: None, + limit: 100, + reverse: false, + }; + let pagination = pagination.as_ref().unwrap_or(&default_pagination); + + // range of all denoms after the given key (or until the key for reverse) + let range = match (pagination.reverse, &pagination.key) { + (_, None) => (Bound::Unbounded, Bound::Unbounded), + (true, Some(key)) => (Bound::Unbounded, Bound::Included(key.as_slice())), + (false, Some(key)) => (Bound::Included(key.as_slice()), Bound::Unbounded), + }; + let iter = self.denom_metadata.range::<[u8], _>(range); + // using dynamic dispatch here to reduce code duplication and since this is only testing code + let iter: Box> = if pagination.reverse { + Box::new(iter.rev()) + } else { + Box::new(iter) + }; + + let mut metadata: Vec<_> = iter + // take the requested amount + 1 to get the next key + .take((pagination.limit.saturating_add(1)) as usize) + .map(|(_, m)| m.clone()) + .collect(); + + // if we took more than requested, remove the last element (the next key), + // otherwise this is the last batch + let next_key = if metadata.len() > pagination.limit as usize { + metadata.pop().map(|m| Binary::from(m.base.as_bytes())) + } else { + None }; - to_binary(&bank_res).into() + + let metadata_res = AllDenomMetadataResponse { metadata, next_key }; + to_json_binary(&metadata_res).into() + } + }; + // system result is always ok in the mock implementation + SystemResult::Ok(contract_result) + } +} + +#[cfg(feature = "stargate")] +#[derive(Clone, Default)] +pub struct IbcQuerier { + port_id: String, + channels: Vec, +} + +#[cfg(feature = "stargate")] +impl IbcQuerier { + /// Create a mock querier where: + /// - port_id is the port the "contract" is bound to + /// - channels are a list of ibc channels + pub fn new(port_id: &str, channels: &[IbcChannel]) -> Self { + IbcQuerier { + port_id: port_id.to_string(), + channels: channels.to_vec(), + } + } + + /// Update the querier's configuration + pub fn update(&mut self, port_id: impl Into, channels: &[IbcChannel]) { + self.port_id = port_id.into(); + self.channels = channels.to_vec(); + } + + pub fn query(&self, request: &IbcQuery) -> QuerierResult { + let contract_result: ContractResult = match request { + IbcQuery::Channel { + channel_id, + port_id, + } => { + let channel = self + .channels + .iter() + .find(|c| match port_id { + Some(p) => c.endpoint.channel_id.eq(channel_id) && c.endpoint.port_id.eq(p), + None => { + c.endpoint.channel_id.eq(channel_id) + && c.endpoint.port_id == self.port_id + } + }) + .cloned(); + let res = ChannelResponse { channel }; + to_json_binary(&res).into() + } + IbcQuery::PortId {} => { + let res = PortIdResponse { + port_id: self.port_id.clone(), + }; + to_json_binary(&res).into() } }; // system result is always ok in the mock implementation @@ -675,19 +1176,31 @@ impl StakingQuerier { } } + /// Update the querier's configuration + pub fn update( + &mut self, + denom: impl Into, + validators: &[Validator], + delegations: &[FullDelegation], + ) { + self.denom = denom.into(); + self.validators = validators.to_vec(); + self.delegations = delegations.to_vec(); + } + pub fn query(&self, request: &StakingQuery) -> QuerierResult { let contract_result: ContractResult = match request { StakingQuery::BondedDenom {} => { let res = BondedDenomResponse { denom: self.denom.clone(), }; - to_binary(&res).into() + to_json_binary(&res).into() } StakingQuery::AllValidators {} => { let res = AllValidatorsResponse { - validators: self.validators.clone(), + validators: self.validators.iter().cloned().map(Into::into).collect(), }; - to_binary(&res).into() + to_json_binary(&res).into() } StakingQuery::Validator { address } => { let validator: Option = self @@ -696,7 +1209,7 @@ impl StakingQuerier { .find(|validator| validator.address == *address) .cloned(); let res = ValidatorResponse { validator }; - to_binary(&res).into() + to_json_binary(&res).into() } StakingQuery::AllDelegations { delegator } => { let delegations: Vec<_> = self @@ -707,7 +1220,7 @@ impl StakingQuerier { .map(|d| d.into()) .collect(); let res = AllDelegationsResponse { delegations }; - to_binary(&res).into() + to_json_binary(&res).into() } StakingQuery::Delegation { delegator, @@ -720,7 +1233,7 @@ impl StakingQuerier { let res = DelegationResponse { delegation: delegation.cloned(), }; - to_binary(&res).into() + to_json_binary(&res).into() } }; // system result is always ok in the mock implementation @@ -728,70 +1241,163 @@ impl StakingQuerier { } } -/// Performs a perfect shuffle (in shuffle) -/// -/// https://en.wikipedia.org/wiki/Riffle_shuffle_permutation#Perfect_shuffles -/// https://en.wikipedia.org/wiki/In_shuffle -/// -/// The number of shuffles required to restore the original order are listed in -/// https://oeis.org/A002326, e.g.: -/// -/// ```ignore -/// 2: 2 -/// 4: 4 -/// 6: 3 -/// 8: 6 -/// 10: 10 -/// 12: 12 -/// 14: 4 -/// 16: 8 -/// 18: 18 -/// 20: 6 -/// 22: 11 -/// 24: 20 -/// 26: 18 -/// 28: 28 -/// 30: 5 -/// 32: 10 -/// 34: 12 -/// 36: 36 -/// 38: 12 -/// 40: 20 -/// 42: 14 -/// 44: 12 -/// 46: 23 -/// 48: 21 -/// 50: 8 -/// 52: 52 -/// 54: 20 -/// 56: 18 -/// 58: 58 -/// 60: 60 -/// 62: 6 -/// 64: 12 -/// 66: 66 -/// 68: 22 -/// 70: 35 -/// 72: 9 -/// 74: 20 -/// ``` -pub fn riffle_shuffle(input: &[T]) -> Vec { - assert!( - input.len() % 2 == 0, - "Method only defined for even number of elements" - ); - let mid = input.len() / 2; - let (left, right) = input.split_at(mid); - let mut out = Vec::::with_capacity(input.len()); - for i in 0..mid { - out.push(right[i].clone()); - out.push(left[i].clone()); - } - out +#[cfg(feature = "cosmwasm_1_3")] +#[derive(Clone, Default)] +pub struct DistributionQuerier { + withdraw_addresses: BTreeMap, + /// Mock of accumulated rewards, indexed first by delegator and then validator address. + rewards: BTreeMap>>, + /// Mock of validators that a delegator has bonded to. + validators: BTreeMap>, } -pub fn digit_sum(input: &[u8]) -> usize { - input.iter().fold(0, |sum, val| sum + (*val as usize)) +#[cfg(feature = "cosmwasm_1_3")] +impl DistributionQuerier { + pub fn new(withdraw_addresses: T) -> Self + where + T: IntoIterator, + { + DistributionQuerier { + withdraw_addresses: withdraw_addresses.into_iter().collect(), + ..Default::default() + } + } + + pub fn set_withdraw_address( + &mut self, + delegator_address: impl Into, + withdraw_address: impl Into, + ) { + self.withdraw_addresses + .insert(delegator_address.into(), withdraw_address.into()); + } + + /// Sets multiple withdraw addresses. + /// + /// This allows passing multiple tuples of `(delegator_address, withdraw_address)`. + /// It does not overwrite existing entries. + pub fn set_withdraw_addresses( + &mut self, + withdraw_addresses: impl IntoIterator, impl Into)>, + ) { + for (d, w) in withdraw_addresses { + self.set_withdraw_address(d, w); + } + } + + pub fn clear_withdraw_addresses(&mut self) { + self.withdraw_addresses.clear(); + } + + /// Sets accumulated rewards for a given validator and delegator pair. + pub fn set_rewards( + &mut self, + validator: impl Into, + delegator: impl Into, + rewards: Vec, + ) { + self.rewards + .entry(delegator.into()) + .or_default() + .insert(validator.into(), rewards); + } + + /// Sets the validators a given delegator has bonded to. + pub fn set_validators( + &mut self, + delegator: impl Into, + validators: impl IntoIterator>, + ) { + self.validators.insert( + delegator.into(), + validators.into_iter().map(Into::into).collect(), + ); + } + + pub fn query(&self, request: &DistributionQuery) -> QuerierResult { + let contract_result: ContractResult = match request { + DistributionQuery::DelegatorWithdrawAddress { delegator_address } => { + let res = DelegatorWithdrawAddressResponse { + withdraw_address: Addr::unchecked( + self.withdraw_addresses + .get(delegator_address) + .unwrap_or(delegator_address), + ), + }; + to_json_binary(&res).into() + } + #[cfg(feature = "cosmwasm_1_4")] + DistributionQuery::DelegationRewards { + delegator_address, + validator_address, + } => { + let res = DelegationRewardsResponse { + rewards: self + .rewards + .get(delegator_address) + .and_then(|v| v.get(validator_address)) + .cloned() + .unwrap_or_default(), + }; + to_json_binary(&res).into() + } + #[cfg(feature = "cosmwasm_1_4")] + DistributionQuery::DelegationTotalRewards { delegator_address } => { + let validator_rewards = self + .validator_rewards(delegator_address) + .unwrap_or_default(); + let res = crate::DelegationTotalRewardsResponse { + total: validator_rewards + .iter() + .fold(BTreeMap::<&str, DecCoin>::new(), |mut acc, rewards| { + for coin in &rewards.reward { + acc.entry(&coin.denom) + .or_insert_with(|| DecCoin { + denom: coin.denom.clone(), + amount: Decimal256::zero(), + }) + .amount += coin.amount; + } + + acc + }) + .into_values() + .collect(), + rewards: validator_rewards, + }; + to_json_binary(&res).into() + } + #[cfg(feature = "cosmwasm_1_4")] + DistributionQuery::DelegatorValidators { delegator_address } => { + let res = DelegatorValidatorsResponse { + validators: self + .validators + .get(delegator_address) + .map(|set| set.iter().cloned().collect()) + .unwrap_or_default(), + }; + to_json_binary(&res).into() + } + }; + // system result is always ok in the mock implementation + SystemResult::Ok(contract_result) + } + + /// Helper method to get all rewards for a given delegator. + #[cfg(feature = "cosmwasm_1_4")] + fn validator_rewards(&self, delegator_address: &str) -> Option> { + let validator_rewards = self.rewards.get(delegator_address)?; + + Some( + validator_rewards + .iter() + .map(|(validator, rewards)| crate::DelegatorReward { + validator_address: validator.clone(), + reward: rewards.clone(), + }) + .collect(), + ) + } } /// Only for test code. This bypasses assertions in new, allowing us to create _* @@ -806,9 +1412,15 @@ pub fn mock_wasmd_attr(key: impl Into, value: impl Into) -> Attr #[cfg(test)] mod tests { use super::*; - use crate::{coin, coins, from_binary, to_binary, ContractInfoResponse, Response}; + #[allow(unused)] + use crate::coins; + #[cfg(feature = "cosmwasm_1_3")] + use crate::DenomUnit; + use crate::{coin, instantiate2_address, ContractInfoResponse, HexBinary, Response, Storage}; #[cfg(feature = "staking")] use crate::{Decimal, Delegation}; + use base64::{engine::general_purpose, Engine}; + use cosmwasm_core::BLS12_381_G1_GENERATOR; use hex_literal::hex; use serde::Deserialize; @@ -817,33 +1429,136 @@ mod tests { const SECP256K1_SIG_HEX: &str = "207082eb2c3dfa0b454e0906051270ba4074ac93760ba9e7110cd9471475111151eb0dbbc9920e72146fb564f99d039802bf6ef2561446eb126ef364d21ee9c4"; const SECP256K1_PUBKEY_HEX: &str = "04051c1ee2190ecfb174bfe4f90763f2b4ff7517b70a2aec1876ebcfd644c4633fb03f3cfbd94b1f376e34592d9d41ccaf640bb751b00a1fadeb0c01157769eb73"; + const SECP256R1_MSG_HASH_HEX: &str = + "5eb28029ebf3c7025ff2fc2f6de6f62aecf6a72139e1cba5f20d11bbef036a7f"; + const SECP256R1_SIG_HEX: &str = "e67a9717ccf96841489d6541f4f6adb12d17b59a6bef847b6183b8fcf16a32eb9ae6ba6d637706849a6a9fc388cf0232d85c26ea0d1fe7437adb48de58364333"; + const SECP256R1_PUBKEY_HEX: &str = "0468229b48c2fe19d3db034e4c15077eb7471a66031f28a980821873915298ba76303e8ee3742a893f78b810991da697083dd8f11128c47651c27a56740a80c24c"; + const ED25519_MSG_HEX: &str = "72"; const ED25519_SIG_HEX: &str = "92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00"; const ED25519_PUBKEY_HEX: &str = "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c"; + // See https://github.com/drand/kyber-bls12381/issues/22 and + // https://github.com/drand/drand/pull/1249 + const DOMAIN_HASH_TO_G2: &[u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_"; + + /// Public key League of Entropy Mainnet (curl -sS https://drand.cloudflare.com/info) + const PK_LEO_MAINNET: [u8; 48] = hex!("868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31"); + + const ETH_BLOCK_HEADER: &[u8] = + include_bytes!("../../../crypto/testdata/eth-headers/1699693797.394876721s.json"); + #[test] - fn mock_info_works() { - let info = mock_info("my name", &coins(100, "atom")); + fn mock_env_works() { + let env = mock_env(); assert_eq!( - info, - MessageInfo { - sender: Addr::unchecked("my name"), - funds: vec![Coin { - amount: 100u128.into(), - denom: "atom".into(), - }] + env, + Env { + block: BlockInfo { + height: 12345, + time: Timestamp::from_nanos(1571797419879305533), + chain_id: "cosmos-testnet-14002".to_string() + }, + transaction: Some(TransactionInfo::new( + 3, + Binary::from_hex( + "E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3" + ) + .unwrap(), + )), + contract: ContractInfo { + address: Addr::unchecked(MOCK_CONTRACT_ADDR) + } } + ) + } + + #[test] + fn envs_works() { + let mut envs = Envs::new("food"); + + let env = envs.make(); + assert_eq!( + env.contract.address.as_str(), + "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj" + ); + assert_eq!(env.block.height, 12_345); + assert_eq!( + env.block.time, + Timestamp::from_nanos(1_571_797_419_879_305_533) + ); + + let env = envs.make(); + assert_eq!( + env.contract.address.as_str(), + "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj" + ); + assert_eq!(env.block.height, 12_346); + assert_eq!( + env.block.time, + Timestamp::from_nanos(1_571_797_424_879_305_533) + ); + + let env = envs.make(); + assert_eq!( + env.contract.address.as_str(), + "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj" + ); + assert_eq!(env.block.height, 12_347); + assert_eq!( + env.block.time, + Timestamp::from_nanos(1_571_797_429_879_305_533) + ); + } + + #[test] + fn envs_implements_iterator() { + let envs = Envs::new("food"); + + let result: Vec<_> = envs.into_iter().take(5).collect(); + + assert_eq!( + result[0].contract.address.as_str(), + "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj" + ); + assert_eq!(result[0].block.height, 12_345); + assert_eq!( + result[0].block.time, + Timestamp::from_nanos(1_571_797_419_879_305_533) + ); + + assert_eq!( + result[4].contract.address.as_str(), + "food1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922ts74yrjj" + ); + assert_eq!(result[4].block.height, 12_349); + assert_eq!( + result[4].block.time, + Timestamp::from_nanos(1_571_797_439_879_305_533) + ); + + // Get a millions envs through iterator + let mut envs = Envs::new("yo"); + let first = envs.next().unwrap(); + let last = envs.take(1_000_000).last().unwrap(); + assert_eq!(first.block.height, 12_345); + assert_eq!(last.block.height, 1_012_345); + assert_eq!( + last.block.time, + first.block.time.plus_seconds(1_000_000 * 5) ); } #[test] fn addr_validate_works() { + // default prefix is 'cosmwasm' let api = MockApi::default(); // valid - let addr = api.addr_validate("foobar123").unwrap(); - assert_eq!(addr, "foobar123"); + let humanized = "cosmwasm1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp"; + let addr = api.addr_validate(humanized).unwrap(); + assert_eq!(addr.as_str(), humanized); // invalid: too short api.addr_validate("").unwrap_err(); @@ -853,57 +1568,224 @@ mod tests { } #[test] - fn addr_canonicalize_works() { + fn addr_canonicalize_works() { + let api = MockApi::default(); + + api.addr_canonicalize( + "cosmwasm1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp", + ) + .unwrap(); + + // is case insensitive + let data1 = api + .addr_canonicalize( + "cosmwasm1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp", + ) + .unwrap(); + let data2 = api + .addr_canonicalize( + "COSMWASM1H34LMPYWH4UPNJDG90CJF4J70AEE6Z8QQFSPUGAMJP42E4Q28KQS8S7VCP", + ) + .unwrap(); + assert_eq!(data1, data2); + } + + #[test] + fn canonicalize_and_humanize_restores_original() { + // create api with 'cosmwasm' prefix + let api = MockApi::default(); + + // normalizes input + let original = + String::from("COSMWASM1H34LMPYWH4UPNJDG90CJF4J70AEE6Z8QQFSPUGAMJP42E4Q28KQS8S7VCP"); + let canonical = api.addr_canonicalize(&original).unwrap(); + let recovered = api.addr_humanize(&canonical).unwrap(); + assert_eq!( + recovered.as_str(), + "cosmwasm1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp" + ); + + // create api with 'juno' prefix + let api = MockApi::default().with_prefix("juno"); + + // long input (Juno contract address) + let original = + String::from("juno1v82su97skv6ucfqvuvswe0t5fph7pfsrtraxf0x33d8ylj5qnrysdvkc95"); + let canonical = api.addr_canonicalize(&original).unwrap(); + let recovered = api.addr_humanize(&canonical).unwrap(); + assert_eq!(recovered.as_str(), original); + } + + #[test] + fn addr_canonicalize_short_input() { + let api = MockApi::default(); + + // empty address should fail + let empty = "cosmwasm1pj90vm"; + assert!(api + .addr_canonicalize(empty) + .unwrap_err() + .to_string() + .contains("Invalid canonical address length")); + + // one byte address should work + let human = "cosmwasm1qqvk2mde"; + assert_eq!(api.addr_canonicalize(human).unwrap().as_ref(), [0u8]); + } + + #[test] + fn addr_canonicalize_long_input() { + let api = MockApi::default(); + let human = + "cosmwasm1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqehqqkz"; + let err = api.addr_canonicalize(human).unwrap_err(); + assert!(err.to_string().contains("Invalid canonical address length")); + } + + #[test] + fn addr_humanize_input_length() { + let api = MockApi::default(); + let input = CanonicalAddr::from(vec![]); + assert!(api + .addr_humanize(&input) + .unwrap_err() + .to_string() + .ends_with("Invalid canonical address length")); + } + + #[test] + fn bls12_381_aggregate_g1_works() { + #[derive(serde::Deserialize)] + struct EthHeader { + public_keys: Vec, + aggregate_pubkey: String, + } + + let api = MockApi::default(); + let header: EthHeader = serde_json::from_slice(ETH_BLOCK_HEADER).unwrap(); + let expected = general_purpose::STANDARD + .decode(header.aggregate_pubkey) + .unwrap(); + + let pubkeys: Vec = header + .public_keys + .into_iter() + .flat_map(|key| general_purpose::STANDARD.decode(key).unwrap()) + .collect(); + let sum = api.bls12_381_aggregate_g1(&pubkeys).unwrap(); + + assert_eq!(expected, sum); + } + + #[test] + fn bls12_381_aggregate_g2_works() { let api = MockApi::default(); - api.addr_canonicalize("foobar123").unwrap(); + let points: Vec = [ + hex!("b6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55"), + hex!("b23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9"), + hex!("948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115"), + ] + .into_iter() + .flatten() + .collect(); - // is case insensitive - let data1 = api.addr_canonicalize("foo123").unwrap(); - let data2 = api.addr_canonicalize("FOO123").unwrap(); - assert_eq!(data1, data2); + let expected = hex!("9683b3e6701f9a4b706709577963110043af78a5b41991b998475a3d3fd62abf35ce03b33908418efc95a058494a8ae504354b9f626231f6b3f3c849dfdeaf5017c4780e2aee1850ceaf4b4d9ce70971a3d2cfcd97b7e5ecf6759f8da5f76d31"); + let sum = api.bls12_381_aggregate_g2(&points).unwrap(); + + assert_eq!(sum, expected); } #[test] - fn canonicalize_and_humanize_restores_original() { + fn bls12_381_pairing_equality_works() { let api = MockApi::default(); - // simple - let original = String::from("shorty"); - let canonical = api.addr_canonicalize(&original).unwrap(); - let recovered = api.addr_humanize(&canonical).unwrap(); - assert_eq!(recovered, original); - - // normalizes input - let original = String::from("CosmWasmChef"); - let canonical = api.addr_canonicalize(&original).unwrap(); - let recovered = api.addr_humanize(&canonical).unwrap(); - assert_eq!(recovered, "cosmwasmchef"); + let dst = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; + let ps = hex!("a491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79ab301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81b53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f"); + let qs: Vec = [ + hex!("0000000000000000000000000000000000000000000000000000000000000000"), + hex!("5656565656565656565656565656565656565656565656565656565656565656"), + hex!("abababababababababababababababababababababababababababababababab"), + ] + .into_iter() + .flat_map(|msg| { + api.bls12_381_hash_to_g2(HashFunction::Sha256, &msg, dst) + .unwrap() + }) + .collect(); + let s = hex!("9104e74b9dfd3ad502f25d6a5ef57db0ed7d9a0e00f3500586d8ce44231212542fcfaf87840539b398bf07626705cf1105d246ca1062c6c2e1a53029a0f790ed5e3cb1f52f8234dc5144c45fc847c0cd37a92d68e7c5ba7c648a8a339f171244"); + + let is_valid = api + .bls12_381_pairing_equality(&ps, &qs, &BLS12_381_G1_GENERATOR, &s) + .unwrap(); + assert!(is_valid); } #[test] - #[should_panic(expected = "address too short")] - fn addr_canonicalize_min_input_length() { + fn bls12_381_hash_to_g1_works() { + // See: ; Section J.9.1 + let api = MockApi::default(); - let human = String::from("1"); - let _ = api.addr_canonicalize(&human).unwrap(); + let msg = b"abc"; + let dst = b"QUUX-V01-CS02-with-BLS12381G1_XMD:SHA-256_SSWU_RO_"; + + let hashed_point = api + .bls12_381_hash_to_g1(HashFunction::Sha256, msg, dst) + .unwrap(); + let mut serialized_expected_compressed = hex!("03567bc5ef9c690c2ab2ecdf6a96ef1c139cc0b2f284dca0a9a7943388a49a3aee664ba5379a7655d3c68900be2f6903"); + // Set the compression tag + serialized_expected_compressed[0] |= 0b1000_0000; + + assert_eq!(hashed_point, serialized_expected_compressed); } #[test] - #[should_panic(expected = "address too long")] - fn addr_canonicalize_max_input_length() { + fn bls12_381_hash_to_g2_works() { let api = MockApi::default(); - let human = - String::from("some-extremely-long-address-not-supported-by-this-api-longer-than-54"); - let _ = api.addr_canonicalize(&human).unwrap(); + let msg = b"abc"; + let dst = b"QUUX-V01-CS02-with-BLS12381G2_XMD:SHA-256_SSWU_RO_"; + + let hashed_point = api + .bls12_381_hash_to_g2(HashFunction::Sha256, msg, dst) + .unwrap(); + let mut serialized_expected_compressed = hex!("139cddbccdc5e91b9623efd38c49f81a6f83f175e80b06fc374de9eb4b41dfe4ca3a230ed250fbe3a2acf73a41177fd802c2d18e033b960562aae3cab37a27ce00d80ccd5ba4b7fe0e7a210245129dbec7780ccc7954725f4168aff2787776e6"); + // Set the compression tag + serialized_expected_compressed[0] |= 0b1000_0000; + + assert_eq!(hashed_point, serialized_expected_compressed); } #[test] - #[should_panic(expected = "length not correct")] - fn addr_humanize_input_length() { + fn bls12_318_pairing_equality_works() { + fn build_bls_message(round: u64, previous_signature: &[u8]) -> Vec { + Sha256::new() + .chain_update(previous_signature) + .chain_update(round.to_be_bytes()) + .finalize() + .to_vec() + } + let api = MockApi::default(); - let input = CanonicalAddr::from(vec![61; 11]); - api.addr_humanize(&input).unwrap(); + + let previous_signature = hex::decode("a609e19a03c2fcc559e8dae14900aaefe517cb55c840f6e69bc8e4f66c8d18e8a609685d9917efbfb0c37f058c2de88f13d297c7e19e0ab24813079efe57a182554ff054c7638153f9b26a60e7111f71a0ff63d9571704905d3ca6df0b031747").unwrap(); + let signature = hex::decode("82f5d3d2de4db19d40a6980e8aa37842a0e55d1df06bd68bddc8d60002e8e959eb9cfa368b3c1b77d18f02a54fe047b80f0989315f83b12a74fd8679c4f12aae86eaf6ab5690b34f1fddd50ee3cc6f6cdf59e95526d5a5d82aaa84fa6f181e42").unwrap(); + let round: u64 = 72785; + + let msg = build_bls_message(round, &previous_signature); + let msg_point = api + .bls12_381_hash_to_g2(HashFunction::Sha256, &msg, DOMAIN_HASH_TO_G2) + .unwrap(); + + let is_valid = api + .bls12_381_pairing_equality( + &BLS12_381_G1_GENERATOR, + &signature, + &PK_LEO_MAINNET, + &msg_point, + ) + .unwrap(); + + assert!(is_valid); } // Basic "works" test. Exhaustive tests on VM's side (packages/vm/src/imports.rs) @@ -984,7 +1866,7 @@ mod tests { let result = api.secp256k1_recover_pubkey(&hash, &signature, 42); match result.unwrap_err() { RecoverPubkeyError::InvalidRecoveryParam => {} - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } @@ -1013,7 +1895,114 @@ mod tests { let result = api.secp256k1_recover_pubkey(&malformed_hash, &signature, recovery_param); match result.unwrap_err() { RecoverPubkeyError::InvalidHashFormat => {} - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), + } + } + + // Basic "works" test. Exhaustive tests on VM's side (packages/vm/src/imports.rs) + #[test] + fn secp256r1_verify_works() { + let api = MockApi::default(); + + let hash = hex::decode(SECP256R1_MSG_HASH_HEX).unwrap(); + let signature = hex::decode(SECP256R1_SIG_HEX).unwrap(); + let public_key = hex::decode(SECP256R1_PUBKEY_HEX).unwrap(); + + assert!(api + .secp256r1_verify(&hash, &signature, &public_key) + .unwrap()); + } + + // Basic "fails" test. Exhaustive tests on VM's side (packages/vm/src/imports.rs) + #[test] + fn secp256r1_verify_fails() { + let api = MockApi::default(); + + let mut hash = hex::decode(SECP256R1_MSG_HASH_HEX).unwrap(); + // alter hash + hash[0] ^= 0x01; + let signature = hex::decode(SECP256R1_SIG_HEX).unwrap(); + let public_key = hex::decode(SECP256R1_PUBKEY_HEX).unwrap(); + + assert!(!api + .secp256r1_verify(&hash, &signature, &public_key) + .unwrap()); + } + + // Basic "errors" test. Exhaustive tests on VM's side (packages/vm/src/imports.rs) + #[test] + fn secp256r1_verify_errs() { + let api = MockApi::default(); + + let hash = hex::decode(SECP256R1_MSG_HASH_HEX).unwrap(); + let signature = hex::decode(SECP256R1_SIG_HEX).unwrap(); + let public_key = vec![]; + + let res = api.secp256r1_verify(&hash, &signature, &public_key); + assert_eq!(res.unwrap_err(), VerificationError::InvalidPubkeyFormat); + } + + #[test] + fn secp256r1_recover_pubkey_works() { + let api = MockApi::default(); + + let hash = hex!("17b03f9f00f6692ccdde485fc63c4530751ef35da6f71336610944b0894fcfb8"); + let signature = hex!("9886ae46c1415c3bc959e82b760ad760aab66885a84e620aa339fdf102465c422bf3a80bc04faa35ebecc0f4864ac02d349f6f126e0f988501b8d3075409a26c"); + let recovery_param = 0; + let expected = hex!("0451f99d2d52d4a6e734484a018b7ca2f895c2929b6754a3a03224d07ae61166ce4737da963c6ef7247fb88d19f9b0c667cac7fe12837fdab88c66f10d3c14cad1"); + + let pubkey = api + .secp256r1_recover_pubkey(&hash, &signature, recovery_param) + .unwrap(); + assert_eq!(pubkey, expected); + } + + #[test] + fn secp256r1_recover_pubkey_fails_for_wrong_recovery_param() { + let api = MockApi::default(); + + let hash = hex!("17b03f9f00f6692ccdde485fc63c4530751ef35da6f71336610944b0894fcfb8"); + let signature = hex!("9886ae46c1415c3bc959e82b760ad760aab66885a84e620aa339fdf102465c422bf3a80bc04faa35ebecc0f4864ac02d349f6f126e0f988501b8d3075409a26c"); + let expected = hex!("0451f99d2d52d4a6e734484a018b7ca2f895c2929b6754a3a03224d07ae61166ce4737da963c6ef7247fb88d19f9b0c667cac7fe12837fdab88c66f10d3c14cad1"); + + // Wrong recovery param leads to different pubkey + let pubkey = api.secp256r1_recover_pubkey(&hash, &signature, 1).unwrap(); + assert_eq!(pubkey.len(), 65); + assert_ne!(pubkey, expected); + + // Invalid recovery param leads to error + let result = api.secp256r1_recover_pubkey(&hash, &signature, 42); + match result.unwrap_err() { + RecoverPubkeyError::InvalidRecoveryParam => {} + err => panic!("Unexpected error: {err:?}"), + } + } + + #[test] + fn secp256r1_recover_pubkey_fails_for_wrong_hash() { + let api = MockApi::default(); + + let hash = hex!("17b03f9f00f6692ccdde485fc63c4530751ef35da6f71336610944b0894fcfb8"); + let signature = hex!("9886ae46c1415c3bc959e82b760ad760aab66885a84e620aa339fdf102465c422bf3a80bc04faa35ebecc0f4864ac02d349f6f126e0f988501b8d3075409a26c"); + let recovery_param = 0; + let expected = hex!("0451f99d2d52d4a6e734484a018b7ca2f895c2929b6754a3a03224d07ae61166ce4737da963c6ef7247fb88d19f9b0c667cac7fe12837fdab88c66f10d3c14cad1"); + + // Wrong hash + let mut corrupted_hash = hash; + corrupted_hash[0] ^= 0x01; + let pubkey = api + .secp256r1_recover_pubkey(&corrupted_hash, &signature, recovery_param) + .unwrap(); + assert_eq!(pubkey.len(), 65); + assert_ne!(pubkey, expected); + + // Malformed hash + let mut malformed_hash = hash.to_vec(); + malformed_hash.push(0x8a); + let result = api.secp256r1_recover_pubkey(&malformed_hash, &signature, recovery_param); + match result.unwrap_err() { + RecoverPubkeyError::InvalidHashFormat => {} + err => panic!("Unexpected error: {err:?}"), } } @@ -1128,7 +2117,7 @@ mod tests { }) .unwrap() .unwrap(); - let res: SupplyResponse = from_binary(&elf).unwrap(); + let res: SupplyResponse = from_json(elf).unwrap(); assert_eq!(res.amount, coin(444, "ELF")); let fly = bank @@ -1137,7 +2126,7 @@ mod tests { }) .unwrap() .unwrap(); - let res: SupplyResponse = from_binary(&fly).unwrap(); + let res: SupplyResponse = from_json(fly).unwrap(); assert_eq!(res.amount, coin(777, "FLY")); // if a denom does not exist, should return zero amount, instead of throwing an error @@ -1147,24 +2136,10 @@ mod tests { }) .unwrap() .unwrap(); - let res: SupplyResponse = from_binary(&atom).unwrap(); + let res: SupplyResponse = from_json(atom).unwrap(); assert_eq!(res.amount, coin(0, "ATOM")); } - #[test] - fn bank_querier_all_balances() { - let addr = String::from("foobar"); - let balance = vec![coin(123, "ELF"), coin(777, "FLY")]; - let bank = BankQuerier::new(&[(&addr, &balance)]); - - let all = bank - .query(&BankQuery::AllBalances { address: addr }) - .unwrap() - .unwrap(); - let res: AllBalanceResponse = from_binary(&all).unwrap(); - assert_eq!(&res.amount, &balance); - } - #[test] fn bank_querier_one_balance() { let addr = String::from("foobar"); @@ -1179,7 +2154,7 @@ mod tests { }) .unwrap() .unwrap(); - let res: BalanceResponse = from_binary(&fly).unwrap(); + let res: BalanceResponse = from_json(fly).unwrap(); assert_eq!(res.amount, coin(777, "FLY")); // missing denom @@ -1190,26 +2165,17 @@ mod tests { }) .unwrap() .unwrap(); - let res: BalanceResponse = from_binary(&miss).unwrap(); + let res: BalanceResponse = from_json(miss).unwrap(); assert_eq!(res.amount, coin(0, "MISS")); } #[test] + #[allow(deprecated)] fn bank_querier_missing_account() { let addr = String::from("foobar"); let balance = vec![coin(123, "ELF"), coin(777, "FLY")]; let bank = BankQuerier::new(&[(&addr, &balance)]); - // all balances on empty account is empty vec - let all = bank - .query(&BankQuery::AllBalances { - address: String::from("elsewhere"), - }) - .unwrap() - .unwrap(); - let res: AllBalanceResponse = from_binary(&all).unwrap(); - assert_eq!(res.amount, vec![]); - // any denom on balances on empty account is empty coin let miss = bank .query(&BankQuery::Balance { @@ -1218,10 +2184,301 @@ mod tests { }) .unwrap() .unwrap(); - let res: BalanceResponse = from_binary(&miss).unwrap(); + let res: BalanceResponse = from_json(miss).unwrap(); assert_eq!(res.amount, coin(0, "ELF")); } + #[cfg(feature = "cosmwasm_1_3")] + #[test] + fn bank_querier_metadata_works() { + let mut bank = BankQuerier::new(&[]); + bank.set_denom_metadata( + &(0..100) + .map(|i| DenomMetadata { + symbol: format!("FOO{i}"), + name: "Foo".to_string(), + description: "Foo coin".to_string(), + denom_units: vec![DenomUnit { + denom: "ufoo".to_string(), + exponent: 8, + aliases: vec!["microfoo".to_string(), "foobar".to_string()], + }], + display: "FOO".to_string(), + base: format!("ufoo{i}"), + uri: "https://foo.bar".to_string(), + uri_hash: "foo".to_string(), + }) + .collect::>(), + ); + + // querying first 10 should work + let res = bank + .query(&BankQuery::AllDenomMetadata { + pagination: Some(PageRequest { + key: None, + limit: 10, + reverse: false, + }), + }) + .unwrap() + .unwrap(); + let res: AllDenomMetadataResponse = from_json(res).unwrap(); + assert_eq!(res.metadata.len(), 10); + assert!(res.next_key.is_some()); + + // querying next 10 should also work + let res2 = bank + .query(&BankQuery::AllDenomMetadata { + pagination: Some(PageRequest { + key: res.next_key, + limit: 10, + reverse: false, + }), + }) + .unwrap() + .unwrap(); + let res2: AllDenomMetadataResponse = from_json(res2).unwrap(); + assert_eq!(res2.metadata.len(), 10); + assert_ne!(res.metadata.last(), res2.metadata.first()); + // should have no overlap + for m in res.metadata { + assert!(!res2.metadata.contains(&m)); + } + + // querying all 100 should work + let res = bank + .query(&BankQuery::AllDenomMetadata { + pagination: Some(PageRequest { + key: None, + limit: 100, + reverse: true, + }), + }) + .unwrap() + .unwrap(); + let res: AllDenomMetadataResponse = from_json(res).unwrap(); + assert_eq!(res.metadata.len(), 100); + assert!(res.next_key.is_none(), "no more data should be available"); + assert_eq!(res.metadata[0].symbol, "FOO99", "should have been reversed"); + + let more_res = bank + .query(&BankQuery::AllDenomMetadata { + pagination: Some(PageRequest { + key: res.next_key, + limit: u32::MAX, + reverse: true, + }), + }) + .unwrap() + .unwrap(); + let more_res: AllDenomMetadataResponse = from_json(more_res).unwrap(); + assert_eq!( + more_res.metadata, res.metadata, + "should be same as previous query" + ); + } + + #[cfg(feature = "cosmwasm_1_3")] + #[test] + fn distribution_querier_delegator_withdraw_address() { + let mut distribution = DistributionQuerier::default(); + distribution.set_withdraw_address("addr0", "withdraw0"); + + let query = DistributionQuery::DelegatorWithdrawAddress { + delegator_address: "addr0".to_string(), + }; + + let res = distribution.query(&query).unwrap().unwrap(); + let res: DelegatorWithdrawAddressResponse = from_json(res).unwrap(); + assert_eq!(res.withdraw_address.as_str(), "withdraw0"); + + let query = DistributionQuery::DelegatorWithdrawAddress { + delegator_address: "addr1".to_string(), + }; + + let res = distribution.query(&query).unwrap().unwrap(); + let res: DelegatorWithdrawAddressResponse = from_json(res).unwrap(); + assert_eq!(res.withdraw_address.as_str(), "addr1"); + } + + #[cfg(feature = "cosmwasm_1_4")] + #[test] + fn distribution_querier_delegator_validators() { + let mut distribution = DistributionQuerier::default(); + distribution.set_validators("addr0", ["valoper1", "valoper2"]); + + let query = DistributionQuery::DelegatorValidators { + delegator_address: "addr0".to_string(), + }; + + let res = distribution.query(&query).unwrap().unwrap(); + let res: DelegatorValidatorsResponse = from_json(res).unwrap(); + assert_eq!(res.validators, ["valoper1", "valoper2"]); + + let query = DistributionQuery::DelegatorValidators { + delegator_address: "addr1".to_string(), + }; + + let res = distribution.query(&query).unwrap().unwrap(); + let res: DelegatorValidatorsResponse = from_json(res).unwrap(); + assert_eq!(res.validators, ([] as [String; 0])); + } + + #[cfg(feature = "cosmwasm_1_4")] + #[test] + fn distribution_querier_delegation_rewards() { + use crate::{Decimal256, DelegationTotalRewardsResponse, DelegatorReward}; + + let mut distribution = DistributionQuerier::default(); + let valoper0_rewards = vec![ + DecCoin::new(Decimal256::from_atomics(1234u128, 0).unwrap(), "uatom"), + DecCoin::new(Decimal256::from_atomics(56781234u128, 4).unwrap(), "utest"), + ]; + distribution.set_rewards("valoper0", "addr0", valoper0_rewards.clone()); + + // both exist / are set + let query = DistributionQuery::DelegationRewards { + delegator_address: "addr0".to_string(), + validator_address: "valoper0".to_string(), + }; + let res = distribution.query(&query).unwrap().unwrap(); + let res: DelegationRewardsResponse = from_json(res).unwrap(); + assert_eq!(res.rewards, valoper0_rewards); + + // delegator does not exist + let query = DistributionQuery::DelegationRewards { + delegator_address: "nonexistent".to_string(), + validator_address: "valoper0".to_string(), + }; + let res = distribution.query(&query).unwrap().unwrap(); + let res: DelegationRewardsResponse = from_json(res).unwrap(); + assert_eq!(res.rewards.len(), 0); + + // validator does not exist + let query = DistributionQuery::DelegationRewards { + delegator_address: "addr0".to_string(), + validator_address: "valopernonexistent".to_string(), + }; + let res = distribution.query(&query).unwrap().unwrap(); + let res: DelegationRewardsResponse = from_json(res).unwrap(); + assert_eq!(res.rewards.len(), 0); + + // add one more validator + let valoper1_rewards = vec![DecCoin::new(Decimal256::one(), "uatom")]; + distribution.set_rewards("valoper1", "addr0", valoper1_rewards.clone()); + + // total rewards + let query = DistributionQuery::DelegationTotalRewards { + delegator_address: "addr0".to_string(), + }; + let res = distribution.query(&query).unwrap().unwrap(); + let res: DelegationTotalRewardsResponse = from_json(res).unwrap(); + assert_eq!( + res.rewards, + vec![ + DelegatorReward { + validator_address: "valoper0".into(), + reward: valoper0_rewards + }, + DelegatorReward { + validator_address: "valoper1".into(), + reward: valoper1_rewards + }, + ] + ); + assert_eq!( + res.total, + [ + DecCoin::new( + Decimal256::from_atomics(1234u128, 0).unwrap() + Decimal256::one(), + "uatom" + ), + // total for utest should still be the same + DecCoin::new(Decimal256::from_atomics(56781234u128, 4).unwrap(), "utest") + ] + ); + } + + #[cfg(feature = "stargate")] + #[test] + fn ibc_querier_channel_existing() { + let chan1 = mock_ibc_channel("channel-0", IbcOrder::Ordered, "ibc"); + let chan2 = mock_ibc_channel("channel-1", IbcOrder::Ordered, "ibc"); + + let ibc = IbcQuerier::new("myport", &[chan1.clone(), chan2]); + + // query existing + let query = &IbcQuery::Channel { + channel_id: "channel-0".to_string(), + port_id: Some("my_port".to_string()), + }; + let raw = ibc.query(query).unwrap().unwrap(); + let chan: ChannelResponse = from_json(raw).unwrap(); + assert_eq!(chan.channel, Some(chan1)); + } + + #[cfg(feature = "stargate")] + #[test] + fn ibc_querier_channel_existing_no_port() { + let chan1 = IbcChannel { + endpoint: IbcEndpoint { + port_id: "myport".to_string(), + channel_id: "channel-0".to_string(), + }, + counterparty_endpoint: IbcEndpoint { + port_id: "their_port".to_string(), + channel_id: "channel-7".to_string(), + }, + order: IbcOrder::Ordered, + version: "ibc".to_string(), + connection_id: "connection-2".to_string(), + }; + let chan2 = mock_ibc_channel("channel-1", IbcOrder::Ordered, "ibc"); + + let ibc = IbcQuerier::new("myport", &[chan1.clone(), chan2]); + + // query existing + let query = &IbcQuery::Channel { + channel_id: "channel-0".to_string(), + port_id: Some("myport".to_string()), + }; + let raw = ibc.query(query).unwrap().unwrap(); + let chan: ChannelResponse = from_json(raw).unwrap(); + assert_eq!(chan.channel, Some(chan1)); + } + + #[cfg(feature = "stargate")] + #[test] + fn ibc_querier_channel_none() { + let chan1 = mock_ibc_channel("channel-0", IbcOrder::Ordered, "ibc"); + let chan2 = mock_ibc_channel("channel-1", IbcOrder::Ordered, "ibc"); + + let ibc = IbcQuerier::new("myport", &[chan1, chan2]); + + // query non-existing + let query = &IbcQuery::Channel { + channel_id: "channel-0".to_string(), + port_id: None, + }; + let raw = ibc.query(query).unwrap().unwrap(); + let chan: ChannelResponse = from_json(raw).unwrap(); + assert_eq!(chan.channel, None); + } + + #[cfg(feature = "stargate")] + #[test] + fn ibc_querier_port() { + let chan1 = mock_ibc_channel("channel-0", IbcOrder::Ordered, "ibc"); + + let ibc = IbcQuerier::new("myport", &[chan1]); + + // query channels matching "myport" (should be none) + let query = &IbcQuery::PortId {}; + let raw = ibc.query(query).unwrap().unwrap(); + let res: PortIdResponse = from_json(raw).unwrap(); + assert_eq!(res.port_id, "myport"); + } + #[cfg(feature = "staking")] #[test] fn staking_querier_all_validators() { @@ -1245,8 +2502,8 @@ mod tests { .query(&StakingQuery::AllValidators {}) .unwrap() .unwrap(); - let vals: AllValidatorsResponse = from_binary(&raw).unwrap(); - assert_eq!(vals.validators, vec![val1, val2]); + let vals: AllValidatorsResponse = from_json(raw).unwrap(); + assert_eq!(vals.validators, vec![val1.into(), val2.into()]); } #[cfg(feature = "staking")] @@ -1276,7 +2533,7 @@ mod tests { .query(&StakingQuery::Validator { address: address1 }) .unwrap() .unwrap(); - let res: ValidatorResponse = from_binary(&raw).unwrap(); + let res: ValidatorResponse = from_json(raw).unwrap(); assert_eq!(res.validator, Some(val1)); // query 2 @@ -1284,7 +2541,7 @@ mod tests { .query(&StakingQuery::Validator { address: address2 }) .unwrap() .unwrap(); - let res: ValidatorResponse = from_binary(&raw).unwrap(); + let res: ValidatorResponse = from_json(raw).unwrap(); assert_eq!(res.validator, Some(val2)); // query non-existent @@ -1294,7 +2551,7 @@ mod tests { }) .unwrap() .unwrap(); - let res: ValidatorResponse = from_binary(&raw).unwrap(); + let res: ValidatorResponse = from_json(raw).unwrap(); assert_eq!(res.validator, None); } @@ -1310,7 +2567,7 @@ mod tests { }) .unwrap() .unwrap(); - let dels: AllDelegationsResponse = from_binary(&raw).unwrap(); + let dels: AllDelegationsResponse = from_json(raw).unwrap(); dels.delegations } @@ -1328,7 +2585,7 @@ mod tests { }) .unwrap() .unwrap(); - let dels: DelegationResponse = from_binary(&raw).unwrap(); + let dels: DelegationResponse = from_json(raw).unwrap(); dels.delegation } @@ -1423,7 +2680,7 @@ mod tests { let any_addr = "foo".to_string(); - // Query WasmQuery::Raw + // By default, querier errors for WasmQuery::Raw let system_err = querier .query(&WasmQuery::Raw { contract_addr: any_addr.clone(), @@ -1432,10 +2689,10 @@ mod tests { .unwrap_err(); match system_err { SystemError::NoSuchContract { addr } => assert_eq!(addr, any_addr), - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } - // Query WasmQuery::Smart + // By default, querier errors for WasmQuery::Smart let system_err = querier .query(&WasmQuery::Smart { contract_addr: any_addr.clone(), @@ -1444,10 +2701,10 @@ mod tests { .unwrap_err(); match system_err { SystemError::NoSuchContract { addr } => assert_eq!(addr, any_addr), - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } - // Query WasmQuery::ContractInfo + // By default, querier errors for WasmQuery::ContractInfo let system_err = querier .query(&WasmQuery::ContractInfo { contract_addr: any_addr.clone(), @@ -1455,19 +2712,55 @@ mod tests { .unwrap_err(); match system_err { SystemError::NoSuchContract { addr } => assert_eq!(addr, any_addr), - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), + } + + #[cfg(feature = "cosmwasm_1_2")] + { + // By default, querier errors for WasmQuery::CodeInfo + let system_err = querier + .query(&WasmQuery::CodeInfo { code_id: 4 }) + .unwrap_err(); + match system_err { + SystemError::NoSuchCode { code_id } => assert_eq!(code_id, 4), + err => panic!("Unexpected error: {err:?}"), + } + } + + #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] + { + // By default, querier errors for WasmQuery::RawRange + let system_err = querier + .query(&WasmQuery::RawRange { + contract_addr: any_addr.clone(), + start: None, + end: None, + limit: 10, + order: crate::Order::Ascending, + }) + .unwrap_err(); + match system_err { + SystemError::NoSuchContract { addr } => assert_eq!(addr, any_addr), + err => panic!("Unexpected error: {err:?}"), + } } querier.update_handler(|request| { - let constract1 = Addr::unchecked("contract1"); - let mut storage1 = HashMap::::default(); - storage1.insert(b"the key".into(), b"the value".into()); + let api = MockApi::default(); + let contract1 = api.addr_make("contract1"); + let mut storage1 = MockStorage::new(); + storage1.set(b"the key", b"the value"); match request { WasmQuery::Raw { contract_addr, key } => { - if *contract_addr == constract1 { + let Ok(addr) = api.addr_validate(contract_addr) else { + return SystemResult::Err(SystemError::NoSuchContract { + addr: contract_addr.clone(), + }); + }; + if addr == contract1 { if let Some(value) = storage1.get(key) { - SystemResult::Ok(ContractResult::Ok(value.clone())) + SystemResult::Ok(ContractResult::Ok(Binary::new(value))) } else { SystemResult::Ok(ContractResult::Ok(Binary::default())) } @@ -1478,17 +2771,22 @@ mod tests { } } WasmQuery::Smart { contract_addr, msg } => { - if *contract_addr == constract1 { + let Ok(addr) = api.addr_validate(contract_addr) else { + return SystemResult::Err(SystemError::NoSuchContract { + addr: contract_addr.clone(), + }); + }; + if addr == contract1 { #[derive(Deserialize)] struct MyMsg {} - let _msg: MyMsg = match from_binary(msg) { + let _msg: MyMsg = match from_json(msg) { Ok(msg) => msg, Err(err) => { return SystemResult::Ok(ContractResult::Err(err.to_string())) } }; let response: Response = Response::new().set_data(b"good"); - SystemResult::Ok(ContractResult::Ok(to_binary(&response).unwrap())) + SystemResult::Ok(ContractResult::Ok(to_json_binary(&response).unwrap())) } else { SystemResult::Err(SystemError::NoSuchContract { addr: contract_addr.clone(), @@ -1496,15 +2794,80 @@ mod tests { } } WasmQuery::ContractInfo { contract_addr } => { - if *contract_addr == constract1 { + let Ok(addr) = api.addr_validate(contract_addr) else { + return SystemResult::Err(SystemError::NoSuchContract { + addr: contract_addr.clone(), + }); + }; + if addr == contract1 { let response = ContractInfoResponse { code_id: 4, - creator: "lalala".into(), + creator: Addr::unchecked("lalala"), admin: None, pinned: false, ibc_port: None, + ibc2_port: None, + }; + SystemResult::Ok(ContractResult::Ok(to_json_binary(&response).unwrap())) + } else { + SystemResult::Err(SystemError::NoSuchContract { + addr: contract_addr.clone(), + }) + } + } + #[cfg(feature = "cosmwasm_1_2")] + WasmQuery::CodeInfo { code_id } => { + use crate::{Checksum, CodeInfoResponse}; + let code_id = *code_id; + if code_id == 4 { + let response = CodeInfoResponse { + code_id, + creator: Addr::unchecked("lalala"), + checksum: Checksum::from_hex( + "84cf20810fd429caf58898c3210fcb71759a27becddae08dbde8668ea2f4725d", + ) + .unwrap(), + }; + SystemResult::Ok(ContractResult::Ok(to_json_binary(&response).unwrap())) + } else { + SystemResult::Err(SystemError::NoSuchCode { code_id }) + } + } + #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] + WasmQuery::RawRange { + contract_addr, + start, + end, + limit, + order, + } => { + let Ok(addr) = api.addr_validate(contract_addr) else { + return SystemResult::Err(SystemError::NoSuchContract { + addr: contract_addr.clone(), + }); + }; + if addr == contract1 { + let mut data: Vec<_> = storage1 + .range( + start.as_ref().map(Binary::as_slice), + end.as_ref().map(Binary::as_slice), + *order, + ) + .take(*limit as usize + 1) // take one more entry than limit + .map(|(key, value)| (Binary::new(key), Binary::new(value))) + .collect(); + + // if we have more than limit, there are more entries to fetch + let next_key = if data.len() > *limit as usize { + data.pop().map(|(key, _)| key) + } else { + None }; - SystemResult::Ok(ContractResult::Ok(to_binary(&response).unwrap())) + let raw_range_response = crate::RawRangeResponse { data, next_key }; + + SystemResult::Ok(ContractResult::Ok( + to_json_binary(&raw_range_response).unwrap(), + )) } else { SystemResult::Err(SystemError::NoSuchContract { addr: contract_addr.clone(), @@ -1514,27 +2877,30 @@ mod tests { } }); + let contract_addr = MockApi::default().addr_make("contract1"); + // WasmQuery::Raw let result = querier.query(&WasmQuery::Raw { - contract_addr: "contract1".into(), + contract_addr: contract_addr.clone().into(), key: b"the key".into(), }); + match result { SystemResult::Ok(ContractResult::Ok(value)) => assert_eq!(value, b"the value" as &[u8]), - res => panic!("Unexpected result: {:?}", res), + res => panic!("Unexpected result: {res:?}"), } let result = querier.query(&WasmQuery::Raw { - contract_addr: "contract1".into(), + contract_addr: contract_addr.clone().into(), key: b"other key".into(), }); match result { SystemResult::Ok(ContractResult::Ok(value)) => assert_eq!(value, b"" as &[u8]), - res => panic!("Unexpected result: {:?}", res), + res => panic!("Unexpected result: {res:?}"), } // WasmQuery::Smart let result = querier.query(&WasmQuery::Smart { - contract_addr: "contract1".into(), + contract_addr: contract_addr.clone().into(), msg: b"{}".into(), }); match result { @@ -1542,78 +2908,145 @@ mod tests { value, br#"{"messages":[],"attributes":[],"events":[],"data":"Z29vZA=="}"# as &[u8] ), - res => panic!("Unexpected result: {:?}", res), + res => panic!("Unexpected result: {res:?}"), } let result = querier.query(&WasmQuery::Smart { - contract_addr: "contract1".into(), + contract_addr: contract_addr.clone().into(), msg: b"a broken request".into(), }); match result { SystemResult::Ok(ContractResult::Err(err)) => { - assert_eq!(err, "Error parsing into type cosmwasm_std::testing::mock::tests::wasm_querier_works::{{closure}}::MyMsg: Invalid type") + assert_eq!( + err, + "kind: Serialization, error: expected value at line 1 column 1" + ) } - res => panic!("Unexpected result: {:?}", res), + res => panic!("Unexpected result: {res:?}"), } // WasmQuery::ContractInfo let result = querier.query(&WasmQuery::ContractInfo { - contract_addr: "contract1".into(), + contract_addr: contract_addr.clone().into(), }); match result { SystemResult::Ok(ContractResult::Ok(value)) => assert_eq!( value, - br#"{"code_id":4,"creator":"lalala","admin":null,"pinned":false,"ibc_port":null}"# + br#"{"code_id":4,"creator":"lalala","admin":null,"pinned":false,"ibc_port":null,"ibc2_port":null}"# as &[u8] ), - res => panic!("Unexpected result: {:?}", res), + res => panic!("Unexpected result: {res:?}"), } - } - #[test] - fn riffle_shuffle_works() { - // Example from https://en.wikipedia.org/wiki/In_shuffle - let start = [0xA, 0x2, 0x3, 0x4, 0x5, 0x6]; - let round1 = riffle_shuffle(&start); - assert_eq!(round1, [0x4, 0xA, 0x5, 0x2, 0x6, 0x3]); - let round2 = riffle_shuffle(&round1); - assert_eq!(round2, [0x2, 0x4, 0x6, 0xA, 0x3, 0x5]); - let round3 = riffle_shuffle(&round2); - assert_eq!(round3, start); - - // For 14 elements, the original order is restored after 4 executions - // See https://en.wikipedia.org/wiki/In_shuffle#Mathematics and https://oeis.org/A002326 - let original = [12, 33, 76, 576, 0, 44, 1, 14, 78, 99, 871212, -7, 2, -1]; - let mut result = Vec::from(original); - for _ in 0..4 { - result = riffle_shuffle(&result); + // WasmQuery::CodeInfo + #[cfg(feature = "cosmwasm_1_2")] + { + let result = querier.query(&WasmQuery::CodeInfo { code_id: 4 }); + match result { + SystemResult::Ok(ContractResult::Ok(value)) => assert_eq!( + value, + br#"{"code_id":4,"creator":"lalala","checksum":"84cf20810fd429caf58898c3210fcb71759a27becddae08dbde8668ea2f4725d"}"# + ), + res => panic!("Unexpected result: {res:?}"), + } } - assert_eq!(result, original); - // For 24 elements, the original order is restored after 20 executions - let original = [ - 7, 4, 2, 4656, 23, 45, 23, 1, 12, 76, 576, 0, 12, 1, 14, 78, 99, 12, 1212, 444, 31, - 111, 424, 34, - ]; - let mut result = Vec::from(original); - for _ in 0..20 { - result = riffle_shuffle(&result); + #[cfg(all(feature = "cosmwasm_3_0", feature = "iterator"))] + { + let result = querier.query(&WasmQuery::RawRange { + contract_addr: contract_addr.clone().into(), + start: Some(Binary::from(b"the key")), + end: Some(Binary::from(b"the keyasdf")), + limit: 10, + order: crate::Order::Ascending, + }); + match result { + SystemResult::Ok(ContractResult::Ok(value)) => assert_eq!( + value.as_slice(), + br#"{"data":[["dGhlIGtleQ==","dGhlIHZhbHVl"]],"next_key":null}"# + ), + res => panic!("Unexpected result: {res:?}"), + } } - assert_eq!(result, original); } #[test] - fn digit_sum_works() { - assert_eq!(digit_sum(&[]), 0); - assert_eq!(digit_sum(&[0]), 0); - assert_eq!(digit_sum(&[0, 0]), 0); - assert_eq!(digit_sum(&[0, 0, 0]), 0); + fn making_an_address_works() { + let mock_api = MockApi::default(); + + assert_eq!( + mock_api.addr_make("creator").to_string(), + "cosmwasm1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp", + ); + + assert_eq!( + mock_api.addr_make("").to_string(), + "cosmwasm1uwcvgs5clswpfxhm7nyfjmaeysn6us0yvjdexn9yjkv3k7zjhp2sly4xh9", + ); + + let mock_api = MockApi::default().with_prefix("juno"); + assert_eq!( + mock_api.addr_make("creator").to_string(), + "juno1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqsksmtyp", + ); + } + + #[test] + fn colon_in_prefix_is_valid() { + let mock_api = MockApi::default().with_prefix("did:com:"); + let addr = mock_api + .addr_validate("did:com:1jkf0kmeyefvyzpwf56m7sne2000ay53r6upttu") + .unwrap(); + + assert_eq!( + addr.as_str(), + "did:com:1jkf0kmeyefvyzpwf56m7sne2000ay53r6upttu" + ); + } + + #[test] + #[should_panic( + expected = "Generating address failed with reason: hrp is empty, must have at least 1 character" + )] + fn making_an_address_with_empty_prefix_should_panic() { + MockApi::default().with_prefix("").addr_make("creator"); + } - assert_eq!(digit_sum(&[1, 0, 0]), 1); - assert_eq!(digit_sum(&[0, 1, 0]), 1); - assert_eq!(digit_sum(&[0, 0, 1]), 1); + #[test] + #[cfg(feature = "cosmwasm_1_3")] + fn distribution_querier_new_works() { + let addresses = [ + ("addr0000".to_string(), "addr0001".to_string()), + ("addr0002".to_string(), "addr0001".to_string()), + ]; + let btree_map = BTreeMap::from(addresses.clone()); + + // should still work with HashMap + let hashmap = std::collections::HashMap::from(addresses.clone()); + let querier = DistributionQuerier::new(hashmap); + assert_eq!(querier.withdraw_addresses, btree_map); + + // should work with BTreeMap + let querier = DistributionQuerier::new(btree_map.clone()); + assert_eq!(querier.withdraw_addresses, btree_map); - assert_eq!(digit_sum(&[1, 2, 3]), 6); + // should work with array + let querier = DistributionQuerier::new(addresses); + assert_eq!(querier.withdraw_addresses, btree_map); + } + + #[test] + fn instantiate2_address_can_be_humanized() { + let mock_api = MockApi::default(); - assert_eq!(digit_sum(&[255, 1]), 256); + let contract_addr = mock_api + .addr_canonicalize(mock_api.addr_make("contract").as_str()) + .unwrap(); + let checksum = + HexBinary::from_hex("9af782a3a1bcbcd22dbb6a45c751551d9af782a3a1bcbcd22dbb6a45c751551d") + .unwrap(); + let salt = b"instance 1231"; + let canonical_addr = instantiate2_address(&checksum, &contract_addr, salt).unwrap(); + // we are not interested in the exact humanization, just that it works + mock_api.addr_humanize(&canonical_addr).unwrap(); } } diff --git a/packages/std/src/testing/mod.rs b/packages/std/src/testing/mod.rs index b317d61c48..59adaaf736 100644 --- a/packages/std/src/testing/mod.rs +++ b/packages/std/src/testing/mod.rs @@ -4,16 +4,27 @@ // Both unit tests and integration tests are compiled to native code, so everything in here does not need to compile to Wasm. mod assertions; +mod message_info; mod mock; +mod storage; pub use assertions::assert_approx_eq_impl; +#[cfg(test)] +pub use assertions::assert_hash_works_impl; +pub use message_info::message_info; +#[cfg(feature = "cosmwasm_1_3")] +pub use mock::DistributionQuerier; #[cfg(feature = "staking")] pub use mock::StakingQuerier; pub use mock::{ - digit_sum, mock_dependencies, mock_dependencies_with_balance, mock_dependencies_with_balances, - mock_env, mock_info, mock_wasmd_attr, riffle_shuffle, BankQuerier, MockApi, MockQuerier, - MockQuerierCustomHandlerResult, MockStorage, MOCK_CONTRACT_ADDR, + mock_dependencies, mock_dependencies_with_balance, mock_dependencies_with_balances, mock_env, + mock_wasmd_attr, BankQuerier, Envs, EnvsOptions, MockApi, MockQuerier, + MockQuerierCustomHandlerResult, MOCK_CONTRACT_ADDR, +}; +#[cfg(feature = "ibc2")] +pub use mock::{ + mock_ibc2_packet_ack, mock_ibc2_packet_recv, mock_ibc2_packet_send, mock_ibc2_packet_timeout, }; #[cfg(feature = "stargate")] pub use mock::{ @@ -21,3 +32,5 @@ pub use mock::{ mock_ibc_channel_connect_ack, mock_ibc_channel_connect_confirm, mock_ibc_channel_open_init, mock_ibc_channel_open_try, mock_ibc_packet_ack, mock_ibc_packet_recv, mock_ibc_packet_timeout, }; + +pub use storage::MockStorage; diff --git a/packages/std/src/storage.rs b/packages/std/src/testing/storage.rs similarity index 92% rename from packages/std/src/storage.rs rename to packages/std/src/testing/storage.rs index be80fcdae0..b336590711 100644 --- a/packages/std/src/storage.rs +++ b/packages/std/src/testing/storage.rs @@ -1,26 +1,27 @@ -use std::collections::BTreeMap; -use std::fmt; +use alloc::collections::BTreeMap; +use core::fmt; #[cfg(feature = "iterator")] -use std::iter; +use core::iter; #[cfg(feature = "iterator")] -use std::ops::{Bound, RangeBounds}; +use core::ops::{Bound, RangeBounds}; #[cfg(feature = "iterator")] use crate::iterator::{Order, Record}; +use crate::prelude::*; use crate::traits::Storage; #[derive(Default)] -pub struct MemoryStorage { +pub struct MockStorage { data: BTreeMap, Vec>, } -impl MemoryStorage { +impl MockStorage { pub fn new() -> Self { - MemoryStorage::default() + MockStorage::default() } } -impl Storage for MemoryStorage { +impl Storage for MockStorage { fn get(&self, key: &[u8]) -> Option> { self.data.get(key).cloned() } @@ -67,18 +68,18 @@ impl Storage for MemoryStorage { /// This debug implementation is made for inspecting storages in unit testing. /// It is made for human readability only and the output can change at any time. -impl fmt::Debug for MemoryStorage { +impl fmt::Debug for MockStorage { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "MemoryStorage ({} entries)", self.data.len())?; f.write_str(" {\n")?; for (key, value) in &self.data { f.write_str(" 0x")?; for byte in key { - write!(f, "{:02x}", byte)?; + write!(f, "{byte:02x}")?; } f.write_str(": 0x")?; for byte in value { - write!(f, "{:02x}", byte)?; + write!(f, "{byte:02x}")?; } f.write_str("\n")?; } @@ -112,7 +113,7 @@ mod tests { #[test] fn get_and_set() { - let mut store = MemoryStorage::new(); + let mut store = MockStorage::new(); assert_eq!(store.get(b"foo"), None); store.set(b"foo", b"bar"); assert_eq!(store.get(b"foo"), Some(b"bar".to_vec())); @@ -124,13 +125,13 @@ mod tests { expected = "Getting empty values from storage is not well supported at the moment." )] fn set_panics_for_empty() { - let mut store = MemoryStorage::new(); + let mut store = MockStorage::new(); store.set(b"foo", b""); } #[test] fn delete() { - let mut store = MemoryStorage::new(); + let mut store = MockStorage::new(); store.set(b"foo", b"bar"); store.set(b"food", b"bank"); store.remove(b"foo"); @@ -142,7 +143,7 @@ mod tests { #[test] #[cfg(feature = "iterator")] fn iterator() { - let mut store = MemoryStorage::new(); + let mut store = MockStorage::new(); store.set(b"foo", b"bar"); // ensure we had previously set "foo" = "bar" @@ -282,30 +283,30 @@ mod tests { #[test] fn memory_storage_implements_debug() { - let store = MemoryStorage::new(); + let store = MockStorage::new(); assert_eq!( - format!("{:?}", store), + format!("{store:?}"), "MemoryStorage (0 entries) {\n\ }" ); // With one element - let mut store = MemoryStorage::new(); + let mut store = MockStorage::new(); store.set(&[0x00, 0xAB, 0xDD], &[0xFF, 0xD5]); assert_eq!( - format!("{:?}", store), + format!("{store:?}"), "MemoryStorage (1 entries) {\n\ \x20\x200x00abdd: 0xffd5\n\ }" ); // Sorted by key - let mut store = MemoryStorage::new(); + let mut store = MockStorage::new(); store.set(&[0x00, 0xAB, 0xDD], &[0xFF, 0xD5]); store.set(&[0x00, 0xAB, 0xEE], &[0xFF, 0xD5]); store.set(&[0x00, 0xAB, 0xCC], &[0xFF, 0xD5]); assert_eq!( - format!("{:?}", store), + format!("{store:?}"), "MemoryStorage (3 entries) {\n\ \x20\x200x00abcc: 0xffd5\n\ \x20\x200x00abdd: 0xffd5\n\ @@ -314,13 +315,13 @@ mod tests { ); // Different lengths - let mut store = MemoryStorage::new(); + let mut store = MockStorage::new(); store.set(&[0xAA], &[0x11]); store.set(&[0xAA, 0xBB], &[0x11, 0x22]); store.set(&[0xAA, 0xBB, 0xCC], &[0x11, 0x22, 0x33]); store.set(&[0xAA, 0xBB, 0xCC, 0xDD], &[0x11, 0x22, 0x33, 0x44]); assert_eq!( - format!("{:?}", store), + format!("{store:?}"), "MemoryStorage (4 entries) {\n\ \x20\x200xaa: 0x11\n\ \x20\x200xaabb: 0x1122\n\ diff --git a/packages/std/src/timestamp.rs b/packages/std/src/timestamp.rs index fa96fb477c..ee41cc27da 100644 --- a/packages/std/src/timestamp.rs +++ b/packages/std/src/timestamp.rs @@ -1,8 +1,7 @@ -use schemars::JsonSchema; +use core::fmt; use serde::{Deserialize, Serialize}; -use std::fmt; -use crate::math::Uint64; +use crate::Uint64; /// A point in time in nanosecond precision. /// @@ -23,8 +22,20 @@ use crate::math::Uint64; /// assert_eq!(ts.subsec_nanos(), 202); /// ``` #[derive( - Serialize, Deserialize, Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, JsonSchema, + Serialize, + Deserialize, + Copy, + Clone, + Default, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + schemars::JsonSchema, + cw_schema::Schemaifier, )] +#[schemaifier(type = cw_schema::NodeType::Timestamp)] pub struct Timestamp(Uint64); impl Timestamp { @@ -38,22 +49,105 @@ impl Timestamp { Timestamp(Uint64::new(seconds_since_epoch * 1_000_000_000)) } + /// Adds the given amount of days to the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result exceeds the value range of [`Timestamp`]. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub const fn plus_days(&self, addition: u64) -> Timestamp { + self.plus_hours(addition * 24) + } + + /// Adds the given amount of hours to the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result exceeds the value range of [`Timestamp`]. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub const fn plus_hours(&self, addition: u64) -> Timestamp { + self.plus_minutes(addition * 60) + } + + /// Adds the given amount of minutes to the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result exceeds the value range of [`Timestamp`]. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub const fn plus_minutes(&self, addition: u64) -> Timestamp { + self.plus_seconds(addition * 60) + } + + /// Adds the given amount of seconds to the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result exceeds the value range of [`Timestamp`]. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] pub const fn plus_seconds(&self, addition: u64) -> Timestamp { self.plus_nanos(addition * 1_000_000_000) } + /// Adds the given amount of nanoseconds to the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result exceeds the value range of [`Timestamp`]. + #[must_use = "this returns the result of the operation, without modifying the original"] + // no #[inline] here as this could be shared with all the callers pub const fn plus_nanos(&self, addition: u64) -> Timestamp { - let nanos = Uint64::new(self.0.u64() + addition); + let nanos = self.0.strict_add(Uint64::new(addition)); Timestamp(nanos) } + /// Subtracts the given amount of days from the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result is not >= 0. I.e. times before epoch cannot be represented. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub const fn minus_days(&self, subtrahend: u64) -> Timestamp { + self.minus_hours(subtrahend * 24) + } + + /// Subtracts the given amount of hours from the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result is not >= 0. I.e. times before epoch cannot be represented. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub const fn minus_hours(&self, subtrahend: u64) -> Timestamp { + self.minus_minutes(subtrahend * 60) + } + + /// Subtracts the given amount of minutes from the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result is not >= 0. I.e. times before epoch cannot be represented. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] + pub const fn minus_minutes(&self, subtrahend: u64) -> Timestamp { + self.minus_seconds(subtrahend * 60) + } + + /// Subtracts the given amount of seconds from the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result is not >= 0. I.e. times before epoch cannot be represented. + #[must_use = "this returns the result of the operation, without modifying the original"] + #[inline] pub const fn minus_seconds(&self, subtrahend: u64) -> Timestamp { self.minus_nanos(subtrahend * 1_000_000_000) } + /// Subtracts the given amount of nanoseconds from the timestamp and + /// returns the result. The original value remains unchanged. + /// + /// Panics if the result is not >= 0. I.e. times before epoch cannot be represented. + #[must_use = "this returns the result of the operation, without modifying the original"] + // no #[inline] here as this could be shared with all the callers pub const fn minus_nanos(&self, subtrahend: u64) -> Timestamp { - let nanos = Uint64::new(self.0.u64() - subtrahend); - Timestamp(nanos) + Timestamp(self.0.strict_sub(Uint64::new(subtrahend))) } /// Returns nanoseconds since epoch @@ -80,7 +174,7 @@ impl fmt::Display for Timestamp { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let whole = self.seconds(); let fractional = self.subsec_nanos(); - write!(f, "{}.{:09}", whole, fractional) + write!(f, "{whole}.{fractional:09}") } } @@ -120,6 +214,13 @@ mod tests { assert_eq!(sum.0.u64(), 123); } + #[test] + #[should_panic(expected = "attempt to add with overflow")] + fn timestamp_plus_nanos_panics_on_overflow() { + let max = Timestamp::from_nanos(u64::MAX); + let _earlier = max.plus_nanos(20); + } + #[test] fn timestamp_minus_seconds() { let earlier = Timestamp::from_seconds(123).minus_seconds(0); @@ -152,6 +253,56 @@ mod tests { let _earlier = Timestamp::from_nanos(100).minus_nanos(101); } + #[test] + fn timestamp_plus_days() { + let ts = Timestamp::from_seconds(123).plus_days(0); + assert_eq!(ts.0.u64(), 123_000_000_000); + let ts = Timestamp::from_seconds(123).plus_days(10); + assert_eq!(ts.0.u64(), 864_123_000_000_000); + } + + #[test] + fn timestamp_minus_days() { + let ts = Timestamp::from_seconds(123).minus_days(0); + assert_eq!(ts.0.u64(), 123_000_000_000); + let ts = Timestamp::from_seconds(2 * 86400 + 123).minus_days(1); + assert_eq!(ts.0.u64(), 86_523_000_000_000); + let ts = Timestamp::from_seconds(86400).minus_days(1); + assert_eq!(ts.0.u64(), 0); + } + + #[test] + fn timestamp_plus_hours() { + let ts = Timestamp::from_seconds(123).plus_hours(0); + assert_eq!(ts.0.u64(), 123_000_000_000); + let ts = Timestamp::from_seconds(123).plus_hours(2); + assert_eq!(ts.0.u64(), 123_000_000_000 + 60 * 60 * 2 * 1_000_000_000); + } + + #[test] + fn timestamp_minus_hours() { + let ts = Timestamp::from_seconds(2 * 60 * 60).minus_hours(0); + assert_eq!(ts.0.u64(), 2 * 60 * 60 * 1_000_000_000); + let ts = Timestamp::from_seconds(2 * 60 * 60 + 123).minus_hours(1); + assert_eq!(ts.0.u64(), 60 * 60 * 1_000_000_000 + 123_000_000_000); + } + + #[test] + fn timestamp_plus_minutes() { + let ts = Timestamp::from_seconds(123).plus_minutes(0); + assert_eq!(ts.0.u64(), 123_000_000_000); + let ts = Timestamp::from_seconds(123).plus_minutes(2); + assert_eq!(ts.0.u64(), 123_000_000_000 + 60 * 2 * 1_000_000_000); + } + + #[test] + fn timestamp_minus_minutes() { + let ts = Timestamp::from_seconds(5 * 60).minus_minutes(0); + assert_eq!(ts.0.u64(), 5 * 60 * 1_000_000_000); + let ts = Timestamp::from_seconds(5 * 60 + 123).minus_minutes(1); + assert_eq!(ts.0.u64(), 4 * 60 * 1_000_000_000 + 123_000_000_000); + } + #[test] fn timestamp_nanos() { let sum = Timestamp::from_nanos(123); diff --git a/packages/std/src/traits.rs b/packages/std/src/traits.rs index 57bd5d81b2..ed6da0102e 100644 --- a/packages/std/src/traits.rs +++ b/packages/std/src/traits.rs @@ -1,26 +1,50 @@ +use core::any::Any; +use core::marker::PhantomData; +use core::ops::Deref; use serde::{de::DeserializeOwned, Serialize}; -use std::marker::PhantomData; -use std::ops::Deref; -use crate::addresses::{Addr, CanonicalAddr}; -use crate::binary::Binary; use crate::coin::Coin; -use crate::errors::{RecoverPubkeyError, StdError, StdResult, VerificationError}; #[cfg(feature = "iterator")] use crate::iterator::{Order, Record}; +use crate::prelude::*; +#[cfg(feature = "cosmwasm_1_2")] +use crate::query::CodeInfoResponse; #[cfg(feature = "cosmwasm_1_1")] use crate::query::SupplyResponse; -use crate::query::{ - AllBalanceResponse, BalanceResponse, BankQuery, CustomQuery, QueryRequest, WasmQuery, -}; #[cfg(feature = "staking")] use crate::query::{ AllDelegationsResponse, AllValidatorsResponse, BondedDenomResponse, Delegation, - DelegationResponse, FullDelegation, StakingQuery, Validator, ValidatorResponse, + DelegationResponse, FullDelegation, StakingQuery, Validator, ValidatorMetadata, + ValidatorResponse, }; +#[cfg(feature = "cosmwasm_1_3")] +use crate::query::{ + AllDenomMetadataResponse, DelegatorWithdrawAddressResponse, DenomMetadataResponse, + DistributionQuery, +}; +use crate::query::{BalanceResponse, BankQuery, CustomQuery, QueryRequest, WasmQuery}; use crate::results::{ContractResult, Empty, SystemResult}; -use crate::serde::{from_binary, to_binary, to_vec}; use crate::ContractInfoResponse; +use crate::{from_json, to_json_binary, to_json_vec, Binary}; +use crate::{Addr, CanonicalAddr}; +#[cfg(feature = "cosmwasm_1_3")] +use crate::{DenomMetadata, PageRequest}; +use crate::{RecoverPubkeyError, StdError, StdResult, VerificationError}; + +#[derive(Clone, Copy, Debug)] +#[non_exhaustive] +pub enum HashFunction { + Sha256 = 0, +} + +#[cfg(not(target_arch = "wasm32"))] +impl From for cosmwasm_crypto::HashFunction { + fn from(value: HashFunction) -> Self { + match value { + HashFunction::Sha256 => cosmwasm_crypto::HashFunction::Sha256, + } + } +} /// Storage provides read and write access to a persistent storage. /// If you only want to provide read access, provide `&Storage` @@ -32,18 +56,56 @@ pub trait Storage { /// is not great yet and might not be possible in all backends. But we're trying to get there. fn get(&self, key: &[u8]) -> Option>; - #[cfg(feature = "iterator")] /// Allows iteration over a set of key/value pairs, either forwards or backwards. /// /// The bound `start` is inclusive and `end` is exclusive. - /// /// If `start` is lexicographically greater than or equal to `end`, an empty range is described, mo matter of the order. + #[cfg(feature = "iterator")] + #[allow(unused_variables)] fn range<'a>( &'a self, start: Option<&[u8]>, end: Option<&[u8]>, order: Order, - ) -> Box + 'a>; + ) -> Box + 'a> { + // This default implementation is just to avoid breaking code when enabling the `iterator` feature. + // Any actual `Storage` impl should override this method. + unimplemented!("This storage does not support ranging. Make sure to override the `range` method in your `Storage` implementation.") + } + + /// Allows iteration over a set of keys, either forwards or backwards. + /// + /// The bound `start` is inclusive and `end` is exclusive. + /// If `start` is lexicographically greater than or equal to `end`, an empty range is described, mo matter of the order. + /// + /// The default implementation uses [`Storage::range`] and discards the values. More efficient + /// implementations might be possible depending on the storage. + #[cfg(feature = "iterator")] + fn range_keys<'a>( + &'a self, + start: Option<&[u8]>, + end: Option<&[u8]>, + order: Order, + ) -> Box> + 'a> { + Box::new(self.range(start, end, order).map(|(k, _v)| k)) + } + + /// Allows iteration over a set of values, either forwards or backwards. + /// + /// The bound `start` is inclusive and `end` is exclusive. + /// If `start` is lexicographically greater than or equal to `end`, an empty range is described, mo matter of the order. + /// + /// The default implementation uses [`Storage::range`] and discards the keys. More efficient implementations + /// might be possible depending on the storage. + #[cfg(feature = "iterator")] + fn range_values<'a>( + &'a self, + start: Option<&[u8]>, + end: Option<&[u8]>, + order: Order, + ) -> Box> + 'a> { + Box::new(self.range(start, end, order).map(|(_k, v)| v)) + } fn set(&mut self, key: &[u8], value: &[u8]); @@ -68,7 +130,7 @@ pub trait Storage { /// /// We can use feature flags to opt-in to non-essential methods /// for backwards compatibility in systems that don't have them all. -pub trait Api { +pub trait Api: Any { /// Takes a human readable address and validates if it is valid. /// If it the validation succeeds, a `Addr` containing the same data as the input is returned. /// @@ -87,10 +149,10 @@ pub trait Api { /// ``` /// # use cosmwasm_std::{Api, Addr}; /// # use cosmwasm_std::testing::MockApi; - /// # let api = MockApi::default(); - /// let input = "what-users-provide"; + /// let api = MockApi::default().with_prefix("juno"); + /// let input = "juno1v82su97skv6ucfqvuvswe0t5fph7pfsrtraxf0x33d8ylj5qnrysdvkc95"; /// let validated: Addr = api.addr_validate(input).unwrap(); - /// assert_eq!(validated, input); + /// assert_eq!(validated.as_str(), input); /// ``` fn addr_validate(&self, human: &str) -> StdResult; @@ -102,7 +164,7 @@ pub trait Api { /// But that might change. So your contract should not make assumptions on the size. fn addr_canonicalize(&self, human: &str) -> StdResult; - /// Takes a canonical address and returns a human readble address. + /// Takes a canonical address and returns a human readable address. /// This is the inverse of [`addr_canonicalize`]. /// /// [`addr_canonicalize`]: Api::addr_canonicalize @@ -122,6 +184,133 @@ pub trait Api { recovery_param: u8, ) -> Result, RecoverPubkeyError>; + /// Add up points of the G1 subgroup on the BLS12-381 curve + /// + /// The length of `g1s` must be a multiple of 48 (each point is encoded in 48 bytes). + #[allow(unused_variables)] + fn bls12_381_aggregate_g1(&self, g1s: &[u8]) -> Result<[u8; 48], VerificationError> { + // Support for BLS12-381 is added in 2.1, i.e. we can't add a compile time requirement for new function. + // Any implementation of the Api trait which does not implement this function but tries to call it will + // panic at runtime. We don't assume such cases exist. + // See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item + unimplemented!() + } + + /// Add up points of the G2 subgroup on the BLS12-381 curve + /// + /// The length of `g2s` must be a multiple of 96 (each point is encoded in 96 bytes) + #[allow(unused_variables)] + fn bls12_381_aggregate_g2(&self, g2s: &[u8]) -> Result<[u8; 96], VerificationError> { + // Support for BLS12-381 is added in 2.1, i.e. we can't add a compile time requirement for new function. + // Any implementation of the Api trait which does not implement this function but tries to call it will + // panic at runtime. We don't assume such cases exist. + // See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item + unimplemented!() + } + + /// Checks the following pairing equality: + /// + /// e(p_1, q_1) × e(p_2, q_2) × … × e(p_n, q_n) = e(s, q) + /// + /// The argument `ps` contain the points p_1, ..., p_n ∈ G1 as a concatenation of 48 byte elements. + /// The argument `qs` contain the points q_1, ..., q_n ∈ G2 as a concatenation of 96 byte elements. + /// + /// ## Examples + /// + /// A simple signature check with one pairing on the left hand side (e(p, q) = e(s, q)): + /// + /// ``` + /// # use cosmwasm_std::{Api, HashFunction, StdResult}; + /// pub fn verify( + /// api: &dyn Api, + /// g1_generator: &[u8], + /// signature: &[u8], + /// pubkey: &[u8], + /// msg: &[u8], + /// dst: &[u8], + /// ) -> StdResult { + /// let msg_hashed = api.bls12_381_hash_to_g2(HashFunction::Sha256, msg, dst)?; + /// api.bls12_381_pairing_equality(g1_generator, signature, pubkey, &msg_hashed) + /// .map_err(Into::into) + /// } + /// ``` + #[allow(unused_variables)] + fn bls12_381_pairing_equality( + &self, + ps: &[u8], + qs: &[u8], + r: &[u8], + s: &[u8], + ) -> Result { + // Support for BLS12-381 is added in 2.1, i.e. we can't add a compile time requirement for new function. + // Any implementation of the Api trait which does not implement this function but tries to call it will + // panic at runtime. We don't assume such cases exist. + // See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item + unimplemented!() + } + + /// Take some arbitrary data and hash it to a point on the G1 subgroup of the curve. + /// + /// The `dst` parameter should be a constant is actually something similar to the "context" parameter in key derivation functions. + #[allow(unused_variables)] + fn bls12_381_hash_to_g1( + &self, + hash_function: HashFunction, + msg: &[u8], + dst: &[u8], + ) -> Result<[u8; 48], VerificationError> { + // Support for BLS12-381 is added in 2.1, i.e. we can't add a compile time requirement for new function. + // Any implementation of the Api trait which does not implement this function but tries to call it will + // panic at runtime. We don't assume such cases exist. + // See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item + unimplemented!() + } + + /// Take some arbitrary data and hash it to a point on the G2 subgroup of the curve. + /// + /// The `dst` parameter should be a constant is actually something similar to the "context" parameter in key derivation functions. + #[allow(unused_variables)] + fn bls12_381_hash_to_g2( + &self, + hash_function: HashFunction, + msg: &[u8], + dst: &[u8], + ) -> Result<[u8; 96], VerificationError> { + // Support for BLS12-381 is added in 2.1, i.e. we can't add a compile time requirement for new function. + // Any implementation of the Api trait which does not implement this function but tries to call it will + // panic at runtime. We don't assume such cases exist. + // See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item + unimplemented!() + } + + #[allow(unused_variables)] + fn secp256r1_verify( + &self, + message_hash: &[u8], + signature: &[u8], + public_key: &[u8], + ) -> Result { + // Support for secp256r1 is added in 2.1, i.e. we can't add a compile time requirement for new function. + // Any implementation of the Api trait which does not implement this function but tries to call it will + // panic at runtime. We don't assume such cases exist. + // See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item + unimplemented!() + } + + #[allow(unused_variables)] + fn secp256r1_recover_pubkey( + &self, + message_hash: &[u8], + signature: &[u8], + recovery_param: u8, + ) -> Result, RecoverPubkeyError> { + // Support for secp256r1 was added in 2.1, i.e. we can't add a compile time requirement for new function. + // Any implementation of the Api trait which does not implement this function but tries to call it will + // panic at runtime. We don't assume such cases exist. + // See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item + unimplemented!() + } + fn ed25519_verify( &self, message: &[u8], @@ -163,7 +352,7 @@ pub struct QuerierWrapper<'a, C: CustomQuery = Empty> { // See "There is a small difference between the two: the derive strategy will also // place a Copy bound on type parameters, which isn’t always desired." // https://doc.rust-lang.org/std/marker/trait.Copy.html -impl<'a, C: CustomQuery> Copy for QuerierWrapper<'a, C> {} +impl Copy for QuerierWrapper<'_, C> {} /// This allows us to use self.raw_query to access the querier. /// It also allows external callers to access the querier easily. @@ -183,24 +372,37 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> { } } + /// This allows to convert any `QuerierWrapper` into a `QuerierWrapper` generic + /// over `Empty` custom query type. + pub fn into_empty(self) -> QuerierWrapper<'a, Empty> { + QuerierWrapper { + querier: self.querier, + custom_query_type: PhantomData, + } + } + /// Makes the query and parses the response. /// /// Any error (System Error, Error or called contract, or Parse Error) are flattened into /// one level. Only use this if you don't need to check the SystemError /// eg. If you don't differentiate between contract missing and contract returned error pub fn query(&self, request: &QueryRequest) -> StdResult { - let raw = to_vec(request).map_err(|serialize_err| { - StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) - })?; + self.query_raw(request).and_then(|raw| from_json(raw)) + } + + /// Internal helper to avoid code duplication. + /// Performs a query and returns the binary result without deserializing it, + /// wrapping any errors that may occur into `StdError`. + fn query_raw(&self, request: &QueryRequest) -> StdResult { + let raw = to_json_vec(request)?; match self.raw_query(&raw) { - SystemResult::Err(system_err) => Err(StdError::generic_err(format!( - "Querier system error: {}", - system_err + SystemResult::Err(system_err) => Err(StdError::msg(format_args!( + "Querier system error: {system_err}" ))), - SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err( - format!("Querier contract error: {}", contract_err), + SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::msg( + format_args!("Querier contract error: {contract_err}"), )), - SystemResult::Ok(ContractResult::Ok(value)) => from_binary(&value), + SystemResult::Ok(ContractResult::Ok(value)) => Ok(value), } } @@ -228,17 +430,95 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> { Ok(res.amount) } - pub fn query_all_balances(&self, address: impl Into) -> StdResult> { - let request = BankQuery::AllBalances { - address: address.into(), + #[cfg(feature = "cosmwasm_1_3")] + pub fn query_delegator_withdraw_address( + &self, + delegator: impl Into, + ) -> StdResult { + let request = DistributionQuery::DelegatorWithdrawAddress { + delegator_address: delegator.into(), } .into(); - let res: AllBalanceResponse = self.query(&request)?; - Ok(res.amount) + let res: DelegatorWithdrawAddressResponse = self.query(&request)?; + Ok(res.withdraw_address) + } + + #[cfg(feature = "cosmwasm_1_3")] + pub fn query_denom_metadata(&self, denom: impl Into) -> StdResult { + let request = BankQuery::DenomMetadata { + denom: denom.into(), + } + .into(); + let res: DenomMetadataResponse = self.query(&request)?; + Ok(res.metadata) + } + + #[cfg(feature = "cosmwasm_1_3")] + pub fn query_all_denom_metadata( + &self, + pagination: PageRequest, + ) -> StdResult { + let request = BankQuery::AllDenomMetadata { + pagination: Some(pagination), + } + .into(); + self.query(&request) + } + + #[cfg(feature = "cosmwasm_1_4")] + pub fn query_delegation_rewards( + &self, + delegator: impl Into, + validator: impl Into, + ) -> StdResult> { + use crate::DelegationRewardsResponse; + + let request = DistributionQuery::DelegationRewards { + delegator_address: delegator.into(), + validator_address: validator.into(), + } + .into(); + let DelegationRewardsResponse { rewards } = self.query(&request)?; + + Ok(rewards) } - // this queries another wasm contract. You should know a priori the proper types for T and U - // (response and request) based on the contract API + #[cfg(feature = "cosmwasm_1_4")] + pub fn query_delegation_total_rewards( + &self, + delegator: impl Into, + ) -> StdResult { + let request = DistributionQuery::DelegationTotalRewards { + delegator_address: delegator.into(), + } + .into(); + self.query(&request) + } + + #[cfg(feature = "cosmwasm_1_4")] + pub fn query_delegator_validators( + &self, + delegator: impl Into, + ) -> StdResult> { + use crate::DelegatorValidatorsResponse; + + let request = DistributionQuery::DelegatorValidators { + delegator_address: delegator.into(), + } + .into(); + let res: DelegatorValidatorsResponse = self.query(&request)?; + Ok(res.validators) + } + + /// See [`GrpcQuery`](crate::GrpcQuery) for more information. + #[cfg(feature = "cosmwasm_2_0")] + pub fn query_grpc(&self, path: String, data: Binary) -> StdResult { + use crate::GrpcQuery; + self.query_raw(&QueryRequest::Grpc(GrpcQuery { path, data })) + } + + /// Queries another wasm contract. You should know a priori the proper types for T and U + /// (response and request) based on the contract API pub fn query_wasm_smart( &self, contract_addr: impl Into, @@ -246,19 +526,20 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> { ) -> StdResult { let request = WasmQuery::Smart { contract_addr: contract_addr.into(), - msg: to_binary(msg)?, + msg: to_json_binary(msg)?, } .into(); self.query(&request) } - // this queries the raw storage from another wasm contract. - // you must know the exact layout and are implementation dependent - // (not tied to an interface like query_wasm_smart) - // that said, if you are building a few contracts together, this is a much cheaper approach - // - // Similar return value to Storage.get(). Returns Some(val) or None if the data is there. - // It only returns error on some runtime issue, not on any data cases. + /// Queries the raw storage from another wasm contract. + /// + /// You must know the exact layout and are implementation dependent + /// (not tied to an interface like query_wasm_smart). + /// That said, if you are building a few contracts together, this is a much cheaper approach + /// + /// Similar return value to [`Storage::get`]. Returns `Some(val)` or `None` if the data is there. + /// It only returns error on some runtime issue, not on any data cases. pub fn query_wasm_raw( &self, contract_addr: impl Into, @@ -271,16 +552,13 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> { .into(); // we cannot use query, as it will try to parse the binary data, when we just want to return it, // so a bit of code copy here... - let raw = to_vec(&request).map_err(|serialize_err| { - StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) - })?; + let raw = to_json_vec(&request)?; match self.raw_query(&raw) { - SystemResult::Err(system_err) => Err(StdError::generic_err(format!( - "Querier system error: {}", - system_err + SystemResult::Err(system_err) => Err(StdError::msg(format_args!( + "Querier system error: {system_err}" ))), - SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err( - format!("Querier contract error: {}", contract_err), + SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::msg( + format_args!("Querier contract error: {contract_err}"), )), SystemResult::Ok(ContractResult::Ok(value)) => { if value.is_empty() { @@ -304,8 +582,15 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> { self.query(&request) } + /// Given a code ID, query information about that code. + #[cfg(feature = "cosmwasm_1_2")] + pub fn query_wasm_code_info(&self, code_id: u64) -> StdResult { + let request = WasmQuery::CodeInfo { code_id }.into(); + self.query(&request) + } + #[cfg(feature = "staking")] - pub fn query_all_validators(&self) -> StdResult> { + pub fn query_all_validators(&self) -> StdResult> { let request = StakingQuery::AllValidators {}.into(); let res: AllValidatorsResponse = self.query(&request)?; Ok(res.validators) @@ -359,9 +644,11 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> { #[cfg(test)] mod tests { + use serde::Deserialize; + use super::*; use crate::testing::MockQuerier; - use crate::{coins, from_slice, Uint128}; + use crate::{coins, Uint256}; // this is a simple demo helper to prove we can use it fn demo_helper(_querier: &dyn Querier) -> u64 { @@ -394,11 +681,11 @@ mod tests { }); let raw = wrapper - .raw_query(&to_vec(&query).unwrap()) + .raw_query(&to_json_vec(&query).unwrap()) .unwrap() .unwrap(); - let balance: BalanceResponse = from_slice(&raw).unwrap(); - assert_eq!(balance.amount.amount, Uint128::new(5)); + let balance: BalanceResponse = from_json(raw).unwrap(); + assert_eq!(balance.amount.amount, Uint256::new(5)); } #[cfg(feature = "cosmwasm_1_1")] @@ -417,9 +704,6 @@ mod tests { let balance = wrapper.query_balance("foo", "ELF").unwrap(); assert_eq!(balance, coin(123, "ELF")); - - let all_balances = wrapper.query_all_balances("foo").unwrap(); - assert_eq!(all_balances, vec![coin(123, "ELF"), coin(777, "FLY")]); } #[test] @@ -428,10 +712,11 @@ mod tests { fn mock_resp() -> ContractInfoResponse { ContractInfoResponse { code_id: 0, - creator: "creator".to_string(), + creator: Addr::unchecked("creator"), admin: None, pinned: false, ibc_port: None, + ibc2_port: None, } } @@ -440,7 +725,7 @@ mod tests { if q == &(WasmQuery::ContractInfo { contract_addr: ACCT.to_string(), }) { - SystemResult::Ok(ContractResult::Ok(to_binary(&mock_resp()).unwrap())) + SystemResult::Ok(ContractResult::Ok(to_json_binary(&mock_resp()).unwrap())) } else { SystemResult::Err(crate::SystemError::NoSuchContract { addr: ACCT.to_string(), @@ -459,10 +744,11 @@ mod tests { fn mock_resp() -> ContractInfoResponse { ContractInfoResponse { code_id: 0, - creator: "creator".to_string(), + creator: Addr::unchecked("creator"), admin: None, pinned: false, ibc_port: None, + ibc2_port: None, } } @@ -471,7 +757,7 @@ mod tests { if q == &(WasmQuery::ContractInfo { contract_addr: ACCT.to_string(), }) { - SystemResult::Ok(ContractResult::Ok(to_binary(&mock_resp()).unwrap())) + SystemResult::Ok(ContractResult::Ok(to_json_binary(&mock_resp()).unwrap())) } else { SystemResult::Err(crate::SystemError::NoSuchContract { addr: ACCT.to_string(), @@ -481,12 +767,20 @@ mod tests { let wrapper = QuerierWrapper::::new(&querier); let err = wrapper.query_wasm_contract_info("unknown").unwrap_err(); - assert!(matches!( - err, - StdError::GenericErr { - msg, - .. - } if msg == "Querier system error: No such contract: foobar" - )); + assert!(err + .to_string() + .ends_with("Querier system error: No such contract: foobar")); + } + + #[test] + fn querier_into_empty() { + #[derive(Clone, Serialize, Deserialize)] + struct MyQuery; + impl CustomQuery for MyQuery {} + + let querier: MockQuerier = MockQuerier::new(&[]); + let wrapper = QuerierWrapper::::new(&querier); + + let _: QuerierWrapper = wrapper.into_empty(); } } diff --git a/packages/std/src/types.rs b/packages/std/src/types.rs index 782ad1e726..4d87624ee8 100644 --- a/packages/std/src/types.rs +++ b/packages/std/src/types.rs @@ -1,11 +1,16 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use crate::addresses::Addr; use crate::coin::Coin; -use crate::timestamp::Timestamp; +use crate::prelude::*; +use crate::Binary; +use crate::{Addr, Timestamp}; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +use crate::utils::impl_hidden_constructor; + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct Env { pub block: BlockInfo, /// Information on the transaction this message was executed in. @@ -15,18 +20,32 @@ pub struct Env { pub contract: ContractInfo, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +#[non_exhaustive] pub struct TransactionInfo { /// The position of this transaction in the block. The first /// transaction has index 0. /// - /// This allows you to get a unique transaction indentifier in this chain + /// This allows you to get a unique transaction identifier in this chain /// using the pair (`env.block.height`, `env.transaction.index`). /// pub index: u32, + + /// Hash of the transaction. + /// + /// If the blockchain's CosmWasm version is below 3.0, this field + /// will default to being empty. + #[serde(default)] + pub hash: Binary, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +impl_hidden_constructor!(TransactionInfo, index: u32, hash: Binary); + +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct BlockInfo { /// The height of a block is the number of blocks preceding it in the blockchain. pub height: u64, @@ -40,14 +59,14 @@ pub struct BlockInfo { /// Using chrono: /// /// ``` - /// # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; + /// # use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; /// # let env = Env { /// # block: BlockInfo { /// # height: 12_345, /// # time: Timestamp::from_nanos(1_571_797_419_879_305_533), /// # chain_id: "cosmos-testnet-14002".to_string(), /// # }, - /// # transaction: Some(TransactionInfo { index: 3 }), + /// # transaction: Some(TransactionInfo::new(3, Binary::from_hex("E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3").unwrap())), /// # contract: ContractInfo { /// # address: Addr::unchecked("contract"), /// # }, @@ -62,14 +81,14 @@ pub struct BlockInfo { /// Creating a simple millisecond-precision timestamp (as used in JavaScript): /// /// ``` - /// # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; + /// # use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; /// # let env = Env { /// # block: BlockInfo { /// # height: 12_345, /// # time: Timestamp::from_nanos(1_571_797_419_879_305_533), /// # chain_id: "cosmos-testnet-14002".to_string(), /// # }, - /// # transaction: Some(TransactionInfo { index: 3 }), + /// # transaction: Some(TransactionInfo::new(3, Binary::from_hex("E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3").unwrap())), /// # contract: ContractInfo { /// # address: Addr::unchecked("contract"), /// # }, @@ -87,7 +106,7 @@ pub struct BlockInfo { /// /// [MsgInstantiateContract]: https://github.com/CosmWasm/wasmd/blob/v0.15.0/x/wasm/internal/types/tx.proto#L47-L61 /// [MsgExecuteContract]: https://github.com/CosmWasm/wasmd/blob/v0.15.0/x/wasm/internal/types/tx.proto#L68-L78 -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, cw_schema::Schemaifier)] pub struct MessageInfo { /// The `sender` field from `MsgInstantiateContract` and `MsgExecuteContract`. /// You can think of this as the address that initiated the action (i.e. the message). What that @@ -105,7 +124,27 @@ pub struct MessageInfo { pub funds: Vec, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] pub struct ContractInfo { pub address: Addr, } + +/// The structure contains additional information related to the +/// contract's migration procedure - the sender address and +/// the contract's migrate version currently stored on the blockchain. +/// The `old_migrate_version` is optional, since there is no guarantee +/// that the currently stored contract's binary contains that information. +#[derive( + Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema, cw_schema::Schemaifier, +)] +pub struct MigrateInfo { + /// Address of the sender. + /// + /// This is the `sender` field from [`MsgMigrateContract`](https://github.com/CosmWasm/wasmd/blob/v0.53.0/proto/cosmwasm/wasm/v1/tx.proto#L217-L233). + pub sender: Addr, + /// Migrate version of the previous contract. It's optional, since + /// adding the version number to the binary is not a mandatory feature. + pub old_migrate_version: Option, +} diff --git a/packages/std/src/utils.rs b/packages/std/src/utils.rs new file mode 100644 index 0000000000..cd0b73a071 --- /dev/null +++ b/packages/std/src/utils.rs @@ -0,0 +1,21 @@ +/// Implements a hidden constructor for non-exhaustive structures that need +/// to be built in libraries like cw-multi-test. +macro_rules! impl_hidden_constructor { + ( $type:ty, $( $field: ident : $t: ty),* ) => { + impl $type { + /// Constructor for testing frameworks such as cw-multi-test. + /// This is required because the type is #[non_exhaustive]. + /// As a contract developer you should not need this constructor since + /// the given structure is constructed for you via deserialization. + /// + /// Warning: This can change in breaking ways in minor versions. + #[doc(hidden)] + #[allow(dead_code)] + pub fn new($( $field: $t),*) -> Self { + Self { $( $field ),* } + } + } + }; +} + +pub(crate) use impl_hidden_constructor; diff --git a/packages/std/testdata/instantiate2_addresses.json b/packages/std/testdata/instantiate2_addresses.json new file mode 100644 index 0000000000..a12ad69521 --- /dev/null +++ b/packages/std/testdata/instantiate2_addresses.json @@ -0,0 +1,386 @@ +[ + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": null + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000001610000000000000000", + "addressData": "5e865d3e45ad3e961f77fd77d46543417ced44d924dc3e079b5415ff6775f847" + }, + "out": { + "address": "purple1t6r960j945lfv8mhl4mage2rg97w63xeynwrupum2s2l7em4lprs9ce5hk" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc00000000000000016100000000000000027b7d", + "addressData": "0995499608947a5281e2c7ebd71bdb26a1ad981946dad57f6c4d3ee35de77835" + }, + "out": { + "address": "purple1px25n9sgj3a99q0zcl4awx7my6s6mxqegmdd2lmvf5lwxh080q6suttktr" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc000000000000000161000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "83326e554723b15bac664ceabc8a5887e27003abe9fbd992af8c7bcea4745167" + }, + "out": { + "address": "purple1svexu428ywc4htrxfn4tezjcsl38qqata8aany4033auafr529ns4v254c" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": null + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae0000000000000000", + "addressData": "9384c6248c0bb171e306fd7da0993ec1e20eba006452a3a9e078883eb3594564" + }, + "out": { + "address": "purple1jwzvvfyvpwchrccxl476pxf7c83qawsqv3f2820q0zyrav6eg4jqdcq7gc" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae00000000000000027b7d", + "addressData": "9a8d5f98fb186825401a26206158e7a1213311a9b6a87944469913655af52ffb" + }, + "out": { + "address": "purple1n2x4lx8mrp5z2sq6ycsxzk885ysnxydfk658j3zxnyfk2kh49lasesxf6j" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "932f07bc53f7d0b0b43cb5a54ac3e245b205e6ae6f7c1d991dc6af4a2ff9ac18" + }, + "out": { + "address": "purple1jvhs00zn7lgtpdpukkj54slzgkeqte4wda7pmxgac6h55tle4svq8cmp60" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": null + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000001610000000000000000", + "addressData": "9725e94f528d8b78d33c25f3dfcd60e6142d8be60ab36f6a5b59036fd51560db" + }, + "out": { + "address": "purple1juj7jn6j3k9h35euyhealntquc2zmzlxp2ek76jmtypkl4g4vrdsfwmwxk" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff00000000000000016100000000000000027b7d", + "addressData": "b056e539bbaf447ba18f3f13b792970111fc78933eb6700f4d227b5216d63658" + }, + "out": { + "address": "purple1kptw2wdm4az8hgv08ufm0y5hqyglc7yn86m8qr6dyfa4y9kkxevqmkm9q3" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff000000000000000161000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "6c98434180f052294ff89fb6d2dae34f9f4468b0b8e6e7c002b2a44adee39abd" + }, + "out": { + "address": "purple1djvyxsvq7pfzjnlcn7md9khrf705g69shrnw0sqzk2jy4hhrn27sjh2ysy" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": null + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae0000000000000000", + "addressData": "0aaf1c31c5d529d21d898775bc35b3416f47bfd99188c334c6c716102cbd3101" + }, + "out": { + "address": "purple1p2h3cvw9655ay8vfsa6mcddng9h5007ejxyvxdxxcutpqt9axyqsagmmay" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae00000000000000027b7d", + "addressData": "36fe6ab732187cdfed46290b448b32eb7f4798e7a4968b0537de8a842cbf030e" + }, + "out": { + "address": "purple1xmlx4dejrp7dlm2x9y95fzejadl50x885jtgkpfhm69ggt9lqv8qk3vn4f" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "a0d0c942adac6f3e5e7c23116c4c42a24e96e0ab75f53690ec2d3de16067c751" + }, + "out": { + "address": "purple15rgvjs4d43hnuhnuyvgkcnzz5f8fdc9twh6ndy8v9577zcr8cags40l9dt" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": null + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000001610000000000000000", + "addressData": "b95c467218d408a0f93046f227b6ece7fe18133ff30113db4d2a7becdfeca141" + }, + "out": { + "address": "purple1h9wyvusc6sy2p7fsgmez0dhvullpsyel7vq38k6d9fa7ehlv59qsvnyh36" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc00000000000000016100000000000000027b7d", + "addressData": "23fe45dbbd45dc6cd25244a74b6e99e7a65bf0bac2f2842a05049d37555a3ae6" + }, + "out": { + "address": "purple1y0lytkaaghwxe5jjgjn5km5eu7n9hu96ctegg2s9qjwnw4268tnqxhg60a" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc000000000000000161000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "6faea261ed63baa65b05726269e83b217fa6205dc7d9fb74f9667d004a69c082" + }, + "out": { + "address": "purple1d7h2yc0dvwa2vkc9wf3xn6pmy9l6vgzaclvlka8eve7sqjnfczpqqsdnwu" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": null + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae0000000000000000", + "addressData": "67a3ab6384729925fdb144574628ce96836fe098d2c6be4e84ac106b2728d96c" + }, + "out": { + "address": "purple1v736kcuyw2vjtld3g3t5v2xwj6pklcyc6trtun5y4sgxkfegm9kq7vgpnt" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae00000000000000027b7d", + "addressData": "23a121263bfce05c144f4af86f3d8a9f87dc56f9dc48dbcffc8c5a614da4c661" + }, + "out": { + "address": "purple1ywsjzf3mlns9c9z0ftux70v2n7rac4hem3ydhnlu33dxzndycesssc7x2m" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "dd90dba6d6fcd5fb9c9c8f536314eb1bb29cb5aa084b633c5806b926a5636b58" + }, + "out": { + "address": "purple1mkgdhfkkln2lh8yu3afkx98trwefedd2pp9kx0zcq6ujdftrddvq50esay" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": null + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000001610000000000000000", + "addressData": "547a743022f4f1af05b102f57bf1c1c7d7ee81bae427dc20d36b2c4ec57612ae" + }, + "out": { + "address": "purple123a8gvpz7nc67pd3qt6hhuwpclt7aqd6usnacgxndvkya3tkz2hq5hz38f" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff00000000000000016100000000000000027b7d", + "addressData": "416e169110e4b411bc53162d7503b2bbf14d6b36b1413a4f4c9af622696e9665" + }, + "out": { + "address": "purple1g9hpdygsuj6pr0znzckh2qajh0c566ekk9qn5n6vntmzy6twjejsrl9alk" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff000000000000000161000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "619a0988b92d8796cea91dea63cbb1f1aefa4a6b6ee5c5d1e937007252697220" + }, + "out": { + "address": "purple1vxdqnz9e9kredn4frh4x8ja37xh05jntdmjut50fxuq8y5nfwgsquu9mxh" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": null + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae0000000000000000", + "addressData": "d8af856a6a04852d19b647ad6d4336eb26e077f740aef1a0331db34d299a885a" + }, + "out": { + "address": "purple1mzhc26n2qjzj6xdkg7kk6sekavnwqalhgzh0rgpnrke562v63pdq8grp8q" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae00000000000000027b7d", + "addressData": "c7fb7bea96daab23e416c4fcf328215303005e1d0d5424257335568e5381e33c" + }, + "out": { + "address": "purple1clahh65km24j8eqkcn70x2pp2vpsqhsap42zgftnx4tgu5upuv7q9ywjws" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "ccdf9dea141a6c2475870529ab38fae9dec30df28e005894fe6578b66133ab4a" + }, + "out": { + "address": "purple1en0em6s5rfkzgav8q556kw86a80vxr0j3cq93987v4utvcfn4d9q0tql4w" + } + } +] diff --git a/packages/storage/Cargo.toml b/packages/storage/Cargo.toml deleted file mode 100644 index 07c778d2b5..0000000000 --- a/packages/storage/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "cosmwasm-storage" -version = "1.1.9" -authors = ["Ethan Frey "] -edition = "2021" -description = "CosmWasm library with useful helpers for Storage patterns" -repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/storage" -license = "Apache-2.0" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[features] -default = ["iterator"] -# This enables iterator functionality, as exposed in cosmwasm-std/iterator -iterator = ["cosmwasm-std/iterator"] - -[dependencies] -# Uses the path when built locally; uses the given version from crates.io when published -cosmwasm-std = { path = "../std", version = "1.1.9", default-features = false } -serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] } diff --git a/packages/storage/README.md b/packages/storage/README.md deleted file mode 100644 index 5ed7379226..0000000000 --- a/packages/storage/README.md +++ /dev/null @@ -1,194 +0,0 @@ -# cosmwasm-storage - -[![cosmwasm-storage on crates.io](https://img.shields.io/crates/v/cosmwasm-storage.svg)](https://crates.io/crates/cosmwasm-storage) - -CosmWasm library with useful helpers for Storage patterns. You can use `Storage` -implementations in `cosmwasm-std`, or rely on these to remove some common -boilterplate. - -## Contents - -- [PrefixedStorage](#prefixed-storage) -- [TypedStorage](#typed-storage) -- [Bucket](#bucket) -- [Singleton](#singleton) - -### Prefixed Storage - -One common technique in smart contracts, especially when multiple types of data -are being stored, is to create separate sub-stores with unique prefixes. Thus -instead of directly dealing with storage, we wrap it and put all `Foo` in a -Storage with key `"foo" + id`, and all `Bar` in a Storage with key `"bar" + id`. -This lets us add multiple types of objects without too much cognitive overhead. -Similar separation like Mongo collections or SQL tables. - -Since we have different types for `Storage` and `ReadonlyStorage`, we use two -different constructors: - -```rust -use cosmwasm_std::testing::MockStorage; -use cosmwasm_storage::{prefixed, prefixed_read}; - -let mut store = MockStorage::new(); - -let mut foos = prefixed(b"foo", &mut store); -foos.set(b"one", b"foo"); - -let mut bars = prefixed(b"bar", &mut store); -bars.set(b"one", b"bar"); - -let read_foo = prefixed_read(b"foo", &store); -assert_eq!(b"foo".to_vec(), read_foo.get(b"one").unwrap()); - -let read_bar = prefixed_read(b"bar", &store); -assert_eq!(b"bar".to_vec(), read_bar.get(b"one").unwrap()); -``` - -Please note that only one mutable reference to the underlying store may be valid -at one point. The compiler sees we do not ever use `foos` after constructing -`bars`, so this example is valid. However, if we did use `foos` again at the -bottom, it would properly complain about violating unique mutable reference. - -The takeaway is to create the `PrefixedStorage` objects when needed and not to -hang around to them too long. - -### Typed Storage - -As we divide our storage space into different subspaces or "buckets", we will -quickly notice that each "bucket" works on a unique type. This leads to a lot of -repeated serialization and deserialization boilerplate that can be removed. We -do this by wrapping a `Storage` with a type-aware `TypedStorage` struct that -provides us a higher-level access to the data. - -Note that `TypedStorage` itself does not implement the `Storage` interface, so -when combining with `PrefixStorage`, make sure to wrap the prefix first. - -```rust -use cosmwasm_std::testing::MockStorage; -use cosmwasm_storage::{prefixed, typed}; - -let mut store = MockStorage::new(); -let mut space = prefixed(b"data", &mut store); -let mut bucket = typed::<_, Data>(&mut space); - -// save data -let data = Data { - name: "Maria".to_string(), - age: 42, -}; -bucket.save(b"maria", &data).unwrap(); - -// load it properly -let loaded = bucket.load(b"maria").unwrap(); -assert_eq!(data, loaded); - -// loading empty can return Ok(None) or Err depending on the chosen method: -assert!(bucket.load(b"john").is_err()); -assert_eq!(bucket.may_load(b"john"), Ok(None)); -``` - -Beyond the basic `save`, `load`, and `may_load`, there is a higher-level API -exposed, `update`. `Update` will load the data, apply an operation and save it -again (if the operation was successful). It will also return any error that -occurred, or the final state that was written if successful. - -```rust -let on_birthday = |mut m: Option| match m { - Some(mut d) => { - d.age += 1; - Ok(d) - }, - None => NotFound { kind: "Data" }.fail(), -}; -let output = bucket.update(b"maria", &on_birthday).unwrap(); -let expected = Data { - name: "Maria".to_string(), - age: 43, -}; -assert_eq!(output, expected); -``` - -### Bucket - -Since the above idiom (a subspace for a class of items) is so common and useful, -and there is no easy way to return this from a function (bucket holds a -reference to space, and cannot live longer than the local variable), the two are -often combined into a `Bucket`. A Bucket works just like the example above, -except the creation can be in another function: - -```rust -use cosmwasm_std::StdResult; -use cosmwasm_std::testing::MockStorage; -use cosmwasm_storage::{bucket, Bucket}; - -fn people<'a, S: Storage>(storage: &'a mut S) -> Bucket<'a, S, Data> { - bucket(b"people", storage) -} - -fn do_stuff() -> StdResult<()> { - let mut store = MockStorage::new(); - people(&mut store).save(b"john", &Data{ - name: "John", - age: 314, - })?; - OK(()) -} -``` - -### Singleton - -Singleton is another wrapper around the `TypedStorage` API. There are cases when -we don't need a whole subspace to hold arbitrary key-value lookup for typed -data, but rather a single storage key. The simplest example is some -_configuration_ information for a contract. For example, in the -[name service example](https://github.com/CosmWasm/cosmwasm-examples/tree/master/nameservice), -there is a `Bucket` to look up name to name data, but we also have a `Singleton` -to store global configuration - namely the price of buying a name. - -Please note that in this context, the term "singleton" does not refer to -[the singleton pattern](https://en.wikipedia.org/wiki/Singleton_pattern) but a -container for a single element. - -```rust -use cosmwasm_std::{Coin, coin, StdResult}; -use cosmwasm_std::testing::MockStorage; - -use cosmwasm_storage::{singleton}; - -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] -pub struct Config { - pub purchase_price: Option, - pub transfer_price: Option, -} - -fn initialize() -> StdResult<()> { - let mut store = MockStorage::new(); - let config = singleton(&mut store, b"config"); - config.save(&Config{ - purchase_price: Some(coin("5", "FEE")), - transfer_price: None, - })?; - config.update(|mut cfg| { - cfg.transfer_price = Some(coin(2, "FEE")); - Ok(cfg) - })?; - let loaded = config.load()?; - OK(()) -} -``` - -`Singleton` works just like `Bucket`, except the `save`, `load`, `update` -methods don't take a key, and `update` requires the object to already exist, so -the closure takes type `T`, rather than `Option`. (Use `save` to create the -object the first time). For `Buckets`, we often don't know which keys exist, but -`Singleton`s should be initialized when the contract is instantiated. - -Since the heart of much of the smart contract code is simply transformations -upon some stored state, we may be able to just code the state transitions and -let the `TypedStorage` APIs take care of all the boilerplate. - -## License - -This package is part of the cosmwasm repository, licensed under the Apache -License 2.0 (see [NOTICE](https://github.com/CosmWasm/cosmwasm/blob/main/NOTICE) -and [LICENSE](https://github.com/CosmWasm/cosmwasm/blob/main/LICENSE)). diff --git a/packages/storage/src/bucket.rs b/packages/storage/src/bucket.rs deleted file mode 100644 index dd9e482f3e..0000000000 --- a/packages/storage/src/bucket.rs +++ /dev/null @@ -1,460 +0,0 @@ -use serde::{de::DeserializeOwned, ser::Serialize}; -use std::marker::PhantomData; - -use cosmwasm_std::{to_vec, StdError, StdResult, Storage}; -#[cfg(feature = "iterator")] -use cosmwasm_std::{Order, Record}; - -use crate::length_prefixed::{to_length_prefixed, to_length_prefixed_nested}; -#[cfg(feature = "iterator")] -use crate::namespace_helpers::range_with_prefix; -use crate::namespace_helpers::{get_with_prefix, remove_with_prefix, set_with_prefix}; -#[cfg(feature = "iterator")] -use crate::type_helpers::deserialize_kv; -use crate::type_helpers::{may_deserialize, must_deserialize}; - -/// An alias of Bucket::new for less verbose usage -pub fn bucket<'a, T>(storage: &'a mut dyn Storage, namespace: &[u8]) -> Bucket<'a, T> -where - T: Serialize + DeserializeOwned, -{ - Bucket::new(storage, namespace) -} - -/// An alias of ReadonlyBucket::new for less verbose usage -pub fn bucket_read<'a, T>(storage: &'a dyn Storage, namespace: &[u8]) -> ReadonlyBucket<'a, T> -where - T: Serialize + DeserializeOwned, -{ - ReadonlyBucket::new(storage, namespace) -} - -pub struct Bucket<'a, T> -where - T: Serialize + DeserializeOwned, -{ - storage: &'a mut dyn Storage, - prefix: Vec, - // see https://doc.rust-lang.org/std/marker/struct.PhantomData.html#unused-type-parameters for why this is needed - data: PhantomData, -} - -impl<'a, T> Bucket<'a, T> -where - T: Serialize + DeserializeOwned, -{ - pub fn new(storage: &'a mut dyn Storage, namespace: &[u8]) -> Self { - Bucket { - storage, - prefix: to_length_prefixed(namespace), - data: PhantomData, - } - } - - pub fn multilevel(storage: &'a mut dyn Storage, namespaces: &[&[u8]]) -> Self { - Bucket { - storage, - prefix: to_length_prefixed_nested(namespaces), - data: PhantomData, - } - } - - /// save will serialize the model and store, returns an error on serialization issues - pub fn save(&mut self, key: &[u8], data: &T) -> StdResult<()> { - set_with_prefix(self.storage, &self.prefix, key, &to_vec(data)?); - Ok(()) - } - - pub fn remove(&mut self, key: &[u8]) { - remove_with_prefix(self.storage, &self.prefix, key) - } - - /// load will return an error if no data is set at the given key, or on parse error - pub fn load(&self, key: &[u8]) -> StdResult { - let value = get_with_prefix(self.storage, &self.prefix, key); - must_deserialize(&value) - } - - /// may_load will parse the data stored at the key if present, returns Ok(None) if no data there. - /// returns an error on issues parsing - pub fn may_load(&self, key: &[u8]) -> StdResult> { - let value = get_with_prefix(self.storage, &self.prefix, key); - may_deserialize(&value) - } - - #[cfg(feature = "iterator")] - pub fn range<'b>( - &'b self, - start: Option<&[u8]>, - end: Option<&[u8]>, - order: Order, - ) -> Box>> + 'b> { - let mapped = range_with_prefix(self.storage, &self.prefix, start, end, order) - .map(deserialize_kv::); - Box::new(mapped) - } - - /// Loads the data, perform the specified action, and store the result - /// in the database. This is shorthand for some common sequences, which may be useful. - /// - /// If the data exists, `action(Some(value))` is called. Otherwise `action(None)` is called. - pub fn update(&mut self, key: &[u8], action: A) -> Result - where - A: FnOnce(Option) -> Result, - E: From, - { - let input = self.may_load(key)?; - let output = action(input)?; - self.save(key, &output)?; - Ok(output) - } -} - -pub struct ReadonlyBucket<'a, T> -where - T: Serialize + DeserializeOwned, -{ - storage: &'a dyn Storage, - prefix: Vec, - // see https://doc.rust-lang.org/std/marker/struct.PhantomData.html#unused-type-parameters for why this is needed - data: PhantomData, -} - -impl<'a, T> ReadonlyBucket<'a, T> -where - T: Serialize + DeserializeOwned, -{ - pub fn new(storage: &'a dyn Storage, namespace: &[u8]) -> Self { - ReadonlyBucket { - storage, - prefix: to_length_prefixed(namespace), - data: PhantomData, - } - } - - pub fn multilevel(storage: &'a dyn Storage, namespaces: &[&[u8]]) -> Self { - ReadonlyBucket { - storage, - prefix: to_length_prefixed_nested(namespaces), - data: PhantomData, - } - } - - /// load will return an error if no data is set at the given key, or on parse error - pub fn load(&self, key: &[u8]) -> StdResult { - let value = get_with_prefix(self.storage, &self.prefix, key); - must_deserialize(&value) - } - - /// may_load will parse the data stored at the key if present, returns Ok(None) if no data there. - /// returns an error on issues parsing - pub fn may_load(&self, key: &[u8]) -> StdResult> { - let value = get_with_prefix(self.storage, &self.prefix, key); - may_deserialize(&value) - } - - #[cfg(feature = "iterator")] - pub fn range<'b>( - &'b self, - start: Option<&[u8]>, - end: Option<&[u8]>, - order: Order, - ) -> Box>> + 'b> { - let mapped = range_with_prefix(self.storage, &self.prefix, start, end, order) - .map(deserialize_kv::); - Box::new(mapped) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use cosmwasm_std::testing::MockStorage; - use cosmwasm_std::StdError; - use serde::{Deserialize, Serialize}; - - #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)] - struct Data { - pub name: String, - pub age: i32, - } - - #[test] - fn store_and_load() { - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - - // save data - let data = Data { - name: "Maria".to_string(), - age: 42, - }; - bucket.save(b"maria", &data).unwrap(); - - // load it properly - let loaded = bucket.load(b"maria").unwrap(); - assert_eq!(data, loaded); - } - - #[test] - fn remove_works() { - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - - // save data - let data = Data { - name: "Maria".to_string(), - age: 42, - }; - bucket.save(b"maria", &data).unwrap(); - assert_eq!(data, bucket.load(b"maria").unwrap()); - - // deleting random key does nothing - bucket.remove(b"foobar"); - assert_eq!(data, bucket.load(b"maria").unwrap()); - - // deleting maria removes the data - bucket.remove(b"maria"); - assert_eq!(None, bucket.may_load(b"maria").unwrap()); - } - - #[test] - fn readonly_works() { - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - - // save data - let data = Data { - name: "Maria".to_string(), - age: 42, - }; - bucket.save(b"maria", &data).unwrap(); - - let reader = bucket_read::(&store, b"data"); - - // check empty data handling - assert!(reader.load(b"john").is_err()); - assert_eq!(reader.may_load(b"john").unwrap(), None); - - // load it properly - let loaded = reader.load(b"maria").unwrap(); - assert_eq!(data, loaded); - } - - #[test] - fn buckets_isolated() { - let mut store = MockStorage::new(); - let mut bucket1 = bucket::(&mut store, b"data"); - - // save data - let data = Data { - name: "Maria".to_string(), - age: 42, - }; - bucket1.save(b"maria", &data).unwrap(); - - let mut bucket2 = bucket::(&mut store, b"dat"); - - // save data (dat, amaria) vs (data, maria) - let data2 = Data { - name: "Amen".to_string(), - age: 67, - }; - bucket2.save(b"amaria", &data2).unwrap(); - - // load one - let reader = bucket_read::(&store, b"data"); - let loaded = reader.load(b"maria").unwrap(); - assert_eq!(data, loaded); - // no cross load - assert_eq!(None, reader.may_load(b"amaria").unwrap()); - - // load the other - let reader2 = bucket_read::(&store, b"dat"); - let loaded2 = reader2.load(b"amaria").unwrap(); - assert_eq!(data2, loaded2); - // no cross load - assert_eq!(None, reader2.may_load(b"maria").unwrap()); - } - - #[test] - fn update_success() { - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - - // initial data - let init = Data { - name: "Maria".to_string(), - age: 42, - }; - bucket.save(b"maria", &init).unwrap(); - - // it's my birthday - let birthday = |mayd: Option| -> StdResult { - let mut d = mayd.ok_or_else(|| StdError::not_found("Data"))?; - d.age += 1; - Ok(d) - }; - let output = bucket.update(b"maria", birthday).unwrap(); - let expected = Data { - name: "Maria".to_string(), - age: 43, - }; - assert_eq!(output, expected); - - // load it properly - let loaded = bucket.load(b"maria").unwrap(); - assert_eq!(loaded, expected); - } - - #[test] - fn update_can_change_variable_from_outer_scope() { - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - let init = Data { - name: "Maria".to_string(), - age: 42, - }; - bucket.save(b"maria", &init).unwrap(); - - // show we can capture data from the closure - let mut old_age = 0i32; - bucket - .update(b"maria", |mayd: Option| -> StdResult<_> { - let mut d = mayd.ok_or_else(|| StdError::not_found("Data"))?; - old_age = d.age; - d.age += 1; - Ok(d) - }) - .unwrap(); - assert_eq!(old_age, 42); - } - - #[test] - fn update_fails_on_error() { - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - - // initial data - let init = Data { - name: "Maria".to_string(), - age: 42, - }; - bucket.save(b"maria", &init).unwrap(); - - // it's my birthday - let output = bucket.update(b"maria", |_d| { - Err(StdError::generic_err("cuz i feel like it")) - }); - assert!(output.is_err()); - - // load it properly - let loaded = bucket.load(b"maria").unwrap(); - assert_eq!(loaded, init); - } - - #[test] - fn update_supports_custom_error_types() { - #[derive(Debug)] - enum MyError { - Std, - NotFound, - } - - impl From for MyError { - fn from(_original: StdError) -> MyError { - MyError::Std - } - } - - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - - // initial data - let init = Data { - name: "Maria".to_string(), - age: 42, - }; - bucket.save(b"maria", &init).unwrap(); - - // it's my birthday - let res = bucket.update(b"bob", |data| { - if let Some(mut data) = data { - if data.age < 0 { - // Uses Into to convert StdError to MyError - return Err(StdError::generic_err("Current age is negative").into()); - } - if data.age > 10 { - to_vec(&data)?; // Uses From to convert StdError to MyError - } - data.age += 1; - Ok(data) - } else { - Err(MyError::NotFound) - } - }); - match res.unwrap_err() { - MyError::NotFound { .. } => {} - err => panic!("Unexpected error: {:?}", err), - } - } - - #[test] - fn update_handles_on_no_data() { - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - - let init_value = Data { - name: "Maria".to_string(), - age: 42, - }; - - // it's my birthday - let output = bucket - .update(b"maria", |d| match d { - Some(_) => Err(StdError::generic_err("Ensure this was empty")), - None => Ok(init_value.clone()), - }) - .unwrap(); - assert_eq!(output, init_value); - - // nothing stored - let loaded = bucket.load(b"maria").unwrap(); - assert_eq!(loaded, init_value); - } - - #[test] - #[cfg(feature = "iterator")] - fn range_over_data() { - let mut store = MockStorage::new(); - let mut bucket = bucket::(&mut store, b"data"); - - let jose = Data { - name: "Jose".to_string(), - age: 42, - }; - let maria = Data { - name: "Maria".to_string(), - age: 27, - }; - - bucket.save(b"maria", &maria).unwrap(); - bucket.save(b"jose", &jose).unwrap(); - - let res_data: StdResult>> = - bucket.range(None, None, Order::Ascending).collect(); - let data = res_data.unwrap(); - assert_eq!(data.len(), 2); - assert_eq!(data[0], (b"jose".to_vec(), jose.clone())); - assert_eq!(data[1], (b"maria".to_vec(), maria.clone())); - - // also works for readonly - let read_bucket = bucket_read::(&store, b"data"); - let res_data: StdResult>> = - read_bucket.range(None, None, Order::Ascending).collect(); - let data = res_data.unwrap(); - assert_eq!(data.len(), 2); - assert_eq!(data[0], (b"jose".to_vec(), jose)); - assert_eq!(data[1], (b"maria".to_vec(), maria)); - } -} diff --git a/packages/storage/src/lib.rs b/packages/storage/src/lib.rs deleted file mode 100644 index 486d070796..0000000000 --- a/packages/storage/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod bucket; -mod length_prefixed; -mod namespace_helpers; -mod prefixed_storage; -mod sequence; -mod singleton; -mod type_helpers; - -pub use bucket::{bucket, bucket_read, Bucket, ReadonlyBucket}; -pub use length_prefixed::{to_length_prefixed, to_length_prefixed_nested}; -pub use prefixed_storage::{prefixed, prefixed_read, PrefixedStorage, ReadonlyPrefixedStorage}; -pub use sequence::{currval, nextval, sequence}; -pub use singleton::{singleton, singleton_read, ReadonlySingleton, Singleton}; diff --git a/packages/storage/src/namespace_helpers.rs b/packages/storage/src/namespace_helpers.rs deleted file mode 100644 index 1c2650b911..0000000000 --- a/packages/storage/src/namespace_helpers.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cosmwasm_std::Storage; -#[cfg(feature = "iterator")] -use cosmwasm_std::{Order, Record}; - -pub(crate) fn get_with_prefix( - storage: &dyn Storage, - namespace: &[u8], - key: &[u8], -) -> Option> { - storage.get(&concat(namespace, key)) -} - -pub(crate) fn set_with_prefix( - storage: &mut dyn Storage, - namespace: &[u8], - key: &[u8], - value: &[u8], -) { - storage.set(&concat(namespace, key), value); -} - -pub(crate) fn remove_with_prefix(storage: &mut dyn Storage, namespace: &[u8], key: &[u8]) { - storage.remove(&concat(namespace, key)); -} - -#[inline] -fn concat(namespace: &[u8], key: &[u8]) -> Vec { - let mut k = namespace.to_vec(); - k.extend_from_slice(key); - k -} - -#[cfg(feature = "iterator")] -pub(crate) fn range_with_prefix<'a>( - storage: &'a dyn Storage, - namespace: &[u8], - start: Option<&[u8]>, - end: Option<&[u8]>, - order: Order, -) -> Box + 'a> { - // prepare start, end with prefix - let start = match start { - Some(s) => concat(namespace, s), - None => namespace.to_vec(), - }; - let end = match end { - Some(e) => concat(namespace, e), - // end is updating last byte by one - None => namespace_upper_bound(namespace), - }; - - // get iterator from storage - let base_iterator = storage.range(Some(&start), Some(&end), order); - - // make a copy for the closure to handle lifetimes safely - let prefix = namespace.to_vec(); - let mapped = base_iterator.map(move |(k, v)| (trim(&prefix, &k), v)); - Box::new(mapped) -} - -#[cfg(feature = "iterator")] -#[inline] -fn trim(namespace: &[u8], key: &[u8]) -> Vec { - key[namespace.len()..].to_vec() -} - -/// Returns a new vec of same length and last byte incremented by one -/// If last bytes are 255, we handle overflow up the chain. -/// If all bytes are 255, this returns wrong data - but that is never possible as a namespace -#[cfg(feature = "iterator")] -fn namespace_upper_bound(input: &[u8]) -> Vec { - let mut copy = input.to_vec(); - // zero out all trailing 255, increment first that is not such - for i in (0..input.len()).rev() { - if copy[i] == 255 { - copy[i] = 0; - } else { - copy[i] += 1; - break; - } - } - copy -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::length_prefixed::to_length_prefixed; - use cosmwasm_std::testing::MockStorage; - - #[test] - fn prefix_get_set() { - let mut storage = MockStorage::new(); - let prefix = to_length_prefixed(b"foo"); - - set_with_prefix(&mut storage, &prefix, b"bar", b"gotcha"); - let rfoo = get_with_prefix(&storage, &prefix, b"bar"); - assert_eq!(rfoo, Some(b"gotcha".to_vec())); - - // no collisions with other prefixes - let other_prefix = to_length_prefixed(b"fo"); - let collision = get_with_prefix(&storage, &other_prefix, b"obar"); - assert_eq!(collision, None); - } - - #[test] - #[cfg(feature = "iterator")] - fn range_works() { - let mut storage = MockStorage::new(); - let prefix = to_length_prefixed(b"foo"); - let other_prefix = to_length_prefixed(b"food"); - - // set some values in this range - set_with_prefix(&mut storage, &prefix, b"bar", b"none"); - set_with_prefix(&mut storage, &prefix, b"snowy", b"day"); - - // set some values outside this range - set_with_prefix(&mut storage, &other_prefix, b"moon", b"buggy"); - - // ensure we get proper result from prefixed_range iterator - let mut iter = range_with_prefix(&storage, &prefix, None, None, Order::Descending); - let first = iter.next().unwrap(); - assert_eq!(first, (b"snowy".to_vec(), b"day".to_vec())); - let second = iter.next().unwrap(); - assert_eq!(second, (b"bar".to_vec(), b"none".to_vec())); - assert!(iter.next().is_none()); - - // ensure we get raw result from base range - let iter = storage.range(None, None, Order::Ascending); - assert_eq!(3, iter.count()); - - // foo comes first - let mut iter = storage.range(None, None, Order::Ascending); - let first = iter.next().unwrap(); - let expected_key = concat(&prefix, b"bar"); - assert_eq!(first, (expected_key, b"none".to_vec())); - } - - #[test] - #[cfg(feature = "iterator")] - fn range_with_prefix_wrapover() { - let mut storage = MockStorage::new(); - // if we don't properly wrap over there will be issues here (note 255+1 is used to calculate end) - let prefix = to_length_prefixed(b"f\xff\xff"); - let other_prefix = to_length_prefixed(b"f\xff\x44"); - - // set some values in this range - set_with_prefix(&mut storage, &prefix, b"bar", b"none"); - set_with_prefix(&mut storage, &prefix, b"snowy", b"day"); - - // set some values outside this range - set_with_prefix(&mut storage, &other_prefix, b"moon", b"buggy"); - - // ensure we get proper result from prefixed_range iterator - let iter = range_with_prefix(&storage, &prefix, None, None, Order::Descending); - let elements: Vec = iter.collect(); - assert_eq!( - elements, - vec![ - (b"snowy".to_vec(), b"day".to_vec()), - (b"bar".to_vec(), b"none".to_vec()), - ] - ); - } - - #[test] - #[cfg(feature = "iterator")] - fn range_with_start_end_set() { - let mut storage = MockStorage::new(); - // if we don't properly wrap over there will be issues here (note 255+1 is used to calculate end) - let prefix = to_length_prefixed(b"f\xff\xff"); - let other_prefix = to_length_prefixed(b"f\xff\x44"); - - // set some values in this range - set_with_prefix(&mut storage, &prefix, b"bar", b"none"); - set_with_prefix(&mut storage, &prefix, b"snowy", b"day"); - - // set some values outside this range - set_with_prefix(&mut storage, &other_prefix, b"moon", b"buggy"); - - // make sure start and end are applied properly - let res: Vec = - range_with_prefix(&storage, &prefix, Some(b"b"), Some(b"c"), Order::Ascending) - .collect(); - assert_eq!(res.len(), 1); - assert_eq!(res[0], (b"bar".to_vec(), b"none".to_vec())); - - // make sure start and end are applied properly - let res_count = range_with_prefix( - &storage, - &prefix, - Some(b"bas"), - Some(b"sno"), - Order::Ascending, - ) - .count(); - assert_eq!(res_count, 0); - - let res: Vec = - range_with_prefix(&storage, &prefix, Some(b"ant"), None, Order::Ascending).collect(); - assert_eq!(res.len(), 2); - assert_eq!(res[0], (b"bar".to_vec(), b"none".to_vec())); - assert_eq!(res[1], (b"snowy".to_vec(), b"day".to_vec())); - } - - #[test] - #[cfg(feature = "iterator")] - fn namespace_upper_bound_works() { - assert_eq!(namespace_upper_bound(b"bob"), b"boc".to_vec()); - assert_eq!(namespace_upper_bound(b"fo\xfe"), b"fo\xff".to_vec()); - assert_eq!(namespace_upper_bound(b"fo\xff"), b"fp\x00".to_vec()); - // multiple \xff roll over - assert_eq!( - namespace_upper_bound(b"fo\xff\xff\xff"), - b"fp\x00\x00\x00".to_vec() - ); - // \xff not at the end are ignored - assert_eq!(namespace_upper_bound(b"\xffabc"), b"\xffabd".to_vec()); - } -} diff --git a/packages/storage/src/prefixed_storage.rs b/packages/storage/src/prefixed_storage.rs deleted file mode 100644 index 6d7779541a..0000000000 --- a/packages/storage/src/prefixed_storage.rs +++ /dev/null @@ -1,182 +0,0 @@ -use cosmwasm_std::Storage; -#[cfg(feature = "iterator")] -use cosmwasm_std::{Order, Record}; - -use crate::length_prefixed::{to_length_prefixed, to_length_prefixed_nested}; -#[cfg(feature = "iterator")] -use crate::namespace_helpers::range_with_prefix; -use crate::namespace_helpers::{get_with_prefix, remove_with_prefix, set_with_prefix}; - -/// An alias of PrefixedStorage::new for less verbose usage -pub fn prefixed<'a>(storage: &'a mut dyn Storage, namespace: &[u8]) -> PrefixedStorage<'a> { - PrefixedStorage::new(storage, namespace) -} - -/// An alias of ReadonlyPrefixedStorage::new for less verbose usage -pub fn prefixed_read<'a>( - storage: &'a dyn Storage, - namespace: &[u8], -) -> ReadonlyPrefixedStorage<'a> { - ReadonlyPrefixedStorage::new(storage, namespace) -} - -pub struct PrefixedStorage<'a> { - storage: &'a mut dyn Storage, - prefix: Vec, -} - -impl<'a> PrefixedStorage<'a> { - pub fn new(storage: &'a mut dyn Storage, namespace: &[u8]) -> Self { - PrefixedStorage { - storage, - prefix: to_length_prefixed(namespace), - } - } - - // Nested namespaces as documented in - // https://github.com/webmaster128/key-namespacing#nesting - pub fn multilevel(storage: &'a mut dyn Storage, namespaces: &[&[u8]]) -> Self { - PrefixedStorage { - storage, - prefix: to_length_prefixed_nested(namespaces), - } - } -} - -impl<'a> Storage for PrefixedStorage<'a> { - fn get(&self, key: &[u8]) -> Option> { - get_with_prefix(self.storage, &self.prefix, key) - } - - fn set(&mut self, key: &[u8], value: &[u8]) { - set_with_prefix(self.storage, &self.prefix, key, value); - } - - fn remove(&mut self, key: &[u8]) { - remove_with_prefix(self.storage, &self.prefix, key); - } - - #[cfg(feature = "iterator")] - /// range allows iteration over a set of keys, either forwards or backwards - /// uses standard rust range notation, and eg db.range(b"foo"..b"bar") also works reverse - fn range<'b>( - &'b self, - start: Option<&[u8]>, - end: Option<&[u8]>, - order: Order, - ) -> Box + 'b> { - range_with_prefix(self.storage, &self.prefix, start, end, order) - } -} - -pub struct ReadonlyPrefixedStorage<'a> { - storage: &'a dyn Storage, - prefix: Vec, -} - -impl<'a> ReadonlyPrefixedStorage<'a> { - pub fn new(storage: &'a dyn Storage, namespace: &[u8]) -> Self { - ReadonlyPrefixedStorage { - storage, - prefix: to_length_prefixed(namespace), - } - } - - // Nested namespaces as documented in - // https://github.com/webmaster128/key-namespacing#nesting - pub fn multilevel(storage: &'a dyn Storage, namespaces: &[&[u8]]) -> Self { - ReadonlyPrefixedStorage { - storage, - prefix: to_length_prefixed_nested(namespaces), - } - } -} - -impl<'a> Storage for ReadonlyPrefixedStorage<'a> { - fn get(&self, key: &[u8]) -> Option> { - get_with_prefix(self.storage, &self.prefix, key) - } - - fn set(&mut self, _key: &[u8], _value: &[u8]) { - unimplemented!(); - } - - fn remove(&mut self, _key: &[u8]) { - unimplemented!(); - } - - #[cfg(feature = "iterator")] - /// range allows iteration over a set of keys, either forwards or backwards - fn range<'b>( - &'b self, - start: Option<&[u8]>, - end: Option<&[u8]>, - order: Order, - ) -> Box + 'b> { - range_with_prefix(self.storage, &self.prefix, start, end, order) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use cosmwasm_std::testing::MockStorage; - - #[test] - fn prefixed_storage_set_and_get() { - let mut storage = MockStorage::new(); - - // set - let mut s1 = PrefixedStorage::new(&mut storage, b"foo"); - s1.set(b"bar", b"gotcha"); - assert_eq!(storage.get(b"\x00\x03foobar").unwrap(), b"gotcha".to_vec()); - - // get - let s2 = PrefixedStorage::new(&mut storage, b"foo"); - assert_eq!(s2.get(b"bar"), Some(b"gotcha".to_vec())); - assert_eq!(s2.get(b"elsewhere"), None); - } - - #[test] - fn prefixed_storage_multilevel_set_and_get() { - let mut storage = MockStorage::new(); - - // set - let mut bar = PrefixedStorage::multilevel(&mut storage, &[b"foo", b"bar"]); - bar.set(b"baz", b"winner"); - assert_eq!( - storage.get(b"\x00\x03foo\x00\x03barbaz").unwrap(), - b"winner".to_vec() - ); - - // get - let bar = PrefixedStorage::multilevel(&mut storage, &[b"foo", b"bar"]); - assert_eq!(bar.get(b"baz"), Some(b"winner".to_vec())); - assert_eq!(bar.get(b"elsewhere"), None); - } - - #[test] - fn readonly_prefixed_storage_get() { - let mut storage = MockStorage::new(); - storage.set(b"\x00\x03foobar", b"gotcha"); - - // try readonly correctly - let s1 = ReadonlyPrefixedStorage::new(&storage, b"foo"); - assert_eq!(s1.get(b"bar"), Some(b"gotcha".to_vec())); - assert_eq!(s1.get(b"elsewhere"), None); - - // no collisions with other prefixes - let s2 = ReadonlyPrefixedStorage::new(&storage, b"fo"); - assert_eq!(s2.get(b"obar"), None); - } - - #[test] - fn readonly_prefixed_storage_multilevel_get() { - let mut storage = MockStorage::new(); - storage.set(b"\x00\x03foo\x00\x03barbaz", b"winner"); - - let bar = ReadonlyPrefixedStorage::multilevel(&storage, &[b"foo", b"bar"]); - assert_eq!(bar.get(b"baz"), Some(b"winner".to_vec())); - assert_eq!(bar.get(b"elsewhere"), None); - } -} diff --git a/packages/storage/src/sequence.rs b/packages/storage/src/sequence.rs deleted file mode 100644 index 30f9491cb2..0000000000 --- a/packages/storage/src/sequence.rs +++ /dev/null @@ -1,72 +0,0 @@ -use cosmwasm_std::{StdResult, Storage}; - -use crate::Singleton; - -/// Sequence creates a custom Singleton to hold an empty sequence -pub fn sequence<'a>(storage: &'a mut dyn Storage, key: &[u8]) -> Singleton<'a, u64> { - Singleton::new(storage, key) -} - -/// currval returns the last value returned by nextval. If the sequence has never been used, -/// then it will return 0. -pub fn currval(seq: &Singleton) -> StdResult { - Ok(seq.may_load()?.unwrap_or_default()) -} - -/// nextval increments the counter by 1 and returns the new value. -/// On the first time it is called (no sequence info in db) it will return 1. -pub fn nextval(seq: &mut Singleton) -> StdResult { - let val = currval(seq)? + 1; - seq.save(&val)?; - Ok(val) -} - -#[cfg(test)] -mod tests { - use super::*; - use cosmwasm_std::testing::MockStorage; - - #[test] - fn walk_through_sequence() { - let mut store = MockStorage::new(); - let mut seq = sequence(&mut store, b"seq"); - - assert_eq!(currval(&seq).unwrap(), 0); - assert_eq!(nextval(&mut seq).unwrap(), 1); - assert_eq!(nextval(&mut seq).unwrap(), 2); - assert_eq!(nextval(&mut seq).unwrap(), 3); - assert_eq!(currval(&seq).unwrap(), 3); - assert_eq!(currval(&seq).unwrap(), 3); - } - - #[test] - fn sequences_independent() { - let mut store = MockStorage::new(); - - let mut seq = sequence(&mut store, b"seq"); - assert_eq!(nextval(&mut seq).unwrap(), 1); - assert_eq!(nextval(&mut seq).unwrap(), 2); - assert_eq!(nextval(&mut seq).unwrap(), 3); - - let mut seq2 = sequence(&mut store, b"seq2"); - assert_eq!(nextval(&mut seq2).unwrap(), 1); - assert_eq!(nextval(&mut seq2).unwrap(), 2); - - let mut seq3 = sequence(&mut store, b"seq"); - assert_eq!(nextval(&mut seq3).unwrap(), 4); - } - - #[test] - fn set_sequence() { - let mut store = MockStorage::new(); - let mut seq = sequence(&mut store, b"seq"); - - assert_eq!(nextval(&mut seq).unwrap(), 1); - assert_eq!(nextval(&mut seq).unwrap(), 2); - - seq.save(&20).unwrap(); - - assert_eq!(currval(&seq).unwrap(), 20); - assert_eq!(nextval(&mut seq).unwrap(), 21); - } -} diff --git a/packages/storage/src/singleton.rs b/packages/storage/src/singleton.rs deleted file mode 100644 index 782002b976..0000000000 --- a/packages/storage/src/singleton.rs +++ /dev/null @@ -1,310 +0,0 @@ -use serde::{de::DeserializeOwned, ser::Serialize}; -use std::marker::PhantomData; - -use cosmwasm_std::{to_vec, StdError, StdResult, Storage}; - -use crate::length_prefixed::to_length_prefixed; -use crate::type_helpers::{may_deserialize, must_deserialize}; - -/// An alias of Singleton::new for less verbose usage -pub fn singleton<'a, T>(storage: &'a mut dyn Storage, key: &[u8]) -> Singleton<'a, T> -where - T: Serialize + DeserializeOwned, -{ - Singleton::new(storage, key) -} - -/// An alias of ReadonlySingleton::new for less verbose usage -pub fn singleton_read<'a, T>(storage: &'a dyn Storage, key: &[u8]) -> ReadonlySingleton<'a, T> -where - T: Serialize + DeserializeOwned, -{ - ReadonlySingleton::new(storage, key) -} - -/// Singleton effectively combines PrefixedStorage with TypedStorage to -/// work on a single storage key. It performs the to_length_prefixed transformation -/// on the given name to ensure no collisions, and then provides the standard -/// TypedStorage accessors, without requiring a key (which is defined in the constructor) -pub struct Singleton<'a, T> -where - T: Serialize + DeserializeOwned, -{ - storage: &'a mut dyn Storage, - key: Vec, - // see https://doc.rust-lang.org/std/marker/struct.PhantomData.html#unused-type-parameters for why this is needed - data: PhantomData, -} - -impl<'a, T> Singleton<'a, T> -where - T: Serialize + DeserializeOwned, -{ - pub fn new(storage: &'a mut dyn Storage, key: &[u8]) -> Self { - Singleton { - storage, - key: to_length_prefixed(key), - data: PhantomData, - } - } - - /// save will serialize the model and store, returns an error on serialization issues - pub fn save(&mut self, data: &T) -> StdResult<()> { - self.storage.set(&self.key, &to_vec(data)?); - Ok(()) - } - - pub fn remove(&mut self) { - self.storage.remove(&self.key) - } - - /// load will return an error if no data is set at the given key, or on parse error - pub fn load(&self) -> StdResult { - let value = self.storage.get(&self.key); - must_deserialize(&value) - } - - /// may_load will parse the data stored at the key if present, returns Ok(None) if no data there. - /// returns an error on issues parsing - pub fn may_load(&self) -> StdResult> { - let value = self.storage.get(&self.key); - may_deserialize(&value) - } - - /// update will load the data, perform the specified action, and store the result - /// in the database. This is shorthand for some common sequences, which may be useful - /// - /// This is the least stable of the APIs, and definitely needs some usage - pub fn update(&mut self, action: A) -> Result - where - A: FnOnce(T) -> Result, - E: From, - { - let input = self.load()?; - let output = action(input)?; - self.save(&output)?; - Ok(output) - } -} - -/// ReadonlySingleton only requires a Storage and exposes only the -/// methods of Singleton that don't modify state. -pub struct ReadonlySingleton<'a, T> -where - T: Serialize + DeserializeOwned, -{ - storage: &'a dyn Storage, - key: Vec, - // see https://doc.rust-lang.org/std/marker/struct.PhantomData.html#unused-type-parameters for why this is needed - data: PhantomData, -} - -impl<'a, T> ReadonlySingleton<'a, T> -where - T: Serialize + DeserializeOwned, -{ - pub fn new(storage: &'a dyn Storage, key: &[u8]) -> Self { - ReadonlySingleton { - storage, - key: to_length_prefixed(key), - data: PhantomData, - } - } - - /// load will return an error if no data is set at the given key, or on parse error - pub fn load(&self) -> StdResult { - let value = self.storage.get(&self.key); - must_deserialize(&value) - } - - /// may_load will parse the data stored at the key if present, returns Ok(None) if no data there. - /// returns an error on issues parsing - pub fn may_load(&self) -> StdResult> { - let value = self.storage.get(&self.key); - may_deserialize(&value) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use cosmwasm_std::testing::MockStorage; - use serde::{Deserialize, Serialize}; - - use cosmwasm_std::{OverflowError, OverflowOperation, StdError}; - - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct Config { - pub owner: String, - pub max_tokens: i32, - } - - #[test] - fn save_and_load() { - let mut store = MockStorage::new(); - let mut single = Singleton::::new(&mut store, b"config"); - - assert!(single.load().is_err()); - assert_eq!(single.may_load().unwrap(), None); - - let cfg = Config { - owner: "admin".to_string(), - max_tokens: 1234, - }; - single.save(&cfg).unwrap(); - - assert_eq!(cfg, single.load().unwrap()); - } - - #[test] - fn remove_works() { - let mut store = MockStorage::new(); - let mut single = Singleton::::new(&mut store, b"config"); - - // store data - let cfg = Config { - owner: "admin".to_string(), - max_tokens: 1234, - }; - single.save(&cfg).unwrap(); - assert_eq!(cfg, single.load().unwrap()); - - // remove it and loads None - single.remove(); - assert_eq!(None, single.may_load().unwrap()); - - // safe to remove 2 times - single.remove(); - assert_eq!(None, single.may_load().unwrap()); - } - - #[test] - fn isolated_reads() { - let mut store = MockStorage::new(); - let mut writer = singleton::(&mut store, b"config"); - - let cfg = Config { - owner: "admin".to_string(), - max_tokens: 1234, - }; - writer.save(&cfg).unwrap(); - - let reader = singleton_read::(&store, b"config"); - assert_eq!(cfg, reader.load().unwrap()); - - let other_reader = singleton_read::(&store, b"config2"); - assert_eq!(other_reader.may_load().unwrap(), None); - } - - #[test] - fn update_success() { - let mut store = MockStorage::new(); - let mut writer = singleton::(&mut store, b"config"); - - let cfg = Config { - owner: "admin".to_string(), - max_tokens: 1234, - }; - writer.save(&cfg).unwrap(); - - let output = writer.update(|mut c| -> StdResult<_> { - c.max_tokens *= 2; - Ok(c) - }); - let expected = Config { - owner: "admin".to_string(), - max_tokens: 2468, - }; - assert_eq!(output.unwrap(), expected); - assert_eq!(writer.load().unwrap(), expected); - } - - #[test] - fn update_can_change_variable_from_outer_scope() { - let mut store = MockStorage::new(); - let mut writer = singleton::(&mut store, b"config"); - let cfg = Config { - owner: "admin".to_string(), - max_tokens: 1234, - }; - writer.save(&cfg).unwrap(); - - let mut old_max_tokens = 0i32; - writer - .update(|mut c| -> StdResult<_> { - old_max_tokens = c.max_tokens; - c.max_tokens *= 2; - Ok(c) - }) - .unwrap(); - assert_eq!(old_max_tokens, 1234); - } - - #[test] - fn update_does_not_change_data_on_error() { - let mut store = MockStorage::new(); - let mut writer = singleton::(&mut store, b"config"); - - let cfg = Config { - owner: "admin".to_string(), - max_tokens: 1234, - }; - writer.save(&cfg).unwrap(); - - let output = writer.update(|_c| { - Err(StdError::from(OverflowError::new( - OverflowOperation::Sub, - 4, - 7, - ))) - }); - match output.unwrap_err() { - StdError::Overflow { .. } => {} - err => panic!("Unexpected error: {:?}", err), - } - assert_eq!(writer.load().unwrap(), cfg); - } - - #[test] - fn update_supports_custom_errors() { - #[derive(Debug)] - enum MyError { - Std(StdError), - Foo, - } - - impl From for MyError { - fn from(original: StdError) -> MyError { - MyError::Std(original) - } - } - - let mut store = MockStorage::new(); - let mut writer = singleton::(&mut store, b"config"); - - let cfg = Config { - owner: "admin".to_string(), - max_tokens: 1234, - }; - writer.save(&cfg).unwrap(); - - let res = writer.update(|mut c| { - if c.max_tokens > 5000 { - return Err(MyError::Foo); - } - if c.max_tokens > 20 { - return Err(StdError::generic_err("broken stuff").into()); // Uses Into to convert StdError to MyError - } - if c.max_tokens > 10 { - to_vec(&c)?; // Uses From to convert StdError to MyError - } - c.max_tokens += 20; - Ok(c) - }); - match res.unwrap_err() { - MyError::Std(StdError::GenericErr { .. }) => {} - err => panic!("Unexpected error: {:?}", err), - } - assert_eq!(writer.load().unwrap(), cfg); - } -} diff --git a/packages/storage/src/type_helpers.rs b/packages/storage/src/type_helpers.rs deleted file mode 100644 index 6a36f074e2..0000000000 --- a/packages/storage/src/type_helpers.rs +++ /dev/null @@ -1,89 +0,0 @@ -use serde::de::DeserializeOwned; -use std::any::type_name; - -#[cfg(feature = "iterator")] -use cosmwasm_std::Record; -use cosmwasm_std::{from_slice, StdError, StdResult}; - -/// may_deserialize parses json bytes from storage (Option), returning Ok(None) if no data present -/// -/// value is an odd type, but this is meant to be easy to use with output from storage.get (Option>) -/// and value.map(|s| s.as_slice()) seems trickier than &value -pub(crate) fn may_deserialize( - value: &Option>, -) -> StdResult> { - match value { - Some(data) => Ok(Some(from_slice(data)?)), - None => Ok(None), - } -} - -/// must_deserialize parses json bytes from storage (Option), returning NotFound error if no data present -pub(crate) fn must_deserialize(value: &Option>) -> StdResult { - match value { - Some(data) => from_slice(data), - None => Err(StdError::not_found(type_name::())), - } -} - -#[cfg(feature = "iterator")] -pub(crate) fn deserialize_kv(kv: Record>) -> StdResult> { - let (k, v) = kv; - let t = from_slice::(&v)?; - Ok((k, t)) -} - -#[cfg(test)] -mod tests { - use super::*; - use cosmwasm_std::{to_vec, StdError}; - use serde::{Deserialize, Serialize}; - - #[derive(Serialize, Deserialize, PartialEq, Debug)] - struct Person { - pub name: String, - pub age: i32, - } - - #[test] - fn may_deserialize_handles_some() { - let person = Person { - name: "Maria".to_string(), - age: 42, - }; - let value = to_vec(&person).unwrap(); - - let may_parse: Option = may_deserialize(&Some(value)).unwrap(); - assert_eq!(may_parse, Some(person)); - } - - #[test] - fn may_deserialize_handles_none() { - let may_parse = may_deserialize::(&None).unwrap(); - assert_eq!(may_parse, None); - } - - #[test] - fn must_deserialize_handles_some() { - let person = Person { - name: "Maria".to_string(), - age: 42, - }; - let value = to_vec(&person).unwrap(); - let loaded = Some(value); - - let parsed: Person = must_deserialize(&loaded).unwrap(); - assert_eq!(parsed, person); - } - - #[test] - fn must_deserialize_handles_none() { - let parsed = must_deserialize::(&None); - match parsed.unwrap_err() { - StdError::NotFound { kind, .. } => { - assert_eq!(kind, "cosmwasm_storage::type_helpers::tests::Person") - } - e => panic!("Unexpected error {}", e), - } - } -} diff --git a/packages/vm-derive/Cargo.toml b/packages/vm-derive/Cargo.toml new file mode 100644 index 0000000000..1d6381b680 --- /dev/null +++ b/packages/vm-derive/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "cosmwasm-vm-derive" +edition = "2021" +version = { workspace = true } +description = "Derive macros for cosmwasm-vm. For internal use only. No stability guarantees." +repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/std" +license = "Apache-2.0" + +[lib] +proc-macro = true + +[dependencies] +blake2 = "0.10.6" +proc-macro2 = "1.0.86" +quote = "1.0.37" +syn = { version = "2.0.77", features = ["extra-traits", "full"] } diff --git a/packages/vm-derive/src/hash_function.rs b/packages/vm-derive/src/hash_function.rs new file mode 100644 index 0000000000..2167224013 --- /dev/null +++ b/packages/vm-derive/src/hash_function.rs @@ -0,0 +1,83 @@ +use std::hash::{Hash, Hasher}; + +use blake2::{Blake2b512, Digest}; +use proc_macro2::TokenStream; +use quote::{quote, ToTokens}; +use syn::{punctuated::Punctuated, Token}; + +use super::maybe; + +struct Options { + const_name: syn::Ident, +} + +impl syn::parse::Parse for Options { + fn parse(input: syn::parse::ParseStream) -> syn::Result { + let params = Punctuated::::parse_terminated(input)?; + + let mut const_name = None; + for param in params { + if param.path.is_ident("const_name") { + if const_name.is_some() { + return Err(syn::Error::new_spanned(param, "Duplicate parameter")); + } + + let ident_as_string: syn::LitStr = syn::parse2(param.value.to_token_stream())?; + const_name = Some(ident_as_string.parse()?); + } else { + return Err(syn::Error::new_spanned(param, "Unknown parameter")); + } + } + + Ok(Self { + const_name: const_name + .ok_or_else(|| syn::Error::new(input.span(), "Missing parameters"))?, + }) + } +} + +struct Blake2Hasher { + hasher: Blake2b512, +} + +impl Blake2Hasher { + fn new() -> Self { + Self { + hasher: Blake2b512::new(), + } + } + + fn consume(self) -> [u8; 64] { + self.hasher.finalize().into() + } +} + +impl Hasher for Blake2Hasher { + fn write(&mut self, bytes: &[u8]) { + self.hasher.update(bytes); + } + + fn finish(&self) -> u64 { + unimplemented!(); + } +} + +pub fn hash_function_impl(attr: TokenStream, input: TokenStream) -> TokenStream { + let options: Options = maybe!(syn::parse2(attr)); + + // Just verify that this is actually a function + let function: syn::ItemFn = maybe!(syn::parse2(input.clone())); + + let mut hasher = Blake2Hasher::new(); + function.hash(&mut hasher); + let hash = hasher.consume(); + + let hash_variable_name = &options.const_name; + let hash_bytes = hash.as_slice(); + + quote! { + pub const #hash_variable_name: &[u8] = &[#(#hash_bytes),*]; + + #input + } +} diff --git a/packages/vm-derive/src/lib.rs b/packages/vm-derive/src/lib.rs new file mode 100644 index 0000000000..4d4702ef51 --- /dev/null +++ b/packages/vm-derive/src/lib.rs @@ -0,0 +1,35 @@ +//! Derive macros for cosmwasm-vm. For internal use only. No stability guarantees. +//! +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! For more information, see: + +mod hash_function; + +macro_rules! maybe { + ($result:expr) => {{ + match { $result } { + Ok(val) => val, + Err(err) => return err.into_compile_error(), + } + }}; +} +use maybe; + +/// Hash the function +/// +/// # Example +/// +/// ```rust +/// # use cosmwasm_vm_derive::hash_function; +/// #[hash_function(const_name = "HASH")] +/// fn foo() { +/// println!("Hello, world!"); +/// } +/// ``` +#[proc_macro_attribute] +pub fn hash_function( + attr: proc_macro::TokenStream, + item: proc_macro::TokenStream, +) -> proc_macro::TokenStream { + hash_function::hash_function_impl(attr.into(), item.into()).into() +} diff --git a/packages/vm/Cargo.toml b/packages/vm/Cargo.toml index 685474d650..d304c21c3c 100644 --- a/packages/vm/Cargo.toml +++ b/packages/vm/Cargo.toml @@ -1,18 +1,24 @@ [package] name = "cosmwasm-vm" -version = "1.1.9" +version = { workspace = true } authors = ["Ethan Frey "] edition = "2021" description = "VM bindings to run cosmwams contracts" repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/vm" license = "Apache-2.0" +[package.metadata.release] +pre-release-hook = ["../../devtools/release_checks.sh"] +pre-release-replacements = [ + { file = "../../CHANGELOG.md", search = "## \\[Unreleased\\]", replace = "## [{{version}}] - {{date}}", exactly = 1 }, + { file = "../../CHANGELOG.md", search = "(U|u)nreleased", replace = "{{version}}" }, + { file = "../../CHANGELOG.md", search = "", replace = "\n\n## [Unreleased]", exactly = 1 }, + { file = "../../CHANGELOG.md", search = "\\.\\.\\.HEAD", replace = "...{{tag_name}}", exactly = 1 }, + { file = "../../CHANGELOG.md", search = "\n", replace = "\n\n[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/{{tag_name}}...HEAD", exactly = 1 }, +] + [features] -default = ["staking", "iterator"] -# backtraces provides much better context at runtime errors (in non-wasm code) -# at the cost of a bit of code size and performance. -# This feature requires Rust nightly because it depends on the unstable backtrace feature. -backtraces = [] +default = ["iterator", "staking"] # iterator allows us to iterate over all DB items in a given range # this must be enabled to support cosmwasm contracts compiled with the 'iterator' feature # optional as some merkle stores (like tries) don't support this @@ -21,60 +27,72 @@ backtraces = [] iterator = ["cosmwasm-std/iterator"] staking = ["cosmwasm-std/staking"] # this enables all stargate-related functionality, including the ibc entry points -stargate = ["cosmwasm-std/stargate", "cosmwasm-std/ibc3"] -# Use cranelift backend instead of singlepass. This is required for development on Windows. -cranelift = ["wasmer/cranelift"] -# It's a bit unclear if interface_version_7 (CosmWasm 0.16) contracts are fully compatible -# with newer hosts. If old contracts are important to you and you are willing to take the risk, -# activate this feature. -# See also https://gist.github.com/webmaster128/3cd1988680843ecaf7548050821e1e6f. -allow_interface_version_7 = [] +stargate = ["cosmwasm-std/stargate"] +# For heap profiling. Only used in the "heap_profiling" example. +dhat-heap = ["dep:dhat"] +# ibc2 enables ibc2-dependent messages, entrypoints and queries +ibc2 = ["cosmwasm-std/ibc2"] [lib] # See https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options bench = false -[[example]] -name = "check_contract" -required-features = ["iterator"] - [dependencies] -clru = "0.4.0" +bytes = "1.4.0" # need a higher version than the one required by Wasmer for the Bytes -> Vec implementation +clru = "0.6.1" +crc32fast = "1.3.2" +bech32 = "0.11.0" +blake2 = "0.10.6" # Uses the path when built locally; uses the given version from crates.io when published -cosmwasm-std = { path = "../std", version = "1.1.9", default-features = false } -cosmwasm-crypto = { path = "../crypto", version = "1.1.9" } +cosmwasm-core = { workspace = true } +cosmwasm-std = { workspace = true, features = ["std"] } +cosmwasm-crypto = { workspace = true } +cosmwasm-vm-derive = { workspace = true } +derive_more = { version = "=1.0.0-beta.6", default-features = false, features = ["debug"] } hex = "0.4" -parity-wasm = "0.42" -schemars = "0.8.3" -serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] } -serde_json = "1.0.40" +rand_core = { version = "0.6", features = ["getrandom"] } +serde = { workspace = true } +serde_json = "1.0.140" sha2 = "0.10.3" -thiserror = "1.0.13" -wasmer = { version = "=2.3.0", default-features = false, features = ["cranelift", "universal", "singlepass"] } -wasmer-middlewares = "=2.3.0" -loupe = "0.1.3" +thiserror = "1.0.26" +# We pin wasmer to a specific version because the layout of cached modules can change between patch versions. +wasmer = { version = "=5.0.6", default-features = false, features = ["singlepass"] } +wasmer-middlewares = "=5.0.6" +wasmer-types = "=5.0.6" +strum = { version = "0.26.2", default-features = false, features = ["derive"] } +# For heap profiling. Only used in the "heap_profiling" example. This has to be a non-dev dependency +# because cargo currently does not support optional dev-dependencies. +dhat = { version = "0.3.3", optional = true } -# Dependencies that we do not use ourself. We add those entries -# to bump the min version of them. -bytecheck = "0.6.3" # With this version the simdutf8 dependency became optional -enumset = "1.0.2" # Fixes https://github.com/Lymia/enumset/issues/17 (https://github.com/Lymia/enumset/commit/a430550cd6a3c9b1ef636d37f75dede7616f5b62) -bitflags = "1.1.0" # https://github.com/CensoredUsername/dynasm-rs/pull/74 +# Dependencies that we do not use ourselves. We add those entries to bump the min version of them. +tracing = "0.1.32" # Wasmer git/local (used for quick local debugging or patching) -# wasmer = { git = "https://github.com/wasmerio/wasmer", rev = "877ce1f7c44fad853c", default-features = false, features = ["cranelift", "universal", "singlepass"] } +# wasmer = { git = "https://github.com/wasmerio/wasmer", rev = "877ce1f7c44fad853c", default-features = false, features = ["singlepass"] } # wasmer-middlewares = { git = "https://github.com/wasmerio/wasmer", rev = "877ce1f7c44fad853c" } -# wasmer = { path = "../../../wasmer/lib/api", default-features = false, features = ["cranelift", "universal", "singlepass"] } +# wasmer = { path = "../../../wasmer/lib/api", default-features = false, features = ["singlepass"] } # wasmer-middlewares = { path = "../../../wasmer/lib/middlewares" } [dev-dependencies] -criterion = { version = "0.3", features = [ "html_reports" ] } -hex-literal = "0.3.1" +criterion = { version = "0.5.1", features = ["html_reports"] } +glob = "0.3.1" +hex-literal = "0.4.1" +rand = "0.8" tempfile = "3.1.0" wat = "1.0" -clap = "2.33.3" -rand = "0.8" +wasm-encoder = "0.205.0" +clap = "4" leb128 = "0.2" +target-lexicon = "0.12" +time = { version = "0.3.35", features = ["formatting"] } [[bench]] name = "main" harness = false + +[[example]] +name = "heap_profiling" +path = "examples/heap_profiling.rs" + +[profile.release] +debug = 1 diff --git a/packages/vm/README.md b/packages/vm/README.md index f3b0cc1bb5..a825c7df8d 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -5,8 +5,8 @@ This is an abstraction layer around the wasmer VM to expose just what we need to run cosmwasm contracts in a high-level manner. This is intended both for efficient writing of unit tests, as well as a public API to run contracts in eg. -go-cosmwasm. As such it includes all glue code needed for typical actions, like -fs caching. +[wasmvm](https://github.com/CosmWasm/wasmvm). As such it includes all glue code +needed for typical actions, like fs caching. ## Compatibility @@ -42,59 +42,76 @@ compatibility list: There are demo files in `testdata/*.wasm`. Those are compiled and optimized versions of -[contracts/hackatom](https://github.com/CosmWasm/cosmwasm/tree/main/contracts/hackatom) -and -[contracts/staking](https://github.com/CosmWasm/cosmwasm/tree/main/contracts/staking) -run through [rust-optimizer](https://github.com/CosmWasm/rust-optimizer). +[contracts/\*](https://github.com/CosmWasm/cosmwasm/tree/main/contracts/) run +through [cosmwasm/optimizer](https://github.com/CosmWasm/optimizer). To rebuild the test contracts, go to the repo root and do ```sh docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_hackatom",target=/code/contracts/hackatom/target \ + --mount type=volume,source="devcontract_cache_cyberpunk",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/hackatom \ - && cp artifacts/hackatom.wasm packages/vm/testdata/hackatom_1.0.wasm + cosmwasm/optimizer:0.16.1 ./contracts/cyberpunk \ + && cp artifacts/cyberpunk.wasm packages/vm/testdata/cyberpunk.wasm docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_ibc_reflect",target=/code/contracts/ibc-reflect/target \ + --mount type=volume,source="devcontract_cache_hackatom",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/ibc-reflect \ - && cp artifacts/ibc_reflect.wasm packages/vm/testdata/ibc_reflect_1.0.wasm + cosmwasm/optimizer:0.16.1 ./contracts/hackatom \ + && cp artifacts/hackatom.wasm packages/vm/testdata/hackatom.wasm docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_floaty",target=/code/contracts/floaty/target \ + --mount type=volume,source="devcontract_cache_ibc_reflect",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/floaty \ - && cp artifacts/floaty.wasm packages/vm/testdata/floaty_1.0.wasm + cosmwasm/optimizer:0.16.1 ./contracts/ibc-reflect \ + && cp artifacts/ibc_reflect.wasm packages/vm/testdata/ibc_reflect.wasm + +docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="devcontract_cache_empty",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/optimizer:0.16.1 ./contracts/empty \ + && cp artifacts/empty.wasm packages/vm/testdata/empty.wasm + +docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="devcontract_cache_ibc_callback",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/optimizer:0.16.1 ./contracts/ibc-callbacks \ + && cp artifacts/ibc_callbacks.wasm packages/vm/testdata/ibc_callbacks.wasm ``` -## Testing +The `cyberpunk_rust170.wasm` for +https://github.com/CosmWasm/cosmwasm/issues/1727 is built as follows +(non-reproducible): + +```sh +cd contracts/cyberpunk +rm -r target +RUSTFLAGS='-C link-arg=-s' cargo build --release --lib --target wasm32-unknown-unknown --locked +cp target/wasm32-unknown-unknown/release/cyberpunk.wasm ../../packages/vm/testdata/cyberpunk_rust170.wasm +``` -By default, this repository is built and tested with the singlepass backend. You -can enable the `cranelift` feature to override the default backend with -Cranelift +The `floaty_2.0.wasm` is built using Rust nightly as follows (non-reproducible): ```sh -cd packages/vm -cargo test --features iterator -cargo test --features cranelift,iterator +cd contracts/floaty +RUSTFLAGS="-C link-arg=-s -C target-feature=+nontrapping-fptoint" cargo wasm +cp target/wasm32-unknown-unknown/release/floaty.wasm ../../packages/vm/testdata/floaty_2.0.wasm ``` -## Benchmarking +## Testing -Using Singlepass: +By default, this repository is built and tested with the singlepass backend. -``` +```sh cd packages/vm -cargo bench --no-default-features +cargo test --features iterator ``` -Using Cranelift: +## Benchmarking ``` cd packages/vm -cargo bench --no-default-features --features cranelift +cargo bench --no-default-features ``` ## Tools diff --git a/packages/vm/benches/main.rs b/packages/vm/benches/main.rs index 970a1ca9c3..06aef35320 100644 --- a/packages/vm/benches/main.rs +++ b/packages/vm/benches/main.rs @@ -1,28 +1,28 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion}; use rand::Rng; use std::sync::Arc; -use std::thread; use std::time::{Duration, SystemTime}; +use std::{fs, thread}; use tempfile::TempDir; -use cosmwasm_std::{coins, Empty}; +use cosmwasm_std::{coins, Checksum, Empty}; use cosmwasm_vm::testing::{ mock_backend, mock_env, mock_info, mock_instance_options, MockApi, MockQuerier, MockStorage, }; use cosmwasm_vm::{ - call_execute, call_instantiate, capabilities_from_csv, Cache, CacheOptions, Checksum, Instance, - InstanceOptions, Size, + call_execute, call_instantiate, capabilities_from_csv, Cache, CacheOptions, Instance, + InstanceOptions, Size, VmError, }; // Instance const DEFAULT_MEMORY_LIMIT: Size = Size::mebi(64); -const DEFAULT_GAS_LIMIT: u64 = 1_000_000_000_000; // ~1ms +const DEFAULT_GAS_LIMIT: u64 = 1_000_000_000; // ~1ms const DEFAULT_INSTANCE_OPTIONS: InstanceOptions = InstanceOptions { gas_limit: DEFAULT_GAS_LIMIT, - print_debug: false, }; -const HIGH_GAS_LIMIT: u64 = 20_000_000_000_000_000; // ~20s, allows many calls on one instance +const HIGH_GAS_LIMIT: u64 = 20_000_000_000_000; // ~20s, allows many calls on one instance +const MEDIUM_GAS_LIMIT: u64 = 1_000_000_000_000; // ~1s // Cache const MEMORY_CACHE_SIZE: Size = Size::mebi(200); @@ -31,7 +31,20 @@ const MEMORY_CACHE_SIZE: Size = Size::mebi(200); const INSTANTIATION_THREADS: usize = 128; const CONTRACTS: u64 = 10; -static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); +const DEFAULT_CAPABILITIES: &str = "cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1,cosmwasm_2_2,iterator,staking"; +static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); +static CYBERPUNK: &[u8] = include_bytes!("../testdata/cyberpunk.wasm"); + +static BENCH_CONTRACTS: &[&str] = &[ + "cyberpunk_rust170.wasm", + "cyberpunk.wasm", + "floaty_1.0.wasm", + "floaty_1.2.wasm", + "floaty_2.0.wasm", + "hackatom_1.0.wasm", + "hackatom_1.2.wasm", + "hackatom.wasm", +]; fn bench_instance(c: &mut Criterion) { let mut group = c.benchmark_group("Instance"); @@ -41,7 +54,7 @@ fn bench_instance(c: &mut Criterion) { let backend = mock_backend(&[]); let (instance_options, memory_limit) = mock_instance_options(); let _instance = - Instance::from_code(CONTRACT, backend, instance_options, memory_limit).unwrap(); + Instance::from_code(HACKATOM, backend, instance_options, memory_limit).unwrap(); }); }); @@ -49,16 +62,22 @@ fn bench_instance(c: &mut Criterion) { let backend = mock_backend(&[]); let much_gas: InstanceOptions = InstanceOptions { gas_limit: HIGH_GAS_LIMIT, - ..DEFAULT_INSTANCE_OPTIONS }; let mut instance = - Instance::from_code(CONTRACT, backend, much_gas, Some(DEFAULT_MEMORY_LIMIT)).unwrap(); + Instance::from_code(HACKATOM, backend, much_gas, Some(DEFAULT_MEMORY_LIMIT)).unwrap(); b.iter(|| { - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let contract_result = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let contract_result = call_instantiate::<_, _, _, Empty>( + &mut instance, + &mock_env(), + &info, + msg.as_bytes(), + ) + .unwrap(); assert!(contract_result.into_result().is_ok()); }); }); @@ -67,20 +86,22 @@ fn bench_instance(c: &mut Criterion) { let backend = mock_backend(&[]); let much_gas: InstanceOptions = InstanceOptions { gas_limit: HIGH_GAS_LIMIT, - ..DEFAULT_INSTANCE_OPTIONS }; let mut instance = - Instance::from_code(CONTRACT, backend, much_gas, Some(DEFAULT_MEMORY_LIMIT)).unwrap(); + Instance::from_code(HACKATOM, backend, much_gas, Some(DEFAULT_MEMORY_LIMIT)).unwrap(); - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); let contract_result = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) + .unwrap(); assert!(contract_result.into_result().is_ok()); b.iter(|| { - let info = mock_info("verifies", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&verifier, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; let contract_result = call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); assert!(contract_result.into_result().is_ok()); @@ -91,15 +112,13 @@ fn bench_instance(c: &mut Criterion) { let backend = mock_backend(&[]); let much_gas: InstanceOptions = InstanceOptions { gas_limit: HIGH_GAS_LIMIT, - ..DEFAULT_INSTANCE_OPTIONS }; let mut instance = - Instance::from_code(CONTRACT, backend, much_gas, Some(DEFAULT_MEMORY_LIMIT)).unwrap(); + Instance::from_code(CYBERPUNK, backend, much_gas, Some(DEFAULT_MEMORY_LIMIT)).unwrap(); let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; let contract_result = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, b"{}").unwrap(); assert!(contract_result.into_result().is_ok()); let mut gas_used = 0; @@ -112,7 +131,49 @@ fn bench_instance(c: &mut Criterion) { assert!(contract_result.into_result().is_ok()); gas_used = gas_before - instance.get_gas_left(); }); - println!("Gas used: {}", gas_used); + println!("Gas used: {gas_used}"); + }); + + group.bench_function("execute execute (infinite loop)", |b| { + let backend = mock_backend(&[]); + let medium_gas: InstanceOptions = InstanceOptions { + gas_limit: MEDIUM_GAS_LIMIT, + }; + let mut instance = + Instance::from_code(CYBERPUNK, backend, medium_gas, Some(DEFAULT_MEMORY_LIMIT)) + .unwrap(); + + let info = mock_info("creator", &coins(1000, "earth")); + let contract_result = + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, b"{}").unwrap(); + assert!(contract_result.into_result().is_ok()); + + let mut gas_used = 0; + b.iter_batched( + || { + // setup new instance for each iteration because cpu loop will consume all gas + Instance::from_code( + CYBERPUNK, + mock_backend(&[]), + medium_gas, + Some(DEFAULT_MEMORY_LIMIT), + ) + .unwrap() + }, + |mut instance| { + let gas_before = instance.get_gas_left(); + let info = mock_info("hasher", &[]); + let msg = br#"{"cpu_loop":{}}"#; + + let vm_result = + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg); + + assert!(matches!(vm_result, Err(VmError::GasDepletion { .. }))); + gas_used = gas_before - instance.get_gas_left(); + }, + BatchSize::SmallInput, + ); + println!("Gas used: {gas_used}"); }); group.finish(); @@ -121,19 +182,20 @@ fn bench_instance(c: &mut Criterion) { fn bench_cache(c: &mut Criterion) { let mut group = c.benchmark_group("Cache"); - let options = CacheOptions { - base_dir: TempDir::new().unwrap().into_path(), - available_capabilities: capabilities_from_csv("iterator,staking"), - memory_cache_size: MEMORY_CACHE_SIZE, - instance_memory_limit: DEFAULT_MEMORY_LIMIT, - }; + let temp_dir = TempDir::new().unwrap(); + let options = CacheOptions::new( + temp_dir.path(), + capabilities_from_csv(DEFAULT_CAPABILITIES), + MEMORY_CACHE_SIZE, + DEFAULT_MEMORY_LIMIT, + ); group.bench_function("save wasm", |b| { let cache: Cache = unsafe { Cache::new(options.clone()).unwrap() }; b.iter(|| { - let result = cache.save_wasm(CONTRACT); + let result = cache.store_code(HACKATOM, true, true); assert!(result.is_ok()); }); }); @@ -141,7 +203,7 @@ fn bench_cache(c: &mut Criterion) { group.bench_function("load wasm", |b| { let cache: Cache = unsafe { Cache::new(options.clone()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); b.iter(|| { let result = cache.load_wasm(&checksum); @@ -149,27 +211,68 @@ fn bench_cache(c: &mut Criterion) { }); }); - group.bench_function("analyze", |b| { - let cache: Cache = - unsafe { Cache::new(options.clone()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + group.bench_function("load wasm unchecked", |b| { + let options = options.clone(); + let mut cache: Cache = + unsafe { Cache::new(options).unwrap() }; + cache.set_module_unchecked(true); + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); b.iter(|| { - let result = cache.analyze(&checksum); + let result = cache.load_wasm(&checksum); assert!(result.is_ok()); }); }); + for contract_name in BENCH_CONTRACTS { + let contract_wasm = fs::read(format!("testdata/{contract_name}")).unwrap(); + let cache: Cache = + unsafe { Cache::new(options.clone()).unwrap() }; + let checksum = cache.store_code(&contract_wasm, true, true).unwrap(); + + group.bench_function(format!("analyze_{contract_name}"), |b| { + b.iter(|| { + let result = cache.analyze(&checksum); + assert!(result.is_ok()); + }); + }); + } + + let temp_dir = TempDir::new().unwrap(); group.bench_function("instantiate from fs", |b| { - let non_memcache = CacheOptions { - base_dir: TempDir::new().unwrap().into_path(), - available_capabilities: capabilities_from_csv("iterator,staking"), - memory_cache_size: Size(0), - instance_memory_limit: DEFAULT_MEMORY_LIMIT, - }; + let non_memcache = CacheOptions::new( + temp_dir.path(), + capabilities_from_csv(DEFAULT_CAPABILITIES), + Size::new(0), + DEFAULT_MEMORY_LIMIT, + ); let cache: Cache = unsafe { Cache::new(non_memcache).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); + + b.iter(|| { + let _ = cache + .get_instance(&checksum, mock_backend(&[]), DEFAULT_INSTANCE_OPTIONS) + .unwrap(); + assert_eq!(cache.stats().hits_pinned_memory_cache, 0); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert!(cache.stats().hits_fs_cache >= 1); + assert_eq!(cache.stats().misses, 0); + }); + }); + + let temp_dir = TempDir::new().unwrap(); + group.bench_function("instantiate from fs unchecked", |b| { + let non_memcache = CacheOptions::new( + temp_dir.path(), + capabilities_from_csv(DEFAULT_CAPABILITIES), + Size::new(0), + DEFAULT_MEMORY_LIMIT, + ); + let mut cache: Cache = + unsafe { Cache::new(non_memcache).unwrap() }; + cache.set_module_unchecked(true); + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); b.iter(|| { let _ = cache @@ -183,7 +286,7 @@ fn bench_cache(c: &mut Criterion) { }); group.bench_function("instantiate from memory", |b| { - let checksum = Checksum::generate(CONTRACT); + let checksum = Checksum::generate(HACKATOM); let cache: Cache = unsafe { Cache::new(options.clone()).unwrap() }; // Load into memory @@ -204,7 +307,7 @@ fn bench_cache(c: &mut Criterion) { }); group.bench_function("instantiate from pinned memory", |b| { - let checksum = Checksum::generate(CONTRACT); + let checksum = Checksum::generate(HACKATOM); let cache: Cache = unsafe { Cache::new(options.clone()).unwrap() }; // Load into pinned memory @@ -225,14 +328,15 @@ fn bench_cache(c: &mut Criterion) { group.finish(); } -pub fn bench_instance_threads(c: &mut Criterion) { +fn bench_instance_threads(c: &mut Criterion) { + let temp_dir = TempDir::new().unwrap(); c.bench_function("multi-threaded get_instance", |b| { - let options = CacheOptions { - base_dir: TempDir::new().unwrap().into_path(), - available_capabilities: capabilities_from_csv("iterator,staking"), - memory_cache_size: MEMORY_CACHE_SIZE, - instance_memory_limit: DEFAULT_MEMORY_LIMIT, - }; + let options = CacheOptions::new( + temp_dir.path(), + capabilities_from_csv(DEFAULT_CAPABILITIES), + MEMORY_CACHE_SIZE, + DEFAULT_MEMORY_LIMIT, + ); let cache: Cache = unsafe { Cache::new(options).unwrap() }; @@ -248,10 +352,10 @@ pub fn bench_instance_threads(c: &mut Criterion) { // Offset to the i32.const (0x41) 15731626 (0xf00baa) (unsigned leb128 encoded) instruction // data we want to replace let query_int_data = b"\x41\xaa\x97\xc0\x07"; - let offset = find_subsequence(CONTRACT, query_int_data).unwrap() + 1; + let offset = find_subsequence(HACKATOM, query_int_data).unwrap() + 1; let mut leb128_buf = [0; 4]; - let mut contract = CONTRACT.to_vec(); + let mut contract = HACKATOM.to_vec(); let mut random_checksum = || { let mut writable = &mut leb128_buf[..]; @@ -264,8 +368,8 @@ pub fn bench_instance_threads(c: &mut Criterion) { // Splice data in contract contract.splice(offset..offset + leb128_buf.len(), leb128_buf); - cache.save_wasm(contract.as_slice()).unwrap() - // let checksum = cache.save_wasm(contract.as_slice()).unwrap(); + cache.store_code(contract.as_slice(), true, true).unwrap() + // let checksum = cache.store_code(contract.as_slice(), true, true).unwrap(); // Preload into memory // cache // .get_instance(&checksum, mock_backend(&[]), DEFAULT_INSTANCE_OPTIONS) @@ -282,7 +386,6 @@ pub fn bench_instance_threads(c: &mut Criterion) { let checksum = random_checksum(); thread::spawn(move || { - let checksum = checksum; // Perform measurement internally let t = SystemTime::now(); black_box( @@ -311,24 +414,128 @@ pub fn bench_instance_threads(c: &mut Criterion) { }); } -fn make_config() -> Criterion { +fn bench_combined(c: &mut Criterion) { + let mut group = c.benchmark_group("Combined"); + + let temp_dir = TempDir::new().unwrap(); + let options = CacheOptions::new( + temp_dir.path(), + capabilities_from_csv("cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,iterator,staking"), + MEMORY_CACHE_SIZE, + DEFAULT_MEMORY_LIMIT, + ); + + // Store contracts for all benchmarks in this group + let checksum: Checksum = { + let cache: Cache = + unsafe { Cache::new(options.clone()).unwrap() }; + cache.store_code(CYBERPUNK, true, true).unwrap() + }; + + group.bench_function("get instance from fs cache and execute", |b| { + let mut non_memcache = options.clone(); + non_memcache.memory_cache_size_bytes = Size::kibi(0); + + let cache: Cache = + unsafe { Cache::new(non_memcache).unwrap() }; + + b.iter(|| { + let mut instance = cache + .get_instance(&checksum, mock_backend(&[]), DEFAULT_INSTANCE_OPTIONS) + .unwrap(); + assert_eq!(cache.stats().hits_pinned_memory_cache, 0); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert!(cache.stats().hits_fs_cache >= 1); + assert_eq!(cache.stats().misses, 0); + + let info = mock_info("guest", &[]); + let msg = br#"{"noop":{}}"#; + let contract_result = + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + contract_result.into_result().unwrap(); + }); + }); + + group.bench_function("get instance from memory cache and execute", |b| { + let cache: Cache = + unsafe { Cache::new(options.clone()).unwrap() }; + + // Load into memory + cache + .get_instance(&checksum, mock_backend(&[]), DEFAULT_INSTANCE_OPTIONS) + .unwrap(); + + b.iter(|| { + let backend = mock_backend(&[]); + let mut instance = cache + .get_instance(&checksum, backend, DEFAULT_INSTANCE_OPTIONS) + .unwrap(); + assert_eq!(cache.stats().hits_pinned_memory_cache, 0); + assert!(cache.stats().hits_memory_cache >= 1); + assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().misses, 0); + + let info = mock_info("guest", &[]); + let msg = br#"{"noop":{}}"#; + let contract_result = + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + contract_result.into_result().unwrap(); + }); + }); + + group.bench_function("get instance from pinned memory and execute", |b| { + let cache: Cache = + unsafe { Cache::new(options.clone()).unwrap() }; + + // Load into pinned memory + cache.pin(&checksum).unwrap(); + + b.iter(|| { + let backend = mock_backend(&[]); + let mut instance = cache + .get_instance(&checksum, backend, DEFAULT_INSTANCE_OPTIONS) + .unwrap(); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert!(cache.stats().hits_pinned_memory_cache >= 1); + assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().misses, 0); + + let info = mock_info("guest", &[]); + let msg = br#"{"noop":{}}"#; + let contract_result = + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + contract_result.into_result().unwrap(); + }); + }); + + group.finish(); +} + +fn make_config(measurement_time_s: u64) -> Criterion { Criterion::default() .without_plots() - .measurement_time(Duration::new(10, 0)) + .measurement_time(Duration::new(measurement_time_s, 0)) .sample_size(12) .configure_from_args() } criterion_group!( name = instance; - config = make_config(); + config = make_config(8); targets = bench_instance ); criterion_group!( name = cache; - config = make_config(); + config = make_config(8); targets = bench_cache ); +// Combines loading module from cache, instantiating it and executing the instance. +// This is what every call in libwasmvm does. +criterion_group!( + name = combined; + config = make_config(5); + targets = bench_combined +); criterion_group!( name = multi_threaded_instance; config = Criterion::default() @@ -338,4 +545,4 @@ criterion_group!( .configure_from_args(); targets = bench_instance_threads ); -criterion_main!(instance, cache, multi_threaded_instance); +criterion_main!(instance, cache, combined, multi_threaded_instance); diff --git a/packages/vm/examples/check_contract.rs b/packages/vm/examples/check_contract.rs deleted file mode 100644 index 1d53b164ee..0000000000 --- a/packages/vm/examples/check_contract.rs +++ /dev/null @@ -1,57 +0,0 @@ -use std::fs::File; -use std::io::Read; - -use clap::{App, Arg}; - -use cosmwasm_vm::capabilities_from_csv; -use cosmwasm_vm::internals::{check_wasm, compile}; - -const DEFAULT_AVAILABLE_CAPABILITIES: &str = "iterator,staking,stargate,cosmwasm_1_1"; - -pub fn main() { - eprintln!("`check_contract` will be removed from the next version of `cosmwasm-vm` - please use `cosmwasm-check` instead."); - eprintln!("> cargo install cosmwasm-check"); - - let matches = App::new("Contract checking") - .version("0.1.0") - .long_about("Checks the given wasm file (memories, exports, imports, available capabilities, and non-determinism).") - .author("Mauro Lacy ") - .arg( - Arg::with_name("CAPABILITIES") - // `long` setting required to turn the position argument into an option 🤷 - .long("available-capabilities") - .aliases(&["FEATURES", "supported-features"]) // Old names - .value_name("CAPABILITIES") - .help("Sets the available capabilities that the desired target chain has") - .takes_value(true) - ) - .arg( - Arg::with_name("WASM") - .help("Wasm file to read and compile") - .required(true) - .index(1), - ) - .get_matches(); - - // Available capabilities - let available_capabilities_csv = matches - .value_of("CAPABILITIES") - .unwrap_or(DEFAULT_AVAILABLE_CAPABILITIES); - let available_capabilities = capabilities_from_csv(available_capabilities_csv); - println!("Available capabilities: {:?}", available_capabilities); - - // File - let path = matches.value_of("WASM").expect("Error parsing file name"); - let mut file = File::open(path).unwrap(); - - // Read wasm - let mut wasm = Vec::::new(); - file.read_to_end(&mut wasm).unwrap(); - - // Check wasm - check_wasm(&wasm, &available_capabilities).unwrap(); - - // Compile module - compile(&wasm, None, &[]).unwrap(); - println!("contract checks passed.") -} diff --git a/packages/vm/examples/heap_profiling.rs b/packages/vm/examples/heap_profiling.rs new file mode 100644 index 0000000000..d1010bb570 --- /dev/null +++ b/packages/vm/examples/heap_profiling.rs @@ -0,0 +1,210 @@ +// Run with +// cargo run --features dhat-heap --example heap_profiling --release + +use std::time::{Duration, SystemTime}; +use tempfile::TempDir; +use time::{format_description::well_known::Rfc3339, OffsetDateTime}; + +use cosmwasm_std::{coins, Checksum, Empty}; +use cosmwasm_vm::testing::{mock_backend, mock_env, mock_info, MockApi, MockQuerier, MockStorage}; +use cosmwasm_vm::{ + call_execute, call_instantiate, capabilities_from_csv, Cache, CacheOptions, InstanceOptions, + Size, +}; + +use clap::{Arg, Command}; + +#[cfg(feature = "dhat-heap")] +#[global_allocator] +static ALLOC: dhat::Alloc = dhat::Alloc; + +/// Number of seconds after which the test stops +const ROUNDS: usize = 1024; +const ROUND_LEN: usize = 16; + +// Instance +const DEFAULT_MEMORY_LIMIT: Size = Size::mebi(64); +const DEFAULT_GAS_LIMIT: u64 = u64::MAX; +const DEFAULT_INSTANCE_OPTIONS: InstanceOptions = InstanceOptions { + gas_limit: DEFAULT_GAS_LIMIT, +}; +// Cache +const MEMORY_CACHE_SIZE: Size = Size::mebi(5); + +struct Execute { + pub msg: &'static [u8], + pub expect_error: bool, +} + +struct Contract { + pub wasm: &'static [u8], + pub instantiate_msg: Option>, + pub execute_msgs: Vec, +} + +fn contracts() -> Vec { + let api = MockApi::default(); + let verifier = api.addr_make("verifies"); + let beneficiary = api.addr_make("benefits"); + vec![ + Contract { + wasm: include_bytes!("../testdata/cyberpunk.wasm"), + instantiate_msg: Some(b"{}".to_vec()), + execute_msgs: vec![ + Execute { + msg: br#"{"unreachable":{}}"#, + expect_error: true, + }, + Execute { + msg: br#"{"allocate_large_memory":{"pages":1000}}"#, + expect_error: false, + }, + Execute { + // mem_cost in KiB + msg: br#"{"argon2":{"mem_cost":256,"time_cost":1}}"#, + expect_error: false, + }, + Execute { + msg: br#"{"memory_loop":{}}"#, + expect_error: true, + }, + ], + }, + Contract { + wasm: include_bytes!("../testdata/hackatom.wasm"), + instantiate_msg: Some( + format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#) + .into_bytes(), + ), + execute_msgs: vec![Execute { + msg: br#"{"release":{"denom":"earth"}}"#, + expect_error: false, + }], + }, + Contract { + wasm: include_bytes!("../testdata/hackatom_1.0.wasm"), + instantiate_msg: Some( + format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#) + .into_bytes(), + ), + execute_msgs: vec![Execute { + msg: br#"{"release":{"denom":"earth"}}"#, + expect_error: false, + }], + }, + Contract { + wasm: include_bytes!("../testdata/ibc_reflect.wasm"), + instantiate_msg: None, + execute_msgs: vec![], + }, + ] +} + +#[allow(clippy::collapsible_else_if)] +fn app(runtime: u64) { + let start_time = SystemTime::now(); + + let temp_dir = TempDir::new().unwrap(); + let options = CacheOptions::new( + temp_dir.path(), + capabilities_from_csv("iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1"), + MEMORY_CACHE_SIZE, + DEFAULT_MEMORY_LIMIT, + ); + + let contracts = contracts(); + + let checksums = { + let cache: Cache = + unsafe { Cache::new(options.clone()).unwrap() }; + + let mut checksums = Vec::::new(); + for contract in &contracts { + checksums.push(cache.store_code(contract.wasm, true, true).unwrap()); + } + checksums + }; + + let after = SystemTime::now().duration_since(start_time).unwrap(); + eprintln!("Done compiling after {after:?}"); + + let cache: Cache = unsafe { Cache::new(options).unwrap() }; + for round in 0..ROUNDS { + for _ in 0..ROUND_LEN { + if SystemTime::now().duration_since(start_time).unwrap() > Duration::from_secs(runtime) + { + eprintln!("Round {round}. End time reached. Ending the process"); + + let metrics = cache.metrics(); + eprintln!("Cache metrics: {metrics:?}"); + + return; // ends app() + } + + for idx in 0..contracts.len() { + let mut instance = cache + .get_instance(&checksums[idx], mock_backend(&[]), DEFAULT_INSTANCE_OPTIONS) + .unwrap(); + + instance.set_debug_handler(|_msg, info| { + let _t = now_rfc3339(); + let _gas = info.gas_remaining; + //eprintln!("[{t}]: {msg} (gas remaining: {gas})"); + }); + + if let Some(msg) = &contracts[idx].instantiate_msg { + let info = mock_info("creator", &coins(1000, "earth")); + let contract_result = + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) + .unwrap(); + assert!(contract_result.into_result().is_ok()); + } + + for (execution_idx, execute) in contracts[idx].execute_msgs.iter().enumerate() { + let info = mock_info("verifies", &coins(15, "earth")); + let msg = execute.msg; + let res = + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg); + + if execute.expect_error { + if res.is_ok() { + panic!( + "Round {round}, Execution {execution_idx}, Contract {idx}. Expected error but got {res:?}" + ); + } + } else { + if res.is_err() { + panic!("Round {round}, Execution {execution_idx}, Contract {idx}. Expected no error but got {res:?}"); + } + } + } + } + } + } +} + +fn now_rfc3339() -> String { + let dt = OffsetDateTime::from(SystemTime::now()); + dt.format(&Rfc3339).unwrap_or_default() +} + +pub fn main() { + let matches = Command::new("Heap profiling") + .version("0.0.0") + .arg( + Arg::new("runtime") + .long("runtime") + .help("Time in seconds how long the tests should be running") + .value_parser(clap::value_parser!(u64).range(1..10_000)) + .default_value("30"), + ) + .get_matches(); + let runtime = matches + .get_one::("runtime") + .expect("Error parsing time argument"); + + #[cfg(feature = "dhat-heap")] + let _profiler = dhat::Profiler::new_heap(); + + app(*runtime); +} diff --git a/packages/vm/examples/module_size.rs b/packages/vm/examples/module_size.rs index ac62a6b694..9b1f1d973e 100644 --- a/packages/vm/examples/module_size.rs +++ b/packages/vm/examples/module_size.rs @@ -2,19 +2,17 @@ use std::fs::File; use std::io::Read; use std::mem; -use clap::{App, Arg}; +use clap::{Arg, Command}; -use cosmwasm_vm::internals::compile; -use cosmwasm_vm::internals::make_runtime_store; -use cosmwasm_vm::Size; -use wasmer::Module; +use cosmwasm_vm::internals::{compile, make_compiling_engine}; +use wasmer::{Engine, Module}; pub fn main() { - let matches = App::new("Module size estimation") - .version("0.0.3") - .author("Mauro Lacy ") + let matches = Command::new("Module size estimation") + .version("0.0.4") + .author("Mauro Lacy ") .arg( - Arg::with_name("WASM") + Arg::new("WASM") .help("Wasm file to read and compile") .required(true) .index(1), @@ -22,7 +20,7 @@ pub fn main() { .get_matches(); // File - let path = matches.value_of("WASM").expect("Error parsing file name"); + let path: &String = matches.get_one("WASM").expect("Error parsing file name"); let mut file = File::open(path).unwrap(); mem::drop(matches); @@ -33,34 +31,25 @@ pub fn main() { // Report wasm size let wasm_size = wasm.len(); - println!("wasm size: {} bytes", wasm_size); - - let memory_limit = Some(Size::mebi(10)); + println!("wasm size: {wasm_size} bytes"); // Compile module - let module = module_compile(&wasm, memory_limit); + let engine = make_compiling_engine(None); + let module = compile(&engine, &wasm).unwrap(); mem::drop(wasm); - // Report loupe size - let loupe_size = loupe::size_of_val(&module); - println!("module size (loupe): {} bytes", loupe_size); - let serialized = module.serialize().unwrap(); mem::drop(module); // Deserialize module - let module = module_deserialize(&serialized, memory_limit); + let module = module_deserialize(&engine, &serialized); mem::drop(serialized); // Report (serialized) module size let serialized = module.serialize().unwrap(); mem::drop(module); let ser_size = serialized.len(); - println!("module size (serialized): {} bytes", ser_size); - println!( - "(loupe) module size ratio: {:.2}", - loupe_size as f32 / wasm_size as f32 - ); + println!("module size (serialized): {ser_size} bytes"); println!( "(serialized) module size ratio: {:.2}", ser_size as f32 / wasm_size as f32 @@ -68,13 +57,6 @@ pub fn main() { } #[inline(never)] -fn module_compile(wasm: &[u8], memory_limit: Option) -> Module { - compile(wasm, memory_limit, &[]).unwrap() -} - -#[inline(never)] -fn module_deserialize(serialized: &[u8], memory_limit: Option) -> Module { - // Deserialize using make_runtime_store() - let store = make_runtime_store(memory_limit); - unsafe { Module::deserialize(&store, serialized) }.unwrap() +fn module_deserialize(engine: &Engine, serialized: &[u8]) -> Module { + unsafe { Module::deserialize(&engine, serialized) }.unwrap() } diff --git a/packages/vm/examples/module_size.sh b/packages/vm/examples/module_size.sh index 80ed757a42..6e1a5e4b79 100755 --- a/packages/vm/examples/module_size.sh +++ b/packages/vm/examples/module_size.sh @@ -1,8 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Uses valgrind's massif tool to compute heap memory consumption of compiled modules. -# For a wasmer `Modulej , it has been determined that this method underestimates the size -# of the module significanty. -# Use loupe::size_of_val instead, to get a better estimation. +# For a wasmer `Module`, it has been determined that this method underestimates the size +# of the module significantly. set -e MAX_SNAPSHOTS=1000 diff --git a/packages/vm/examples/multi_threaded_cache.rs b/packages/vm/examples/multi_threaded_cache.rs index 16053ee920..5d7538b0eb 100644 --- a/packages/vm/examples/multi_threaded_cache.rs +++ b/packages/vm/examples/multi_threaded_cache.rs @@ -11,60 +11,66 @@ use cosmwasm_vm::{ // Instance const DEFAULT_MEMORY_LIMIT: Size = Size::mebi(64); -const DEFAULT_GAS_LIMIT: u64 = 400_000 * 150_000; +const DEFAULT_GAS_LIMIT: u64 = 400_000 * 150; const DEFAULT_INSTANCE_OPTIONS: InstanceOptions = InstanceOptions { gas_limit: DEFAULT_GAS_LIMIT, - print_debug: false, }; // Cache const MEMORY_CACHE_SIZE: Size = Size::mebi(200); -static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); +static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); -const SAVE_WASM_THREADS: usize = 32; +const STORE_CODE_THREADS: usize = 32; const INSTANTIATION_THREADS: usize = 2048; -const THREADS: usize = SAVE_WASM_THREADS + INSTANTIATION_THREADS; +const THREADS: usize = STORE_CODE_THREADS + INSTANTIATION_THREADS; pub fn main() { - let options = CacheOptions { - base_dir: TempDir::new().unwrap().into_path(), - available_capabilities: capabilities_from_csv("iterator,staking"), - memory_cache_size: MEMORY_CACHE_SIZE, - instance_memory_limit: DEFAULT_MEMORY_LIMIT, - }; + let temp_dir = TempDir::new().unwrap(); + let options = CacheOptions::new( + temp_dir.path(), + capabilities_from_csv("iterator,staking,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1,cosmwasm_2_2"), + MEMORY_CACHE_SIZE, + DEFAULT_MEMORY_LIMIT, + ); let cache: Cache = unsafe { Cache::new(options).unwrap() }; let cache = Arc::new(cache); - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); let mut threads = Vec::with_capacity(THREADS); - for _ in 0..SAVE_WASM_THREADS { + for _ in 0..STORE_CODE_THREADS { let cache = Arc::clone(&cache); threads.push(thread::spawn(move || { - let checksum = cache.save_wasm(CONTRACT).unwrap(); - println!("Done saving Wasm {}", checksum); + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); + println!("Done saving Wasm {checksum}"); })); } - for _ in 0..INSTANTIATION_THREADS { + for i in 0..INSTANTIATION_THREADS { let cache = Arc::clone(&cache); threads.push(thread::spawn(move || { - let checksum = checksum; let mut instance = cache .get_instance(&checksum, mock_backend(&[]), DEFAULT_INSTANCE_OPTIONS) .unwrap(); - println!("Done instantiating contract"); + println!("Done instantiating contract {i}"); - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let contract_result = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let contract_result = call_instantiate::<_, _, _, Empty>( + &mut instance, + &mock_env(), + &info, + msg.as_bytes(), + ) + .unwrap(); assert!(contract_result.into_result().is_ok()); - let info = mock_info("verifies", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&verifier, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; let contract_result = call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); assert!(contract_result.into_result().is_ok()); @@ -74,7 +80,7 @@ pub fn main() { threads.into_iter().for_each(|thread| { thread .join() - .expect("The thread creating or execution failed !") + .expect("The threaded instantiation or execution failed !") }); assert_eq!(cache.stats().misses, 0); diff --git a/packages/vm/src/backend.rs b/packages/vm/src/backend.rs index ea9a085007..f3760be066 100644 --- a/packages/vm/src/backend.rs +++ b/packages/vm/src/backend.rs @@ -10,6 +10,10 @@ use cosmwasm_std::{Order, Record}; /// A structure that represents gas cost to be deducted from the remaining gas. /// This is always needed when computations are performed outside of /// Wasm execution, such as calling crypto APIs or calls into the blockchain. +/// +/// All values are measured in [CosmWasm gas]. +/// +/// [CosmWasm gas]: https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct GasInfo { /// The gas cost of a computation that was executed already but not yet charged. @@ -19,6 +23,12 @@ pub struct GasInfo { pub cost: u64, /// Gas that was used and charged externally. This is needed to /// adjust the VM's gas limit but does not affect the gas usage. + /// + /// Since this is measured in [CosmWasm gas], the caller may need + /// to convert from Cosmos SDK gas in cases where an SDK gas meter + /// is used. + /// + /// [CosmWasm gas]: https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md pub externally_used: u64, } @@ -85,7 +95,7 @@ pub trait Storage { fn get(&self, key: &[u8]) -> BackendResult>>; /// Allows iteration over a set of key/value pairs, either forwards or backwards. - /// Returns an interator ID that is unique within the Storage instance. + /// Returns an iterator ID that is unique within the Storage instance. /// /// The bound `start` is inclusive and `end` is exclusive. /// @@ -112,6 +122,34 @@ pub trait Storage { #[cfg(feature = "iterator")] fn next(&mut self, iterator_id: u32) -> BackendResult>; + /// Returns the next value of the iterator with the given ID. + /// Since the iterator is incremented, the corresponding key will never be accessible. + /// + /// If the ID is not found, a BackendError::IteratorDoesNotExist is returned. + /// + /// The default implementation uses [`Storage::next`] and discards the key. + /// More efficient implementations might be possible depending on the storage. + #[cfg(feature = "iterator")] + fn next_value(&mut self, iterator_id: u32) -> BackendResult>> { + let (result, gas_info) = self.next(iterator_id); + let result = result.map(|record| record.map(|(_, v)| v)); + (result, gas_info) + } + + /// Returns the next key of the iterator with the given ID. + /// Since the iterator is incremented, the corresponding value will never be accessible. + /// + /// If the ID is not found, a BackendError::IteratorDoesNotExist is returned. + /// + /// The default implementation uses [`Storage::next`] and discards the value. + /// More efficient implementations might be possible depending on the storage. + #[cfg(feature = "iterator")] + fn next_key(&mut self, iterator_id: u32) -> BackendResult>> { + let (result, gas_info) = self.next(iterator_id); + let result = result.map(|record| record.map(|(k, _)| k)); + (result, gas_info) + } + fn set(&mut self, key: &[u8], value: &[u8]) -> BackendResult<()>; /// Removes a database entry at `key`. @@ -127,12 +165,10 @@ pub trait Storage { /// Currently it just supports address conversion, we could add eg. crypto functions here. /// These should all be pure (stateless) functions. If you need state, you probably want /// to use the Querier. -/// -/// We can use feature flags to opt-in to non-essential methods -/// for backwards compatibility in systems that don't have them all. -pub trait BackendApi: Copy + Clone + Send { - fn canonical_address(&self, human: &str) -> BackendResult>; - fn human_address(&self, canonical: &[u8]) -> BackendResult; +pub trait BackendApi: Clone + Send { + fn addr_validate(&self, input: &str) -> BackendResult<()>; + fn addr_canonicalize(&self, human: &str) -> BackendResult>; + fn addr_humanize(&self, canonical: &[u8]) -> BackendResult; } pub trait Querier { @@ -141,10 +177,12 @@ pub trait Querier { /// knowing the custom format, or we can decode it, with the knowledge of the allowed /// types. /// - /// The gas limit describes how much VM gas this particular query is allowed - /// to comsume when measured separately from the rest of the contract. + /// The gas limit describes how much [CosmWasm gas] this particular query is allowed + /// to consume when measured separately from the rest of the contract. /// The returned gas info (in BackendResult) can exceed the gas limit in cases /// where the query could not be aborted exactly at the limit. + /// + /// [CosmWasm gas]: https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md fn query_raw( &self, request: &[u8], @@ -153,10 +191,29 @@ pub trait Querier { } /// A result type for calling into the backend. Such a call can cause -/// non-negligible computational cost in both success and faiure case and must always have gas information -/// attached. +/// non-negligible computational cost in both success and failure case and +/// must always have gas information attached. pub type BackendResult = (core::result::Result, GasInfo); +/// This aims to be similar to the `?` operator, but for a [`BackendResult`]. +/// +/// The first argument is a result. If it is Ok, return the value. +/// If it is Err, end the current function with a `return BackendResult::Err`. +/// +/// The second argument is the gas value that will be used in the error case. +/// It should be the sum of all gas used in the calling function. +macro_rules! unwrap_or_return_with_gas { + ($result: expr $(,)?, $gas_total: expr $(,)?) => {{ + let result: core::result::Result<_, _> = $result; // just a type check + let gas: GasInfo = $gas_total; // just a type check + match result { + Ok(v) => v, + Err(e) => return (Err(e), gas), + } + }}; +} +pub(crate) use unwrap_or_return_with_gas; + #[derive(Error, Debug, PartialEq, Eq)] #[non_exhaustive] pub enum BackendError { @@ -304,7 +361,7 @@ mod tests { let error = BackendError::foreign_panic(); match error { BackendError::ForeignPanic { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -313,7 +370,7 @@ mod tests { let error = BackendError::bad_argument(); match error { BackendError::BadArgument { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -322,7 +379,7 @@ mod tests { let error = BackendError::iterator_does_not_exist(15); match error { BackendError::IteratorDoesNotExist { id, .. } => assert_eq!(id, 15), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -331,7 +388,7 @@ mod tests { let error = BackendError::out_of_gas(); match error { BackendError::OutOfGas { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -340,7 +397,7 @@ mod tests { let error = BackendError::unknown("broken"); match error { BackendError::Unknown { msg, .. } => assert_eq!(msg, "broken"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -349,7 +406,7 @@ mod tests { let error = BackendError::user_err("invalid input"); match error { BackendError::UserErr { msg, .. } => assert_eq!(msg, "invalid input"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -360,7 +417,7 @@ mod tests { let error: BackendError = String::from_utf8(vec![0x80]).unwrap_err().into(); match error { BackendError::InvalidUtf8 { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } } diff --git a/packages/vm/src/cache.rs b/packages/vm/src/cache.rs index 6310f3ca40..967cf0fb15 100644 --- a/packages/vm/src/cache.rs +++ b/packages/vm/src/cache.rs @@ -1,20 +1,26 @@ -use std::collections::HashSet; -use std::fs::{create_dir_all, File, OpenOptions}; +use std::collections::{BTreeSet, HashSet}; +use std::fs::{self, File, OpenOptions}; use std::io::{Read, Write}; use std::marker::PhantomData; use std::path::{Path, PathBuf}; +use std::str::FromStr; use std::sync::Mutex; +use wasmer::{Module, Store}; + +use cosmwasm_std::Checksum; use crate::backend::{Backend, BackendApi, Querier, Storage}; use crate::capabilities::required_capabilities_from_module; -use crate::checksum::Checksum; use crate::compatibility::check_wasm; +use crate::config::{CacheOptions, Config, WasmLimits}; use crate::errors::{VmError, VmResult}; +use crate::filesystem::mkdir_p; use crate::instance::{Instance, InstanceOptions}; -use crate::modules::{FileSystemCache, InMemoryCache, PinnedMemoryCache}; +use crate::modules::{CachedModule, FileSystemCache, InMemoryCache, PinnedMemoryCache}; +use crate::parsed_wasm::ParsedWasm; use crate::size::Size; -use crate::static_analysis::{deserialize_wasm, has_ibc_entry_points}; -use crate::wasm_backend::{compile, make_runtime_store}; +use crate::static_analysis::{Entrypoint, ExportInfo, REQUIRED_IBC_EXPORTS}; +use crate::wasm_backend::{compile, make_compiling_engine}; const STATE_DIR: &str = "state"; // Things related to the state of the blockchain. @@ -24,6 +30,13 @@ const CACHE_DIR: &str = "cache"; // Cacheable things. const MODULES_DIR: &str = "modules"; +/// Statistics about the usage of a cache instance. Those values are node +/// specific and must not be used in a consensus critical context. +/// When a node is hit by a client for simulations or other queries, hits and misses +/// increase. Also a node restart will reset the values. +/// +/// All values should be increment using saturated addition to ensure the node does not +/// crash in case the stats exceed the integer limit. #[derive(Debug, Default, Clone, Copy)] pub struct Stats { pub hits_pinned_memory_cache: u32, @@ -41,21 +54,25 @@ pub struct Metrics { pub size_memory_cache: usize, } -#[derive(Clone, Debug)] -pub struct CacheOptions { - pub base_dir: PathBuf, - pub available_capabilities: HashSet, - pub memory_cache_size: Size, - /// Memory limit for instances, in bytes. Use a value that is divisible by the Wasm page size 65536, - /// e.g. full MiBs. - pub instance_memory_limit: Size, +#[derive(Debug, Clone)] +pub struct PerModuleMetrics { + /// Hits (i.e. loads) of the module from the cache + pub hits: u32, + /// Size the module takes up in memory + pub size: usize, +} + +#[derive(Debug, Clone)] +pub struct PinnedMetrics { + // It is *intentional* that this is only a vector + // We don't need a potentially expensive hashing algorithm here + // The checksums are sourced from a hashmap already, ensuring uniqueness of the checksums + pub per_module: Vec<(Checksum, PerModuleMetrics)>, } pub struct CacheInner { + /// The directory in which the Wasm blobs are stored in the file system. wasm_path: PathBuf, - /// Instances memory limit in bytes. Use a value that is divisible by the Wasm page size 65536, - /// e.g. full MiBs. - instance_memory_limit: Size, pinned_memory_cache: PinnedMemoryCache, memory_cache: InMemoryCache, fs_cache: FileSystemCache, @@ -67,18 +84,28 @@ pub struct Cache { /// i.e. any number of read-only references is allowed to access it concurrently. available_capabilities: HashSet, inner: Mutex, + instance_memory_limit: Size, // Those two don't store data but only fix type information type_api: PhantomData, type_storage: PhantomData, type_querier: PhantomData, /// To prevent concurrent access to `WasmerInstance::new` instantiation_lock: Mutex<()>, + wasm_limits: WasmLimits, } #[derive(PartialEq, Eq, Debug)] +#[non_exhaustive] pub struct AnalysisReport { + /// `true` if and only if all [`REQUIRED_IBC_EXPORTS`] exist as exported functions. + /// This does not guarantee they are functional or even have the correct signatures. pub has_ibc_entry_points: bool, - pub required_capabilities: HashSet, + /// A set of all entrypoints that are exported by the contract. + pub entrypoints: BTreeSet, + /// The set of capabilities the contract requires. + pub required_capabilities: BTreeSet, + /// The contract migrate version exported set by the contract developer + pub contract_migrate_version: Option, } impl Cache @@ -95,12 +122,31 @@ where /// assumes the disk contents are correct, and there's no way to ensure the artifacts /// stored in the cache haven't been corrupted or tampered with. pub unsafe fn new(options: CacheOptions) -> VmResult { - let CacheOptions { - base_dir, - available_capabilities, - memory_cache_size, - instance_memory_limit, - } = options; + Self::new_with_config(Config { + wasm_limits: WasmLimits::default(), + cache: options, + }) + } + + /// Creates a new cache with the given configuration. + /// This allows configuring lots of limits and sizes. + /// + /// # Safety + /// + /// This function is marked unsafe due to `FileSystemCache::new`, which implicitly + /// assumes the disk contents are correct, and there's no way to ensure the artifacts + /// stored in the cache haven't been corrupted or tampered with. + pub unsafe fn new_with_config(config: Config) -> VmResult { + let Config { + cache: + CacheOptions { + base_dir, + available_capabilities, + memory_cache_size_bytes, + instance_memory_limit_bytes, + }, + wasm_limits, + } = config; let state_path = base_dir.join(STATE_DIR); let cache_path = base_dir.join(CACHE_DIR); @@ -108,39 +154,62 @@ where let wasm_path = state_path.join(WASM_DIR); // Ensure all the needed directories exist on disk. - for path in [&state_path, &cache_path, &wasm_path].iter() { - create_dir_all(path).map_err(|e| { - VmError::cache_err(format!( - "Error creating directory {}: {}", - path.display(), - e - )) - })?; - } + mkdir_p(&state_path).map_err(|_e| VmError::cache_err("Error creating state directory"))?; + mkdir_p(&cache_path).map_err(|_e| VmError::cache_err("Error creating cache directory"))?; + mkdir_p(&wasm_path).map_err(|_e| VmError::cache_err("Error creating wasm directory"))?; - let fs_cache = FileSystemCache::new(cache_path.join(MODULES_DIR)) - .map_err(|e| VmError::cache_err(format!("Error file system cache: {}", e)))?; + let fs_cache = FileSystemCache::new(cache_path.join(MODULES_DIR), false) + .map_err(|e| VmError::cache_err(format!("Error file system cache: {e}")))?; Ok(Cache { available_capabilities, inner: Mutex::new(CacheInner { wasm_path, - instance_memory_limit, pinned_memory_cache: PinnedMemoryCache::new(), - memory_cache: InMemoryCache::new(memory_cache_size), + memory_cache: InMemoryCache::new(memory_cache_size_bytes), fs_cache, stats: Stats::default(), }), + instance_memory_limit: instance_memory_limit_bytes, type_storage: PhantomData::, type_api: PhantomData::, type_querier: PhantomData::, instantiation_lock: Mutex::new(()), + wasm_limits, }) } + /// If `unchecked` is true, the filesystem cache will use the `*_unchecked` wasmer functions for + /// loading modules from disk. + pub fn set_module_unchecked(&mut self, unchecked: bool) { + self.inner + .lock() + .unwrap() + .fs_cache + .set_module_unchecked(unchecked); + } + pub fn stats(&self) -> Stats { self.inner.lock().unwrap().stats } + pub fn pinned_metrics(&self) -> PinnedMetrics { + let cache = self.inner.lock().unwrap(); + let per_module = cache + .pinned_memory_cache + .iter() + .map(|(checksum, module)| { + let metrics = PerModuleMetrics { + hits: module.hits, + size: module.module.size_estimate, + }; + + (*checksum, metrics) + }) + .collect(); + + PinnedMetrics { per_module } + } + pub fn metrics(&self) -> Metrics { let cache = self.inner.lock().unwrap(); Metrics { @@ -152,17 +221,85 @@ where } } + /// Takes a Wasm bytecode and stores it to the cache. + /// + /// This performs static checks, compiles the bytescode to a module and + /// stores the Wasm file on disk. + /// + /// This does the same as [`Cache::save_wasm_unchecked`] plus the static checks. + /// When a Wasm blob is stored the first time, use this function. + #[deprecated = "Use `store_code(wasm, true, true)` instead"] pub fn save_wasm(&self, wasm: &[u8]) -> VmResult { - check_wasm(wasm, &self.available_capabilities)?; - let module = compile(wasm, None, &[])?; + self.store_code(wasm, true, true) + } + + /// Takes a Wasm bytecode and stores it to the cache. + /// + /// This performs static checks if `checked` is `true`, + /// compiles the bytescode to a module and + /// stores the Wasm file on disk if `persist` is `true`. + /// + /// Only set `checked = false` when a Wasm blob is stored which was previously checked + /// (e.g. as part of state sync). + pub fn store_code(&self, wasm: &[u8], checked: bool, persist: bool) -> VmResult { + if checked { + check_wasm( + wasm, + &self.available_capabilities, + &self.wasm_limits, + crate::internals::Logger::Off, + )?; + } + + let module = compile_module(wasm)?; + + if persist { + self.save_to_disk(wasm, &module) + } else { + Ok(Checksum::generate(wasm)) + } + } + /// Takes a Wasm bytecode and stores it to the cache. + /// + /// This compiles the bytescode to a module and + /// stores the Wasm file on disk. + /// + /// This does the same as [`Cache::save_wasm`] but without the static checks. + /// When a Wasm blob is stored which was previously checked (e.g. as part of state sync), + /// use this function. + #[deprecated = "Use `store_code(wasm, false, true)` instead"] + pub fn save_wasm_unchecked(&self, wasm: &[u8]) -> VmResult { + self.store_code(wasm, false, true) + } + + fn save_to_disk(&self, wasm: &[u8], module: &Module) -> VmResult { let mut cache = self.inner.lock().unwrap(); let checksum = save_wasm_to_disk(&cache.wasm_path, wasm)?; - cache.fs_cache.store(&checksum, &module)?; + cache.fs_cache.store(&checksum, module)?; Ok(checksum) } - /// Retrieves a Wasm blob that was previously stored via save_wasm. + /// Removes the Wasm blob for the given checksum from disk and its + /// compiled module from the file system cache. + /// + /// The existence of the original code is required since the caller (wasmd) + /// has to keep track of which entries we have here. + pub fn remove_wasm(&self, checksum: &Checksum) -> VmResult<()> { + let mut cache = self.inner.lock().unwrap(); + + // Remove compiled moduled from disk (if it exists). + // Here we could also delete from memory caches but this is not really + // necessary as they are pushed out from the LRU over time or disappear + // when the node process restarts. + cache.fs_cache.remove(checksum)?; + + let path = &cache.wasm_path; + remove_wasm_from_disk(path, checksum)?; + Ok(()) + } + + /// Retrieves a Wasm blob that was previously stored via [`Cache::store_code`]. /// When the cache is instantiated with the same base dir, this finds Wasm files on disc across multiple cache instances (i.e. node restarts). /// This function is public to allow a checksum to Wasm lookup in the blockchain. /// @@ -183,57 +320,80 @@ where /// Performs static anlyzation on this Wasm without compiling or instantiating it. /// - /// Once the contract was stored via [`save_wasm`], this can be called at any point in time. + /// Once the contract was stored via [`Cache::store_code`], this can be called at any point in time. /// It does not depend on any caching of the contract. pub fn analyze(&self, checksum: &Checksum) -> VmResult { // Here we could use a streaming deserializer to slightly improve performance. However, this way it is DRYer. let wasm = self.load_wasm(checksum)?; - let module = deserialize_wasm(&wasm)?; + let module = ParsedWasm::parse(&wasm)?; + let exports = module.exported_function_names(None); + + let entrypoints = exports + .iter() + .filter_map(|export| Entrypoint::from_str(export).ok()) + .collect(); + Ok(AnalysisReport { - has_ibc_entry_points: has_ibc_entry_points(&module), - required_capabilities: required_capabilities_from_module(&module), + has_ibc_entry_points: REQUIRED_IBC_EXPORTS + .iter() + .all(|required| exports.contains(required.as_ref())), + entrypoints, + required_capabilities: required_capabilities_from_module(&module) + .into_iter() + .collect(), + contract_migrate_version: module.contract_migrate_version, }) } - /// Pins a Module that was previously stored via save_wasm. + /// Pins a Module that was previously stored via [`Cache::store_code`]. /// - /// The module is lookup first in the memory cache, and then in the file system cache. - /// If not found, the code is loaded from the file system, compiled, and stored into the + /// The module is looked up first in the file system cache. If not found, + /// the code is loaded from the file system, compiled, and stored into the /// pinned cache. - /// If the given ID is not found, or the content does not match the hash (=ID), an error is returned. + /// + /// If the given contract for the given checksum is not found, or the content + /// does not match the checksum, an error is returned. pub fn pin(&self, checksum: &Checksum) -> VmResult<()> { let mut cache = self.inner.lock().unwrap(); if cache.pinned_memory_cache.has(checksum) { return Ok(()); } - // Try to get module from the memory cache - if let Some(module) = cache.memory_cache.load(checksum)? { - cache.stats.hits_memory_cache += 1; - return cache - .pinned_memory_cache - .store(checksum, module.module, module.size); - } + // We don't load from the memory cache because we had to create new store here and + // serialize/deserialize the artifact to get a full clone. Could be done but adds some code + // for a not-so-relevant use case. // Try to get module from file system cache - let store = make_runtime_store(Some(cache.instance_memory_limit)); - if let Some(module) = cache.fs_cache.load(checksum, &store)? { - cache.stats.hits_fs_cache += 1; - let module_size = loupe::size_of_val(&module); - return cache - .pinned_memory_cache - .store(checksum, module, module_size); + if let Some(cached_module) = cache + .fs_cache + .load(checksum, Some(self.instance_memory_limit))? + { + cache.stats.hits_fs_cache = cache.stats.hits_fs_cache.saturating_add(1); + return cache.pinned_memory_cache.store(checksum, cached_module); } // Re-compile from original Wasm bytecode - let code = self.load_wasm_with_path(&cache.wasm_path, checksum)?; - let module = compile(&code, Some(cache.instance_memory_limit), &[])?; - // Store into the fs cache too - cache.fs_cache.store(checksum, &module)?; - let module_size = loupe::size_of_val(&module); - cache - .pinned_memory_cache - .store(checksum, module, module_size) + let wasm = self.load_wasm_with_path(&cache.wasm_path, checksum)?; + cache.stats.misses = cache.stats.misses.saturating_add(1); + { + // Module will run with a different engine, so we can set memory limit to None + let compiling_engine = make_compiling_engine(None); + // This module cannot be executed directly as it was not created with the runtime engine + let module = compile(&compiling_engine, &wasm)?; + cache.fs_cache.store(checksum, &module)?; + } + + // This time we'll hit the file-system cache. + let Some(cached_module) = cache + .fs_cache + .load(checksum, Some(self.instance_memory_limit))? + else { + return Err(VmError::generic_err( + "Can't load module from file system cache after storing it to file system cache (pin)", + )); + }; + + cache.pinned_memory_cache.store(checksum, cached_module) } /// Unpins a Module, i.e. removes it from the pinned memory cache. @@ -257,12 +417,12 @@ where backend: Backend, options: InstanceOptions, ) -> VmResult> { - let module = self.get_module(checksum)?; + let (module, store) = self.get_module(checksum)?; let instance = Instance::from_module( + store, &module, backend, options.gas_limit, - options.print_debug, None, Some(&self.instantiation_lock), )?; @@ -272,48 +432,93 @@ where /// Returns a module tied to a previously saved Wasm. /// Depending on availability, this is either generated from a memory cache, file system cache or Wasm code. /// This is part of `get_instance` but pulled out to reduce the locking time. - fn get_module(&self, checksum: &Checksum) -> VmResult { + fn get_module(&self, checksum: &Checksum) -> VmResult<(Module, Store)> { let mut cache = self.inner.lock().unwrap(); // Try to get module from the pinned memory cache - if let Some(module) = cache.pinned_memory_cache.load(checksum)? { - cache.stats.hits_pinned_memory_cache += 1; - return Ok(module); + if let Some(element) = cache.pinned_memory_cache.load(checksum)? { + cache.stats.hits_pinned_memory_cache = + cache.stats.hits_pinned_memory_cache.saturating_add(1); + let CachedModule { + module, + engine, + size_estimate: _, + } = element; + let store = Store::new(engine); + return Ok((module, store)); } // Get module from memory cache - if let Some(module) = cache.memory_cache.load(checksum)? { - cache.stats.hits_memory_cache += 1; - return Ok(module.module); + if let Some(element) = cache.memory_cache.load(checksum)? { + cache.stats.hits_memory_cache = cache.stats.hits_memory_cache.saturating_add(1); + let CachedModule { + module, + engine, + size_estimate: _, + } = element; + let store = Store::new(engine); + return Ok((module, store)); } // Get module from file system cache - let store = make_runtime_store(Some(cache.instance_memory_limit)); - if let Some(module) = cache.fs_cache.load(checksum, &store)? { - cache.stats.hits_fs_cache += 1; - let module_size = loupe::size_of_val(&module); - cache - .memory_cache - .store(checksum, module.clone(), module_size)?; - return Ok(module); + if let Some(cached_module) = cache + .fs_cache + .load(checksum, Some(self.instance_memory_limit))? + { + cache.stats.hits_fs_cache = cache.stats.hits_fs_cache.saturating_add(1); + + cache.memory_cache.store(checksum, cached_module.clone())?; + + let CachedModule { + module, + engine, + size_estimate: _, + } = cached_module; + let store = Store::new(engine); + return Ok((module, store)); } // Re-compile module from wasm // // This is needed for chains that upgrade their node software in a way that changes the module - // serialization format. If you do not replay all transactions, previous calls of `save_wasm` + // serialization format. If you do not replay all transactions, previous calls of `store_code` // stored the old module format. let wasm = self.load_wasm_with_path(&cache.wasm_path, checksum)?; - cache.stats.misses += 1; - let module = compile(&wasm, Some(cache.instance_memory_limit), &[])?; - cache.fs_cache.store(checksum, &module)?; - let module_size = loupe::size_of_val(&module); - cache - .memory_cache - .store(checksum, module.clone(), module_size)?; - Ok(module) + cache.stats.misses = cache.stats.misses.saturating_add(1); + { + // Module will run with a different engine, so we can set memory limit to None + let compiling_engine = make_compiling_engine(None); + // This module cannot be executed directly as it was not created with the runtime engine + let module = compile(&compiling_engine, &wasm)?; + cache.fs_cache.store(checksum, &module)?; + } + + // This time we'll hit the file-system cache. + let Some(cached_module) = cache + .fs_cache + .load(checksum, Some(self.instance_memory_limit))? + else { + return Err(VmError::generic_err( + "Can't load module from file system cache after storing it to file system cache (get_module)", + )); + }; + cache.memory_cache.store(checksum, cached_module.clone())?; + + let CachedModule { + module, + engine, + size_estimate: _, + } = cached_module; + let store = Store::new(engine); + Ok((module, store)) } } +fn compile_module(wasm: &[u8]) -> Result { + let compiling_engine = make_compiling_engine(None); + let module = compile(&compiling_engine, wasm)?; + Ok(module) +} + unsafe impl Sync for Cache where A: BackendApi + 'static, @@ -337,129 +542,252 @@ fn save_wasm_to_disk(dir: impl Into, wasm: &[u8]) -> VmResult // calculate filename let checksum = Checksum::generate(wasm); let filename = checksum.to_hex(); - let filepath = dir.into().join(&filename); + let filepath = dir.into().join(filename).with_extension("wasm"); // write data to file - // Since the same filename (a collision resistent hash) cannot be generated from two different byte codes + // Since the same filename (a collision resistant hash) cannot be generated from two different byte codes // (even if a malicious actor tried), it is safe to override. let mut file = OpenOptions::new() .write(true) .create(true) + .truncate(true) .open(filepath) - .map_err(|e| VmError::cache_err(format!("Error opening Wasm file for writing: {}", e)))?; + .map_err(|e| VmError::cache_err(format!("Error opening Wasm file for writing: {e}")))?; file.write_all(wasm) - .map_err(|e| VmError::cache_err(format!("Error writing Wasm file: {}", e)))?; + .map_err(|e| VmError::cache_err(format!("Error writing Wasm file: {e}")))?; Ok(checksum) } fn load_wasm_from_disk(dir: impl Into, checksum: &Checksum) -> VmResult> { // this requires the directory and file to exist + // The files previously had no extension, so to allow for a smooth transition, + // we also try to load the file without the wasm extension. let path = dir.into().join(checksum.to_hex()); - let mut file = File::open(path) - .map_err(|e| VmError::cache_err(format!("Error opening Wasm file for reading: {}", e)))?; + let mut file = File::open(path.with_extension("wasm")) + .or_else(|_| File::open(path)) + .map_err(|_e| VmError::cache_err("Error opening Wasm file for reading"))?; let mut wasm = Vec::::new(); file.read_to_end(&mut wasm) - .map_err(|e| VmError::cache_err(format!("Error reading Wasm file: {}", e)))?; + .map_err(|_e| VmError::cache_err("Error reading Wasm file"))?; Ok(wasm) } +/// Removes the Wasm blob for the given checksum from disk. +/// +/// In contrast to the file system cache, the existence of the original +/// code is required. So a non-existent file leads to an error as it +/// indicates a bug. +fn remove_wasm_from_disk(dir: impl Into, checksum: &Checksum) -> VmResult<()> { + // the files previously had no extension, so to allow for a smooth transition, we delete both + let path = dir.into().join(checksum.to_hex()); + let wasm_path = path.with_extension("wasm"); + + let path_exists = path.exists(); + let wasm_path_exists = wasm_path.exists(); + if !path_exists && !wasm_path_exists { + return Err(VmError::cache_err("Wasm file does not exist")); + } + + if path_exists { + fs::remove_file(path) + .map_err(|_e| VmError::cache_err("Error removing Wasm file from disk"))?; + } + + if wasm_path_exists { + fs::remove_file(wasm_path) + .map_err(|_e| VmError::cache_err("Error removing Wasm file from disk"))?; + } + + Ok(()) +} + #[cfg(test)] mod tests { use super::*; use crate::calls::{call_execute, call_instantiate}; - use crate::capabilities::capabilities_from_csv; - use crate::errors::VmError; use crate::testing::{mock_backend, mock_env, mock_info, MockApi, MockQuerier, MockStorage}; use cosmwasm_std::{coins, Empty}; - use std::fs::OpenOptions; - use std::io::Write; + use std::borrow::Cow; + use std::fs::{create_dir_all, remove_dir_all}; use tempfile::TempDir; + use wasm_encoder::ComponentSection; - const TESTING_GAS_LIMIT: u64 = 500_000_000_000; // ~0.5ms + const TESTING_GAS_LIMIT: u64 = 500_000_000; // ~0.5ms const TESTING_MEMORY_LIMIT: Size = Size::mebi(16); const TESTING_OPTIONS: InstanceOptions = InstanceOptions { gas_limit: TESTING_GAS_LIMIT, - print_debug: false, }; const TESTING_MEMORY_CACHE_SIZE: Size = Size::mebi(200); - static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); - static IBC_CONTRACT: &[u8] = include_bytes!("../testdata/ibc_reflect.wasm"); + static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static IBC_REFLECT: &[u8] = include_bytes!("../testdata/ibc_reflect.wasm"); + static IBC2: &[u8] = include_bytes!("../testdata/ibc2.wasm"); + static EMPTY: &[u8] = include_bytes!("../testdata/empty.wasm"); + // Invalid because it doesn't contain required memory and exports + static INVALID_CONTRACT_WAT: &str = r#"(module + (type $t0 (func (param i32) (result i32))) + (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) + local.get $p0 + i32.const 1 + i32.add)) + "#; fn default_capabilities() -> HashSet { - capabilities_from_csv("iterator,staking") + HashSet::from([ + "cosmwasm_1_1".to_string(), + "cosmwasm_1_2".to_string(), + "cosmwasm_1_3".to_string(), + "cosmwasm_1_4".to_string(), + "cosmwasm_1_4".to_string(), + "cosmwasm_2_0".to_string(), + "cosmwasm_2_1".to_string(), + "cosmwasm_2_2".to_string(), + "iterator".to_string(), + "staking".to_string(), + "stargate".to_string(), + ]) } - fn make_testing_options() -> CacheOptions { - CacheOptions { - base_dir: TempDir::new().unwrap().into_path(), - available_capabilities: default_capabilities(), - memory_cache_size: TESTING_MEMORY_CACHE_SIZE, - instance_memory_limit: TESTING_MEMORY_LIMIT, - } + fn make_testing_options() -> (CacheOptions, TempDir) { + let temp_dir = TempDir::new().unwrap(); + ( + CacheOptions { + base_dir: temp_dir.path().into(), + available_capabilities: default_capabilities(), + memory_cache_size_bytes: TESTING_MEMORY_CACHE_SIZE, + instance_memory_limit_bytes: TESTING_MEMORY_LIMIT, + }, + temp_dir, + ) } - fn make_stargate_testing_options() -> CacheOptions { + fn make_stargate_testing_options() -> (CacheOptions, TempDir) { + let temp_dir = TempDir::new().unwrap(); let mut capabilities = default_capabilities(); capabilities.insert("stargate".into()); - CacheOptions { - base_dir: TempDir::new().unwrap().into_path(), - available_capabilities: capabilities, - memory_cache_size: TESTING_MEMORY_CACHE_SIZE, - instance_memory_limit: TESTING_MEMORY_LIMIT, - } + ( + CacheOptions { + base_dir: temp_dir.path().into(), + available_capabilities: capabilities, + memory_cache_size_bytes: TESTING_MEMORY_CACHE_SIZE, + instance_memory_limit_bytes: TESTING_MEMORY_LIMIT, + }, + temp_dir, + ) + } + + fn make_ibc2_testing_options() -> (CacheOptions, TempDir) { + let temp_dir = TempDir::new().unwrap(); + let mut capabilities = default_capabilities(); + capabilities.insert("ibc2".into()); + ( + CacheOptions { + base_dir: temp_dir.path().into(), + available_capabilities: capabilities, + memory_cache_size_bytes: TESTING_MEMORY_CACHE_SIZE, + instance_memory_limit_bytes: TESTING_MEMORY_LIMIT, + }, + temp_dir, + ) + } + + /// Takes an instance and executes it + fn test_hackatom_instance_execution(instance: &mut Instance) + where + S: Storage + 'static, + Q: Querier + 'static, + { + // instantiate + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let response = + call_instantiate::<_, _, _, Empty>(instance, &mock_env(), &info, msg.as_bytes()) + .unwrap() + .unwrap(); + assert_eq!(response.messages.len(), 0); + + // execute + let info = mock_info(&verifier, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; + let response = call_execute::<_, _, _, Empty>(instance, &mock_env(), &info, msg) + .unwrap() + .unwrap(); + assert_eq!(response.messages.len(), 1); } #[test] - fn save_wasm_works() { + fn new_base_dir_will_be_created() { + let temp_dir = TempDir::new().unwrap(); + let my_base_dir = temp_dir.path().join("non-existent-sub-dir"); + let (base_opts, _temp_dir) = make_testing_options(); + let options = CacheOptions { + base_dir: my_base_dir.clone(), + ..base_opts + }; + assert!(!my_base_dir.is_dir()); + let _cache = unsafe { Cache::::new(options).unwrap() }; + assert!(my_base_dir.is_dir()); + } + + #[test] + fn store_code_checked_works() { + let (testing_opts, _temp_dir) = make_testing_options(); + let cache: Cache = + unsafe { Cache::new(testing_opts).unwrap() }; + cache.store_code(HACKATOM, true, true).unwrap(); + } + + #[test] + fn store_code_without_persist_works() { + let (testing_opts, _temp_dir) = make_testing_options(); let cache: Cache = - unsafe { Cache::new(make_testing_options()).unwrap() }; - cache.save_wasm(CONTRACT).unwrap(); + unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, false).unwrap(); + + assert!( + cache.load_wasm(&checksum).is_err(), + "wasm file should not be saved to disk" + ); } #[test] // This property is required when the same bytecode is uploaded multiple times - fn save_wasm_allows_saving_multiple_times() { + fn store_code_allows_saving_multiple_times() { + let (testing_opts, _temp_dir) = make_testing_options(); let cache: Cache = - unsafe { Cache::new(make_testing_options()).unwrap() }; - cache.save_wasm(CONTRACT).unwrap(); - cache.save_wasm(CONTRACT).unwrap(); + unsafe { Cache::new(testing_opts).unwrap() }; + cache.store_code(HACKATOM, true, true).unwrap(); + cache.store_code(HACKATOM, true, true).unwrap(); } #[test] - fn save_wasm_rejects_invalid_contract() { - // Invalid because it doesn't contain required memory and exports - let wasm = wat::parse_str( - r#"(module - (type $t0 (func (param i32) (result i32))) - (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 - i32.const 1 - i32.add)) - "#, - ) - .unwrap(); + fn store_code_checked_rejects_invalid_contract() { + let wasm = wat::parse_str(INVALID_CONTRACT_WAT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); let cache: Cache = - unsafe { Cache::new(make_testing_options()).unwrap() }; - let save_result = cache.save_wasm(&wasm); + unsafe { Cache::new(testing_opts).unwrap() }; + let save_result = cache.store_code(&wasm, true, true); match save_result.unwrap_err() { VmError::StaticValidationErr { msg, .. } => { - assert_eq!(msg, "Wasm contract doesn\'t have a memory section") + assert_eq!(msg, "Wasm contract must contain exactly one memory") } - e => panic!("Unexpected error {:?}", e), + e => panic!("Unexpected error {e:?}"), } } #[test] - fn save_wasm_fills_file_system_but_not_memory_cache() { + fn store_code_fills_file_system_but_not_memory_cache() { // Who knows if and when the uploaded contract will be executed. Don't pollute // memory cache before the init call. - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); let backend = mock_backend(&[]); let _ = cache @@ -471,14 +799,33 @@ mod tests { assert_eq!(cache.stats().misses, 0); } + #[test] + fn store_code_unchecked_works() { + let (testing_opts, _temp_dir) = make_testing_options(); + let cache: Cache = + unsafe { Cache::new(testing_opts).unwrap() }; + cache.store_code(HACKATOM, false, true).unwrap(); + } + + #[test] + fn store_code_unchecked_accepts_invalid_contract() { + let wasm = wat::parse_str(INVALID_CONTRACT_WAT).unwrap(); + + let (testing_opts, _temp_dir) = make_testing_options(); + let cache: Cache = + unsafe { Cache::new(testing_opts).unwrap() }; + cache.store_code(&wasm, false, true).unwrap(); + } + #[test] fn load_wasm_works() { + let (testing_opts, _temp_dir) = make_testing_options(); let cache: Cache = - unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); let restored = cache.load_wasm(&checksum).unwrap(); - assert_eq!(restored, CONTRACT); + assert_eq!(restored, HACKATOM); } #[test] @@ -490,32 +837,33 @@ mod tests { let options1 = CacheOptions { base_dir: tmp_dir.path().to_path_buf(), available_capabilities: default_capabilities(), - memory_cache_size: TESTING_MEMORY_CACHE_SIZE, - instance_memory_limit: TESTING_MEMORY_LIMIT, + memory_cache_size_bytes: TESTING_MEMORY_CACHE_SIZE, + instance_memory_limit_bytes: TESTING_MEMORY_LIMIT, }; let cache1: Cache = unsafe { Cache::new(options1).unwrap() }; - id = cache1.save_wasm(CONTRACT).unwrap(); + id = cache1.store_code(HACKATOM, true, true).unwrap(); } { let options2 = CacheOptions { base_dir: tmp_dir.path().to_path_buf(), available_capabilities: default_capabilities(), - memory_cache_size: TESTING_MEMORY_CACHE_SIZE, - instance_memory_limit: TESTING_MEMORY_LIMIT, + memory_cache_size_bytes: TESTING_MEMORY_CACHE_SIZE, + instance_memory_limit_bytes: TESTING_MEMORY_LIMIT, }; let cache2: Cache = unsafe { Cache::new(options2).unwrap() }; let restored = cache2.load_wasm(&id).unwrap(); - assert_eq!(restored, CONTRACT); + assert_eq!(restored, HACKATOM); } } #[test] fn load_wasm_errors_for_non_existent_id() { + let (testing_opts, _temp_dir) = make_testing_options(); let cache: Cache = - unsafe { Cache::new(make_testing_options()).unwrap() }; + unsafe { Cache::new(testing_opts).unwrap() }; let checksum = Checksum::from([ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, @@ -523,10 +871,9 @@ mod tests { match cache.load_wasm(&checksum).unwrap_err() { VmError::CacheErr { msg, .. } => { - assert!(msg - .starts_with("Error opening Wasm file for reading: No such file or directory")) + assert_eq!(msg, "Error opening Wasm file for reading") } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -536,34 +883,68 @@ mod tests { let options = CacheOptions { base_dir: tmp_dir.path().to_path_buf(), available_capabilities: default_capabilities(), - memory_cache_size: TESTING_MEMORY_CACHE_SIZE, - instance_memory_limit: TESTING_MEMORY_LIMIT, + memory_cache_size_bytes: TESTING_MEMORY_CACHE_SIZE, + instance_memory_limit_bytes: TESTING_MEMORY_LIMIT, }; let cache: Cache = unsafe { Cache::new(options).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); // Corrupt cache file let filepath = tmp_dir .path() .join(STATE_DIR) .join(WASM_DIR) - .join(&checksum.to_hex()); + .join(checksum.to_hex()) + .with_extension("wasm"); let mut file = OpenOptions::new().write(true).open(filepath).unwrap(); file.write_all(b"broken data").unwrap(); let res = cache.load_wasm(&checksum); match res { Err(VmError::IntegrityErr { .. }) => {} - Err(e) => panic!("Unexpected error: {:?}", e), + Err(e) => panic!("Unexpected error: {e:?}"), Ok(_) => panic!("This must not succeed"), } } + #[test] + fn remove_wasm_works() { + let (testing_opts, _temp_dir) = make_testing_options(); + let cache: Cache = + unsafe { Cache::new(testing_opts).unwrap() }; + + // Store + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); + + // Exists + cache.load_wasm(&checksum).unwrap(); + + // Remove + cache.remove_wasm(&checksum).unwrap(); + + // Does not exist anymore + match cache.load_wasm(&checksum).unwrap_err() { + VmError::CacheErr { msg, .. } => { + assert_eq!(msg, "Error opening Wasm file for reading") + } + e => panic!("Unexpected error: {e:?}"), + } + + // Removing again fails + match cache.remove_wasm(&checksum).unwrap_err() { + VmError::CacheErr { msg, .. } => { + assert_eq!(msg, "Wasm file does not exist") + } + e => panic!("Unexpected error: {e:?}"), + } + } + #[test] fn get_instance_finds_cached_module() { - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); let backend = mock_backend(&[]); let _instance = cache .get_instance(&checksum, backend, TESTING_OPTIONS) @@ -576,8 +957,9 @@ mod tests { #[test] fn get_instance_finds_cached_modules_and_stores_to_memory() { - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); let backend1 = mock_backend(&[]); let backend2 = mock_backend(&[]); let backend3 = mock_backend(&[]); @@ -611,11 +993,11 @@ mod tests { assert_eq!(cache.stats().hits_fs_cache, 1); assert_eq!(cache.stats().misses, 0); - // pinning hits the memory cache + // pinning hits the file system cache cache.pin(&checksum).unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 0); - assert_eq!(cache.stats().hits_memory_cache, 3); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 2); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); // from pinned memory cache @@ -623,8 +1005,8 @@ mod tests { .get_instance(&checksum, backend4, TESTING_OPTIONS) .unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 1); - assert_eq!(cache.stats().hits_memory_cache, 3); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 2); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); // from pinned memory cache again @@ -632,15 +1014,46 @@ mod tests { .get_instance(&checksum, backend5, TESTING_OPTIONS) .unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 2); - assert_eq!(cache.stats().hits_memory_cache, 3); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 2); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); } + #[test] + fn get_instance_recompiles_module() { + let (options, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(options.clone()).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); + + // Remove compiled module from disk + remove_dir_all(options.base_dir.join(CACHE_DIR).join(MODULES_DIR)).unwrap(); + + // The first get_instance recompiles the Wasm (miss) + let backend = mock_backend(&[]); + let _instance = cache + .get_instance(&checksum, backend, TESTING_OPTIONS) + .unwrap(); + assert_eq!(cache.stats().hits_pinned_memory_cache, 0); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert_eq!(cache.stats().hits_fs_cache, 0); + assert_eq!(cache.stats().misses, 1); + + // The second get_instance finds the module in cache (hit) + let backend = mock_backend(&[]); + let _instance = cache + .get_instance(&checksum, backend, TESTING_OPTIONS) + .unwrap(); + assert_eq!(cache.stats().hits_pinned_memory_cache, 0); + assert_eq!(cache.stats().hits_memory_cache, 1); + assert_eq!(cache.stats().hits_fs_cache, 0); + assert_eq!(cache.stats().misses, 1); + } + #[test] fn call_instantiate_on_cached_contract() { - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); // from file system { @@ -652,11 +1065,18 @@ mod tests { assert_eq!(cache.stats().hits_fs_cache, 1); assert_eq!(cache.stats().misses, 0); - // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let res = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + // instantiate + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let res = call_instantiate::<_, _, _, Empty>( + &mut instance, + &mock_env(), + &info, + msg.as_bytes(), + ) + .unwrap(); let msgs = res.unwrap().messages; assert_eq!(msgs.len(), 0); } @@ -671,11 +1091,18 @@ mod tests { assert_eq!(cache.stats().hits_fs_cache, 1); assert_eq!(cache.stats().misses, 0); - // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let res = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + // instantiate + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let res = call_instantiate::<_, _, _, Empty>( + &mut instance, + &mock_env(), + &info, + msg.as_bytes(), + ) + .unwrap(); let msgs = res.unwrap().messages; assert_eq!(msgs.len(), 0); } @@ -688,15 +1115,22 @@ mod tests { .get_instance(&checksum, mock_backend(&[]), TESTING_OPTIONS) .unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 1); - assert_eq!(cache.stats().hits_memory_cache, 2); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 1); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); - // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let res = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + // instantiate + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let res = call_instantiate::<_, _, _, Empty>( + &mut instance, + &mock_env(), + &info, + msg.as_bytes(), + ) + .unwrap(); let msgs = res.unwrap().messages; assert_eq!(msgs.len(), 0); } @@ -704,8 +1138,9 @@ mod tests { #[test] fn call_execute_on_cached_contract() { - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); // from file system { @@ -717,18 +1152,24 @@ mod tests { assert_eq!(cache.stats().hits_fs_cache, 1); assert_eq!(cache.stats().misses, 0); - // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let response = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) - .unwrap() - .unwrap(); + // instantiate + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let response = call_instantiate::<_, _, _, Empty>( + &mut instance, + &mock_env(), + &info, + msg.as_bytes(), + ) + .unwrap() + .unwrap(); assert_eq!(response.messages.len(), 0); // execute - let info = mock_info("verifies", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&verifier, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; let response = call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) .unwrap() .unwrap(); @@ -745,18 +1186,24 @@ mod tests { assert_eq!(cache.stats().hits_fs_cache, 1); assert_eq!(cache.stats().misses, 0); - // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let response = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) - .unwrap() - .unwrap(); + // instantiate + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let response = call_instantiate::<_, _, _, Empty>( + &mut instance, + &mock_env(), + &info, + msg.as_bytes(), + ) + .unwrap() + .unwrap(); assert_eq!(response.messages.len(), 0); // execute - let info = mock_info("verifies", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&verifier, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; let response = call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) .unwrap() .unwrap(); @@ -771,22 +1218,28 @@ mod tests { .get_instance(&checksum, mock_backend(&[]), TESTING_OPTIONS) .unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 1); - assert_eq!(cache.stats().hits_memory_cache, 2); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 1); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); - // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let response = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) - .unwrap() - .unwrap(); + // instantiate + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let response = call_instantiate::<_, _, _, Empty>( + &mut instance, + &mock_env(), + &info, + msg.as_bytes(), + ) + .unwrap() + .unwrap(); assert_eq!(response.messages.len(), 0); // execute - let info = mock_info("verifies", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&verifier, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; let response = call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) .unwrap() .unwrap(); @@ -794,35 +1247,63 @@ mod tests { } } + #[test] + fn call_execute_on_recompiled_contract() { + let (options, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(options.clone()).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); + + // Remove compiled module from disk + remove_dir_all(options.base_dir.join(CACHE_DIR).join(MODULES_DIR)).unwrap(); + + // Recompiles the Wasm (miss on all caches) + let backend = mock_backend(&[]); + let mut instance = cache + .get_instance(&checksum, backend, TESTING_OPTIONS) + .unwrap(); + assert_eq!(cache.stats().hits_pinned_memory_cache, 0); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert_eq!(cache.stats().hits_fs_cache, 0); + assert_eq!(cache.stats().misses, 1); + test_hackatom_instance_execution(&mut instance); + } + #[test] fn use_multiple_cached_instances_of_same_contract() { - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); // these differentiate the two instances of the same contract let backend1 = mock_backend(&[]); let backend2 = mock_backend(&[]); - // init instance 1 + // instantiate instance 1 let mut instance = cache .get_instance(&checksum, backend1, TESTING_OPTIONS) .unwrap(); let info = mock_info("owner1", &coins(1000, "earth")); - let msg = br#"{"verifier": "sue", "beneficiary": "mary"}"#; + let sue = instance.api().addr_make("sue"); + let mary = instance.api().addr_make("mary"); + let msg = format!(r#"{{"verifier": "{sue}", "beneficiary": "{mary}"}}"#); let res = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) + .unwrap(); let msgs = res.unwrap().messages; assert_eq!(msgs.len(), 0); let backend1 = instance.recycle().unwrap(); - // init instance 2 + // instantiate instance 2 let mut instance = cache .get_instance(&checksum, backend2, TESTING_OPTIONS) .unwrap(); let info = mock_info("owner2", &coins(500, "earth")); - let msg = br#"{"verifier": "bob", "beneficiary": "john"}"#; + let bob = instance.api().addr_make("bob"); + let john = instance.api().addr_make("john"); + let msg = format!(r#"{{"verifier": "{bob}", "beneficiary": "{john}"}}"#); let res = - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) + .unwrap(); let msgs = res.unwrap().messages; assert_eq!(msgs.len(), 0); let backend2 = instance.recycle().unwrap(); @@ -831,8 +1312,8 @@ mod tests { let mut instance = cache .get_instance(&checksum, backend2, TESTING_OPTIONS) .unwrap(); - let info = mock_info("bob", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&bob, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; let res = call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); let msgs = res.unwrap().messages; assert_eq!(1, msgs.len()); @@ -841,8 +1322,8 @@ mod tests { let mut instance = cache .get_instance(&checksum, backend1, TESTING_OPTIONS) .unwrap(); - let info = mock_info("sue", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&sue, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; let res = call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap(); let msgs = res.unwrap().messages; assert_eq!(1, msgs.len()); @@ -850,8 +1331,9 @@ mod tests { #[test] fn resets_gas_when_reusing_instance() { - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); let backend1 = mock_backend(&[]); let backend2 = mock_backend(&[]); @@ -868,14 +1350,16 @@ mod tests { // Consume some gas let info = mock_info("owner1", &coins(1000, "earth")); - let msg = br#"{"verifier": "sue", "beneficiary": "mary"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance1, &mock_env(), &info, msg) + let sue = instance1.api().addr_make("sue"); + let mary = instance1.api().addr_make("mary"); + let msg = format!(r#"{{"verifier": "{sue}", "beneficiary": "{mary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance1, &mock_env(), &info, msg.as_bytes()) .unwrap() .unwrap(); assert!(instance1.get_gas_left() < original_gas); // Init from memory cache - let instance2 = cache + let mut instance2 = cache .get_instance(&checksum, backend2, TESTING_OPTIONS) .unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 0); @@ -887,36 +1371,41 @@ mod tests { #[test] fn recovers_from_out_of_gas() { - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); let backend1 = mock_backend(&[]); let backend2 = mock_backend(&[]); // Init from module cache - let options = InstanceOptions { - gas_limit: 10, - print_debug: false, - }; + let options = InstanceOptions { gas_limit: 10 }; let mut instance1 = cache.get_instance(&checksum, backend1, options).unwrap(); assert_eq!(cache.stats().hits_fs_cache, 1); assert_eq!(cache.stats().misses, 0); // Consume some gas. This fails let info1 = mock_info("owner1", &coins(1000, "earth")); - let msg1 = br#"{"verifier": "sue", "beneficiary": "mary"}"#; - match call_instantiate::<_, _, _, Empty>(&mut instance1, &mock_env(), &info1, msg1) - .unwrap_err() + let sue = instance1.api().addr_make("sue"); + let mary = instance1.api().addr_make("mary"); + let msg1 = format!(r#"{{"verifier": "{sue}", "beneficiary": "{mary}"}}"#); + + match call_instantiate::<_, _, _, Empty>( + &mut instance1, + &mock_env(), + &info1, + msg1.as_bytes(), + ) + .unwrap_err() { VmError::GasDepletion { .. } => (), // all good, continue - e => panic!("unexpected error, {:?}", e), + e => panic!("unexpected error, {e:?}"), } assert_eq!(instance1.get_gas_left(), 0); // Init from memory cache let options = InstanceOptions { gas_limit: TESTING_GAS_LIMIT, - print_debug: false, }; let mut instance2 = cache.get_instance(&checksum, backend2, options).unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 0); @@ -927,8 +1416,10 @@ mod tests { // Now it works let info2 = mock_info("owner2", &coins(500, "earth")); - let msg2 = br#"{"verifier": "bob", "beneficiary": "john"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance2, &mock_env(), &info2, msg2) + let bob = instance2.api().addr_make("bob"); + let john = instance2.api().addr_make("john"); + let msg2 = format!(r#"{{"verifier": "{bob}", "beneficiary": "{john}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance2, &mock_env(), &info2, msg2.as_bytes()) .unwrap() .unwrap(); } @@ -975,87 +1466,240 @@ mod tests { assert_eq!(code, loaded); } + #[test] + fn remove_wasm_from_disk_works() { + let tmp_dir = TempDir::new().unwrap(); + let path = tmp_dir.path(); + let code = vec![12u8; 17]; + let checksum = save_wasm_to_disk(path, &code).unwrap(); + + remove_wasm_from_disk(path, &checksum).unwrap(); + + // removing again fails + + match remove_wasm_from_disk(path, &checksum).unwrap_err() { + VmError::CacheErr { msg, .. } => assert_eq!(msg, "Wasm file does not exist"), + err => panic!("Unexpected error: {err:?}"), + } + } + #[test] fn analyze_works() { + use Entrypoint as E; + + let (testing_opts, _temp_dir) = make_stargate_testing_options(); let cache: Cache = - unsafe { Cache::new(make_stargate_testing_options()).unwrap() }; + unsafe { Cache::new(testing_opts).unwrap() }; - let checksum1 = cache.save_wasm(CONTRACT).unwrap(); + let checksum1 = cache.store_code(HACKATOM, true, true).unwrap(); let report1 = cache.analyze(&checksum1).unwrap(); assert_eq!( report1, AnalysisReport { has_ibc_entry_points: false, - required_capabilities: HashSet::new(), + entrypoints: BTreeSet::from([ + E::Instantiate, + E::Migrate, + E::Sudo, + E::Execute, + E::Query + ]), + required_capabilities: BTreeSet::from([ + "cosmwasm_1_1".to_string(), + "cosmwasm_1_2".to_string(), + "cosmwasm_1_3".to_string(), + "cosmwasm_1_4".to_string(), + "cosmwasm_1_4".to_string(), + "cosmwasm_2_0".to_string(), + "cosmwasm_2_1".to_string(), + "cosmwasm_2_2".to_string(), + ]), + contract_migrate_version: Some(420), } ); - let checksum2 = cache.save_wasm(IBC_CONTRACT).unwrap(); + let checksum2 = cache.store_code(IBC_REFLECT, true, true).unwrap(); let report2 = cache.analyze(&checksum2).unwrap(); + let mut ibc_contract_entrypoints = + BTreeSet::from([E::Instantiate, E::Migrate, E::Execute, E::Reply, E::Query]); + ibc_contract_entrypoints.extend(REQUIRED_IBC_EXPORTS); assert_eq!( report2, AnalysisReport { has_ibc_entry_points: true, - required_capabilities: HashSet::from_iter(vec![ + entrypoints: ibc_contract_entrypoints, + required_capabilities: BTreeSet::from_iter([ + "cosmwasm_1_1".to_string(), + "cosmwasm_1_2".to_string(), + "cosmwasm_1_3".to_string(), + "cosmwasm_1_4".to_string(), + "cosmwasm_1_4".to_string(), + "cosmwasm_2_0".to_string(), + "cosmwasm_2_1".to_string(), + "cosmwasm_2_2".to_string(), "iterator".to_string(), - "staking".to_string(), "stargate".to_string() ]), + contract_migrate_version: None, + } + ); + + let checksum3 = cache.store_code(EMPTY, true, true).unwrap(); + let report3 = cache.analyze(&checksum3).unwrap(); + assert_eq!( + report3, + AnalysisReport { + has_ibc_entry_points: false, + entrypoints: BTreeSet::new(), + required_capabilities: BTreeSet::from(["iterator".to_string()]), + contract_migrate_version: None, + } + ); + + let mut wasm_with_version = EMPTY.to_vec(); + let custom_section = wasm_encoder::CustomSection { + name: Cow::Borrowed("cw_migrate_version"), + data: Cow::Borrowed(b"21"), + }; + custom_section.append_to_component(&mut wasm_with_version); + + let checksum4 = cache.store_code(&wasm_with_version, true, true).unwrap(); + let report4 = cache.analyze(&checksum4).unwrap(); + assert_eq!( + report4, + AnalysisReport { + has_ibc_entry_points: false, + entrypoints: BTreeSet::new(), + required_capabilities: BTreeSet::from(["iterator".to_string()]), + contract_migrate_version: Some(21), + } + ); + + let (testing_opts, _temp_dir) = make_ibc2_testing_options(); + let cache: Cache = + unsafe { Cache::new(testing_opts).unwrap() }; + let checksum5 = cache.store_code(IBC2, true, true).unwrap(); + let report5 = cache.analyze(&checksum5).unwrap(); + let ibc2_contract_entrypoints = BTreeSet::from([ + E::Instantiate, + E::Query, + E::Ibc2PacketReceive, + E::Ibc2PacketTimeout, + E::Ibc2PacketAck, + E::Ibc2PacketSend, + ]); + assert_eq!( + report5, + AnalysisReport { + has_ibc_entry_points: false, + entrypoints: ibc2_contract_entrypoints, + required_capabilities: BTreeSet::from_iter([ + "iterator".to_string(), + "ibc2".to_string() + ]), + contract_migrate_version: None, } ); } + #[test] + fn pinned_metrics_works() { + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); + + cache.pin(&checksum).unwrap(); + + let pinned_metrics = cache.pinned_metrics(); + assert_eq!(pinned_metrics.per_module.len(), 1); + assert_eq!(pinned_metrics.per_module[0].0, checksum); + assert_eq!(pinned_metrics.per_module[0].1.hits, 0); + + let backend = mock_backend(&[]); + let _ = cache + .get_instance(&checksum, backend, TESTING_OPTIONS) + .unwrap(); + + let pinned_metrics = cache.pinned_metrics(); + assert_eq!(pinned_metrics.per_module.len(), 1); + assert_eq!(pinned_metrics.per_module[0].0, checksum); + assert_eq!(pinned_metrics.per_module[0].1.hits, 1); + + let empty_checksum = cache.store_code(EMPTY, true, true).unwrap(); + cache.pin(&empty_checksum).unwrap(); + + let pinned_metrics = cache.pinned_metrics(); + assert_eq!(pinned_metrics.per_module.len(), 2); + + let get_module_hits = |checksum| { + pinned_metrics + .per_module + .iter() + .find(|(iter_checksum, _module)| *iter_checksum == checksum) + .map(|(_checksum, module)| module) + .cloned() + .unwrap() + }; + + assert_eq!(get_module_hits(checksum).hits, 1); + assert_eq!(get_module_hits(empty_checksum).hits, 0); + } + #[test] fn pin_unpin_works() { - let cache = unsafe { Cache::new(make_testing_options()).unwrap() }; - let checksum = cache.save_wasm(CONTRACT).unwrap(); + let (testing_opts, _temp_dir) = make_testing_options(); + let cache = unsafe { Cache::new(testing_opts).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); // check not pinned let backend = mock_backend(&[]); - let _instance = cache + let mut instance = cache .get_instance(&checksum, backend, TESTING_OPTIONS) .unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 0); assert_eq!(cache.stats().hits_memory_cache, 0); assert_eq!(cache.stats().hits_fs_cache, 1); assert_eq!(cache.stats().misses, 0); + test_hackatom_instance_execution(&mut instance); - // first pin hits memory cache + // first pin hits file system cache cache.pin(&checksum).unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 0); - assert_eq!(cache.stats().hits_memory_cache, 1); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); // consecutive pins are no-ops cache.pin(&checksum).unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 0); - assert_eq!(cache.stats().hits_memory_cache, 1); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); // check pinned let backend = mock_backend(&[]); - let _instance = cache + let mut instance = cache .get_instance(&checksum, backend, TESTING_OPTIONS) .unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 1); - assert_eq!(cache.stats().hits_memory_cache, 1); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); + test_hackatom_instance_execution(&mut instance); // unpin cache.unpin(&checksum).unwrap(); // verify unpinned let backend = mock_backend(&[]); - let _instance = cache + let mut instance = cache .get_instance(&checksum, backend, TESTING_OPTIONS) .unwrap(); assert_eq!(cache.stats().hits_pinned_memory_cache, 1); - assert_eq!(cache.stats().hits_memory_cache, 2); - assert_eq!(cache.stats().hits_fs_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 1); + assert_eq!(cache.stats().hits_fs_cache, 2); assert_eq!(cache.stats().misses, 0); + test_hackatom_instance_execution(&mut instance); // unpin again has no effect cache.unpin(&checksum).unwrap(); @@ -1064,4 +1708,110 @@ mod tests { let non_id = Checksum::generate(b"non_existent"); cache.unpin(&non_id).unwrap(); } + + #[test] + fn pin_recompiles_module() { + let (options, _temp_dir) = make_testing_options(); + let cache: Cache = + unsafe { Cache::new(options.clone()).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); + + // Remove compiled module from disk + remove_dir_all(options.base_dir.join(CACHE_DIR).join(MODULES_DIR)).unwrap(); + + // Pin misses, forcing a re-compile of the module + cache.pin(&checksum).unwrap(); + assert_eq!(cache.stats().hits_pinned_memory_cache, 0); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert_eq!(cache.stats().hits_fs_cache, 0); + assert_eq!(cache.stats().misses, 1); + + // After the compilation in pin, the module can be used from pinned memory cache + let backend = mock_backend(&[]); + let mut instance = cache + .get_instance(&checksum, backend, TESTING_OPTIONS) + .unwrap(); + assert_eq!(cache.stats().hits_pinned_memory_cache, 1); + assert_eq!(cache.stats().hits_memory_cache, 0); + assert_eq!(cache.stats().hits_fs_cache, 0); + assert_eq!(cache.stats().misses, 1); + test_hackatom_instance_execution(&mut instance); + } + + #[test] + fn loading_without_extension_works() { + let tmp_dir = TempDir::new().unwrap(); + let options = CacheOptions { + base_dir: tmp_dir.path().to_path_buf(), + available_capabilities: default_capabilities(), + memory_cache_size_bytes: TESTING_MEMORY_CACHE_SIZE, + instance_memory_limit_bytes: TESTING_MEMORY_LIMIT, + }; + let cache: Cache = + unsafe { Cache::new(options).unwrap() }; + let checksum = cache.store_code(HACKATOM, true, true).unwrap(); + + // Move the saved wasm to the old path (without extension) + let old_path = tmp_dir + .path() + .join(STATE_DIR) + .join(WASM_DIR) + .join(checksum.to_hex()); + let new_path = old_path.with_extension("wasm"); + fs::rename(new_path, old_path).unwrap(); + + // loading wasm from before the wasm extension was added should still work + let restored = cache.load_wasm(&checksum).unwrap(); + assert_eq!(restored, HACKATOM); + } + + #[test] + fn func_ref_test() { + let wasm = wat::parse_str( + r#"(module + (type (func)) + (type (func (param funcref))) + (import "env" "abort" (func $f (type 1))) + (func (type 0) nop) + (export "add_one" (func 0)) + (export "allocate" (func 0)) + (export "interface_version_8" (func 0)) + (export "deallocate" (func 0)) + (export "memory" (memory 0)) + (memory 3) + )"#, + ) + .unwrap(); + + let (testing_opts, _temp_dir) = make_testing_options(); + let cache: Cache = + unsafe { Cache::new(testing_opts).unwrap() }; + + // making sure this doesn't panic + let err = cache.store_code(&wasm, true, true).unwrap_err(); + assert!(err.to_string().contains("FuncRef")); + } + + #[test] + fn test_wasm_limits_checked() { + let tmp_dir = TempDir::new().unwrap(); + + let config = Config { + wasm_limits: WasmLimits { + max_function_params: Some(0), + ..Default::default() + }, + cache: CacheOptions { + base_dir: tmp_dir.path().to_path_buf(), + available_capabilities: default_capabilities(), + memory_cache_size_bytes: TESTING_MEMORY_CACHE_SIZE, + instance_memory_limit_bytes: TESTING_MEMORY_LIMIT, + }, + }; + + let cache: Cache = + unsafe { Cache::new_with_config(config).unwrap() }; + let err = cache.store_code(HACKATOM, true, true).unwrap_err(); + assert!(matches!(err, VmError::StaticValidationErr { .. })); + } } diff --git a/packages/vm/src/calls.rs b/packages/vm/src/calls.rs index 55ec230e5f..384701d2c4 100644 --- a/packages/vm/src/calls.rs +++ b/packages/vm/src/calls.rs @@ -1,12 +1,18 @@ use serde::de::DeserializeOwned; -use wasmer::Val; +use wasmer::Value; + +use cosmwasm_std::{ + ContractResult, CustomMsg, Env, IbcBasicResponse, IbcDestinationCallbackMsg, + IbcSourceCallbackMsg, MessageInfo, MigrateInfo, QueryResponse, Reply, Response, +}; + +#[cfg(any(feature = "stargate", feature = "ibc2"))] +use cosmwasm_std::IbcReceiveResponse; -use cosmwasm_std::{ContractResult, CustomMsg, Env, MessageInfo, QueryResponse, Reply, Response}; #[cfg(feature = "stargate")] use cosmwasm_std::{ - Ibc3ChannelOpenResponse, IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, - IbcChannelOpenMsg, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, - IbcReceiveResponse, + Ibc3ChannelOpenResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, + IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, }; use crate::backend::{BackendApi, Querier, Storage}; @@ -14,6 +20,10 @@ use crate::conversion::ref_to_u32; use crate::errors::{VmError, VmResult}; use crate::instance::Instance; use crate::serde::{from_slice, to_vec}; +#[cfg(feature = "ibc2")] +use cosmwasm_std::{ + Ibc2PacketAckMsg, Ibc2PacketReceiveMsg, Ibc2PacketSendMsg, Ibc2PacketTimeoutMsg, +}; /// The limits in here protect the host from allocating an unreasonable amount of memory /// and copying an unreasonable amount of data. @@ -22,7 +32,7 @@ use crate::serde::{from_slice, to_vec}; /// deserializing JSON is more expensive. As a consequence, any sane contract should hit /// the deserializer limit before the read limit. mod read_limits { - /// A mibi (mega binary) + /// A mebi (mega binary) const MI: usize = 1024 * 1024; /// Max length (in bytes) of the result data from an instantiate call. pub const RESULT_INSTANTIATE: usize = 64 * MI; @@ -36,24 +46,30 @@ mod read_limits { pub const RESULT_REPLY: usize = 64 * MI; /// Max length (in bytes) of the result data from a query call. pub const RESULT_QUERY: usize = 64 * MI; - /// Max length (in bytes) of the result data from a ibc_channel_open call. + /// Max length (in bytes) of the result data from an ibc_channel_open call. #[cfg(feature = "stargate")] pub const RESULT_IBC_CHANNEL_OPEN: usize = 64 * MI; - /// Max length (in bytes) of the result data from a ibc_channel_connect call. + /// Max length (in bytes) of the result data from an ibc_channel_connect call. #[cfg(feature = "stargate")] pub const RESULT_IBC_CHANNEL_CONNECT: usize = 64 * MI; - /// Max length (in bytes) of the result data from a ibc_channel_close call. + /// Max length (in bytes) of the result data from an ibc_channel_close call. #[cfg(feature = "stargate")] pub const RESULT_IBC_CHANNEL_CLOSE: usize = 64 * MI; - /// Max length (in bytes) of the result data from a ibc_packet_receive call. - #[cfg(feature = "stargate")] + /// Max length (in bytes) of the result data from an ibc_packet_receive call. + #[cfg(any(feature = "stargate", feature = "ibc2"))] pub const RESULT_IBC_PACKET_RECEIVE: usize = 64 * MI; - /// Max length (in bytes) of the result data from a ibc_packet_ack call. - #[cfg(feature = "stargate")] + /// Max length (in bytes) of the result data from an ibc_packet_ack call. + #[cfg(any(feature = "stargate", feature = "ibc2"))] pub const RESULT_IBC_PACKET_ACK: usize = 64 * MI; - /// Max length (in bytes) of the result data from a ibc_packet_timeout call. - #[cfg(feature = "stargate")] + /// Max length (in bytes) of the result data from an ibc_packet_timeout call. + #[cfg(any(feature = "stargate", feature = "ibc2"))] pub const RESULT_IBC_PACKET_TIMEOUT: usize = 64 * MI; + /// Max length (in bytes) of the result data from an ibc_source_callback call. + pub const RESULT_IBC_SOURCE_CALLBACK: usize = 64 * MI; + /// Max length (in bytes) of the result data from an ibc_destination_callback call. + pub const RESULT_IBC_DESTINATION_CALLBACK: usize = 64 * MI; + #[cfg(feature = "ibc2")] + pub const RESULT_IBC2_PACKET_SEND: usize = 64 * MI; } /// The limits for the JSON deserialization. @@ -75,24 +91,31 @@ mod deserialization_limits { pub const RESULT_REPLY: usize = 256 * KI; /// Max length (in bytes) of the result data from a query call. pub const RESULT_QUERY: usize = 256 * KI; - /// Max length (in bytes) of the result data from a ibc_channel_open call. + /// Max length (in bytes) of the result data from an ibc_channel_open call. #[cfg(feature = "stargate")] pub const RESULT_IBC_CHANNEL_OPEN: usize = 256 * KI; - /// Max length (in bytes) of the result data from a ibc_channel_connect call. + /// Max length (in bytes) of the result data from an ibc_channel_connect call. #[cfg(feature = "stargate")] pub const RESULT_IBC_CHANNEL_CONNECT: usize = 256 * KI; - /// Max length (in bytes) of the result data from a ibc_channel_close call. + /// Max length (in bytes) of the result data from an ibc_channel_close call. #[cfg(feature = "stargate")] pub const RESULT_IBC_CHANNEL_CLOSE: usize = 256 * KI; - /// Max length (in bytes) of the result data from a ibc_packet_receive call. - #[cfg(feature = "stargate")] + /// Max length (in bytes) of the result data from an ibc_packet_receive call. + #[cfg(any(feature = "stargate", feature = "ibc2"))] pub const RESULT_IBC_PACKET_RECEIVE: usize = 256 * KI; - /// Max length (in bytes) of the result data from a ibc_packet_ack call. + /// Max length (in bytes) of the result data from an ibc_packet_ack call. #[cfg(feature = "stargate")] pub const RESULT_IBC_PACKET_ACK: usize = 256 * KI; - /// Max length (in bytes) of the result data from a ibc_packet_timeout call. - #[cfg(feature = "stargate")] + /// Max length (in bytes) of the result data from an ibc_packet_timeout call. + #[cfg(any(feature = "stargate", feature = "ibc2"))] pub const RESULT_IBC_PACKET_TIMEOUT: usize = 256 * KI; + /// Max length (in bytes) of the result data from an ibc_source_callback call. + pub const RESULT_IBC_SOURCE_CALLBACK: usize = 256 * KI; + /// Max length (in bytes) of the result data from an ibc_destination_callback call. + pub const RESULT_IBC_DESTINATION_CALLBACK: usize = 256 * KI; + /// Max length (in bytes) of the result data from an ibc_packet_receive call. + #[cfg(feature = "ibc2")] + pub const RESULT_IBC2_PACKET_SEND: usize = 256 * KI; } pub fn call_instantiate( @@ -153,6 +176,26 @@ where Ok(result) } +pub fn call_migrate_with_info( + instance: &mut Instance, + env: &Env, + msg: &[u8], + migrate_info: &MigrateInfo, +) -> VmResult>> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, + U: DeserializeOwned + CustomMsg, +{ + let env = to_vec(env)?; + let migrate_info = to_vec(migrate_info)?; + let data = call_migrate_with_info_raw(instance, &env, msg, &migrate_info)?; + let result: ContractResult> = + from_slice(&data, deserialization_limits::RESULT_MIGRATE)?; + Ok(result) +} + pub fn call_sudo( instance: &mut Instance, env: &Env, @@ -206,9 +249,8 @@ where from_slice(&data, deserialization_limits::RESULT_QUERY)?; // Ensure query response is valid JSON if let ContractResult::Ok(binary_response) = &result { - serde_json::from_slice::(binary_response.as_slice()).map_err(|e| { - VmError::generic_err(format!("Query response must be valid JSON. {}", e)) - })?; + serde_json::from_slice::(binary_response.as_slice()) + .map_err(|e| VmError::generic_err(format!("Query response must be valid JSON. {e}")))?; } Ok(result) @@ -328,6 +370,45 @@ where Ok(result) } +pub fn call_ibc_source_callback( + instance: &mut Instance, + env: &Env, + msg: &IbcSourceCallbackMsg, +) -> VmResult>> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, + U: DeserializeOwned + CustomMsg, +{ + let env = to_vec(env)?; + let msg = to_vec(msg)?; + let data = call_ibc_source_callback_raw(instance, &env, &msg)?; + let result = from_slice(&data, deserialization_limits::RESULT_IBC_SOURCE_CALLBACK)?; + Ok(result) +} + +pub fn call_ibc_destination_callback( + instance: &mut Instance, + env: &Env, + msg: &IbcDestinationCallbackMsg, +) -> VmResult>> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, + U: DeserializeOwned + CustomMsg, +{ + let env = to_vec(env)?; + let msg = to_vec(msg)?; + let data = call_ibc_destination_callback_raw(instance, &env, &msg)?; + let result = from_slice( + &data, + deserialization_limits::RESULT_IBC_DESTINATION_CALLBACK, + )?; + Ok(result) +} + /// Calls Wasm export "instantiate" and returns raw data from the contract. /// The result is length limited to prevent abuse but otherwise unchecked. pub fn call_instantiate_raw( @@ -393,6 +474,47 @@ where ) } +/// Calls Wasm export "migrate" and returns raw data from the contract. +/// The result is length limited to prevent abuse but otherwise unchecked. +/// The difference between this function and [call_migrate_raw] is the +/// additional argument - `migrate_info`. It contains additional data +/// related to the contract's migration procedure. +/// +/// It is safe to call this method instead of [call_migrate_raw] even +/// if a contract contains the migrate entrypoint without `migrate_info`. +/// In such case this structure is omitted. +pub fn call_migrate_with_info_raw( + instance: &mut Instance, + env: &[u8], + msg: &[u8], + migrate_info: &[u8], +) -> VmResult> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +{ + instance.set_storage_readonly(false); + call_raw( + instance, + "migrate", + &[env, msg, migrate_info], + read_limits::RESULT_MIGRATE, + ) + .or_else(|err| { + if matches!(err, VmError::FunctionArityMismatch { .. }) { + call_raw( + instance, + "migrate", + &[env, msg], + read_limits::RESULT_MIGRATE, + ) + } else { + Err(err) + } + }) +} + /// Calls Wasm export "sudo" and returns raw data from the contract. /// The result is length limited to prevent abuse but otherwise unchecked. pub fn call_sudo_raw( @@ -561,6 +683,181 @@ where ) } +#[cfg(feature = "ibc2")] +pub fn call_ibc2_packet_ack( + instance: &mut Instance, + env: &Env, + msg: &Ibc2PacketAckMsg, +) -> VmResult>> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, + U: DeserializeOwned + CustomMsg, +{ + let env = to_vec(env)?; + let msg = to_vec(msg)?; + let data = call_ibc2_packet_ack_raw(instance, &env, &msg)?; + let result = from_slice(&data, deserialization_limits::RESULT_IBC_PACKET_ACK)?; + Ok(result) +} + +#[cfg(feature = "ibc2")] +pub fn call_ibc2_packet_ack_raw( + instance: &mut Instance, + env: &[u8], + msg: &[u8], +) -> VmResult> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +{ + instance.set_storage_readonly(false); + call_raw( + instance, + "ibc2_packet_ack", + &[env, msg], + read_limits::RESULT_IBC_PACKET_ACK, + ) +} + +#[cfg(feature = "ibc2")] +pub fn call_ibc2_packet_receive_raw( + instance: &mut Instance, + env: &[u8], + msg: &[u8], +) -> VmResult> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +{ + instance.set_storage_readonly(false); + call_raw( + instance, + "ibc2_packet_receive", + &[env, msg], + read_limits::RESULT_IBC_PACKET_RECEIVE, + ) +} + +#[cfg(feature = "ibc2")] +pub fn call_ibc2_packet_timeout( + instance: &mut Instance, + env: &Env, + msg: &Ibc2PacketTimeoutMsg, +) -> VmResult>> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, + U: DeserializeOwned + CustomMsg, +{ + let env = to_vec(env)?; + let msg = to_vec(msg)?; + let data = call_ibc2_packet_timeout_raw(instance, &env, &msg)?; + let result = from_slice(&data, deserialization_limits::RESULT_IBC_PACKET_TIMEOUT)?; + Ok(result) +} + +#[cfg(feature = "ibc2")] +pub fn call_ibc2_packet_timeout_raw( + instance: &mut Instance, + env: &[u8], + msg: &[u8], +) -> VmResult> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +{ + instance.set_storage_readonly(false); + call_raw( + instance, + "ibc2_packet_timeout", + &[env, msg], + read_limits::RESULT_IBC_PACKET_TIMEOUT, + ) +} + +#[cfg(feature = "ibc2")] +pub fn call_ibc2_packet_send_raw( + instance: &mut Instance, + env: &[u8], + msg: &[u8], +) -> VmResult> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +{ + instance.set_storage_readonly(false); + call_raw( + instance, + "ibc2_packet_send", + &[env, msg], + read_limits::RESULT_IBC2_PACKET_SEND, + ) +} + +#[cfg(feature = "ibc2")] +pub fn call_ibc2_packet_send( + instance: &mut Instance, + env: &Env, + msg: &Ibc2PacketSendMsg, +) -> VmResult>> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, + U: DeserializeOwned + CustomMsg, +{ + let env = to_vec(env)?; + let msg = to_vec(msg)?; + let data = call_ibc2_packet_send_raw(instance, &env, &msg)?; + let result = from_slice(&data, deserialization_limits::RESULT_IBC2_PACKET_SEND)?; + Ok(result) +} + +pub fn call_ibc_source_callback_raw( + instance: &mut Instance, + env: &[u8], + msg: &[u8], +) -> VmResult> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +{ + instance.set_storage_readonly(false); + call_raw( + instance, + "ibc_source_callback", + &[env, msg], + read_limits::RESULT_IBC_SOURCE_CALLBACK, + ) +} + +pub fn call_ibc_destination_callback_raw( + instance: &mut Instance, + env: &[u8], + msg: &[u8], +) -> VmResult> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +{ + instance.set_storage_readonly(false); + call_raw( + instance, + "ibc_destination_callback", + &[env, msg], + read_limits::RESULT_IBC_DESTINATION_CALLBACK, + ) +} + /// Calls a function with the given arguments. /// The exported function must return exactly one result (an offset to the result Region). pub(crate) fn call_raw( @@ -574,7 +871,7 @@ where S: Storage + 'static, Q: Querier + 'static, { - let mut arg_region_ptrs = Vec::::with_capacity(args.len()); + let mut arg_region_ptrs = Vec::::with_capacity(args.len()); for arg in args { let region_ptr = instance.allocate(arg.len())?; instance.write_memory(region_ptr, arg)?; @@ -588,78 +885,247 @@ where Ok(data) } +#[cfg(feature = "ibc2")] +pub fn call_ibc2_packet_receive( + instance: &mut Instance, + env: &Env, + msg: &Ibc2PacketReceiveMsg, +) -> VmResult>> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, + U: DeserializeOwned + CustomMsg, +{ + let env = to_vec(env)?; + let msg = to_vec(msg)?; + let data = call_ibc2_packet_receive_raw(instance, &env, &msg)?; + let result = from_slice(&data, deserialization_limits::RESULT_IBC_PACKET_RECEIVE)?; + Ok(result) +} + #[cfg(test)] mod tests { use super::*; - use crate::testing::{mock_env, mock_info, mock_instance}; - use cosmwasm_std::{coins, Empty}; + use crate::testing::{ + mock_env, mock_info, mock_instance, mock_instance_with_options, MockInstanceOptions, + }; + use cosmwasm_std::{coins, from_json, to_json_string, Addr, Empty}; + use sha2::{Digest, Sha256}; - static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static HACKATOM_1_3: &[u8] = include_bytes!("../testdata/hackatom_1.3.wasm"); + static CYBERPUNK: &[u8] = include_bytes!("../testdata/cyberpunk.wasm"); + static FLOATY2: &[u8] = include_bytes!("../testdata/floaty_2.0.wasm"); + static EMPTY: &[u8] = include_bytes!("../testdata/empty.wasm"); #[test] fn call_instantiate_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) .unwrap() .unwrap(); } + #[test] + fn call_instantiate_handles_missing_export() { + let mut deps = mock_instance(EMPTY, &[]); + + let msg = Empty {}; + let info = mock_info("creator", &coins(1000, "earth")); + + let serialized_msg = to_vec(&msg).unwrap(); + let err = + call_instantiate::<_, _, _, Empty>(&mut deps, &mock_env(), &info, &serialized_msg) + .unwrap_err(); + + assert!(matches!( + err, + VmError::ResolveErr { + msg, + .. + } + if msg == "Could not get export: Missing export instantiate" + )); + } + #[test] fn call_execute_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) .unwrap() .unwrap(); // execute - let info = mock_info("verifies", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&verifier, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) .unwrap() .unwrap(); } + #[test] + fn call_execute_runs_out_of_gas() { + let mut instance = mock_instance(CYBERPUNK, &[]); + + // init + let info = mock_info("creator", &[]); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{}"#) + .unwrap() + .unwrap(); + + // execute + let info = mock_info("looper", &[]); + let msg = br#"{"cpu_loop":{}}"#; + let err = + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap_err(); + assert!(matches!(err, VmError::GasDepletion { .. })); + } + + #[test] + fn call_execute_handles_panic() { + let mut instance = mock_instance(CYBERPUNK, &[]); + + let info = mock_info("creator", &[]); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{}"#) + .unwrap() + .unwrap(); + + // execute + let info = mock_info("troll", &[]); + let msg = br#"{"panic":{}}"#; + let err = + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap_err(); + match err { + VmError::RuntimeErr { msg, .. } => { + assert!( + msg.contains("RuntimeError: Aborted: panicked at src/contract.rs:"), + "Unexpected error msg: {msg}" + ) + } + err => panic!("Unexpected error: {err:?}"), + } + } + + #[test] + fn call_execute_handles_unreachable() { + let mut instance = mock_instance(CYBERPUNK, &[]); + + let info = mock_info("creator", &[]); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{}"#) + .unwrap() + .unwrap(); + + // execute + let info = mock_info("troll", &[]); + let msg = br#"{"unreachable":{}}"#; + let err = + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg).unwrap_err(); + match err { + VmError::RuntimeErr { msg, .. } => { + assert!(msg.contains("RuntimeError: unreachable")) + } + err => panic!("Unexpected error: {err:?}"), + } + } + #[test] fn call_migrate_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance( + HACKATOM_1_3, // only old version of hackatom supports classic migrate signature + &[], + ); // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) + .unwrap() + .unwrap(); + + // change the verifier via migrate + let someone_else = instance.api().addr_make("someone else"); + let msg = format!(r#"{{"verifier": "{someone_else}"}}"#); + let _res = call_migrate::<_, _, _, Empty>(&mut instance, &mock_env(), msg.as_bytes()) + .unwrap() + .unwrap(); + + // query the new_verifier with verifier + let msg = br#"{"verifier":{}}"#; + let contract_result = call_query(&mut instance, &mock_env(), msg).unwrap(); + let query_response = contract_result.unwrap(); + assert_eq!( + query_response, + format!(r#"{{"verifier":"{}"}}"#, someone_else).as_bytes(), + ); + } + + #[test] + fn call_migrate_with_info_works_for_classic_migrate_signature() { + let mut instance = mock_instance( + HACKATOM_1_3, // we test again the old version of hackatom which did not implement the migrate info argument + &[], + ); + + // init + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) .unwrap() .unwrap(); // change the verifier via migrate - let msg = br#"{"verifier": "someone else"}"#; - let _res = call_migrate::<_, _, _, Empty>(&mut instance, &mock_env(), msg); + let someone_else = instance.api().addr_make("someone else"); + let msg = format!(r#"{{"verifier": "{someone_else}"}}"#); + let migrate_info = MigrateInfo { + sender: Addr::unchecked(someone_else.clone()), + old_migrate_version: Some(33), + }; + let _res = call_migrate_with_info::<_, _, _, Empty>( + &mut instance, + &mock_env(), + msg.as_bytes(), + &migrate_info, + ) + .unwrap() + .unwrap(); // query the new_verifier with verifier let msg = br#"{"verifier":{}}"#; let contract_result = call_query(&mut instance, &mock_env(), msg).unwrap(); let query_response = contract_result.unwrap(); assert_eq!( - query_response.as_slice(), - b"{\"verifier\":\"someone else\"}" + query_response, + format!(r#"{{"verifier":"{}"}}"#, someone_else).as_bytes(), ); } #[test] fn call_query_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); // init - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) .unwrap() .unwrap(); @@ -667,26 +1133,109 @@ mod tests { let msg = br#"{"verifier":{}}"#; let contract_result = call_query(&mut instance, &mock_env(), msg).unwrap(); let query_response = contract_result.unwrap(); - assert_eq!(query_response.as_slice(), b"{\"verifier\":\"verifies\"}"); + assert_eq!( + query_response, + format!("{{\"verifier\":\"{verifier}\"}}").as_bytes() + ); + } + + #[test] + fn float_instrs_are_deterministic() { + #[derive(Debug, serde::Serialize, serde::Deserialize)] + #[serde(rename_all = "snake_case")] + pub enum Value { + U32(u32), + U64(u64), + F32(u32), + F64(u64), + } + + let mut instance = mock_instance_with_options( + FLOATY2, + MockInstanceOptions { + gas_limit: u64::MAX, + memory_limit: None, + ..Default::default() + }, + ); + + // init + let info = mock_info("creator", &[]); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{}"#) + .unwrap() + .unwrap(); + + // query instructions + let msg = br#"{"instructions":{}}"#; + let contract_result = call_query(&mut instance, &mock_env(), msg) + .unwrap() + .unwrap(); + let instructions: Vec = from_json(contract_result).unwrap(); + // little sanity check + assert_eq!(instructions.len(), 70); + + const RUNS_PER_INSTRUCTION: u64 = 150; + let mut hasher = Sha256::new(); + for instr in &instructions { + for seed in 0..RUNS_PER_INSTRUCTION { + // query some input values for the instruction + let args: Vec = from_json( + call_query( + &mut instance, + &mock_env(), + format!( + r#"{{"random_args_for":{{ "instruction": "{instr}", "seed": {seed}}}}}"# + ) + .as_bytes(), + ) + .unwrap() + .unwrap(), + ) + .unwrap(); + + // build the run message + let args = to_json_string(&args).unwrap(); + let msg: String = format!( + r#"{{"run":{{ + "instruction": "{instr}", + "args": {args} + }}}}"# + ); + // run the instruction + // this might throw a runtime error (e.g. if the instruction traps) + let result = match call_query(&mut instance, &mock_env(), msg.as_bytes()) { + Ok(ContractResult::Ok(r)) => format!("{:?}", from_json::(&r).unwrap()), + Err(VmError::RuntimeErr { msg, .. }) => msg, + e => panic!("unexpected error: {e:?}"), + }; + // add the result to the hash + hasher.update(format!("{instr}{seed}{result}").as_bytes()); + } + } + let hash = Digest::finalize(hasher); + assert_eq!( + hex::encode(hash.as_slice()), + "95f70fa6451176ab04a9594417a047a1e4d8e2ff809609b8f81099496bee2393" + ); } #[cfg(feature = "stargate")] mod ibc { use super::*; - use crate::calls::{call_instantiate, call_reply}; - use crate::testing::{ - mock_env, mock_info, mock_instance, MockApi, MockQuerier, MockStorage, - }; + use crate::testing::{MockApi, MockQuerier, MockStorage}; + use cosmwasm_std::testing::mock_ibc_packet_timeout; use cosmwasm_std::testing::{ mock_ibc_channel_close_init, mock_ibc_channel_connect_ack, mock_ibc_channel_open_init, - mock_ibc_packet_ack, mock_ibc_packet_recv, mock_ibc_packet_timeout, mock_wasmd_attr, + mock_ibc_packet_ack, mock_ibc_packet_recv, mock_wasmd_attr, }; use cosmwasm_std::{ - Empty, Event, IbcAcknowledgement, IbcOrder, Reply, ReplyOn, SubMsgResponse, - SubMsgResult, + Event, IbcAckCallbackMsg, IbcAcknowledgement, IbcOrder, IbcTimeoutCallbackMsg, ReplyOn, + SubMsgResponse, SubMsgResult, }; - static CONTRACT: &[u8] = include_bytes!("../testdata/ibc_reflect.wasm"); + static IBC_REFLECT: &[u8] = include_bytes!("../testdata/ibc_reflect.wasm"); + static IBC_CALLBACKS: &[u8] = include_bytes!("../testdata/ibc_callbacks.wasm"); const IBC_VERSION: &str = "ibc-reflect-v1"; + fn setup( instance: &mut Instance, channel_id: &str, @@ -721,40 +1270,50 @@ mod tests { ); assert_eq!(ReplyOn::Success, res.messages[0].reply_on); let id = res.messages[0].id; + let payload = res.messages[0].payload.clone(); let event = Event::new("instantiate").add_attributes(vec![ // We have to force this one to avoid the debug assertion against _ mock_wasmd_attr("_contract_address", account), ]); // which creates a reflect account. here we get the callback + #[allow(deprecated)] let response = Reply { id, + payload, + gas_used: 1234567, result: SubMsgResult::Ok(SubMsgResponse { events: vec![event], + msg_responses: vec![], data: None, }), }; call_reply::<_, _, _, Empty>(instance, &mock_env(), &response).unwrap(); } + const CHANNEL_ID: &str = "channel-123"; const ACCOUNT: &str = "account-456"; + #[test] fn call_ibc_channel_open_and_connect_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(IBC_REFLECT, &[]); setup(&mut instance, CHANNEL_ID, ACCOUNT); } + #[test] fn call_ibc_channel_close_works() { - let mut instance = mock_instance(CONTRACT, &[]); - setup(&mut instance, CHANNEL_ID, ACCOUNT); + let mut instance = mock_instance(IBC_REFLECT, &[]); + let account = instance.api().addr_make(ACCOUNT); + setup(&mut instance, CHANNEL_ID, &account); let handshake_close = mock_ibc_channel_close_init(CHANNEL_ID, IbcOrder::Ordered, IBC_VERSION); call_ibc_channel_close::<_, _, _, Empty>(&mut instance, &mock_env(), &handshake_close) .unwrap() .unwrap(); } + #[test] fn call_ibc_packet_ack_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(IBC_REFLECT, &[]); setup(&mut instance, CHANNEL_ID, ACCOUNT); let ack = IbcAcknowledgement::new(br#"{}"#); let msg = mock_ibc_packet_ack(CHANNEL_ID, br#"{}"#, ack).unwrap(); @@ -762,18 +1321,20 @@ mod tests { .unwrap() .unwrap(); } + #[test] fn call_ibc_packet_timeout_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(IBC_REFLECT, &[]); setup(&mut instance, CHANNEL_ID, ACCOUNT); let msg = mock_ibc_packet_timeout(CHANNEL_ID, br#"{}"#).unwrap(); call_ibc_packet_timeout::<_, _, _, Empty>(&mut instance, &mock_env(), &msg) .unwrap() .unwrap(); } + #[test] fn call_ibc_packet_receive_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(IBC_REFLECT, &[]); setup(&mut instance, CHANNEL_ID, ACCOUNT); let who_am_i = br#"{"who_am_i":{}}"#; let msg = mock_ibc_packet_recv(CHANNEL_ID, who_am_i).unwrap(); @@ -781,5 +1342,157 @@ mod tests { .unwrap() .unwrap(); } + + #[test] + fn call_ibc_source_callback_works() { + let mut instance = mock_instance(IBC_CALLBACKS, &[]); + + // init + let creator = instance.api().addr_make("creator"); + let info = mock_info(&creator, &[]); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{}"#) + .unwrap() + .unwrap(); + + /// Response type for the `callback_stats` query + #[derive(serde::Serialize, serde::Deserialize)] + struct CallbackStats { + pub ibc_ack_callbacks: Vec, + pub ibc_timeout_callbacks: Vec, + } + + // send ack callback + let ack = mock_ibc_packet_ack(CHANNEL_ID, br#"{}"#, IbcAcknowledgement::new(br#"{}"#)) + .unwrap(); + let msg = IbcSourceCallbackMsg::Acknowledgement(IbcAckCallbackMsg::new( + ack.acknowledgement, + ack.original_packet, + ack.relayer, + )); + call_ibc_source_callback::<_, _, _, Empty>(&mut instance, &mock_env(), &msg) + .unwrap() + .unwrap(); + // query the CallbackStats + let stats: CallbackStats = serde_json::from_slice( + &call_query::<_, _, _>(&mut instance, &mock_env(), br#"{"callback_stats":{}}"#) + .unwrap() + .unwrap(), + ) + .unwrap(); + assert_eq!(1, stats.ibc_ack_callbacks.len()); + assert_eq!(0, stats.ibc_timeout_callbacks.len()); + + // send timeout callback + let timeout = mock_ibc_packet_timeout(CHANNEL_ID, br#"{}"#).unwrap(); + let msg = IbcSourceCallbackMsg::Timeout(IbcTimeoutCallbackMsg::new( + timeout.packet, + timeout.relayer, + )); + call_ibc_source_callback::<_, _, _, Empty>(&mut instance, &mock_env(), &msg) + .unwrap() + .unwrap(); + // query the CallbackStats + let stats: CallbackStats = serde_json::from_slice( + &call_query::<_, _, _>(&mut instance, &mock_env(), br#"{"callback_stats":{}}"#) + .unwrap() + .unwrap(), + ) + .unwrap(); + assert_eq!(1, stats.ibc_ack_callbacks.len()); + assert_eq!(1, stats.ibc_timeout_callbacks.len()); + } + } + + #[cfg(feature = "ibc2")] + mod ibc2 { + use super::*; + use cosmwasm_std::testing::{ + mock_ibc2_packet_ack, mock_ibc2_packet_recv, mock_ibc2_packet_send, + mock_ibc2_packet_timeout, + }; + static IBC2: &[u8] = include_bytes!("../testdata/ibc2.wasm"); + + #[derive(serde::Serialize)] + pub struct IbcPayload { + pub response_without_ack: bool, + pub send_async_ack_for_prev_msg: bool, + } + + #[test] + fn call_ibc2_packet_ack_works() { + // init + let mut instance = mock_instance(IBC2, &[]); + let info = mock_info("creator", &[]); + let instantiate_msg = br#"{}"#; + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, instantiate_msg) + .unwrap() + .unwrap(); + + let ibc2_msg = IbcPayload { + response_without_ack: false, + send_async_ack_for_prev_msg: false, + }; + let ibc2_ack = mock_ibc2_packet_ack(&ibc2_msg).unwrap(); + call_ibc2_packet_ack::<_, _, _, Empty>(&mut instance, &mock_env(), &ibc2_ack) + .unwrap() + .unwrap(); + } + + #[test] + fn call_ibc2_packet_receive_works() { + // init + let mut instance = mock_instance(IBC2, &[]); + let info = mock_info("creator", &[]); + let instantiate_msg = br#"{}"#; + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, instantiate_msg) + .unwrap() + .unwrap(); + + let ibc2_msg = IbcPayload { + response_without_ack: false, + send_async_ack_for_prev_msg: false, + }; + let ibc2_timeout = mock_ibc2_packet_recv(&ibc2_msg).unwrap(); + call_ibc2_packet_receive::<_, _, _, Empty>(&mut instance, &mock_env(), &ibc2_timeout) + .unwrap() + .unwrap(); + } + + #[test] + fn call_ibc2_packet_timeout_works() { + // init + let mut instance = mock_instance(IBC2, &[]); + let info = mock_info("creator", &[]); + let instantiate_msg = br#"{}"#; + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, instantiate_msg) + .unwrap() + .unwrap(); + + let ibc2_msg = br#"SomeRandomMsg"#; + let ibc2_msg = mock_ibc2_packet_timeout(ibc2_msg).unwrap(); + call_ibc2_packet_timeout::<_, _, _, Empty>(&mut instance, &mock_env(), &ibc2_msg) + .unwrap() + .unwrap(); + } + + #[test] + fn call_ibc2_packet_send_works() { + // init + let mut instance = mock_instance(IBC2, &[]); + let info = mock_info("creator", &[]); + let instantiate_msg = br#"{}"#; + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, instantiate_msg) + .unwrap() + .unwrap(); + + let ibc2_msg = IbcPayload { + response_without_ack: false, + send_async_ack_for_prev_msg: false, + }; + let ibc2_sent = mock_ibc2_packet_send(&ibc2_msg).unwrap(); + call_ibc2_packet_send::<_, _, _, Empty>(&mut instance, &mock_env(), &ibc2_sent) + .unwrap() + .unwrap(); + } } } diff --git a/packages/vm/src/capabilities.rs b/packages/vm/src/capabilities.rs index 85dabe9c95..8281105011 100644 --- a/packages/vm/src/capabilities.rs +++ b/packages/vm/src/capabilities.rs @@ -15,7 +15,7 @@ pub fn capabilities_from_csv(csv: &str) -> HashSet { /// Implementation for check_wasm, based on static analysis of the bytecode. /// This is used for code upload, to perform check before compiling the Wasm. -pub fn required_capabilities_from_module(module: &impl ExportInfo) -> HashSet { +pub fn required_capabilities_from_module(module: impl ExportInfo) -> HashSet { module .exported_function_names(Some(REQUIRES_PREFIX)) .into_iter() @@ -32,8 +32,9 @@ pub fn required_capabilities_from_module(module: &impl ExportInfo) -> HashSet Self { - Checksum(Sha256::digest(wasm).into()) - } - - /// Creates a lowercase hex encoded copy of this checksum. - /// - /// This takes an owned `self` instead of a reference because `Checksum` is cheap to `Copy`. - pub fn to_hex(self) -> String { - self.to_string() - } -} - -impl fmt::Display for Checksum { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - for byte in self.0.iter() { - write!(f, "{:02x}", byte)?; - } - Ok(()) - } -} - -impl From<[u8; 32]> for Checksum { - fn from(data: [u8; 32]) -> Self { - Checksum(data) - } -} - -impl TryFrom<&[u8]> for Checksum { - type Error = VmError; - - fn try_from(value: &[u8]) -> Result { - if value.len() != 32 { - return Err(VmError::cache_err("Checksum not of length 32")); - } - let mut data = [0u8; 32]; - data.copy_from_slice(value); - Ok(Checksum(data)) - } -} - -impl From for Vec { - fn from(original: Checksum) -> Vec { - original.0.into() - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn generate_works() { - let wasm = vec![0x68, 0x69, 0x6a]; - let checksum = Checksum::generate(&wasm); - - // echo -n "hij" | sha256sum - let expected = [ - 0x72, 0x2c, 0x8c, 0x99, 0x3f, 0xd7, 0x5a, 0x76, 0x27, 0xd6, 0x9e, 0xd9, 0x41, 0x34, - 0x4f, 0xe2, 0xa1, 0x42, 0x3a, 0x3e, 0x75, 0xef, 0xd3, 0xe6, 0x77, 0x8a, 0x14, 0x28, - 0x84, 0x22, 0x71, 0x04, - ]; - assert_eq!(checksum.0, expected); - } - - #[test] - fn implemented_display() { - let wasm = vec![0x68, 0x69, 0x6a]; - let checksum = Checksum::generate(&wasm); - // echo -n "hij" | sha256sum - let embedded = format!("Check: {}", checksum); - assert_eq!( - embedded, - "Check: 722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104" - ); - assert_eq!( - checksum.to_string(), - "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104" - ); - } - - #[test] - fn to_hex_works() { - let wasm = vec![0x68, 0x69, 0x6a]; - let checksum = Checksum::generate(&wasm); - // echo -n "hij" | sha256sum - assert_eq!( - checksum.to_hex(), - "722c8c993fd75a7627d69ed941344fe2a1423a3e75efd3e6778a142884227104" - ); - } - - #[test] - fn into_vec_works() { - let checksum = Checksum::generate(&[12u8; 17]); - let as_vec: Vec = checksum.into(); - assert_eq!(as_vec, checksum.0); - } -} diff --git a/packages/vm/src/compatibility.rs b/packages/vm/src/compatibility.rs index c2c9826a9d..3da2662593 100644 --- a/packages/vm/src/compatibility.rs +++ b/packages/vm/src/compatibility.rs @@ -1,11 +1,15 @@ -use parity_wasm::elements::{External, ImportEntry, Module}; use std::collections::BTreeSet; use std::collections::HashSet; +use wasmer::wasmparser::Import; +use wasmer::wasmparser::TypeRef; + use crate::capabilities::required_capabilities_from_module; +use crate::config::WasmLimits; use crate::errors::{VmError, VmResult}; use crate::limited::LimitedDisplay; -use crate::static_analysis::{deserialize_wasm, ExportInfo}; +use crate::parsed_wasm::ParsedWasm; +use crate::static_analysis::ExportInfo; /// Lists all imports we provide upon instantiating the instance in Instance::from_module() /// This should be updated when new imports are added @@ -17,8 +21,15 @@ const SUPPORTED_IMPORTS: &[&str] = &[ "env.addr_validate", "env.addr_canonicalize", "env.addr_humanize", + "env.bls12_381_aggregate_g1", + "env.bls12_381_aggregate_g2", + "env.bls12_381_pairing_equality", + "env.bls12_381_hash_to_g1", + "env.bls12_381_hash_to_g2", "env.secp256k1_verify", "env.secp256k1_recover_pubkey", + "env.secp256r1_verify", + "env.secp256r1_recover_pubkey", "env.ed25519_verify", "env.ed25519_batch_verify", "env.debug", @@ -27,6 +38,10 @@ const SUPPORTED_IMPORTS: &[&str] = &[ "env.db_scan", #[cfg(feature = "iterator")] "env.db_next", + #[cfg(feature = "iterator")] + "env.db_next_key", + #[cfg(feature = "iterator")] + "env.db_next_value", ]; /// Lists all entry points we expect to be present when calling a contract. @@ -37,59 +52,110 @@ const REQUIRED_EXPORTS: &[&str] = &[ // IO "allocate", "deallocate", - // Required entry points - "instantiate", ]; const INTERFACE_VERSION_PREFIX: &str = "interface_version_"; -const SUPPORTED_INTERFACE_VERSIONS: &[&str] = &[ - "interface_version_8", - #[cfg(feature = "allow_interface_version_7")] - "interface_version_7", -]; +const SUPPORTED_INTERFACE_VERSIONS: &[&str] = &["interface_version_8"]; + +#[derive(Clone, Copy)] +pub enum LogOutput { + StdOut, + StdErr, +} +#[derive(Clone, Copy, Default)] +pub enum Logger<'a> { + On { + prefix: &'a str, + output: LogOutput, + }, + #[default] + Off, +} + +impl<'a> Logger<'a> { + pub fn with_config(output: LogOutput, prefix: &'a str) -> Self { + On { output, prefix } + } + + /// Adds a message to the logs, if they are enabled. + /// This is a convenience method for adding a single message. + /// + /// Takes a closure that returns the message to add to avoid unnecessary allocations. + pub fn add(&self, msg_fn: impl FnOnce() -> String) { + if let On { prefix, output } = &self { + let msg = msg_fn(); + match output { + LogOutput::StdOut => println!("{prefix}{msg}"), + LogOutput::StdErr => eprintln!("{prefix}{msg}"), + } + } + } +} -const MEMORY_LIMIT: u32 = 512; // in pages +use Logger::*; /// Checks if the data is valid wasm and compatibility with the CosmWasm API (imports and exports) -pub fn check_wasm(wasm_code: &[u8], available_capabilities: &HashSet) -> VmResult<()> { - let module = deserialize_wasm(wasm_code)?; - check_wasm_memories(&module)?; +pub fn check_wasm( + wasm_code: &[u8], + available_capabilities: &HashSet, + limits: &WasmLimits, + logs: Logger<'_>, +) -> VmResult<()> { + logs.add(|| format!("Size of Wasm blob: {}", wasm_code.len())); + + let mut module = ParsedWasm::parse(wasm_code)?; + + check_wasm_tables(&module, limits)?; + check_wasm_memories(&module, limits)?; check_interface_version(&module)?; - check_wasm_exports(&module)?; - check_wasm_imports(&module, SUPPORTED_IMPORTS)?; - check_wasm_capabilities(&module, available_capabilities)?; - Ok(()) + check_wasm_exports(&module, logs)?; + check_wasm_imports(&module, SUPPORTED_IMPORTS, limits, logs)?; + check_wasm_capabilities(&module, available_capabilities, logs)?; + check_wasm_functions(&module, limits, logs)?; + + module.validate_funcs() } -fn check_wasm_memories(module: &Module) -> VmResult<()> { - let section = match module.memory_section() { - Some(section) => section, - None => { - return Err(VmError::static_validation_err( - "Wasm contract doesn't have a memory section", - )); +fn check_wasm_tables(module: &ParsedWasm, wasm_limits: &WasmLimits) -> VmResult<()> { + match module.tables.len() { + 0 => Ok(()), + 1 => { + let limits = &module.tables[0]; + if let Some(maximum) = limits.maximum { + if maximum > wasm_limits.table_size_limit_elements() as u64 { + return Err(VmError::static_validation_err( + "Wasm contract's first table section has a too large max limit", + )); + } + Ok(()) + } else { + Err(VmError::static_validation_err( + "Wasm contract must not have unbound table section", + )) + } } - }; + _ => Err(VmError::static_validation_err( + "Wasm contract must not have more than 1 table section", + )), + } +} - let memories = section.entries(); - if memories.len() != 1 { +fn check_wasm_memories(module: &ParsedWasm, limits: &WasmLimits) -> VmResult<()> { + if module.memories.len() != 1 { return Err(VmError::static_validation_err( "Wasm contract must contain exactly one memory", )); } + let memory = &module.memories[0]; - let memory = memories[0]; - // println!("Memory: {:?}", memory); - let limits = memory.limits(); - - if limits.initial() > MEMORY_LIMIT { + if memory.initial > limits.initial_memory_limit_pages() as u64 { return Err(VmError::static_validation_err(format!( "Wasm contract memory's minimum must not exceed {} pages.", - MEMORY_LIMIT + limits.initial_memory_limit_pages() ))); } - if limits.maximum().is_some() { + if memory.maximum.is_some() { return Err(VmError::static_validation_err( "Wasm contract memory's maximum must be unset. The host will set it for you.", )); @@ -97,7 +163,7 @@ fn check_wasm_memories(module: &Module) -> VmResult<()> { Ok(()) } -fn check_interface_version(module: &Module) -> VmResult<()> { +fn check_interface_version(module: &ParsedWasm) -> VmResult<()> { let mut interface_version_exports = module .exported_function_names(Some(INTERFACE_VERSION_PREFIX)) .into_iter(); @@ -109,10 +175,7 @@ fn check_interface_version(module: &Module) -> VmResult<()> { } else { // Exactly one interface version found let version_str = first_interface_version_export.as_str(); - if SUPPORTED_INTERFACE_VERSIONS - .iter() - .any(|&v| v == version_str) - { + if SUPPORTED_INTERFACE_VERSIONS.contains(&version_str) { Ok(()) } else { Err(VmError::static_validation_err( @@ -127,13 +190,15 @@ fn check_interface_version(module: &Module) -> VmResult<()> { } } -fn check_wasm_exports(module: &Module) -> VmResult<()> { +fn check_wasm_exports(module: &ParsedWasm, logs: Logger) -> VmResult<()> { let available_exports: HashSet = module.exported_function_names(None); + + logs.add(|| format!("Exports: {}", available_exports.to_string_limited(20_000))); + for required_export in REQUIRED_EXPORTS { if !available_exports.contains(*required_export) { return Err(VmError::static_validation_err(format!( - "Wasm contract doesn't have required export: \"{}\". Exports required by VM: {:?}.", - required_export, REQUIRED_EXPORTS + "Wasm contract doesn't have required export: \"{required_export}\". Exports required by VM: {REQUIRED_EXPORTS:?}." ))); } } @@ -143,42 +208,70 @@ fn check_wasm_exports(module: &Module) -> VmResult<()> { /// Checks if the import requirements of the contract are satisfied. /// When this is not the case, we either have an incompatibility between contract and VM /// or a error in the contract. -fn check_wasm_imports(module: &Module, supported_imports: &[&str]) -> VmResult<()> { - let required_imports: Vec = module - .import_section() - .map_or(vec![], |import_section| import_section.entries().to_vec()); - let required_import_names: BTreeSet<_> = - required_imports.iter().map(full_import_name).collect(); - - for required_import in required_imports { - let full_name = full_import_name(&required_import); +fn check_wasm_imports( + module: &ParsedWasm, + supported_imports: &[&str], + limits: &WasmLimits, + logs: Logger, +) -> VmResult<()> { + logs.add(|| { + format!( + "Imports ({}): {}", + module.imports.len(), + module + .imports + .iter() + .map(|import| full_import_name(import)) + .collect::>() + .join(", ") + ) + }); + + if module.imports.len() > limits.max_imports() { + return Err(VmError::static_validation_err(format!( + "Import count exceeds limit. Imports: {}. Limit: {}.", + module.imports.len(), + limits.max_imports() + ))); + } + + for required_import in &module.imports { + let full_name = full_import_name(required_import); if !supported_imports.contains(&full_name.as_str()) { + let required_import_names: BTreeSet<_> = + module.imports.iter().map(full_import_name).collect(); return Err(VmError::static_validation_err(format!( "Wasm contract requires unsupported import: \"{}\". Required imports: {}. Available imports: {:?}.", full_name, required_import_names.to_string_limited(200), supported_imports ))); } - match required_import.external() { - External::Function(_) => {}, // ok + match required_import.ty { + TypeRef::Func(_) => {} // ok _ => return Err(VmError::static_validation_err(format!( - "Wasm contract requires non-function import: \"{}\". Right now, all supported imports are functions.", - full_name - ))), - }; + "Wasm contract requires non-function import: \"{full_name}\". Right now, all supported imports are functions." + ))) + } } Ok(()) } -fn full_import_name(ie: &ImportEntry) -> String { - format!("{}.{}", ie.module(), ie.field()) +fn full_import_name(ie: &Import) -> String { + format!("{}.{}", ie.module, ie.name) } fn check_wasm_capabilities( - module: &Module, + module: &ParsedWasm, available_capabilities: &HashSet, + logs: Logger, ) -> VmResult<()> { let required_capabilities = required_capabilities_from_module(module); + logs.add(|| { + format!( + "Required capabilities: {}", + required_capabilities.to_string_limited(20_000) + ) + }); if !required_capabilities.is_subset(available_capabilities) { // We switch to BTreeSet to get a sorted error message let unavailable: BTreeSet<_> = required_capabilities @@ -192,80 +285,207 @@ fn check_wasm_capabilities( Ok(()) } +fn check_wasm_functions(module: &ParsedWasm, limits: &WasmLimits, logs: Logger) -> VmResult<()> { + logs.add(|| format!("Function count: {}", module.function_count)); + logs.add(|| format!("Max function parameters: {}", module.max_func_params)); + logs.add(|| format!("Max function results: {}", module.max_func_results)); + logs.add(|| { + format!( + "Total function parameter count: {}", + module.total_func_params + ) + }); + + if module.function_count > limits.max_functions() { + return Err(VmError::static_validation_err(format!( + "Wasm contract contains more than {} functions", + limits.max_functions() + ))); + } + if module.max_func_params > limits.max_function_params() { + return Err(VmError::static_validation_err(format!( + "Wasm contract contains function with more than {} parameters", + limits.max_function_params() + ))); + } + if module.max_func_results > limits.max_function_results() { + return Err(VmError::static_validation_err(format!( + "Wasm contract contains function with more than {} results", + limits.max_function_results() + ))); + } + + if module.total_func_params > limits.max_total_function_params() { + return Err(VmError::static_validation_err(format!( + "Wasm contract contains more than {} function parameters in total", + limits.max_total_function_params() + ))); + } + + Ok(()) +} + #[cfg(test)] mod tests { use super::*; - use crate::errors::VmError; static CONTRACT_0_7: &[u8] = include_bytes!("../testdata/hackatom_0.7.wasm"); static CONTRACT_0_12: &[u8] = include_bytes!("../testdata/hackatom_0.12.wasm"); static CONTRACT_0_14: &[u8] = include_bytes!("../testdata/hackatom_0.14.wasm"); static CONTRACT_0_15: &[u8] = include_bytes!("../testdata/hackatom_0.15.wasm"); - static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static CYBERPUNK: &[u8] = include_bytes!("../testdata/cyberpunk.wasm"); + static CYBERPUNK_RUST_170: &[u8] = include_bytes!("../testdata/cyberpunk_rust170.wasm"); fn default_capabilities() -> HashSet { - ["staking".to_string()].into_iter().collect() + HashSet::from([ + "cosmwasm_1_1".to_string(), + "cosmwasm_1_2".to_string(), + "cosmwasm_1_3".to_string(), + "cosmwasm_1_4".to_string(), + "cosmwasm_1_4".to_string(), + "cosmwasm_2_0".to_string(), + "cosmwasm_2_1".to_string(), + "cosmwasm_2_2".to_string(), + "iterator".to_string(), + "staking".to_string(), + "stargate".to_string(), + ]) } #[test] fn check_wasm_passes_for_latest_contract() { // this is our reference check, must pass - check_wasm(CONTRACT, &default_capabilities()).unwrap(); + check_wasm( + HACKATOM, + &default_capabilities(), + &WasmLimits::default(), + Off, + ) + .unwrap(); + check_wasm( + CYBERPUNK, + &default_capabilities(), + &WasmLimits::default(), + Off, + ) + .unwrap(); + } + + #[test] + fn check_wasm_allows_sign_ext() { + // See https://github.com/CosmWasm/cosmwasm/issues/1727 + check_wasm( + CYBERPUNK_RUST_170, + &default_capabilities(), + &WasmLimits::default(), + Off, + ) + .unwrap(); } #[test] fn check_wasm_old_contract() { - match check_wasm(CONTRACT_0_15, &default_capabilities()) { + match check_wasm(CONTRACT_0_15, &default_capabilities(),&WasmLimits::default(), + Off) { Err(VmError::StaticValidationErr { msg, .. }) => assert_eq!( msg, "Wasm contract has unknown interface_version_* marker export (see https://github.com/CosmWasm/cosmwasm/blob/main/packages/vm/README.md)" ), - Err(e) => panic!("Unexpected error {:?}", e), - Ok(_) => panic!("This must not succeeed"), + Err(e) => panic!("Unexpected error {e:?}"), + Ok(_) => panic!("This must not succeed"), }; - match check_wasm(CONTRACT_0_14, &default_capabilities()) { + match check_wasm(CONTRACT_0_14, &default_capabilities(),&WasmLimits::default(), + Off,) { Err(VmError::StaticValidationErr { msg, .. }) => assert_eq!( msg, "Wasm contract has unknown interface_version_* marker export (see https://github.com/CosmWasm/cosmwasm/blob/main/packages/vm/README.md)" ), - Err(e) => panic!("Unexpected error {:?}", e), - Ok(_) => panic!("This must not succeeed"), + Err(e) => panic!("Unexpected error {e:?}"), + Ok(_) => panic!("This must not succeed"), }; - match check_wasm(CONTRACT_0_12, &default_capabilities()) { - Err(VmError::StaticValidationErr { msg, .. }) => assert_eq!( - msg, - "Wasm contract missing a required marker export: interface_version_*" - ), - Err(e) => panic!("Unexpected error {:?}", e), - Ok(_) => panic!("This must not succeeed"), + match check_wasm( + CONTRACT_0_12, + &default_capabilities(), + &WasmLimits::default(), + Off, + ) { + Err(VmError::StaticValidationErr { msg, .. }) => { + assert!(msg.contains( + "Wasm contract missing a required marker export: interface_version_*" + )) + } + Err(e) => panic!("Unexpected error {e:?}"), + Ok(_) => panic!("This must not succeed"), }; - match check_wasm(CONTRACT_0_7, &default_capabilities()) { - Err(VmError::StaticValidationErr { msg, .. }) => assert_eq!( - msg, - "Wasm contract missing a required marker export: interface_version_*" - ), - Err(e) => panic!("Unexpected error {:?}", e), - Ok(_) => panic!("This must not succeeed"), + match check_wasm( + CONTRACT_0_7, + &default_capabilities(), + &WasmLimits::default(), + Off, + ) { + Err(VmError::StaticValidationErr { msg, .. }) => { + assert!(msg.contains( + "Wasm contract missing a required marker export: interface_version_*" + )) + } + Err(e) => panic!("Unexpected error {e:?}"), + Ok(_) => panic!("This must not succeed"), }; } + #[test] + fn check_wasm_tables_works() { + let limits = WasmLimits::default(); + // No tables is fine + let wasm = wat::parse_str("(module)").unwrap(); + assert!(ParsedWasm::parse(&wasm).unwrap().tables.is_empty()); + + // One table (bound) + let wasm = wat::parse_str("(module (table $name 123 123 funcref))").unwrap(); + check_wasm_tables(&ParsedWasm::parse(&wasm).unwrap(), &limits).unwrap(); + + // One table (bound, initial > max) + let wasm = wat::parse_str("(module (table $name 124 123 funcref))").unwrap(); + // this should be caught by the validator + let err = &ParsedWasm::parse(&wasm).unwrap_err(); + assert!(err + .to_string() + .contains("size minimum must not be greater than maximum")); + + // One table (bound, max too large) + let wasm = wat::parse_str("(module (table $name 100 9999 funcref))").unwrap(); + let err = check_wasm_tables(&ParsedWasm::parse(&wasm).unwrap(), &limits).unwrap_err(); + assert!(err + .to_string() + .contains("Wasm contract's first table section has a too large max limit")); + + // One table (unbound) + let wasm = wat::parse_str("(module (table $name 100 funcref))").unwrap(); + let err = check_wasm_tables(&ParsedWasm::parse(&wasm).unwrap(), &limits).unwrap_err(); + assert!(err + .to_string() + .contains("Wasm contract must not have unbound table section")); + } + #[test] fn check_wasm_memories_ok() { let wasm = wat::parse_str("(module (memory 1))").unwrap(); - check_wasm_memories(&deserialize_wasm(&wasm).unwrap()).unwrap() + check_wasm_memories(&ParsedWasm::parse(&wasm).unwrap(), &WasmLimits::default()).unwrap() } #[test] fn check_wasm_memories_no_memory() { + let limits = WasmLimits::default(); let wasm = wat::parse_str("(module)").unwrap(); - match check_wasm_memories(&deserialize_wasm(&wasm).unwrap()) { + match check_wasm_memories(&ParsedWasm::parse(&wasm).unwrap(), &limits) { Err(VmError::StaticValidationErr { msg, .. }) => { - assert!(msg.starts_with("Wasm contract doesn't have a memory section")); + assert!(msg.starts_with("Wasm contract must contain exactly one memory")); } - Err(e) => panic!("Unexpected error {:?}", e), + Err(e) => panic!("Unexpected error {e:?}"), Ok(_) => panic!("Didn't reject wasm with invalid api"), } } @@ -285,11 +505,12 @@ mod tests { )) .unwrap(); - match check_wasm_memories(&deserialize_wasm(&wasm).unwrap()) { + // wrong number of memories should be caught by the validator + match ParsedWasm::parse(&wasm) { Err(VmError::StaticValidationErr { msg, .. }) => { - assert!(msg.starts_with("Wasm contract must contain exactly one memory")); + assert!(msg.contains("multiple memories")); } - Err(e) => panic!("Unexpected error {:?}", e), + Err(e) => panic!("Unexpected error {e:?}"), Ok(_) => panic!("Didn't reject wasm with invalid api"), } } @@ -306,26 +527,27 @@ mod tests { )) .unwrap(); - match check_wasm_memories(&deserialize_wasm(&wasm).unwrap()) { + match check_wasm_memories(&ParsedWasm::parse(&wasm).unwrap(), &WasmLimits::default()) { Err(VmError::StaticValidationErr { msg, .. }) => { assert!(msg.starts_with("Wasm contract must contain exactly one memory")); } - Err(e) => panic!("Unexpected error {:?}", e), + Err(e) => panic!("Unexpected error {e:?}"), Ok(_) => panic!("Didn't reject wasm with invalid api"), } } #[test] fn check_wasm_memories_initial_size() { + let limits = WasmLimits::default(); let wasm_ok = wat::parse_str("(module (memory 512))").unwrap(); - check_wasm_memories(&deserialize_wasm(&wasm_ok).unwrap()).unwrap(); + check_wasm_memories(&ParsedWasm::parse(&wasm_ok).unwrap(), &limits).unwrap(); let wasm_too_big = wat::parse_str("(module (memory 513))").unwrap(); - match check_wasm_memories(&deserialize_wasm(&wasm_too_big).unwrap()) { + match check_wasm_memories(&ParsedWasm::parse(&wasm_too_big).unwrap(), &limits) { Err(VmError::StaticValidationErr { msg, .. }) => { assert!(msg.starts_with("Wasm contract memory's minimum must not exceed 512 pages")); } - Err(e) => panic!("Unexpected error {:?}", e), + Err(e) => panic!("Unexpected error {e:?}"), Ok(_) => panic!("Didn't reject wasm with invalid api"), } } @@ -333,11 +555,14 @@ mod tests { #[test] fn check_wasm_memories_maximum_size() { let wasm_max = wat::parse_str("(module (memory 1 5))").unwrap(); - match check_wasm_memories(&deserialize_wasm(&wasm_max).unwrap()) { + match check_wasm_memories( + &ParsedWasm::parse(&wasm_max).unwrap(), + &WasmLimits::default(), + ) { Err(VmError::StaticValidationErr { msg, .. }) => { assert!(msg.starts_with("Wasm contract memory's maximum must be unset")); } - Err(e) => panic!("Unexpected error {:?}", e), + Err(e) => panic!("Unexpected error {e:?}"), Ok(_) => panic!("Didn't reject wasm with invalid api"), } } @@ -357,28 +582,9 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); check_interface_version(&module).unwrap(); - #[cfg(feature = "allow_interface_version_7")] - { - // valid legacy version - let wasm = wat::parse_str( - r#"(module - (type (func)) - (func (type 0) nop) - (export "add_one" (func 0)) - (export "allocate" (func 0)) - (export "interface_version_7" (func 0)) - (export "deallocate" (func 0)) - (export "instantiate" (func 0)) - )"#, - ) - .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); - check_interface_version(&module).unwrap(); - } - // missing let wasm = wat::parse_str( r#"(module @@ -391,7 +597,7 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); match check_interface_version(&module).unwrap_err() { VmError::StaticValidationErr { msg, .. } => { assert_eq!( @@ -399,7 +605,7 @@ mod tests { "Wasm contract missing a required marker export: interface_version_*" ); } - err => panic!("Unexpected error {:?}", err), + err => panic!("Unexpected error {err:?}"), } // multiple @@ -416,7 +622,7 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); match check_interface_version(&module).unwrap_err() { VmError::StaticValidationErr { msg, .. } => { assert_eq!( @@ -424,7 +630,7 @@ mod tests { "Wasm contract contains more than one marker export: interface_version_*" ); } - err => panic!("Unexpected error {:?}", err), + err => panic!("Unexpected error {err:?}"), } // CosmWasm 0.15 @@ -440,12 +646,12 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); match check_interface_version(&module).unwrap_err() { VmError::StaticValidationErr { msg, .. } => { assert_eq!(msg, "Wasm contract has unknown interface_version_* marker export (see https://github.com/CosmWasm/cosmwasm/blob/main/packages/vm/README.md)"); } - err => panic!("Unexpected error {:?}", err), + err => panic!("Unexpected error {err:?}"), } // Unknown value @@ -461,12 +667,12 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); match check_interface_version(&module).unwrap_err() { VmError::StaticValidationErr { msg, .. } => { assert_eq!(msg, "Wasm contract has unknown interface_version_* marker export (see https://github.com/CosmWasm/cosmwasm/blob/main/packages/vm/README.md)"); } - err => panic!("Unexpected error {:?}", err), + err => panic!("Unexpected error {err:?}"), } } @@ -480,12 +686,11 @@ mod tests { (export "add_one" (func 0)) (export "allocate" (func 0)) (export "deallocate" (func 0)) - (export "instantiate" (func 0)) )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); - check_wasm_exports(&module).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); + check_wasm_exports(&module, Off).unwrap(); // this is invalid, as it doesn't any required export let wasm = wat::parse_str( @@ -496,12 +701,12 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); - match check_wasm_exports(&module) { + let module = ParsedWasm::parse(&wasm).unwrap(); + match check_wasm_exports(&module, Off) { Err(VmError::StaticValidationErr { msg, .. }) => { assert!(msg.starts_with("Wasm contract doesn't have required export: \"allocate\"")); } - Err(e) => panic!("Unexpected error {:?}", e), + Err(e) => panic!("Unexpected error {e:?}"), Ok(_) => panic!("Didn't reject wasm with invalid api"), } @@ -515,37 +720,50 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); - match check_wasm_exports(&module) { + let module = ParsedWasm::parse(&wasm).unwrap(); + match check_wasm_exports(&module, Off) { Err(VmError::StaticValidationErr { msg, .. }) => { assert!( msg.starts_with("Wasm contract doesn't have required export: \"deallocate\"") ); } - Err(e) => panic!("Unexpected error {:?}", e), + Err(e) => panic!("Unexpected error {e:?}"), Ok(_) => panic!("Didn't reject wasm with invalid api"), } } #[test] - fn check_wasm_exports_of_old_contract() { - let module = deserialize_wasm(CONTRACT_0_7).unwrap(); - match check_wasm_exports(&module) { - Err(VmError::StaticValidationErr { msg, .. }) => { - assert!( - msg.starts_with("Wasm contract doesn't have required export: \"instantiate\"") - ) - } - Err(e) => panic!("Unexpected error {:?}", e), - Ok(_) => panic!("Didn't reject wasm with invalid api"), - } + fn check_wasm_imports_ok() { + let wasm = wat::parse_str( + r#"(module + (import "env" "db_read" (func (param i32 i32) (result i32))) + (import "env" "db_write" (func (param i32 i32) (result i32))) + (import "env" "db_remove" (func (param i32) (result i32))) + (import "env" "addr_validate" (func (param i32) (result i32))) + (import "env" "addr_canonicalize" (func (param i32 i32) (result i32))) + (import "env" "addr_humanize" (func (param i32 i32) (result i32))) + (import "env" "secp256k1_verify" (func (param i32 i32 i32) (result i32))) + (import "env" "secp256k1_recover_pubkey" (func (param i32 i32 i32) (result i64))) + (import "env" "secp256r1_verify" (func (param i32 i32 i32) (result i32))) + (import "env" "secp256r1_recover_pubkey" (func (param i32 i32 i32) (result i64))) + (import "env" "ed25519_verify" (func (param i32 i32 i32) (result i32))) + (import "env" "ed25519_batch_verify" (func (param i32 i32 i32) (result i32))) + )"#, + ) + .unwrap(); + check_wasm_imports( + &ParsedWasm::parse(&wasm).unwrap(), + SUPPORTED_IMPORTS, + &WasmLimits::default(), + Off, + ) + .unwrap(); } #[test] - fn check_wasm_imports_ok() { + fn check_wasm_imports_exceeds_limit() { let wasm = wat::parse_str( r#"(module - (import "env" "db_read" (func (param i32 i32) (result i32))) (import "env" "db_write" (func (param i32 i32) (result i32))) (import "env" "db_remove" (func (param i32) (result i32))) (import "env" "addr_validate" (func (param i32) (result i32))) @@ -553,12 +771,116 @@ mod tests { (import "env" "addr_humanize" (func (param i32 i32) (result i32))) (import "env" "secp256k1_verify" (func (param i32 i32 i32) (result i32))) (import "env" "secp256k1_recover_pubkey" (func (param i32 i32 i32) (result i64))) + (import "env" "secp256r1_verify" (func (param i32 i32 i32) (result i32))) + (import "env" "secp256r1_recover_pubkey" (func (param i32 i32 i32) (result i64))) (import "env" "ed25519_verify" (func (param i32 i32 i32) (result i32))) (import "env" "ed25519_batch_verify" (func (param i32 i32 i32) (result i32))) + (import "env" "spam01" (func (param i32 i32) (result i32))) + (import "env" "spam02" (func (param i32 i32) (result i32))) + (import "env" "spam03" (func (param i32 i32) (result i32))) + (import "env" "spam04" (func (param i32 i32) (result i32))) + (import "env" "spam05" (func (param i32 i32) (result i32))) + (import "env" "spam06" (func (param i32 i32) (result i32))) + (import "env" "spam07" (func (param i32 i32) (result i32))) + (import "env" "spam08" (func (param i32 i32) (result i32))) + (import "env" "spam09" (func (param i32 i32) (result i32))) + (import "env" "spam10" (func (param i32 i32) (result i32))) + (import "env" "spam11" (func (param i32 i32) (result i32))) + (import "env" "spam12" (func (param i32 i32) (result i32))) + (import "env" "spam13" (func (param i32 i32) (result i32))) + (import "env" "spam14" (func (param i32 i32) (result i32))) + (import "env" "spam15" (func (param i32 i32) (result i32))) + (import "env" "spam16" (func (param i32 i32) (result i32))) + (import "env" "spam17" (func (param i32 i32) (result i32))) + (import "env" "spam18" (func (param i32 i32) (result i32))) + (import "env" "spam19" (func (param i32 i32) (result i32))) + (import "env" "spam20" (func (param i32 i32) (result i32))) + (import "env" "spam21" (func (param i32 i32) (result i32))) + (import "env" "spam22" (func (param i32 i32) (result i32))) + (import "env" "spam23" (func (param i32 i32) (result i32))) + (import "env" "spam24" (func (param i32 i32) (result i32))) + (import "env" "spam25" (func (param i32 i32) (result i32))) + (import "env" "spam26" (func (param i32 i32) (result i32))) + (import "env" "spam27" (func (param i32 i32) (result i32))) + (import "env" "spam28" (func (param i32 i32) (result i32))) + (import "env" "spam29" (func (param i32 i32) (result i32))) + (import "env" "spam30" (func (param i32 i32) (result i32))) + (import "env" "spam31" (func (param i32 i32) (result i32))) + (import "env" "spam32" (func (param i32 i32) (result i32))) + (import "env" "spam33" (func (param i32 i32) (result i32))) + (import "env" "spam34" (func (param i32 i32) (result i32))) + (import "env" "spam35" (func (param i32 i32) (result i32))) + (import "env" "spam36" (func (param i32 i32) (result i32))) + (import "env" "spam37" (func (param i32 i32) (result i32))) + (import "env" "spam38" (func (param i32 i32) (result i32))) + (import "env" "spam39" (func (param i32 i32) (result i32))) + (import "env" "spam40" (func (param i32 i32) (result i32))) + (import "env" "spam41" (func (param i32 i32) (result i32))) + (import "env" "spam42" (func (param i32 i32) (result i32))) + (import "env" "spam43" (func (param i32 i32) (result i32))) + (import "env" "spam44" (func (param i32 i32) (result i32))) + (import "env" "spam45" (func (param i32 i32) (result i32))) + (import "env" "spam46" (func (param i32 i32) (result i32))) + (import "env" "spam47" (func (param i32 i32) (result i32))) + (import "env" "spam48" (func (param i32 i32) (result i32))) + (import "env" "spam49" (func (param i32 i32) (result i32))) + (import "env" "spam50" (func (param i32 i32) (result i32))) + (import "env" "spam51" (func (param i32 i32) (result i32))) + (import "env" "spam52" (func (param i32 i32) (result i32))) + (import "env" "spam53" (func (param i32 i32) (result i32))) + (import "env" "spam54" (func (param i32 i32) (result i32))) + (import "env" "spam55" (func (param i32 i32) (result i32))) + (import "env" "spam56" (func (param i32 i32) (result i32))) + (import "env" "spam57" (func (param i32 i32) (result i32))) + (import "env" "spam58" (func (param i32 i32) (result i32))) + (import "env" "spam59" (func (param i32 i32) (result i32))) + (import "env" "spam60" (func (param i32 i32) (result i32))) + (import "env" "spam61" (func (param i32 i32) (result i32))) + (import "env" "spam62" (func (param i32 i32) (result i32))) + (import "env" "spam63" (func (param i32 i32) (result i32))) + (import "env" "spam64" (func (param i32 i32) (result i32))) + (import "env" "spam65" (func (param i32 i32) (result i32))) + (import "env" "spam66" (func (param i32 i32) (result i32))) + (import "env" "spam67" (func (param i32 i32) (result i32))) + (import "env" "spam68" (func (param i32 i32) (result i32))) + (import "env" "spam69" (func (param i32 i32) (result i32))) + (import "env" "spam70" (func (param i32 i32) (result i32))) + (import "env" "spam71" (func (param i32 i32) (result i32))) + (import "env" "spam72" (func (param i32 i32) (result i32))) + (import "env" "spam73" (func (param i32 i32) (result i32))) + (import "env" "spam74" (func (param i32 i32) (result i32))) + (import "env" "spam75" (func (param i32 i32) (result i32))) + (import "env" "spam76" (func (param i32 i32) (result i32))) + (import "env" "spam77" (func (param i32 i32) (result i32))) + (import "env" "spam78" (func (param i32 i32) (result i32))) + (import "env" "spam79" (func (param i32 i32) (result i32))) + (import "env" "spam80" (func (param i32 i32) (result i32))) + (import "env" "spam81" (func (param i32 i32) (result i32))) + (import "env" "spam82" (func (param i32 i32) (result i32))) + (import "env" "spam83" (func (param i32 i32) (result i32))) + (import "env" "spam84" (func (param i32 i32) (result i32))) + (import "env" "spam85" (func (param i32 i32) (result i32))) + (import "env" "spam86" (func (param i32 i32) (result i32))) + (import "env" "spam87" (func (param i32 i32) (result i32))) + (import "env" "spam88" (func (param i32 i32) (result i32))) + (import "env" "spam89" (func (param i32 i32) (result i32))) + (import "env" "spam90" (func (param i32 i32) (result i32))) )"#, ) .unwrap(); - check_wasm_imports(&deserialize_wasm(&wasm).unwrap(), SUPPORTED_IMPORTS).unwrap(); + let err = check_wasm_imports( + &ParsedWasm::parse(&wasm).unwrap(), + SUPPORTED_IMPORTS, + &WasmLimits::default(), + Off, + ) + .unwrap_err(); + match err { + VmError::StaticValidationErr { msg, .. } => { + assert_eq!(msg, "Import count exceeds limit. Imports: 101. Limit: 100."); + } + err => panic!("Unexpected error: {err:?}"), + } } #[test] @@ -589,44 +911,54 @@ mod tests { "env.debug", "env.query_chain", ]; - let result = check_wasm_imports(&deserialize_wasm(&wasm).unwrap(), supported_imports); + let result = check_wasm_imports( + &ParsedWasm::parse(&wasm).unwrap(), + supported_imports, + &WasmLimits::default(), + Off, + ); match result.unwrap_err() { VmError::StaticValidationErr { msg, .. } => { - println!("{}", msg); + println!("{msg}"); assert_eq!( msg, r#"Wasm contract requires unsupported import: "env.foo". Required imports: {"env.bar", "env.foo", "env.spammyspam01", "env.spammyspam02", "env.spammyspam03", "env.spammyspam04", "env.spammyspam05", "env.spammyspam06", "env.spammyspam07", "env.spammyspam08", ... 2 more}. Available imports: ["env.db_read", "env.db_write", "env.db_remove", "env.addr_canonicalize", "env.addr_humanize", "env.debug", "env.query_chain"]."# ); } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } #[test] fn check_wasm_imports_of_old_contract() { - let module = deserialize_wasm(CONTRACT_0_7).unwrap(); - let result = check_wasm_imports(&module, SUPPORTED_IMPORTS); + let module = &ParsedWasm::parse(CONTRACT_0_7).unwrap(); + let result = check_wasm_imports(module, SUPPORTED_IMPORTS, &WasmLimits::default(), Off); match result.unwrap_err() { VmError::StaticValidationErr { msg, .. } => { assert!( msg.starts_with("Wasm contract requires unsupported import: \"env.read_db\"") ); } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } #[test] fn check_wasm_imports_wrong_type() { let wasm = wat::parse_str(r#"(module (import "env" "db_read" (memory 1 1)))"#).unwrap(); - let result = check_wasm_imports(&deserialize_wasm(&wasm).unwrap(), SUPPORTED_IMPORTS); + let result = check_wasm_imports( + &ParsedWasm::parse(&wasm).unwrap(), + SUPPORTED_IMPORTS, + &WasmLimits::default(), + Off, + ); match result.unwrap_err() { VmError::StaticValidationErr { msg, .. } => { assert!( msg.starts_with("Wasm contract requires non-function import: \"env.db_read\"") ); } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } @@ -645,7 +977,7 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); let available = [ "water".to_string(), "nutrients".to_string(), @@ -654,7 +986,7 @@ mod tests { ] .into_iter() .collect(); - check_wasm_capabilities(&module, &available).unwrap(); + check_wasm_capabilities(&module, &available, Off).unwrap(); } #[test] @@ -672,7 +1004,7 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); // Available set 1 let available = [ @@ -682,7 +1014,7 @@ mod tests { ] .into_iter() .collect(); - match check_wasm_capabilities(&module, &available).unwrap_err() { + match check_wasm_capabilities(&module, &available, Off).unwrap_err() { VmError::StaticValidationErr { msg, .. } => assert_eq!( msg, "Wasm contract requires unavailable capabilities: {\"sun\"}" @@ -698,7 +1030,7 @@ mod tests { ] .into_iter() .collect(); - match check_wasm_capabilities(&module, &available).unwrap_err() { + match check_wasm_capabilities(&module, &available, Off).unwrap_err() { VmError::StaticValidationErr { msg, .. } => assert_eq!( msg, "Wasm contract requires unavailable capabilities: {\"sun\", \"water\"}" @@ -708,7 +1040,7 @@ mod tests { // Available set 3 let available = ["freedom".to_string()].into_iter().collect(); - match check_wasm_capabilities(&module, &available).unwrap_err() { + match check_wasm_capabilities(&module, &available, Off).unwrap_err() { VmError::StaticValidationErr { msg, .. } => assert_eq!( msg, "Wasm contract requires unavailable capabilities: {\"nutrients\", \"sun\", \"water\"}" @@ -718,7 +1050,7 @@ mod tests { // Available set 4 let available = [].into_iter().collect(); - match check_wasm_capabilities(&module, &available).unwrap_err() { + match check_wasm_capabilities(&module, &available, Off).unwrap_err() { VmError::StaticValidationErr { msg, .. } => assert_eq!( msg, "Wasm contract requires unavailable capabilities: {\"nutrients\", \"sun\", \"water\"}" @@ -726,4 +1058,63 @@ mod tests { _ => panic!("Got unexpected error"), } } + + #[test] + fn check_wasm_fails_for_big_functions() { + let limits = WasmLimits::default(); + // too many arguments + let args = " i32".repeat(limits.max_function_params() + 1); + let wasm = wat::parse_str(format!( + r#"(module + (type (func (param {args}))) + (func (type 0) nop) + )"# + )) + .unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); + + match check_wasm_functions(&module, &limits, Off).unwrap_err() { + VmError::StaticValidationErr { msg, .. } => assert_eq!( + msg, + "Wasm contract contains function with more than 100 parameters" + ), + _ => panic!("Got unexpected error"), + } + + // too many returns + let return_types = " i32".repeat(limits.max_function_results() + 1); + let returns = " i32.const 42".repeat(limits.max_function_results() + 1); + let wasm = wat::parse_str(format!( + r#"(module + (type (func (result {return_types}))) + (func (type 0) {returns}) + )"# + )) + .unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); + match check_wasm_functions(&module, &limits, Off).unwrap_err() { + VmError::StaticValidationErr { msg, .. } => assert_eq!( + msg, + "Wasm contract contains function with more than 1 results" + ), + _ => panic!("Got unexpected error"), + } + + // too many functions + let functions = "(func (type 0) nop)".repeat(limits.max_functions() + 1); + let wasm = wat::parse_str(format!( + r#"(module + (type (func)) + {functions} + )"# + )) + .unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); + match check_wasm_functions(&module, &limits, Off).unwrap_err() { + VmError::StaticValidationErr { msg, .. } => { + assert_eq!(msg, "Wasm contract contains more than 20000 functions") + } + _ => panic!("Got unexpected error"), + } + } } diff --git a/packages/vm/src/config.rs b/packages/vm/src/config.rs new file mode 100644 index 0000000000..088dab2343 --- /dev/null +++ b/packages/vm/src/config.rs @@ -0,0 +1,155 @@ +use std::{collections::HashSet, path::PathBuf}; + +use serde::{Deserialize, Serialize}; + +use crate::Size; + +const DEFAULT_MEMORY_LIMIT: u32 = 512; // in pages +/// As of March 2023, on Juno mainnet the largest value for production contracts +/// is 485. Most are between 100 and 300. +const DEFAULT_TABLE_SIZE_LIMIT: u32 = 2500; // entries + +/// We keep this number high since failing early gives less detailed error messages. Especially +/// when a user accidentally includes wasm-bindgen, they get a bunch of unsupported imports. +const DEFAULT_MAX_IMPORTS: usize = 100; + +const DEFAULT_MAX_FUNCTIONS: usize = 20_000; + +const DEFAULT_MAX_FUNCTION_PARAMS: usize = 100; + +const DEFAULT_MAX_TOTAL_FUNCTION_PARAMS: usize = 10_000; + +const DEFAULT_MAX_FUNCTION_RESULTS: usize = 1; + +/// Various configurations for the VM. +#[derive(Clone, Debug, Serialize, Deserialize)] +#[non_exhaustive] +pub struct Config { + /// Configuration for limitations placed on Wasm files. + /// This defines a few limits on the Wasm file that are checked during static validation before + /// storing the Wasm file. + pub wasm_limits: WasmLimits, + + /// Configuration for the cache. + pub cache: CacheOptions, +} + +impl Config { + pub fn new(cache: CacheOptions) -> Self { + Self { + wasm_limits: WasmLimits::default(), + cache, + } + } +} + +/// Limits for static validation of Wasm files. These are checked before storing the Wasm file. +/// All limits are optional because they are coming from the Go-side and have default values. +#[derive(Clone, Debug, Default, Serialize, Deserialize)] +#[non_exhaustive] +pub struct WasmLimits { + /// Maximum number of memory pages that a module can request. + /// + /// Every Wasm memory has an initial size and an optional maximum size, + /// both measured in Wasm pages. This limit applies to the initial size. + pub initial_memory_limit_pages: Option, + /// The upper limit for the `max` value of each table. CosmWasm contracts have + /// initial=max for 1 table. See + /// + /// ```plain + /// $ wasm-objdump --section=table -x packages/vm/testdata/hackatom.wasm + /// Section Details: + /// + /// Table[1]: + /// - table[0] type=funcref initial=161 max=161 + /// ``` + /// + pub table_size_limit_elements: Option, + /// If the contract has more than this amount of imports, it will be rejected + /// during static validation before even looking into the imports. + pub max_imports: Option, + + /// The maximum number of functions a contract can have. + /// Any contract with more functions than this will be rejected during static validation. + pub max_functions: Option, + + /// The maximum number of parameters a Wasm function can have. + pub max_function_params: Option, + /// The maximum total number of parameters of all functions in the Wasm. + /// For each function in the Wasm, take the number of parameters and sum all of these up. + /// If that sum exceeds this limit, the Wasm will be rejected during static validation. + /// + /// Be careful when adjusting this limit, as it prevents an attack where a small Wasm file + /// explodes in size when compiled. + pub max_total_function_params: Option, + + /// The maximum number of results a Wasm function type can have. + pub max_function_results: Option, +} + +impl WasmLimits { + pub fn initial_memory_limit_pages(&self) -> u32 { + self.initial_memory_limit_pages + .unwrap_or(DEFAULT_MEMORY_LIMIT) + } + + pub fn table_size_limit_elements(&self) -> u32 { + self.table_size_limit_elements + .unwrap_or(DEFAULT_TABLE_SIZE_LIMIT) + } + + pub fn max_imports(&self) -> usize { + self.max_imports.unwrap_or(DEFAULT_MAX_IMPORTS) + } + + pub fn max_functions(&self) -> usize { + self.max_functions.unwrap_or(DEFAULT_MAX_FUNCTIONS) + } + + pub fn max_function_params(&self) -> usize { + self.max_function_params + .unwrap_or(DEFAULT_MAX_FUNCTION_PARAMS) + } + + pub fn max_total_function_params(&self) -> usize { + self.max_total_function_params + .unwrap_or(DEFAULT_MAX_TOTAL_FUNCTION_PARAMS) + } + + pub fn max_function_results(&self) -> usize { + self.max_function_results + .unwrap_or(DEFAULT_MAX_FUNCTION_RESULTS) + } +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +#[non_exhaustive] +pub struct CacheOptions { + /// The base directory of this cache. + /// + /// If this does not exist, it will be created. Not sure if this behaviour + /// is desired but wasmd relies on it. + pub base_dir: PathBuf, + pub available_capabilities: HashSet, + /// Memory limit for the cache, in bytes. + pub memory_cache_size_bytes: Size, + /// Memory limit for instances, in bytes. Use a value that is divisible by the Wasm page size 65536, + /// e.g. full MiBs. + pub instance_memory_limit_bytes: Size, +} + +impl CacheOptions { + pub fn new( + base_dir: impl Into, + available_capabilities: impl Into>, + memory_cache_size_bytes: Size, + instance_memory_limit_bytes: Size, + ) -> Self { + Self { + base_dir: base_dir.into(), + available_capabilities: available_capabilities.into(), + memory_cache_size_bytes, + instance_memory_limit_bytes, + } + } +} diff --git a/packages/vm/src/conversion.rs b/packages/vm/src/conversion.rs index 8723cd0ebe..83ef6f867a 100644 --- a/packages/vm/src/conversion.rs +++ b/packages/vm/src/conversion.rs @@ -32,7 +32,6 @@ pub fn to_i32 + ToString + Copy>(input: T) -> VmResult { #[cfg(test)] mod tests { use super::*; - use crate::errors::VmError; #[test] fn to_u32_works_for_usize() { @@ -41,7 +40,8 @@ mod tests { assert_eq!(to_u32(2147483647usize).unwrap(), 2147483647); assert_eq!(to_u32(2147483648usize).unwrap(), 2147483648); assert_eq!(to_u32(4294967295usize).unwrap(), 4294967295); - + // Gate required for Rust 1.77.0 in Linux, possibly a Rust/clippy regression bug + #[cfg(target_pointer_width = "64")] match to_u32(4294967296usize) { Err(VmError::ConversionErr { from_type, @@ -53,7 +53,7 @@ mod tests { assert_eq!(to_type, "u32"); assert_eq!(input, "4294967296"); } - Err(err) => panic!("unexpected error: {:?}", err), + Err(err) => panic!("unexpected error: {err:?}"), Ok(_) => panic!("must not succeed"), }; } @@ -77,7 +77,7 @@ mod tests { assert_eq!(to_type, "u32"); assert_eq!(input, "4294967296"); } - Err(err) => panic!("unexpected error: {:?}", err), + Err(err) => panic!("unexpected error: {err:?}"), Ok(_) => panic!("must not succeed"), }; } @@ -99,7 +99,7 @@ mod tests { assert_eq!(to_type, "u32"); assert_eq!(input, "-1"); } - Err(err) => panic!("unexpected error: {:?}", err), + Err(err) => panic!("unexpected error: {err:?}"), Ok(_) => panic!("must not succeed"), }; } @@ -121,7 +121,7 @@ mod tests { assert_eq!(to_type, "u32"); assert_eq!(input, "-1"); } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), }; // usize @@ -130,6 +130,8 @@ mod tests { assert_eq!(ref_to_u32(&2147483647usize).unwrap(), 2147483647); assert_eq!(ref_to_u32(&2147483648usize).unwrap(), 2147483648); assert_eq!(ref_to_u32(&4294967295usize).unwrap(), 4294967295); + // Gate required for Rust 1.77.0 in Linux, possibly a Rust/clippy regression bug + #[cfg(target_pointer_width = "64")] match ref_to_u32(&4294967296usize).unwrap_err() { VmError::ConversionErr { from_type, @@ -141,7 +143,7 @@ mod tests { assert_eq!(to_type, "u32"); assert_eq!(input, "4294967296"); } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), }; } @@ -162,7 +164,7 @@ mod tests { assert_eq!(to_type, "i32"); assert_eq!(input, "2147483648"); } - Err(err) => panic!("unexpected error: {:?}", err), + Err(err) => panic!("unexpected error: {err:?}"), Ok(_) => panic!("must not succeed"), }; } @@ -188,7 +190,7 @@ mod tests { assert_eq!(to_type, "i32"); assert_eq!(input, "-2147483649"); } - Err(err) => panic!("unexpected error: {:?}", err), + Err(err) => panic!("unexpected error: {err:?}"), Ok(_) => panic!("must not succeed"), }; } diff --git a/packages/vm/src/environment.rs b/packages/vm/src/environment.rs index d66aa88c8b..ca088d3c02 100644 --- a/packages/vm/src/environment.rs +++ b/packages/vm/src/environment.rs @@ -1,14 +1,25 @@ //! Internal details to be used by instance.rs only -use std::borrow::{Borrow, BorrowMut}; +use std::borrow::BorrowMut; +use std::cell::RefCell; +use std::marker::PhantomData; use std::ptr::NonNull; +use std::rc::Rc; use std::sync::{Arc, RwLock}; -use wasmer::{HostEnvInitError, Instance as WasmerInstance, Memory, Val, WasmerEnv}; +use derive_more::Debug; +use wasmer::{AsStoreMut, Instance as WasmerInstance, Memory, MemoryView, Value}; use wasmer_middlewares::metering::{get_remaining_points, set_remaining_points, MeteringPoints}; use crate::backend::{BackendApi, GasInfo, Querier, Storage}; use crate::errors::{VmError, VmResult}; +/// Keep this as low as necessary to avoid deepy nested errors like this: +/// +/// ```plain +/// RuntimeErr { msg: "Wasmer runtime error: RuntimeError: Error executing Wasm: Wasmer runtime error: RuntimeError: Error executing Wasm: Wasmer runtime error: RuntimeError: Error executing Wasm: Wasmer runtime error: RuntimeError: Error executing Wasm: Wasmer runtime error: RuntimeError: Maximum call depth exceeded." } +/// ``` +const MAX_CALL_DEPTH: usize = 2; + /// Never can never be instantiated. /// Replace this with the [never primitive type](https://doc.rust-lang.org/std/primitive.never.html) when stable. #[derive(Debug)] @@ -17,39 +28,141 @@ pub enum Never {} /** gas config data */ #[derive(Clone, PartialEq, Eq, Debug)] +#[non_exhaustive] pub struct GasConfig { /// Gas costs of VM (not Backend) provided functionality /// secp256k1 signature verification cost pub secp256k1_verify_cost: u64, /// secp256k1 public key recovery cost pub secp256k1_recover_pubkey_cost: u64, + /// secp256r1 signature verification cost + pub secp256r1_verify_cost: u64, + /// secp256r1 public key recovery cost + pub secp256r1_recover_pubkey_cost: u64, /// ed25519 signature verification cost pub ed25519_verify_cost: u64, /// ed25519 batch signature verification cost - pub ed25519_batch_verify_cost: u64, + pub ed25519_batch_verify_cost: LinearGasCost, /// ed25519 batch signature verification cost (single public key) - pub ed25519_batch_verify_one_pubkey_cost: u64, + pub ed25519_batch_verify_one_pubkey_cost: LinearGasCost, + /// bls12-381 aggregate cost (g1) + pub bls12_381_aggregate_g1_cost: LinearGasCost, + /// bls12-381 aggregate cost (g2) + pub bls12_381_aggregate_g2_cost: LinearGasCost, + /// bls12-381 hash to g1 cost + pub bls12_381_hash_to_g1_cost: u64, + /// bls12-381 hash to g2 cost + pub bls12_381_hash_to_g2_cost: u64, + /// bls12-381 pairing equality check cost + pub bls12_381_pairing_equality_cost: LinearGasCost, + /// cost for writing memory regions + pub write_region_cost: LinearGasCost, + /// cost for reading memory regions <= 8MB + pub read_region_small_cost: LinearGasCost, + /// cost for reading memory regions > 8MB + pub read_region_large_cost: LinearGasCost, + /// cost for validating bytes into a String + pub string_from_bytes_cost: LinearGasCost, + /// cost for calling a host function + pub host_call_cost: u64, } impl Default for GasConfig { fn default() -> Self { - // Target is 10^12 per millisecond (see GAS.md), i.e. 10^9 gas per µ second. - const GAS_PER_US: u64 = 1_000_000_000; + // Target is 10^12 per second (see GAS.md), i.e. 10^6 gas per µ second. + const GAS_PER_US: u64 = 1_000_000; Self { - // ~154 us in crypto benchmarks - secp256k1_verify_cost: 154 * GAS_PER_US, - // ~162 us in crypto benchmarks - secp256k1_recover_pubkey_cost: 162 * GAS_PER_US, - // ~63 us in crypto benchmarks - ed25519_verify_cost: 63 * GAS_PER_US, - // Gas cost factors, relative to ed25519_verify cost - // From https://docs.rs/ed25519-zebra/2.2.0/ed25519_zebra/batch/index.html - ed25519_batch_verify_cost: 63 * GAS_PER_US / 2, - ed25519_batch_verify_one_pubkey_cost: 63 * GAS_PER_US / 4, + // ~96 us in crypto benchmarks + secp256k1_verify_cost: 96 * GAS_PER_US, + // ~194 us in crypto benchmarks + secp256k1_recover_pubkey_cost: 194 * GAS_PER_US, + // ~279 us in crypto benchmarks + secp256r1_verify_cost: 279 * GAS_PER_US, + // ~592 us in crypto benchmarks + secp256r1_recover_pubkey_cost: 592 * GAS_PER_US, + // ~35 us in crypto benchmarks + ed25519_verify_cost: 35 * GAS_PER_US, + // Calculated based on the benchmark results for `ed25519_batch_verify_{x}`. + ed25519_batch_verify_cost: LinearGasCost { + base: 24 * GAS_PER_US, + per_item: 21 * GAS_PER_US, + }, + // Calculated based on the benchmark results for `ed25519_batch_verify_one_pubkey_{x}`. + ed25519_batch_verify_one_pubkey_cost: LinearGasCost { + base: 36 * GAS_PER_US, + per_item: 10 * GAS_PER_US, + }, + // just assume the production machines have more than 4 cores, so we can half that + bls12_381_aggregate_g1_cost: LinearGasCost { + base: 136 * GAS_PER_US / 2, + per_item: 24 * GAS_PER_US / 2, + }, + bls12_381_aggregate_g2_cost: LinearGasCost { + base: 207 * GAS_PER_US / 2, + per_item: 49 * GAS_PER_US / 2, + }, + bls12_381_hash_to_g1_cost: 563 * GAS_PER_US, + bls12_381_hash_to_g2_cost: 871 * GAS_PER_US, + bls12_381_pairing_equality_cost: LinearGasCost { + base: 2112 * GAS_PER_US, + per_item: 163 * GAS_PER_US, + }, + write_region_cost: LinearGasCost { + base: 230000, + per_item: 570, + }, + read_region_small_cost: LinearGasCost { + base: 200000, + per_item: 115, + }, + read_region_large_cost: LinearGasCost { + base: 0, + per_item: 520, + }, + string_from_bytes_cost: LinearGasCost { + base: 28700, + per_item: 1400, + }, + host_call_cost: 18000, } } } +impl GasConfig { + pub fn read_region_cost(&self, bytes: usize) -> VmResult { + const THRESHOLD: usize = 8 * 1000 * 1000; + if bytes <= THRESHOLD { + self.read_region_small_cost.total_cost(bytes as u64) + } else { + self.read_region_large_cost.total_cost(bytes as u64) + } + } +} + +/// Linear gas cost model where the cost is linear in the number of items. +/// +/// To calculate it, you sample the cost for a few different amounts of items and fit a line to it. +/// Let `b` be that line of best fit. Then `base = b(0)` is the y-intercept and +/// `per_item = b(1) - b(0)` the slope. +#[derive(Clone, PartialEq, Eq, Debug)] +pub struct LinearGasCost { + /// This is a flat part of the cost, charged once per batch. + base: u64, + /// This is the cost per item in the batch. + per_item: u64, +} + +impl LinearGasCost { + pub fn total_cost(&self, items: u64) -> VmResult { + self.total_cost_opt(items) + .ok_or_else(VmError::gas_depletion) + } + + fn total_cost_opt(&self, items: u64) -> Option { + self.base.checked_add(self.per_item.checked_mul(items)?) + } +} + /** context data **/ #[derive(Clone, PartialEq, Eq, Debug, Default)] @@ -72,11 +185,34 @@ impl GasState { } } +/// Additional environmental information in a debug call. +/// +/// The currently unused lifetime parameter 'a allows accessing referenced data in the debug implementation +/// without cloning it. +#[derive(Debug)] +#[non_exhaustive] +pub struct DebugInfo<'a> { + pub gas_remaining: u64, + // This field is just to allow us to add the unused lifetime parameter. It can be removed + // at any time. + #[doc(hidden)] + #[debug(skip)] + pub(crate) __lifetime: PhantomData<&'a ()>, +} + +// Unfortunately we cannot create an alias for the trait (https://github.com/rust-lang/rust/issues/41517). +// So we need to copy it in a few places. +// +// /- BEGIN TRAIT END TRAIT \ +// | | +// v v +pub type DebugHandlerFn = dyn for<'a, 'b> FnMut(/* msg */ &'a str, DebugInfo<'b>); + /// A environment that provides access to the ContextData. -/// The environment is clonable but clones access the same underlying data. -pub struct Environment { +/// The environment is cloneable but clones access the same underlying data. +pub struct Environment { + pub memory: Option, pub api: A, - pub print_debug: bool, pub gas_config: GasConfig, data: Arc>>, } @@ -88,30 +224,37 @@ unsafe impl Sync for Environment impl Clone for Environment { fn clone(&self) -> Self { Environment { - api: self.api, - print_debug: self.print_debug, + memory: None, + api: self.api.clone(), gas_config: self.gas_config.clone(), data: self.data.clone(), } } } -impl WasmerEnv for Environment { - fn init_with_instance(&mut self, _instance: &WasmerInstance) -> Result<(), HostEnvInitError> { - Ok(()) - } -} - impl Environment { - pub fn new(api: A, gas_limit: u64, print_debug: bool) -> Self { + pub fn new(api: A, gas_limit: u64) -> Self { Environment { + memory: None, api, - print_debug, gas_config: GasConfig::default(), data: Arc::new(RwLock::new(ContextData::new(gas_limit))), } } + pub fn set_debug_handler(&self, debug_handler: Option>>) { + self.with_context_data_mut(|context_data| { + context_data.debug_handler = debug_handler; + }) + } + + pub fn debug_handler(&self) -> Option>> { + self.with_context_data(|context_data| { + // This clone here requires us to wrap the function in Rc instead of Box + context_data.debug_handler.clone() + }) + } + fn with_context_data_mut(&self, callback: C) -> R where C: FnOnce(&mut ContextData) -> R, @@ -126,8 +269,7 @@ impl Environment { C: FnOnce(&ContextData) -> R, { let guard = self.data.as_ref().read().unwrap(); - let context_data = guard.borrow(); - callback(context_data) + callback(&guard) } pub fn with_gas_state(&self, callback: C) -> R @@ -161,26 +303,43 @@ impl Environment { /// The number of return values is variable and controlled by the guest. /// Usually we expect 0 or 1 return values. Use [`Self::call_function0`] /// or [`Self::call_function1`] to ensure the number of return values is checked. - fn call_function(&self, name: &str, args: &[Val]) -> VmResult> { + fn call_function( + &self, + store: &mut impl AsStoreMut, + name: &str, + args: &[Value], + ) -> VmResult> { // Clone function before calling it to avoid dead locks let func = self.with_wasmer_instance(|instance| { let func = instance.exports.get_function(name)?; Ok(func.clone()) })?; - func.call(args).map_err(|runtime_err| -> VmError { + let function_arity = func.param_arity(store); + if args.len() != function_arity { + return Err(VmError::function_arity_mismatch(function_arity)); + }; + self.increment_call_depth()?; + let res = func.call(store, args).map_err(|runtime_err| -> VmError { self.with_wasmer_instance::<_, Never>(|instance| { - let err: VmError = match get_remaining_points(instance) { + let err: VmError = match get_remaining_points(store, instance) { MeteringPoints::Remaining(_) => VmError::from(runtime_err), MeteringPoints::Exhausted => VmError::gas_depletion(), }; Err(err) }) .unwrap_err() // with_wasmer_instance can only succeed if the callback succeeds - }) + }); + self.decrement_call_depth(); + res } - pub fn call_function0(&self, name: &str, args: &[Val]) -> VmResult<()> { - let result = self.call_function(name, args)?; + pub fn call_function0( + &self, + store: &mut impl AsStoreMut, + name: &str, + args: &[Value], + ) -> VmResult<()> { + let result = self.call_function(store, name, args)?; let expected = 0; let actual = result.len(); if actual != expected { @@ -189,8 +348,13 @@ impl Environment { Ok(()) } - pub fn call_function1(&self, name: &str, args: &[Val]) -> VmResult { - let result = self.call_function(name, args)?; + pub fn call_function1( + &self, + store: &mut impl AsStoreMut, + name: &str, + args: &[Value], + ) -> VmResult { + let result = self.call_function(store, name, args)?; let expected = 1; let actual = result.len(); if actual != expected { @@ -237,9 +401,37 @@ impl Environment { }) } - pub fn get_gas_left(&self) -> u64 { + /// Increments the call depth by 1 and returns the new value + pub fn increment_call_depth(&self) -> VmResult { + let new = self.with_context_data_mut(|context_data| { + let new = context_data.call_depth + 1; + context_data.call_depth = new; + new + }); + if new > MAX_CALL_DEPTH { + return Err(VmError::max_call_depth_exceeded()); + } + Ok(new) + } + + /// Decrements the call depth by 1 and returns the new value + pub fn decrement_call_depth(&self) -> usize { + self.with_context_data_mut(|context_data| { + let new = context_data + .call_depth + .checked_sub(1) + .expect("Call depth < 0. This is a bug."); + context_data.call_depth = new; + new + }) + } + + /// Returns the remaining gas measured in [CosmWasm gas]. + /// + /// [CosmWasm gas]: https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md + pub fn get_gas_left(&self, store: &mut impl AsStoreMut) -> u64 { self.with_wasmer_instance(|instance| { - Ok(match get_remaining_points(instance) { + Ok(match get_remaining_points(store, instance) { MeteringPoints::Remaining(count) => count, MeteringPoints::Exhausted => 0, }) @@ -247,9 +439,12 @@ impl Environment { .expect("Wasmer instance is not set. This is a bug in the lifecycle.") } - pub fn set_gas_left(&self, new_value: u64) { + /// Sets the remaining gas measured in [CosmWasm gas]. + /// + /// [CosmWasm gas]: https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md + pub fn set_gas_left(&self, store: &mut impl AsStoreMut, new_value: u64) { self.with_wasmer_instance(|instance| { - set_remaining_points(instance, new_value); + set_remaining_points(store, instance, new_value); Ok(()) }) .expect("Wasmer instance is not set. This is a bug in the lifecycle.") @@ -259,39 +454,29 @@ impl Environment { /// If the amount exceeds the available gas, the remaining gas is set to 0 and /// an VmError::GasDepletion error is returned. #[allow(unused)] // used in tests - pub fn decrease_gas_left(&self, amount: u64) -> VmResult<()> { + pub fn decrease_gas_left(&self, store: &mut impl AsStoreMut, amount: u64) -> VmResult<()> { self.with_wasmer_instance(|instance| { - let remaining = match get_remaining_points(instance) { + let remaining = match get_remaining_points(store, instance) { MeteringPoints::Remaining(count) => count, MeteringPoints::Exhausted => 0, }; if amount > remaining { - set_remaining_points(instance, 0); + set_remaining_points(store, instance, 0); Err(VmError::gas_depletion()) } else { - set_remaining_points(instance, remaining - amount); + set_remaining_points(store, instance, remaining - amount); Ok(()) } }) } - pub fn memory(&self) -> Memory { - self.with_wasmer_instance(|instance| { - let first: Option = instance - .exports - .iter() - .memories() - .next() - .map(|pair| pair.1.clone()); - // Every contract in CosmWasm must have exactly one exported memory. - // This is ensured by `check_wasm`/`check_wasm_memories`, which is called for every - // contract added to the Cache as well as in integration tests. - // It is possible to bypass this check when using `Instance::from_code` but then you - // learn the hard way when this panics, or when trying to upload the contract to chain. - let memory = first.expect("A contract must have exactly one exported memory."); - Ok(memory) - }) - .expect("Wasmer instance is not set. This is a bug in the lifecycle.") + /// Creates a MemoryView. + /// This must be short living and not be used after the memory was grown. + pub fn memory<'a>(&self, store: &'a impl AsStoreMut) -> MemoryView<'a> { + self.memory + .as_ref() + .expect("Memory is not set. This is a bug in the lifecycle.") + .view(store) } /// Moves owned instances of storage and querier into the env. @@ -312,11 +497,13 @@ impl Environment { } } -pub struct ContextData { +pub struct ContextData { gas_state: GasState, storage: Option, storage_readonly: bool, + call_depth: usize, querier: Option, + debug_handler: Option>>, /// A non-owning link to the wasmer instance wasmer_instance: Option>, } @@ -327,7 +514,9 @@ impl ContextData { gas_state: GasState::with_limit(gas_limit), storage: None, storage_readonly: true, + call_depth: 0, querier: None, + debug_handler: None, wasmer_instance: None, } } @@ -335,9 +524,10 @@ impl ContextData { pub fn process_gas_info( env: &Environment, + store: &mut impl AsStoreMut, info: GasInfo, ) -> VmResult<()> { - let gas_left = env.get_gas_left(); + let gas_left = env.get_gas_left(store); let new_limit = env.with_gas_state_mut(|gas_state| { gas_state.externally_used_gas += info.externally_used; @@ -349,7 +539,7 @@ pub fn process_gas_info( }); // This tells wasmer how much more gas it can consume from this point in time. - env.set_gas_left(new_limit); + env.set_gas_left(store, new_limit); if info.externally_used + info.cost > gas_left { Err(VmError::gas_depletion()) @@ -361,18 +551,16 @@ pub fn process_gas_info( #[cfg(test)] mod tests { use super::*; - use crate::backend::Storage; use crate::conversion::ref_to_u32; - use crate::errors::VmError; use crate::size::Size; use crate::testing::{MockApi, MockQuerier, MockStorage}; - use crate::wasm_backend::compile; + use crate::wasm_backend::{compile, make_compiling_engine}; use cosmwasm_std::{ - coins, from_binary, to_vec, AllBalanceResponse, BankQuery, Empty, QueryRequest, + coin, coins, from_json, to_json_vec, BalanceResponse, BankQuery, Empty, QueryRequest, }; - use wasmer::{imports, Function, Instance as WasmerInstance}; + use wasmer::{imports, Function, Instance as WasmerInstance, Store}; - static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); // prepared data const INIT_KEY: &[u8] = b"foo"; @@ -382,7 +570,7 @@ mod tests { const INIT_AMOUNT: u128 = 500; const INIT_DENOM: &str = "TOKEN"; - const TESTING_GAS_LIMIT: u64 = 500_000_000_000; // ~0.5ms + const TESTING_GAS_LIMIT: u64 = 500_000_000; // ~0.5ms const DEFAULT_QUERY_GAS_LIMIT: u64 = 300_000; const TESTING_MEMORY_LIMIT: Option = Some(Size::mebi(16)); @@ -390,38 +578,51 @@ mod tests { gas_limit: u64, ) -> ( Environment, + Store, Box, ) { - let env = Environment::new(MockApi::default(), gas_limit, false); + let env = Environment::new(MockApi::default(), gas_limit); + + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = compile(&engine, HACKATOM).unwrap(); + let mut store = Store::new(engine); - let module = compile(CONTRACT, TESTING_MEMORY_LIMIT, &[]).unwrap(); - let store = module.store(); // we need stubs for all required imports let import_obj = imports! { "env" => { - "db_read" => Function::new_native(store, |_a: u32| -> u32 { 0 }), - "db_write" => Function::new_native(store, |_a: u32, _b: u32| {}), - "db_remove" => Function::new_native(store, |_a: u32| {}), - "db_scan" => Function::new_native(store, |_a: u32, _b: u32, _c: i32| -> u32 { 0 }), - "db_next" => Function::new_native(store, |_a: u32| -> u32 { 0 }), - "query_chain" => Function::new_native(store, |_a: u32| -> u32 { 0 }), - "addr_validate" => Function::new_native(store, |_a: u32| -> u32 { 0 }), - "addr_canonicalize" => Function::new_native(store, |_a: u32, _b: u32| -> u32 { 0 }), - "addr_humanize" => Function::new_native(store, |_a: u32, _b: u32| -> u32 { 0 }), - "secp256k1_verify" => Function::new_native(store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), - "secp256k1_recover_pubkey" => Function::new_native(store, |_a: u32, _b: u32, _c: u32| -> u64 { 0 }), - "ed25519_verify" => Function::new_native(store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), - "ed25519_batch_verify" => Function::new_native(store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), - "debug" => Function::new_native(store, |_a: u32| {}), + "db_read" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "db_write" => Function::new_typed(&mut store, |_a: u32, _b: u32| {}), + "db_remove" => Function::new_typed(&mut store, |_a: u32| {}), + "db_scan" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: i32| -> u32 { 0 }), + "db_next" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "db_next_key" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "db_next_value" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "query_chain" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "addr_validate" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "addr_canonicalize" => Function::new_typed(&mut store, |_a: u32, _b: u32| -> u32 { 0 }), + "addr_humanize" => Function::new_typed(&mut store, |_a: u32, _b: u32| -> u32 { 0 }), + "bls12_381_aggregate_g1" => Function::new_typed(&mut store, |_a: u32, _b: u32| -> u32 { 0 }), + "bls12_381_aggregate_g2" => Function::new_typed(&mut store, |_a: u32, _b: u32| -> u32 { 0 }), + "bls12_381_pairing_equality" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32, _d: u32| -> u32 { 0 }), + "bls12_381_hash_to_g1" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32, _d: u32| -> u32 { 0 }), + "bls12_381_hash_to_g2" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32, _d: u32| -> u32 { 0 }), + "secp256k1_verify" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), + "secp256k1_recover_pubkey" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u64 { 0 }), + "secp256r1_verify" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), + "secp256r1_recover_pubkey" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u64 { 0 }), + "ed25519_verify" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), + "ed25519_batch_verify" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), + "debug" => Function::new_typed(&mut store, |_a: u32| {}), + "abort" => Function::new_typed(&mut store, |_a: u32| {}), }, }; - let instance = Box::from(WasmerInstance::new(&module, &import_obj).unwrap()); + let instance = Box::from(WasmerInstance::new(&mut store, &module, &import_obj).unwrap()); let instance_ptr = NonNull::from(instance.as_ref()); env.set_wasmer_instance(Some(instance_ptr)); - env.set_gas_left(gas_limit); + env.set_gas_left(&mut store, gas_limit); - (env, instance) + (env, store, instance) } fn leave_default_data(env: &Environment) { @@ -438,7 +639,7 @@ mod tests { #[test] fn move_out_works() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, _store, _instance) = make_instance(TESTING_GAS_LIMIT); // empty data on start let (inits, initq) = env.move_out(); @@ -463,90 +664,90 @@ mod tests { #[test] fn process_gas_info_works_for_cost() { - let (env, _instance) = make_instance(100); - assert_eq!(env.get_gas_left(), 100); + let (env, mut store, _instance) = make_instance(100); + assert_eq!(env.get_gas_left(&mut store), 100); // Consume all the Gas that we allocated - process_gas_info(&env, GasInfo::with_cost(70)).unwrap(); - assert_eq!(env.get_gas_left(), 30); - process_gas_info(&env, GasInfo::with_cost(4)).unwrap(); - assert_eq!(env.get_gas_left(), 26); - process_gas_info(&env, GasInfo::with_cost(6)).unwrap(); - assert_eq!(env.get_gas_left(), 20); - process_gas_info(&env, GasInfo::with_cost(20)).unwrap(); - assert_eq!(env.get_gas_left(), 0); + process_gas_info(&env, &mut store, GasInfo::with_cost(70)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 30); + process_gas_info(&env, &mut store, GasInfo::with_cost(4)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 26); + process_gas_info(&env, &mut store, GasInfo::with_cost(6)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 20); + process_gas_info(&env, &mut store, GasInfo::with_cost(20)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 0); // Using one more unit of gas triggers a failure - match process_gas_info(&env, GasInfo::with_cost(1)).unwrap_err() { + match process_gas_info(&env, &mut store, GasInfo::with_cost(1)).unwrap_err() { VmError::GasDepletion { .. } => {} - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } } #[test] fn process_gas_info_works_for_externally_used() { - let (env, _instance) = make_instance(100); - assert_eq!(env.get_gas_left(), 100); + let (env, mut store, _instance) = make_instance(100); + assert_eq!(env.get_gas_left(&mut store), 100); // Consume all the Gas that we allocated - process_gas_info(&env, GasInfo::with_externally_used(70)).unwrap(); - assert_eq!(env.get_gas_left(), 30); - process_gas_info(&env, GasInfo::with_externally_used(4)).unwrap(); - assert_eq!(env.get_gas_left(), 26); - process_gas_info(&env, GasInfo::with_externally_used(6)).unwrap(); - assert_eq!(env.get_gas_left(), 20); - process_gas_info(&env, GasInfo::with_externally_used(20)).unwrap(); - assert_eq!(env.get_gas_left(), 0); + process_gas_info(&env, &mut store, GasInfo::with_externally_used(70)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 30); + process_gas_info(&env, &mut store, GasInfo::with_externally_used(4)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 26); + process_gas_info(&env, &mut store, GasInfo::with_externally_used(6)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 20); + process_gas_info(&env, &mut store, GasInfo::with_externally_used(20)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 0); // Using one more unit of gas triggers a failure - match process_gas_info(&env, GasInfo::with_externally_used(1)).unwrap_err() { + match process_gas_info(&env, &mut store, GasInfo::with_externally_used(1)).unwrap_err() { VmError::GasDepletion { .. } => {} - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } } #[test] fn process_gas_info_works_for_cost_and_externally_used() { - let (env, _instance) = make_instance(100); - assert_eq!(env.get_gas_left(), 100); + let (env, mut store, _instance) = make_instance(100); + assert_eq!(env.get_gas_left(&mut store), 100); let gas_state = env.with_gas_state(|gas_state| gas_state.clone()); assert_eq!(gas_state.gas_limit, 100); assert_eq!(gas_state.externally_used_gas, 0); - process_gas_info(&env, GasInfo::new(17, 4)).unwrap(); - assert_eq!(env.get_gas_left(), 79); + process_gas_info(&env, &mut store, GasInfo::new(17, 4)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 79); let gas_state = env.with_gas_state(|gas_state| gas_state.clone()); assert_eq!(gas_state.gas_limit, 100); assert_eq!(gas_state.externally_used_gas, 4); - process_gas_info(&env, GasInfo::new(9, 0)).unwrap(); - assert_eq!(env.get_gas_left(), 70); + process_gas_info(&env, &mut store, GasInfo::new(9, 0)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 70); let gas_state = env.with_gas_state(|gas_state| gas_state.clone()); assert_eq!(gas_state.gas_limit, 100); assert_eq!(gas_state.externally_used_gas, 4); - process_gas_info(&env, GasInfo::new(0, 70)).unwrap(); - assert_eq!(env.get_gas_left(), 0); + process_gas_info(&env, &mut store, GasInfo::new(0, 70)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 0); let gas_state = env.with_gas_state(|gas_state| gas_state.clone()); assert_eq!(gas_state.gas_limit, 100); assert_eq!(gas_state.externally_used_gas, 74); // More cost fail but do not change stats - match process_gas_info(&env, GasInfo::new(1, 0)).unwrap_err() { + match process_gas_info(&env, &mut store, GasInfo::new(1, 0)).unwrap_err() { VmError::GasDepletion { .. } => {} - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } - assert_eq!(env.get_gas_left(), 0); + assert_eq!(env.get_gas_left(&mut store), 0); let gas_state = env.with_gas_state(|gas_state| gas_state.clone()); assert_eq!(gas_state.gas_limit, 100); assert_eq!(gas_state.externally_used_gas, 74); // More externally used fails and changes stats - match process_gas_info(&env, GasInfo::new(0, 1)).unwrap_err() { + match process_gas_info(&env, &mut store, GasInfo::new(0, 1)).unwrap_err() { VmError::GasDepletion { .. } => {} - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } - assert_eq!(env.get_gas_left(), 0); + assert_eq!(env.get_gas_left(&mut store), 0); let gas_state = env.with_gas_state(|gas_state| gas_state.clone()); assert_eq!(gas_state.gas_limit, 100); assert_eq!(gas_state.externally_used_gas, 75); @@ -556,13 +757,13 @@ mod tests { fn process_gas_info_zeros_gas_left_when_exceeded() { // with_externally_used { - let (env, _instance) = make_instance(100); - let result = process_gas_info(&env, GasInfo::with_externally_used(120)); + let (env, mut store, _instance) = make_instance(100); + let result = process_gas_info(&env, &mut store, GasInfo::with_externally_used(120)); match result.unwrap_err() { VmError::GasDepletion { .. } => {} - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } - assert_eq!(env.get_gas_left(), 0); + assert_eq!(env.get_gas_left(&mut store), 0); let gas_state = env.with_gas_state(|gas_state| gas_state.clone()); assert_eq!(gas_state.gas_limit, 100); assert_eq!(gas_state.externally_used_gas, 120); @@ -570,13 +771,13 @@ mod tests { // with_cost { - let (env, _instance) = make_instance(100); - let result = process_gas_info(&env, GasInfo::with_cost(120)); + let (env, mut store, _instance) = make_instance(100); + let result = process_gas_info(&env, &mut store, GasInfo::with_cost(120)); match result.unwrap_err() { VmError::GasDepletion { .. } => {} - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } - assert_eq!(env.get_gas_left(), 0); + assert_eq!(env.get_gas_left(&mut store), 0); let gas_state = env.with_gas_state(|gas_state| gas_state.clone()); assert_eq!(gas_state.gas_limit, 100); assert_eq!(gas_state.externally_used_gas, 0); @@ -585,34 +786,34 @@ mod tests { #[test] fn process_gas_info_works_correctly_with_gas_consumption_in_wasmer() { - let (env, _instance) = make_instance(100); - assert_eq!(env.get_gas_left(), 100); + let (env, mut store, _instance) = make_instance(100); + assert_eq!(env.get_gas_left(&mut store), 100); // Some gas was consumed externally - process_gas_info(&env, GasInfo::with_externally_used(50)).unwrap(); - assert_eq!(env.get_gas_left(), 50); - process_gas_info(&env, GasInfo::with_externally_used(4)).unwrap(); - assert_eq!(env.get_gas_left(), 46); + process_gas_info(&env, &mut store, GasInfo::with_externally_used(50)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 50); + process_gas_info(&env, &mut store, GasInfo::with_externally_used(4)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 46); // Consume 20 gas directly in wasmer - env.decrease_gas_left(20).unwrap(); - assert_eq!(env.get_gas_left(), 26); + env.decrease_gas_left(&mut store, 20).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 26); - process_gas_info(&env, GasInfo::with_externally_used(6)).unwrap(); - assert_eq!(env.get_gas_left(), 20); - process_gas_info(&env, GasInfo::with_externally_used(20)).unwrap(); - assert_eq!(env.get_gas_left(), 0); + process_gas_info(&env, &mut store, GasInfo::with_externally_used(6)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 20); + process_gas_info(&env, &mut store, GasInfo::with_externally_used(20)).unwrap(); + assert_eq!(env.get_gas_left(&mut store), 0); // Using one more unit of gas triggers a failure - match process_gas_info(&env, GasInfo::with_externally_used(1)).unwrap_err() { + match process_gas_info(&env, &mut store, GasInfo::with_externally_used(1)).unwrap_err() { VmError::GasDepletion { .. } => {} - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } } #[test] fn is_storage_readonly_defaults_to_true() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, _store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); assert!(env.is_storage_readonly()); @@ -620,7 +821,7 @@ mod tests { #[test] fn set_storage_readonly_can_change_flag() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, _store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); // change @@ -638,57 +839,60 @@ mod tests { #[test] fn call_function_works() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, mut store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); - let result = env.call_function("allocate", &[10u32.into()]).unwrap(); + let result = env + .call_function(&mut store, "allocate", &[10u32.into()]) + .unwrap(); let ptr = ref_to_u32(&result[0]).unwrap(); assert!(ptr > 0); } #[test] fn call_function_fails_for_missing_instance() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, mut store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); // Clear context's wasmer_instance env.set_wasmer_instance(None); - let res = env.call_function("allocate", &[]); + let res = env.call_function(&mut store, "allocate", &[]); match res.unwrap_err() { VmError::UninitializedContextData { kind, .. } => assert_eq!(kind, "wasmer_instance"), - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } #[test] fn call_function_fails_for_missing_function() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, mut store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); - let res = env.call_function("doesnt_exist", &[]); + let res = env.call_function(&mut store, "doesnt_exist", &[]); match res.unwrap_err() { VmError::ResolveErr { msg, .. } => { assert_eq!(msg, "Could not get export: Missing export doesnt_exist"); } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } #[test] fn call_function0_works() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, mut store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); - env.call_function0("interface_version_8", &[]).unwrap(); + env.call_function0(&mut store, "interface_version_8", &[]) + .unwrap(); } #[test] fn call_function0_errors_for_wrong_result_count() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, mut store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); - let result = env.call_function0("allocate", &[10u32.into()]); + let result = env.call_function0(&mut store, "allocate", &[10u32.into()]); match result.unwrap_err() { VmError::ResultMismatch { function_name, @@ -700,30 +904,34 @@ mod tests { assert_eq!(expected, 0); assert_eq!(actual, 1); } - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } } #[test] fn call_function1_works() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, mut store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); - let result = env.call_function1("allocate", &[10u32.into()]).unwrap(); + let result = env + .call_function1(&mut store, "allocate", &[10u32.into()]) + .unwrap(); let ptr = ref_to_u32(&result).unwrap(); assert!(ptr > 0); } #[test] fn call_function1_errors_for_wrong_result_count() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, mut store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); - let result = env.call_function1("allocate", &[10u32.into()]).unwrap(); + let result = env + .call_function1(&mut store, "allocate", &[10u32.into()]) + .unwrap(); let ptr = ref_to_u32(&result).unwrap(); assert!(ptr > 0); - let result = env.call_function1("deallocate", &[ptr.into()]); + let result = env.call_function1(&mut store, "deallocate", &[ptr.into()]); match result.unwrap_err() { VmError::ResultMismatch { function_name, @@ -735,13 +943,13 @@ mod tests { assert_eq!(expected, 1); assert_eq!(actual, 0); } - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), } } #[test] fn with_storage_from_context_set_get() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, _store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); let val = env @@ -774,7 +982,7 @@ mod tests { #[test] #[should_panic(expected = "A panic occurred in the callback.")] fn with_storage_from_context_handles_panics() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, _store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); env.with_storage_from_context::<_, ()>(|_store| { @@ -784,31 +992,33 @@ mod tests { } #[test] + #[allow(deprecated)] fn with_querier_from_context_works() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, _store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); let res = env .with_querier_from_context::<_, _>(|querier| { - let req: QueryRequest = QueryRequest::Bank(BankQuery::AllBalances { + let req: QueryRequest = QueryRequest::Bank(BankQuery::Balance { address: INIT_ADDR.to_string(), + denom: INIT_DENOM.to_string(), }); let (result, _gas_info) = - querier.query_raw(&to_vec(&req).unwrap(), DEFAULT_QUERY_GAS_LIMIT); + querier.query_raw(&to_json_vec(&req).unwrap(), DEFAULT_QUERY_GAS_LIMIT); Ok(result.unwrap()) }) .unwrap() .unwrap() .unwrap(); - let balance: AllBalanceResponse = from_binary(&res).unwrap(); + let balance: BalanceResponse = from_json(res).unwrap(); - assert_eq!(balance.amount, coins(INIT_AMOUNT, INIT_DENOM)); + assert_eq!(balance.amount, coin(INIT_AMOUNT, INIT_DENOM)); } #[test] #[should_panic(expected = "A panic occurred in the callback.")] fn with_querier_from_context_handles_panics() { - let (env, _instance) = make_instance(TESTING_GAS_LIMIT); + let (env, _store, _instance) = make_instance(TESTING_GAS_LIMIT); leave_default_data(&env); env.with_querier_from_context::<_, ()>(|_querier| { diff --git a/packages/vm/src/errors/backtrace.rs b/packages/vm/src/errors/backtrace.rs new file mode 100644 index 0000000000..5697225c9a --- /dev/null +++ b/packages/vm/src/errors/backtrace.rs @@ -0,0 +1,42 @@ +use core::fmt::{Debug, Display, Formatter, Result}; +use std::backtrace::Backtrace; + +/// This wraps an actual backtrace to allow us to use this in conjunction with [`thiserror::Error`] +pub struct BT(Box); + +impl BT { + #[track_caller] + pub fn capture() -> Self { + BT(Box::new(Backtrace::capture())) + } +} + +impl Debug for BT { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + Debug::fmt(&self.0, f) + } +} + +impl Display for BT { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + Display::fmt(&self.0, f) + } +} + +/// This macro implements `From` for a given error type to a given error type where +/// the target error has a `backtrace` field. +/// This is meant as a replacement for `thiserror`'s `#[from]` attribute, which does not +/// work with our custom backtrace wrapper. +macro_rules! impl_from_err { + ($from:ty, $to:ty, $map:path) => { + impl From<$from> for $to { + fn from(err: $from) -> Self { + $map { + source: err, + backtrace: $crate::errors::backtrace::BT::capture(), + } + } + } + }; +} +pub(crate) use impl_from_err; diff --git a/packages/vm/src/errors/communication_error.rs b/packages/vm/src/errors/communication_error.rs index a5fb88e0ee..b9c4e60e34 100644 --- a/packages/vm/src/errors/communication_error.rs +++ b/packages/vm/src/errors/communication_error.rs @@ -2,8 +2,9 @@ use std::fmt::Debug; use thiserror::Error; use super::region_validation_error::RegionValidationError; +use crate::memory::Region; -/// An error in the communcation between contract and host. Those happen around imports and exports. +/// An error in the communication between contract and host. Those happen around imports and exports. #[derive(Error, Debug)] #[non_exhaustive] pub enum CommunicationError { @@ -24,6 +25,9 @@ pub enum CommunicationError { #[from] source: RegionValidationError, }, + /// When the contract supplies invalid section data to the host. See also `decode_sections` [crate::sections::decode_sections]. + #[error("Got an invalid section: {}", msg)] + InvalidSection { msg: String }, /// Whenever UTF-8 bytes cannot be decoded into a unicode string, e.g. in String::from_utf8 or str::from_utf8. #[error("Cannot decode UTF8 bytes into string: {}", msg)] InvalidUtf8 { msg: String }, @@ -32,6 +36,12 @@ pub enum CommunicationError { RegionLengthTooBig { length: usize, max_length: usize }, #[error("Region too small. Got {}, required {}", size, required)] RegionTooSmall { size: usize, required: usize }, + #[error("Tried to access memory of region {:?} in Wasm memory of size {} bytes. This typically happens when the given Region pointer does not point to a proper Region struct.", region, memory_size)] + RegionAccessErr { + region: Region, + /// Current size of the linear memory in bytes + memory_size: usize, + }, #[error("Got a zero Wasm address")] ZeroAddress {}, } @@ -49,6 +59,10 @@ impl CommunicationError { CommunicationError::InvalidOrder { value } } + pub(crate) fn invalid_section(msg: impl Into) -> Self { + CommunicationError::InvalidSection { msg: msg.into() } + } + #[allow(dead_code)] pub(crate) fn invalid_utf8(msg: impl ToString) -> Self { CommunicationError::InvalidUtf8 { @@ -64,6 +78,13 @@ impl CommunicationError { CommunicationError::RegionTooSmall { size, required } } + pub(crate) fn region_access_err(region: Region, memory_size: usize) -> Self { + CommunicationError::RegionAccessErr { + region, + memory_size, + } + } + pub(crate) fn zero_address() -> Self { CommunicationError::ZeroAddress {} } @@ -83,7 +104,7 @@ mod tests { assert_eq!(offset, 345); assert_eq!(msg, "broken stuff"); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -92,7 +113,7 @@ mod tests { let error = CommunicationError::invalid_order(-745); match error { CommunicationError::InvalidOrder { value, .. } => assert_eq!(value, -745), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -101,7 +122,7 @@ mod tests { let error = CommunicationError::invalid_utf8("broken"); match error { CommunicationError::InvalidUtf8 { msg, .. } => assert_eq!(msg, "broken"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -115,7 +136,7 @@ mod tests { assert_eq!(length, 50); assert_eq!(max_length, 20); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -127,7 +148,7 @@ mod tests { assert_eq!(size, 12); assert_eq!(required, 33); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -136,7 +157,7 @@ mod tests { let error = CommunicationError::zero_address(); match error { CommunicationError::ZeroAddress { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } } diff --git a/packages/vm/src/errors/mod.rs b/packages/vm/src/errors/mod.rs index b1da714a38..ba536389a4 100644 --- a/packages/vm/src/errors/mod.rs +++ b/packages/vm/src/errors/mod.rs @@ -1,7 +1,9 @@ +mod backtrace; mod communication_error; mod region_validation_error; mod vm_error; +pub(crate) use backtrace::{impl_from_err, BT}; pub use communication_error::CommunicationError; pub use region_validation_error::RegionValidationError; pub use vm_error::VmError; diff --git a/packages/vm/src/errors/region_validation_error.rs b/packages/vm/src/errors/region_validation_error.rs index 7fc407e7c0..bf9dd5e360 100644 --- a/packages/vm/src/errors/region_validation_error.rs +++ b/packages/vm/src/errors/region_validation_error.rs @@ -51,7 +51,7 @@ mod tests { assert_eq!(length, 50); assert_eq!(capacity, 20); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -65,7 +65,7 @@ mod tests { assert_eq!(offset, u32::MAX); assert_eq!(capacity, 1); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -74,7 +74,7 @@ mod tests { let error = RegionValidationError::zero_offset(); match error { RegionValidationError::ZeroOffset { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } } diff --git a/packages/vm/src/errors/vm_error.rs b/packages/vm/src/errors/vm_error.rs index 6140799bc4..5a6260418a 100644 --- a/packages/vm/src/errors/vm_error.rs +++ b/packages/vm/src/errors/vm_error.rs @@ -1,5 +1,4 @@ -#[cfg(feature = "backtraces")] -use std::backtrace::Backtrace; +use super::{impl_from_err, BT}; use std::fmt::{Debug, Display}; use thiserror::Error; @@ -12,103 +11,59 @@ use crate::backend::BackendError; #[non_exhaustive] pub enum VmError { #[error("Aborted: {}", msg)] - Aborted { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + Aborted { msg: String, backtrace: BT }, #[error("Error calling into the VM's backend: {}", source)] - BackendErr { - source: BackendError, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + BackendErr { source: BackendError, backtrace: BT }, #[error("Cache error: {msg}")] - CacheErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + CacheErr { msg: String, backtrace: BT }, #[error("Error in guest/host communication: {source}")] CommunicationErr { - #[from] source: CommunicationError, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, + backtrace: BT, }, #[error("Error compiling Wasm: {msg}")] - CompileErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + CompileErr { msg: String, backtrace: BT }, #[error("Couldn't convert from {} to {}. Input: {}", from_type, to_type, input)] ConversionErr { from_type: String, to_type: String, input: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, + backtrace: BT, }, #[error("Crypto error: {}", source)] - CryptoErr { - source: CryptoError, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + CryptoErr { source: CryptoError, backtrace: BT }, #[error("Ran out of gas during contract execution")] - GasDepletion { - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + GasDepletion { backtrace: BT }, /// Whenever there is no specific error type available #[error("Generic error: {msg}")] - GenericErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + GenericErr { msg: String, backtrace: BT }, #[error("Error instantiating a Wasm module: {msg}")] - InstantiationErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + InstantiationErr { msg: String, backtrace: BT }, #[error("Hash doesn't match stored data")] - IntegrityErr { - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + IntegrityErr { backtrace: BT }, #[error("Error parsing into type {target_type}: {msg}")] ParseErr { /// the target type that was attempted target_type: String, msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, + backtrace: BT, }, #[error("Data too long for deserialization. Got: {length} bytes; limit: {max_length} bytes")] DeserializationLimitExceeded { /// the target type that was attempted length: usize, max_length: usize, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, + backtrace: BT, }, #[error("Error serializing type {source_type}: {msg}")] SerializeErr { /// the source type that was attempted source_type: String, msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, + backtrace: BT, }, #[error("Error resolving Wasm function: {}", msg)] - ResolveErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + ResolveErr { msg: String, backtrace: BT }, #[error( "Unexpected number of result values when calling '{}'. Expected: {}, actual: {}.", function_name, @@ -119,31 +74,25 @@ pub enum VmError { function_name: String, expected: usize, actual: usize, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, + backtrace: BT, }, #[error("Error executing Wasm: {}", msg)] - RuntimeErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + RuntimeErr { msg: String, backtrace: BT }, #[error("Error during static Wasm validation: {}", msg)] - StaticValidationErr { - msg: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + StaticValidationErr { msg: String, backtrace: BT }, #[error("Uninitialized Context Data: {}", kind)] - UninitializedContextData { - kind: String, - #[cfg(feature = "backtraces")] - backtrace: Backtrace, - }, + UninitializedContextData { kind: String, backtrace: BT }, #[error("Must not call a writing storage function in this context.")] - WriteAccessDenied { - #[cfg(feature = "backtraces")] - backtrace: Backtrace, + WriteAccessDenied { backtrace: BT }, + #[error("Maximum call depth exceeded.")] + MaxCallDepthExceeded { backtrace: BT }, + #[error( + "The called function args arity does not match. The contract's method arity: {}", + contract_method_arity + )] + FunctionArityMismatch { + contract_method_arity: usize, + backtrace: BT, }, } @@ -151,32 +100,28 @@ impl VmError { pub(crate) fn aborted(msg: impl Into) -> Self { VmError::Aborted { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn backend_err(original: BackendError) -> Self { VmError::BackendErr { source: original, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn cache_err(msg: impl Into) -> Self { VmError::CacheErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn compile_err(msg: impl Into) -> Self { VmError::CompileErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } @@ -189,46 +134,40 @@ impl VmError { from_type: from_type.into(), to_type: to_type.into(), input: input.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn crypto_err(original: CryptoError) -> Self { VmError::CryptoErr { source: original, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn gas_depletion() -> Self { VmError::GasDepletion { - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn generic_err(msg: impl Into) -> Self { VmError::GenericErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn instantiation_err(msg: impl Into) -> Self { VmError::InstantiationErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn integrity_err() -> Self { VmError::IntegrityErr { - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } @@ -236,8 +175,7 @@ impl VmError { VmError::ParseErr { target_type: target.into(), msg: msg.to_string(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } @@ -245,8 +183,7 @@ impl VmError { VmError::DeserializationLimitExceeded { length, max_length, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } @@ -254,16 +191,14 @@ impl VmError { VmError::SerializeErr { source_type: source.into(), msg: msg.to_string(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn resolve_err(msg: impl Into) -> Self { VmError::ResolveErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } @@ -276,8 +211,7 @@ impl VmError { function_name: function_name.into(), expected, actual, - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } @@ -287,35 +221,46 @@ impl VmError { fn runtime_err(msg: impl Into) -> Self { VmError::RuntimeErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn static_validation_err(msg: impl Into) -> Self { VmError::StaticValidationErr { msg: msg.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn uninitialized_context_data(kind: impl Into) -> Self { VmError::UninitializedContextData { kind: kind.into(), - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), } } pub(crate) fn write_access_denied() -> Self { VmError::WriteAccessDenied { - #[cfg(feature = "backtraces")] - backtrace: Backtrace::capture(), + backtrace: BT::capture(), + } + } + + pub(crate) fn max_call_depth_exceeded() -> Self { + VmError::MaxCallDepthExceeded { + backtrace: BT::capture(), + } + } + + pub(crate) fn function_arity_mismatch(contract_method_arity: usize) -> Self { + VmError::FunctionArityMismatch { + contract_method_arity, + backtrace: BT::capture(), } } } +impl_from_err!(CommunicationError, VmError, VmError::CommunicationErr); + impl From for VmError { fn from(original: BackendError) -> Self { match original { @@ -331,21 +276,29 @@ impl From for VmError { } } +impl From for VmError { + fn from(original: wasmer::wasmparser::BinaryReaderError) -> Self { + VmError::static_validation_err(format!( + "Wasm bytecode could not be deserialized. Deserialization error: \"{original}\"" + )) + } +} + impl From for VmError { fn from(original: wasmer::ExportError) -> Self { - VmError::resolve_err(format!("Could not get export: {}", original)) + VmError::resolve_err(format!("Could not get export: {original}")) } } impl From for VmError { fn from(original: wasmer::SerializeError) -> Self { - VmError::cache_err(format!("Could not serialize module: {}", original)) + VmError::cache_err(format!("Could not serialize module: {original}")) } } impl From for VmError { fn from(original: wasmer::DeserializeError) -> Self { - VmError::cache_err(format!("Could not deserialize module: {}", original)) + VmError::cache_err(format!("Could not deserialize module: {original}")) } } @@ -359,7 +312,7 @@ impl From for VmError { let message = format!("RuntimeError: {}", original.message()); debug_assert!( original.to_string().starts_with(&message), - "The error message we created is not a prefix of the error message from Wasmer. Our message: '{}'. Wasmer messsage: '{}'", + "The error message we created is not a prefix of the error message from Wasmer. Our message: '{}'. Wasmer message: '{}'", &message, original ); @@ -369,7 +322,7 @@ impl From for VmError { impl From for VmError { fn from(original: wasmer::CompileError) -> Self { - VmError::compile_err(format!("Could not compile: {}", original)) + VmError::compile_err(format!("Could not compile: {original}")) } } @@ -400,7 +353,7 @@ mod tests { source: BackendError::Unknown { msg }, .. } => assert_eq!(msg, "something went wrong"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -409,7 +362,7 @@ mod tests { let error = VmError::cache_err("something went wrong"); match error { VmError::CacheErr { msg, .. } => assert_eq!(msg, "something went wrong"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -418,7 +371,7 @@ mod tests { let error = VmError::compile_err("something went wrong"); match error { VmError::CompileErr { msg, .. } => assert_eq!(msg, "something went wrong"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -436,19 +389,19 @@ mod tests { assert_eq!(to_type, "u32"); assert_eq!(input, "-9"); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] - fn cyrpto_err_works() { + fn crypto_err_works() { let error = VmError::crypto_err(CryptoError::generic_err("something went wrong")); match error { VmError::CryptoErr { source: CryptoError::GenericErr { msg, .. }, .. } => assert_eq!(msg, "something went wrong"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -457,19 +410,19 @@ mod tests { let error = VmError::gas_depletion(); match error { VmError::GasDepletion { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn generic_err_works() { let guess = 7; - let error = VmError::generic_err(format!("{} is too low", guess)); + let error = VmError::generic_err(format!("{guess} is too low")); match error { VmError::GenericErr { msg, .. } => { assert_eq!(msg, String::from("7 is too low")); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -478,7 +431,7 @@ mod tests { let error = VmError::instantiation_err("something went wrong"); match error { VmError::InstantiationErr { msg, .. } => assert_eq!(msg, "something went wrong"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -487,7 +440,7 @@ mod tests { let error = VmError::integrity_err(); match error { VmError::IntegrityErr { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -501,7 +454,7 @@ mod tests { assert_eq!(target_type, "Book"); assert_eq!(msg, "Missing field: title"); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -515,7 +468,7 @@ mod tests { assert_eq!(source_type, "Book"); assert_eq!(msg, "Content too long"); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -524,7 +477,7 @@ mod tests { let error = VmError::resolve_err("function has different signature"); match error { VmError::ResolveErr { msg, .. } => assert_eq!(msg, "function has different signature"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -542,7 +495,7 @@ mod tests { assert_eq!(expected, 0); assert_eq!(actual, 1); } - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -551,7 +504,7 @@ mod tests { let error = VmError::runtime_err("something went wrong"); match error { VmError::RuntimeErr { msg, .. } => assert_eq!(msg, "something went wrong"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -560,7 +513,7 @@ mod tests { let error = VmError::static_validation_err("export xy missing"); match error { VmError::StaticValidationErr { msg, .. } => assert_eq!(msg, "export xy missing"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -569,7 +522,7 @@ mod tests { let error = VmError::uninitialized_context_data("foo"); match error { VmError::UninitializedContextData { kind, .. } => assert_eq!(kind, "foo"), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -578,7 +531,7 @@ mod tests { let error = VmError::write_access_denied(); match error { VmError::WriteAccessDenied { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } } diff --git a/packages/vm/src/filesystem.rs b/packages/vm/src/filesystem.rs new file mode 100644 index 0000000000..45a60f435f --- /dev/null +++ b/packages/vm/src/filesystem.rs @@ -0,0 +1,43 @@ +use std::{fs::create_dir_all, path::Path}; + +#[derive(Debug)] +pub struct MkdirPFailure; + +/// An implementation for `mkdir -p`. +/// +/// This is a thin wrapper around fs::create_dir_all that +/// hides all OS specific error messages to ensure they don't end up +/// breaking consensus. +pub fn mkdir_p(path: &Path) -> Result<(), MkdirPFailure> { + create_dir_all(path).map_err(|_e| MkdirPFailure) +} + +#[cfg(test)] +mod tests { + use tempfile::TempDir; + + use super::*; + + #[test] + fn mkdir_p_works() { + let tmp_root = TempDir::new().unwrap(); + + // Can create + let path = tmp_root.path().join("something"); + assert!(!path.is_dir()); + mkdir_p(&path).unwrap(); + assert!(path.is_dir()); + + // Can be called on existing dir + let path = tmp_root.path().join("something else"); + assert!(!path.is_dir()); + mkdir_p(&path).unwrap(); + assert!(path.is_dir()); + mkdir_p(&path).unwrap(); // no-op + assert!(path.is_dir()); + + // Fails for dir with null + let path = tmp_root.path().join("something\0with NULL"); + mkdir_p(&path).unwrap_err(); + } +} diff --git a/packages/vm/src/imports.rs b/packages/vm/src/imports.rs index d99e6b7ecc..6805759cbb 100644 --- a/packages/vm/src/imports.rs +++ b/packages/vm/src/imports.rs @@ -1,20 +1,25 @@ //! Import implementations -use std::cmp::max; +use std::marker::PhantomData; +use cosmwasm_core::{BLS12_381_G1_POINT_LEN, BLS12_381_G2_POINT_LEN}; use cosmwasm_crypto::{ - ed25519_batch_verify, ed25519_verify, secp256k1_recover_pubkey, secp256k1_verify, CryptoError, + bls12_381_aggregate_g1, bls12_381_aggregate_g2, bls12_381_hash_to_g1, bls12_381_hash_to_g2, + bls12_381_pairing_equality, ed25519_batch_verify, ed25519_verify, secp256k1_recover_pubkey, + secp256k1_verify, secp256r1_recover_pubkey, secp256r1_verify, CryptoError, HashFunction, }; use cosmwasm_crypto::{ ECDSA_PUBKEY_MAX_LEN, ECDSA_SIGNATURE_LEN, EDDSA_PUBKEY_LEN, MESSAGE_HASH_MAX_LEN, }; +use rand_core::OsRng; #[cfg(feature = "iterator")] use cosmwasm_std::Order; +use wasmer::{AsStoreMut, FunctionEnvMut}; use crate::backend::{BackendApi, BackendError, Querier, Storage}; use crate::conversion::{ref_to_u32, to_u32}; -use crate::environment::{process_gas_info, Environment}; +use crate::environment::{process_gas_info, DebugInfo, Environment}; use crate::errors::{CommunicationError, VmError, VmResult}; #[cfg(feature = "iterator")] use crate::memory::maybe_read_region; @@ -27,7 +32,7 @@ use crate::GasInfo; /// A kibi (kilo binary) const KI: usize = 1024; -/// A mibi (mega binary) +/// A mebi (mega binary) const MI: usize = 1024 * 1024; /// Max key length for db_write/db_read/db_remove/db_scan (when VM reads the key argument from Wasm memory) const MAX_LENGTH_DB_KEY: usize = 64 * KI; @@ -43,11 +48,11 @@ const MAX_LENGTH_QUERY_CHAIN_REQUEST: usize = 64 * KI; /// Length of a serialized Ed25519 signature const MAX_LENGTH_ED25519_SIGNATURE: usize = 64; /// Max length of a Ed25519 message in bytes. -/// This is an arbitrary value, for performance / memory contraints. If you need to verify larger +/// This is an arbitrary value, for performance / memory constraints. If you need to verify larger /// messages, let us know. const MAX_LENGTH_ED25519_MESSAGE: usize = 128 * 1024; /// Max number of batch Ed25519 messages / signatures / public_keys. -/// This is an arbitrary value, for performance / memory contraints. If you need to batch-verify a +/// This is an arbitrary value, for performance / memory constraints. If you need to batch-verify a /// larger number of signatures, let us know. const MAX_COUNT_ED25519_BATCH: usize = 256; @@ -57,207 +62,517 @@ const MAX_LENGTH_DEBUG: usize = 2 * MI; /// Max length for an abort message const MAX_LENGTH_ABORT: usize = 2 * MI; +#[inline(always)] +fn charge_host_call_gas( + env: &Environment, + store: &mut impl AsStoreMut, +) -> VmResult<()> { + let gas = GasInfo::with_cost(env.gas_config.host_call_cost); + process_gas_info(env, store, gas) +} + // Import implementations // // This block of do_* prefixed functions is tailored for Wasmer's -// Function::new_native_with_env interface. Those require an env in the first +// Function::new_typed_with_env interface. Those require an env in the first // argument and cannot capture other variables. Thus everything is accessed // through the env. /// Reads a storage entry from the VM's storage into Wasm memory -pub fn do_db_read( - env: &Environment, +pub fn do_db_read( + mut env: FunctionEnvMut>, key_ptr: u32, ) -> VmResult { - let key = read_region(&env.memory(), key_ptr, MAX_LENGTH_DB_KEY)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; - let (result, gas_info) = env.with_storage_from_context::<_, _>(|store| Ok(store.get(&key)))?; - process_gas_info::(env, gas_info)?; + let key = read_region(data, &mut store, key_ptr, MAX_LENGTH_DB_KEY)?; + + let (result, gas_info) = data.with_storage_from_context::<_, _>(|store| Ok(store.get(&key)))?; + process_gas_info(data, &mut store, gas_info)?; let value = result?; let out_data = match value { Some(data) => data, None => return Ok(0), }; - write_to_contract::(env, &out_data) + write_to_contract(data, &mut store, &out_data) } /// Writes a storage entry from Wasm memory into the VM's storage -pub fn do_db_write( - env: &Environment, +pub fn do_db_write( + mut env: FunctionEnvMut>, key_ptr: u32, value_ptr: u32, ) -> VmResult<()> { - if env.is_storage_readonly() { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + if data.is_storage_readonly() { return Err(VmError::write_access_denied()); } - let key = read_region(&env.memory(), key_ptr, MAX_LENGTH_DB_KEY)?; - let value = read_region(&env.memory(), value_ptr, MAX_LENGTH_DB_VALUE)?; + /// Converts a region length error to a different variant for better understandability + fn convert_error(e: VmError, kind: &'static str) -> VmError { + if let VmError::CommunicationErr { + source: CommunicationError::RegionLengthTooBig { length, max_length }, + .. + } = e + { + VmError::generic_err(format!( + "{kind} too big. Tried to write {length} bytes to storage, limit is {max_length}." + )) + } else { + e + } + } + + let key = read_region(data, &mut store, key_ptr, MAX_LENGTH_DB_KEY) + .map_err(|e| convert_error(e, "Key"))?; + let value = read_region(data, &mut store, value_ptr, MAX_LENGTH_DB_VALUE) + .map_err(|e| convert_error(e, "Value"))?; let (result, gas_info) = - env.with_storage_from_context::<_, _>(|store| Ok(store.set(&key, &value)))?; - process_gas_info::(env, gas_info)?; + data.with_storage_from_context::<_, _>(|store| Ok(store.set(&key, &value)))?; + process_gas_info(data, &mut store, gas_info)?; result?; Ok(()) } -pub fn do_db_remove( - env: &Environment, +pub fn do_db_remove( + mut env: FunctionEnvMut>, key_ptr: u32, ) -> VmResult<()> { - if env.is_storage_readonly() { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + if data.is_storage_readonly() { return Err(VmError::write_access_denied()); } - let key = read_region(&env.memory(), key_ptr, MAX_LENGTH_DB_KEY)?; + let key = read_region(data, &mut store, key_ptr, MAX_LENGTH_DB_KEY)?; let (result, gas_info) = - env.with_storage_from_context::<_, _>(|store| Ok(store.remove(&key)))?; - process_gas_info(env, gas_info)?; + data.with_storage_from_context::<_, _>(|store| Ok(store.remove(&key)))?; + process_gas_info(data, &mut store, gas_info)?; result?; Ok(()) } -pub fn do_addr_validate( - env: &Environment, +pub fn do_addr_validate( + mut env: FunctionEnvMut>, source_ptr: u32, ) -> VmResult { - let source_data = read_region(&env.memory(), source_ptr, MAX_LENGTH_HUMAN_ADDRESS)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let source_data = read_region(data, &mut store, source_ptr, MAX_LENGTH_HUMAN_ADDRESS)?; if source_data.is_empty() { - return write_to_contract::(env, b"Input is empty"); + return write_to_contract(data, &mut store, b"Input is empty"); } + let string_gas_cost = GasInfo::with_cost( + data.gas_config + .string_from_bytes_cost + .total_cost(source_data.len() as u64)?, + ); + process_gas_info(data, &mut store, string_gas_cost)?; let source_string = match String::from_utf8(source_data) { Ok(s) => s, - Err(_) => return write_to_contract::(env, b"Input is not valid UTF-8"), - }; - - let (result, gas_info) = env.api.canonical_address(&source_string); - process_gas_info::(env, gas_info)?; - let canonical = match result { - Ok(data) => data, - Err(BackendError::UserErr { msg, .. }) => { - return write_to_contract::(env, msg.as_bytes()) - } - Err(err) => return Err(VmError::from(err)), + Err(_) => return write_to_contract(data, &mut store, b"Input is not valid UTF-8"), }; - let (result, gas_info) = env.api.human_address(&canonical); - process_gas_info::(env, gas_info)?; - let normalized = match result { - Ok(addr) => addr, + let (result, gas_info) = data.api.addr_validate(&source_string); + process_gas_info(data, &mut store, gas_info)?; + match result { + Ok(()) => Ok(0), Err(BackendError::UserErr { msg, .. }) => { - return write_to_contract::(env, msg.as_bytes()) + write_to_contract(data, &mut store, msg.as_bytes()) } - Err(err) => return Err(VmError::from(err)), - }; - - if normalized != source_string { - return write_to_contract::(env, b"Address is not normalized"); + Err(err) => Err(VmError::from(err)), } - - Ok(0) } -pub fn do_addr_canonicalize( - env: &Environment, +pub fn do_addr_canonicalize( + mut env: FunctionEnvMut>, source_ptr: u32, destination_ptr: u32, ) -> VmResult { - let source_data = read_region(&env.memory(), source_ptr, MAX_LENGTH_HUMAN_ADDRESS)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let source_data = read_region(data, &mut store, source_ptr, MAX_LENGTH_HUMAN_ADDRESS)?; if source_data.is_empty() { - return write_to_contract::(env, b"Input is empty"); + return write_to_contract(data, &mut store, b"Input is empty"); } + let string_gas_cost = GasInfo::with_cost( + data.gas_config + .string_from_bytes_cost + .total_cost(source_data.len() as u64)?, + ); + process_gas_info(data, &mut store, string_gas_cost)?; let source_string = match String::from_utf8(source_data) { Ok(s) => s, - Err(_) => return write_to_contract::(env, b"Input is not valid UTF-8"), + Err(_) => return write_to_contract(data, &mut store, b"Input is not valid UTF-8"), }; - let (result, gas_info) = env.api.canonical_address(&source_string); - process_gas_info::(env, gas_info)?; + let (result, gas_info) = data.api.addr_canonicalize(&source_string); + process_gas_info(data, &mut store, gas_info)?; match result { Ok(canonical) => { - write_region(&env.memory(), destination_ptr, canonical.as_slice())?; + write_region(data, &mut store, destination_ptr, canonical.as_slice())?; Ok(0) } Err(BackendError::UserErr { msg, .. }) => { - Ok(write_to_contract::(env, msg.as_bytes())?) + Ok(write_to_contract(data, &mut store, msg.as_bytes())?) } Err(err) => Err(VmError::from(err)), } } -pub fn do_addr_humanize( - env: &Environment, +pub fn do_addr_humanize( + mut env: FunctionEnvMut>, source_ptr: u32, destination_ptr: u32, ) -> VmResult { - let canonical = read_region(&env.memory(), source_ptr, MAX_LENGTH_CANONICAL_ADDRESS)?; + let (data, mut store) = env.data_and_store_mut(); - let (result, gas_info) = env.api.human_address(&canonical); - process_gas_info::(env, gas_info)?; + charge_host_call_gas(data, &mut store)?; + + let canonical = read_region(data, &mut store, source_ptr, MAX_LENGTH_CANONICAL_ADDRESS)?; + + let (result, gas_info) = data.api.addr_humanize(&canonical); + process_gas_info(data, &mut store, gas_info)?; match result { Ok(human) => { - write_region(&env.memory(), destination_ptr, human.as_bytes())?; + write_region(data, &mut store, destination_ptr, human.as_bytes())?; Ok(0) } Err(BackendError::UserErr { msg, .. }) => { - Ok(write_to_contract::(env, msg.as_bytes())?) + Ok(write_to_contract(data, &mut store, msg.as_bytes())?) } Err(err) => Err(VmError::from(err)), } } -pub fn do_secp256k1_verify( - env: &Environment, +/// Return code (error code) for a valid signature +const SECP256K1_VERIFY_CODE_VALID: u32 = 0; + +/// Return code (error code) for an invalid signature +const SECP256K1_VERIFY_CODE_INVALID: u32 = 1; + +/// Return code (error code) for a valid pairing +const BLS12_381_VALID_PAIRING: u32 = 0; + +/// Return code (error code) for an invalid pairing +const BLS12_381_INVALID_PAIRING: u32 = 1; + +/// Return code (error code) if the aggregating the points on curve was successful +const BLS12_381_AGGREGATE_SUCCESS: u32 = 0; + +/// Return code (error code) for success when hashing to the curve +const BLS12_381_HASH_TO_CURVE_SUCCESS: u32 = 0; + +/// Maximum size of continuous points passed to aggregate functions +const BLS12_381_MAX_AGGREGATE_SIZE: usize = 2 * MI; + +/// Maximum size of the message passed to the hash-to-curve functions +const BLS12_381_MAX_MESSAGE_SIZE: usize = 5 * MI; + +/// Maximum size of the destination passed to the hash-to-curve functions +const BLS12_381_MAX_DST_SIZE: usize = 5 * KI; + +pub fn do_bls12_381_aggregate_g1< + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +>( + mut env: FunctionEnvMut>, + g1s_ptr: u32, + out_ptr: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + charge_host_call_gas(data, &mut store)?; + + let g1s = read_region(data, &mut store, g1s_ptr, BLS12_381_MAX_AGGREGATE_SIZE)?; + + let estimated_point_count = (g1s.len() / BLS12_381_G1_POINT_LEN) as u64; + let gas_info = GasInfo::with_cost( + data.gas_config + .bls12_381_aggregate_g1_cost + .total_cost(estimated_point_count)?, + ); + process_gas_info(data, &mut store, gas_info)?; + + let code = match bls12_381_aggregate_g1(&g1s) { + Ok(point) => { + write_region(data, &mut store, out_ptr, &point)?; + BLS12_381_AGGREGATE_SUCCESS + } + Err(err) => match err { + CryptoError::InvalidPoint { .. } | CryptoError::Aggregation { .. } => err.code(), + CryptoError::PairingEquality { .. } + | CryptoError::BatchErr { .. } + | CryptoError::GenericErr { .. } + | CryptoError::InvalidHashFormat { .. } + | CryptoError::InvalidPubkeyFormat { .. } + | CryptoError::InvalidRecoveryParam { .. } + | CryptoError::InvalidSignatureFormat { .. } + | CryptoError::UnknownHashFunction { .. } => { + panic!("Error must not happen for this call") + } + }, + }; + + Ok(code) +} + +pub fn do_bls12_381_aggregate_g2< + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +>( + mut env: FunctionEnvMut>, + g2s_ptr: u32, + out_ptr: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let g2s = read_region(data, &mut store, g2s_ptr, BLS12_381_MAX_AGGREGATE_SIZE)?; + + let estimated_point_count = (g2s.len() / BLS12_381_G2_POINT_LEN) as u64; + let gas_info = GasInfo::with_cost( + data.gas_config + .bls12_381_aggregate_g2_cost + .total_cost(estimated_point_count)?, + ); + process_gas_info(data, &mut store, gas_info)?; + + let code = match bls12_381_aggregate_g2(&g2s) { + Ok(point) => { + write_region(data, &mut store, out_ptr, &point)?; + BLS12_381_AGGREGATE_SUCCESS + } + Err(err) => match err { + CryptoError::InvalidPoint { .. } | CryptoError::Aggregation { .. } => err.code(), + CryptoError::PairingEquality { .. } + | CryptoError::BatchErr { .. } + | CryptoError::GenericErr { .. } + | CryptoError::InvalidHashFormat { .. } + | CryptoError::InvalidPubkeyFormat { .. } + | CryptoError::InvalidRecoveryParam { .. } + | CryptoError::InvalidSignatureFormat { .. } + | CryptoError::UnknownHashFunction { .. } => { + panic!("Error must not happen for this call") + } + }, + }; + + Ok(code) +} + +pub fn do_bls12_381_pairing_equality< + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +>( + mut env: FunctionEnvMut>, + ps_ptr: u32, + qs_ptr: u32, + r_ptr: u32, + s_ptr: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let ps = read_region(data, &mut store, ps_ptr, BLS12_381_MAX_AGGREGATE_SIZE)?; + let qs = read_region(data, &mut store, qs_ptr, BLS12_381_MAX_AGGREGATE_SIZE)?; + let r = read_region(data, &mut store, r_ptr, BLS12_381_G1_POINT_LEN)?; + let s = read_region(data, &mut store, s_ptr, BLS12_381_G2_POINT_LEN)?; + + // The values here are only correct if ps and qs can be divided by the point size. + // They are good enough for gas since we error in `bls12_381_pairing_equality` if the inputs are + // not properly formatted. + let estimated_n = (ps.len() / BLS12_381_G1_POINT_LEN) as u64; + // The number of parings to compute (`n` on the left hand side and `k = n + 1` in total) + let estimated_k = estimated_n + 1; + + let gas_info = GasInfo::with_cost( + data.gas_config + .bls12_381_pairing_equality_cost + .total_cost(estimated_k)?, + ); + process_gas_info(data, &mut store, gas_info)?; + + let code = match bls12_381_pairing_equality(&ps, &qs, &r, &s) { + Ok(true) => BLS12_381_VALID_PAIRING, + Ok(false) => BLS12_381_INVALID_PAIRING, + Err(err) => match err { + CryptoError::PairingEquality { .. } | CryptoError::InvalidPoint { .. } => err.code(), + CryptoError::Aggregation { .. } + | CryptoError::BatchErr { .. } + | CryptoError::GenericErr { .. } + | CryptoError::InvalidHashFormat { .. } + | CryptoError::InvalidPubkeyFormat { .. } + | CryptoError::InvalidRecoveryParam { .. } + | CryptoError::InvalidSignatureFormat { .. } + | CryptoError::UnknownHashFunction { .. } => { + panic!("Error must not happen for this call") + } + }, + }; + + Ok(code) +} + +pub fn do_bls12_381_hash_to_g1< + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +>( + mut env: FunctionEnvMut>, + hash_function: u32, + msg_ptr: u32, + dst_ptr: u32, + out_ptr: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let msg = read_region(data, &mut store, msg_ptr, BLS12_381_MAX_MESSAGE_SIZE)?; + let dst = read_region(data, &mut store, dst_ptr, BLS12_381_MAX_DST_SIZE)?; + + let gas_info = GasInfo::with_cost(data.gas_config.bls12_381_hash_to_g1_cost); + process_gas_info(data, &mut store, gas_info)?; + + let hash_function = match HashFunction::from_u32(hash_function) { + Ok(func) => func, + Err(error) => return Ok(error.code()), + }; + let point = bls12_381_hash_to_g1(hash_function, &msg, &dst); + + write_region(data, &mut store, out_ptr, &point)?; + + Ok(BLS12_381_HASH_TO_CURVE_SUCCESS) +} + +pub fn do_bls12_381_hash_to_g2< + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +>( + mut env: FunctionEnvMut>, + hash_function: u32, + msg_ptr: u32, + dst_ptr: u32, + out_ptr: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let msg = read_region(data, &mut store, msg_ptr, BLS12_381_MAX_MESSAGE_SIZE)?; + let dst = read_region(data, &mut store, dst_ptr, BLS12_381_MAX_DST_SIZE)?; + + let gas_info = GasInfo::with_cost(data.gas_config.bls12_381_hash_to_g2_cost); + process_gas_info(data, &mut store, gas_info)?; + + let hash_function = match HashFunction::from_u32(hash_function) { + Ok(func) => func, + Err(error) => return Ok(error.code()), + }; + let point = bls12_381_hash_to_g2(hash_function, &msg, &dst); + + write_region(data, &mut store, out_ptr, &point)?; + + Ok(BLS12_381_HASH_TO_CURVE_SUCCESS) +} + +pub fn do_secp256k1_verify( + mut env: FunctionEnvMut>, hash_ptr: u32, signature_ptr: u32, pubkey_ptr: u32, ) -> VmResult { - let hash = read_region(&env.memory(), hash_ptr, MESSAGE_HASH_MAX_LEN)?; - let signature = read_region(&env.memory(), signature_ptr, ECDSA_SIGNATURE_LEN)?; - let pubkey = read_region(&env.memory(), pubkey_ptr, ECDSA_PUBKEY_MAX_LEN)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let hash = read_region(data, &mut store, hash_ptr, MESSAGE_HASH_MAX_LEN)?; + let signature = read_region(data, &mut store, signature_ptr, ECDSA_SIGNATURE_LEN)?; + let pubkey = read_region(data, &mut store, pubkey_ptr, ECDSA_PUBKEY_MAX_LEN)?; + + let gas_info = GasInfo::with_cost(data.gas_config.secp256k1_verify_cost); + process_gas_info(data, &mut store, gas_info)?; - let gas_info = GasInfo::with_cost(env.gas_config.secp256k1_verify_cost); - process_gas_info::(env, gas_info)?; let result = secp256k1_verify(&hash, &signature, &pubkey); - Ok(result.map_or_else( - |err| match err { + let code = match result { + Ok(valid) => { + if valid { + SECP256K1_VERIFY_CODE_VALID + } else { + SECP256K1_VERIFY_CODE_INVALID + } + } + Err(err) => match err { CryptoError::InvalidHashFormat { .. } | CryptoError::InvalidPubkeyFormat { .. } | CryptoError::InvalidSignatureFormat { .. } | CryptoError::GenericErr { .. } => err.code(), - CryptoError::BatchErr { .. } | CryptoError::InvalidRecoveryParam { .. } => { + CryptoError::Aggregation { .. } + | CryptoError::PairingEquality { .. } + | CryptoError::BatchErr { .. } + | CryptoError::InvalidPoint { .. } + | CryptoError::InvalidRecoveryParam { .. } + | CryptoError::UnknownHashFunction { .. } => { panic!("Error must not happen for this call") } }, - |valid| if valid { 0 } else { 1 }, - )) + }; + Ok(code) } -pub fn do_secp256k1_recover_pubkey( - env: &Environment, +pub fn do_secp256k1_recover_pubkey< + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +>( + mut env: FunctionEnvMut>, hash_ptr: u32, signature_ptr: u32, recover_param: u32, ) -> VmResult { - let hash = read_region(&env.memory(), hash_ptr, MESSAGE_HASH_MAX_LEN)?; - let signature = read_region(&env.memory(), signature_ptr, ECDSA_SIGNATURE_LEN)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let hash = read_region(data, &mut store, hash_ptr, MESSAGE_HASH_MAX_LEN)?; + let signature = read_region(data, &mut store, signature_ptr, ECDSA_SIGNATURE_LEN)?; + let recover_param: u8 = match recover_param.try_into() { Ok(rp) => rp, Err(_) => return Ok((CryptoError::invalid_recovery_param().code() as u64) << 32), }; - let gas_info = GasInfo::with_cost(env.gas_config.secp256k1_recover_pubkey_cost); - process_gas_info::(env, gas_info)?; + let gas_info = GasInfo::with_cost(data.gas_config.secp256k1_recover_pubkey_cost); + process_gas_info(data, &mut store, gas_info)?; + let result = secp256k1_recover_pubkey(&hash, &signature, recover_param); match result { Ok(pubkey) => { - let pubkey_ptr = write_to_contract::(env, pubkey.as_ref())?; + let pubkey_ptr = write_to_contract(data, &mut store, pubkey.as_ref())?; Ok(to_low_half(pubkey_ptr)) } Err(err) => match err { @@ -265,178 +580,415 @@ pub fn do_secp256k1_recover_pubkey( | CryptoError::InvalidSignatureFormat { .. } | CryptoError::InvalidRecoveryParam { .. } | CryptoError::GenericErr { .. } => Ok(to_high_half(err.code())), - CryptoError::BatchErr { .. } | CryptoError::InvalidPubkeyFormat { .. } => { + CryptoError::Aggregation { .. } + | CryptoError::PairingEquality { .. } + | CryptoError::BatchErr { .. } + | CryptoError::InvalidPoint { .. } + | CryptoError::InvalidPubkeyFormat { .. } + | CryptoError::UnknownHashFunction { .. } => { panic!("Error must not happen for this call") } }, } } -pub fn do_ed25519_verify( - env: &Environment, +/// Return code (error code) for a valid signature +const SECP256R1_VERIFY_CODE_VALID: u32 = 0; + +/// Return code (error code) for an invalid signature +const SECP256R1_VERIFY_CODE_INVALID: u32 = 1; + +pub fn do_secp256r1_verify( + mut env: FunctionEnvMut>, + hash_ptr: u32, + signature_ptr: u32, + pubkey_ptr: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let hash = read_region(data, &mut store, hash_ptr, MESSAGE_HASH_MAX_LEN)?; + let signature = read_region(data, &mut store, signature_ptr, ECDSA_SIGNATURE_LEN)?; + let pubkey = read_region(data, &mut store, pubkey_ptr, ECDSA_PUBKEY_MAX_LEN)?; + + let gas_info = GasInfo::with_cost(data.gas_config.secp256r1_verify_cost); + process_gas_info(data, &mut store, gas_info)?; + + let result = secp256r1_verify(&hash, &signature, &pubkey); + let code = match result { + Ok(valid) => { + if valid { + SECP256R1_VERIFY_CODE_VALID + } else { + SECP256R1_VERIFY_CODE_INVALID + } + } + Err(err) => match err { + CryptoError::InvalidHashFormat { .. } + | CryptoError::InvalidPubkeyFormat { .. } + | CryptoError::InvalidSignatureFormat { .. } + | CryptoError::GenericErr { .. } => err.code(), + CryptoError::Aggregation { .. } + | CryptoError::PairingEquality { .. } + | CryptoError::BatchErr { .. } + | CryptoError::InvalidPoint { .. } + | CryptoError::InvalidRecoveryParam { .. } + | CryptoError::UnknownHashFunction { .. } => { + panic!("Error must not happen for this call") + } + }, + }; + Ok(code) +} + +pub fn do_secp256r1_recover_pubkey< + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +>( + mut env: FunctionEnvMut>, + hash_ptr: u32, + signature_ptr: u32, + recover_param: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let hash = read_region(data, &mut store, hash_ptr, MESSAGE_HASH_MAX_LEN)?; + let signature = read_region(data, &mut store, signature_ptr, ECDSA_SIGNATURE_LEN)?; + let recover_param: u8 = match recover_param.try_into() { + Ok(rp) => rp, + Err(_) => return Ok((CryptoError::invalid_recovery_param().code() as u64) << 32), + }; + + let gas_info = GasInfo::with_cost(data.gas_config.secp256r1_recover_pubkey_cost); + process_gas_info(data, &mut store, gas_info)?; + + let result = secp256r1_recover_pubkey(&hash, &signature, recover_param); + match result { + Ok(pubkey) => { + let pubkey_ptr = write_to_contract(data, &mut store, pubkey.as_ref())?; + Ok(to_low_half(pubkey_ptr)) + } + Err(err) => match err { + CryptoError::InvalidHashFormat { .. } + | CryptoError::InvalidSignatureFormat { .. } + | CryptoError::InvalidRecoveryParam { .. } + | CryptoError::GenericErr { .. } => Ok(to_high_half(err.code())), + CryptoError::Aggregation { .. } + | CryptoError::PairingEquality { .. } + | CryptoError::BatchErr { .. } + | CryptoError::InvalidPoint { .. } + | CryptoError::InvalidPubkeyFormat { .. } + | CryptoError::UnknownHashFunction { .. } => { + panic!("Error must not happen for this call") + } + }, + } +} + +/// Return code (error code) for a valid signature +const ED25519_VERIFY_CODE_VALID: u32 = 0; + +/// Return code (error code) for an invalid signature +const ED25519_VERIFY_CODE_INVALID: u32 = 1; + +pub fn do_ed25519_verify( + mut env: FunctionEnvMut>, message_ptr: u32, signature_ptr: u32, pubkey_ptr: u32, ) -> VmResult { - let message = read_region(&env.memory(), message_ptr, MAX_LENGTH_ED25519_MESSAGE)?; - let signature = read_region(&env.memory(), signature_ptr, MAX_LENGTH_ED25519_SIGNATURE)?; - let pubkey = read_region(&env.memory(), pubkey_ptr, EDDSA_PUBKEY_LEN)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let message = read_region(data, &mut store, message_ptr, MAX_LENGTH_ED25519_MESSAGE)?; + let signature = read_region( + data, + &mut store, + signature_ptr, + MAX_LENGTH_ED25519_SIGNATURE, + )?; + let pubkey = read_region(data, &mut store, pubkey_ptr, EDDSA_PUBKEY_LEN)?; + + let gas_info = GasInfo::with_cost(data.gas_config.ed25519_verify_cost); + process_gas_info(data, &mut store, gas_info)?; - let gas_info = GasInfo::with_cost(env.gas_config.ed25519_verify_cost); - process_gas_info::(env, gas_info)?; let result = ed25519_verify(&message, &signature, &pubkey); - Ok(result.map_or_else( - |err| match err { + let code = match result { + Ok(valid) => { + if valid { + ED25519_VERIFY_CODE_VALID + } else { + ED25519_VERIFY_CODE_INVALID + } + } + Err(err) => match err { CryptoError::InvalidPubkeyFormat { .. } | CryptoError::InvalidSignatureFormat { .. } | CryptoError::GenericErr { .. } => err.code(), - CryptoError::BatchErr { .. } + CryptoError::Aggregation { .. } + | CryptoError::PairingEquality { .. } + | CryptoError::BatchErr { .. } + | CryptoError::InvalidPoint { .. } | CryptoError::InvalidHashFormat { .. } - | CryptoError::InvalidRecoveryParam { .. } => { + | CryptoError::InvalidRecoveryParam { .. } + | CryptoError::UnknownHashFunction { .. } => { panic!("Error must not happen for this call") } }, - |valid| if valid { 0 } else { 1 }, - )) + }; + Ok(code) } -pub fn do_ed25519_batch_verify( - env: &Environment, +pub fn do_ed25519_batch_verify< + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, +>( + mut env: FunctionEnvMut>, messages_ptr: u32, signatures_ptr: u32, public_keys_ptr: u32, ) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + let messages = read_region( - &env.memory(), + data, + &mut store, messages_ptr, (MAX_LENGTH_ED25519_MESSAGE + 4) * MAX_COUNT_ED25519_BATCH, )?; let signatures = read_region( - &env.memory(), + data, + &mut store, signatures_ptr, (MAX_LENGTH_ED25519_SIGNATURE + 4) * MAX_COUNT_ED25519_BATCH, )?; let public_keys = read_region( - &env.memory(), + data, + &mut store, public_keys_ptr, (EDDSA_PUBKEY_LEN + 4) * MAX_COUNT_ED25519_BATCH, )?; - let messages = decode_sections(&messages); - let signatures = decode_sections(&signatures); - let public_keys = decode_sections(&public_keys); + let messages = decode_sections(&messages)?; + let signatures = decode_sections(&signatures)?; + let public_keys = decode_sections(&public_keys)?; let gas_cost = if public_keys.len() == 1 { - env.gas_config.ed25519_batch_verify_one_pubkey_cost + &data.gas_config.ed25519_batch_verify_one_pubkey_cost } else { - env.gas_config.ed25519_batch_verify_cost - } * signatures.len() as u64; - let gas_info = GasInfo::with_cost(max(gas_cost, env.gas_config.ed25519_verify_cost)); - process_gas_info::(env, gas_info)?; - let result = ed25519_batch_verify(&messages, &signatures, &public_keys); - Ok(result.map_or_else( - |err| match err { + &data.gas_config.ed25519_batch_verify_cost + }; + let gas_info = GasInfo::with_cost(gas_cost.total_cost(signatures.len() as u64)?); + process_gas_info(data, &mut store, gas_info)?; + + let result = ed25519_batch_verify(&mut OsRng, &messages, &signatures, &public_keys); + let code = match result { + Ok(valid) => { + if valid { + ED25519_VERIFY_CODE_VALID + } else { + ED25519_VERIFY_CODE_INVALID + } + } + Err(err) => match err { CryptoError::BatchErr { .. } | CryptoError::InvalidPubkeyFormat { .. } | CryptoError::InvalidSignatureFormat { .. } | CryptoError::GenericErr { .. } => err.code(), - CryptoError::InvalidHashFormat { .. } | CryptoError::InvalidRecoveryParam { .. } => { + CryptoError::Aggregation { .. } + | CryptoError::PairingEquality { .. } + | CryptoError::InvalidHashFormat { .. } + | CryptoError::InvalidPoint { .. } + | CryptoError::InvalidRecoveryParam { .. } + | CryptoError::UnknownHashFunction { .. } => { panic!("Error must not happen for this call") } }, - |valid| (!valid).into(), - )) + }; + Ok(code) } /// Prints a debug message to console. -/// This does not charge gas, so debug printing should be disabled when used in a blockchain module. -pub fn do_debug( - env: &Environment, +/// Debug printing should be disabled when used in a blockchain module. +pub fn do_debug( + mut env: FunctionEnvMut>, message_ptr: u32, ) -> VmResult<()> { - if env.print_debug { - let message_data = read_region(&env.memory(), message_ptr, MAX_LENGTH_DEBUG)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + let message_data = read_region(data, &mut store, message_ptr, MAX_LENGTH_DEBUG)?; + + if let Some(debug_handler) = data.debug_handler() { let msg = String::from_utf8_lossy(&message_data); - println!("{}", msg); + let gas_remaining = data.get_gas_left(&mut store); + debug_handler.borrow_mut()( + &msg, + DebugInfo { + gas_remaining, + __lifetime: PhantomData, + }, + ); } Ok(()) } /// Aborts the contract and shows the given error message -pub fn do_abort( - env: &Environment, +pub fn do_abort( + mut env: FunctionEnvMut>, message_ptr: u32, ) -> VmResult<()> { - let message_data = read_region(&env.memory(), message_ptr, MAX_LENGTH_ABORT)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let message_data = read_region(data, &mut store, message_ptr, MAX_LENGTH_ABORT)?; + let string_gas_cost = GasInfo::with_cost( + data.gas_config + .string_from_bytes_cost + .total_cost(message_data.len() as u64)?, + ); + process_gas_info(data, &mut store, string_gas_cost)?; let msg = String::from_utf8_lossy(&message_data); Err(VmError::aborted(msg)) } -/// Creates a Region in the contract, writes the given data to it and returns the memory location -fn write_to_contract( - env: &Environment, - input: &[u8], -) -> VmResult { - let out_size = to_u32(input.len())?; - let result = env.call_function1("allocate", &[out_size.into()])?; - let target_ptr = ref_to_u32(&result)?; - if target_ptr == 0 { - return Err(CommunicationError::zero_address().into()); - } - write_region(&env.memory(), target_ptr, input)?; - Ok(target_ptr) -} - -pub fn do_query_chain( - env: &Environment, +pub fn do_query_chain( + mut env: FunctionEnvMut>, request_ptr: u32, ) -> VmResult { - let request = read_region(&env.memory(), request_ptr, MAX_LENGTH_QUERY_CHAIN_REQUEST)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; - let gas_remaining = env.get_gas_left(); - let (result, gas_info) = env.with_querier_from_context::<_, _>(|querier| { + let request = read_region( + data, + &mut store, + request_ptr, + MAX_LENGTH_QUERY_CHAIN_REQUEST, + )?; + + let gas_remaining = data.get_gas_left(&mut store); + let (result, gas_info) = data.with_querier_from_context::<_, _>(|querier| { Ok(querier.query_raw(&request, gas_remaining)) })?; - process_gas_info::(env, gas_info)?; + process_gas_info(data, &mut store, gas_info)?; let serialized = to_vec(&result?)?; - write_to_contract::(env, &serialized) + write_to_contract(data, &mut store, &serialized) } #[cfg(feature = "iterator")] -pub fn do_db_scan( - env: &Environment, +pub fn do_db_scan( + mut env: FunctionEnvMut>, start_ptr: u32, end_ptr: u32, order: i32, ) -> VmResult { - let start = maybe_read_region(&env.memory(), start_ptr, MAX_LENGTH_DB_KEY)?; - let end = maybe_read_region(&env.memory(), end_ptr, MAX_LENGTH_DB_KEY)?; + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let start = maybe_read_region(data, &mut store, start_ptr, MAX_LENGTH_DB_KEY)?; + let end = maybe_read_region(data, &mut store, end_ptr, MAX_LENGTH_DB_KEY)?; let order: Order = order .try_into() .map_err(|_| CommunicationError::invalid_order(order))?; - let (result, gas_info) = env.with_storage_from_context::<_, _>(|store| { + let (result, gas_info) = data.with_storage_from_context::<_, _>(|store| { Ok(store.scan(start.as_deref(), end.as_deref(), order)) })?; - process_gas_info::(env, gas_info)?; + process_gas_info(data, &mut store, gas_info)?; let iterator_id = result?; Ok(iterator_id) } #[cfg(feature = "iterator")] -pub fn do_db_next( - env: &Environment, +pub fn do_db_next( + mut env: FunctionEnvMut>, iterator_id: u32, ) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + let (result, gas_info) = - env.with_storage_from_context::<_, _>(|store| Ok(store.next(iterator_id)))?; - process_gas_info::(env, gas_info)?; + data.with_storage_from_context::<_, _>(|store| Ok(store.next(iterator_id)))?; + + process_gas_info(data, &mut store, gas_info)?; // Empty key will later be treated as _no more element_. let (key, value) = result?.unwrap_or_else(|| (Vec::::new(), Vec::::new())); let out_data = encode_sections(&[key, value])?; - write_to_contract::(env, &out_data) + write_to_contract(data, &mut store, &out_data) +} + +#[cfg(feature = "iterator")] +pub fn do_db_next_key( + mut env: FunctionEnvMut>, + iterator_id: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let (result, gas_info) = + data.with_storage_from_context::<_, _>(|store| Ok(store.next_key(iterator_id)))?; + + process_gas_info(data, &mut store, gas_info)?; + + let key = match result? { + Some(key) => key, + None => return Ok(0), + }; + + write_to_contract(data, &mut store, &key) +} + +#[cfg(feature = "iterator")] +pub fn do_db_next_value( + mut env: FunctionEnvMut>, + iterator_id: u32, +) -> VmResult { + let (data, mut store) = env.data_and_store_mut(); + + charge_host_call_gas(data, &mut store)?; + + let (result, gas_info) = + data.with_storage_from_context::<_, _>(|store| Ok(store.next_value(iterator_id)))?; + + process_gas_info(data, &mut store, gas_info)?; + + let value = match result? { + Some(value) => value, + None => return Ok(0), + }; + + write_to_contract(data, &mut store, &value) +} + +/// Creates a Region in the contract, writes the given data to it and returns the memory location +fn write_to_contract( + data: &Environment, + store: &mut impl AsStoreMut, + input: &[u8], +) -> VmResult { + let out_size = to_u32(input.len())?; + let result = data.call_function1(store, "allocate", &[out_size.into()])?; + let target_ptr = ref_to_u32(&result)?; + if target_ptr == 0 { + return Err(CommunicationError::zero_address().into()); + } + write_region(data, &mut store.as_store_mut(), target_ptr, input)?; + Ok(target_ptr) } /// Returns the data shifted by 32 bits towards the most significant bit. @@ -463,19 +1015,18 @@ fn to_low_half(data: u32) -> u64 { mod tests { use super::*; use cosmwasm_std::{ - coins, from_binary, AllBalanceResponse, BankQuery, Binary, Empty, QueryRequest, + coin, coins, from_json, BalanceResponse, BankQuery, Binary, Empty, QueryRequest, SystemError, SystemResult, WasmQuery, }; use hex_literal::hex; use std::ptr::NonNull; - use wasmer::{imports, Function, Instance as WasmerInstance}; + use wasmer::{imports, Function, FunctionEnv, Instance as WasmerInstance, Store}; - use crate::backend::{BackendError, Storage}; use crate::size::Size; use crate::testing::{MockApi, MockQuerier, MockStorage}; - use crate::wasm_backend::compile; + use crate::wasm_backend::{compile, make_compiling_engine}; - static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); // prepared data const KEY1: &[u8] = b"ant"; @@ -488,12 +1039,17 @@ mod tests { const INIT_AMOUNT: u128 = 500; const INIT_DENOM: &str = "TOKEN"; - const TESTING_GAS_LIMIT: u64 = 500_000_000_000; // ~0.5ms + const TESTING_GAS_LIMIT: u64 = 1_000_000_000; // ~1ms const TESTING_MEMORY_LIMIT: Option = Some(Size::mebi(16)); - const ECDSA_HASH_HEX: &str = "5ae8317d34d1e595e3fa7247db80c0af4320cce1116de187f8f7e2e099c0d8d0"; - const ECDSA_SIG_HEX: &str = "207082eb2c3dfa0b454e0906051270ba4074ac93760ba9e7110cd9471475111151eb0dbbc9920e72146fb564f99d039802bf6ef2561446eb126ef364d21ee9c4"; - const ECDSA_PUBKEY_HEX: &str = "04051c1ee2190ecfb174bfe4f90763f2b4ff7517b70a2aec1876ebcfd644c4633fb03f3cfbd94b1f376e34592d9d41ccaf640bb751b00a1fadeb0c01157769eb73"; + const ECDSA_P256K1_HASH_HEX: &str = + "5ae8317d34d1e595e3fa7247db80c0af4320cce1116de187f8f7e2e099c0d8d0"; + const ECDSA_P256K1_SIG_HEX: &str = "207082eb2c3dfa0b454e0906051270ba4074ac93760ba9e7110cd9471475111151eb0dbbc9920e72146fb564f99d039802bf6ef2561446eb126ef364d21ee9c4"; + const ECDSA_P256K1_PUBKEY_HEX: &str = "04051c1ee2190ecfb174bfe4f90763f2b4ff7517b70a2aec1876ebcfd644c4633fb03f3cfbd94b1f376e34592d9d41ccaf640bb751b00a1fadeb0c01157769eb73"; + const ECDSA_P256R1_HASH_HEX: &str = + "b804cf88af0c2eff8bbbfb3660ebb3294138e9d3ebd458884e19818061dacff0"; + const ECDSA_P256R1_SIG_HEX: &str = "35fb60f5ca0f3ca08542fb3cc641c8263a2cab7a90ee6a5e1583fac2bb6f6bd1ee59d81bc9db1055cc0ed97b159d8784af04e98511d0a9a407b99bb292572e96"; + const ECDSA_P256R1_PUBKEY_HEX: &str = "0474ccd8a62fba0e667c50929a53f78c21b8ff0c3c737b0b40b1750b2302b0bde829074e21f3a0ef88b9efdf10d06aa4c295cc1671f758ca0e4cd108803d0f2614"; const EDDSA_MSG_HEX: &str = ""; const EDDSA_SIG_HEX: &str = "e5564300c360ac729086e2cc806e828a84877f1eb8e5d974d873e065224901555fb8821590a33bacc61e39701cf9b46bd25bf5f0595bbe24655141438e7a100b"; @@ -503,44 +1059,77 @@ mod tests { fn make_instance( api: MockApi, ) -> ( - Environment, + FunctionEnv>, + Store, Box, ) { let gas_limit = TESTING_GAS_LIMIT; - let env = Environment::new(api, gas_limit, false); + let env = Environment::new(api, gas_limit); + + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = compile(&engine, HACKATOM).unwrap(); + let mut store = Store::new(engine); + + let fe = FunctionEnv::new(&mut store, env); - let module = compile(CONTRACT, TESTING_MEMORY_LIMIT, &[]).unwrap(); - let store = module.store(); // we need stubs for all required imports let import_obj = imports! { "env" => { - "db_read" => Function::new_native(store, |_a: u32| -> u32 { 0 }), - "db_write" => Function::new_native(store, |_a: u32, _b: u32| {}), - "db_remove" => Function::new_native(store, |_a: u32| {}), - "db_scan" => Function::new_native(store, |_a: u32, _b: u32, _c: i32| -> u32 { 0 }), - "db_next" => Function::new_native(store, |_a: u32| -> u32 { 0 }), - "query_chain" => Function::new_native(store, |_a: u32| -> u32 { 0 }), - "addr_validate" => Function::new_native(store, |_a: u32| -> u32 { 0 }), - "addr_canonicalize" => Function::new_native(store, |_a: u32, _b: u32| -> u32 { 0 }), - "addr_humanize" => Function::new_native(store, |_a: u32, _b: u32| -> u32 { 0 }), - "secp256k1_verify" => Function::new_native(store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), - "secp256k1_recover_pubkey" => Function::new_native(store, |_a: u32, _b: u32, _c: u32| -> u64 { 0 }), - "ed25519_verify" => Function::new_native(store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), - "ed25519_batch_verify" => Function::new_native(store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), - "debug" => Function::new_native(store, |_a: u32| {}), + "db_read" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "db_write" => Function::new_typed(&mut store, |_a: u32, _b: u32| {}), + "db_remove" => Function::new_typed(&mut store, |_a: u32| {}), + "db_scan" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: i32| -> u32 { 0 }), + "db_next" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "db_next_key" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "db_next_value" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "query_chain" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "addr_validate" => Function::new_typed(&mut store, |_a: u32| -> u32 { 0 }), + "addr_canonicalize" => Function::new_typed(&mut store, |_a: u32, _b: u32| -> u32 { 0 }), + "addr_humanize" => Function::new_typed(&mut store, |_a: u32, _b: u32| -> u32 { 0 }), + "bls12_381_aggregate_g1" => Function::new_typed(&mut store, |_a: u32, _b: u32| -> u32 { 0 }), + "bls12_381_aggregate_g2" => Function::new_typed(&mut store, |_a: u32, _b: u32| -> u32 { 0 }), + "bls12_381_pairing_equality" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32, _d: u32| -> u32 { 0 }), + "bls12_381_hash_to_g1" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32, _d: u32| -> u32 { 0 }), + "bls12_381_hash_to_g2" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32, _d: u32| -> u32 { 0 }), + "secp256k1_verify" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), + "secp256k1_recover_pubkey" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u64 { 0 }), + "secp256r1_verify" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), + "secp256r1_recover_pubkey" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u64 { 0 }), + "ed25519_verify" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), + "ed25519_batch_verify" => Function::new_typed(&mut store, |_a: u32, _b: u32, _c: u32| -> u32 { 0 }), + "debug" => Function::new_typed(&mut store, |_a: u32| {}), + "abort" => Function::new_typed(&mut store, |_a: u32| {}), }, }; - let instance = Box::from(WasmerInstance::new(&module, &import_obj).unwrap()); + let wasmer_instance = + Box::from(WasmerInstance::new(&mut store, &module, &import_obj).unwrap()); + let memory = wasmer_instance + .exports + .get_memory("memory") + .unwrap() + .clone(); + + fe.as_mut(&mut store).memory = Some(memory); + + let instance_ptr = NonNull::from(wasmer_instance.as_ref()); + + { + let mut fe_mut = fe.clone().into_mut(&mut store); + let (env, mut store) = fe_mut.data_and_store_mut(); - let instance_ptr = NonNull::from(instance.as_ref()); - env.set_wasmer_instance(Some(instance_ptr)); - env.set_gas_left(gas_limit); - env.set_storage_readonly(false); + env.set_wasmer_instance(Some(instance_ptr)); + env.set_gas_left(&mut store, gas_limit); + env.set_storage_readonly(false); + } - (env, instance) + (fe, store, wasmer_instance) } - fn leave_default_data(env: &Environment) { + fn leave_default_data( + fe_mut: &mut FunctionEnvMut>, + ) { + let (env, _store) = fe_mut.data_and_store_mut(); + // create some mock data let mut storage = MockStorage::new(); storage.set(KEY1, VALUE1).0.expect("error setting"); @@ -550,88 +1139,106 @@ mod tests { env.move_in(storage, querier); } - fn write_data(env: &Environment, data: &[u8]) -> u32 { + fn write_data( + fe_mut: &mut FunctionEnvMut>, + data: &[u8], + ) -> u32 { + let (env, mut store) = fe_mut.data_and_store_mut(); + let result = env - .call_function1("allocate", &[(data.len() as u32).into()]) + .call_function1(&mut store, "allocate", &[(data.len() as u32).into()]) .unwrap(); let region_ptr = ref_to_u32(&result).unwrap(); - write_region(&env.memory(), region_ptr, data).expect("error writing"); + write_region(env, &mut store, region_ptr, data).expect("error writing"); region_ptr } - fn create_empty(wasmer_instance: &mut WasmerInstance, capacity: u32) -> u32 { + fn create_empty( + wasmer_instance: &WasmerInstance, + fe_mut: &mut FunctionEnvMut>, + capacity: u32, + ) -> u32 { + let (_, mut store) = fe_mut.data_and_store_mut(); let allocate = wasmer_instance .exports .get_function("allocate") .expect("error getting function"); let result = allocate - .call(&[capacity.into()]) + .call(&mut store, &[capacity.into()]) .expect("error calling allocate"); ref_to_u32(&result[0]).expect("error converting result") } /// A Region reader that is just good enough for the tests in this file fn force_read( - env: &Environment, + fe_mut: &mut FunctionEnvMut>, region_ptr: u32, ) -> Vec { - read_region(&env.memory(), region_ptr, 5000).unwrap() + let (env, mut store) = fe_mut.data_and_store_mut(); + + read_region(env, &mut store, region_ptr, 5000).unwrap() } #[test] fn do_db_read_works() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); - leave_default_data(&env); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + leave_default_data(&mut fe_mut); - let key_ptr = write_data(&env, KEY1); - let result = do_db_read(&env, key_ptr); + let key_ptr = write_data(&mut fe_mut, KEY1); + let result = do_db_read(fe_mut.as_mut(), key_ptr); let value_ptr = result.unwrap(); assert!(value_ptr > 0); - assert_eq!(force_read(&env, value_ptr as u32), VALUE1); + leave_default_data(&mut fe_mut); + assert_eq!(force_read(&mut fe_mut, value_ptr), VALUE1); } #[test] fn do_db_read_works_for_non_existent_key() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); - leave_default_data(&env); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + leave_default_data(&mut fe_mut); - let key_ptr = write_data(&env, b"I do not exist in storage"); - let result = do_db_read(&env, key_ptr); + let key_ptr = write_data(&mut fe_mut, b"I do not exist in storage"); + let result = do_db_read(fe_mut, key_ptr); assert_eq!(result.unwrap(), 0); } #[test] fn do_db_read_fails_for_large_key() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); - leave_default_data(&env); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + leave_default_data(&mut fe_mut); - let key_ptr = write_data(&env, &vec![7u8; 300 * 1024]); - let result = do_db_read(&env, key_ptr); + let key_ptr = write_data(&mut fe_mut, &vec![7u8; 300 * 1024]); + let result = do_db_read(fe_mut, key_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionLengthTooBig { length, .. }, .. } => assert_eq!(length, 300 * 1024), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_db_write_works() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let key_ptr = write_data(&env, b"new storage key"); - let value_ptr = write_data(&env, b"new value"); + let key_ptr = write_data(&mut fe_mut, b"new storage key"); + let value_ptr = write_data(&mut fe_mut, b"new value"); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - do_db_write(&env, key_ptr, value_ptr).unwrap(); + do_db_write(fe_mut.as_mut(), key_ptr, value_ptr).unwrap(); - let val = env + let val = fe_mut + .data() .with_storage_from_context::<_, _>(|store| { Ok(store .get(b"new storage key") @@ -645,16 +1252,18 @@ mod tests { #[test] fn do_db_write_can_override() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let key_ptr = write_data(&env, KEY1); - let value_ptr = write_data(&env, VALUE2); + let key_ptr = write_data(&mut fe_mut, KEY1); + let value_ptr = write_data(&mut fe_mut, VALUE2); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - do_db_write(&env, key_ptr, value_ptr).unwrap(); + do_db_write(fe_mut.as_mut(), key_ptr, value_ptr).unwrap(); - let val = env + let val = fe_mut + .data() .with_storage_from_context::<_, _>(|store| { Ok(store.get(KEY1).0.expect("error getting value")) }) @@ -665,16 +1274,18 @@ mod tests { #[test] fn do_db_write_works_for_empty_value() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let key_ptr = write_data(&env, b"new storage key"); - let value_ptr = write_data(&env, b""); + let key_ptr = write_data(&mut fe_mut, b"new storage key"); + let value_ptr = write_data(&mut fe_mut, b""); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - do_db_write(&env, key_ptr, value_ptr).unwrap(); + do_db_write(fe_mut.as_mut(), key_ptr, value_ptr).unwrap(); - let val = env + let val = fe_mut + .data() .with_storage_from_context::<_, _>(|store| { Ok(store .get(b"new storage key") @@ -688,98 +1299,85 @@ mod tests { #[test] fn do_db_write_fails_for_large_key() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let key_ptr = write_data(&env, &vec![4u8; 300 * 1024]); - let value_ptr = write_data(&env, b"new value"); + const KEY_SIZE: usize = 300 * 1024; + let key_ptr = write_data(&mut fe_mut, &vec![4u8; KEY_SIZE]); + let value_ptr = write_data(&mut fe_mut, b"new value"); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_db_write(&env, key_ptr, value_ptr); - match result.unwrap_err() { - VmError::CommunicationErr { - source: - CommunicationError::RegionLengthTooBig { - length, max_length, .. - }, - .. - } => { - assert_eq!(length, 300 * 1024); - assert_eq!(max_length, MAX_LENGTH_DB_KEY); - } - err => panic!("unexpected error: {:?}", err), - }; + let result = do_db_write(fe_mut, key_ptr, value_ptr); + assert_eq!(result.unwrap_err().to_string(), format!("Generic error: Key too big. Tried to write {KEY_SIZE} bytes to storage, limit is {MAX_LENGTH_DB_KEY}.")); } #[test] fn do_db_write_fails_for_large_value() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let key_ptr = write_data(&env, b"new storage key"); - let value_ptr = write_data(&env, &vec![5u8; 300 * 1024]); + const VAL_SIZE: usize = 300 * 1024; + let key_ptr = write_data(&mut fe_mut, b"new storage key"); + let value_ptr = write_data(&mut fe_mut, &vec![5u8; VAL_SIZE]); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_db_write(&env, key_ptr, value_ptr); - match result.unwrap_err() { - VmError::CommunicationErr { - source: - CommunicationError::RegionLengthTooBig { - length, max_length, .. - }, - .. - } => { - assert_eq!(length, 300 * 1024); - assert_eq!(max_length, MAX_LENGTH_DB_VALUE); - } - err => panic!("unexpected error: {:?}", err), - }; + let result = do_db_write(fe_mut, key_ptr, value_ptr); + assert_eq!(result.unwrap_err().to_string(), format!("Generic error: Value too big. Tried to write {VAL_SIZE} bytes to storage, limit is {MAX_LENGTH_DB_VALUE}.")); } #[test] fn do_db_write_is_prohibited_in_readonly_contexts() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let key_ptr = write_data(&env, b"new storage key"); - let value_ptr = write_data(&env, b"new value"); + let key_ptr = write_data(&mut fe_mut, b"new storage key"); + let value_ptr = write_data(&mut fe_mut, b"new value"); - leave_default_data(&env); - env.set_storage_readonly(true); + leave_default_data(&mut fe_mut); + fe_mut.data().set_storage_readonly(true); - let result = do_db_write(&env, key_ptr, value_ptr); + let result = do_db_write(fe_mut, key_ptr, value_ptr); match result.unwrap_err() { VmError::WriteAccessDenied { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_db_remove_works() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let existing_key = KEY1; - let key_ptr = write_data(&env, existing_key); + let key_ptr = write_data(&mut fe_mut, existing_key); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - env.with_storage_from_context::<_, _>(|store| { - println!("{:?}", store); - Ok(()) - }) - .unwrap(); + fe_mut + .data() + .with_storage_from_context::<_, _>(|store| { + println!("{store:?}"); + Ok(()) + }) + .unwrap(); - do_db_remove(&env, key_ptr).unwrap(); + do_db_remove(fe_mut.as_mut(), key_ptr).unwrap(); - env.with_storage_from_context::<_, _>(|store| { - println!("{:?}", store); - Ok(()) - }) - .unwrap(); + fe_mut + .data() + .with_storage_from_context::<_, _>(|store| { + println!("{store:?}"); + Ok(()) + }) + .unwrap(); - let value = env + let value = fe_mut + .data() .with_storage_from_context::<_, _>(|store| { Ok(store.get(existing_key).0.expect("error getting value")) }) @@ -790,17 +1388,19 @@ mod tests { #[test] fn do_db_remove_works_for_non_existent_key() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let non_existent_key = b"I do not exist"; - let key_ptr = write_data(&env, non_existent_key); + let key_ptr = write_data(&mut fe_mut, non_existent_key); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - // Note: right now we cannot differnetiate between an existent and a non-existent key - do_db_remove(&env, key_ptr).unwrap(); + // Note: right now we cannot differentiate between an existent and a non-existent key + do_db_remove(fe_mut.as_mut(), key_ptr).unwrap(); - let value = env + let value = fe_mut + .data() .with_storage_from_context::<_, _>(|store| { Ok(store.get(non_existent_key).0.expect("error getting value")) }) @@ -811,13 +1411,14 @@ mod tests { #[test] fn do_db_remove_fails_for_large_key() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let key_ptr = write_data(&env, &vec![26u8; 300 * 1024]); + let key_ptr = write_data(&mut fe_mut, &vec![26u8; 300 * 1024]); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_db_remove(&env, key_ptr); + let result = do_db_remove(fe_mut, key_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: @@ -829,101 +1430,103 @@ mod tests { assert_eq!(length, 300 * 1024); assert_eq!(max_length, MAX_LENGTH_DB_KEY); } - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), }; } #[test] fn do_db_remove_is_prohibited_in_readonly_contexts() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let key_ptr = write_data(&env, b"a storage key"); + let key_ptr = write_data(&mut fe_mut, b"a storage key"); - leave_default_data(&env); - env.set_storage_readonly(true); + leave_default_data(&mut fe_mut); + fe_mut.data().set_storage_readonly(true); - let result = do_db_remove(&env, key_ptr); + let result = do_db_remove(fe_mut, key_ptr); match result.unwrap_err() { VmError::WriteAccessDenied { .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_addr_validate_works() { - let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let api = MockApi::default().with_prefix("osmo"); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr1 = write_data(&env, b"foo"); - let source_ptr2 = write_data(&env, b"eth1n48g2mjh9ezz7zjtya37wtgg5r5emr0drkwlgw"); + let source_ptr1 = write_data(&mut fe_mut, b"osmo186kh7c0k0gh4ww0wh4jqc4yhzu7n7dhswe845d"); + let source_ptr2 = write_data(&mut fe_mut, b"osmo18enxpg25jc4zkwe7w00yneva0vztwuex3rtv8t"); - let res = do_addr_validate(&env, source_ptr1).unwrap(); + let res = do_addr_validate(fe_mut.as_mut(), source_ptr1).unwrap(); assert_eq!(res, 0); - let res = do_addr_validate(&env, source_ptr2).unwrap(); + let res = do_addr_validate(fe_mut.as_mut(), source_ptr2).unwrap(); assert_eq!(res, 0); } #[test] fn do_addr_validate_reports_invalid_input_back_to_contract() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr1 = write_data(&env, b"fo\x80o"); // invalid UTF-8 (fo�o) - let source_ptr2 = write_data(&env, b""); // empty - let source_ptr3 = write_data(&env, b"addressexceedingaddressspacesuperlongreallylongiamensuringthatitislongerthaneverything"); // too long - let source_ptr4 = write_data(&env, b"fooBar"); // Not normalized. The definition of normalized is chain-dependent but the MockApi requires lower case. + let source_ptr1 = write_data(&mut fe_mut, b"cosmwasm\x80o"); // invalid UTF-8 (cosmwasm�o) + let source_ptr2 = write_data(&mut fe_mut, b""); // empty + let source_ptr3 = write_data( + &mut fe_mut, + b"cosmwasm1h34LMPYwh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp", + ); // Not normalized. The definition of normalized is chain-dependent but the MockApi disallows mixed case. - let res = do_addr_validate(&env, source_ptr1).unwrap(); + let res = do_addr_validate(fe_mut.as_mut(), source_ptr1).unwrap(); assert_ne!(res, 0); - let err = String::from_utf8(force_read(&env, res)).unwrap(); + let err = String::from_utf8(force_read(&mut fe_mut, res)).unwrap(); assert_eq!(err, "Input is not valid UTF-8"); - let res = do_addr_validate(&env, source_ptr2).unwrap(); + let res = do_addr_validate(fe_mut.as_mut(), source_ptr2).unwrap(); assert_ne!(res, 0); - let err = String::from_utf8(force_read(&env, res)).unwrap(); + let err = String::from_utf8(force_read(&mut fe_mut, res)).unwrap(); assert_eq!(err, "Input is empty"); - let res = do_addr_validate(&env, source_ptr3).unwrap(); - assert_ne!(res, 0); - let err = String::from_utf8(force_read(&env, res)).unwrap(); - assert_eq!(err, "Invalid input: human address too long"); - - let res = do_addr_validate(&env, source_ptr4).unwrap(); + let res = do_addr_validate(fe_mut.as_mut(), source_ptr3).unwrap(); assert_ne!(res, 0); - let err = String::from_utf8(force_read(&env, res)).unwrap(); - assert_eq!(err, "Address is not normalized"); + let err = String::from_utf8(force_read(&mut fe_mut, res)).unwrap(); + assert_eq!(err, "Error decoding bech32"); } #[test] fn do_addr_validate_fails_for_broken_backend() { let api = MockApi::new_failing("Temporarily unavailable"); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, b"foo"); + let source_ptr = write_data(&mut fe_mut, b"foo"); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_addr_validate(&env, source_ptr); + let result = do_addr_validate(fe_mut, source_ptr); match result.unwrap_err() { VmError::BackendErr { source: BackendError::Unknown { msg, .. }, .. } => assert_eq!(msg, "Temporarily unavailable"), - err => panic!("Incorrect error returned: {:?}", err), + err => panic!("Incorrect error returned: {err:?}"), } } #[test] fn do_addr_validate_fails_for_large_inputs() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, &[61; 333]); + let source_ptr = write_data(&mut fe_mut, &[61; 333]); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_addr_validate(&env, source_ptr); + let result = do_addr_validate(fe_mut, source_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: @@ -935,87 +1538,88 @@ mod tests { assert_eq!(length, 333); assert_eq!(max_length, 256); } - err => panic!("Incorrect error returned: {:?}", err), + err => panic!("Incorrect error returned: {err:?}"), } } + const CANONICAL_ADDRESS_BUFFER_LENGTH: u32 = 64; + #[test] fn do_addr_canonicalize_works() { let api = MockApi::default(); - let (env, mut instance) = make_instance(api); - let api = MockApi::default(); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, b"foo"); - let dest_ptr = create_empty(&mut instance, api.canonical_length() as u32); + let source_ptr = write_data( + &mut fe_mut, + b"cosmwasm1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp", + ); + let dest_ptr = create_empty(&instance, &mut fe_mut, CANONICAL_ADDRESS_BUFFER_LENGTH); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let api = MockApi::default(); - let res = do_addr_canonicalize(&env, source_ptr, dest_ptr).unwrap(); + let res = do_addr_canonicalize(fe_mut.as_mut(), source_ptr, dest_ptr).unwrap(); assert_eq!(res, 0); - let data = force_read(&env, dest_ptr); - assert_eq!(data.len(), api.canonical_length()); + let data = force_read(&mut fe_mut, dest_ptr); + assert_eq!(data.len(), 32); } #[test] fn do_addr_canonicalize_reports_invalid_input_back_to_contract() { let api = MockApi::default(); - let (env, mut instance) = make_instance(api); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr1 = write_data(&env, b"fo\x80o"); // invalid UTF-8 (fo�o) - let source_ptr2 = write_data(&env, b""); // empty - let source_ptr3 = write_data(&env, b"addressexceedingaddressspacesuperlongreallylongiamensuringthatitislongerthaneverything"); // too long - let dest_ptr = create_empty(&mut instance, 70); + let source_ptr1 = write_data(&mut fe_mut, b"cosmwasm\x80o"); // invalid UTF-8 (cosmwasm�o) + let source_ptr2 = write_data(&mut fe_mut, b""); // empty + let dest_ptr = create_empty(&instance, &mut fe_mut, 70); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let res = do_addr_canonicalize(&env, source_ptr1, dest_ptr).unwrap(); + let res = do_addr_canonicalize(fe_mut.as_mut(), source_ptr1, dest_ptr).unwrap(); assert_ne!(res, 0); - let err = String::from_utf8(force_read(&env, res)).unwrap(); + let err = String::from_utf8(force_read(&mut fe_mut, res)).unwrap(); assert_eq!(err, "Input is not valid UTF-8"); - let res = do_addr_canonicalize(&env, source_ptr2, dest_ptr).unwrap(); + let res = do_addr_canonicalize(fe_mut.as_mut(), source_ptr2, dest_ptr).unwrap(); assert_ne!(res, 0); - let err = String::from_utf8(force_read(&env, res)).unwrap(); + let err = String::from_utf8(force_read(&mut fe_mut, res)).unwrap(); assert_eq!(err, "Input is empty"); - - let res = do_addr_canonicalize(&env, source_ptr3, dest_ptr).unwrap(); - assert_ne!(res, 0); - let err = String::from_utf8(force_read(&env, res)).unwrap(); - assert_eq!(err, "Invalid input: human address too long"); } #[test] fn do_addr_canonicalize_fails_for_broken_backend() { let api = MockApi::new_failing("Temporarily unavailable"); - let (env, mut instance) = make_instance(api); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, b"foo"); - let dest_ptr = create_empty(&mut instance, 7); + let source_ptr = write_data(&mut fe_mut, b"foo"); + let dest_ptr = create_empty(&instance, &mut fe_mut, 7); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_addr_canonicalize(&env, source_ptr, dest_ptr); + let result = do_addr_canonicalize(fe_mut.as_mut(), source_ptr, dest_ptr); match result.unwrap_err() { VmError::BackendErr { source: BackendError::Unknown { msg, .. }, .. } => assert_eq!(msg, "Temporarily unavailable"), - err => panic!("Incorrect error returned: {:?}", err), + err => panic!("Incorrect error returned: {err:?}"), } } #[test] fn do_addr_canonicalize_fails_for_large_inputs() { let api = MockApi::default(); - let (env, mut instance) = make_instance(api); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, &[61; 333]); - let dest_ptr = create_empty(&mut instance, 8); + let source_ptr = write_data(&mut fe_mut, &[61; 333]); + let dest_ptr = create_empty(&instance, &mut fe_mut, 8); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_addr_canonicalize(&env, source_ptr, dest_ptr); + let result = do_addr_canonicalize(fe_mut.as_mut(), source_ptr, dest_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: @@ -1027,97 +1631,101 @@ mod tests { assert_eq!(length, 333); assert_eq!(max_length, 256); } - err => panic!("Incorrect error returned: {:?}", err), + err => panic!("Incorrect error returned: {err:?}"), } } #[test] fn do_addr_canonicalize_fails_for_small_destination_region() { - let api = MockApi::default(); - let (env, mut instance) = make_instance(api); + let api = MockApi::default().with_prefix("osmo"); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, b"foo"); - let dest_ptr = create_empty(&mut instance, 7); + let source_ptr = write_data(&mut fe_mut, b"osmo18enxpg25jc4zkwe7w00yneva0vztwuex3rtv8t"); + let dest_ptr = create_empty(&instance, &mut fe_mut, 7); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_addr_canonicalize(&env, source_ptr, dest_ptr); + let result = do_addr_canonicalize(fe_mut, source_ptr, dest_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionTooSmall { size, required, .. }, .. } => { assert_eq!(size, 7); - assert_eq!(required, api.canonical_length()); + assert_eq!(required, 20); } - err => panic!("Incorrect error returned: {:?}", err), + err => panic!("Incorrect error returned: {err:?}"), } } #[test] fn do_addr_humanize_works() { let api = MockApi::default(); - let (env, mut instance) = make_instance(api); - let api = MockApi::default(); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_data = vec![0x22; api.canonical_length()]; - let source_ptr = write_data(&env, &source_data); - let dest_ptr = create_empty(&mut instance, 70); + let source_data = vec![0x22; CANONICAL_ADDRESS_BUFFER_LENGTH as usize]; + let source_ptr = write_data(&mut fe_mut, &source_data); + let dest_ptr = create_empty(&instance, &mut fe_mut, 118); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let error_ptr = do_addr_humanize(&env, source_ptr, dest_ptr).unwrap(); + let error_ptr = do_addr_humanize(fe_mut.as_mut(), source_ptr, dest_ptr).unwrap(); assert_eq!(error_ptr, 0); - assert_eq!(force_read(&env, dest_ptr), source_data); + assert_eq!(force_read(&mut fe_mut, dest_ptr), b"cosmwasm1yg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygsegeksq"); } #[test] fn do_addr_humanize_reports_invalid_input_back_to_contract() { let api = MockApi::default(); - let (env, mut instance) = make_instance(api); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, b"foo"); // too short - let dest_ptr = create_empty(&mut instance, 70); + let source_ptr = write_data(&mut fe_mut, b""); // too short + let dest_ptr = create_empty(&instance, &mut fe_mut, 70); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let res = do_addr_humanize(&env, source_ptr, dest_ptr).unwrap(); + let res = do_addr_humanize(fe_mut.as_mut(), source_ptr, dest_ptr).unwrap(); assert_ne!(res, 0); - let err = String::from_utf8(force_read(&env, res)).unwrap(); - assert_eq!(err, "Invalid input: canonical address length not correct"); + let err = String::from_utf8(force_read(&mut fe_mut, res)).unwrap(); + assert_eq!(err, "Invalid canonical address length"); } #[test] fn do_addr_humanize_fails_for_broken_backend() { let api = MockApi::new_failing("Temporarily unavailable"); - let (env, mut instance) = make_instance(api); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, b"foo\0\0\0\0\0"); - let dest_ptr = create_empty(&mut instance, 70); + let source_ptr = write_data(&mut fe_mut, b"foo\0\0\0\0\0"); + let dest_ptr = create_empty(&instance, &mut fe_mut, 70); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_addr_humanize(&env, source_ptr, dest_ptr); + let result = do_addr_humanize(fe_mut, source_ptr, dest_ptr); match result.unwrap_err() { VmError::BackendErr { source: BackendError::Unknown { msg, .. }, .. } => assert_eq!(msg, "Temporarily unavailable"), - err => panic!("Incorrect error returned: {:?}", err), + err => panic!("Incorrect error returned: {err:?}"), }; } #[test] fn do_addr_humanize_fails_for_input_too_long() { let api = MockApi::default(); - let (env, mut instance) = make_instance(api); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_ptr = write_data(&env, &[61; 65]); - let dest_ptr = create_empty(&mut instance, 70); + let source_ptr = write_data(&mut fe_mut, &[61; 65]); + let dest_ptr = create_empty(&instance, &mut fe_mut, 70); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_addr_humanize(&env, source_ptr, dest_ptr); + let result = do_addr_humanize(fe_mut, source_ptr, dest_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: @@ -1129,49 +1737,50 @@ mod tests { assert_eq!(length, 65); assert_eq!(max_length, 64); } - err => panic!("Incorrect error returned: {:?}", err), + err => panic!("Incorrect error returned: {err:?}"), } } #[test] fn do_addr_humanize_fails_for_destination_region_too_small() { let api = MockApi::default(); - let (env, mut instance) = make_instance(api); - let api = MockApi::default(); + let (fe, mut store, instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let source_data = vec![0x22; api.canonical_length()]; - let source_ptr = write_data(&env, &source_data); - let dest_ptr = create_empty(&mut instance, 2); + let source_data = vec![0x22; CANONICAL_ADDRESS_BUFFER_LENGTH as usize]; + let source_ptr = write_data(&mut fe_mut, &source_data); + let dest_ptr = create_empty(&instance, &mut fe_mut, 2); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let result = do_addr_humanize(&env, source_ptr, dest_ptr); + let result = do_addr_humanize(fe_mut, source_ptr, dest_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionTooSmall { size, required, .. }, .. } => { assert_eq!(size, 2); - assert_eq!(required, api.canonical_length()); + assert_eq!(required, 118); } - err => panic!("Incorrect error returned: {:?}", err), + err => panic!("Incorrect error returned: {err:?}"), } } #[test] fn do_secp256k1_verify_works() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); - let pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 0 ); } @@ -1179,19 +1788,20 @@ mod tests { #[test] fn do_secp256k1_verify_wrong_hash_verify_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let mut hash = hex::decode(ECDSA_HASH_HEX).unwrap(); + let mut hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); // alter hash hash[0] ^= 0x01; - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); - let pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 1 ); } @@ -1199,43 +1809,45 @@ mod tests { #[test] fn do_secp256k1_verify_larger_hash_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let mut hash = hex::decode(ECDSA_HASH_HEX).unwrap(); + let mut hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); // extend / break hash hash.push(0x00); - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); - let pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); - let result = do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr); + let result = do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionLengthTooBig { length, .. }, .. } => assert_eq!(length, MESSAGE_HASH_MAX_LEN + 1), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_secp256k1_verify_shorter_hash_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let mut hash = hex::decode(ECDSA_HASH_HEX).unwrap(); + let mut hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); // reduce / break hash hash.pop(); - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); - let pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 3 // mapped InvalidHashFormat ); } @@ -1243,19 +1855,20 @@ mod tests { #[test] fn do_secp256k1_verify_wrong_sig_verify_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let mut sig = hex::decode(ECDSA_SIG_HEX).unwrap(); + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let mut sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); // alter sig sig[0] ^= 0x01; - let sig_ptr = write_data(&env, &sig); - let pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 1 ); } @@ -1263,43 +1876,45 @@ mod tests { #[test] fn do_secp256k1_verify_larger_sig_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let mut sig = hex::decode(ECDSA_SIG_HEX).unwrap(); + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let mut sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); // extend / break sig sig.push(0x00); - let sig_ptr = write_data(&env, &sig); - let pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); - let result = do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr); + let result = do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionLengthTooBig { length, .. }, .. } => assert_eq!(length, ECDSA_SIGNATURE_LEN + 1), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_secp256k1_verify_shorter_sig_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let mut sig = hex::decode(ECDSA_SIG_HEX).unwrap(); + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let mut sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); // reduce / break sig sig.pop(); - let sig_ptr = write_data(&env, &sig); - let pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 4 // mapped InvalidSignatureFormat ) } @@ -1307,19 +1922,20 @@ mod tests { #[test] fn do_secp256k1_verify_wrong_pubkey_format_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); - - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); - let mut pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let mut pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); // alter pubkey format pubkey[0] ^= 0x01; - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 5 // mapped InvalidPubkeyFormat ) } @@ -1327,19 +1943,20 @@ mod tests { #[test] fn do_secp256k1_verify_wrong_pubkey_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); - - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); - let mut pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let mut pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); // alter pubkey pubkey[1] ^= 0x01; - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 10 // mapped GenericErr ) } @@ -1347,43 +1964,45 @@ mod tests { #[test] fn do_secp256k1_verify_larger_pubkey_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); - - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); - let mut pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let mut pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); // extend / break pubkey pubkey.push(0x00); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); - let result = do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr); + let result = do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionLengthTooBig { length, .. }, .. } => assert_eq!(length, ECDSA_PUBKEY_MAX_LEN + 1), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_secp256k1_verify_shorter_pubkey_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); - - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); - let mut pubkey = hex::decode(ECDSA_PUBKEY_HEX).unwrap(); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let mut pubkey = hex::decode(ECDSA_P256K1_PUBKEY_HEX).unwrap(); // reduce / break pubkey pubkey.pop(); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 5 // mapped InvalidPubkeyFormat ) } @@ -1391,17 +2010,18 @@ mod tests { #[test] fn do_secp256k1_verify_empty_pubkey_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let hash = hex::decode(ECDSA_HASH_HEX).unwrap(); - let hash_ptr = write_data(&env, &hash); - let sig = hex::decode(ECDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); + let hash = hex::decode(ECDSA_P256K1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256K1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = vec![]; - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 5 // mapped InvalidPubkeyFormat ) } @@ -1409,17 +2029,18 @@ mod tests { #[test] fn do_secp256k1_verify_wrong_data_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let hash = vec![0x22; MESSAGE_HASH_MAX_LEN]; - let hash_ptr = write_data(&env, &hash); + let hash_ptr = write_data(&mut fe_mut, &hash); let sig = vec![0x22; ECDSA_SIGNATURE_LEN]; - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = vec![0x04; ECDSA_PUBKEY_MAX_LEN]; - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_secp256k1_verify(&env, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_secp256k1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), 10 // mapped GenericErr ) } @@ -1427,7 +2048,8 @@ mod tests { #[test] fn do_secp256k1_recover_pubkey_works() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); // https://gist.github.com/webmaster128/130b628d83621a33579751846699ed15 let hash = hex!("5ae8317d34d1e595e3fa7247db80c0af4320cce1116de187f8f7e2e099c0d8d0"); @@ -1435,29 +2057,333 @@ mod tests { let recovery_param = 1; let expected = hex!("044a071e8a6e10aada2b8cf39fa3b5fb3400b04e99ea8ae64ceea1a977dbeaf5d5f8c8fbd10b71ab14cd561f7df8eb6da50f8a8d81ba564342244d26d1d4211595"); - let hash_ptr = write_data(&env, &hash); - let sig_ptr = write_data(&env, &sig); - let result = do_secp256k1_recover_pubkey(&env, hash_ptr, sig_ptr, recovery_param).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig_ptr = write_data(&mut fe_mut, &sig); + let result = + do_secp256k1_recover_pubkey(fe_mut.as_mut(), hash_ptr, sig_ptr, recovery_param) + .unwrap(); + let error = result >> 32; + let pubkey_ptr: u32 = (result & 0xFFFFFFFF).try_into().unwrap(); + assert_eq!(error, 0); + assert_eq!(force_read(&mut fe_mut, pubkey_ptr), expected); + } + + #[test] + fn do_secp256r1_verify_works() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 0 + ); + } + + #[test] + fn do_secp256r1_verify_wrong_hash_verify_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let mut hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + // alter hash + hash[0] ^= 0x01; + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 1 + ); + } + + #[test] + fn do_secp256r1_verify_larger_hash_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let mut hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + // extend / break hash + hash.push(0x00); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + let result = do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr); + match result.unwrap_err() { + VmError::CommunicationErr { + source: CommunicationError::RegionLengthTooBig { length, .. }, + .. + } => assert_eq!(length, MESSAGE_HASH_MAX_LEN + 1), + e => panic!("Unexpected error: {e:?}"), + } + } + + #[test] + fn do_secp256r1_verify_shorter_hash_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let mut hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + // reduce / break hash + hash.pop(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 3 // mapped InvalidHashFormat + ); + } + + #[test] + fn do_secp256r1_verify_wrong_sig_verify_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let mut sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + // alter sig + sig[0] ^= 0x01; + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 1 + ); + } + + #[test] + fn do_secp256r1_verify_larger_sig_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let mut sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + // extend / break sig + sig.push(0x00); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + let result = do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr); + match result.unwrap_err() { + VmError::CommunicationErr { + source: CommunicationError::RegionLengthTooBig { length, .. }, + .. + } => assert_eq!(length, ECDSA_SIGNATURE_LEN + 1), + e => panic!("Unexpected error: {e:?}"), + } + } + + #[test] + fn do_secp256r1_verify_shorter_sig_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let mut sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + // reduce / break sig + sig.pop(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 4 // mapped InvalidSignatureFormat + ) + } + + #[test] + fn do_secp256r1_verify_wrong_pubkey_format_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let mut pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + // alter pubkey format + pubkey[0] ^= 0x01; + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 5 // mapped InvalidPubkeyFormat + ) + } + + #[test] + fn do_secp256r1_verify_wrong_pubkey_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let mut pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + // alter pubkey + pubkey[1] ^= 0x01; + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 10 // mapped GenericErr + ) + } + + #[test] + fn do_secp256r1_verify_larger_pubkey_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let mut pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + // extend / break pubkey + pubkey.push(0x00); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + let result = do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr); + match result.unwrap_err() { + VmError::CommunicationErr { + source: CommunicationError::RegionLengthTooBig { length, .. }, + .. + } => assert_eq!(length, ECDSA_PUBKEY_MAX_LEN + 1), + e => panic!("Unexpected error: {e:?}"), + } + } + + #[test] + fn do_secp256r1_verify_shorter_pubkey_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let mut pubkey = hex::decode(ECDSA_P256R1_PUBKEY_HEX).unwrap(); + // reduce / break pubkey + pubkey.pop(); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 5 // mapped InvalidPubkeyFormat + ) + } + + #[test] + fn do_secp256r1_verify_empty_pubkey_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex::decode(ECDSA_P256R1_HASH_HEX).unwrap(); + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = hex::decode(ECDSA_P256R1_SIG_HEX).unwrap(); + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = vec![]; + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 5 // mapped InvalidPubkeyFormat + ) + } + + #[test] + fn do_secp256r1_verify_wrong_data_fails() { + let api = MockApi::default(); + let (fe, mut store, mut _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = vec![0x22; MESSAGE_HASH_MAX_LEN]; + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig = vec![0x22; ECDSA_SIGNATURE_LEN]; + let sig_ptr = write_data(&mut fe_mut, &sig); + let pubkey = vec![0x04; ECDSA_PUBKEY_MAX_LEN]; + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); + + assert_eq!( + do_secp256r1_verify(fe_mut, hash_ptr, sig_ptr, pubkey_ptr).unwrap(), + 10 // mapped GenericErr + ) + } + + #[test] + fn do_secp256r1_recover_pubkey_works() { + let api = MockApi::default(); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + let hash = hex!("12135386c09e0bf6fd5c454a95bcfe9b3edb25c71e455c73a212405694b29002"); + let sig = hex!("b53ce4da1aa7c0dc77a1896ab716b921499aed78df725b1504aba1597ba0c64bd7c246dc7ad0e67700c373edcfdd1c0a0495fc954549ad579df6ed1438840851"); + let recovery_param = 0; + let expected = hex!("040a7dbb8bf50cb605eb2268b081f26d6b08e012f952c4b70a5a1e6e7d46af98bbf26dd7d799930062480849962ccf5004edcfd307c044f4e8f667c9baa834eeae"); + + let hash_ptr = write_data(&mut fe_mut, &hash); + let sig_ptr = write_data(&mut fe_mut, &sig); + let result = + do_secp256r1_recover_pubkey(fe_mut.as_mut(), hash_ptr, sig_ptr, recovery_param) + .unwrap(); let error = result >> 32; let pubkey_ptr: u32 = (result & 0xFFFFFFFF).try_into().unwrap(); assert_eq!(error, 0); - assert_eq!(force_read(&env, pubkey_ptr), expected); + assert_eq!(force_read(&mut fe_mut, pubkey_ptr), expected); } #[test] fn do_ed25519_verify_works() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = hex::decode(EDDSA_MSG_HEX).unwrap(); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let sig = hex::decode(EDDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), 0 ); } @@ -1465,19 +2391,20 @@ mod tests { #[test] fn do_ed25519_verify_wrong_msg_verify_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let mut msg = hex::decode(EDDSA_MSG_HEX).unwrap(); // alter msg msg.push(0x01); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let sig = hex::decode(EDDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), 1 ); } @@ -1485,43 +2412,45 @@ mod tests { #[test] fn do_ed25519_verify_larger_msg_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let mut msg = hex::decode(EDDSA_MSG_HEX).unwrap(); // extend / break msg msg.extend_from_slice(&[0x00; MAX_LENGTH_ED25519_MESSAGE + 1]); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let sig = hex::decode(EDDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); - let result = do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr); + let result = do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionLengthTooBig { length, .. }, .. } => assert_eq!(length, msg.len()), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_ed25519_verify_wrong_sig_verify_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = hex::decode(EDDSA_MSG_HEX).unwrap(); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let mut sig = hex::decode(EDDSA_SIG_HEX).unwrap(); // alter sig sig[0] ^= 0x01; - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), 1 ); } @@ -1529,43 +2458,45 @@ mod tests { #[test] fn do_ed25519_verify_larger_sig_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = hex::decode(EDDSA_MSG_HEX).unwrap(); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let mut sig = hex::decode(EDDSA_SIG_HEX).unwrap(); // extend / break sig sig.push(0x00); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); - let result = do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr); + let result = do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionLengthTooBig { length, .. }, .. } => assert_eq!(length, MAX_LENGTH_ED25519_SIGNATURE + 1), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_ed25519_verify_shorter_sig_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = hex::decode(EDDSA_MSG_HEX).unwrap(); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let mut sig = hex::decode(EDDSA_SIG_HEX).unwrap(); // reduce / break sig sig.pop(); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), 4 // mapped InvalidSignatureFormat ) } @@ -1573,19 +2504,20 @@ mod tests { #[test] fn do_ed25519_verify_wrong_pubkey_verify_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = hex::decode(EDDSA_MSG_HEX).unwrap(); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let sig = hex::decode(EDDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let mut pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); // alter pubkey pubkey[1] ^= 0x01; - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), 1 ); } @@ -1593,43 +2525,45 @@ mod tests { #[test] fn do_ed25519_verify_larger_pubkey_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = hex::decode(EDDSA_MSG_HEX).unwrap(); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let sig = hex::decode(EDDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let mut pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); // extend / break pubkey pubkey.push(0x00); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); - let result = do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr); + let result = do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::RegionLengthTooBig { length, .. }, .. } => assert_eq!(length, EDDSA_PUBKEY_LEN + 1), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } #[test] fn do_ed25519_verify_shorter_pubkey_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = hex::decode(EDDSA_MSG_HEX).unwrap(); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let sig = hex::decode(EDDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let mut pubkey = hex::decode(EDDSA_PUBKEY_HEX).unwrap(); // reduce / break pubkey pubkey.pop(); - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), 5 // mapped InvalidPubkeyFormat ) } @@ -1637,17 +2571,18 @@ mod tests { #[test] fn do_ed25519_verify_empty_pubkey_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = hex::decode(EDDSA_MSG_HEX).unwrap(); - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let sig = hex::decode(EDDSA_SIG_HEX).unwrap(); - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = vec![]; - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), 5 // mapped InvalidPubkeyFormat ) } @@ -1655,94 +2590,97 @@ mod tests { #[test] fn do_ed25519_verify_wrong_data_fails() { let api = MockApi::default(); - let (env, mut _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let msg = vec![0x22; MESSAGE_HASH_MAX_LEN]; - let msg_ptr = write_data(&env, &msg); + let msg_ptr = write_data(&mut fe_mut, &msg); let sig = vec![0x22; MAX_LENGTH_ED25519_SIGNATURE]; - let sig_ptr = write_data(&env, &sig); + let sig_ptr = write_data(&mut fe_mut, &sig); let pubkey = vec![0x04; EDDSA_PUBKEY_LEN]; - let pubkey_ptr = write_data(&env, &pubkey); + let pubkey_ptr = write_data(&mut fe_mut, &pubkey); assert_eq!( - do_ed25519_verify(&env, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), + do_ed25519_verify(fe_mut, msg_ptr, sig_ptr, pubkey_ptr).unwrap(), 1 // verification failure ) } #[test] + #[allow(deprecated)] fn do_query_chain_works() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let request: QueryRequest = QueryRequest::Bank(BankQuery::AllBalances { + let request: QueryRequest = QueryRequest::Bank(BankQuery::Balance { address: INIT_ADDR.to_string(), + denom: INIT_DENOM.to_string(), }); - let request_data = cosmwasm_std::to_vec(&request).unwrap(); - let request_ptr = write_data(&env, &request_data); + let request_data = cosmwasm_std::to_json_vec(&request).unwrap(); + let request_ptr = write_data(&mut fe_mut, &request_data); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let response_ptr = do_query_chain(&env, request_ptr).unwrap(); - let response = force_read(&env, response_ptr); + let response_ptr = do_query_chain(fe_mut.as_mut(), request_ptr).unwrap(); + let response = force_read(&mut fe_mut, response_ptr); - let query_result: cosmwasm_std::QuerierResult = - cosmwasm_std::from_slice(&response).unwrap(); + let query_result: cosmwasm_std::QuerierResult = cosmwasm_std::from_json(response).unwrap(); let query_result_inner = query_result.unwrap(); let query_result_inner_inner = query_result_inner.unwrap(); - let parsed_again: AllBalanceResponse = from_binary(&query_result_inner_inner).unwrap(); - assert_eq!(parsed_again.amount, coins(INIT_AMOUNT, INIT_DENOM)); + let parsed_again: BalanceResponse = from_json(query_result_inner_inner).unwrap(); + assert_eq!(parsed_again.amount, coin(INIT_AMOUNT, INIT_DENOM)); } #[test] fn do_query_chain_fails_for_broken_request() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let request = b"Not valid JSON for sure"; - let request_ptr = write_data(&env, request); + let request_ptr = write_data(&mut fe_mut, request); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let response_ptr = do_query_chain(&env, request_ptr).unwrap(); - let response = force_read(&env, response_ptr); + let response_ptr = do_query_chain(fe_mut.as_mut(), request_ptr).unwrap(); + let response = force_read(&mut fe_mut, response_ptr); - let query_result: cosmwasm_std::QuerierResult = - cosmwasm_std::from_slice(&response).unwrap(); + let query_result: cosmwasm_std::QuerierResult = cosmwasm_std::from_json(response).unwrap(); match query_result { SystemResult::Ok(_) => panic!("This must not succeed"), SystemResult::Err(SystemError::InvalidRequest { request: err, .. }) => { assert_eq!(err.as_slice(), request) } - SystemResult::Err(err) => panic!("Unexpected error: {:?}", err), + SystemResult::Err(err) => panic!("Unexpected error: {err:?}"), } } #[test] fn do_query_chain_fails_for_missing_contract() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); let request: QueryRequest = QueryRequest::Wasm(WasmQuery::Smart { contract_addr: String::from("non-existent"), msg: Binary::from(b"{}" as &[u8]), }); - let request_data = cosmwasm_std::to_vec(&request).unwrap(); - let request_ptr = write_data(&env, &request_data); + let request_data = cosmwasm_std::to_json_vec(&request).unwrap(); + let request_ptr = write_data(&mut fe_mut, &request_data); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let response_ptr = do_query_chain(&env, request_ptr).unwrap(); - let response = force_read(&env, response_ptr); + let response_ptr = do_query_chain(fe_mut.as_mut(), request_ptr).unwrap(); + let response = force_read(&mut fe_mut, response_ptr); - let query_result: cosmwasm_std::QuerierResult = - cosmwasm_std::from_slice(&response).unwrap(); + let query_result: cosmwasm_std::QuerierResult = cosmwasm_std::from_json(response).unwrap(); match query_result { SystemResult::Ok(_) => panic!("This must not succeed"), SystemResult::Err(SystemError::NoSuchContract { addr }) => { assert_eq!(addr, "non-existent") } - SystemResult::Err(err) => panic!("Unexpected error: {:?}", err), + SystemResult::Err(err) => panic!("Unexpected error: {err:?}"), } } @@ -1750,24 +2688,28 @@ mod tests { #[cfg(feature = "iterator")] fn do_db_scan_unbound_works() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); - leave_default_data(&env); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + leave_default_data(&mut fe_mut); // set up iterator over all space - let id = do_db_scan(&env, 0, 0, Order::Ascending.into()).unwrap(); + let id = do_db_scan(fe_mut.as_mut(), 0, 0, Order::Ascending.into()).unwrap(); assert_eq!(1, id); - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY1.to_vec(), VALUE1.to_vec())); - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY2.to_vec(), VALUE2.to_vec())); - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id))) .unwrap(); assert!(item.0.unwrap().is_none()); @@ -1777,24 +2719,28 @@ mod tests { #[cfg(feature = "iterator")] fn do_db_scan_unbound_descending_works() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); - leave_default_data(&env); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + leave_default_data(&mut fe_mut); // set up iterator over all space - let id = do_db_scan(&env, 0, 0, Order::Descending.into()).unwrap(); + let id = do_db_scan(fe_mut.as_mut(), 0, 0, Order::Descending.into()).unwrap(); assert_eq!(1, id); - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY2.to_vec(), VALUE2.to_vec())); - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY1.to_vec(), VALUE1.to_vec())); - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id))) .unwrap(); assert!(item.0.unwrap().is_none()); @@ -1804,21 +2750,24 @@ mod tests { #[cfg(feature = "iterator")] fn do_db_scan_bound_works() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - let start = write_data(&env, b"anna"); - let end = write_data(&env, b"bert"); + let start = write_data(&mut fe_mut, b"anna"); + let end = write_data(&mut fe_mut, b"bert"); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let id = do_db_scan(&env, start, end, Order::Ascending.into()).unwrap(); + let id = do_db_scan(fe_mut.as_mut(), start, end, Order::Ascending.into()).unwrap(); - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY1.to_vec(), VALUE1.to_vec())); - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id))) .unwrap(); assert!(item.0.unwrap().is_none()); @@ -1828,41 +2777,47 @@ mod tests { #[cfg(feature = "iterator")] fn do_db_scan_multiple_iterators() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); - leave_default_data(&env); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + leave_default_data(&mut fe_mut); // unbounded, ascending and descending - let id1 = do_db_scan(&env, 0, 0, Order::Ascending.into()).unwrap(); - let id2 = do_db_scan(&env, 0, 0, Order::Descending.into()).unwrap(); + let id1 = do_db_scan(fe_mut.as_mut(), 0, 0, Order::Ascending.into()).unwrap(); + let id2 = do_db_scan(fe_mut.as_mut(), 0, 0, Order::Descending.into()).unwrap(); assert_eq!(id1, 1); assert_eq!(id2, 2); // first item, first iterator - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id1))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY1.to_vec(), VALUE1.to_vec())); // second item, first iterator - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id1))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY2.to_vec(), VALUE2.to_vec())); // first item, second iterator - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id2))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY2.to_vec(), VALUE2.to_vec())); // end, first iterator - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id1))) .unwrap(); assert!(item.0.unwrap().is_none()); // second item, second iterator - let item = env + let item = fe_mut + .data() .with_storage_from_context::<_, _>(|store| Ok(store.next(id2))) .unwrap(); assert_eq!(item.0.unwrap().unwrap(), (KEY1.to_vec(), VALUE1.to_vec())); @@ -1872,17 +2827,18 @@ mod tests { #[cfg(feature = "iterator")] fn do_db_scan_errors_for_invalid_order_value() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); - leave_default_data(&env); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + leave_default_data(&mut fe_mut); // set up iterator over all space - let result = do_db_scan(&env, 0, 0, 42); + let result = do_db_scan(fe_mut, 0, 0, 42); match result.unwrap_err() { VmError::CommunicationErr { source: CommunicationError::InvalidOrder { .. }, .. } => {} - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } @@ -1890,29 +2846,30 @@ mod tests { #[cfg(feature = "iterator")] fn do_db_next_works() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - leave_default_data(&env); + leave_default_data(&mut fe_mut); - let id = do_db_scan(&env, 0, 0, Order::Ascending.into()).unwrap(); + let id = do_db_scan(fe_mut.as_mut(), 0, 0, Order::Ascending.into()).unwrap(); // Entry 1 - let kv_region_ptr = do_db_next(&env, id).unwrap(); + let kv_region_ptr = do_db_next(fe_mut.as_mut(), id).unwrap(); assert_eq!( - force_read(&env, kv_region_ptr), + force_read(&mut fe_mut, kv_region_ptr), [KEY1, b"\0\0\0\x03", VALUE1, b"\0\0\0\x06"].concat() ); // Entry 2 - let kv_region_ptr = do_db_next(&env, id).unwrap(); + let kv_region_ptr = do_db_next(fe_mut.as_mut(), id).unwrap(); assert_eq!( - force_read(&env, kv_region_ptr), + force_read(&mut fe_mut, kv_region_ptr), [KEY2, b"\0\0\0\x04", VALUE2, b"\0\0\0\x05"].concat() ); // End - let kv_region_ptr = do_db_next(&env, id).unwrap(); - assert_eq!(force_read(&env, kv_region_ptr), b"\0\0\0\0\0\0\0\0"); + let kv_region_ptr = do_db_next(fe_mut.as_mut(), id).unwrap(); + assert_eq!(force_read(&mut fe_mut, kv_region_ptr), b"\0\0\0\0\0\0\0\0"); // API makes no guarantees for value_ptr in this case } @@ -1920,18 +2877,91 @@ mod tests { #[cfg(feature = "iterator")] fn do_db_next_fails_for_non_existent_id() { let api = MockApi::default(); - let (env, _instance) = make_instance(api); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); - leave_default_data(&env); + leave_default_data(&mut fe_mut); let non_existent_id = 42u32; - let result = do_db_next(&env, non_existent_id); + let result = do_db_next(fe_mut.as_mut(), non_existent_id); match result.unwrap_err() { VmError::BackendErr { source: BackendError::IteratorDoesNotExist { id, .. }, .. } => assert_eq!(id, non_existent_id), - e => panic!("Unexpected error: {:?}", e), + e => panic!("Unexpected error: {e:?}"), } } + + #[test] + #[cfg(feature = "iterator")] + fn do_db_next_key_works() { + let api = MockApi::default(); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + leave_default_data(&mut fe_mut); + + let id = do_db_scan(fe_mut.as_mut(), 0, 0, Order::Ascending.into()).unwrap(); + + // Entry 1 + let key_region_ptr = do_db_next_key(fe_mut.as_mut(), id).unwrap(); + assert_eq!(force_read(&mut fe_mut, key_region_ptr), KEY1); + + // Entry 2 + let key_region_ptr = do_db_next_key(fe_mut.as_mut(), id).unwrap(); + assert_eq!(force_read(&mut fe_mut, key_region_ptr), KEY2); + + // End + let key_region_ptr: u32 = do_db_next_key(fe_mut.as_mut(), id).unwrap(); + assert_eq!(key_region_ptr, 0); + } + + #[test] + #[cfg(feature = "iterator")] + fn do_db_next_value_works() { + let api = MockApi::default(); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + leave_default_data(&mut fe_mut); + + let id = do_db_scan(fe_mut.as_mut(), 0, 0, Order::Ascending.into()).unwrap(); + + // Entry 1 + let value_region_ptr = do_db_next_value(fe_mut.as_mut(), id).unwrap(); + assert_eq!(force_read(&mut fe_mut, value_region_ptr), VALUE1); + + // Entry 2 + let value_region_ptr = do_db_next_value(fe_mut.as_mut(), id).unwrap(); + assert_eq!(force_read(&mut fe_mut, value_region_ptr), VALUE2); + + // End + let value_region_ptr = do_db_next_value(fe_mut.as_mut(), id).unwrap(); + assert_eq!(value_region_ptr, 0); + } + + #[test] + #[cfg(feature = "iterator")] + fn do_db_next_works_mixed() { + let api = MockApi::default(); + let (fe, mut store, _instance) = make_instance(api); + let mut fe_mut = fe.into_mut(&mut store); + + leave_default_data(&mut fe_mut); + + let id = do_db_scan(fe_mut.as_mut(), 0, 0, Order::Ascending.into()).unwrap(); + + // Key 1 + let key_region_ptr = do_db_next_key(fe_mut.as_mut(), id).unwrap(); + assert_eq!(force_read(&mut fe_mut, key_region_ptr), KEY1); + + // Value 2 + let value_region_ptr = do_db_next_value(fe_mut.as_mut(), id).unwrap(); + assert_eq!(force_read(&mut fe_mut, value_region_ptr), VALUE2); + + // End + let kv_region_ptr = do_db_next(fe_mut.as_mut(), id).unwrap(); + assert_eq!(force_read(&mut fe_mut, kv_region_ptr), b"\0\0\0\0\0\0\0\0"); + } } diff --git a/packages/vm/src/instance.rs b/packages/vm/src/instance.rs index 66801435c7..0d3eae2842 100644 --- a/packages/vm/src/instance.rs +++ b/packages/vm/src/instance.rs @@ -1,8 +1,12 @@ +use std::cell::RefCell; use std::collections::{HashMap, HashSet}; use std::ptr::NonNull; +use std::rc::Rc; use std::sync::Mutex; -use wasmer::{Exports, Function, ImportObject, Instance as WasmerInstance, Module, Val}; +use wasmer::{ + Exports, Function, FunctionEnv, Imports, Instance as WasmerInstance, Module, Store, Value, +}; use crate::backend::{Backend, BackendApi, Querier, Storage}; use crate::capabilities::required_capabilities_from_module; @@ -10,15 +14,19 @@ use crate::conversion::{ref_to_u32, to_u32}; use crate::environment::Environment; use crate::errors::{CommunicationError, VmError, VmResult}; use crate::imports::{ - do_abort, do_addr_canonicalize, do_addr_humanize, do_addr_validate, do_db_read, do_db_remove, - do_db_write, do_debug, do_ed25519_batch_verify, do_ed25519_verify, do_query_chain, - do_secp256k1_recover_pubkey, do_secp256k1_verify, + do_abort, do_addr_canonicalize, do_addr_humanize, do_addr_validate, do_bls12_381_aggregate_g1, + do_bls12_381_aggregate_g2, do_bls12_381_hash_to_g1, do_bls12_381_hash_to_g2, + do_bls12_381_pairing_equality, do_db_read, do_db_remove, do_db_write, do_debug, + do_ed25519_batch_verify, do_ed25519_verify, do_query_chain, do_secp256k1_recover_pubkey, + do_secp256k1_verify, do_secp256r1_recover_pubkey, do_secp256r1_verify, }; #[cfg(feature = "iterator")] -use crate::imports::{do_db_next, do_db_scan}; +use crate::imports::{do_db_next, do_db_next_key, do_db_next_value, do_db_scan}; use crate::memory::{read_region, write_region}; use crate::size::Size; -use crate::wasm_backend::compile; +use crate::wasm_backend::{compile, make_compiling_engine}; + +pub use crate::environment::DebugInfo; // Re-exported as public via to be usable for set_debug_handler #[derive(Copy, Clone, Debug)] pub struct GasReport { @@ -37,7 +45,6 @@ pub struct GasReport { pub struct InstanceOptions { /// Gas limit measured in [CosmWasm gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md). pub gas_limit: u64, - pub print_debug: bool, } pub struct Instance { @@ -47,7 +54,8 @@ pub struct Instance { /// /// This instance should only be accessed via the Environment, which provides safe access. _inner: Box, - env: Environment, + fe: FunctionEnv>, + store: Store, } impl Instance @@ -64,46 +72,40 @@ where options: InstanceOptions, memory_limit: Option, ) -> VmResult { - let module = compile(code, memory_limit, &[])?; - Instance::from_module( - &module, - backend, - options.gas_limit, - options.print_debug, - None, - None, - ) + let engine = make_compiling_engine(memory_limit); + let module = compile(&engine, code)?; + let store = Store::new(engine); + Instance::from_module(store, &module, backend, options.gas_limit, None, None) } + #[allow(clippy::too_many_arguments)] pub(crate) fn from_module( + mut store: Store, module: &Module, backend: Backend, gas_limit: u64, - print_debug: bool, extra_imports: Option>, instantiation_lock: Option<&Mutex<()>>, ) -> VmResult { - let store = module.store(); - - let env = Environment::new(backend.api, gas_limit, print_debug); + let fe = FunctionEnv::new(&mut store, Environment::new(backend.api, gas_limit)); - let mut import_obj = ImportObject::new(); + let mut import_obj = Imports::new(); let mut env_imports = Exports::new(); - // Reads the database entry at the given key into the the value. + // Reads the database entry at the given key into the value. // Returns 0 if key does not exist and pointer to result region otherwise. // Ownership of the key pointer is not transferred to the host. // Ownership of the value pointer is transferred to the contract. env_imports.insert( "db_read", - Function::new_native_with_env(store, env.clone(), do_db_read), + Function::new_typed_with_env(&mut store, &fe, do_db_read), ); // Writes the given value into the database entry at the given key. // Ownership of both input and output pointer is not transferred to the host. env_imports.insert( "db_write", - Function::new_native_with_env(store, env.clone(), do_db_write), + Function::new_typed_with_env(&mut store, &fe, do_db_write), ); // Removes the value at the given key. Different than writing &[] as future @@ -112,7 +114,7 @@ where // Ownership of both key pointer is not transferred to the host. env_imports.insert( "db_remove", - Function::new_native_with_env(store, env.clone(), do_db_remove), + Function::new_typed_with_env(&mut store, &fe, do_db_remove), ); // Reads human address from source_ptr and checks if it is valid. @@ -120,7 +122,7 @@ where // Ownership of the input pointer is not transferred to the host. env_imports.insert( "addr_validate", - Function::new_native_with_env(store, env.clone(), do_addr_validate), + Function::new_typed_with_env(&mut store, &fe, do_addr_validate), ); // Reads human address from source_ptr and writes canonicalized representation to destination_ptr. @@ -129,7 +131,7 @@ where // Ownership of both input and output pointer is not transferred to the host. env_imports.insert( "addr_canonicalize", - Function::new_native_with_env(store, env.clone(), do_addr_canonicalize), + Function::new_typed_with_env(&mut store, &fe, do_addr_canonicalize), ); // Reads canonical address from source_ptr and writes humanized representation to destination_ptr. @@ -138,7 +140,50 @@ where // Ownership of both input and output pointer is not transferred to the host. env_imports.insert( "addr_humanize", - Function::new_native_with_env(store, env.clone(), do_addr_humanize), + Function::new_typed_with_env(&mut store, &fe, do_addr_humanize), + ); + + // Reads a list of points on of the subgroup G1 on the BLS12-381 curve and aggregates them down to a single element. + // The "out_ptr" parameter has to be a pointer to a region with the sufficient size to fit an element of G1 (48 bytes). + // Returns a u32 as a result. 0 signifies success, anything else may be converted into a `CryptoError`. + env_imports.insert( + "bls12_381_aggregate_g1", + Function::new_typed_with_env(&mut store, &fe, do_bls12_381_aggregate_g1), + ); + + // Reads a list of points on of the subgroup G2 on the BLS12-381 curve and aggregates them down to a single element. + // The "out_ptr" parameter has to be a pointer to a region with the sufficient size to fit an element of G2 (96 bytes). + // Returns a u32 as a result. 0 signifies success, anything else may be converted into a `CryptoError`. + env_imports.insert( + "bls12_381_aggregate_g2", + Function::new_typed_with_env(&mut store, &fe, do_bls12_381_aggregate_g2), + ); + + // Four parameters, "ps", "qs", "r", "s", which all represent elements on the BLS12-381 curve (where "ps" and "r" are elements of the G1 subgroup, and "qs" and "s" elements of G2). + // The "ps" and "qs" are interpreted as a continuous list of points in the subgroups G1 and G2 respectively. + // Returns a single u32 which signifies the validity of the pairing equality. + // Returns 0 if the pairing equality exists, 1 if it doesn't, and any other code may be interpreted as a `CryptoError`. + env_imports.insert( + "bls12_381_pairing_equality", + Function::new_typed_with_env(&mut store, &fe, do_bls12_381_pairing_equality), + ); + + // Three parameters, "hash_function" and "msg" and "dst", are passed down which are both arbitrary octet strings. + // The "hash_function" parameter is interpreted as a case of the "HashFunction" enum. + // The "out_ptr" parameter has to be a pointer to a region with the sufficient size to fit an element of G1 (48 bytes). + // Returns a u32 as a result. 0 signifies success, anything else may be converted into a `CryptoError`. + env_imports.insert( + "bls12_381_hash_to_g1", + Function::new_typed_with_env(&mut store, &fe, do_bls12_381_hash_to_g1), + ); + + // Three parameters, "hash_function" and "msg" and "dst", are passed down which are both arbitrary octet strings. + // The "hash_function" parameter is interpreted as a case of the "HashFunction" enum. + // The "out_ptr" parameter has to be a pointer to a region with the sufficient size to fit an element of G2 (96 bytes). + // Returns a u32 as a result. 0 signifies success, anything else may be converted into a `CryptoError`. + env_imports.insert( + "bls12_381_hash_to_g2", + Function::new_typed_with_env(&mut store, &fe, do_bls12_381_hash_to_g2), ); // Verifies message hashes against a signature with a public key, using the secp256k1 ECDSA parametrization. @@ -146,12 +191,25 @@ where // Ownership of input pointers is not transferred to the host. env_imports.insert( "secp256k1_verify", - Function::new_native_with_env(store, env.clone(), do_secp256k1_verify), + Function::new_typed_with_env(&mut store, &fe, do_secp256k1_verify), ); env_imports.insert( "secp256k1_recover_pubkey", - Function::new_native_with_env(store, env.clone(), do_secp256k1_recover_pubkey), + Function::new_typed_with_env(&mut store, &fe, do_secp256k1_recover_pubkey), + ); + + // Verifies message hashes against a signature with a public key, using the secp256r1 ECDSA parametrization. + // Returns 0 on verification success, 1 on verification failure, and values greater than 1 in case of error. + // Ownership of input pointers is not transferred to the host. + env_imports.insert( + "secp256r1_verify", + Function::new_typed_with_env(&mut store, &fe, do_secp256r1_verify), + ); + + env_imports.insert( + "secp256r1_recover_pubkey", + Function::new_typed_with_env(&mut store, &fe, do_secp256r1_recover_pubkey), ); // Verifies a message against a signature with a public key, using the ed25519 EdDSA scheme. @@ -159,7 +217,7 @@ where // Ownership of input pointers is not transferred to the host. env_imports.insert( "ed25519_verify", - Function::new_native_with_env(store, env.clone(), do_ed25519_verify), + Function::new_typed_with_env(&mut store, &fe, do_ed25519_verify), ); // Verifies a batch of messages against a batch of signatures with a batch of public keys, @@ -169,7 +227,7 @@ where // Ownership of input pointers is not transferred to the host. env_imports.insert( "ed25519_batch_verify", - Function::new_native_with_env(store, env.clone(), do_ed25519_batch_verify), + Function::new_typed_with_env(&mut store, &fe, do_ed25519_batch_verify), ); // Allows the contract to emit debug logs that the host can either process or ignore. @@ -178,7 +236,7 @@ where // Ownership of both input and output pointer is not transferred to the host. env_imports.insert( "debug", - Function::new_native_with_env(store, env.clone(), do_debug), + Function::new_typed_with_env(&mut store, &fe, do_debug), ); // Aborts the contract execution with an error message provided by the contract. @@ -186,12 +244,12 @@ where // Ownership of both input and output pointer is not transferred to the host. env_imports.insert( "abort", - Function::new_native_with_env(store, env.clone(), do_abort), + Function::new_typed_with_env(&mut store, &fe, do_abort), ); env_imports.insert( "query_chain", - Function::new_native_with_env(store, env.clone(), do_query_chain), + Function::new_typed_with_env(&mut store, &fe, do_query_chain), ); // Creates an iterator that will go from start to end. @@ -203,7 +261,7 @@ where #[cfg(feature = "iterator")] env_imports.insert( "db_scan", - Function::new_native_with_env(store, env.clone(), do_db_scan), + Function::new_typed_with_env(&mut store, &fe, do_db_scan), ); // Get next element of iterator with ID `iterator_id`. @@ -214,47 +272,87 @@ where #[cfg(feature = "iterator")] env_imports.insert( "db_next", - Function::new_native_with_env(store, env.clone(), do_db_next), + Function::new_typed_with_env(&mut store, &fe, do_db_next), + ); + + // Get next key of iterator with ID `iterator_id`. + // Returns 0 if there are no more entries and pointer to result region otherwise. + // Ownership of the result region is transferred to the contract. + #[cfg(feature = "iterator")] + env_imports.insert( + "db_next_key", + Function::new_typed_with_env(&mut store, &fe, do_db_next_key), + ); + + // Get next value of iterator with ID `iterator_id`. + // Returns 0 if there are no more entries and pointer to result region otherwise. + // Ownership of the result region is transferred to the contract. + #[cfg(feature = "iterator")] + env_imports.insert( + "db_next_value", + Function::new_typed_with_env(&mut store, &fe, do_db_next_value), ); - import_obj.register("env", env_imports); + import_obj.register_namespace("env", env_imports); if let Some(extra_imports) = extra_imports { for (namespace, exports_obj) in extra_imports { - import_obj.register(namespace, exports_obj); + import_obj.register_namespace(namespace, exports_obj); } } let wasmer_instance = Box::from( { let _lock = instantiation_lock.map(|l| l.lock().unwrap()); - WasmerInstance::new(module, &import_obj) + WasmerInstance::new(&mut store, module, &import_obj) } .map_err(|original| { - VmError::instantiation_err(format!("Error instantiating module: {:?}", original)) + VmError::instantiation_err(format!("Error instantiating module: {original}")) })?, ); + let memory = wasmer_instance + .exports + .get_memory("memory") + .map_err(|original| { + VmError::instantiation_err(format!("Could not get memory 'memory': {original}")) + })? + .clone(); + let instance_ptr = NonNull::from(wasmer_instance.as_ref()); - env.set_wasmer_instance(Some(instance_ptr)); - env.set_gas_left(gas_limit); - env.move_in(backend.storage, backend.querier); - let instance = Instance { + + { + let mut fe_mut = fe.clone().into_mut(&mut store); + let (env, mut store) = fe_mut.data_and_store_mut(); + + env.memory = Some(memory); + env.set_wasmer_instance(Some(instance_ptr)); + env.set_gas_left(&mut store, gas_limit); + env.move_in(backend.storage, backend.querier); + } + + Ok(Instance { _inner: wasmer_instance, - env, - }; - Ok(instance) + fe, + store, + }) } pub fn api(&self) -> &A { - &self.env.api + &self.fe.as_ref(&self.store).api } /// Decomposes this instance into its components. /// External dependencies are returned for reuse, the rest is dropped. + #[must_use = "Calling ::recycle() without reusing the returned backend just drops the instance"] pub fn recycle(self) -> Option> { - if let (Some(storage), Some(querier)) = self.env.move_out() { - let api = self.env.api; + let Instance { + _inner, fe, store, .. + } = self; + + let env = fe.as_ref(&store); + if let (Some(storage), Some(querier)) = env.move_out() { + let api = env.api.clone(); Some(Backend { api, storage, @@ -265,10 +363,23 @@ where } } + pub fn set_debug_handler(&mut self, debug_handler: H) + where + H: for<'a, 'b> FnMut(/* msg */ &'a str, DebugInfo<'b>) + 'static, + { + self.fe + .as_ref(&self.store) + .set_debug_handler(Some(Rc::new(RefCell::new(debug_handler)))); + } + + pub fn unset_debug_handler(&mut self) { + self.fe.as_ref(&self.store).set_debug_handler(None); + } + /// Returns the features required by this contract. /// /// This is not needed for production because we can do static analysis - /// on the Wasm file before instatiation to obtain this information. It's + /// on the Wasm file before instantiation to obtain this information. It's /// only kept because it can be handy for integration testing. pub fn required_capabilities(&self) -> HashSet { required_capabilities_from_module(self._inner.module()) @@ -278,21 +389,30 @@ where /// This provides a rough idea of the peak memory consumption. Note that /// Wasm memory always grows in 64 KiB steps (pages) and can never shrink /// (https://github.com/WebAssembly/design/issues/1300#issuecomment-573867836). - pub fn memory_pages(&self) -> usize { - self.env.memory().size().0 as _ + pub fn memory_pages(&mut self) -> usize { + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, store) = fe_mut.data_and_store_mut(); + + env.memory(&store).size().0 as _ } /// Returns the currently remaining gas. - pub fn get_gas_left(&self) -> u64 { - self.env.get_gas_left() + pub fn get_gas_left(&mut self) -> u64 { + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, mut store) = fe_mut.data_and_store_mut(); + + env.get_gas_left(&mut store) } /// Creates and returns a gas report. /// This is a snapshot and multiple reports can be created during the lifetime of /// an instance. - pub fn create_gas_report(&self) -> GasReport { - let state = self.env.with_gas_state(|gas_state| gas_state.clone()); - let gas_left = self.env.get_gas_left(); + pub fn create_gas_report(&mut self) -> GasReport { + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, mut store) = fe_mut.data_and_store_mut(); + + let state = env.with_gas_state(|gas_state| gas_state.clone()); + let gas_left = env.get_gas_left(&mut store); GasReport { limit: state.gas_limit, remaining: gas_left, @@ -307,19 +427,33 @@ where } } + pub fn is_storage_readonly(&mut self) -> bool { + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, _) = fe_mut.data_and_store_mut(); + + env.is_storage_readonly() + } + /// Sets the readonly storage flag on this instance. Since one instance can be used /// for multiple calls in integration tests, this should be set to the desired value /// right before every call. pub fn set_storage_readonly(&mut self, new_value: bool) { - self.env.set_storage_readonly(new_value); + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, _) = fe_mut.data_and_store_mut(); + + env.set_storage_readonly(new_value); } pub fn with_storage VmResult, T>(&mut self, func: F) -> VmResult { - self.env.with_storage_from_context::(func) + self.fe + .as_ref(&self.store) + .with_storage_from_context::(func) } pub fn with_querier VmResult, T>(&mut self, func: F) -> VmResult { - self.env.with_querier_from_context::(func) + self.fe + .as_ref(&self.store) + .with_querier_from_context::(func) } /// Requests memory allocation by the instance and returns a pointer @@ -342,36 +476,48 @@ where } /// Copies all data described by the Region at the given pointer from Wasm to the caller. - pub(crate) fn read_memory(&self, region_ptr: u32, max_length: usize) -> VmResult> { - read_region(&self.env.memory(), region_ptr, max_length) + pub(crate) fn read_memory(&mut self, region_ptr: u32, max_length: usize) -> VmResult> { + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, mut store) = fe_mut.data_and_store_mut(); + + read_region(env, &mut store, region_ptr, max_length) } /// Copies data to the memory region that was created before using allocate. pub(crate) fn write_memory(&mut self, region_ptr: u32, data: &[u8]) -> VmResult<()> { - write_region(&self.env.memory(), region_ptr, data)?; + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, mut store) = fe_mut.data_and_store_mut(); + + write_region(env, &mut store, region_ptr, data)?; Ok(()) } /// Calls a function exported by the instance. /// The function is expected to return no value. Otherwise this calls errors. - pub(crate) fn call_function0(&self, name: &str, args: &[Val]) -> VmResult<()> { - self.env.call_function0(name, args) + pub(crate) fn call_function0(&mut self, name: &str, args: &[Value]) -> VmResult<()> { + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, mut store) = fe_mut.data_and_store_mut(); + + env.call_function0(&mut store, name, args) } /// Calls a function exported by the instance. /// The function is expected to return one value. Otherwise this calls errors. - pub(crate) fn call_function1(&self, name: &str, args: &[Val]) -> VmResult { - self.env.call_function1(name, args) + pub(crate) fn call_function1(&mut self, name: &str, args: &[Value]) -> VmResult { + let mut fe_mut = self.fe.clone().into_mut(&mut self.store); + let (env, mut store) = fe_mut.data_and_store_mut(); + + env.call_function1(&mut store, name, args) } } /// This exists only to be exported through `internals` for use by crates that are /// part of Cosmwasm. pub fn instance_from_module( + store: Store, module: &Module, backend: Backend, gas_limit: u64, - print_debug: bool, extra_imports: Option>, ) -> VmResult> where @@ -379,46 +525,101 @@ where S: Storage + 'static, // 'static is needed here to allow using this in an Environment that is cloned into closures Q: Querier + 'static, { - Instance::from_module(module, backend, gas_limit, print_debug, extra_imports, None) + Instance::from_module(store, module, backend, gas_limit, extra_imports, None) } #[cfg(test)] mod tests { use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; + use std::time::SystemTime; use super::*; - use crate::backend::Storage; use crate::calls::{call_execute, call_instantiate, call_query}; - use crate::errors::VmError; use crate::testing::{ mock_backend, mock_env, mock_info, mock_instance, mock_instance_options, mock_instance_with_balances, mock_instance_with_failing_api, mock_instance_with_gas_limit, mock_instance_with_options, MockInstanceOptions, }; use cosmwasm_std::{ - coin, coins, from_binary, AllBalanceResponse, BalanceResponse, BankQuery, Empty, - QueryRequest, + coin, coins, from_json, BalanceResponse, BankQuery, Empty, QueryRequest, Uint256, }; + use wasmer::FunctionEnvMut; const KIB: usize = 1024; const MIB: usize = 1024 * 1024; const DEFAULT_QUERY_GAS_LIMIT: u64 = 300_000; - static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static HACKATOM_1_3: &[u8] = include_bytes!("../testdata/hackatom_1.3.wasm"); + static CYBERPUNK: &[u8] = include_bytes!("../testdata/cyberpunk.wasm"); + + #[test] + fn from_code_works() { + let backend = mock_backend(&[]); + let (instance_options, memory_limit) = mock_instance_options(); + let _instance = + Instance::from_code(HACKATOM, backend, instance_options, memory_limit).unwrap(); + } + + #[test] + fn set_debug_handler_and_unset_debug_handler_work() { + const LIMIT: u64 = 70_000_000_000; + let mut instance = mock_instance_with_gas_limit(CYBERPUNK, LIMIT); + + // init contract + let info = mock_info("creator", &coins(1000, "earth")); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{}"#) + .unwrap() + .unwrap(); + + let info = mock_info("caller", &[]); + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{"debug":{}}"#) + .unwrap() + .unwrap(); + + let start = SystemTime::now(); + instance.set_debug_handler(move |msg, info| { + let gas = info.gas_remaining; + let runtime = SystemTime::now().duration_since(start).unwrap().as_micros(); + eprintln!("{msg} (gas: {gas}, runtime: {runtime}µs)"); + }); + + let info = mock_info("caller", &[]); + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{"debug":{}}"#) + .unwrap() + .unwrap(); + + eprintln!("Unsetting debug handler. From here nothing is printed anymore."); + instance.unset_debug_handler(); + + let info = mock_info("caller", &[]); + call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, br#"{"debug":{}}"#) + .unwrap() + .unwrap(); + } #[test] fn required_capabilities_works() { let backend = mock_backend(&[]); let (instance_options, memory_limit) = mock_instance_options(); let instance = - Instance::from_code(CONTRACT, backend, instance_options, memory_limit).unwrap(); + Instance::from_code(HACKATOM_1_3, backend, instance_options, memory_limit).unwrap(); assert_eq!(instance.required_capabilities().len(), 0); + + let backend = mock_backend(&[]); + let (instance_options, memory_limit) = mock_instance_options(); + let instance = + Instance::from_code(HACKATOM, backend, instance_options, memory_limit).unwrap(); + assert_eq!(instance.required_capabilities().len(), 7); } #[test] fn required_capabilities_works_for_many_exports() { let wasm = wat::parse_str( r#"(module + (memory 3) + (export "memory" (memory 0)) + (type (func)) (func (type 0) nop) (export "requires_water" (func 0)) @@ -442,55 +643,65 @@ mod tests { #[test] fn extra_imports_get_added() { + let (instance_options, memory_limit) = mock_instance_options(); + let wasm = wat::parse_str( r#"(module (import "foo" "bar" (func $bar)) + (memory 3) + (export "memory" (memory 0)) (func (export "main") (call $bar)) )"#, ) .unwrap(); let backend = mock_backend(&[]); - let (instance_options, memory_limit) = mock_instance_options(); - let module = compile(&wasm, memory_limit, &[]).unwrap(); + let engine = make_compiling_engine(memory_limit); + let module = compile(&engine, &wasm).unwrap(); + let mut store = Store::new(engine); + + let called = Arc::new(AtomicBool::new(false)); - #[derive(wasmer::WasmerEnv, Clone)] + #[derive(Clone)] struct MyEnv { // This can be mutated across threads safely. We initialize it as `false` // and let our imported fn switch it to `true` to confirm it works. called: Arc, } - let my_env = MyEnv { - called: Arc::new(AtomicBool::new(false)), - }; + let fe = FunctionEnv::new( + &mut store, + MyEnv { + called: called.clone(), + }, + ); - let fun = Function::new_native_with_env(module.store(), my_env.clone(), |env: &MyEnv| { - env.called.store(true, Ordering::Relaxed); - }); + let fun = + Function::new_typed_with_env(&mut store, &fe, move |fe_mut: FunctionEnvMut| { + fe_mut.data().called.store(true, Ordering::Relaxed); + }); let mut exports = Exports::new(); exports.insert("bar", fun); let mut extra_imports = HashMap::new(); extra_imports.insert("foo", exports); - let instance = Instance::from_module( + let mut instance = Instance::from_module( + store, &module, backend, instance_options.gas_limit, - false, Some(extra_imports), None, ) .unwrap(); - let main = instance._inner.exports.get_function("main").unwrap(); - main.call(&[]).unwrap(); + instance.call_function0("main", &[]).unwrap(); - assert!(my_env.called.load(Ordering::Relaxed)); + assert!(called.load(Ordering::Relaxed)); } #[test] fn call_function0_works() { - let instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); instance .call_function0("interface_version_8", &[]) @@ -499,7 +710,7 @@ mod tests { #[test] fn call_function1_works() { - let instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); // can call function few times let result = instance @@ -521,7 +732,7 @@ mod tests { #[test] fn allocate_deallocate_works() { let mut instance = mock_instance_with_options( - CONTRACT, + HACKATOM, MockInstanceOptions { memory_limit: Some(Size::mebi(500)), ..Default::default() @@ -548,7 +759,7 @@ mod tests { #[test] fn write_and_read_memory_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance_with_gas_limit(HACKATOM, 6_000_000_000); let sizes: Vec = vec![ 0, @@ -559,7 +770,7 @@ mod tests { 40 * KIB, 400 * KIB, 4 * MIB, - // disabled for performance reasons, but pass as well + // disabled for performance reasons, but pass as well (with much more gas) // 40 * MIB, // 400 * MIB, ]; @@ -581,7 +792,7 @@ mod tests { fn errors_in_imports() { // set up an instance that will experience an error in an import let error_message = "Api failed intentionally"; - let mut instance = mock_instance_with_failing_api(CONTRACT, &[], error_message); + let mut instance = mock_instance_with_failing_api(HACKATOM, &[], error_message); let init_result = call_instantiate::<_, _, _, Empty>( &mut instance, &mock_env(), @@ -591,7 +802,7 @@ mod tests { match init_result.unwrap_err() { VmError::RuntimeErr { msg, .. } => assert!(msg.contains(error_message)), - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } @@ -599,7 +810,7 @@ mod tests { fn read_memory_errors_when_when_length_is_too_long() { let length = 6; let max_length = 5; - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); // Allocate sets length to 0. Write some data to increase length. let region_ptr = instance.allocate(length).expect("error allocating"); @@ -620,7 +831,7 @@ mod tests { assert_eq!(length, 6); assert_eq!(max_length, 5); } - err => panic!("unexpected error: {:?}", err), + err => panic!("unexpected error: {err:?}"), }; instance.deallocate(region_ptr).expect("error deallocating"); @@ -643,7 +854,7 @@ mod tests { )"#, ) .unwrap(); - let instance = mock_instance(&wasm, &[]); + let mut instance = mock_instance(&wasm, &[]); assert_eq!(instance.memory_pages(), 0); // min: 3 pages, max: none @@ -661,13 +872,13 @@ mod tests { )"#, ) .unwrap(); - let instance = mock_instance(&wasm, &[]); + let mut instance = mock_instance(&wasm, &[]); assert_eq!(instance.memory_pages(), 3); } #[test] fn memory_pages_grows_with_usage() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); assert_eq!(instance.memory_pages(), 17); @@ -683,15 +894,15 @@ mod tests { #[test] fn get_gas_left_works() { - let instance = mock_instance_with_gas_limit(CONTRACT, 123321); + let mut instance = mock_instance_with_gas_limit(HACKATOM, 123321); let orig_gas = instance.get_gas_left(); assert_eq!(orig_gas, 123321); } #[test] fn create_gas_report_works() { - const LIMIT: u64 = 700_000_000_000; - let mut instance = mock_instance_with_gas_limit(CONTRACT, LIMIT); + const LIMIT: u64 = 700_000_000; + let mut instance = mock_instance_with_gas_limit(HACKATOM, LIMIT); let report1 = instance.create_gas_report(); assert_eq!(report1.used_externally, 0); @@ -700,15 +911,17 @@ mod tests { assert_eq!(report1.remaining, LIMIT); // init contract - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) .unwrap() .unwrap(); let report2 = instance.create_gas_report(); - assert_eq!(report2.used_externally, 73); - assert_eq!(report2.used_internally, 5775750198); + assert_eq!(report2.used_externally, 251); + assert_eq!(report2.used_internally, 18034325); assert_eq!(report2.limit, LIMIT); assert_eq!( report2.remaining, @@ -718,23 +931,23 @@ mod tests { #[test] fn set_storage_readonly_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); - assert!(instance.env.is_storage_readonly()); + assert!(instance.is_storage_readonly()); instance.set_storage_readonly(false); - assert!(!instance.env.is_storage_readonly()); + assert!(!instance.is_storage_readonly()); instance.set_storage_readonly(false); - assert!(!instance.env.is_storage_readonly()); + assert!(!instance.is_storage_readonly()); instance.set_storage_readonly(true); - assert!(instance.env.is_storage_readonly()); + assert!(instance.is_storage_readonly()); } #[test] fn with_storage_works() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); // initial check instance @@ -765,17 +978,18 @@ mod tests { #[should_panic] fn with_storage_safe_for_panic() { // this should fail with the assertion, but not cause a double-free crash (issue #59) - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); instance .with_storage::<_, ()>(|_store| panic!("trigger failure")) .unwrap(); } #[test] + #[allow(deprecated)] fn with_querier_works_readonly() { let rich_addr = String::from("foobar"); let rich_balance = vec![coin(10000, "gold"), coin(8000, "silver")]; - let mut instance = mock_instance_with_balances(CONTRACT, &[(&rich_addr, &rich_balance)]); + let mut instance = mock_instance_with_balances(HACKATOM, &[(&rich_addr, &rich_balance)]); // query one instance @@ -792,46 +1006,21 @@ mod tests { .unwrap() .unwrap() .unwrap(); - let BalanceResponse { amount } = from_binary(&response).unwrap(); - assert_eq!(amount.amount.u128(), 8000); + let BalanceResponse { amount, .. } = from_json(response).unwrap(); + assert_eq!(amount.amount, Uint256::new(8000)); assert_eq!(amount.denom, "silver"); Ok(()) }) .unwrap(); - - // query all - instance - .with_querier(|querier| { - let response = querier - .query::( - &QueryRequest::Bank(BankQuery::AllBalances { - address: rich_addr.clone(), - }), - DEFAULT_QUERY_GAS_LIMIT, - ) - .0 - .unwrap() - .unwrap() - .unwrap(); - let AllBalanceResponse { amount } = from_binary(&response).unwrap(); - assert_eq!(amount.len(), 2); - assert_eq!(amount[0].amount.u128(), 10000); - assert_eq!(amount[0].denom, "gold"); - assert_eq!(amount[1].amount.u128(), 8000); - assert_eq!(amount[1].denom, "silver"); - - Ok(()) - }) - .unwrap(); } - /// This is needed for writing intagration tests in which the balance of a contract changes over time + /// This is needed for writing integration tests in which the balance of a contract changes over time. #[test] fn with_querier_allows_updating_balances() { let rich_addr = String::from("foobar"); let rich_balance1 = vec![coin(10000, "gold"), coin(500, "silver")]; let rich_balance2 = vec![coin(10000, "gold"), coin(8000, "silver")]; - let mut instance = mock_instance_with_balances(CONTRACT, &[(&rich_addr, &rich_balance1)]); + let mut instance = mock_instance_with_balances(HACKATOM, &[(&rich_addr, &rich_balance1)]); // Get initial state instance @@ -848,8 +1037,8 @@ mod tests { .unwrap() .unwrap() .unwrap(); - let BalanceResponse { amount } = from_binary(&response).unwrap(); - assert_eq!(amount.amount.u128(), 500); + let BalanceResponse { amount, .. } = from_json(response).unwrap(); + assert_eq!(amount.amount, Uint256::new(500)); Ok(()) }) .unwrap(); @@ -877,8 +1066,8 @@ mod tests { .unwrap() .unwrap() .unwrap(); - let BalanceResponse { amount } = from_binary(&response).unwrap(); - assert_eq!(amount.amount.u128(), 8000); + let BalanceResponse { amount, .. } = from_json(response).unwrap(); + assert_eq!(amount.amount, Uint256::new(8000)); Ok(()) }) .unwrap(); @@ -886,64 +1075,74 @@ mod tests { #[test] fn contract_deducts_gas_init() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); let orig_gas = instance.get_gas_left(); // init contract - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) .unwrap() .unwrap(); let init_used = orig_gas - instance.get_gas_left(); - assert_eq!(init_used, 5775750271); + assert_eq!(init_used, 18034576); } #[test] fn contract_deducts_gas_execute() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); // init contract - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) .unwrap() .unwrap(); // run contract - just sanity check - results validate in contract unit tests let gas_before_execute = instance.get_gas_left(); - let info = mock_info("verifies", &coins(15, "earth")); - let msg = br#"{"release":{}}"#; + let info = mock_info(&verifier, &coins(15, "earth")); + let msg = br#"{"release":{"denom":"earth"}}"#; call_execute::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) .unwrap() .unwrap(); let execute_used = gas_before_execute - instance.get_gas_left(); - assert_eq!(execute_used, 8627053606); + assert_eq!(execute_used, 24624251); } #[test] fn contract_enforces_gas_limit() { - let mut instance = mock_instance_with_gas_limit(CONTRACT, 20_000); + let mut instance = mock_instance_with_gas_limit(HACKATOM, 20_000); // init contract - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let res = call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg); + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let res = + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()); assert!(res.is_err()); } #[test] fn query_works_with_gas_metering() { - let mut instance = mock_instance(CONTRACT, &[]); + let mut instance = mock_instance(HACKATOM, &[]); // init contract - let info = mock_info("creator", &coins(1000, "earth")); - let msg = br#"{"verifier": "verifies", "beneficiary": "benefits"}"#; - let _res = call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg) - .unwrap() - .unwrap(); + let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth")); + let verifier = instance.api().addr_make("verifies"); + let beneficiary = instance.api().addr_make("benefits"); + let msg = format!(r#"{{"verifier": "{verifier}", "beneficiary": "{beneficiary}"}}"#); + let _res = + call_instantiate::<_, _, _, Empty>(&mut instance, &mock_env(), &info, msg.as_bytes()) + .unwrap() + .unwrap(); // run contract - just sanity check - results validate in contract unit tests let gas_before_query = instance.get_gas_left(); @@ -951,9 +1150,12 @@ mod tests { let msg = br#"{"verifier":{}}"#; let res = call_query(&mut instance, &mock_env(), msg).unwrap(); let answer = res.unwrap(); - assert_eq!(answer.as_slice(), b"{\"verifier\":\"verifies\"}"); + assert_eq!( + answer.as_slice(), + format!("{{\"verifier\":\"{verifier}\"}}").as_bytes() + ); let query_used = gas_before_query - instance.get_gas_left(); - assert_eq!(query_used, 4438350006); + assert_eq!(query_used, 11105221); } } diff --git a/packages/vm/src/lib.rs b/packages/vm/src/lib.rs index 37713763fa..7650b84220 100644 --- a/packages/vm/src/lib.rs +++ b/packages/vm/src/lib.rs @@ -1,19 +1,24 @@ -#![cfg_attr(feature = "backtraces", feature(backtrace))] +//! CosmWasm is a smart contract platform for the Cosmos ecosystem. +//! This crate provides VM bindings to run CosmWasm contracts. +//! +//! For more information, see: mod backend; mod cache; mod calls; mod capabilities; -mod checksum; mod compatibility; +mod config; mod conversion; mod environment; mod errors; +mod filesystem; mod imports; mod instance; mod limited; mod memory; mod modules; +mod parsed_wasm; mod sections; mod serde; mod size; @@ -24,12 +29,20 @@ mod wasm_backend; pub use crate::backend::{ Backend, BackendApi, BackendError, BackendResult, GasInfo, Querier, Storage, }; -pub use crate::cache::{AnalysisReport, Cache, CacheOptions, Metrics, Stats}; +pub use crate::cache::{AnalysisReport, Cache, Metrics, PerModuleMetrics, PinnedMetrics, Stats}; pub use crate::calls::{ - call_execute, call_execute_raw, call_instantiate, call_instantiate_raw, call_migrate, - call_migrate_raw, call_query, call_query_raw, call_reply, call_reply_raw, call_sudo, + call_execute, call_execute_raw, call_ibc_destination_callback, + call_ibc_destination_callback_raw, call_ibc_source_callback, call_ibc_source_callback_raw, + call_instantiate, call_instantiate_raw, call_migrate, call_migrate_raw, call_migrate_with_info, + call_migrate_with_info_raw, call_query, call_query_raw, call_reply, call_reply_raw, call_sudo, call_sudo_raw, }; +#[cfg(feature = "ibc2")] +pub use crate::calls::{ + call_ibc2_packet_ack, call_ibc2_packet_ack_raw, call_ibc2_packet_receive, + call_ibc2_packet_receive_raw, call_ibc2_packet_send, call_ibc2_packet_send_raw, + call_ibc2_packet_timeout, call_ibc2_packet_timeout_raw, +}; #[cfg(feature = "stargate")] pub use crate::calls::{ call_ibc_channel_close, call_ibc_channel_close_raw, call_ibc_channel_connect, @@ -38,23 +51,23 @@ pub use crate::calls::{ call_ibc_packet_receive_raw, call_ibc_packet_timeout, call_ibc_packet_timeout_raw, }; pub use crate::capabilities::capabilities_from_csv; -pub use crate::checksum::Checksum; +pub use crate::config::{CacheOptions, Config, WasmLimits}; pub use crate::errors::{ CommunicationError, CommunicationResult, RegionValidationError, RegionValidationResult, VmError, VmResult, }; -pub use crate::instance::{GasReport, Instance, InstanceOptions}; +pub use crate::instance::{DebugInfo, GasReport, Instance, InstanceOptions}; pub use crate::serde::{from_slice, to_vec}; pub use crate::size::Size; -#[doc(hidden)] pub mod internals { + #![doc(hidden)] //! We use the internals module for exporting types that are only //! intended to be used in internal crates / utils. //! Please don't use any of these types directly, as //! they might change frequently or be removed in the future. - pub use crate::compatibility::check_wasm; + pub use crate::compatibility::{check_wasm, LogOutput, Logger}; pub use crate::instance::instance_from_module; - pub use crate::wasm_backend::{compile, make_runtime_store}; + pub use crate::wasm_backend::{compile, make_compiling_engine, make_runtime_engine}; } diff --git a/packages/vm/src/limited.rs b/packages/vm/src/limited.rs index 1475dc4712..e959d3db2b 100644 --- a/packages/vm/src/limited.rs +++ b/packages/vm/src/limited.rs @@ -1,5 +1,5 @@ //! A set of tools designed for processing user defined contract data, -//! which can potientially have abusive size. +//! which can potentially have abusive size. use std::collections::{BTreeSet, HashSet}; @@ -73,9 +73,9 @@ fn collection_to_string_limited, I: ExactSizeIterator>( let skipped = elements_count - lengths_stack.len(); let remaining = elements_count - skipped; let skipped_text = if remaining == 0 { - format!("... {} elements", skipped) + format!("... {skipped} elements") } else { - format!(", ... {} more", skipped) + format!(", ... {skipped} more") }; if previous_length + skipped_text.len() + closing.len() <= max_length { out.truncate(previous_length); diff --git a/packages/vm/src/memory.rs b/packages/vm/src/memory.rs index d5048d26ca..eaf44f2f42 100644 --- a/packages/vm/src/memory.rs +++ b/packages/vm/src/memory.rs @@ -1,10 +1,14 @@ -use wasmer::{Array, ValueType, WasmPtr}; +use std::mem::{size_of, MaybeUninit}; + +use wasmer::{ValueType, WasmPtr}; use crate::conversion::to_u32; +use crate::environment::{process_gas_info, Environment}; use crate::errors::{ CommunicationError, CommunicationResult, RegionValidationError, RegionValidationResult, VmResult, }; +use crate::{BackendApi, GasInfo, Querier, Storage}; /****** read/write to wasm memory buffer ****/ @@ -15,7 +19,7 @@ use crate::errors::{ /// but defined here to allow Wasmer specific implementation. #[repr(C)] #[derive(Default, Clone, Copy, Debug)] -struct Region { +pub struct Region { /// The beginning of the region expressed as bytes from the beginning of the linear memory pub offset: u32, /// The number of bytes available in this region @@ -24,13 +28,66 @@ struct Region { pub length: u32, } -unsafe impl ValueType for Region {} +/// Byte representation of a [Region] struct in Wasm memory. +type RegionBytes = [u8; size_of::()]; + +impl Region { + fn from_wasm_bytes(bytes: RegionBytes) -> Self { + let offset = u32::from_le_bytes([bytes[0], bytes[1], bytes[2], bytes[3]]); + let capacity = u32::from_le_bytes([bytes[4], bytes[5], bytes[6], bytes[7]]); + let length = u32::from_le_bytes([bytes[8], bytes[9], bytes[10], bytes[11]]); + Region { + offset, + capacity, + length, + } + } + + fn into_wasm_bytes(self) -> RegionBytes { + let Region { + offset, + capacity, + length, + } = self; + + let mut bytes = [0u8; 12]; + // wasm is little endian + bytes[0..4].copy_from_slice(&offset.to_le_bytes()); + bytes[4..8].copy_from_slice(&capacity.to_le_bytes()); + bytes[8..12].copy_from_slice(&length.to_le_bytes()); + bytes + } +} + +unsafe impl ValueType for Region { + fn zero_padding_bytes(&self, _bytes: &mut [MaybeUninit]) { + // The size of Region is exactly 3x4=12 bytes with no padding. + // The `size_of::()` test below ensures that. + // So we do not need to zero any bytes here. + } +} + +// Wasm is little endian, and we want to be able to just reinterpret slices of +// wasm memory as a Region struct, so we only support little endian systems. +// If we ever need to support big endian systems, we can use more fine-grained checks +// in the places where we read/write the Region struct +// (and possibly other interactions between Wasm and host). +#[cfg(target_endian = "big")] +compile_error!("big endian systems are not supported"); /// Expects a (fixed size) Region struct at ptr, which is read. This links to the /// memory region, which is copied in the second step. /// Errors if the length of the region exceeds `max_length`. -pub fn read_region(memory: &wasmer::Memory, ptr: u32, max_length: usize) -> VmResult> { - let region = get_region(memory, ptr)?; +pub fn read_region( + env: &Environment, + store: &mut wasmer::StoreMut<'_>, + ptr: u32, + max_length: usize, +) -> VmResult> { + let region = get_region(&env.memory(store), ptr)?; + + let gas_info = GasInfo::with_cost(env.gas_config.read_region_cost(region.length as usize)?); + process_gas_info(env, store, gas_info)?; if region.length > to_u32(max_length)? { return Err( @@ -38,83 +95,74 @@ pub fn read_region(memory: &wasmer::Memory, ptr: u32, max_length: usize) -> VmRe ); } - match WasmPtr::::new(region.offset).deref(memory, 0, region.length) { - Some(cells) => { - // In case you want to do some premature optimization, this shows how to cast a `&'mut [Cell]` to `&mut [u8]`: - // https://github.com/wasmerio/wasmer/blob/0.13.1/lib/wasi/src/syscalls/mod.rs#L79-L81 - let len = region.length as usize; - let mut result = vec![0u8; len]; - for i in 0..len { - result[i] = cells[i].get(); - } - Ok(result) - } - None => Err(CommunicationError::deref_err(region.offset, format!( - "Tried to access memory of region {:?} in wasm memory of size {} bytes. This typically happens when the given Region pointer does not point to a proper Region struct.", - region, - memory.size().bytes().0 - )).into()), - } + let memory = env.memory(store); + let mut result = vec![0u8; region.length as usize]; + memory + .read(region.offset as u64, &mut result) + .map_err(|_err| CommunicationError::region_access_err(region, memory.size().bytes().0))?; + + Ok(result) } /// maybe_read_region is like read_region, but gracefully handles null pointer (0) by returning None /// meant to be used where the argument is optional (like scan) #[cfg(feature = "iterator")] -pub fn maybe_read_region( - memory: &wasmer::Memory, +pub fn maybe_read_region( + env: &Environment, + store: &mut wasmer::StoreMut<'_>, ptr: u32, max_length: usize, ) -> VmResult>> { if ptr == 0 { Ok(None) } else { - read_region(memory, ptr, max_length).map(Some) + read_region(env, store, ptr, max_length).map(Some) } } /// A prepared and sufficiently large memory Region is expected at ptr that points to pre-allocated memory. /// /// Returns number of bytes written on success. -pub fn write_region(memory: &wasmer::Memory, ptr: u32, data: &[u8]) -> VmResult<()> { - let mut region = get_region(memory, ptr)?; +pub fn write_region( + env: &Environment, + store: &mut wasmer::StoreMut<'_>, + ptr: u32, + data: &[u8], +) -> VmResult<()> { + let mut region = get_region(&env.memory(store), ptr)?; + + let gas_info = GasInfo::with_cost( + env.gas_config + .write_region_cost + .total_cost(data.len() as u64)?, + ); + process_gas_info(env, store, gas_info)?; let region_capacity = region.capacity as usize; if data.len() > region_capacity { return Err(CommunicationError::region_too_small(region_capacity, data.len()).into()); } - match WasmPtr::::new(region.offset).deref(memory, 0, region.capacity) { - Some(cells) => { - // In case you want to do some premature optimization, this shows how to cast a `&'mut [Cell]` to `&mut [u8]`: - // https://github.com/wasmerio/wasmer/blob/0.13.1/lib/wasi/src/syscalls/mod.rs#L79-L81 - for i in 0..data.len() { - cells[i].set(data[i]) - } - region.length = data.len() as u32; - set_region(memory, ptr, region)?; - Ok(()) - }, - None => Err(CommunicationError::deref_err(region.offset, format!( - "Tried to access memory of region {:?} in wasm memory of size {} bytes. This typically happens when the given Region pointer does not point to a proper Region struct.", - region, - memory.size().bytes().0 - )).into()), - } + + let memory = &env.memory(store); + + memory + .write(region.offset as u64, data) + .map_err(|_err| CommunicationError::region_access_err(region, memory.size().bytes().0))?; + + region.length = data.len() as u32; + set_region(memory, ptr, region)?; + + Ok(()) } -/// Reads in a Region at ptr in wasm memory and returns a copy of it -fn get_region(memory: &wasmer::Memory, ptr: u32) -> CommunicationResult { - let wptr = WasmPtr::::new(ptr); - match wptr.deref(memory) { - Some(cell) => { - let region = cell.get(); - validate_region(®ion)?; - Ok(region) - } - None => Err(CommunicationError::deref_err( - ptr, - "Could not dereference this pointer to a Region", - )), - } +/// Reads in a Region at offset in Wasm memory and returns a copy of it +fn get_region(memory: &wasmer::MemoryView, offset: u32) -> CommunicationResult { + let wptr = WasmPtr::::new(offset); + let region = Region::from_wasm_bytes(wptr.deref(memory).read().map_err(|_err| { + CommunicationError::deref_err(offset, "Could not dereference this pointer to a Region") + })?); + validate_region(®ion)?; + Ok(region) } /// Performs plausibility checks in the given Region. Regions are always created by the @@ -138,26 +186,29 @@ fn validate_region(region: &Region) -> RegionValidationResult<()> { Ok(()) } -/// Overrides a Region at ptr in wasm memory with data -fn set_region(memory: &wasmer::Memory, ptr: u32, data: Region) -> CommunicationResult<()> { - let wptr = WasmPtr::::new(ptr); - - match wptr.deref(memory) { - Some(cell) => { - cell.set(data); - Ok(()) - } - None => Err(CommunicationError::deref_err( - ptr, - "Could not dereference this pointer to a Region", - )), - } +/// Overrides a Region at offset in Wasm memory +fn set_region(memory: &wasmer::MemoryView, offset: u32, data: Region) -> CommunicationResult<()> { + let wptr = WasmPtr::::new(offset); + wptr.deref(memory) + .write(data.into_wasm_bytes()) + .map_err(|_err| { + CommunicationError::deref_err(offset, "Could not dereference this pointer to a Region") + })?; + Ok(()) } #[cfg(test)] mod tests { + use std::mem; + use super::*; + #[test] + fn region_has_known_size() { + // 3x4 bytes with no padding + assert_eq!(mem::size_of::(), 12); + } + #[test] fn validate_region_passes_for_valid_region() { // empty @@ -211,7 +262,7 @@ mod tests { let result = validate_region(®ion); match result.unwrap_err() { RegionValidationError::ZeroOffset { .. } => {} - e => panic!("Got unexpected error: {:?}", e), + e => panic!("Got unexpected error: {e:?}"), } } @@ -230,7 +281,7 @@ mod tests { assert_eq!(length, 501); assert_eq!(capacity, 500); } - e => panic!("Got unexpected error: {:?}", e), + e => panic!("Got unexpected error: {e:?}"), } } @@ -249,7 +300,7 @@ mod tests { assert_eq!(offset, 23); assert_eq!(capacity, u32::MAX); } - e => panic!("Got unexpected error: {:?}", e), + e => panic!("Got unexpected error: {e:?}"), } let region = Region { @@ -265,7 +316,7 @@ mod tests { assert_eq!(offset, u32::MAX); assert_eq!(capacity, 1); } - e => panic!("Got unexpected error: {:?}", e), + e => panic!("Got unexpected error: {e:?}"), } } } diff --git a/packages/vm/src/modules/cached_module.rs b/packages/vm/src/modules/cached_module.rs new file mode 100644 index 0000000000..73c8d1fa58 --- /dev/null +++ b/packages/vm/src/modules/cached_module.rs @@ -0,0 +1,30 @@ +use wasmer::{Engine, Module}; + +/// Some manual tests on Simon's machine showed that Engine is roughly 3-5 KB big, +/// so give it a constant 10 KiB estimate. +#[inline] +pub fn engine_size_estimate() -> usize { + 10 * 1024 +} + +#[derive(Debug, Clone)] +pub struct CachedModule { + pub module: Module, + /// The runtime engine to run this module. Ideally we could use a single engine + /// for all modules but the memory issue described in + /// requires using one engine per module as a workaround. + pub engine: Engine, + /// The estimated size of this element in memory. + /// Since the cached modules are just [rkyv](https://rkyv.org/) dumps of the Module + /// instances, we use the file size of the module on disk (not the Wasm!) + /// as an estimate for this. + /// + /// Between CosmWasm 1.4 (Wasmer 4) and 1.5.2, Store/Engine were not cached. This lead to a + /// memory consumption problem. From 1.5.2 on, Module and Engine are cached and Store is created + /// from Engine on demand. + /// + /// The majority of the Module size is the Artifact which is why we use the module filesize as the estimate. + /// Some manual tests on Simon's machine showed that Engine is roughly 3-5 KB big, so give it a constant + /// estimate: [`engine_size_estimate`]. + pub size_estimate: usize, +} diff --git a/packages/vm/src/modules/file_system_cache.rs b/packages/vm/src/modules/file_system_cache.rs index 0488ca7635..4cb83bce6b 100644 --- a/packages/vm/src/modules/file_system_cache.rs +++ b/packages/vm/src/modules/file_system_cache.rs @@ -1,24 +1,34 @@ +use blake2::{digest::consts::U5, Blake2b, Digest}; use std::fs; +use std::hash::Hash; use std::io; -use std::path::PathBuf; +use std::panic::catch_unwind; +use std::path::{Path, PathBuf}; +use std::sync::OnceLock; +use thiserror::Error; -use wasmer::{DeserializeError, Module, Store}; +use wasmer::{DeserializeError, Module, Target}; -use crate::checksum::Checksum; -use crate::errors::{VmError, VmResult}; +use cosmwasm_std::Checksum; +use crate::errors::{VmError, VmResult}; +use crate::filesystem::mkdir_p; use crate::modules::current_wasmer_module_version; +use crate::wasm_backend::make_runtime_engine; +use crate::wasm_backend::COST_FUNCTION_HASH; +use crate::Size; -/// Bump this version whenever the module system changes in a way -/// that old stored modules would be corrupt when loaded in the new system. -/// This needs to be done e.g. when switching between the jit/native engine. +use super::cached_module::engine_size_estimate; +use super::CachedModule; + +/// This is a value you can manually modify to the cache. +/// You normally _do not_ need to change this value yourself. /// -/// The string is used as a folder and should be named in a way that is -/// easy to interprete for system admins. It should allow easy clearing -/// of old versions. +/// Cases where you might need to update it yourself, is things like when the memory layout of some types in Rust [std] changes. /// -/// See https://github.com/wasmerio/wasmer/issues/2781 for more information -/// on Wasmer's module stability concept. +/// --- +/// +/// Now follows the legacy documentation of this value: /// /// ## Version history: /// - **v1**:
@@ -37,125 +47,262 @@ use crate::modules::current_wasmer_module_version; /// the module header version (). In cosmwasm-vm 1.1.0-1.1.1 /// the old value "v3" is still used along with Wasmer 2.3.0 (bug). From cosmwasm 1.1.2 onwards, this is /// fixed by bumping to "v4". -const MODULE_SERIALIZATION_VERSION: &str = "v4"; +/// - **v5**:
+/// A change in memory layout of some types in Rust [std] caused +/// [issues with module deserialization](https://github.com/CosmWasm/wasmvm/issues/426). +/// To work around this, the version was bumped to "v5" here to invalidate these corrupt caches. +/// - **v6**:
+/// Version for cosmwasm_vm 1.3+ which adds a sub-folder with the target identifier for the modules. +/// - **v7**:
+/// New version because of Wasmer 2.3.0 -> 4 upgrade. +/// This internally changes how rkyv is used for module serialization, making compatibility unlikely. +/// - **v8**:
+/// New version because of Wasmer 4.1.2 -> 4.2.2 upgrade. +/// Module compatibility between Wasmer versions is not guaranteed. +/// - **v9**:
+/// New version because of Wasmer 4.2.2 -> 4.2.6 upgrade. +/// Module compatibility between Wasmer versions is not guaranteed. +/// - **v10**:
+/// New version because of Metering middleware change. +/// - **v20**:
+/// New version because of Wasmer 4.3.3 -> 4.3.7 upgrade. +/// Module compatibility between Wasmer versions is not guaranteed. +const MODULE_SERIALIZATION_VERSION: &str = "v20"; + +/// Function that actually does the heavy lifting of creating the module version discriminator. +/// +/// Separated for sanity tests because otherwise the `OnceLock` would cache the result. +#[inline] +fn raw_module_version_discriminator() -> String { + let hashes = [COST_FUNCTION_HASH]; + + let mut hasher = Blake2b::::new(); + + hasher.update(MODULE_SERIALIZATION_VERSION.as_bytes()); + hasher.update(wasmer::VERSION.as_bytes()); + + for hash in hashes { + hasher.update(hash); + } + + hex::encode(hasher.finalize()) +} + +/// This version __MUST__ change whenever the module system changes in a way +/// that old stored modules would be corrupt when loaded in the new system. +/// This needs to be done e.g. when switching between the jit/native engine. +/// +/// By default, this derived by performing the following operation: +/// +/// ```ignore +/// BLAKE2( +/// manual module version, +/// wasmer version requirement, +/// BLAKE2_512(cost_fn) +/// ) +/// ``` +/// +/// If anything else changes, you must change the manual module version. +/// +/// See https://github.com/wasmerio/wasmer/issues/2781 for more information +/// on Wasmer's module stability concept. +#[inline] +fn module_version_discriminator() -> &'static str { + static DISCRIMINATOR: OnceLock = OnceLock::new(); + + DISCRIMINATOR.get_or_init(raw_module_version_discriminator) +} /// Representation of a directory that contains compiled Wasm artifacts. pub struct FileSystemCache { - /// The base path this cache operates in. Within this path, versioned directories are created. - /// A sophisticated version of this cache might be able to read multiple input versions in the future. - base_path: PathBuf, - wasmer_module_version: u32, + modules_path: PathBuf, + /// If true, the cache uses the `*_unchecked` wasmer functions for loading modules from disk. + unchecked_modules: bool, +} + +/// An error type that hides system specific error information +/// to ensure deterministic errors across operating systems. +#[derive(Error, Debug)] +pub enum NewFileSystemCacheError { + #[error("Could not get metadata of cache path")] + CouldntGetMetadata, + #[error("The supplied path is readonly")] + ReadonlyPath, + #[error("The supplied path already exists but is no directory")] + ExistsButNoDirectory, + #[error("Could not create cache path")] + CouldntCreatePath, } impl FileSystemCache { /// Construct a new `FileSystemCache` around the specified directory. /// The contents of the cache are stored in sub-versioned directories. + /// If `unchecked_modules` is set to true, it uses the `*_unchecked` + /// wasmer functions for loading modules from disk (no validity checks). /// /// # Safety /// /// This method is unsafe because there's no way to ensure the artifacts /// stored in this cache haven't been corrupted or tampered with. - pub unsafe fn new(path: impl Into) -> io::Result { - let wasmer_module_version = current_wasmer_module_version(); - - let path: PathBuf = path.into(); - if path.exists() { - let metadata = path.metadata()?; - if metadata.is_dir() { - if !metadata.permissions().readonly() { - Ok(Self { - base_path: path, - wasmer_module_version, - }) - } else { - // This directory is readonly. - Err(io::Error::new( - io::ErrorKind::PermissionDenied, - format!("the supplied path is readonly: {}", path.display()), - )) - } - } else { - // This path points to a file. - Err(io::Error::new( - io::ErrorKind::PermissionDenied, - format!( - "the supplied path already points to a file: {}", - path.display() - ), - )) + pub unsafe fn new( + base_path: impl Into, + unchecked_modules: bool, + ) -> Result { + let base_path: PathBuf = base_path.into(); + if base_path.exists() { + let metadata = base_path + .metadata() + .map_err(|_e| NewFileSystemCacheError::CouldntGetMetadata)?; + if !metadata.is_dir() { + return Err(NewFileSystemCacheError::ExistsButNoDirectory); + } + if metadata.permissions().readonly() { + return Err(NewFileSystemCacheError::ReadonlyPath); } } else { // Create the directory and any parent directories if they don't yet exist. - fs::create_dir_all(&path)?; - Ok(Self { - base_path: path, - wasmer_module_version, - }) + mkdir_p(&base_path).map_err(|_e| NewFileSystemCacheError::CouldntCreatePath)?; } + + Ok(Self { + modules_path: modules_path( + &base_path, + current_wasmer_module_version(), + &Target::default(), + ), + unchecked_modules, + }) } - /// Loads a serialized module from the file system and returns a module (i.e. artifact + store), - /// along with the size of the serialized module. - pub fn load(&self, checksum: &Checksum, store: &Store) -> VmResult> { - let filename = checksum.to_hex(); - let file_path = self.latest_modules_path().join(filename); + /// If `unchecked` is true, the cache will use the `*_unchecked` wasmer functions for + /// loading modules from disk. + pub fn set_module_unchecked(&mut self, unchecked: bool) { + self.unchecked_modules = unchecked; + } + + /// Returns the path to the serialized module with the given checksum. + fn module_file(&self, checksum: &Checksum) -> PathBuf { + let mut path = self.modules_path.clone(); + path.push(checksum.to_hex()); + path.set_extension("module"); + path + } - let result = unsafe { Module::deserialize_from_file(store, &file_path) }; + /// Loads a serialized module from the file system and returns a Module + Engine, + /// along with a size estimation for the pair. + pub fn load( + &self, + checksum: &Checksum, + memory_limit: Option, + ) -> VmResult> { + let file_path = self.module_file(checksum); + + let engine = make_runtime_engine(memory_limit); + let result = if self.unchecked_modules { + unsafe { Module::deserialize_from_file_unchecked(&engine, &file_path) } + } else { + unsafe { Module::deserialize_from_file(&engine, &file_path) } + }; match result { - Ok(module) => Ok(Some(module)), + Ok(module) => { + let module_size = module_size(&file_path)?; + Ok(Some(CachedModule { + module, + engine, + size_estimate: module_size + engine_size_estimate(), + })) + } Err(DeserializeError::Io(err)) => match err.kind() { io::ErrorKind::NotFound => Ok(None), _ => Err(VmError::cache_err(format!( - "Error opening module file: {}", - err + "Error opening module file: {err}" ))), }, Err(err) => Err(VmError::cache_err(format!( - "Error deserializing module: {}", - err + "Error deserializing module: {err}" ))), } } /// Stores a serialized module to the file system. Returns the size of the serialized module. - pub fn store(&mut self, checksum: &Checksum, module: &Module) -> VmResult<()> { - let modules_dir = self.latest_modules_path(); - fs::create_dir_all(&modules_dir) - .map_err(|e| VmError::cache_err(format!("Error creating directory: {}", e)))?; - let filename = checksum.to_hex(); - let path = modules_dir.join(filename); - module - .serialize_to_file(path) - .map_err(|e| VmError::cache_err(format!("Error writing module to disk: {}", e)))?; - Ok(()) + pub fn store(&mut self, checksum: &Checksum, module: &Module) -> VmResult { + mkdir_p(&self.modules_path) + .map_err(|_e| VmError::cache_err("Error creating modules directory"))?; + + let path = self.module_file(checksum); + catch_unwind(|| { + module + .serialize_to_file(&path) + .map_err(|e| VmError::cache_err(format!("Error writing module to disk: {e}"))) + }) + .map_err(|_| VmError::cache_err("Could not write module to disk"))??; + let module_size = module_size(&path)?; + Ok(module_size) } - /// The path to the latest version of the modules. - fn latest_modules_path(&self) -> PathBuf { - let version = format!( - "{}-wasmer{}", - MODULE_SERIALIZATION_VERSION, self.wasmer_module_version - ); - self.base_path.join(version) + /// Removes a serialized module from the file system. + /// + /// Returns true if the file existed and false if the file did not exist. + pub fn remove(&mut self, checksum: &Checksum) -> VmResult { + let file_path = self.module_file(checksum); + + if file_path.exists() { + fs::remove_file(file_path) + .map_err(|_e| VmError::cache_err("Error deleting module from disk"))?; + Ok(true) + } else { + Ok(false) + } } } +/// Returns the size of the module stored on disk +fn module_size(module_path: &Path) -> VmResult { + let module_size: usize = module_path + .metadata() + .map_err(|_e| VmError::cache_err("Error getting file metadata"))? // ensure error message is not system specific + .len() + .try_into() + .expect("Could not convert file size to usize"); + Ok(module_size) +} + +/// Creates an identifier for the Wasmer `Target` that is used for +/// cache invalidation. The output is reasonable human friendly to be usable +/// in file path component. +fn target_id(target: &Target) -> String { + // Use a custom Hasher implementation to avoid randomization. + let mut deterministic_hasher = crc32fast::Hasher::new(); + target.hash(&mut deterministic_hasher); + let hash = deterministic_hasher.finalize(); + format!("{}-{:08X}", target.triple(), hash) // print 4 byte hash as 8 hex characters +} + +/// The path to the latest version of the modules. +fn modules_path(base_path: &Path, wasmer_module_version: u32, target: &Target) -> PathBuf { + let version_dir = format!( + "{}-wasmer{wasmer_module_version}", + module_version_discriminator() + ); + let target_dir = target_id(target); + base_path.join(version_dir).join(target_dir) +} + #[cfg(test)] mod tests { use super::*; - use crate::size::Size; - use crate::wasm_backend::{compile, make_runtime_store}; + use crate::wasm_backend::{compile, make_compiling_engine}; use tempfile::TempDir; - use wasmer::{imports, Instance as WasmerInstance}; + use wasmer::{imports, Instance as WasmerInstance, Store}; use wasmer_middlewares::metering::set_remaining_points; const TESTING_MEMORY_LIMIT: Option = Some(Size::mebi(16)); - const TESTING_GAS_LIMIT: u64 = 500_000_000; + const TESTING_GAS_LIMIT: u64 = 500_000; const SOME_WAT: &str = r#"(module (type $t0 (func (param i32) (result i32))) (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 + local.get $p0 i32.const 1 i32.add)) "#; @@ -163,35 +310,43 @@ mod tests { #[test] fn file_system_cache_run() { let tmp_dir = TempDir::new().unwrap(); - let mut cache = unsafe { FileSystemCache::new(tmp_dir.path()).unwrap() }; + let mut cache = unsafe { FileSystemCache::new(tmp_dir.path(), false).unwrap() }; // Create module let wasm = wat::parse_str(SOME_WAT).unwrap(); let checksum = Checksum::generate(&wasm); // Module does not exist - let store = make_runtime_store(TESTING_MEMORY_LIMIT); - let cached = cache.load(&checksum, &store).unwrap(); + let cached = cache.load(&checksum, TESTING_MEMORY_LIMIT).unwrap(); assert!(cached.is_none()); // Store module - let module = compile(&wasm, None, &[]).unwrap(); + let compiling_engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = compile(&compiling_engine, &wasm).unwrap(); cache.store(&checksum, &module).unwrap(); // Load module - let store = make_runtime_store(TESTING_MEMORY_LIMIT); - let cached = cache.load(&checksum, &store).unwrap(); + let cached = cache.load(&checksum, TESTING_MEMORY_LIMIT).unwrap(); assert!(cached.is_some()); // Check the returned module is functional. // This is not really testing the cache API but better safe than sorry. { - let cached_module = cached.unwrap(); + let CachedModule { + module: cached_module, + engine: runtime_engine, + size_estimate, + } = cached.unwrap(); + assert_eq!( + size_estimate, + module.serialize().unwrap().len() + 10240 /* engine size estimate */ + ); let import_object = imports! {}; - let instance = WasmerInstance::new(&cached_module, &import_object).unwrap(); - set_remaining_points(&instance, TESTING_GAS_LIMIT); + let mut store = Store::new(runtime_engine); + let instance = WasmerInstance::new(&mut store, &cached_module, &import_object).unwrap(); + set_remaining_points(&mut store, &instance, TESTING_GAS_LIMIT); let add_one = instance.exports.get_function("add_one").unwrap(); - let result = add_one.call(&[42.into()]).unwrap(); + let result = add_one.call(&mut store, &[42.into()]).unwrap(); assert_eq!(result[0].unwrap_i32(), 43); } } @@ -199,21 +354,132 @@ mod tests { #[test] fn file_system_cache_store_uses_expected_path() { let tmp_dir = TempDir::new().unwrap(); - let mut cache = unsafe { FileSystemCache::new(tmp_dir.path()).unwrap() }; + let mut cache = unsafe { FileSystemCache::new(tmp_dir.path(), false).unwrap() }; // Create module let wasm = wat::parse_str(SOME_WAT).unwrap(); let checksum = Checksum::generate(&wasm); // Store module - let module = compile(&wasm, None, &[]).unwrap(); + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = compile(&engine, &wasm).unwrap(); cache.store(&checksum, &module).unwrap(); - let file_path = format!( - "{}/v4-wasmer1/{}", + let discriminator = raw_module_version_discriminator(); + let mut globber = glob::glob(&format!( + "{}/{}-wasmer8/**/{}.module", tmp_dir.path().to_string_lossy(), + discriminator, checksum - ); + )) + .expect("Failed to read glob pattern"); + let file_path = globber.next().unwrap().unwrap(); let _serialized_module = fs::read(file_path).unwrap(); } + + #[test] + fn file_system_cache_remove_works() { + let tmp_dir = TempDir::new().unwrap(); + let mut cache = unsafe { FileSystemCache::new(tmp_dir.path(), false).unwrap() }; + + // Create module + let wasm = wat::parse_str(SOME_WAT).unwrap(); + let checksum = Checksum::generate(&wasm); + + // Store module + let compiling_engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = compile(&compiling_engine, &wasm).unwrap(); + cache.store(&checksum, &module).unwrap(); + + // It's there + assert!(cache + .load(&checksum, TESTING_MEMORY_LIMIT) + .unwrap() + .is_some()); + + // Remove module + let existed = cache.remove(&checksum).unwrap(); + assert!(existed); + + // it's gone now + assert!(cache + .load(&checksum, TESTING_MEMORY_LIMIT) + .unwrap() + .is_none()); + + // Remove again + let existed = cache.remove(&checksum).unwrap(); + assert!(!existed); + } + + #[test] + fn target_id_works() { + let triple = wasmer::Triple { + architecture: wasmer::Architecture::X86_64, + vendor: target_lexicon::Vendor::Nintendo, + operating_system: target_lexicon::OperatingSystem::Fuchsia, + environment: target_lexicon::Environment::Gnu, + binary_format: target_lexicon::BinaryFormat::Coff, + }; + let target = Target::new(triple.clone(), wasmer::CpuFeature::POPCNT.into()); + let id = target_id(&target); + assert_eq!(id, "x86_64-nintendo-fuchsia-gnu-coff-719EEF18"); + // Changing CPU features changes the hash part + let target = Target::new(triple, wasmer::CpuFeature::AVX512DQ.into()); + let id = target_id(&target); + assert_eq!(id, "x86_64-nintendo-fuchsia-gnu-coff-E3770FA3"); + + // Works for durrect target (hashing is deterministic); + let target = Target::default(); + let id1 = target_id(&target); + let id2 = target_id(&target); + assert_eq!(id1, id2); + } + + #[test] + fn modules_path_works() { + let base = PathBuf::from("modules"); + let triple = wasmer::Triple { + architecture: wasmer::Architecture::X86_64, + vendor: target_lexicon::Vendor::Nintendo, + operating_system: target_lexicon::OperatingSystem::Fuchsia, + environment: target_lexicon::Environment::Gnu, + binary_format: target_lexicon::BinaryFormat::Coff, + }; + let target = Target::new(triple, wasmer::CpuFeature::POPCNT.into()); + let p = modules_path(&base, 17, &target); + let discriminator = raw_module_version_discriminator(); + + assert_eq!( + p.as_os_str(), + if cfg!(windows) { + format!( + "modules\\{discriminator}-wasmer17\\x86_64-nintendo-fuchsia-gnu-coff-719EEF18" + ) + } else { + format!( + "modules/{discriminator}-wasmer17/x86_64-nintendo-fuchsia-gnu-coff-719EEF18" + ) + } + .as_str() + ); + } + + #[test] + fn module_version_discriminator_stays_the_same() { + let v1 = raw_module_version_discriminator(); + let v2 = raw_module_version_discriminator(); + let v3 = raw_module_version_discriminator(); + let v4 = raw_module_version_discriminator(); + + assert_eq!(v1, v2); + assert_eq!(v2, v3); + assert_eq!(v3, v4); + } + + #[test] + fn module_version_static() { + let version = raw_module_version_discriminator(); + assert_eq!(version, "6c36aacf76"); + } } diff --git a/packages/vm/src/modules/in_memory_cache.rs b/packages/vm/src/modules/in_memory_cache.rs index 9a14ac9960..3ae3ad6749 100644 --- a/packages/vm/src/modules/in_memory_cache.rs +++ b/packages/vm/src/modules/in_memory_cache.rs @@ -1,16 +1,17 @@ use clru::{CLruCache, CLruCacheConfig, WeightScale}; use std::collections::hash_map::RandomState; use std::num::NonZeroUsize; -use wasmer::Module; -use super::sized_module::SizedModule; -use crate::{Checksum, Size, VmError, VmResult}; +use cosmwasm_std::Checksum; + +use super::cached_module::CachedModule; +use crate::{Size, VmError, VmResult}; // Minimum module size. // Based on `examples/module_size.sh`, and the cosmwasm-plus contracts. // We use an estimated *minimum* module size in order to compute a number of pre-allocated entries // that are enough to handle a size-limited cache without requiring re-allocation / resizing. -// This will incurr an extra memory cost for the unused entries, but it's negligible: +// This will incur an extra memory cost for the unused entries, but it's negligible: // Assuming the cost per entry is 48 bytes, 10000 entries will have an extra cost of just ~500 kB. // Which is a very small percentage (~0.03%) of our typical cache memory budget (2 GB). const MINIMUM_MODULE_SIZE: Size = Size::kibi(250); @@ -18,16 +19,22 @@ const MINIMUM_MODULE_SIZE: Size = Size::kibi(250); #[derive(Debug)] struct SizeScale; -impl WeightScale for SizeScale { +impl WeightScale for SizeScale { #[inline] - fn weight(&self, _key: &Checksum, value: &SizedModule) -> usize { - value.size + fn weight(&self, key: &Checksum, value: &CachedModule) -> usize { + std::mem::size_of_val(key) + value.size_estimate } } /// An in-memory module cache pub struct InMemoryCache { - modules: Option>, + /// This is where the cached data is stored. + /// + /// `Some` means the cache is active (i.e. size > 0) and + /// `None` means it is inactive (size is 0). This is only needed because + /// the currently used `CLruCache` does not support zero capacity construction. + /// It can likely be simplified if the underlying implementation supports zero. + modules: Option>, } impl InMemoryCache { @@ -36,33 +43,32 @@ impl InMemoryCache { pub fn new(size: Size) -> Self { let preallocated_entries = size.0 / MINIMUM_MODULE_SIZE.0; + let size = NonZeroUsize::new(size.0); InMemoryCache { - modules: if size.0 > 0 { - Some(CLruCache::with_config( - CLruCacheConfig::new(NonZeroUsize::new(size.0).unwrap()) + modules: size.map(|non_zero_size| { + CLruCache::with_config( + CLruCacheConfig::new(non_zero_size) .with_memory(preallocated_entries) .with_scale(SizeScale), - )) - } else { - None - }, + ) + }), } } - pub fn store(&mut self, checksum: &Checksum, module: Module, size: usize) -> VmResult<()> { + pub fn store(&mut self, checksum: &Checksum, cached_module: CachedModule) -> VmResult<()> { if let Some(modules) = &mut self.modules { modules - .put_with_weight(*checksum, SizedModule { module, size }) - .map_err(|e| VmError::cache_err(format!("{:?}", e)))?; + .put_with_weight(*checksum, cached_module) + .map_err(|e| VmError::cache_err(format!("{e:?}")))?; } Ok(()) } /// Looks up a module in the cache and creates a new module - pub fn load(&mut self, checksum: &Checksum) -> VmResult> { + pub fn load(&mut self, checksum: &Checksum) -> VmResult> { if let Some(modules) = &mut self.modules { match modules.get(checksum) { - Some(module) => Ok(Some(module.clone())), + Some(cached) => Ok(Some(cached.clone())), None => Ok(None), } } else { @@ -93,27 +99,45 @@ impl InMemoryCache { #[cfg(test)] mod tests { use super::*; - use crate::size::Size; - use crate::wasm_backend::compile; + use crate::wasm_backend::{compile, make_compiling_engine, make_runtime_engine}; use std::mem; - use wasmer::{imports, Instance as WasmerInstance}; + use wasmer::{imports, Instance as WasmerInstance, Module, Store}; use wasmer_middlewares::metering::set_remaining_points; - const TESTING_GAS_LIMIT: u64 = 500_000_000; + const TESTING_MEMORY_LIMIT: Option = Some(Size::mebi(16)); + const TESTING_GAS_LIMIT: u64 = 500_000; // Based on `examples/module_size.sh` const TESTING_WASM_SIZE_FACTOR: usize = 18; + const WAT1: &str = r#"(module + (type $t0 (func (param i32) (result i32))) + (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) + local.get $p0 + i32.const 1 + i32.add) + )"#; + const WAT2: &str = r#"(module + (type $t0 (func (param i32) (result i32))) + (func $add_one (export "add_two") (type $t0) (param $p0 i32) (result i32) + local.get $p0 + i32.const 2 + i32.add) + )"#; + const WAT3: &str = r#"(module + (type $t0 (func (param i32) (result i32))) + (func $add_one (export "add_three") (type $t0) (param $p0 i32) (result i32) + local.get $p0 + i32.const 3 + i32.add) + )"#; + #[test] fn check_element_sizes() { let key_size = mem::size_of::(); assert_eq!(key_size, 32); - // A Module consists of a Store (3 Arcs) and an Arc to the Engine. - // This is 3 * 64bit of data, but we don't get any guarantee how the Rust structs - // Module and Store are aligned (https://doc.rust-lang.org/reference/type-layout.html#the-default-representation). - // So we get this value by trial and error. It can change over time and across platforms. let value_size = mem::size_of::(); - assert_eq!(value_size, 56); + assert_eq!(value_size, 8); // Just in case we want to go that route let boxed_value_size = mem::size_of::>(); @@ -125,16 +149,7 @@ mod tests { let mut cache = InMemoryCache::new(Size::mebi(200)); // Create module - let wasm = wat::parse_str( - r#"(module - (type $t0 (func (param i32) (result i32))) - (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 - i32.const 1 - i32.add) - )"#, - ) - .unwrap(); + let wasm = wat::parse_str(WAT1).unwrap(); let checksum = Checksum::generate(&wasm); // Module does not exist @@ -142,30 +157,37 @@ mod tests { assert!(cache_entry.is_none()); // Compile module - let original = compile(&wasm, None, &[]).unwrap(); + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let original = compile(&engine, &wasm).unwrap(); // Ensure original module can be executed { - let instance = WasmerInstance::new(&original, &imports! {}).unwrap(); - set_remaining_points(&instance, TESTING_GAS_LIMIT); + let mut store = Store::new(engine.clone()); + let instance = WasmerInstance::new(&mut store, &original, &imports! {}).unwrap(); + set_remaining_points(&mut store, &instance, TESTING_GAS_LIMIT); let add_one = instance.exports.get_function("add_one").unwrap(); - let result = add_one.call(&[42.into()]).unwrap(); + let result = add_one.call(&mut store, &[42.into()]).unwrap(); assert_eq!(result[0].unwrap_i32(), 43); } // Store module - let size = wasm.len() * TESTING_WASM_SIZE_FACTOR; - cache.store(&checksum, original, size).unwrap(); + let module = CachedModule { + module: original, + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: wasm.len() * TESTING_WASM_SIZE_FACTOR, + }; + cache.store(&checksum, module).unwrap(); // Load module let cached = cache.load(&checksum).unwrap().unwrap(); // Ensure cached module can be executed { - let instance = WasmerInstance::new(&cached.module, &imports! {}).unwrap(); - set_remaining_points(&instance, TESTING_GAS_LIMIT); + let mut store = Store::new(engine); + let instance = WasmerInstance::new(&mut store, &cached.module, &imports! {}).unwrap(); + set_remaining_points(&mut store, &instance, TESTING_GAS_LIMIT); let add_one = instance.exports.get_function("add_one").unwrap(); - let result = add_one.call(&[42.into()]).unwrap(); + let result = add_one.call(&mut store, &[42.into()]).unwrap(); assert_eq!(result[0].unwrap_i32(), 43); } } @@ -175,58 +197,43 @@ mod tests { let mut cache = InMemoryCache::new(Size::mebi(2)); // Create module - let wasm1 = wat::parse_str( - r#"(module - (type $t0 (func (param i32) (result i32))) - (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 - i32.const 1 - i32.add) - )"#, - ) - .unwrap(); + let wasm1 = wat::parse_str(WAT1).unwrap(); let checksum1 = Checksum::generate(&wasm1); - let wasm2 = wat::parse_str( - r#"(module - (type $t0 (func (param i32) (result i32))) - (func $add_one (export "add_two") (type $t0) (param $p0 i32) (result i32) - get_local $p0 - i32.const 2 - i32.add) - )"#, - ) - .unwrap(); + let wasm2 = wat::parse_str(WAT2).unwrap(); let checksum2 = Checksum::generate(&wasm2); - let wasm3 = wat::parse_str( - r#"(module - (type $t0 (func (param i32) (result i32))) - (func $add_one (export "add_three") (type $t0) (param $p0 i32) (result i32) - get_local $p0 - i32.const 3 - i32.add) - )"#, - ) - .unwrap(); + let wasm3 = wat::parse_str(WAT3).unwrap(); let checksum3 = Checksum::generate(&wasm3); assert_eq!(cache.len(), 0); // Add 1 - cache - .store(&checksum1, compile(&wasm1, None, &[]).unwrap(), 900_000) - .unwrap(); + let engine1 = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = CachedModule { + module: compile(&engine1, &wasm1).unwrap(), + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 900_000, + }; + cache.store(&checksum1, module).unwrap(); assert_eq!(cache.len(), 1); // Add 2 - cache - .store(&checksum2, compile(&wasm2, None, &[]).unwrap(), 900_000) - .unwrap(); + let engine2 = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = CachedModule { + module: compile(&engine2, &wasm2).unwrap(), + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 900_000, + }; + cache.store(&checksum2, module).unwrap(); assert_eq!(cache.len(), 2); // Add 3 (pushes out the previous two) - cache - .store(&checksum3, compile(&wasm3, None, &[]).unwrap(), 1_500_000) - .unwrap(); + let engine3 = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = CachedModule { + module: compile(&engine3, &wasm3).unwrap(), + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 1_500_000, + }; + cache.store(&checksum3, module).unwrap(); assert_eq!(cache.len(), 1); } @@ -235,58 +242,82 @@ mod tests { let mut cache = InMemoryCache::new(Size::mebi(2)); // Create module - let wasm1 = wat::parse_str( - r#"(module - (type $t0 (func (param i32) (result i32))) - (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 - i32.const 1 - i32.add) - )"#, - ) - .unwrap(); + let wasm1 = wat::parse_str(WAT1).unwrap(); let checksum1 = Checksum::generate(&wasm1); - let wasm2 = wat::parse_str( - r#"(module - (type $t0 (func (param i32) (result i32))) - (func $add_one (export "add_two") (type $t0) (param $p0 i32) (result i32) - get_local $p0 - i32.const 2 - i32.add) - )"#, - ) - .unwrap(); + let wasm2 = wat::parse_str(WAT2).unwrap(); let checksum2 = Checksum::generate(&wasm2); - let wasm3 = wat::parse_str( - r#"(module - (type $t0 (func (param i32) (result i32))) - (func $add_one (export "add_three") (type $t0) (param $p0 i32) (result i32) - get_local $p0 - i32.const 3 - i32.add) - )"#, - ) - .unwrap(); + let wasm3 = wat::parse_str(WAT3).unwrap(); let checksum3 = Checksum::generate(&wasm3); assert_eq!(cache.size(), 0); // Add 1 - cache - .store(&checksum1, compile(&wasm1, None, &[]).unwrap(), 900_000) - .unwrap(); - assert_eq!(cache.size(), 900_000); + let engine1 = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = CachedModule { + module: compile(&engine1, &wasm1).unwrap(), + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 900_000, + }; + cache.store(&checksum1, module).unwrap(); + assert_eq!(cache.size(), 900_032); // Add 2 - cache - .store(&checksum2, compile(&wasm2, None, &[]).unwrap(), 800_000) - .unwrap(); - assert_eq!(cache.size(), 1_700_000); + let engine2 = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = CachedModule { + module: compile(&engine2, &wasm2).unwrap(), + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 800_000, + }; + cache.store(&checksum2, module).unwrap(); + assert_eq!(cache.size(), 900_032 + 800_032); // Add 3 (pushes out the previous two) - cache - .store(&checksum3, compile(&wasm3, None, &[]).unwrap(), 1_500_000) - .unwrap(); - assert_eq!(cache.size(), 1_500_000); + let engine3 = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = CachedModule { + module: compile(&engine3, &wasm3).unwrap(), + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 1_500_000, + }; + cache.store(&checksum3, module).unwrap(); + assert_eq!(cache.size(), 1_500_032); + } + + #[test] + fn in_memory_cache_works_for_zero_size() { + // A cache size of 0 practically disabled the cache. It must work + // like any cache with insufficient space. + // We test all common methods here. + + let mut cache = InMemoryCache::new(Size::mebi(0)); + + // Create module + let wasm = wat::parse_str(WAT1).unwrap(); + let checksum = Checksum::generate(&wasm); + + // Module does not exist + let cache_entry = cache.load(&checksum).unwrap(); + assert!(cache_entry.is_none()); + assert_eq!(cache.len(), 0); + assert_eq!(cache.size(), 0); + + // Compile module + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let original = compile(&engine, &wasm).unwrap(); + + // Store module + let module = CachedModule { + module: original, + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: wasm.len() * TESTING_WASM_SIZE_FACTOR, + }; + cache.store(&checksum, module).unwrap(); + assert_eq!(cache.len(), 0); + assert_eq!(cache.size(), 0); + + // Load module + let cached = cache.load(&checksum).unwrap(); + assert!(cached.is_none()); + assert_eq!(cache.len(), 0); + assert_eq!(cache.size(), 0); } } diff --git a/packages/vm/src/modules/mod.rs b/packages/vm/src/modules/mod.rs index c00ebae121..ec3804c914 100644 --- a/packages/vm/src/modules/mod.rs +++ b/packages/vm/src/modules/mod.rs @@ -1,9 +1,10 @@ +mod cached_module; mod file_system_cache; mod in_memory_cache; mod pinned_memory_cache; -mod sized_module; mod versioning; +pub use cached_module::CachedModule; pub use file_system_cache::FileSystemCache; pub use in_memory_cache::InMemoryCache; pub use pinned_memory_cache::PinnedMemoryCache; diff --git a/packages/vm/src/modules/pinned_memory_cache.rs b/packages/vm/src/modules/pinned_memory_cache.rs index 61ef8cc746..662f5c1dd7 100644 --- a/packages/vm/src/modules/pinned_memory_cache.rs +++ b/packages/vm/src/modules/pinned_memory_cache.rs @@ -1,12 +1,21 @@ +use cosmwasm_std::Checksum; use std::collections::HashMap; -use wasmer::Module; -use super::sized_module::SizedModule; -use crate::{Checksum, VmResult}; +use super::cached_module::CachedModule; +use crate::VmResult; + +/// Struct storing some additional metadata, which is only of interest for the pinned cache, +/// alongside the cached module. +pub struct InstrumentedModule { + /// Number of loads from memory this module received + pub hits: u32, + /// The actual cached module + pub module: CachedModule, +} /// An pinned in memory module cache pub struct PinnedMemoryCache { - modules: HashMap, + modules: HashMap, } impl PinnedMemoryCache { @@ -17,8 +26,19 @@ impl PinnedMemoryCache { } } - pub fn store(&mut self, checksum: &Checksum, module: Module, size: usize) -> VmResult<()> { - self.modules.insert(*checksum, SizedModule { module, size }); + pub fn iter(&self) -> impl Iterator { + self.modules.iter() + } + + pub fn store(&mut self, checksum: &Checksum, cached_module: CachedModule) -> VmResult<()> { + self.modules.insert( + *checksum, + InstrumentedModule { + hits: 0, + module: cached_module, + }, + ); + Ok(()) } @@ -30,9 +50,12 @@ impl PinnedMemoryCache { } /// Looks up a module in the cache and creates a new module - pub fn load(&mut self, checksum: &Checksum) -> VmResult> { - match self.modules.get(checksum) { - Some(module) => Ok(Some(module.module.clone())), + pub fn load(&mut self, checksum: &Checksum) -> VmResult> { + match self.modules.get_mut(checksum) { + Some(cached) => { + cached.hits = cached.hits.saturating_add(1); + Ok(Some(cached.module.clone())) + } None => Ok(None), } } @@ -52,18 +75,25 @@ impl PinnedMemoryCache { /// This is based on the values provided with `store`. No actual /// memory size is measured here. pub fn size(&self) -> usize { - self.modules.iter().map(|(_, module)| module.size).sum() + self.modules + .iter() + .map(|(key, module)| std::mem::size_of_val(key) + module.module.size_estimate) + .sum() } } #[cfg(test)] mod tests { use super::*; - use crate::wasm_backend::compile; - use wasmer::{imports, Instance as WasmerInstance}; + use crate::{ + wasm_backend::{compile, make_compiling_engine, make_runtime_engine}, + Size, + }; + use wasmer::{imports, Instance as WasmerInstance, Store}; use wasmer_middlewares::metering::set_remaining_points; - const TESTING_GAS_LIMIT: u64 = 500_000_000; + const TESTING_MEMORY_LIMIT: Option = Some(Size::mebi(16)); + const TESTING_GAS_LIMIT: u64 = 500_000; #[test] fn pinned_memory_cache_run() { @@ -74,7 +104,7 @@ mod tests { r#"(module (type $t0 (func (param i32) (result i32))) (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 + local.get $p0 i32.const 1 i32.add) )"#, @@ -87,29 +117,37 @@ mod tests { assert!(cache_entry.is_none()); // Compile module - let original = compile(&wasm, None, &[]).unwrap(); + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let original = compile(&engine, &wasm).unwrap(); // Ensure original module can be executed { - let instance = WasmerInstance::new(&original, &imports! {}).unwrap(); - set_remaining_points(&instance, TESTING_GAS_LIMIT); + let mut store = Store::new(engine.clone()); + let instance = WasmerInstance::new(&mut store, &original, &imports! {}).unwrap(); + set_remaining_points(&mut store, &instance, TESTING_GAS_LIMIT); let add_one = instance.exports.get_function("add_one").unwrap(); - let result = add_one.call(&[42.into()]).unwrap(); + let result = add_one.call(&mut store, &[42.into()]).unwrap(); assert_eq!(result[0].unwrap_i32(), 43); } // Store module - cache.store(&checksum, original, 0).unwrap(); + let module = CachedModule { + module: original, + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 0, + }; + cache.store(&checksum, module).unwrap(); // Load module let cached = cache.load(&checksum).unwrap().unwrap(); // Ensure cached module can be executed { - let instance = WasmerInstance::new(&cached, &imports! {}).unwrap(); - set_remaining_points(&instance, TESTING_GAS_LIMIT); + let mut store = Store::new(engine); + let instance = WasmerInstance::new(&mut store, &cached.module, &imports! {}).unwrap(); + set_remaining_points(&mut store, &instance, TESTING_GAS_LIMIT); let add_one = instance.exports.get_function("add_one").unwrap(); - let result = add_one.call(&[42.into()]).unwrap(); + let result = add_one.call(&mut store, &[42.into()]).unwrap(); assert_eq!(result[0].unwrap_i32(), 43); } } @@ -123,7 +161,7 @@ mod tests { r#"(module (type $t0 (func (param i32) (result i32))) (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 + local.get $p0 i32.const 1 i32.add) )"#, @@ -134,8 +172,14 @@ mod tests { assert!(!cache.has(&checksum)); // Add - let original = compile(&wasm, None, &[]).unwrap(); - cache.store(&checksum, original, 0).unwrap(); + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let original = compile(&engine, &wasm).unwrap(); + let module = CachedModule { + module: original, + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 0, + }; + cache.store(&checksum, module).unwrap(); assert!(cache.has(&checksum)); @@ -145,6 +189,51 @@ mod tests { assert!(!cache.has(&checksum)); } + #[test] + fn hit_metric_works() { + let mut cache = PinnedMemoryCache::new(); + + // Create module + let wasm = wat::parse_str( + r#"(module + (type $t0 (func (param i32) (result i32))) + (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) + local.get $p0 + i32.const 1 + i32.add) + )"#, + ) + .unwrap(); + let checksum = Checksum::generate(&wasm); + + assert!(!cache.has(&checksum)); + + // Add + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let original = compile(&engine, &wasm).unwrap(); + let module = CachedModule { + module: original, + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 0, + }; + cache.store(&checksum, module).unwrap(); + + let (_checksum, module) = cache + .iter() + .find(|(iter_checksum, _module)| **iter_checksum == checksum) + .unwrap(); + + assert_eq!(module.hits, 0); + + let _ = cache.load(&checksum).unwrap(); + let (_checksum, module) = cache + .iter() + .find(|(iter_checksum, _module)| **iter_checksum == checksum) + .unwrap(); + + assert_eq!(module.hits, 1); + } + #[test] fn len_works() { let mut cache = PinnedMemoryCache::new(); @@ -154,7 +243,7 @@ mod tests { r#"(module (type $t0 (func (param i32) (result i32))) (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 + local.get $p0 i32.const 1 i32.add) )"#, @@ -165,8 +254,14 @@ mod tests { assert_eq!(cache.len(), 0); // Add - let original = compile(&wasm, None, &[]).unwrap(); - cache.store(&checksum, original, 0).unwrap(); + let engine = make_compiling_engine(TESTING_MEMORY_LIMIT); + let original = compile(&engine, &wasm).unwrap(); + let module = CachedModule { + module: original, + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 0, + }; + cache.store(&checksum, module).unwrap(); assert_eq!(cache.len(), 1); @@ -185,7 +280,7 @@ mod tests { r#"(module (type $t0 (func (param i32) (result i32))) (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32) - get_local $p0 + local.get $p0 i32.const 1 i32.add) )"#, @@ -196,7 +291,7 @@ mod tests { r#"(module (type $t0 (func (param i32) (result i32))) (func $add_one (export "add_two") (type $t0) (param $p0 i32) (result i32) - get_local $p0 + local.get $p0 i32.const 2 i32.add) )"#, @@ -207,18 +302,28 @@ mod tests { assert_eq!(cache.size(), 0); // Add 1 - let original = compile(&wasm1, None, &[]).unwrap(); - cache.store(&checksum1, original, 500).unwrap(); - assert_eq!(cache.size(), 500); + let engine1 = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = CachedModule { + module: compile(&engine1, &wasm1).unwrap(), + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 500, + }; + cache.store(&checksum1, module).unwrap(); + assert_eq!(cache.size(), 532); // Add 2 - let original = compile(&wasm2, None, &[]).unwrap(); - cache.store(&checksum2, original, 300).unwrap(); - assert_eq!(cache.size(), 800); + let engine2 = make_compiling_engine(TESTING_MEMORY_LIMIT); + let module = CachedModule { + module: compile(&engine2, &wasm2).unwrap(), + engine: make_runtime_engine(TESTING_MEMORY_LIMIT), + size_estimate: 300, + }; + cache.store(&checksum2, module).unwrap(); + assert_eq!(cache.size(), 532 + 332); // Remove 1 cache.remove(&checksum1).unwrap(); - assert_eq!(cache.size(), 300); + assert_eq!(cache.size(), 332); // Remove 2 cache.remove(&checksum2).unwrap(); diff --git a/packages/vm/src/modules/sized_module.rs b/packages/vm/src/modules/sized_module.rs deleted file mode 100644 index 3ca9da7392..0000000000 --- a/packages/vm/src/modules/sized_module.rs +++ /dev/null @@ -1,7 +0,0 @@ -use wasmer::Module; - -#[derive(Debug, Clone)] -pub struct SizedModule { - pub module: Module, - pub size: usize, -} diff --git a/packages/vm/src/modules/versioning.rs b/packages/vm/src/modules/versioning.rs index 86ce486f8b..50f65bdb42 100644 --- a/packages/vm/src/modules/versioning.rs +++ b/packages/vm/src/modules/versioning.rs @@ -1,4 +1,4 @@ -use crate::wasm_backend::compile; +use crate::wasm_backend::{compile, make_compiling_engine}; /// This header prefix contains the module type (wasmer-universal) and /// the magic value WASMER\0\0. @@ -12,11 +12,13 @@ const METADATA_HEADER_LEN: usize = 16; // https://github.com/wasmerio/wasmer/blo fn current_wasmer_module_header() -> Vec { // echo "(module)" > my.wat && wat2wasm my.wat && hexdump -C my.wasm const WASM: &[u8] = b"\x00\x61\x73\x6d\x01\x00\x00\x00"; - let module = compile(WASM, None, &[]).unwrap(); + let engine = make_compiling_engine(None); + let module = compile(&engine, WASM).unwrap(); + let mut bytes = module.serialize().unwrap_or_default(); bytes.truncate(ENGINE_TYPE_LEN + METADATA_HEADER_LEN); - bytes + bytes.into() } /// Obtains the module version from Wasmer that is currently used. @@ -49,6 +51,6 @@ mod tests { #[test] fn current_wasmer_module_version_works() { let version = current_wasmer_module_version(); - assert_eq!(version, 1); + assert_eq!(version, 8); } } diff --git a/packages/vm/src/parsed_wasm.rs b/packages/vm/src/parsed_wasm.rs new file mode 100644 index 0000000000..a6ceb7090f --- /dev/null +++ b/packages/vm/src/parsed_wasm.rs @@ -0,0 +1,278 @@ +use std::{fmt, mem, str}; + +use wasmer::wasmparser::{ + BinaryReaderError, CompositeInnerType, Export, FuncToValidate, FunctionBody, Import, + MemoryType, Parser, Payload, TableType, ValidPayload, Validator, ValidatorResources, + WasmFeatures, +}; + +use crate::{VmError, VmResult}; + +/// Opaque wrapper type implementing `Debug` +/// +/// The purpose of this type is to wrap types that do not implement `Debug` themselves. +/// For example, you have a large struct and derive `Debug` on it but one member does not implement the trait, that's where this type comes in. +/// +/// Instead of printing a full debug representation of the underlying data, it simply prints something akin to this: +/// +/// ```ignore +/// WrappedType { ... } +/// ``` +#[derive(Default)] +pub struct OpaqueDebug(pub T); + +impl fmt::Debug for OpaqueDebug { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct(std::any::type_name::()) + .finish_non_exhaustive() + } +} + +#[derive(Debug)] +pub enum FunctionValidator<'a> { + Pending(OpaqueDebug, FunctionBody<'a>)>>), + Success, + Error(BinaryReaderError), +} + +impl<'a> FunctionValidator<'a> { + fn push(&mut self, item: (FuncToValidate, FunctionBody<'a>)) { + let Self::Pending(OpaqueDebug(ref mut funcs)) = self else { + panic!("attempted to push function into non-pending validator"); + }; + + funcs.push(item); + } +} + +/// A parsed and validated wasm module. +/// It keeps track of the parts that are important for our static analysis and compatibility checks. +#[derive(Debug)] +pub struct ParsedWasm<'a> { + pub version: u16, + pub exports: Vec>, + pub imports: Vec>, + pub tables: Vec, + pub memories: Vec, + pub function_count: usize, + pub type_count: u32, + /// How many parameters a type has. + /// The index is the type id + pub type_params: Vec, + /// How many parameters the function with the most parameters has + pub max_func_params: usize, + /// How many results the function with the most results has + pub max_func_results: usize, + /// How many function parameters are used in the module + pub total_func_params: usize, + /// Collections of functions that are potentially pending validation + pub func_validator: FunctionValidator<'a>, + /// Contract migrate version as defined in a custom section + pub contract_migrate_version: Option, +} + +impl<'a> ParsedWasm<'a> { + pub fn parse(wasm: &'a [u8]) -> VmResult { + let features = WasmFeatures::MUTABLE_GLOBAL + | WasmFeatures::SATURATING_FLOAT_TO_INT + | WasmFeatures::SIGN_EXTENSION + | WasmFeatures::MULTI_VALUE + | WasmFeatures::FLOATS + | WasmFeatures::REFERENCE_TYPES; + + let mut validator = Validator::new_with_features(features); + + let mut this = Self { + version: 0, + exports: vec![], + imports: vec![], + tables: vec![], + memories: vec![], + function_count: 0, + type_count: 0, + type_params: Vec::new(), + max_func_params: 0, + max_func_results: 0, + total_func_params: 0, + func_validator: FunctionValidator::Pending(OpaqueDebug::default()), + contract_migrate_version: None, + }; + + for p in Parser::new(0).parse_all(wasm) { + let p = p?; + // validate the payload + if let ValidPayload::Func(fv, body) = validator.payload(&p)? { + // also validate function bodies + this.func_validator.push((fv, body)); + this.function_count += 1; + } + + match p { + Payload::TypeSection(t) => { + this.type_count = 0; + // t.count() is a lower bound + this.type_params = Vec::with_capacity(t.count() as usize); + for group in t.into_iter() { + let types = group?.into_types(); + // update count + this.type_count += types.len() as u32; + + for ty in types { + match ty.composite_type.inner { + CompositeInnerType::Func(ft) => { + this.type_params.push(ft.params().len()); + + this.max_func_params = + core::cmp::max(ft.params().len(), this.max_func_params); + this.max_func_results = + core::cmp::max(ft.results().len(), this.max_func_results); + } + CompositeInnerType::Array(_) | CompositeInnerType::Struct(_) => { + // ignoring these for now, as they are only available with the GC + // proposal and we explicitly disabled that above + } + } + } + } + } + Payload::FunctionSection(section) => { + // In valid Wasm, the function section always has to come after the type section + // (see https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#modules%E2%91%A0%E2%93%AA), + // so we can assume that the type_params map is already filled at this point + + for a in section { + let type_index = a? as usize; + this.total_func_params += + this.type_params.get(type_index).ok_or_else(|| { + // this will also be thrown if the wasm section order is invalid + VmError::static_validation_err( + "Wasm bytecode error: function uses unknown type index", + ) + })? + } + } + Payload::Version { num, .. } => this.version = num, + Payload::ImportSection(i) => { + this.imports = i.into_iter().collect::, _>>()?; + } + Payload::TableSection(t) => { + this.tables = t + .into_iter() + .map(|r| r.map(|t| t.ty)) + .collect::, _>>()?; + } + Payload::MemorySection(m) => { + this.memories = m.into_iter().collect::, _>>()?; + } + Payload::ExportSection(e) => { + this.exports = e.into_iter().collect::, _>>()?; + } + Payload::CustomSection(reader) if reader.name() == "cw_migrate_version" => { + // This is supposed to be valid UTF-8 + let raw_version = str::from_utf8(reader.data()) + .map_err(|err| VmError::static_validation_err(err.to_string()))?; + + this.contract_migrate_version = Some( + raw_version + .parse::() + .map_err(|err| VmError::static_validation_err(err.to_string()))?, + ); + } + _ => {} // ignore everything else + } + } + + Ok(this) + } + + /// Perform the expensive operation of validating each function body + /// + /// Note: This function caches the output of this function into the field `func_validator` so repeated invocations are cheap. + pub fn validate_funcs(&mut self) -> VmResult<()> { + match self.func_validator { + FunctionValidator::Pending(OpaqueDebug(ref mut funcs)) => { + let result = (|| { + let mut allocations = <_>::default(); + for (func, body) in mem::take(funcs) { + let mut validator = func.into_validator(allocations); + validator.validate(&body)?; + allocations = validator.into_allocations(); + } + Ok(()) + })(); + + self.func_validator = match result { + Ok(()) => FunctionValidator::Success, + Err(err) => FunctionValidator::Error(err), + }; + + self.validate_funcs() + } + FunctionValidator::Success => Ok(()), + FunctionValidator::Error(ref err) => Err(err.clone().into()), + } + } +} + +#[cfg(test)] +mod test { + use super::ParsedWasm; + + #[test] + fn read_migrate_version() { + let wasm_data = + wat::parse_str(r#"( module ( @custom "cw_migrate_version" "42" ) )"#).unwrap(); + let parsed = ParsedWasm::parse(&wasm_data).unwrap(); + + assert_eq!(parsed.contract_migrate_version, Some(42)); + } + + #[test] + fn read_migrate_version_fails() { + let wasm_data = + wat::parse_str(r#"( module ( @custom "cw_migrate_version" "not a number" ) )"#) + .unwrap(); + assert!(ParsedWasm::parse(&wasm_data).is_err()); + } + + #[test] + fn parsed_wasm_counts_functions_correctly() { + let wasm = wat::parse_str(r#"(module)"#).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); + assert_eq!(module.function_count, 0); + + let wasm = wat::parse_str( + r#"(module + (type (func)) + (func (type 0) nop) + (func (type 0) nop) + (export "foo" (func 0)) + (export "bar" (func 0)) + )"#, + ) + .unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); + assert_eq!(module.function_count, 2); + } + + #[test] + fn parsed_wasm_counts_func_io_correctly() { + let wasm = wat::parse_str(r#"(module)"#).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); + assert_eq!(module.max_func_params, 0); + assert_eq!(module.max_func_results, 0); + + let wasm = wat::parse_str( + r#"(module + (type (func (param i32 i32 i32) (result i32))) + (type (func (param i32) (result i32 i32))) + (func (type 1) i32.const 42 i32.const 42) + (func (type 0) i32.const 42) + )"#, + ) + .unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); + assert_eq!(module.max_func_params, 3); + assert_eq!(module.max_func_results, 2); + } +} diff --git a/packages/vm/src/sections.rs b/packages/vm/src/sections.rs index c0c40166a5..00bb9f0e45 100644 --- a/packages/vm/src/sections.rs +++ b/packages/vm/src/sections.rs @@ -1,13 +1,12 @@ use crate::conversion::to_u32; -use crate::errors::VmResult; +use crate::{CommunicationError, VmResult}; /// Decodes sections of data into multiple slices. /// /// Each encoded section is suffixed by a section length, encoded as big endian uint32. /// -/// See also: `encode_section`. -#[allow(dead_code)] -pub fn decode_sections(data: &[u8]) -> Vec<&[u8]> { +/// See also: [`encode_sections`]. +pub fn decode_sections(data: &[u8]) -> Result, CommunicationError> { let mut result: Vec<&[u8]> = vec![]; let mut remaining_len = data.len(); while remaining_len >= 4 { @@ -17,11 +16,20 @@ pub fn decode_sections(data: &[u8]) -> Vec<&[u8]> { data[remaining_len - 2], data[remaining_len - 1], ]) as usize; - result.push(&data[remaining_len - 4 - tail_len..remaining_len - 4]); - remaining_len -= 4 + tail_len; + let tail_len_idx = remaining_len - 4; // index of the first byte of the tail length + let section_start = tail_len_idx + .checked_sub(tail_len) + .ok_or_else(|| CommunicationError::invalid_section("section length overflow"))?; + result.push(&data[section_start..tail_len_idx]); + remaining_len = section_start; + } + if remaining_len > 0 { + return Err(CommunicationError::invalid_section( + "extra data outside of any section", + )); } result.reverse(); - result + Ok(result) } /// Encodes multiple sections of data into one vector. @@ -57,55 +65,85 @@ mod tests { #[test] fn decode_sections_works_for_empty_sections() { - let dec = decode_sections(&[]); + let dec = decode_sections(&[]).unwrap(); assert_eq!(dec.len(), 0); - let dec = decode_sections(b"\0\0\0\0"); + let dec = decode_sections(b"\0\0\0\0").unwrap(); assert_eq!(dec, &[&[0u8; 0]]); - let dec = decode_sections(b"\0\0\0\0\0\0\0\0"); + let dec = decode_sections(b"\0\0\0\0\0\0\0\0").unwrap(); assert_eq!(dec, &[&[0u8; 0]; 2]); - let dec = decode_sections(b"\0\0\0\0\0\0\0\0\0\0\0\0"); + let dec = decode_sections(b"\0\0\0\0\0\0\0\0\0\0\0\0").unwrap(); assert_eq!(dec, &[&[0u8; 0]; 3]); - // ignores "trailing" stuff - let dec = decode_sections(b"\0\0\0\0\0\0\0\0\0\0\0"); - assert_eq!(dec, &[&[0u8; 0]; 2]); } #[test] fn decode_sections_works_for_one_element() { - let dec = decode_sections(b"\xAA\0\0\0\x01"); + let dec = decode_sections(b"\xAA\0\0\0\x01").unwrap(); assert_eq!(dec, &[vec![0xAA]]); - let dec = decode_sections(b"\xAA\xBB\0\0\0\x02"); + let dec = decode_sections(b"\xAA\xBB\0\0\0\x02").unwrap(); assert_eq!(dec, &[vec![0xAA, 0xBB]]); - let dec = decode_sections(b"\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\0\0\x01\x15"); + let dec = decode_sections(b"\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\0\0\x01\x15").unwrap(); assert_eq!(dec, &[vec![0x9D; 277]]); } #[test] fn decode_sections_works_for_two_elements() { let data = b"\xAA\0\0\0\x01\xBB\xCC\0\0\0\x02".to_vec(); - assert_eq!(decode_sections(&data), &[vec![0xAA], vec![0xBB, 0xCC]]); + assert_eq!( + decode_sections(&data).unwrap(), + &[vec![0xAA], vec![0xBB, 0xCC]] + ); let data = b"\xDE\xEF\x62\0\0\0\x03\0\0\0\0".to_vec(); - assert_eq!(decode_sections(&data), &[vec![0xDE, 0xEF, 0x62], vec![]]); + assert_eq!( + decode_sections(&data).unwrap(), + &[vec![0xDE, 0xEF, 0x62], vec![]] + ); let data = b"\0\0\0\0\xDE\xEF\x62\0\0\0\x03".to_vec(); - assert_eq!(decode_sections(&data), &[vec![], vec![0xDE, 0xEF, 0x62]]); + assert_eq!( + decode_sections(&data).unwrap(), + &[vec![], vec![0xDE, 0xEF, 0x62]] + ); let data = b"\0\0\0\0\0\0\0\0".to_vec(); - assert_eq!(decode_sections(&data), &[vec![0u8; 0], vec![]]); + assert_eq!(decode_sections(&data).unwrap(), &[vec![0u8; 0], vec![]]); let data = b"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\0\0\x13\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\x9D\0\0\x01\x15".to_vec(); - assert_eq!(decode_sections(&data), &[vec![0xFF; 19], vec![0x9D; 277]]); + assert_eq!( + decode_sections(&data).unwrap(), + &[vec![0xFF; 19], vec![0x9D; 277]] + ); } #[test] fn decode_sections_works_for_multiple_elements() { - let dec = decode_sections(b"\xAA\0\0\0\x01"); + let dec = decode_sections(b"\xAA\0\0\0\x01").unwrap(); assert_eq!(dec, &[vec![0xAA]]); - let dec = decode_sections(b"\xAA\0\0\0\x01\xDE\xDE\0\0\0\x02"); + let dec = decode_sections(b"\xAA\0\0\0\x01\xDE\xDE\0\0\0\x02").unwrap(); assert_eq!(dec, &[vec![0xAA], vec![0xDE, 0xDE]]); - let dec = decode_sections(b"\xAA\0\0\0\x01\xDE\xDE\0\0\0\x02\0\0\0\0"); + let dec = decode_sections(b"\xAA\0\0\0\x01\xDE\xDE\0\0\0\x02\0\0\0\0").unwrap(); assert_eq!(dec, &[vec![0xAA], vec![0xDE, 0xDE], vec![]]); - let dec = decode_sections(b"\xAA\0\0\0\x01\xDE\xDE\0\0\0\x02\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\0\0\x13"); + let dec = decode_sections(b"\xAA\0\0\0\x01\xDE\xDE\0\0\0\x02\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\0\0\x13").unwrap(); assert_eq!(dec, &[vec![0xAA], vec![0xDE, 0xDE], vec![], vec![0xFF; 19]]); } + #[test] + fn decode_sections_fails_for_invalid_length() { + // section length too long + assert!(decode_sections(b"\xAA\0\0\0\x02").is_err()); + // section length without section + assert!(decode_sections(b"\xAA\0\0\0\x01\xBB\x03\0\0\0\x03").is_err()); + } + + #[test] + fn decode_sections_fails_for_extra_bytes() { + // extra data after successful section + assert!(decode_sections(b"\x44\xAA\0\0\0\x01").is_err()); + assert!(decode_sections(b"\x44\x44\xAA\0\0\0\x01").is_err()); + assert!(decode_sections(b"\x44\x44\x44\xAA\0\0\0\x01").is_err()); + + // Insufficient length for even a first section (or extra data of 0 sections) + assert!(decode_sections(b"\x44").is_err()); + assert!(decode_sections(b"\x44\x44").is_err()); + assert!(decode_sections(b"\x44\x44\x44").is_err()); + } + #[test] fn encode_sections_works_for_empty_sections() { let enc = encode_sections(&[]).unwrap(); diff --git a/packages/vm/src/serde.rs b/packages/vm/src/serde.rs index c884dd1b80..ce6c9e0f81 100644 --- a/packages/vm/src/serde.rs +++ b/packages/vm/src/serde.rs @@ -95,7 +95,7 @@ mod tests { assert_eq!(length, 13); assert_eq!(max_length, 5); } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } diff --git a/packages/vm/src/size.rs b/packages/vm/src/size.rs index 14ec88f928..b4d690ccdf 100644 --- a/packages/vm/src/size.rs +++ b/packages/vm/src/size.rs @@ -1,7 +1,14 @@ -#[derive(Copy, Clone, Debug)] -pub struct Size(pub usize); +use serde::{Deserialize, Serialize}; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] +pub struct Size(pub(crate) usize); impl Size { + /// Creates a size of `n` + pub const fn new(n: usize) -> Self { + Size(n) + } + /// Creates a size of `n` kilo pub const fn kilo(n: usize) -> Self { Size(n * 1000) @@ -39,8 +46,8 @@ mod tests { #[test] fn constructors_work() { - assert_eq!(Size(0).0, 0); - assert_eq!(Size(3).0, 3); + assert_eq!(Size::new(0).0, Size(0).0); + assert_eq!(Size::new(3).0, Size(3).0); assert_eq!(Size::kilo(0).0, 0); assert_eq!(Size::kilo(3).0, 3000); @@ -63,8 +70,8 @@ mod tests { #[test] fn implements_debug() { - assert_eq!(format!("{:?}", Size(0)), "Size(0)"); - assert_eq!(format!("{:?}", Size(123)), "Size(123)"); + assert_eq!(format!("{:?}", Size::new(0)), "Size(0)"); + assert_eq!(format!("{:?}", Size::new(123)), "Size(123)"); assert_eq!(format!("{:?}", Size::kibi(2)), "Size(2048)"); assert_eq!(format!("{:?}", Size::mebi(1)), "Size(1048576)"); } diff --git a/packages/vm/src/static_analysis.rs b/packages/vm/src/static_analysis.rs index 9db720db9a..568192d970 100644 --- a/packages/vm/src/static_analysis.rs +++ b/packages/vm/src/static_analysis.rs @@ -1,59 +1,102 @@ -use parity_wasm::elements::{deserialize_buffer, Internal, Module}; use std::collections::HashSet; -use crate::errors::{VmError, VmResult}; +use strum::{AsRefStr, Display, EnumString}; +use wasmer::wasmparser::ExternalKind; -pub const REQUIRED_IBC_EXPORTS: &[&str] = &[ - "ibc_channel_open", - "ibc_channel_connect", - "ibc_channel_close", - "ibc_packet_receive", - "ibc_packet_ack", - "ibc_packet_timeout", -]; +use crate::parsed_wasm::ParsedWasm; + +/// An enum containing all available contract entrypoints. +/// This also provides conversions to and from strings. +#[derive(PartialEq, Eq, Debug, Clone, Copy, Hash, EnumString, Display, AsRefStr)] +pub enum Entrypoint { + #[strum(serialize = "instantiate")] + Instantiate, + #[strum(serialize = "execute")] + Execute, + #[strum(serialize = "migrate")] + Migrate, + #[strum(serialize = "sudo")] + Sudo, + #[strum(serialize = "reply")] + Reply, + #[strum(serialize = "query")] + Query, + #[strum(serialize = "ibc_channel_open")] + IbcChannelOpen, + #[strum(serialize = "ibc_channel_connect")] + IbcChannelConnect, + #[strum(serialize = "ibc_channel_close")] + IbcChannelClose, + #[strum(serialize = "ibc_packet_receive")] + IbcPacketReceive, + #[strum(serialize = "ibc_packet_ack")] + IbcPacketAck, + #[strum(serialize = "ibc_packet_timeout")] + IbcPacketTimeout, + #[strum(serialize = "ibc_source_callback")] + IbcSourceCallback, + #[strum(serialize = "ibc_destination_callback")] + IbcDestinationCallback, + #[strum(serialize = "ibc2_packet_receive")] + Ibc2PacketReceive, + #[strum(serialize = "ibc2_packet_timeout")] + Ibc2PacketTimeout, + #[strum(serialize = "ibc2_packet_ack")] + Ibc2PacketAck, + #[strum(serialize = "ibc2_packet_send")] + Ibc2PacketSend, +} -pub fn deserialize_wasm(wasm_code: &[u8]) -> VmResult { - deserialize_buffer(wasm_code).map_err(|err| { - VmError::static_validation_err(format!( - "Wasm bytecode could not be deserialized. Deserialization error: \"{}\"", - err - )) - }) +// sort entrypoints by their &str representation +impl PartialOrd for Entrypoint { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } } +impl Ord for Entrypoint { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.as_ref().cmp(other.as_ref()) + } +} + +pub const REQUIRED_IBC_EXPORTS: &[Entrypoint] = &[ + Entrypoint::IbcChannelOpen, + Entrypoint::IbcChannelConnect, + Entrypoint::IbcChannelClose, + Entrypoint::IbcPacketReceive, + Entrypoint::IbcPacketAck, + Entrypoint::IbcPacketTimeout, +]; /// A trait that allows accessing shared functionality of `parity_wasm::elements::Module` /// and `wasmer::Module` in a shared fashion. pub trait ExportInfo { /// Returns all exported function names with the given prefix - fn exported_function_names(&self, prefix: Option<&str>) -> HashSet; + fn exported_function_names(self, prefix: Option<&str>) -> HashSet; } -impl ExportInfo for Module { - fn exported_function_names(&self, prefix: Option<&str>) -> HashSet { - self.export_section() - .map_or(HashSet::default(), |export_section| { - export_section - .entries() - .iter() - .filter_map(|entry| match entry.internal() { - Internal::Function(_) => Some(entry.field()), - _ => None, - }) - .filter(|name| { - if let Some(required_prefix) = prefix { - name.starts_with(required_prefix) - } else { - true - } - }) - .map(|name| name.to_string()) - .collect() +impl ExportInfo for &ParsedWasm<'_> { + fn exported_function_names(self, prefix: Option<&str>) -> HashSet { + self.exports + .iter() + .filter_map(|export| match export.kind { + ExternalKind::Func => Some(export.name), + _ => None, }) + .filter(|name| { + if let Some(required_prefix) = prefix { + name.starts_with(required_prefix) + } else { + true + } + }) + .map(|name| name.to_string()) + .collect() } } -impl ExportInfo for wasmer::Module { - fn exported_function_names(&self, prefix: Option<&str>) -> HashSet { +impl ExportInfo for &wasmer::Module { + fn exported_function_names(self, prefix: Option<&str>) -> HashSet { self.exports() .functions() .filter_map(|function_export| { @@ -72,61 +115,54 @@ impl ExportInfo for wasmer::Module { } } -/// Returns true if and only if all IBC entry points ([`REQUIRED_IBC_EXPORTS`]) -/// exist as exported functions. This does not guarantee the entry points -/// are functional and for simplicity does not even check their signatures. -pub fn has_ibc_entry_points(module: &impl ExportInfo) -> bool { - let available_exports = module.exported_function_names(None); - REQUIRED_IBC_EXPORTS - .iter() - .all(|required| available_exports.contains(*required)) -} - #[cfg(test)] mod tests { + use std::str::FromStr; + + use crate::wasm_backend::make_compiler_config; + use crate::VmError; + use super::*; - use parity_wasm::elements::Internal; - use wasmer::{Cranelift, Store, Universal}; + use wasmer::Store; - static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm"); static CORRUPTED: &[u8] = include_bytes!("../testdata/corrupted.wasm"); #[test] - fn deserialize_wasm_works() { - let module = deserialize_wasm(CONTRACT).unwrap(); - assert_eq!(module.version(), 1); + fn deserialize_exports_works() { + let module = ParsedWasm::parse(HACKATOM).unwrap(); + assert_eq!(module.version, 1); let exported_functions = module - .export_section() - .unwrap() - .entries() + .exports .iter() - .filter(|entry| matches!(entry.internal(), Internal::Function(_))); - assert_eq!(exported_functions.count(), 8); // 4 required exports plus "execute", "migrate", "query" and "sudo" + .filter(|entry| matches!(entry.kind, ExternalKind::Func)); + assert_eq!(exported_functions.count(), 15); let exported_memories = module - .export_section() - .unwrap() - .entries() + .exports .iter() - .filter(|entry| matches!(entry.internal(), Internal::Memory(_))); + .filter(|entry| matches!(entry.kind, ExternalKind::Memory)); assert_eq!(exported_memories.count(), 1); } #[test] fn deserialize_wasm_corrupted_data() { - match deserialize_wasm(CORRUPTED).unwrap_err() { + match ParsedWasm::parse(CORRUPTED) + .and_then(|mut parsed| parsed.validate_funcs()) + .unwrap_err() + { VmError::StaticValidationErr { msg, .. } => { assert!(msg.starts_with("Wasm bytecode could not be deserialized.")) } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } #[test] fn exported_function_names_works_for_parity_with_no_prefix() { let wasm = wat::parse_str(r#"(module)"#).unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); let exports = module.exported_function_names(None); assert_eq!(exports, HashSet::new()); @@ -142,7 +178,7 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); let exports = module.exported_function_names(None); assert_eq!( exports, @@ -153,7 +189,7 @@ mod tests { #[test] fn exported_function_names_works_for_parity_with_prefix() { let wasm = wat::parse_str(r#"(module)"#).unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); let exports = module.exported_function_names(Some("b")); assert_eq!(exports, HashSet::new()); @@ -170,7 +206,7 @@ mod tests { )"#, ) .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); + let module = ParsedWasm::parse(&wasm).unwrap(); let exports = module.exported_function_names(Some("b")); assert_eq!( exports, @@ -181,7 +217,8 @@ mod tests { #[test] fn exported_function_names_works_for_wasmer_with_no_prefix() { let wasm = wat::parse_str(r#"(module)"#).unwrap(); - let store = Store::new(&Universal::new(Cranelift::default()).engine()); + let compiler = make_compiler_config(); + let store = Store::new(compiler); let module = wasmer::Module::new(&store, wasm).unwrap(); let exports = module.exported_function_names(None); assert_eq!(exports, HashSet::new()); @@ -198,7 +235,8 @@ mod tests { )"#, ) .unwrap(); - let store = Store::new(&Universal::new(Cranelift::default()).engine()); + let compiler = make_compiler_config(); + let store = Store::new(compiler); let module = wasmer::Module::new(&store, wasm).unwrap(); let exports = module.exported_function_names(None); assert_eq!( @@ -210,7 +248,8 @@ mod tests { #[test] fn exported_function_names_works_for_wasmer_with_prefix() { let wasm = wat::parse_str(r#"(module)"#).unwrap(); - let store = Store::new(&Universal::new(Cranelift::default()).engine()); + let compiler = make_compiler_config(); + let store = Store::new(compiler); let module = wasmer::Module::new(&store, wasm).unwrap(); let exports = module.exported_function_names(Some("b")); assert_eq!(exports, HashSet::new()); @@ -228,7 +267,8 @@ mod tests { )"#, ) .unwrap(); - let store = Store::new(&Universal::new(Cranelift::default()).engine()); + let compiler = make_compiler_config(); + let store = Store::new(compiler); let module = wasmer::Module::new(&store, wasm).unwrap(); let exports = module.exported_function_names(Some("b")); assert_eq!( @@ -238,72 +278,23 @@ mod tests { } #[test] - fn has_ibc_entry_points_works() { - // Non-IBC contract - let wasm = wat::parse_str( - r#"(module - (memory 3) - (export "memory" (memory 0)) - - (type (func)) - (func (type 0) nop) - (export "interface_version_8" (func 0)) - (export "instantiate" (func 0)) - (export "allocate" (func 0)) - (export "deallocate" (func 0)) - )"#, - ) - .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); - assert!(!has_ibc_entry_points(&module)); - - // IBC contract - let wasm = wat::parse_str( - r#"(module - (memory 3) - (export "memory" (memory 0)) + fn entrypoint_from_string_works() { + assert_eq!( + Entrypoint::from_str("ibc_channel_open").unwrap(), + Entrypoint::IbcChannelOpen + ); - (type (func)) - (func (type 0) nop) - (export "interface_version_8" (func 0)) - (export "instantiate" (func 0)) - (export "execute" (func 0)) - (export "allocate" (func 0)) - (export "deallocate" (func 0)) - (export "ibc_channel_open" (func 0)) - (export "ibc_channel_connect" (func 0)) - (export "ibc_channel_close" (func 0)) - (export "ibc_packet_receive" (func 0)) - (export "ibc_packet_ack" (func 0)) - (export "ibc_packet_timeout" (func 0)) - )"#, - ) - .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); - assert!(has_ibc_entry_points(&module)); + assert!(Entrypoint::from_str("IbcChannelConnect").is_err()); + } - // Missing packet ack - let wasm = wat::parse_str( - r#"(module - (memory 3) - (export "memory" (memory 0)) + #[test] + fn entrypoint_to_string_works() { + assert_eq!( + Entrypoint::IbcPacketTimeout.to_string(), + "ibc_packet_timeout" + ); - (type (func)) - (func (type 0) nop) - (export "interface_version_8" (func 0)) - (export "instantiate" (func 0)) - (export "execute" (func 0)) - (export "allocate" (func 0)) - (export "deallocate" (func 0)) - (export "ibc_channel_open" (func 0)) - (export "ibc_channel_connect" (func 0)) - (export "ibc_channel_close" (func 0)) - (export "ibc_packet_receive" (func 0)) - (export "ibc_packet_timeout" (func 0)) - )"#, - ) - .unwrap(); - let module = deserialize_wasm(&wasm).unwrap(); - assert!(!has_ibc_entry_points(&module)); + let static_str: &'static str = Entrypoint::IbcPacketReceive.as_ref(); + assert_eq!(static_str, "ibc_packet_receive"); } } diff --git a/packages/vm/src/testing/calls.rs b/packages/vm/src/testing/calls.rs index 4c11640ed9..8029c92ed0 100644 --- a/packages/vm/src/testing/calls.rs +++ b/packages/vm/src/testing/calls.rs @@ -1,10 +1,11 @@ //! This file has some helpers for integration tests. //! They should be imported via full path to ensure there is no confusion //! use cosmwasm_vm::testing::X -use schemars::JsonSchema; use serde::{de::DeserializeOwned, Serialize}; -use cosmwasm_std::{ContractResult, CustomMsg, Env, MessageInfo, QueryResponse, Reply, Response}; +use cosmwasm_std::{ + ContractResult, CustomMsg, Env, MessageInfo, MigrateInfo, QueryResponse, Reply, Response, +}; #[cfg(feature = "stargate")] use cosmwasm_std::{ Ibc3ChannelOpenResponse, IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, @@ -13,7 +14,8 @@ use cosmwasm_std::{ }; use crate::calls::{ - call_execute, call_instantiate, call_migrate, call_query, call_reply, call_sudo, + call_execute, call_instantiate, call_migrate, call_migrate_with_info, call_query, call_reply, + call_sudo, }; #[cfg(feature = "stargate")] use crate::calls::{ @@ -24,7 +26,7 @@ use crate::instance::Instance; use crate::serde::to_vec; use crate::{BackendApi, Querier, Storage}; -/// Mimicks the call signature of the smart contracts. +/// Mimics the call signature of the smart contracts. /// Thus it moves env and msg rather than take them as reference. /// This is inefficient here, but only used in test code. pub fn instantiate( @@ -37,14 +39,14 @@ where A: BackendApi + 'static, S: Storage + 'static, Q: Querier + 'static, - M: Serialize + JsonSchema, + M: Serialize, U: DeserializeOwned + CustomMsg, { - let serialized_msg = to_vec(&msg).expect("Testing error: Could not seralize request message"); + let serialized_msg = to_vec(&msg).expect("Testing error: Could not serialize request message"); call_instantiate(instance, &env, &info, &serialized_msg).expect("VM error") } -// execute mimicks the call signature of the smart contracts. +// execute mimics the call signature of the smart contracts. // thus it moves env and msg rather than take them as reference. // this is inefficient here, but only used in test code pub fn execute( @@ -57,14 +59,14 @@ where A: BackendApi + 'static, S: Storage + 'static, Q: Querier + 'static, - M: Serialize + JsonSchema, + M: Serialize, U: DeserializeOwned + CustomMsg, { - let serialized_msg = to_vec(&msg).expect("Testing error: Could not seralize request message"); + let serialized_msg = to_vec(&msg).expect("Testing error: Could not serialize request message"); call_execute(instance, &env, &info, &serialized_msg).expect("VM error") } -// migrate mimicks the call signature of the smart contracts. +// migrate mimics the call signature of the smart contracts. // thus it moves env and msg rather than take them as reference. // this is inefficient here, but only used in test code pub fn migrate( @@ -76,14 +78,34 @@ where A: BackendApi + 'static, S: Storage + 'static, Q: Querier + 'static, - M: Serialize + JsonSchema, + M: Serialize, U: DeserializeOwned + CustomMsg, { - let serialized_msg = to_vec(&msg).expect("Testing error: Could not seralize request message"); + let serialized_msg = to_vec(&msg).expect("Testing error: Could not serialize request message"); call_migrate(instance, &env, &serialized_msg).expect("VM error") } -// sudo mimicks the call signature of the smart contracts. +// migrate mimics the call signature of the smart contracts. +// thus it moves env and msg rather than take them as reference. +// this is inefficient here, but only used in test code +pub fn migrate_with_info( + instance: &mut Instance, + env: Env, + msg: M, + migrate_info: MigrateInfo, +) -> ContractResult> +where + A: BackendApi + 'static, + S: Storage + 'static, + Q: Querier + 'static, + M: Serialize, + U: DeserializeOwned + CustomMsg, +{ + let serialized_msg = to_vec(&msg).expect("Testing error: Could not serialize request message"); + call_migrate_with_info(instance, &env, &serialized_msg, &migrate_info).expect("VM error") +} + +// sudo mimics the call signature of the smart contracts. // thus it moves env and msg rather than take them as reference. // this is inefficient here, but only used in test code pub fn sudo( @@ -95,14 +117,14 @@ where A: BackendApi + 'static, S: Storage + 'static, Q: Querier + 'static, - M: Serialize + JsonSchema, + M: Serialize, U: DeserializeOwned + CustomMsg, { - let serialized_msg = to_vec(&msg).expect("Testing error: Could not seralize request message"); + let serialized_msg = to_vec(&msg).expect("Testing error: Could not serialize request message"); call_sudo(instance, &env, &serialized_msg).expect("VM error") } -// reply mimicks the call signature of the smart contracts. +// reply mimics the call signature of the smart contracts. // thus it moves env and msg rather than take them as reference. // this is inefficient here, but only used in test code pub fn reply( @@ -119,7 +141,7 @@ where call_reply(instance, &env, &msg).expect("VM error") } -// query mimicks the call signature of the smart contracts. +// query mimics the call signature of the smart contracts. // thus it moves env and msg rather than take them as reference. // this is inefficient here, but only used in test code pub fn query( @@ -131,13 +153,13 @@ where A: BackendApi + 'static, S: Storage + 'static, Q: Querier + 'static, - M: Serialize + JsonSchema, + M: Serialize, { - let serialized_msg = to_vec(&msg).expect("Testing error: Could not seralize request message"); + let serialized_msg = to_vec(&msg).expect("Testing error: Could not serialize request message"); call_query(instance, &env, &serialized_msg).expect("VM error") } -// ibc_channel_open mimicks the call signature of the smart contracts. +// ibc_channel_open mimics the call signature of the smart contracts. // thus it moves env and channel rather than take them as reference. // this is inefficient here, but only used in test code #[cfg(feature = "stargate")] @@ -154,7 +176,7 @@ where call_ibc_channel_open(instance, &env, &msg).expect("VM error") } -// ibc_channel_connect mimicks the call signature of the smart contracts. +// ibc_channel_connect mimics the call signature of the smart contracts. // thus it moves env and channel rather than take them as reference. // this is inefficient here, but only used in test code #[cfg(feature = "stargate")] @@ -172,7 +194,7 @@ where call_ibc_channel_connect(instance, &env, &msg).expect("VM error") } -// ibc_channel_close mimicks the call signature of the smart contracts. +// ibc_channel_close mimics the call signature of the smart contracts. // thus it moves env and channel rather than take them as reference. // this is inefficient here, but only used in test code #[cfg(feature = "stargate")] @@ -190,7 +212,7 @@ where call_ibc_channel_close(instance, &env, &msg).expect("VM error") } -// ibc_packet_receive mimicks the call signature of the smart contracts. +// ibc_packet_receive mimics the call signature of the smart contracts. // thus it moves env and packet rather than take them as reference. // this is inefficient here, but only used in test code #[cfg(feature = "stargate")] @@ -208,7 +230,7 @@ where call_ibc_packet_receive(instance, &env, &msg).expect("VM error") } -// ibc_packet_ack mimicks the call signature of the smart contracts. +// ibc_packet_ack mimics the call signature of the smart contracts. // thus it moves env and acknowledgement rather than take them as reference. // this is inefficient here, but only used in test code #[cfg(feature = "stargate")] @@ -226,7 +248,7 @@ where call_ibc_packet_ack(instance, &env, &msg).expect("VM error") } -// ibc_packet_timeout mimicks the call signature of the smart contracts. +// ibc_packet_timeout mimics the call signature of the smart contracts. // thus it moves env and packet rather than take them as reference. // this is inefficient here, but only used in test code #[cfg(feature = "stargate")] diff --git a/packages/vm/src/testing/instance.rs b/packages/vm/src/testing/instance.rs index 6311c10a67..f23fe4915b 100644 --- a/packages/vm/src/testing/instance.rs +++ b/packages/vm/src/testing/instance.rs @@ -7,19 +7,19 @@ use std::collections::HashSet; use crate::capabilities::capabilities_from_csv; use crate::compatibility::check_wasm; use crate::instance::{Instance, InstanceOptions}; +use crate::internals::Logger; use crate::size::Size; -use crate::{Backend, BackendApi, Querier, Storage}; +use crate::{Backend, BackendApi, Querier, Storage, WasmLimits}; use super::mock::{MockApi, MOCK_CONTRACT_ADDR}; use super::querier::MockQuerier; use super::storage::MockStorage; /// This gas limit is used in integration tests and should be high enough to allow a reasonable -/// number of contract executions and queries on one instance. For this reason it is significatly +/// number of contract executions and queries on one instance. For this reason it is significantly /// higher than the limit for a single execution that we have in the production setup. -const DEFAULT_GAS_LIMIT: u64 = 500_000_000_000; // ~0.5ms +const DEFAULT_GAS_LIMIT: u64 = 2_000_000_000; // ~2.0ms const DEFAULT_MEMORY_LIMIT: Option = Some(Size::mebi(16)); -const DEFAULT_PRINT_DEBUG: bool = true; pub fn mock_instance( wasm: &[u8], @@ -90,7 +90,6 @@ pub struct MockInstanceOptions<'a> { pub available_capabilities: HashSet, /// Gas limit measured in [CosmWasm gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md). pub gas_limit: u64, - pub print_debug: bool, /// Memory limit in bytes. Use a value that is divisible by the Wasm page size 65536, e.g. full MiBs. pub memory_limit: Option, } @@ -98,7 +97,9 @@ pub struct MockInstanceOptions<'a> { impl MockInstanceOptions<'_> { fn default_capabilities() -> HashSet { #[allow(unused_mut)] - let mut out = capabilities_from_csv("iterator,staking,cosmwasm_1_1"); + let mut out = capabilities_from_csv( + "ibc2,iterator,staking,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1,cosmwasm_2_2,cosmwasm_3_0", + ); #[cfg(feature = "stargate")] out.insert("stargate".to_string()); out @@ -116,7 +117,6 @@ impl Default for MockInstanceOptions<'_> { // instance available_capabilities: Self::default_capabilities(), gas_limit: DEFAULT_GAS_LIMIT, - print_debug: DEFAULT_PRINT_DEBUG, memory_limit: DEFAULT_MEMORY_LIMIT, } } @@ -126,7 +126,13 @@ pub fn mock_instance_with_options( wasm: &[u8], options: MockInstanceOptions, ) -> Instance { - check_wasm(wasm, &options.available_capabilities).unwrap(); + check_wasm( + wasm, + &options.available_capabilities, + &WasmLimits::default(), + Logger::Off, + ) + .unwrap(); let contract_address = MOCK_CONTRACT_ADDR; // merge balances @@ -153,7 +159,6 @@ pub fn mock_instance_with_options( let memory_limit = options.memory_limit; let options = InstanceOptions { gas_limit: options.gas_limit, - print_debug: options.print_debug, }; Instance::from_code(wasm, backend, options, memory_limit).unwrap() } @@ -163,7 +168,6 @@ pub fn mock_instance_options() -> (InstanceOptions, Option) { ( InstanceOptions { gas_limit: DEFAULT_GAS_LIMIT, - print_debug: DEFAULT_PRINT_DEBUG, }, DEFAULT_MEMORY_LIMIT, ) @@ -192,8 +196,7 @@ where let wasm_data = instance.read_memory(wasm_ptr, size).expect("error reading"); assert_eq!( original, wasm_data, - "failed for size {}; expected: {:?}; actual: {:?}", - size, original, wasm_data + "failed for size {size}; expected: {original:?}; actual: {wasm_data:?}" ); instance .deallocate(wasm_ptr) diff --git a/packages/vm/src/testing/mock.rs b/packages/vm/src/testing/mock.rs index 131a7c43a7..825d09b8d4 100644 --- a/packages/vm/src/testing/mock.rs +++ b/packages/vm/src/testing/mock.rs @@ -1,15 +1,28 @@ -use cosmwasm_std::testing::{digit_sum, riffle_shuffle}; +use bech32::primitives::decode::CheckedHrpstring; +use bech32::{encode, Bech32, Hrp}; use cosmwasm_std::{ - Addr, BlockInfo, Coin, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo, + Addr, Binary, BlockInfo, Coin, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo, }; +use sha2::{Digest, Sha256}; use super::querier::MockQuerier; use super::storage::MockStorage; +use crate::backend::unwrap_or_return_with_gas; use crate::{Backend, BackendApi, BackendError, BackendResult, GasInfo}; -pub const MOCK_CONTRACT_ADDR: &str = "cosmos2contract"; -const GAS_COST_HUMANIZE: u64 = 44; -const GAS_COST_CANONICALIZE: u64 = 55; +pub const MOCK_CONTRACT_ADDR: &str = + "cosmwasm1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922tscp8avs"; + +/// Default gas multiplier in wasmd. +/// See https://github.com/CosmWasm/wasmd/blob/v0.51.0/x/wasm/types/gas_register.go#L34 +const WASMD_GAS_MULTIPLIER: u64 = 140_000; +/// See https://github.com/CosmWasm/wasmd/blob/v0.51.0/x/wasm/keeper/api.go#L27 +const GAS_COST_HUMANIZE: u64 = 4 * WASMD_GAS_MULTIPLIER; +/// See https://github.com/CosmWasm/wasmd/blob/v0.51.0/x/wasm/keeper/api.go#L28 +const GAS_COST_CANONICALIZE: u64 = 5 * WASMD_GAS_MULTIPLIER; + +/// Default prefix used when creating Bech32 encoded address. +const BECH32_PREFIX: &str = "cosmwasm"; /// All external requirements that can be injected for unit tests. /// It sets the given balance for the contract itself, nothing else @@ -22,7 +35,7 @@ pub fn mock_backend(contract_balance: &[Coin]) -> Backend Backend { @@ -33,141 +46,247 @@ pub fn mock_backend_with_balances( } } -/// Length of canonical addresses created with this API. Contracts should not make any assumtions -/// what this value is. -/// The value here must be restorable with `SHUFFLES_ENCODE` + `SHUFFLES_DECODE` in-shuffles. -const CANONICAL_LENGTH: usize = 54; - -const SHUFFLES_ENCODE: usize = 18; -const SHUFFLES_DECODE: usize = 2; - /// Zero-pads all human addresses to make them fit the canonical_length and /// trims off zeros for the reverse operation. -/// This is not really smart, but allows us to see a difference (and consistent length for canonical adddresses). +/// This is not really smart, but allows us to see a difference (and consistent length for canonical addresses). #[derive(Copy, Clone)] -pub struct MockApi { - /// Length of canonical addresses created with this API. Contracts should not make any assumtions - /// what this value is. - canonical_length: usize, - /// When set, all calls to the API fail with BackendError::Unknown containing this message - backend_error: Option<&'static str>, +pub struct MockApi(MockApiImpl); + +#[derive(Copy, Clone)] +enum MockApiImpl { + /// With this variant, all calls to the API fail with BackendError::Unknown + /// containing the given message + Error(&'static str), + /// This variant implements Bech32 addresses. + Bech32 { + /// Prefix used for creating addresses in Bech32 encoding. + bech32_prefix: &'static str, + }, } impl MockApi { - /// Read-only getter for `canonical_length`, which must not be changed by the caller. - pub fn canonical_length(&self) -> usize { - self.canonical_length + pub fn new_failing(backend_error: &'static str) -> Self { + Self(MockApiImpl::Error(backend_error)) } - pub fn new_failing(backend_error: &'static str) -> Self { - MockApi { - backend_error: Some(backend_error), - ..MockApi::default() + /// Returns [MockApi] with Bech32 prefix set to provided value. + /// + /// Bech32 prefix must not be empty. + /// + /// # Example + /// + /// ``` + /// # use cosmwasm_std::Addr; + /// # use cosmwasm_std::testing::MockApi; + /// # + /// let mock_api = MockApi::default().with_prefix("juno"); + /// let addr = mock_api.addr_make("creator"); + /// + /// assert_eq!(addr.as_str(), "juno1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqsksmtyp"); + /// ``` + pub fn with_prefix(self, prefix: &'static str) -> Self { + Self(MockApiImpl::Bech32 { + bech32_prefix: prefix, + }) + } + + /// Returns an address built from provided input string. + /// + /// # Example + /// + /// ``` + /// # use cosmwasm_std::Addr; + /// # use cosmwasm_std::testing::MockApi; + /// # + /// let mock_api = MockApi::default(); + /// let addr = mock_api.addr_make("creator"); + /// + /// assert_eq!(addr.as_str(), "cosmwasm1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqs8s7vcp"); + /// ``` + /// + /// # Panics + /// + /// This function panics when generating a valid address is not possible, + /// especially when Bech32 prefix set in function [with_prefix](Self::with_prefix) is empty. + /// + pub fn addr_make(&self, input: &str) -> String { + // handle error case + let bech32_prefix = match self.0 { + MockApiImpl::Error(e) => panic!("Generating address failed: {e}"), + MockApiImpl::Bech32 { bech32_prefix } => bech32_prefix, + }; + + let digest = Sha256::digest(input); + let bech32_prefix = Hrp::parse(bech32_prefix).expect("Invalid prefix"); + match encode::(bech32_prefix, &digest) { + Ok(address) => address, + Err(reason) => panic!("Generating address failed with reason: {reason}"), } } } impl Default for MockApi { fn default() -> Self { - MockApi { - canonical_length: CANONICAL_LENGTH, - backend_error: None, - } + Self(MockApiImpl::Bech32 { + bech32_prefix: BECH32_PREFIX, + }) } } impl BackendApi for MockApi { - fn canonical_address(&self, input: &str) -> BackendResult> { - // mimicks formats like hex or bech32 where different casings are valid for one address - let normalized = input.to_lowercase(); - - let gas_info = GasInfo::with_cost(GAS_COST_CANONICALIZE); + fn addr_validate(&self, input: &str) -> BackendResult<()> { + let mut gas_total = GasInfo { + cost: 0, + externally_used: 0, + }; - if let Some(backend_error) = self.backend_error { - return (Err(BackendError::unknown(backend_error)), gas_info); - } + let (canonicalize_res, gas_info) = self.addr_canonicalize(input); + gas_total += gas_info; + let canonical = unwrap_or_return_with_gas!(canonicalize_res, gas_total); - // Dummy input validation. This is more sophisticated for formats like bech32, where format and checksum are validated. - if normalized.len() < 3 { + let (humanize_res, gas_info) = self.addr_humanize(&canonical); + gas_total += gas_info; + let normalized = unwrap_or_return_with_gas!(humanize_res, gas_total); + if input != normalized.as_str() { return ( Err(BackendError::user_err( - "Invalid input: human address too short", + "Invalid input: address not normalized", )), - gas_info, + gas_total, ); } - if normalized.len() > self.canonical_length { - return ( - Err(BackendError::user_err( - "Invalid input: human address too long", - )), - gas_info, - ); - } - - let mut out = Vec::from(normalized); - // pad to canonical length with NULL bytes - out.resize(self.canonical_length, 0x00); - // content-dependent rotate followed by shuffle to destroy - // the most obvious structure (https://github.com/CosmWasm/cosmwasm/issues/552) - let rotate_by = digit_sum(&out) % self.canonical_length; - out.rotate_left(rotate_by); - for _ in 0..SHUFFLES_ENCODE { - out = riffle_shuffle(&out); - } - (Ok(out), gas_info) + (Ok(()), gas_total) } - fn human_address(&self, canonical: &[u8]) -> BackendResult { - let gas_info = GasInfo::with_cost(GAS_COST_HUMANIZE); + fn addr_canonicalize(&self, input: &str) -> BackendResult> { + let gas_total = GasInfo::with_cost(GAS_COST_CANONICALIZE); - if let Some(backend_error) = self.backend_error { - return (Err(BackendError::unknown(backend_error)), gas_info); - } + // handle error case + let bech32_prefix = match self.0 { + MockApiImpl::Error(e) => return (Err(BackendError::unknown(e)), gas_total), + MockApiImpl::Bech32 { bech32_prefix } => bech32_prefix, + }; + + let hrp_str = unwrap_or_return_with_gas!( + CheckedHrpstring::new::(input) + .map_err(|_| BackendError::user_err("Error decoding bech32")), + gas_total + ); - if canonical.len() != self.canonical_length { + if !hrp_str + .hrp() + .as_bytes() + .eq_ignore_ascii_case(bech32_prefix.as_bytes()) + { return ( - Err(BackendError::user_err( - "Invalid input: canonical address length not correct", - )), - gas_info, + Err(BackendError::user_err("Wrong bech32 prefix")), + gas_total, ); } - let mut tmp: Vec = canonical.into(); - // Shuffle two more times which restored the original value (24 elements are back to original after 20 rounds) - for _ in 0..SHUFFLES_DECODE { - tmp = riffle_shuffle(&tmp); - } - // Rotate back - let rotate_by = digit_sum(&tmp) % self.canonical_length; - tmp.rotate_right(rotate_by); - // Remove NULL bytes (i.e. the padding) - let trimmed = tmp.into_iter().filter(|&x| x != 0x00).collect(); - - let result = match String::from_utf8(trimmed) { - Ok(human) => Ok(human), - Err(err) => Err(err.into()), + let bytes: Vec = hrp_str.byte_iter().collect(); + unwrap_or_return_with_gas!(validate_length(&bytes), gas_total); + (Ok(bytes), gas_total) + } + + fn addr_humanize(&self, canonical: &[u8]) -> BackendResult { + let gas_total = GasInfo::with_cost(GAS_COST_HUMANIZE); + + // handle error case + let bech32_prefix = match self.0 { + MockApiImpl::Error(e) => return (Err(BackendError::unknown(e)), gas_total), + MockApiImpl::Bech32 { bech32_prefix } => bech32_prefix, }; - (result, gas_info) + + unwrap_or_return_with_gas!(validate_length(canonical), gas_total); + let bech32_prefix = unwrap_or_return_with_gas!( + Hrp::parse(bech32_prefix).map_err(|_| BackendError::user_err("Invalid bech32 prefix")), + gas_total + ); + let result = encode::(bech32_prefix, canonical) + .map_err(|_| BackendError::user_err("Invalid data to be encoded to bech32")); + + (result, gas_total) } } -/// Returns a default enviroment with height, time, chain_id, and contract address +/// Does basic validation of the number of bytes in a canonical address +fn validate_length(bytes: &[u8]) -> Result<(), BackendError> { + match bytes.len() { + 1..=255 => Ok(()), + _ => Err(BackendError::user_err("Invalid canonical address length")), + } +} + +/// Returns a default environment with height, time, chain_id, and contract address. /// You can submit as is to most contracts, or modify height/time if you want to /// test for expiration. /// /// This is intended for use in test code only. +/// +/// The contract address uses the same bech32 prefix as [`MockApi`](crate::testing::MockApi). While +/// this is good for the majority of users, you might need to create your `Env`s +/// differently if you need a valid address using a different prefix. +/// +/// ## Examples +/// +/// Create an env: +/// +/// ``` +/// # use cosmwasm_std::{Addr, Binary, BlockInfo, ContractInfo, Env, Timestamp, TransactionInfo}; +/// use cosmwasm_vm::testing::mock_env; +/// +/// let env = mock_env(); +/// assert_eq!(env, Env { +/// block: BlockInfo { +/// height: 12_345, +/// time: Timestamp::from_nanos(1_571_797_419_879_305_533), +/// chain_id: "cosmos-testnet-14002".to_string(), +/// }, +/// transaction: Some(TransactionInfo::new(3, Binary::from_hex("E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3").unwrap())), +/// contract: ContractInfo { +/// address: Addr::unchecked("cosmwasm1jpev2csrppg792t22rn8z8uew8h3sjcpglcd0qv9g8gj8ky922tscp8avs"), +/// }, +/// }); +/// ``` +/// +/// Mutate and reuse environment: +/// +/// ``` +/// # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, Timestamp, TransactionInfo}; +/// use cosmwasm_vm::testing::mock_env; +/// +/// let env1 = mock_env(); +/// +/// // First test with `env1` +/// +/// let mut env2 = env1.clone(); +/// env2.block.height += 1; +/// env2.block.time = env1.block.time.plus_seconds(6); +/// +/// // `env2` is one block and 6 seconds later +/// +/// let mut env3 = env2.clone(); +/// env3.block.height += 1; +/// env3.block.time = env2.block.time.plus_nanos(5_500_000_000); +/// +/// // `env3` is one block and 5.5 seconds later +/// ``` pub fn mock_env() -> Env { + let contract_addr = MockApi::default().addr_make("cosmos2contract"); Env { block: BlockInfo { height: 12_345, time: Timestamp::from_nanos(1_571_797_419_879_305_533), chain_id: "cosmos-testnet-14002".to_string(), }, - transaction: Some(TransactionInfo { index: 3 }), + transaction: Some(TransactionInfo::new( + 3, + Binary::from_hex("E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3") + .unwrap(), + )), contract: ContractInfo { - address: Addr::unchecked(MOCK_CONTRACT_ADDR), + address: Addr::unchecked(contract_addr), }, } } @@ -184,9 +303,14 @@ pub fn mock_info(sender: &str, funds: &[Coin]) -> MessageInfo { #[cfg(test)] mod tests { use super::*; - use crate::BackendError; use cosmwasm_std::coins; + #[test] + fn mock_env_matches_mock_contract_addr() { + let contract_address = mock_env().contract.address; + assert_eq!(contract_address, Addr::unchecked(MOCK_CONTRACT_ADDR)); + } + #[test] fn mock_info_works() { let info = mock_info("my name", &coins(100, "atom")); @@ -203,62 +327,98 @@ mod tests { } #[test] - fn canonical_address_works() { - let api = MockApi::default(); + fn addr_canonicalize_works() { + let api = MockApi::default().with_prefix("osmo"); - api.canonical_address("foobar123").0.unwrap(); + api.addr_canonicalize("osmo186kh7c0k0gh4ww0wh4jqc4yhzu7n7dhswe845d") + .0 + .unwrap(); // is case insensitive - let data1 = api.canonical_address("foo123").0.unwrap(); - let data2 = api.canonical_address("FOO123").0.unwrap(); + let data1 = api + .addr_canonicalize("osmo186kh7c0k0gh4ww0wh4jqc4yhzu7n7dhswe845d") + .0 + .unwrap(); + let data2 = api + .addr_canonicalize("OSMO186KH7C0K0GH4WW0WH4JQC4YHZU7N7DHSWE845D") + .0 + .unwrap(); assert_eq!(data1, data2); } #[test] fn canonicalize_and_humanize_restores_original() { - let api = MockApi::default(); + let api = MockApi::default().with_prefix("juno"); // simple - let original = "shorty"; - let canonical = api.canonical_address(original).0.unwrap(); - let (recovered, _gas_cost) = api.human_address(&canonical); + let original = api.addr_make("shorty"); + let canonical = api.addr_canonicalize(&original).0.unwrap(); + let (recovered, _gas_cost) = api.addr_humanize(&canonical); assert_eq!(recovered.unwrap(), original); // normalizes input - let original = String::from("CosmWasmChef"); - let canonical = api.canonical_address(&original).0.unwrap(); - let recovered = api.human_address(&canonical).0.unwrap(); - assert_eq!(recovered, "cosmwasmchef"); + let original = "JUNO1MEPRU9FUQ4E65856ARD6068MFSFRWPGEMD0C3R"; + let canonical = api.addr_canonicalize(original).0.unwrap(); + let recovered = api.addr_humanize(&canonical).0.unwrap(); + assert_eq!(recovered, original.to_lowercase()); + + // Long input (Juno contract address) + let original = + String::from("juno1v82su97skv6ucfqvuvswe0t5fph7pfsrtraxf0x33d8ylj5qnrysdvkc95"); + let canonical = api.addr_canonicalize(&original).0.unwrap(); + let recovered = api.addr_humanize(&canonical).0.unwrap(); + assert_eq!(recovered, original); } #[test] - fn human_address_input_length() { + fn addr_humanize_input_length() { let api = MockApi::default(); - let input = vec![61; 11]; - let (result, _gas_info) = api.human_address(&input); + let input = vec![61; 256]; // too long + let (result, _gas_info) = api.addr_humanize(&input); match result.unwrap_err() { BackendError::UserErr { .. } => {} - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } #[test] - fn canonical_address_min_input_length() { + fn addr_canonicalize_min_input_length() { let api = MockApi::default(); - let human = "1"; - match api.canonical_address(human).0.unwrap_err() { - BackendError::UserErr { .. } => {} - err => panic!("Unexpected error: {:?}", err), - } + + // empty address should fail + let empty = "cosmwasm1pj90vm"; + assert!(matches!(api + .addr_canonicalize(empty) + .0 + .unwrap_err(), + BackendError::UserErr { msg } if msg.contains("address length"))); } #[test] - fn canonical_address_max_input_length() { + fn addr_canonicalize_max_input_length() { let api = MockApi::default(); - let human = "longer-than-the-address-length-supported-by-this-api-longer-than-54"; - match api.canonical_address(human).0.unwrap_err() { - BackendError::UserErr { .. } => {} - err => panic!("Unexpected error: {:?}", err), - } + + let too_long = "cosmwasm1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqehqqkz"; + + assert!(matches!(api + .addr_canonicalize(too_long) + .0 + .unwrap_err(), + BackendError::UserErr { msg } if msg.contains("address length"))); + } + + #[test] + fn colon_in_prefix_is_valid() { + let mock_api = MockApi::default().with_prefix("did:com:"); + let bytes = mock_api + .addr_canonicalize("did:com:1jkf0kmeyefvyzpwf56m7sne2000ay53r6upttu") + .0 + .unwrap(); + let humanized = mock_api.addr_humanize(&bytes).0.unwrap(); + + assert_eq!( + humanized.as_str(), + "did:com:1jkf0kmeyefvyzpwf56m7sne2000ay53r6upttu" + ); } } diff --git a/packages/vm/src/testing/mod.rs b/packages/vm/src/testing/mod.rs index 347258973b..495bcb37c2 100644 --- a/packages/vm/src/testing/mod.rs +++ b/packages/vm/src/testing/mod.rs @@ -6,7 +6,7 @@ mod mock; mod querier; mod storage; -pub use calls::{execute, instantiate, migrate, query, reply, sudo}; +pub use calls::{execute, instantiate, migrate, migrate_with_info, query, reply, sudo}; #[cfg(feature = "stargate")] pub use calls::{ ibc_channel_close, ibc_channel_connect, ibc_channel_open, ibc_packet_ack, ibc_packet_receive, diff --git a/packages/vm/src/testing/querier.rs b/packages/vm/src/testing/querier.rs index 6a3edae14b..edc892e980 100644 --- a/packages/vm/src/testing/querier.rs +++ b/packages/vm/src/testing/querier.rs @@ -2,7 +2,7 @@ use serde::de::DeserializeOwned; use cosmwasm_std::testing::{MockQuerier as StdMockQuerier, MockQuerierCustomHandlerResult}; use cosmwasm_std::{ - to_binary, to_vec, Binary, Coin, ContractResult, CustomQuery, Empty, Querier as _, + to_json_binary, to_json_vec, Binary, Coin, ContractResult, CustomQuery, Empty, Querier as _, QueryRequest, SystemError, SystemResult, }; @@ -11,7 +11,7 @@ use crate::{BackendError, BackendResult, GasInfo, Querier}; const GAS_COST_QUERY_FLAT: u64 = 100_000; /// Gas per request byte const GAS_COST_QUERY_REQUEST_MULTIPLIER: u64 = 0; -/// Gas per reponse byte +/// Gas per response byte const GAS_COST_QUERY_RESPONSE_MULTIPLIER: u64 = 100; /// MockQuerier holds an immutable table of bank balances @@ -26,13 +26,13 @@ impl MockQuerier { } } - // set a new balance for the given address and return the old balance + /// Set a new balance for the given address and return the old balance pub fn update_balance( &mut self, addr: impl Into, balance: Vec, ) -> Option> { - self.querier.update_balance(addr, balance) + self.querier.bank.update_balance(addr, balance) } #[cfg(feature = "staking")] @@ -42,19 +42,19 @@ impl MockQuerier { validators: &[cosmwasm_std::Validator], delegations: &[cosmwasm_std::FullDelegation], ) { - self.querier.update_staking(denom, validators, delegations); + self.querier.staking.update(denom, validators, delegations); } - pub fn update_wasm(&mut self, handler: WH) + pub fn update_wasm(&mut self, handler: WH) where - WH: Fn(&cosmwasm_std::WasmQuery) -> cosmwasm_std::QuerierResult, + WH: Fn(&cosmwasm_std::WasmQuery) -> cosmwasm_std::QuerierResult + 'static, { self.querier.update_wasm(handler) } - pub fn with_custom_handler(mut self, handler: CH) -> Self + pub fn with_custom_handler(mut self, handler: CH) -> Self where - CH: Fn(&C) -> MockQuerierCustomHandlerResult, + CH: Fn(&C) -> MockQuerierCustomHandlerResult + 'static, { self.querier = self.querier.with_custom_handler(handler); self @@ -72,7 +72,7 @@ impl Querier for MockQuerier { GAS_COST_QUERY_FLAT + (GAS_COST_QUERY_REQUEST_MULTIPLIER * (bin_request.len() as u64)) + (GAS_COST_QUERY_RESPONSE_MULTIPLIER - * (to_binary(&response).unwrap().len() as u64)), + * (to_json_binary(&response).unwrap().len() as u64)), ); // In a production implementation, this should stop the query execution in the middle of the computation. @@ -93,13 +93,13 @@ impl MockQuerier { gas_limit: u64, ) -> BackendResult>> { // encode the request, then call raw_query - let request_binary = match to_vec(request) { + let request_binary = match to_json_vec(request) { Ok(raw) => raw, Err(err) => { let gas_info = GasInfo::with_externally_used(err.to_string().len() as u64); return ( Ok(SystemResult::Err(SystemError::InvalidRequest { - error: format!("Serializing query request: {}", err), + error: format!("Serializing query request: {err}"), request: b"N/A".into(), })), gas_info, @@ -113,7 +113,7 @@ impl MockQuerier { #[cfg(test)] mod tests { use super::*; - use cosmwasm_std::{coin, from_binary, AllBalanceResponse, BalanceResponse, BankQuery, Empty}; + use cosmwasm_std::{coin, from_json, BalanceResponse, BankQuery}; const DEFAULT_QUERY_GAS_LIMIT: u64 = 300_000; @@ -127,32 +127,12 @@ mod tests { let (result, _gas_info) = querier.query_raw(b"broken request", gas_limit); match result.unwrap_err() { BackendError::OutOfGas {} => {} - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } #[test] - fn bank_querier_all_balances() { - let addr = String::from("foobar"); - let balance = vec![coin(123, "ELF"), coin(777, "FLY")]; - let querier = MockQuerier::new(&[(&addr, &balance)]); - - // all - let all = querier - .query::( - &BankQuery::AllBalances { address: addr }.into(), - DEFAULT_QUERY_GAS_LIMIT, - ) - .0 - .unwrap() - .unwrap() - .unwrap(); - let res: AllBalanceResponse = from_binary(&all).unwrap(); - assert_eq!(&res.amount, &balance); - } - - #[test] - fn bank_querier_one_balance() { + fn bank_querier_balance() { let addr = String::from("foobar"); let balance = vec![coin(123, "ELF"), coin(777, "FLY")]; let querier = MockQuerier::new(&[(&addr, &balance)]); @@ -171,7 +151,7 @@ mod tests { .unwrap() .unwrap() .unwrap(); - let res: BalanceResponse = from_binary(&fly).unwrap(); + let res: BalanceResponse = from_json(fly).unwrap(); assert_eq!(res.amount, coin(777, "FLY")); // missing denom @@ -188,32 +168,17 @@ mod tests { .unwrap() .unwrap() .unwrap(); - let res: BalanceResponse = from_binary(&miss).unwrap(); + let res: BalanceResponse = from_json(miss).unwrap(); assert_eq!(res.amount, coin(0, "MISS")); } #[test] + #[allow(deprecated)] fn bank_querier_missing_account() { let addr = String::from("foobar"); let balance = vec![coin(123, "ELF"), coin(777, "FLY")]; let querier = MockQuerier::new(&[(&addr, &balance)]); - // all balances on empty account is empty vec - let all = querier - .query::( - &BankQuery::AllBalances { - address: String::from("elsewhere"), - } - .into(), - DEFAULT_QUERY_GAS_LIMIT, - ) - .0 - .unwrap() - .unwrap() - .unwrap(); - let res: AllBalanceResponse = from_binary(&all).unwrap(); - assert_eq!(res.amount, vec![]); - // any denom on balances on empty account is empty coin let miss = querier .query::( @@ -228,7 +193,7 @@ mod tests { .unwrap() .unwrap() .unwrap(); - let res: BalanceResponse = from_binary(&miss).unwrap(); + let res: BalanceResponse = from_json(miss).unwrap(); assert_eq!(res.amount, coin(0, "ELF")); } } diff --git a/packages/vm/src/wasm_backend/compile.rs b/packages/vm/src/wasm_backend/compile.rs index a750997674..778601e738 100644 --- a/packages/vm/src/wasm_backend/compile.rs +++ b/packages/vm/src/wasm_backend/compile.rs @@ -1,35 +1,36 @@ -use std::sync::Arc; - -use wasmer::{Module, ModuleMiddleware}; +use wasmer::{Engine, Module}; use crate::errors::VmResult; -use crate::size::Size; - -use super::store::make_compile_time_store; /// Compiles a given Wasm bytecode into a module. -/// The given memory limit (in bytes) is used when memories are created. -/// If no memory limit is passed, the resulting compiled module should -/// not be used for execution. -pub fn compile( - code: &[u8], - memory_limit: Option, - middlewares: &[Arc], -) -> VmResult { - let store = make_compile_time_store(memory_limit, middlewares); - let module = Module::new(&store, code)?; +pub fn compile(engine: &Engine, code: &[u8]) -> VmResult { + let module = Module::new(&engine, code)?; Ok(module) } #[cfg(test)] mod tests { use super::*; + use crate::wasm_backend::make_compiling_engine; + + static FLOATY: &[u8] = include_bytes!("../../testdata/floaty.wasm"); - static CONTRACT: &[u8] = include_bytes!("../../testdata/floaty.wasm"); + #[test] + fn contract_with_floats_passes_check() { + let engine = make_compiling_engine(None); + assert!(compile(&engine, FLOATY).is_ok()); + } #[test] - fn contract_with_floats_fails_check() { - let err = compile(CONTRACT, None, &[]).unwrap_err(); - assert!(err.to_string().contains("Float operator detected:")); + fn reference_types_dont_panic() { + const WASM: &str = r#"(module + (type $t0 (func (param funcref externref))) + (import "" "" (func $hello (type $t0))) + )"#; + + let wasm = wat::parse_str(WASM).unwrap(); + let engine = make_compiling_engine(None); + let error = compile(&engine, &wasm).unwrap_err(); + assert!(error.to_string().contains("FuncRef")); } } diff --git a/packages/vm/src/wasm_backend/engine.rs b/packages/vm/src/wasm_backend/engine.rs new file mode 100644 index 0000000000..84feb0e2b4 --- /dev/null +++ b/packages/vm/src/wasm_backend/engine.rs @@ -0,0 +1,134 @@ +use cosmwasm_vm_derive::hash_function; +use std::sync::Arc; +use wasmer::NativeEngineExt; +use wasmer::{ + sys::BaseTunables, wasmparser::Operator, CompilerConfig, Engine, Pages, Target, WASM_PAGE_SIZE, +}; +use wasmer_middlewares::metering::{is_accounting, Metering}; + +use crate::size::Size; + +use super::gatekeeper::Gatekeeper; +use super::limiting_tunables::LimitingTunables; + +/// WebAssembly linear memory objects have sizes measured in pages. Each page +/// is 65536 (2^16) bytes. In WebAssembly version 1, a linear memory can have at +/// most 65536 pages, for a total of 2^32 bytes (4 gibibytes). +/// https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md +const MAX_WASM_PAGES: u32 = 65536; + +// This function is hashed and put into the `module_version_discriminator` because it is used as +// part of the compilation process. If it changes, modules need to be recompiled. +#[hash_function(const_name = "COST_FUNCTION_HASH")] +fn cost(operator: &Operator) -> u64 { + // A flat fee for each operation + // The target is 1 Teragas per second (see GAS.md). + // + // In https://github.com/CosmWasm/cosmwasm/pull/1042 a profiler is developed to + // identify runtime differences between different Wasm operation, but this is not yet + // precise enough to derive insights from it. + const GAS_PER_OPERATION: u64 = 115; + + if is_accounting(operator) { + // Accounting operators are operators where the `Metering` middleware injects instructions + // to count the gas usage and check for gas exhaustion. Therefore they are more expensive. + // + // Benchmarks show that the overhead is about 14 times the cost of a normal operation. + // To benchmark this, set `GAS_PER_OPERATION = 100` and run the "infinite loop" and + // "argon2" benchmarks. From the "Gas used" output, you can calculate the number of + // operations and from that together with the run time the expected gas value per operation: + // GAS_PER_OP = GAS_TARGET_PER_SEC / (NUM_OPS / RUNTIME_IN_SECS) + // This is repeated with different multipliers to bring the two benchmarks closer together. + GAS_PER_OPERATION * 14 + } else { + GAS_PER_OPERATION + } +} + +/// Creates a compiler config using Singlepass +pub fn make_compiler_config() -> impl CompilerConfig + Into { + wasmer::Singlepass::new() +} + +/// Creates an engine without a compiler. +/// This is used to run modules compiled before. +pub fn make_runtime_engine(memory_limit: Option) -> Engine { + let mut engine = Engine::headless(); + if let Some(limit) = memory_limit { + let base = BaseTunables::for_target(&Target::default()); + let tunables = LimitingTunables::new(base, limit_to_pages(limit)); + engine.set_tunables(tunables); + } + engine +} + +/// Creates an Engine with a compiler attached. Use this when compiling Wasm to a module. +pub fn make_compiling_engine(memory_limit: Option) -> Engine { + let gas_limit = 0; + let deterministic = Arc::new(Gatekeeper::default()); + let metering = Arc::new(Metering::new(gas_limit, cost)); + + let mut compiler = make_compiler_config(); + compiler.canonicalize_nans(true); + compiler.push_middleware(deterministic); + compiler.push_middleware(metering); + let mut engine: Engine = compiler.into(); + if let Some(limit) = memory_limit { + let base = BaseTunables::for_target(&Target::default()); + let tunables = LimitingTunables::new(base, limit_to_pages(limit)); + engine.set_tunables(tunables); + } + engine +} + +fn limit_to_pages(limit: Size) -> Pages { + // round down to ensure the limit is less than or equal to the config + let limit_in_pages: usize = limit.0 / WASM_PAGE_SIZE; + + let capped = match u32::try_from(limit_in_pages) { + Ok(x) => std::cmp::min(x, MAX_WASM_PAGES), + // The only case where TryFromIntError can happen is when + // limit_in_pages exceeds the u32 range. In this case it is way + // larger than MAX_WASM_PAGES and needs to be capped. + Err(_too_large) => MAX_WASM_PAGES, + }; + Pages(capped) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn cost_works() { + // accounting operator + assert_eq!(cost(&Operator::Br { relative_depth: 3 }), 1610); + assert_eq!(cost(&Operator::Return {}), 1610); + + // anything else + assert_eq!(cost(&Operator::I64Const { value: 7 }), 115); + assert_eq!(cost(&Operator::I64Extend8S {}), 115); + } + + #[test] + fn make_compiler_config_returns_singlepass() { + let cc = Box::new(make_compiler_config()); + assert_eq!(cc.compiler().name(), "singlepass"); + } + + #[test] + fn limit_to_pages_works() { + // rounds down + assert_eq!(limit_to_pages(Size::new(0)), Pages(0)); + assert_eq!(limit_to_pages(Size::new(1)), Pages(0)); + assert_eq!(limit_to_pages(Size::kibi(63)), Pages(0)); + assert_eq!(limit_to_pages(Size::kibi(64)), Pages(1)); + assert_eq!(limit_to_pages(Size::kibi(65)), Pages(1)); + assert_eq!(limit_to_pages(Size::new(u32::MAX as usize)), Pages(65535)); + // caps at 4 GiB + assert_eq!(limit_to_pages(Size::gibi(3)), Pages(49152)); + assert_eq!(limit_to_pages(Size::gibi(4)), Pages(65536)); + assert_eq!(limit_to_pages(Size::gibi(5)), Pages(65536)); + assert_eq!(limit_to_pages(Size::new(usize::MAX)), Pages(65536)); + } +} diff --git a/packages/vm/src/wasm_backend/gatekeeper.rs b/packages/vm/src/wasm_backend/gatekeeper.rs index c5c82efaff..129eb8d653 100644 --- a/packages/vm/src/wasm_backend/gatekeeper.rs +++ b/packages/vm/src/wasm_backend/gatekeeper.rs @@ -1,11 +1,10 @@ -use loupe::MemoryUsage; use wasmer::wasmparser::Operator; use wasmer::{ FunctionMiddleware, LocalFunctionIndex, MiddlewareError, MiddlewareReaderState, ModuleMiddleware, }; -#[derive(Debug, MemoryUsage, Clone, Copy)] +#[derive(Debug, Clone, Copy)] struct GatekeeperConfig { /// True iff float operations are allowed. /// @@ -35,11 +34,15 @@ struct GatekeeperConfig { /// Note, this feature is not yet standardized! /// See and . allow_feature_threads: bool, + /// True iff operations of the "Shared-Everything Threads" feature are allowed. + /// Note, this feature is not yet standardized! + /// See . + allow_shared_everything_threads: bool, } /// A middleware that ensures only deterministic operations are used (i.e. no floats). /// It also disallows the use of Wasm features that are not explicitly enabled. -#[derive(Debug, MemoryUsage)] +#[derive(Debug)] #[non_exhaustive] pub struct Gatekeeper { config: GatekeeperConfig, @@ -48,7 +51,7 @@ pub struct Gatekeeper { impl Gatekeeper { /// Creates a new Gatekeeper with a custom config. /// - /// A costum configuration is potentially dangerous (non-final Wasm proposals, floats in SIMD operation). + /// A custom configuration is potentially dangerous (non-final Wasm proposals, floats in SIMD operation). /// For this reason, only [`Gatekeeper::default()`] is public. fn new(config: GatekeeperConfig) -> Self { Self { config } @@ -58,12 +61,17 @@ impl Gatekeeper { impl Default for Gatekeeper { fn default() -> Self { Self::new(GatekeeperConfig { - allow_floats: false, + allow_floats: true, allow_feature_bulk_memory_operations: false, + // we allow the reference types proposal during compatibility checking because a subset + // of it is required since Rust 1.82, but we don't allow any of the instructions specific + // to the proposal here. Especially `table.grow` and `table.fill` can be abused to cause + // very long runtime and high memory usage. allow_feature_reference_types: false, allow_feature_simd: false, allow_feature_exception_handling: false, allow_feature_threads: false, + allow_shared_everything_threads: false, }) } } @@ -96,416 +104,85 @@ impl FunctionMiddleware for FunctionGatekeeper { operator: Operator<'a>, state: &mut MiddlewareReaderState<'a>, ) -> Result<(), MiddlewareError> { - match operator { - Operator::Unreachable - | Operator::Nop - | Operator::Block { .. } - | Operator::Loop { .. } - | Operator::If { .. } - | Operator::Else - | Operator::End - | Operator::Br { .. } - | Operator::BrIf { .. } - | Operator::BrTable { .. } - | Operator::Return - | Operator::Call { .. } - | Operator::CallIndirect { .. } - | Operator::Drop - | Operator::Select - | Operator::LocalGet { .. } - | Operator::LocalSet { .. } - | Operator::LocalTee { .. } - | Operator::GlobalGet { .. } - | Operator::GlobalSet { .. } - | Operator::I32Load { .. } - | Operator::I64Load { .. } - | Operator::I32Load8S { .. } - | Operator::I32Load8U { .. } - | Operator::I32Load16S { .. } - | Operator::I32Load16U { .. } - | Operator::I64Load8S { .. } - | Operator::I64Load8U { .. } - | Operator::I64Load16S { .. } - | Operator::I64Load16U { .. } - | Operator::I64Load32S { .. } - | Operator::I64Load32U { .. } - | Operator::I32Store { .. } - | Operator::I64Store { .. } - | Operator::I32Store8 { .. } - | Operator::I32Store16 { .. } - | Operator::I64Store8 { .. } - | Operator::I64Store16 { .. } - | Operator::I64Store32 { .. } - | Operator::MemorySize { .. } - | Operator::MemoryGrow { .. } - | Operator::I32Const { .. } - | Operator::I64Const { .. } - | Operator::I32Eqz - | Operator::I32Eq - | Operator::I32Ne - | Operator::I32LtS - | Operator::I32LtU - | Operator::I32GtS - | Operator::I32GtU - | Operator::I32LeS - | Operator::I32LeU - | Operator::I32GeS - | Operator::I32GeU - | Operator::I64Eqz - | Operator::I64Eq - | Operator::I64Ne - | Operator::I64LtS - | Operator::I64LtU - | Operator::I64GtS - | Operator::I64GtU - | Operator::I64LeS - | Operator::I64LeU - | Operator::I64GeS - | Operator::I64GeU - | Operator::I32Clz - | Operator::I32Ctz - | Operator::I32Popcnt - | Operator::I32Add - | Operator::I32Sub - | Operator::I32Mul - | Operator::I32DivS - | Operator::I32DivU - | Operator::I32RemS - | Operator::I32RemU - | Operator::I32And - | Operator::I32Or - | Operator::I32Xor - | Operator::I32Shl - | Operator::I32ShrS - | Operator::I32ShrU - | Operator::I32Rotl - | Operator::I32Rotr - | Operator::I64Clz - | Operator::I64Ctz - | Operator::I64Popcnt - | Operator::I64Add - | Operator::I64Sub - | Operator::I64Mul - | Operator::I64DivS - | Operator::I64DivU - | Operator::I64RemS - | Operator::I64RemU - | Operator::I64And - | Operator::I64Or - | Operator::I64Xor - | Operator::I64Shl - | Operator::I64ShrS - | Operator::I64ShrU - | Operator::I64Rotl - | Operator::I64Rotr - | Operator::I32WrapI64 - | Operator::I32Extend8S - | Operator::I32Extend16S - | Operator::I64Extend8S - | Operator::I64Extend16S - | Operator::I64ExtendI32S - | Operator::I64Extend32S - | Operator::I64ExtendI32U => { - state.push_operator(operator); - Ok(()) - } - Operator::RefNull { .. } - | Operator::RefIsNull - | Operator::RefFunc { .. } - | Operator::ReturnCall { .. } - | Operator::ReturnCallIndirect { .. } - | Operator::TypedSelect { .. } - | Operator::TableGet { .. } - | Operator::TableSet { .. } - | Operator::TableGrow { .. } - | Operator::TableSize { .. } => { - if self.config.allow_feature_reference_types { - state.push_operator(operator); - Ok(()) - } else { - let msg = format!("Reference type operation detected: {:?}. Reference types are not supported.", operator); - Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) - } - } - Operator::MemoryAtomicNotify { .. } - | Operator::MemoryAtomicWait32 { .. } - | Operator::MemoryAtomicWait64 { .. } - | Operator::AtomicFence { .. } - | Operator::I32AtomicLoad { .. } - | Operator::I64AtomicLoad { .. } - | Operator::I32AtomicLoad8U { .. } - | Operator::I32AtomicLoad16U { .. } - | Operator::I64AtomicLoad8U { .. } - | Operator::I64AtomicLoad16U { .. } - | Operator::I64AtomicLoad32U { .. } - | Operator::I32AtomicStore { .. } - | Operator::I64AtomicStore { .. } - | Operator::I32AtomicStore8 { .. } - | Operator::I32AtomicStore16 { .. } - | Operator::I64AtomicStore8 { .. } - | Operator::I64AtomicStore16 { .. } - | Operator::I64AtomicStore32 { .. } - | Operator::I32AtomicRmwAdd { .. } - | Operator::I64AtomicRmwAdd { .. } - | Operator::I32AtomicRmw8AddU { .. } - | Operator::I32AtomicRmw16AddU { .. } - | Operator::I64AtomicRmw8AddU { .. } - | Operator::I64AtomicRmw16AddU { .. } - | Operator::I64AtomicRmw32AddU { .. } - | Operator::I32AtomicRmwSub { .. } - | Operator::I64AtomicRmwSub { .. } - | Operator::I32AtomicRmw8SubU { .. } - | Operator::I32AtomicRmw16SubU { .. } - | Operator::I64AtomicRmw8SubU { .. } - | Operator::I64AtomicRmw16SubU { .. } - | Operator::I64AtomicRmw32SubU { .. } - | Operator::I32AtomicRmwAnd { .. } - | Operator::I64AtomicRmwAnd { .. } - | Operator::I32AtomicRmw8AndU { .. } - | Operator::I32AtomicRmw16AndU { .. } - | Operator::I64AtomicRmw8AndU { .. } - | Operator::I64AtomicRmw16AndU { .. } - | Operator::I64AtomicRmw32AndU { .. } - | Operator::I32AtomicRmwOr { .. } - | Operator::I64AtomicRmwOr { .. } - | Operator::I32AtomicRmw8OrU { .. } - | Operator::I32AtomicRmw16OrU { .. } - | Operator::I64AtomicRmw8OrU { .. } - | Operator::I64AtomicRmw16OrU { .. } - | Operator::I64AtomicRmw32OrU { .. } - | Operator::I32AtomicRmwXor { .. } - | Operator::I64AtomicRmwXor { .. } - | Operator::I32AtomicRmw8XorU { .. } - | Operator::I32AtomicRmw16XorU { .. } - | Operator::I64AtomicRmw8XorU { .. } - | Operator::I64AtomicRmw16XorU { .. } - | Operator::I64AtomicRmw32XorU { .. } - | Operator::I32AtomicRmwXchg { .. } - | Operator::I64AtomicRmwXchg { .. } - | Operator::I32AtomicRmw8XchgU { .. } - | Operator::I32AtomicRmw16XchgU { .. } - | Operator::I64AtomicRmw8XchgU { .. } - | Operator::I64AtomicRmw16XchgU { .. } - | Operator::I64AtomicRmw32XchgU { .. } - | Operator::I32AtomicRmwCmpxchg { .. } - | Operator::I64AtomicRmwCmpxchg { .. } - | Operator::I32AtomicRmw8CmpxchgU { .. } - | Operator::I32AtomicRmw16CmpxchgU { .. } - | Operator::I64AtomicRmw8CmpxchgU { .. } - | Operator::I64AtomicRmw16CmpxchgU { .. } - | Operator::I64AtomicRmw32CmpxchgU { .. } => { - if self.config.allow_feature_threads { - state.push_operator(operator); - Ok(()) - } else { - let msg = format!("Threads operator detected: {:?}. The Wasm Threads extension is not supported.", operator); - Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) - } - } - Operator::V128Load { .. } - | Operator::V128Store { .. } - | Operator::V128Const { .. } - | Operator::I8x16Splat - | Operator::I8x16ExtractLaneS { .. } - | Operator::I8x16ExtractLaneU { .. } - | Operator::I8x16ReplaceLane { .. } - | Operator::I16x8Splat - | Operator::I16x8ExtractLaneS { .. } - | Operator::I16x8ExtractLaneU { .. } - | Operator::I16x8ReplaceLane { .. } - | Operator::I32x4Splat - | Operator::I32x4ExtractLane { .. } - | Operator::I32x4ReplaceLane { .. } - | Operator::I64x2Splat - | Operator::I64x2ExtractLane { .. } - | Operator::I64x2ReplaceLane { .. } - | Operator::I8x16Eq - | Operator::I8x16Ne - | Operator::I8x16LtS - | Operator::I8x16LtU - | Operator::I8x16GtS - | Operator::I8x16GtU - | Operator::I8x16LeS - | Operator::I8x16LeU - | Operator::I8x16GeS - | Operator::I8x16GeU - | Operator::I16x8Eq - | Operator::I16x8Ne - | Operator::I16x8LtS - | Operator::I16x8LtU - | Operator::I16x8GtS - | Operator::I16x8GtU - | Operator::I16x8LeS - | Operator::I16x8LeU - | Operator::I16x8GeS - | Operator::I16x8GeU - | Operator::I32x4Eq - | Operator::I32x4Ne - | Operator::I32x4LtS - | Operator::I32x4LtU - | Operator::I32x4GtS - | Operator::I32x4GtU - | Operator::I32x4LeS - | Operator::I32x4LeU - | Operator::I32x4GeS - | Operator::I32x4GeU - | Operator::V128Not - | Operator::V128And - | Operator::V128AndNot - | Operator::V128Or - | Operator::V128Xor - | Operator::V128Bitselect - | Operator::I8x16Abs - | Operator::I8x16Neg - | Operator::V128AnyTrue - | Operator::I8x16AllTrue - | Operator::I8x16Bitmask - | Operator::I8x16Shl - | Operator::I8x16ShrS - | Operator::I8x16ShrU - | Operator::I8x16Add - | Operator::I8x16AddSatS - | Operator::I8x16AddSatU - | Operator::I8x16Sub - | Operator::I8x16SubSatS - | Operator::I8x16SubSatU - | Operator::I8x16MinS - | Operator::I8x16MinU - | Operator::I8x16MaxS - | Operator::I8x16MaxU - | Operator::I16x8Abs - | Operator::I16x8Neg - | Operator::I16x8AllTrue - | Operator::I16x8Bitmask - | Operator::I16x8Shl - | Operator::I16x8ShrS - | Operator::I16x8ShrU - | Operator::I16x8Add - | Operator::I16x8AddSatS - | Operator::I16x8AddSatU - | Operator::I16x8Sub - | Operator::I16x8SubSatS - | Operator::I16x8SubSatU - | Operator::I16x8Mul - | Operator::I16x8MinS - | Operator::I16x8MinU - | Operator::I16x8MaxS - | Operator::I16x8MaxU - | Operator::I32x4Abs - | Operator::I32x4Neg - | Operator::I32x4AllTrue - | Operator::I32x4Bitmask - | Operator::I32x4Shl - | Operator::I32x4ShrS - | Operator::I32x4ShrU - | Operator::I32x4Add - | Operator::I32x4Sub - | Operator::I32x4Mul - | Operator::I32x4MinS - | Operator::I32x4MinU - | Operator::I32x4MaxS - | Operator::I32x4MaxU - | Operator::I32x4DotI16x8S - | Operator::I64x2Neg - | Operator::I64x2Shl - | Operator::I64x2ShrS - | Operator::I64x2ShrU - | Operator::I64x2Add - | Operator::I64x2Sub - | Operator::I64x2Mul - | Operator::I8x16Swizzle - | Operator::I8x16Shuffle { .. } - | Operator::V128Load8Splat { .. } - | Operator::V128Load16Splat { .. } - | Operator::V128Load32Splat { .. } - | Operator::V128Load32Zero { .. } - | Operator::V128Load64Splat { .. } - | Operator::V128Load64Zero { .. } - | Operator::I8x16NarrowI16x8S - | Operator::I8x16NarrowI16x8U - | Operator::I16x8NarrowI32x4S - | Operator::I16x8NarrowI32x4U - | Operator::I16x8ExtendLowI8x16S - | Operator::I16x8ExtendHighI8x16S - | Operator::I16x8ExtendLowI8x16U - | Operator::I16x8ExtendHighI8x16U - | Operator::I32x4ExtendLowI16x8S - | Operator::I32x4ExtendHighI16x8S - | Operator::I32x4ExtendLowI16x8U - | Operator::I32x4ExtendHighI16x8U - | Operator::V128Load8x8S { .. } - | Operator::V128Load8x8U { .. } - | Operator::V128Load16x4S { .. } - | Operator::V128Load16x4U { .. } - | Operator::V128Load32x2S { .. } - | Operator::V128Load32x2U { .. } - | Operator::I8x16RoundingAverageU - | Operator::I16x8RoundingAverageU - | Operator::V128Load8Lane { .. } - | Operator::V128Load16Lane { .. } - | Operator::V128Load32Lane { .. } - | Operator::V128Load64Lane { .. } - | Operator::V128Store8Lane { .. } - | Operator::V128Store16Lane { .. } - | Operator::V128Store32Lane { .. } - | Operator::V128Store64Lane { .. } - | Operator::I64x2Eq - | Operator::I64x2Ne - | Operator::I64x2LtS - | Operator::I64x2GtS - | Operator::I64x2LeS - | Operator::I64x2GeS - | Operator::I8x16Popcnt - | Operator::I16x8ExtAddPairwiseI8x16S - | Operator::I16x8ExtAddPairwiseI8x16U - | Operator::I16x8Q15MulrSatS - | Operator::I16x8ExtMulLowI8x16S - | Operator::I16x8ExtMulHighI8x16S - | Operator::I16x8ExtMulLowI8x16U - | Operator::I16x8ExtMulHighI8x16U - | Operator::I32x4ExtAddPairwiseI16x8S - | Operator::I32x4ExtAddPairwiseI16x8U - | Operator::I32x4ExtMulLowI16x8S - | Operator::I32x4ExtMulHighI16x8S - | Operator::I32x4ExtMulLowI16x8U - | Operator::I32x4ExtMulHighI16x8U - | Operator::I64x2Abs - | Operator::I64x2AllTrue - | Operator::I64x2Bitmask - | Operator::I64x2ExtendLowI32x4S - | Operator::I64x2ExtendHighI32x4S - | Operator::I64x2ExtendLowI32x4U - | Operator::I64x2ExtendHighI32x4U - | Operator::I64x2ExtMulLowI32x4S - | Operator::I64x2ExtMulHighI32x4S - | Operator::I64x2ExtMulLowI32x4U - | Operator::I64x2ExtMulHighI32x4U - | Operator::I32x4TruncSatF64x2SZero - | Operator::I32x4TruncSatF64x2UZero - | Operator::F64x2ConvertLowI32x4S - | Operator::F64x2ConvertLowI32x4U - | Operator::F32x4DemoteF64x2Zero - | Operator::F64x2PromoteLowF32x4 - | Operator::I8x16RelaxedSwizzle - | Operator::I32x4RelaxedTruncSatF32x4S - | Operator::I32x4RelaxedTruncSatF32x4U - | Operator::I32x4RelaxedTruncSatF64x2SZero - | Operator::I32x4RelaxedTruncSatF64x2UZero - | Operator::I8x16LaneSelect - | Operator::I16x8LaneSelect - | Operator::I32x4LaneSelect - | Operator::I64x2LaneSelect => { - if self.config.allow_feature_simd { - state.push_operator(operator); - Ok(()) - } else { - let msg = format!( - "SIMD operator detected: {:?}. The Wasm SIMD extension is not supported.", - operator - ); - Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + /// Creates a match arm for the given operator. + /// Intended to be used inside a `match`. + macro_rules! match_op { + ($op:ident { $($payload:tt)* }) => { + $op { .. } + }; + ($op:ident) => { + $op + }; + } + /// Matches on the given operator and calls the corresponding handler function. + macro_rules! gatekeep { + ($( @$proposal:ident $op:ident $({ $($payload:tt)* })? => $visit:ident)*) => {{ + use wasmer::wasmparser::Operator::*; + + let mut proposal_validator = ProposalValidator { + config: &self.config, + state, + }; + + + match operator { + $( + match_op!($op $({ $($payload)* })?) => { + proposal_validator.$proposal(operator) + } + )* } - } + }} + } + + wasmer::wasmparser::for_each_operator!(gatekeep) + } +} + +struct ProposalValidator<'a, 'b> { + config: &'b GatekeeperConfig, + state: &'b mut MiddlewareReaderState<'a>, +} + +impl<'a, 'b> ProposalValidator<'a, 'b> { + /// Internal helper to deduplicate code + fn _ref_types(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + if self.config.allow_feature_reference_types { + self.state.push_operator(operator); + Ok(()) + } else { + let msg = format!("Reference type operation detected: {operator:?}. Reference types are not supported."); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + } + + /// Internal helper to deduplicate code + fn _floats(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + if self.config.allow_floats { + self.state.push_operator(operator); + Ok(()) + } else { + let msg = format!( + "Float operator detected: {operator:?}. The use of floats is not supported." + ); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + } + + /// Internal helper to deduplicate code + fn _exceptions(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + if self.config.allow_feature_exception_handling { + self.state.push_operator(operator); + Ok(()) + } else { + let msg = format!("Exception handling operation detected: {operator:?}. Exception handling is not supported."); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + } + + fn mvp(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + // special handling for float operators + match operator { Operator::F32Load { .. } | Operator::F64Load { .. } | Operator::F32Store { .. } @@ -573,125 +250,134 @@ impl FunctionMiddleware for FunctionGatekeeper { | Operator::I32ReinterpretF32 | Operator::I64ReinterpretF64 | Operator::F32ReinterpretI32 - | Operator::F64ReinterpretI64 - | Operator::I32TruncSatF32S - | Operator::I32TruncSatF32U - | Operator::I32TruncSatF64S - | Operator::I32TruncSatF64U - | Operator::I64TruncSatF32S - | Operator::I64TruncSatF32U - | Operator::I64TruncSatF64S - | Operator::I64TruncSatF64U - | Operator::F32x4Splat - | Operator::F32x4ExtractLane { .. } - | Operator::F32x4ReplaceLane { .. } - | Operator::F64x2Splat - | Operator::F64x2ExtractLane { .. } - | Operator::F64x2ReplaceLane { .. } - | Operator::F32x4Eq - | Operator::F32x4Ne - | Operator::F32x4Lt - | Operator::F32x4Gt - | Operator::F32x4Le - | Operator::F32x4Ge - | Operator::F64x2Eq - | Operator::F64x2Ne - | Operator::F64x2Lt - | Operator::F64x2Gt - | Operator::F64x2Le - | Operator::F64x2Ge - | Operator::F32x4Ceil - | Operator::F32x4Floor - | Operator::F32x4Trunc - | Operator::F32x4Nearest - | Operator::F64x2Ceil - | Operator::F64x2Floor - | Operator::F64x2Trunc - | Operator::F64x2Nearest - | Operator::F32x4Abs - | Operator::F32x4Neg - | Operator::F32x4Sqrt - | Operator::F32x4Add - | Operator::F32x4Sub - | Operator::F32x4Mul - | Operator::F32x4Div - | Operator::F32x4Min - | Operator::F32x4Max - | Operator::F32x4PMin - | Operator::F32x4PMax - | Operator::F64x2Abs - | Operator::F64x2Neg - | Operator::F64x2Sqrt - | Operator::F64x2Add - | Operator::F64x2Sub - | Operator::F64x2Mul - | Operator::F64x2Div - | Operator::F64x2Min - | Operator::F64x2Max - | Operator::F64x2PMin - | Operator::F64x2PMax - | Operator::I32x4TruncSatF32x4S - | Operator::I32x4TruncSatF32x4U - | Operator::F32x4ConvertI32x4S - | Operator::F32x4ConvertI32x4U - | Operator::F32x4RelaxedMin - | Operator::F32x4RelaxedMax - | Operator::F64x2RelaxedMin - | Operator::F64x2RelaxedMax - | Operator::F32x4Fma - | Operator::F32x4Fms - | Operator::F64x2Fma - | Operator::F64x2Fms => { - if self.config.allow_floats { - state.push_operator(operator); - Ok(()) - } else { - let msg = format!( - "Float operator detected: {:?}. The use of floats is not supported.", - operator - ); - Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) - } - } - Operator::MemoryInit { .. } - | Operator::DataDrop { .. } - | Operator::MemoryCopy { .. } - | Operator::MemoryFill { .. } - | Operator::TableInit { .. } - | Operator::ElemDrop { .. } - | Operator::TableCopy { .. } - | Operator::TableFill { .. } => { - if self.config.allow_feature_bulk_memory_operations { - state.push_operator(operator); - Ok(()) - } else { - let msg = format!("Bulk memory operation detected: {:?}. Bulk memory operations are not supported.", operator); - Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) - } - } - Operator::Try { .. } - | Operator::Catch { .. } - | Operator::Throw { .. } - | Operator::Rethrow { .. } - | Operator::Delegate { .. } - | Operator::CatchAll => { - if self.config.allow_feature_exception_handling { - state.push_operator(operator); - Ok(()) - } else { - let msg = format!("Exception handling operation detected: {:?}. Exception handling is not supported.", operator); - Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) - } + | Operator::F64ReinterpretI64 => self._floats(operator), + // all other mvp operators + _ => { + self.state.push_operator(operator); + Ok(()) } } } + + /// Sign-extension + /// https://github.com/bytecodealliance/wasm-tools/blob/wasmparser-0.107.0/crates/wasmparser/src/lib.rs#L307-L311 + #[inline] + fn sign_extension(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + self.state.push_operator(operator); + Ok(()) + } + + #[inline] + fn function_references(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + self._ref_types(operator) + } + + #[inline] + fn reference_types(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + self._ref_types(operator) + } + + #[inline] + fn tail_call(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + self._ref_types(operator) + } + + #[inline] + fn threads(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + if self.config.allow_feature_threads { + self.state.push_operator(operator); + Ok(()) + } else { + let msg = format!("Threads operator detected: {operator:?}. The Wasm Threads extension is not supported."); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + } + + #[inline] + fn shared_everything_threads( + &'b mut self, + operator: Operator<'a>, + ) -> Result<(), MiddlewareError> { + if self.config.allow_shared_everything_threads { + self.state.push_operator(operator); + Ok(()) + } else { + let msg = format!("Shared-Everything threads operator detected: {operator:?}. The Wasm Shared-Everything Threads extension is not supported."); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + } + + #[inline] + fn simd(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + if self.config.allow_feature_simd { + self.state.push_operator(operator); + Ok(()) + } else { + let msg = format!( + "SIMD operator detected: {operator:?}. The Wasm SIMD extension is not supported." + ); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + } + + #[inline] + fn relaxed_simd(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + let msg = format!( + "Relaxed SIMD operator detected: {operator:?}. The Wasm Relaxed SIMD extension is not supported." + ); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + + #[inline] + fn saturating_float_to_int( + &'b mut self, + operator: Operator<'a>, + ) -> Result<(), MiddlewareError> { + self._floats(operator) + } + + #[inline] + fn bulk_memory(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + if self.config.allow_feature_bulk_memory_operations { + self.state.push_operator(operator); + Ok(()) + } else { + let msg = format!("Bulk memory operation detected: {operator:?}. Bulk memory operations are not supported."); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + } + + #[inline] + fn legacy_exceptions(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + self._exceptions(operator) + } + + #[inline] + fn exceptions(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + self._exceptions(operator) + } + + #[inline] + fn gc(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + let msg = format!("GC operation detected: {operator:?}. GC Proposal is not supported."); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } + + #[inline] + fn memory_control(&'b mut self, operator: Operator<'a>) -> Result<(), MiddlewareError> { + let msg = format!( + "Memory control operation detected: {operator:?}. Memory control is not supported." + ); + Err(MiddlewareError::new(MIDDLEWARE_NAME, msg)) + } } #[cfg(test)] mod tests { use super::*; + use crate::wasm_backend::make_compiler_config; use std::sync::Arc; - use wasmer::{CompilerConfig, Cranelift, Module, Store, Universal}; + use wasmer::{CompilerConfig, Module, Store}; #[test] fn valid_wasm_instance_sanity() { @@ -699,8 +385,8 @@ mod tests { r#" (module (func (export "sum") (param i32 i32) (result i32) - get_local 0 - get_local 1 + local.get 0 + local.get 1 i32.add )) "#, @@ -708,35 +394,32 @@ mod tests { .unwrap(); let deterministic = Arc::new(Gatekeeper::default()); - let mut compiler_config = Cranelift::default(); - compiler_config.push_middleware(deterministic); - let store = Store::new(&Universal::new(compiler_config).engine()); - let result = Module::new(&store, &wasm); + let mut compiler = make_compiler_config(); + compiler.push_middleware(deterministic); + let store = Store::new(compiler); + let result = Module::new(&store, wasm); assert!(result.is_ok()); } #[test] - fn parser_floats_are_not_supported() { + fn parser_floats_are_supported() { let wasm = wat::parse_str( r#" (module (func $to_float (param i32) (result f32) - get_local 0 - f32.convert_u/i32 + local.get 0 + f32.convert_i32_u )) "#, ) .unwrap(); let deterministic = Arc::new(Gatekeeper::default()); - let mut compiler_config = Cranelift::default(); - compiler_config.push_middleware(deterministic); - let store = Store::new(&Universal::new(compiler_config).engine()); - let result = Module::new(&store, &wasm); - assert!(result - .unwrap_err() - .to_string() - .contains("Float operator detected:")); + let mut compiler = make_compiler_config(); + compiler.push_middleware(deterministic); + let store = Store::new(compiler); + let result = Module::new(&store, wasm); + assert!(result.is_ok()); } #[test] @@ -756,13 +439,61 @@ mod tests { .unwrap(); let deterministic = Arc::new(Gatekeeper::default()); - let mut compiler_config = Cranelift::default(); - compiler_config.push_middleware(deterministic); - let store = Store::new(&Universal::new(compiler_config).engine()); - let result = Module::new(&store, &wasm); + let mut compiler = make_compiler_config(); + compiler.push_middleware(deterministic); + let store = Store::new(compiler); + let result = Module::new(&store, wasm); assert!(result .unwrap_err() .to_string() .contains("Bulk memory operation")); } + + #[test] + fn bulk_table_operations_not_supported() { + // these operations can take a long time with big tables + let deterministic = Arc::new(Gatekeeper::default()); + let mut compiler = make_compiler_config(); + compiler.push_middleware(deterministic); + let store = Store::new(compiler); + + let wasm = wat::parse_str( + r#" + (module + (table 2 funcref) + (func (export "test") (param $i i32) (result i32) + ;; grow table to size of $i + ref.null func + local.get $i + table.grow 0)) + "#, + ) + .unwrap(); + + let result = Module::new(&store, wasm); + assert!(result + .unwrap_err() + .to_string() + .contains("Reference type operation")); + + let wasm = wat::parse_str( + r#" + (module + (table 1000000 funcref) + (func (export "test") (param $i i32) + ;; fill with nulls + i32.const 0 + ref.null func + i32.const 1000000 + table.fill 0)) + "#, + ) + .unwrap(); + + let result = Module::new(&store, wasm); + assert!(result + .unwrap_err() + .to_string() + .contains("Reference type operation")); + } } diff --git a/packages/vm/src/wasm_backend/limiting_tunables.rs b/packages/vm/src/wasm_backend/limiting_tunables.rs index 007bc34a47..56086fc656 100644 --- a/packages/vm/src/wasm_backend/limiting_tunables.rs +++ b/packages/vm/src/wasm_backend/limiting_tunables.rs @@ -1,9 +1,10 @@ use std::ptr::NonNull; -use std::sync::Arc; -use loupe::MemoryUsage; use wasmer::{ - vm::{self, MemoryError, MemoryStyle, TableStyle, VMMemoryDefinition, VMTableDefinition}, + vm::{ + MemoryError, MemoryStyle, TableStyle, VMMemory, VMMemoryDefinition, VMTable, + VMTableDefinition, + }, MemoryType, Pages, TableType, Tunables, }; @@ -11,9 +12,8 @@ use wasmer::{ /// /// After adjusting the memory limits, it delegates all other logic /// to the base tunables. -#[derive(MemoryUsage)] pub struct LimitingTunables { - /// The maxium a linear memory is allowed to be (in Wasm pages, 65 KiB each). + /// The maximum a linear memory is allowed to be (in Wasm pages, 65 KiB each). /// Since Wasmer ensures there is only none or one memory, this is practically /// an upper limit for the guest memory. limit: Pages, @@ -38,7 +38,7 @@ impl LimitingTunables { adjusted } - /// Ensures the a given memory type does not exceed the memory limit. + /// Ensures a given memory type does not exceed the memory limit. /// Call this after adjusting the memory. fn validate_memory(&self, ty: &MemoryType) -> Result<(), MemoryError> { if ty.minimum > self.limit { @@ -84,7 +84,7 @@ impl Tunables for LimitingTunables { &self, ty: &MemoryType, style: &MemoryStyle, - ) -> Result, MemoryError> { + ) -> Result { let adjusted = self.adjust_memory(ty); self.validate_memory(&adjusted)?; self.base.create_host_memory(&adjusted, style) @@ -98,7 +98,7 @@ impl Tunables for LimitingTunables { ty: &MemoryType, style: &MemoryStyle, vm_definition_location: NonNull, - ) -> Result, MemoryError> { + ) -> Result { let adjusted = self.adjust_memory(ty); self.validate_memory(&adjusted)?; self.base @@ -108,11 +108,7 @@ impl Tunables for LimitingTunables { /// Create a table owned by the host given a [`TableType`] and a [`TableStyle`]. /// /// Delegated to base. - fn create_host_table( - &self, - ty: &TableType, - style: &TableStyle, - ) -> Result, String> { + fn create_host_table(&self, ty: &TableType, style: &TableStyle) -> Result { self.base.create_host_table(ty, style) } @@ -124,7 +120,7 @@ impl Tunables for LimitingTunables { ty: &TableType, style: &TableStyle, vm_definition_location: NonNull, - ) -> Result, String> { + ) -> Result { self.base.create_vm_table(ty, style, vm_definition_location) } } @@ -132,7 +128,7 @@ impl Tunables for LimitingTunables { #[cfg(test)] mod tests { use super::*; - use wasmer::{BaseTunables, Target}; + use wasmer::{sys::BaseTunables, Target}; #[test] fn adjust_memory_works() { @@ -190,7 +186,7 @@ mod tests { MemoryError::Generic(msg) => { assert_eq!(msg, "Maximum exceeds the allowed memory limit") } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } // Maximum not set @@ -198,7 +194,7 @@ mod tests { let result = limiting.validate_memory(&memory); match result.unwrap_err() { MemoryError::Generic(msg) => assert_eq!(msg, "Maximum unset"), - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } // Minimum greater than maximum (not our problem) @@ -212,7 +208,7 @@ mod tests { MemoryError::Generic(msg) => { assert_eq!(msg, "Minimum exceeds the allowed memory limit") } - err => panic!("Unexpected error: {:?}", err), + err => panic!("Unexpected error: {err:?}"), } } } diff --git a/packages/vm/src/wasm_backend/mod.rs b/packages/vm/src/wasm_backend/mod.rs index 3e503c1da1..63f6611b9b 100644 --- a/packages/vm/src/wasm_backend/mod.rs +++ b/packages/vm/src/wasm_backend/mod.rs @@ -1,8 +1,10 @@ mod compile; +mod engine; mod gatekeeper; mod limiting_tunables; -mod store; + +#[cfg(test)] +pub use engine::make_compiler_config; pub use compile::compile; -pub use limiting_tunables::LimitingTunables; -pub use store::make_runtime_store; +pub use engine::{make_compiling_engine, make_runtime_engine, COST_FUNCTION_HASH}; diff --git a/packages/vm/src/wasm_backend/store.rs b/packages/vm/src/wasm_backend/store.rs deleted file mode 100644 index 570692b590..0000000000 --- a/packages/vm/src/wasm_backend/store.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::sync::Arc; -#[cfg(feature = "cranelift")] -use wasmer::Cranelift; -#[cfg(not(feature = "cranelift"))] -use wasmer::Singlepass; -use wasmer::{ - wasmparser::Operator, BaseTunables, CompilerConfig, Engine, ModuleMiddleware, Pages, Store, - Target, Universal, WASM_PAGE_SIZE, -}; -use wasmer_middlewares::Metering; - -use crate::size::Size; - -use super::gatekeeper::Gatekeeper; -use super::limiting_tunables::LimitingTunables; - -/// WebAssembly linear memory objects have sizes measured in pages. Each page -/// is 65536 (2^16) bytes. In WebAssembly version 1, a linear memory can have at -/// most 65536 pages, for a total of 2^32 bytes (4 gibibytes). -/// https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md -const MAX_WASM_PAGES: u32 = 65536; - -fn cost(_operator: &Operator) -> u64 { - // A flat fee for each operation - // The target is 1 Teragas per millisecond (see GAS.md). - // - // In https://github.com/CosmWasm/cosmwasm/pull/1042 a profiler is developed to - // identify runtime differences between different Wasm operation, but this is not yet - // precise enough to derive insights from it. - 150_000 -} - -/// Created a store with the default compiler and the given memory limit (in bytes). -/// If memory_limit is None, no limit is applied. -pub fn make_compile_time_store( - memory_limit: Option, - middlewares: &[Arc], -) -> Store { - let gas_limit = 0; - let deterministic = Arc::new(Gatekeeper::default()); - let metering = Arc::new(Metering::new(gas_limit, cost)); - - #[cfg(feature = "cranelift")] - { - let mut config = Cranelift::default(); - for middleware in middlewares { - config.push_middleware(middleware.clone()); - } - config.push_middleware(deterministic); - config.push_middleware(metering); - let engine = Universal::new(config).engine(); - make_store_with_engine(&engine, memory_limit) - } - - #[cfg(not(feature = "cranelift"))] - { - let mut config = Singlepass::default(); - for middleware in middlewares { - config.push_middleware(middleware.clone()); - } - config.push_middleware(deterministic); - config.push_middleware(metering); - let engine = Universal::new(config).engine(); - make_store_with_engine(&engine, memory_limit) - } -} - -/// Created a store with no compiler and the given memory limit (in bytes) -/// If memory_limit is None, no limit is applied. -pub fn make_runtime_store(memory_limit: Option) -> Store { - let engine = Universal::headless().engine(); - make_store_with_engine(&engine, memory_limit) -} - -/// Creates a store from an engine and an optional memory limit. -/// If no limit is set, the no custom tunables will be used. -fn make_store_with_engine(engine: &dyn Engine, memory_limit: Option) -> Store { - match memory_limit { - Some(limit) => { - let base = BaseTunables::for_target(&Target::default()); - let tunables = LimitingTunables::new(base, limit_to_pages(limit)); - Store::new_with_tunables(engine, tunables) - } - None => Store::new(engine), - } -} - -fn limit_to_pages(limit: Size) -> Pages { - // round down to ensure the limit is less than or equal to the config - let limit_in_pages: usize = limit.0 / WASM_PAGE_SIZE; - - let capped = match u32::try_from(limit_in_pages) { - Ok(x) => std::cmp::min(x, MAX_WASM_PAGES), - // The only case where TryFromIntError can happen is when - // limit_in_pages exceeds the u32 range. In this case it is way - // larger than MAX_WASM_PAGES and needs to be capped. - Err(_too_large) => MAX_WASM_PAGES, - }; - Pages(capped) -} - -#[cfg(test)] -mod tests { - use super::*; - use wasmer::{ImportObject, Instance, Memory, Module}; - - /// A Wasm module with an exported memory (min: 4 pages, max: none) - const EXPORTED_MEMORY_WAT: &str = r#"(module - (memory 4) - (export "memory" (memory 0)) - )"#; - - #[test] - fn limit_to_pages_works() { - // rounds down - assert_eq!(limit_to_pages(Size(0)), Pages(0)); - assert_eq!(limit_to_pages(Size(1)), Pages(0)); - assert_eq!(limit_to_pages(Size::kibi(63)), Pages(0)); - assert_eq!(limit_to_pages(Size::kibi(64)), Pages(1)); - assert_eq!(limit_to_pages(Size::kibi(65)), Pages(1)); - assert_eq!(limit_to_pages(Size(u32::MAX as usize)), Pages(65535)); - // caps at 4 GiB - assert_eq!(limit_to_pages(Size::gibi(3)), Pages(49152)); - assert_eq!(limit_to_pages(Size::gibi(4)), Pages(65536)); - assert_eq!(limit_to_pages(Size::gibi(5)), Pages(65536)); - assert_eq!(limit_to_pages(Size(usize::MAX)), Pages(65536)); - } - - #[test] - fn make_compile_time_store_applies_memory_limit() { - let wasm = wat::parse_str(EXPORTED_MEMORY_WAT).unwrap(); - - // No limit - let store = make_compile_time_store(None, &[]); - let module = Module::new(&store, &wasm).unwrap(); - let module_memory = module.info().memories.last().unwrap(); - assert_eq!(module_memory.minimum, Pages(4)); - assert_eq!(module_memory.maximum, None); - let instance = Instance::new(&module, &ImportObject::new()).unwrap(); - let instance_memory: Memory = instance - .exports - .iter() - .memories() - .map(|pair| pair.1.clone()) - .next() - .unwrap(); - assert_eq!(instance_memory.ty().minimum, Pages(4)); - assert_eq!(instance_memory.ty().maximum, None); - - // Set limit - let store = make_compile_time_store(Some(Size::kibi(23 * 64)), &[]); - let module = Module::new(&store, &wasm).unwrap(); - let module_memory = module.info().memories.last().unwrap(); - assert_eq!(module_memory.minimum, Pages(4)); - assert_eq!(module_memory.maximum, None); - let instance = Instance::new(&module, &ImportObject::new()).unwrap(); - let instance_memory: Memory = instance - .exports - .iter() - .memories() - .map(|pair| pair.1.clone()) - .next() - .unwrap(); - assert_eq!(instance_memory.ty().minimum, Pages(4)); - assert_eq!(instance_memory.ty().maximum, Some(Pages(23))); - } - - #[test] - fn make_runtime_store_applies_memory_limit() { - // Compile - let serialized = { - let wasm = wat::parse_str(EXPORTED_MEMORY_WAT).unwrap(); - let store = make_compile_time_store(None, &[]); - let module = Module::new(&store, &wasm).unwrap(); - module.serialize().unwrap() - }; - - // No limit - let store = make_runtime_store(None); - let module = unsafe { Module::deserialize(&store, &serialized) }.unwrap(); - let module_memory = module.info().memories.last().unwrap(); - assert_eq!(module_memory.minimum, Pages(4)); - assert_eq!(module_memory.maximum, None); - let instance = Instance::new(&module, &ImportObject::new()).unwrap(); - let instance_memory: Memory = instance - .exports - .iter() - .memories() - .map(|pair| pair.1.clone()) - .next() - .unwrap(); - assert_eq!(instance_memory.ty().minimum, Pages(4)); - assert_eq!(instance_memory.ty().maximum, None); - - // Instantiate with limit - let store = make_runtime_store(Some(Size::kibi(23 * 64))); - let module = unsafe { Module::deserialize(&store, &serialized) }.unwrap(); - let module_memory = module.info().memories.last().unwrap(); - assert_eq!(module_memory.minimum, Pages(4)); - assert_eq!(module_memory.maximum, None); - let instance = Instance::new(&module, &ImportObject::new()).unwrap(); - let instance_memory: Memory = instance - .exports - .iter() - .memories() - .map(|pair| pair.1.clone()) - .next() - .unwrap(); - assert_eq!(instance_memory.ty().minimum, Pages(4)); - assert_eq!(instance_memory.ty().maximum, Some(Pages(23))); - } -} diff --git a/packages/vm/testdata/cyberpunk.wasm b/packages/vm/testdata/cyberpunk.wasm new file mode 100644 index 0000000000..5176c9a6c9 Binary files /dev/null and b/packages/vm/testdata/cyberpunk.wasm differ diff --git a/packages/vm/testdata/cyberpunk_rust170.wasm b/packages/vm/testdata/cyberpunk_rust170.wasm new file mode 100755 index 0000000000..3bd0b471c0 Binary files /dev/null and b/packages/vm/testdata/cyberpunk_rust170.wasm differ diff --git a/packages/vm/testdata/empty.wasm b/packages/vm/testdata/empty.wasm new file mode 100644 index 0000000000..fe3ef96899 Binary files /dev/null and b/packages/vm/testdata/empty.wasm differ diff --git a/packages/vm/testdata/floaty.wasm b/packages/vm/testdata/floaty.wasm index 8ae4d6a31d..76b5ee18c7 120000 --- a/packages/vm/testdata/floaty.wasm +++ b/packages/vm/testdata/floaty.wasm @@ -1 +1 @@ -floaty_1.0.wasm \ No newline at end of file +floaty_1.2.wasm \ No newline at end of file diff --git a/packages/vm/testdata/floaty_1.2.wasm b/packages/vm/testdata/floaty_1.2.wasm new file mode 100644 index 0000000000..653c3e884e Binary files /dev/null and b/packages/vm/testdata/floaty_1.2.wasm differ diff --git a/packages/vm/testdata/floaty_2.0.wasm b/packages/vm/testdata/floaty_2.0.wasm new file mode 100755 index 0000000000..3dd07a913e Binary files /dev/null and b/packages/vm/testdata/floaty_2.0.wasm differ diff --git a/packages/vm/testdata/hackatom.wasm b/packages/vm/testdata/hackatom.wasm deleted file mode 120000 index 76495bcd7b..0000000000 --- a/packages/vm/testdata/hackatom.wasm +++ /dev/null @@ -1 +0,0 @@ -hackatom_1.0.wasm \ No newline at end of file diff --git a/packages/vm/testdata/hackatom.wasm b/packages/vm/testdata/hackatom.wasm new file mode 100644 index 0000000000..2c7dc55ff6 Binary files /dev/null and b/packages/vm/testdata/hackatom.wasm differ diff --git a/packages/vm/testdata/hackatom_1.2.wasm b/packages/vm/testdata/hackatom_1.2.wasm new file mode 100644 index 0000000000..f15360139a Binary files /dev/null and b/packages/vm/testdata/hackatom_1.2.wasm differ diff --git a/packages/vm/testdata/hackatom_1.3.wasm b/packages/vm/testdata/hackatom_1.3.wasm new file mode 100644 index 0000000000..580f9cf136 Binary files /dev/null and b/packages/vm/testdata/hackatom_1.3.wasm differ diff --git a/packages/vm/testdata/ibc2.wasm b/packages/vm/testdata/ibc2.wasm new file mode 100755 index 0000000000..ab33e48332 Binary files /dev/null and b/packages/vm/testdata/ibc2.wasm differ diff --git a/packages/vm/testdata/ibc_callbacks.wasm b/packages/vm/testdata/ibc_callbacks.wasm new file mode 100644 index 0000000000..63519505aa Binary files /dev/null and b/packages/vm/testdata/ibc_callbacks.wasm differ diff --git a/packages/vm/testdata/ibc_reflect.wasm b/packages/vm/testdata/ibc_reflect.wasm deleted file mode 120000 index c5b6708f3d..0000000000 --- a/packages/vm/testdata/ibc_reflect.wasm +++ /dev/null @@ -1 +0,0 @@ -ibc_reflect_1.0.wasm \ No newline at end of file diff --git a/packages/vm/testdata/ibc_reflect.wasm b/packages/vm/testdata/ibc_reflect.wasm new file mode 100644 index 0000000000..1c388adfaa Binary files /dev/null and b/packages/vm/testdata/ibc_reflect.wasm differ diff --git a/packages/vm/testdata/ibc_reflect_1.2.wasm b/packages/vm/testdata/ibc_reflect_1.2.wasm new file mode 100644 index 0000000000..228bdfbfff Binary files /dev/null and b/packages/vm/testdata/ibc_reflect_1.2.wasm differ